From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:15:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:15:51 +0000 Subject: [PATCH] openbsc[master]: libbsc: document arguments of generate_bcch_chan_list() Message-ID: Review at https://gerrit.osmocom.org/4111 libbsc: document arguments of generate_bcch_chan_list() Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b --- M openbsc/src/libbsc/system_information.c 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/11/4111/1 diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index 2bc8769..c7fc4bf 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -574,7 +574,13 @@ return bitvec2freq_list(chan_list, bv, bts, false, false); } -/* generate a cell channel list as per Section 10.5.2.1b of 04.08 */ +/*! generate a cell channel list as per Section 10.5.2.22 of 04.08 + * \param[out] chan_list caller-provided output buffer + * \param[in] bts BTS descriptor used for input data + * \param[in] si5 Are we generating SI5xxx (true) or SI2xxx (false) + * \param[in] bis Are we generating SIXbis (true) or not (false) + * \param[in] ter Are we generating SIXter (true) or not (false) + */ static int generate_bcch_chan_list(uint8_t *chan_list, struct gsm_bts *bts, bool si5, bool bis, bool ter) { -- To view, visit https://gerrit.osmocom.org/4111 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:15:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:15:55 +0000 Subject: [PATCH] openbsc[master]: Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' Message-ID: Review at https://gerrit.osmocom.org/4112 Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' In masurement reports sent by the MS, this can then be used to correlate if a given measurement report was in response to a BCCH/neighbor list received on BCCH (SI2xxx) or on dowlink SACCH (SI5xxx). Closes: OS#2525 Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a --- M openbsc/src/libbsc/rest_octets.c M openbsc/src/libbsc/system_information.c M openbsc/tests/gsm0408/gsm0408_test.ok 3 files changed, 110 insertions(+), 92 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/12/4112/1 diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c index 78e7413..7b77ce2 100644 --- a/openbsc/src/libbsc/rest_octets.c +++ b/openbsc/src/libbsc/rest_octets.c @@ -361,8 +361,12 @@ bv.data_len = 20; bitvec_zero(&bv); - /* BA_IND */ - bitvec_set_bit(&bv, 1); + /* BA_IND: Set to '0' as that's what we use for SI2xxx type, + * whereas '1' is used for SI5xxx type messages. The point here + * is to be able to correlate whether a given MS measurement + * report was using the neighbor cells advertised in SI2 or in + * SI5, as those two could very well be different */ + bitvec_set_bit(&bv, 0); /* 3G_BA_IND */ bitvec_set_bit(&bv, 1); /* MP_CHANGE_MARK */ diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index c7fc4bf..abb1a6d 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -586,6 +586,7 @@ { struct gsm_bts *cur_bts; struct bitvec *bv; + int rc; if (si5 && bts->neigh_list_manual_mode == NL_MODE_MANUAL_SI5SEP) bv = &bts->si_common.si5_neigh_list; @@ -606,7 +607,20 @@ } /* then we generate a GSM 04.08 frequency list from the bitvec */ - return bitvec2freq_list(chan_list, bv, bts, bis, ter); + rc = bitvec2freq_list(chan_list, bv, bts, bis, ter); + if (rc < 0) + return rc; + + /* Set BA-IND depending on whether we're generating SI2 or SI5. + * The point here is to be able to correlate whether a given MS + * measurement report was using the neighbor cells advertised in + * SI2 or in SI5, as those two could very well be different */ + if (si5) + chan_list[0] |= 0x10; + else + chan_list[0] &= ~0x10; + + return rc; } static int list_arfcn(uint8_t *chan_list, uint8_t mask, char *text) diff --git a/openbsc/tests/gsm0408/gsm0408_test.ok b/openbsc/tests/gsm0408/gsm0408_test.ok index d30f421..8eba927 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.ok +++ b/openbsc/tests/gsm0408/gsm0408_test.ok @@ -64,141 +64,141 @@ Allocated reference: 1 Test SI2quater UARFCN (same scrambling code and diversity): generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b Testing SYSINFO_TYPE_2quater EARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... generated invalid SI2quater [00/00]: [23] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 added EARFCN 1917 - generating SI2quater for 1 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b removed EARFCN 1917 - generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated invalid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1917 - generating SI2quater for 1 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be c8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be c8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1932 - generating SI2quater for 2 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 30 14 03 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 30 14 03 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1937 - generating SI2quater for 3 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a0 a0 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a0 a0 2b 2b 2b 2b 2b 2b added EARFCN 1945 - generating SI2quater for 4 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a8 3c c8 28 0b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a8 3c c8 28 0b 2b 2b 2b added EARFCN 1965 - generating SI2quater for 5 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b added EARFCN 1967 - generating SI2quater for 6 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 04 86 59 83 d7 e0 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 04 86 59 83 d7 e0 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1982 - generating SI2quater for 7 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 04 86 59 83 d7 e4 1e fa c2 80 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 04 86 59 83 d7 e4 1e fa c2 80 2b 2b 2b 2b 2b 2b 2b 2b Testing SYSINFO_TYPE_2quater UARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... generated invalid SI2quater [00/00]: [23] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 0c 1a 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 0c 1a 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 14 1a 1f 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 14 1a 1f 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 18 58 12 f0 83 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 18 58 12 f0 83 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 20 58 2e f0 f2 03 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 20 58 2e f0 f2 03 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 28 58 2e 22 f2 4e 83 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 28 58 2e 22 f2 4e 83 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 34 1a 64 26 5d f2 05 03 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 34 1a 64 26 5d f2 05 03 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 38 58 12 22 fd ce 8e 05 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 38 58 12 22 fd ce 8e 05 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 40 58 1d 22 fa ce 88 85 7b 0b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 40 58 1d 22 fa ce 88 85 7b 0b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 9 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 4c 7a 34 0e 64 77 85 43 55 c8 0b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 4c 7a 34 0e 64 77 85 43 55 c8 0b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 10 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 50 1c 3b 31 fa dd 88 85 7b c4 1c 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 50 1c 3b 31 fa dd 88 85 7b c4 1c 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 11 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 58 1c 3b 25 7a ea 08 91 fb c4 1f b0 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 58 1c 3b 25 7a ea 08 91 fb c4 1f b0 2b 2b 2b Test SI2quater multiple UARFCNs: generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 12 7e e0 a9 44 05 3e 0b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 12 7e e0 a9 44 05 3e 0b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 ea 08 81 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 ea 08 81 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 25 52 ea 08 81 52 e8 10 3f f4 a9 75 04 a4 0b 2b 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 25 52 e8 28 81 df 7f fa 32 d4 a2 02 9f 03 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 08 81 52 e8 10 3f f4 a9 75 04 a4 0b 2b 2b 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 28 81 df 7f fa 32 d4 a2 02 9f 03 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 25 52 ea 10 81 ce a9 74 08 1f fa 54 ba 82 52 03 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 25 52 e8 30 81 d3 7f fd b2 86 54 a2 02 9f 03 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 10 81 ce a9 74 08 1f fa 54 ba 82 52 03 2b 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 30 81 d3 7f fd b2 86 54 a2 02 9f 03 2b 2b 2b Testing SYSINFO_TYPE_2quater combined EARFCN & UARFCN generation: generating SI2quater for 17 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 0c 1a 10 99 66 0f 04 83 c1 1c bb 2b 03 2b 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 0c 1a 10 99 66 0f 04 83 c1 1c bb 2b 03 2b 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 14 4d e7 00 44 b3 07 82 41 e0 8e 5d 95 83 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 14 4d e7 00 44 b3 07 82 41 e0 8e 5d 95 83 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 1c 4d e7 03 04 86 59 83 c1 20 f0 47 2e ca c1 -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 1c 4d e7 03 04 86 59 83 c1 20 f0 47 2e ca c1 +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 24 59 fa 26 73 84 86 59 83 c1 1c bb 2b 03 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 24 59 fa 26 73 84 86 59 83 c1 1c bb 2b 03 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b generating SI2quater for 17 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 2c 59 fa 30 73 f6 04 86 59 83 c1 1c bb 2b 03 -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 2c 59 fa 30 73 f6 04 86 59 83 c1 1c bb 2b 03 +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b generating SI2quater for 17 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 34 f1 ae 15 f3 f4 83 04 86 59 72 ec ac 0b 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 34 f1 ae 15 f3 f4 83 04 86 59 72 ec ac 0b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 3c f1 ae 15 f3 f4 83 01 84 86 59 72 ec ac 0b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 3c f1 ae 15 f3 f4 83 01 84 86 59 72 ec ac 0b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 c0 40 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 00 44 b3 07 82 41 -generated valid SI2quater [01/02]: [23] 59 06 07 c2 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 c4 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 00 44 b3 07 82 41 +generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 9 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 c0 40 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 10 99 66 0f 04 -generated valid SI2quater [01/02]: [23] 59 06 07 c2 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 c4 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 10 99 66 0f 04 +generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 10 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 04 12 c8 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 04 12 c8 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 11 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 5d 47 89 1e fd 7c b0 01 67 9b b3 f8 2b 2b 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 5d 47 89 1e fd 7c b0 01 67 9b b3 f8 2b 2b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b Done. -- To view, visit https://gerrit.osmocom.org/4112 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:15:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:15:55 +0000 Subject: [PATCH] openbsc[master]: gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx Message-ID: Review at https://gerrit.osmocom.org/4113 gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx This adds a test case to explicitly verify the BA-IND is as expected by the behaviour introduced in Change-Id I1cd0dc51026dcd0e508e63eea4e333e6b184787a Related: OS#2525 Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 --- M openbsc/tests/gsm0408/gsm0408_test.c M openbsc/tests/gsm0408/gsm0408_test.ok 2 files changed, 70 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/13/4113/1 diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 63b5c7c..3882f05 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -671,6 +671,67 @@ OSMO_ASSERT(res == 1); } +static void test_si_ba_ind(void) +{ + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_bts *bts = gsm_bts_alloc(network, 0); + const struct gsm48_system_information_type_2 *si2 = + (struct gsm48_system_information_type_2 *) GSM_BTS_SI(bts, SYSINFO_TYPE_2); + const struct gsm48_system_information_type_2bis *si2bis = + (struct gsm48_system_information_type_2bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_2bis); + const struct gsm48_system_information_type_2ter *si2ter = + (struct gsm48_system_information_type_2ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_2ter); + const struct gsm48_system_information_type_5 *si5 = + (struct gsm48_system_information_type_5 *) GSM_BTS_SI(bts, SYSINFO_TYPE_5); + const struct gsm48_system_information_type_5bis *si5bis = + (struct gsm48_system_information_type_5bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_5bis); + const struct gsm48_system_information_type_5ter *si5ter = + (struct gsm48_system_information_type_5ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_5ter); + + int rc; + + bts->network = network; + bts->c0->arfcn = 23; + + printf("Testing if BA-IND is set as expected in SI2xxx and SI5xxx\n"); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2); + OSMO_ASSERT(rc > 0); + printf("SI2: %s\n", osmo_hexdump((uint8_t *)si2, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2->bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2bis); + OSMO_ASSERT(rc > 0); + printf("SI2bis: %s\n", osmo_hexdump((uint8_t *)si2bis, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2bis->bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2ter); + OSMO_ASSERT(rc > 0); + printf("SI2ter: %s\n", osmo_hexdump((uint8_t *)si2ter, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2ter->ext_bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5); + OSMO_ASSERT(rc > 0); + printf("SI5: %s\n", osmo_hexdump((uint8_t *)si5, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5->bcch_frequency_list[0] & 0x10); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5bis); + OSMO_ASSERT(rc > 0); + printf("SI5bis: %s\n", osmo_hexdump((uint8_t *)si5bis, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5bis->bcch_frequency_list[0] & 0x10); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5ter); + OSMO_ASSERT(rc > 0); + printf("SI5ter: %s\n", osmo_hexdump((uint8_t *)si5ter, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5ter->bcch_frequency_list[0] & 0x10); +} + int main(int argc, char **argv) { osmo_init_logging(&log_info); @@ -691,6 +752,8 @@ test_si2q_mu(); test_si2q_long(); + test_si_ba_ind(); + printf("Done.\n"); return EXIT_SUCCESS; diff --git a/openbsc/tests/gsm0408/gsm0408_test.ok b/openbsc/tests/gsm0408/gsm0408_test.ok index 8eba927..4fff78f 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.ok +++ b/openbsc/tests/gsm0408/gsm0408_test.ok @@ -201,4 +201,11 @@ generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +Testing if BA-IND is set as expected in SI2xxx and SI5xxx +SI2: 59 06 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI2bis: 59 06 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI2ter: 59 06 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5: 06 1d 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5bis: 06 05 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5ter: 06 06 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Done. -- To view, visit https://gerrit.osmocom.org/4113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:25:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:25:08 +0000 Subject: [PATCH] osmo-bsc[master]: libbsc: document arguments of generate_bcch_chan_list() Message-ID: Review at https://gerrit.osmocom.org/4114 libbsc: document arguments of generate_bcch_chan_list() Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b --- M src/libbsc/system_information.c 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/14/4114/1 diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index fe0b23d..1ff8d04 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -576,7 +576,13 @@ return bitvec2freq_list(chan_list, bv, bts, false, false); } -/* generate a cell channel list as per Section 10.5.2.1b of 04.08 */ +/*! generate a cell channel list as per Section 10.5.2.22 of 04.08 + * \param[out] chan_list caller-provided output buffer + * \param[in] bts BTS descriptor used for input data + * \param[in] si5 Are we generating SI5xxx (true) or SI2xxx (false) + * \param[in] bis Are we generating SIXbis (true) or not (false) + * \param[in] ter Are we generating SIXter (true) or not (false) + */ static int generate_bcch_chan_list(uint8_t *chan_list, struct gsm_bts *bts, bool si5, bool bis, bool ter) { -- To view, visit https://gerrit.osmocom.org/4114 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:25:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:25:08 +0000 Subject: [PATCH] osmo-bsc[master]: Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' Message-ID: Review at https://gerrit.osmocom.org/4115 Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' In masurement reports sent by the MS, this can then be used to correlate if a given measurement report was in response to a BCCH/neighbor list received on BCCH (SI2xxx) or on dowlink SACCH (SI5xxx). Closes: OS#2525 Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a --- M src/libbsc/rest_octets.c M src/libbsc/system_information.c M tests/gsm0408/gsm0408_test.ok 3 files changed, 110 insertions(+), 92 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/15/4115/1 diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index fdab70a..a650dd1 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -361,8 +361,12 @@ bv.data_len = 20; bitvec_zero(&bv); - /* BA_IND */ - bitvec_set_bit(&bv, 1); + /* BA_IND: Set to '0' as that's what we use for SI2xxx type, + * whereas '1' is used for SI5xxx type messages. The point here + * is to be able to correlate whether a given MS measurement + * report was using the neighbor cells advertised in SI2 or in + * SI5, as those two could very well be different */ + bitvec_set_bit(&bv, 0); /* 3G_BA_IND */ bitvec_set_bit(&bv, 1); /* MP_CHANGE_MARK */ diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index 1ff8d04..3450ee6 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -588,6 +588,7 @@ { struct gsm_bts *cur_bts; struct bitvec *bv; + int rc; if (si5 && bts->neigh_list_manual_mode == NL_MODE_MANUAL_SI5SEP) bv = &bts->si_common.si5_neigh_list; @@ -608,7 +609,20 @@ } /* then we generate a GSM 04.08 frequency list from the bitvec */ - return bitvec2freq_list(chan_list, bv, bts, bis, ter); + rc = bitvec2freq_list(chan_list, bv, bts, bis, ter); + if (rc < 0) + return rc; + + /* Set BA-IND depending on whether we're generating SI2 or SI5. + * The point here is to be able to correlate whether a given MS + * measurement report was using the neighbor cells advertised in + * SI2 or in SI5, as those two could very well be different */ + if (si5) + chan_list[0] |= 0x10; + else + chan_list[0] &= ~0x10; + + return rc; } static int list_arfcn(uint8_t *chan_list, uint8_t mask, char *text) diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index d30f421..8eba927 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -64,141 +64,141 @@ Allocated reference: 1 Test SI2quater UARFCN (same scrambling code and diversity): generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b Testing SYSINFO_TYPE_2quater EARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... generated invalid SI2quater [00/00]: [23] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 added EARFCN 1917 - generating SI2quater for 1 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b removed EARFCN 1917 - generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated invalid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1917 - generating SI2quater for 1 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be c8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be c8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1932 - generating SI2quater for 2 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 30 14 03 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 30 14 03 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1937 - generating SI2quater for 3 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a0 a0 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a0 a0 2b 2b 2b 2b 2b 2b added EARFCN 1945 - generating SI2quater for 4 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a8 3c c8 28 0b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a8 3c c8 28 0b 2b 2b 2b added EARFCN 1965 - generating SI2quater for 5 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b added EARFCN 1967 - generating SI2quater for 6 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 04 86 59 83 d7 e0 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 04 86 59 83 d7 e0 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1982 - generating SI2quater for 7 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 04 86 59 83 d7 e4 1e fa c2 80 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 04 86 59 83 d7 e4 1e fa c2 80 2b 2b 2b 2b 2b 2b 2b 2b Testing SYSINFO_TYPE_2quater UARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... generated invalid SI2quater [00/00]: [23] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 0c 1a 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 0c 1a 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 14 1a 1f 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 14 1a 1f 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 18 58 12 f0 83 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 18 58 12 f0 83 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 20 58 2e f0 f2 03 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 20 58 2e f0 f2 03 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 28 58 2e 22 f2 4e 83 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 28 58 2e 22 f2 4e 83 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 34 1a 64 26 5d f2 05 03 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 34 1a 64 26 5d f2 05 03 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 38 58 12 22 fd ce 8e 05 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 38 58 12 22 fd ce 8e 05 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 40 58 1d 22 fa ce 88 85 7b 0b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 40 58 1d 22 fa ce 88 85 7b 0b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 9 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 4c 7a 34 0e 64 77 85 43 55 c8 0b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 4c 7a 34 0e 64 77 85 43 55 c8 0b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 10 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 50 1c 3b 31 fa dd 88 85 7b c4 1c 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 50 1c 3b 31 fa dd 88 85 7b c4 1c 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 11 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 58 1c 3b 25 7a ea 08 91 fb c4 1f b0 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 58 1c 3b 25 7a ea 08 91 fb c4 1f b0 2b 2b 2b Test SI2quater multiple UARFCNs: generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 12 7e e0 a9 44 05 3e 0b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 12 7e e0 a9 44 05 3e 0b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 ea 08 81 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 ea 08 81 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 25 52 ea 08 81 52 e8 10 3f f4 a9 75 04 a4 0b 2b 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 25 52 e8 28 81 df 7f fa 32 d4 a2 02 9f 03 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 08 81 52 e8 10 3f f4 a9 75 04 a4 0b 2b 2b 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 28 81 df 7f fa 32 d4 a2 02 9f 03 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 25 52 ea 10 81 ce a9 74 08 1f fa 54 ba 82 52 03 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 25 52 e8 30 81 d3 7f fd b2 86 54 a2 02 9f 03 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 10 81 ce a9 74 08 1f fa 54 ba 82 52 03 2b 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 30 81 d3 7f fd b2 86 54 a2 02 9f 03 2b 2b 2b Testing SYSINFO_TYPE_2quater combined EARFCN & UARFCN generation: generating SI2quater for 17 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 0c 1a 10 99 66 0f 04 83 c1 1c bb 2b 03 2b 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 0c 1a 10 99 66 0f 04 83 c1 1c bb 2b 03 2b 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 14 4d e7 00 44 b3 07 82 41 e0 8e 5d 95 83 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 14 4d e7 00 44 b3 07 82 41 e0 8e 5d 95 83 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 1c 4d e7 03 04 86 59 83 c1 20 f0 47 2e ca c1 -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 1c 4d e7 03 04 86 59 83 c1 20 f0 47 2e ca c1 +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 24 59 fa 26 73 84 86 59 83 c1 1c bb 2b 03 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 24 59 fa 26 73 84 86 59 83 c1 1c bb 2b 03 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b generating SI2quater for 17 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 2c 59 fa 30 73 f6 04 86 59 83 c1 1c bb 2b 03 -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 2c 59 fa 30 73 f6 04 86 59 83 c1 1c bb 2b 03 +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b generating SI2quater for 17 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 34 f1 ae 15 f3 f4 83 04 86 59 72 ec ac 0b 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 34 f1 ae 15 f3 f4 83 04 86 59 72 ec ac 0b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 3c f1 ae 15 f3 f4 83 01 84 86 59 72 ec ac 0b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 3c f1 ae 15 f3 f4 83 01 84 86 59 72 ec ac 0b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 c0 40 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 00 44 b3 07 82 41 -generated valid SI2quater [01/02]: [23] 59 06 07 c2 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 c4 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 00 44 b3 07 82 41 +generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 9 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 c0 40 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 10 99 66 0f 04 -generated valid SI2quater [01/02]: [23] 59 06 07 c2 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 c4 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 10 99 66 0f 04 +generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 10 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 04 12 c8 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 04 12 c8 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 11 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 5d 47 89 1e fd 7c b0 01 67 9b b3 f8 2b 2b 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 5d 47 89 1e fd 7c b0 01 67 9b b3 f8 2b 2b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b Done. -- To view, visit https://gerrit.osmocom.org/4115 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:25:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:25:08 +0000 Subject: [PATCH] osmo-bsc[master]: gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx Message-ID: Review at https://gerrit.osmocom.org/4116 gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx This adds a test case to explicitly verify the BA-IND is as expected by the behaviour introduced in Change-Id I1cd0dc51026dcd0e508e63eea4e333e6b184787a Related: OS#2525 Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 --- M tests/gsm0408/gsm0408_test.c M tests/gsm0408/gsm0408_test.ok 2 files changed, 70 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/16/4116/1 diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index d9ff305..8f31a83 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -672,6 +672,67 @@ } #endif +static void test_si_ba_ind(void) +{ + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_bts *bts = gsm_bts_alloc(network, 0); + const struct gsm48_system_information_type_2 *si2 = + (struct gsm48_system_information_type_2 *) GSM_BTS_SI(bts, SYSINFO_TYPE_2); + const struct gsm48_system_information_type_2bis *si2bis = + (struct gsm48_system_information_type_2bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_2bis); + const struct gsm48_system_information_type_2ter *si2ter = + (struct gsm48_system_information_type_2ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_2ter); + const struct gsm48_system_information_type_5 *si5 = + (struct gsm48_system_information_type_5 *) GSM_BTS_SI(bts, SYSINFO_TYPE_5); + const struct gsm48_system_information_type_5bis *si5bis = + (struct gsm48_system_information_type_5bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_5bis); + const struct gsm48_system_information_type_5ter *si5ter = + (struct gsm48_system_information_type_5ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_5ter); + + int rc; + + bts->network = network; + bts->c0->arfcn = 23; + + printf("Testing if BA-IND is set as expected in SI2xxx and SI5xxx\n"); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2); + OSMO_ASSERT(rc > 0); + printf("SI2: %s\n", osmo_hexdump((uint8_t *)si2, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2->bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2bis); + OSMO_ASSERT(rc > 0); + printf("SI2bis: %s\n", osmo_hexdump((uint8_t *)si2bis, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2bis->bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2ter); + OSMO_ASSERT(rc > 0); + printf("SI2ter: %s\n", osmo_hexdump((uint8_t *)si2ter, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2ter->ext_bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5); + OSMO_ASSERT(rc > 0); + printf("SI5: %s\n", osmo_hexdump((uint8_t *)si5, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5->bcch_frequency_list[0] & 0x10); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5bis); + OSMO_ASSERT(rc > 0); + printf("SI5bis: %s\n", osmo_hexdump((uint8_t *)si5bis, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5bis->bcch_frequency_list[0] & 0x10); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5ter); + OSMO_ASSERT(rc > 0); + printf("SI5ter: %s\n", osmo_hexdump((uint8_t *)si5ter, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5ter->bcch_frequency_list[0] & 0x10); +} + int main(int argc, char **argv) { osmo_init_logging(&log_info); @@ -694,6 +755,8 @@ test_si2q_mu(); test_si2q_long(); + test_si_ba_ind(); + printf("Done.\n"); return EXIT_SUCCESS; diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index 8eba927..d23cebb 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -58,10 +58,6 @@ Random range test: range 255, max num ARFCNs 22 Random range test: range 511, max num ARFCNs 18 Random range test: range 1023, max num ARFCNs 16 -testing RP-Reference wrap -Allocated reference: 255 -Allocated reference: 0 -Allocated reference: 1 Test SI2quater UARFCN (same scrambling code and diversity): generating SI2quater for 0 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b @@ -201,4 +197,11 @@ generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +Testing if BA-IND is set as expected in SI2xxx and SI5xxx +SI2: 59 06 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI2bis: 59 06 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI2ter: 59 06 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5: 06 1d 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5bis: 06 05 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5ter: 06 06 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Done. -- To view, visit https://gerrit.osmocom.org/4116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:32:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:32:19 +0000 Subject: openbsc[master]: libbsc: document arguments of generate_bcch_chan_list() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4111 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:32:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:32:41 +0000 Subject: openbsc[master]: Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4112 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:32:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:32:48 +0000 Subject: openbsc[master]: gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:35:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:35:27 +0000 Subject: [PATCH] osmo-bsc[master]: gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4116 to look at the new patch set (#2). gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx This adds a test case to explicitly verify the BA-IND is as expected by the behaviour introduced in Change-Id I1cd0dc51026dcd0e508e63eea4e333e6b184787a Related: OS#2525 Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 --- M tests/gsm0408/gsm0408_test.c M tests/gsm0408/gsm0408_test.ok 2 files changed, 70 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/16/4116/2 diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index d5a5363..72a1772 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -647,6 +647,67 @@ VERIFY(f0, ==, 1); } +static void test_si_ba_ind(void) +{ + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_bts *bts = gsm_bts_alloc(network, 0); + const struct gsm48_system_information_type_2 *si2 = + (struct gsm48_system_information_type_2 *) GSM_BTS_SI(bts, SYSINFO_TYPE_2); + const struct gsm48_system_information_type_2bis *si2bis = + (struct gsm48_system_information_type_2bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_2bis); + const struct gsm48_system_information_type_2ter *si2ter = + (struct gsm48_system_information_type_2ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_2ter); + const struct gsm48_system_information_type_5 *si5 = + (struct gsm48_system_information_type_5 *) GSM_BTS_SI(bts, SYSINFO_TYPE_5); + const struct gsm48_system_information_type_5bis *si5bis = + (struct gsm48_system_information_type_5bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_5bis); + const struct gsm48_system_information_type_5ter *si5ter = + (struct gsm48_system_information_type_5ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_5ter); + + int rc; + + bts->network = network; + bts->c0->arfcn = 23; + + printf("Testing if BA-IND is set as expected in SI2xxx and SI5xxx\n"); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2); + OSMO_ASSERT(rc > 0); + printf("SI2: %s\n", osmo_hexdump((uint8_t *)si2, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2->bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2bis); + OSMO_ASSERT(rc > 0); + printf("SI2bis: %s\n", osmo_hexdump((uint8_t *)si2bis, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2bis->bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2ter); + OSMO_ASSERT(rc > 0); + printf("SI2ter: %s\n", osmo_hexdump((uint8_t *)si2ter, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2ter->ext_bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5); + OSMO_ASSERT(rc > 0); + printf("SI5: %s\n", osmo_hexdump((uint8_t *)si5, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5->bcch_frequency_list[0] & 0x10); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5bis); + OSMO_ASSERT(rc > 0); + printf("SI5bis: %s\n", osmo_hexdump((uint8_t *)si5bis, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5bis->bcch_frequency_list[0] & 0x10); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5ter); + OSMO_ASSERT(rc > 0); + printf("SI5ter: %s\n", osmo_hexdump((uint8_t *)si5ter, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5ter->bcch_frequency_list[0] & 0x10); +} + int main(int argc, char **argv) { osmo_init_logging(&log_info); @@ -666,6 +727,8 @@ test_si2q_mu(); test_si2q_long(); + test_si_ba_ind(); + printf("Done.\n"); return EXIT_SUCCESS; diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index 8eba927..d23cebb 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -58,10 +58,6 @@ Random range test: range 255, max num ARFCNs 22 Random range test: range 511, max num ARFCNs 18 Random range test: range 1023, max num ARFCNs 16 -testing RP-Reference wrap -Allocated reference: 255 -Allocated reference: 0 -Allocated reference: 1 Test SI2quater UARFCN (same scrambling code and diversity): generating SI2quater for 0 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b @@ -201,4 +197,11 @@ generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +Testing if BA-IND is set as expected in SI2xxx and SI5xxx +SI2: 59 06 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI2bis: 59 06 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI2ter: 59 06 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5: 06 1d 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5bis: 06 05 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5ter: 06 06 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Done. -- To view, visit https://gerrit.osmocom.org/4116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:45:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:45:38 +0000 Subject: osmo-bsc[master]: libbsc: document arguments of generate_bcch_chan_list() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4114 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:45:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:45:41 +0000 Subject: osmo-bsc[master]: Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4115 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:45:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:45:44 +0000 Subject: osmo-bsc[master]: gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:45:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:45:47 +0000 Subject: [MERGED] osmo-bsc[master]: gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx ...................................................................... gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx This adds a test case to explicitly verify the BA-IND is as expected by the behaviour introduced in Change-Id I1cd0dc51026dcd0e508e63eea4e333e6b184787a Related: OS#2525 Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 --- M tests/gsm0408/gsm0408_test.c M tests/gsm0408/gsm0408_test.ok 2 files changed, 70 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index d5a5363..72a1772 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -647,6 +647,67 @@ VERIFY(f0, ==, 1); } +static void test_si_ba_ind(void) +{ + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_bts *bts = gsm_bts_alloc(network, 0); + const struct gsm48_system_information_type_2 *si2 = + (struct gsm48_system_information_type_2 *) GSM_BTS_SI(bts, SYSINFO_TYPE_2); + const struct gsm48_system_information_type_2bis *si2bis = + (struct gsm48_system_information_type_2bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_2bis); + const struct gsm48_system_information_type_2ter *si2ter = + (struct gsm48_system_information_type_2ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_2ter); + const struct gsm48_system_information_type_5 *si5 = + (struct gsm48_system_information_type_5 *) GSM_BTS_SI(bts, SYSINFO_TYPE_5); + const struct gsm48_system_information_type_5bis *si5bis = + (struct gsm48_system_information_type_5bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_5bis); + const struct gsm48_system_information_type_5ter *si5ter = + (struct gsm48_system_information_type_5ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_5ter); + + int rc; + + bts->network = network; + bts->c0->arfcn = 23; + + printf("Testing if BA-IND is set as expected in SI2xxx and SI5xxx\n"); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2); + OSMO_ASSERT(rc > 0); + printf("SI2: %s\n", osmo_hexdump((uint8_t *)si2, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2->bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2bis); + OSMO_ASSERT(rc > 0); + printf("SI2bis: %s\n", osmo_hexdump((uint8_t *)si2bis, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2bis->bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2ter); + OSMO_ASSERT(rc > 0); + printf("SI2ter: %s\n", osmo_hexdump((uint8_t *)si2ter, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2ter->ext_bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5); + OSMO_ASSERT(rc > 0); + printf("SI5: %s\n", osmo_hexdump((uint8_t *)si5, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5->bcch_frequency_list[0] & 0x10); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5bis); + OSMO_ASSERT(rc > 0); + printf("SI5bis: %s\n", osmo_hexdump((uint8_t *)si5bis, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5bis->bcch_frequency_list[0] & 0x10); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5ter); + OSMO_ASSERT(rc > 0); + printf("SI5ter: %s\n", osmo_hexdump((uint8_t *)si5ter, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5ter->bcch_frequency_list[0] & 0x10); +} + int main(int argc, char **argv) { osmo_init_logging(&log_info); @@ -666,6 +727,8 @@ test_si2q_mu(); test_si2q_long(); + test_si_ba_ind(); + printf("Done.\n"); return EXIT_SUCCESS; diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index 8eba927..d23cebb 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -58,10 +58,6 @@ Random range test: range 255, max num ARFCNs 22 Random range test: range 511, max num ARFCNs 18 Random range test: range 1023, max num ARFCNs 16 -testing RP-Reference wrap -Allocated reference: 255 -Allocated reference: 0 -Allocated reference: 1 Test SI2quater UARFCN (same scrambling code and diversity): generating SI2quater for 0 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b @@ -201,4 +197,11 @@ generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +Testing if BA-IND is set as expected in SI2xxx and SI5xxx +SI2: 59 06 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI2bis: 59 06 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI2ter: 59 06 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5: 06 1d 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5bis: 06 05 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5ter: 06 06 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Done. -- To view, visit https://gerrit.osmocom.org/4116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:45:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:45:47 +0000 Subject: [MERGED] osmo-bsc[master]: Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' ...................................................................... Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' In masurement reports sent by the MS, this can then be used to correlate if a given measurement report was in response to a BCCH/neighbor list received on BCCH (SI2xxx) or on dowlink SACCH (SI5xxx). Closes: OS#2525 Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a --- M src/libbsc/rest_octets.c M src/libbsc/system_information.c M tests/gsm0408/gsm0408_test.ok 3 files changed, 110 insertions(+), 92 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index 866734b..09c4a90 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -361,8 +361,12 @@ bv.data_len = 20; bitvec_zero(&bv); - /* BA_IND */ - bitvec_set_bit(&bv, 1); + /* BA_IND: Set to '0' as that's what we use for SI2xxx type, + * whereas '1' is used for SI5xxx type messages. The point here + * is to be able to correlate whether a given MS measurement + * report was using the neighbor cells advertised in SI2 or in + * SI5, as those two could very well be different */ + bitvec_set_bit(&bv, 0); /* 3G_BA_IND */ bitvec_set_bit(&bv, 1); /* MP_CHANGE_MARK */ diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index 65b9ccc..7bdb80a 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -588,6 +588,7 @@ { struct gsm_bts *cur_bts; struct bitvec *bv; + int rc; if (si5 && bts->neigh_list_manual_mode == NL_MODE_MANUAL_SI5SEP) bv = &bts->si_common.si5_neigh_list; @@ -608,7 +609,20 @@ } /* then we generate a GSM 04.08 frequency list from the bitvec */ - return bitvec2freq_list(chan_list, bv, bts, bis, ter); + rc = bitvec2freq_list(chan_list, bv, bts, bis, ter); + if (rc < 0) + return rc; + + /* Set BA-IND depending on whether we're generating SI2 or SI5. + * The point here is to be able to correlate whether a given MS + * measurement report was using the neighbor cells advertised in + * SI2 or in SI5, as those two could very well be different */ + if (si5) + chan_list[0] |= 0x10; + else + chan_list[0] &= ~0x10; + + return rc; } static int list_arfcn(uint8_t *chan_list, uint8_t mask, char *text) diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index d30f421..8eba927 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -64,141 +64,141 @@ Allocated reference: 1 Test SI2quater UARFCN (same scrambling code and diversity): generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b Testing SYSINFO_TYPE_2quater EARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... generated invalid SI2quater [00/00]: [23] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 added EARFCN 1917 - generating SI2quater for 1 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b removed EARFCN 1917 - generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated invalid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1917 - generating SI2quater for 1 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be c8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be c8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1932 - generating SI2quater for 2 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 30 14 03 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 30 14 03 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1937 - generating SI2quater for 3 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a0 a0 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a0 a0 2b 2b 2b 2b 2b 2b added EARFCN 1945 - generating SI2quater for 4 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a8 3c c8 28 0b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a8 3c c8 28 0b 2b 2b 2b added EARFCN 1965 - generating SI2quater for 5 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b added EARFCN 1967 - generating SI2quater for 6 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 04 86 59 83 d7 e0 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 04 86 59 83 d7 e0 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1982 - generating SI2quater for 7 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 04 86 59 83 d7 e4 1e fa c2 80 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 04 86 59 83 d7 e4 1e fa c2 80 2b 2b 2b 2b 2b 2b 2b 2b Testing SYSINFO_TYPE_2quater UARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... generated invalid SI2quater [00/00]: [23] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 0c 1a 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 0c 1a 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 14 1a 1f 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 14 1a 1f 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 18 58 12 f0 83 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 18 58 12 f0 83 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 20 58 2e f0 f2 03 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 20 58 2e f0 f2 03 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 28 58 2e 22 f2 4e 83 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 28 58 2e 22 f2 4e 83 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 34 1a 64 26 5d f2 05 03 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 34 1a 64 26 5d f2 05 03 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 38 58 12 22 fd ce 8e 05 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 38 58 12 22 fd ce 8e 05 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 40 58 1d 22 fa ce 88 85 7b 0b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 40 58 1d 22 fa ce 88 85 7b 0b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 9 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 4c 7a 34 0e 64 77 85 43 55 c8 0b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 4c 7a 34 0e 64 77 85 43 55 c8 0b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 10 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 50 1c 3b 31 fa dd 88 85 7b c4 1c 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 50 1c 3b 31 fa dd 88 85 7b c4 1c 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 11 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 58 1c 3b 25 7a ea 08 91 fb c4 1f b0 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 58 1c 3b 25 7a ea 08 91 fb c4 1f b0 2b 2b 2b Test SI2quater multiple UARFCNs: generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 12 7e e0 a9 44 05 3e 0b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 12 7e e0 a9 44 05 3e 0b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 ea 08 81 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 ea 08 81 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 25 52 ea 08 81 52 e8 10 3f f4 a9 75 04 a4 0b 2b 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 25 52 e8 28 81 df 7f fa 32 d4 a2 02 9f 03 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 08 81 52 e8 10 3f f4 a9 75 04 a4 0b 2b 2b 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 28 81 df 7f fa 32 d4 a2 02 9f 03 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 25 52 ea 10 81 ce a9 74 08 1f fa 54 ba 82 52 03 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 25 52 e8 30 81 d3 7f fd b2 86 54 a2 02 9f 03 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 10 81 ce a9 74 08 1f fa 54 ba 82 52 03 2b 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 30 81 d3 7f fd b2 86 54 a2 02 9f 03 2b 2b 2b Testing SYSINFO_TYPE_2quater combined EARFCN & UARFCN generation: generating SI2quater for 17 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 0c 1a 10 99 66 0f 04 83 c1 1c bb 2b 03 2b 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 0c 1a 10 99 66 0f 04 83 c1 1c bb 2b 03 2b 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 14 4d e7 00 44 b3 07 82 41 e0 8e 5d 95 83 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 14 4d e7 00 44 b3 07 82 41 e0 8e 5d 95 83 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 1c 4d e7 03 04 86 59 83 c1 20 f0 47 2e ca c1 -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 1c 4d e7 03 04 86 59 83 c1 20 f0 47 2e ca c1 +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 24 59 fa 26 73 84 86 59 83 c1 1c bb 2b 03 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 24 59 fa 26 73 84 86 59 83 c1 1c bb 2b 03 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b generating SI2quater for 17 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 2c 59 fa 30 73 f6 04 86 59 83 c1 1c bb 2b 03 -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 2c 59 fa 30 73 f6 04 86 59 83 c1 1c bb 2b 03 +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b generating SI2quater for 17 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 34 f1 ae 15 f3 f4 83 04 86 59 72 ec ac 0b 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 34 f1 ae 15 f3 f4 83 04 86 59 72 ec ac 0b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 3c f1 ae 15 f3 f4 83 01 84 86 59 72 ec ac 0b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 3c f1 ae 15 f3 f4 83 01 84 86 59 72 ec ac 0b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 c0 40 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 00 44 b3 07 82 41 -generated valid SI2quater [01/02]: [23] 59 06 07 c2 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 c4 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 00 44 b3 07 82 41 +generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 9 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 c0 40 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 10 99 66 0f 04 -generated valid SI2quater [01/02]: [23] 59 06 07 c2 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 c4 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 10 99 66 0f 04 +generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 10 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 04 12 c8 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 04 12 c8 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 11 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 5d 47 89 1e fd 7c b0 01 67 9b b3 f8 2b 2b 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 5d 47 89 1e fd 7c b0 01 67 9b b3 f8 2b 2b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b Done. -- To view, visit https://gerrit.osmocom.org/4115 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:45:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:45:48 +0000 Subject: [MERGED] osmo-bsc[master]: libbsc: document arguments of generate_bcch_chan_list() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libbsc: document arguments of generate_bcch_chan_list() ...................................................................... libbsc: document arguments of generate_bcch_chan_list() Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b --- M src/libbsc/system_information.c 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index c9da4b2..65b9ccc 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -576,7 +576,13 @@ return bitvec2freq_list(chan_list, bv, bts, false, false); } -/* generate a cell channel list as per Section 10.5.2.1b of 04.08 */ +/*! generate a cell channel list as per Section 10.5.2.22 of 04.08 + * \param[out] chan_list caller-provided output buffer + * \param[in] bts BTS descriptor used for input data + * \param[in] si5 Are we generating SI5xxx (true) or SI2xxx (false) + * \param[in] bis Are we generating SIXbis (true) or not (false) + * \param[in] ter Are we generating SIXter (true) or not (false) + */ static int generate_bcch_chan_list(uint8_t *chan_list, struct gsm_bts *bts, bool si5, bool bis, bool ter) { -- To view, visit https://gerrit.osmocom.org/4114 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:45:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:45:57 +0000 Subject: [MERGED] openbsc[master]: gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx ...................................................................... gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx This adds a test case to explicitly verify the BA-IND is as expected by the behaviour introduced in Change-Id I1cd0dc51026dcd0e508e63eea4e333e6b184787a Related: OS#2525 Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 --- M openbsc/tests/gsm0408/gsm0408_test.c M openbsc/tests/gsm0408/gsm0408_test.ok 2 files changed, 70 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 63b5c7c..3882f05 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -671,6 +671,67 @@ OSMO_ASSERT(res == 1); } +static void test_si_ba_ind(void) +{ + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_bts *bts = gsm_bts_alloc(network, 0); + const struct gsm48_system_information_type_2 *si2 = + (struct gsm48_system_information_type_2 *) GSM_BTS_SI(bts, SYSINFO_TYPE_2); + const struct gsm48_system_information_type_2bis *si2bis = + (struct gsm48_system_information_type_2bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_2bis); + const struct gsm48_system_information_type_2ter *si2ter = + (struct gsm48_system_information_type_2ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_2ter); + const struct gsm48_system_information_type_5 *si5 = + (struct gsm48_system_information_type_5 *) GSM_BTS_SI(bts, SYSINFO_TYPE_5); + const struct gsm48_system_information_type_5bis *si5bis = + (struct gsm48_system_information_type_5bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_5bis); + const struct gsm48_system_information_type_5ter *si5ter = + (struct gsm48_system_information_type_5ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_5ter); + + int rc; + + bts->network = network; + bts->c0->arfcn = 23; + + printf("Testing if BA-IND is set as expected in SI2xxx and SI5xxx\n"); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2); + OSMO_ASSERT(rc > 0); + printf("SI2: %s\n", osmo_hexdump((uint8_t *)si2, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2->bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2bis); + OSMO_ASSERT(rc > 0); + printf("SI2bis: %s\n", osmo_hexdump((uint8_t *)si2bis, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2bis->bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_2ter); + OSMO_ASSERT(rc > 0); + printf("SI2ter: %s\n", osmo_hexdump((uint8_t *)si2ter, rc)); + /* Validate BA-IND == 0 */ + OSMO_ASSERT(!(si2ter->ext_bcch_frequency_list[0] & 0x10)); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5); + OSMO_ASSERT(rc > 0); + printf("SI5: %s\n", osmo_hexdump((uint8_t *)si5, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5->bcch_frequency_list[0] & 0x10); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5bis); + OSMO_ASSERT(rc > 0); + printf("SI5bis: %s\n", osmo_hexdump((uint8_t *)si5bis, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5bis->bcch_frequency_list[0] & 0x10); + + rc = gsm_generate_si(bts, SYSINFO_TYPE_5ter); + OSMO_ASSERT(rc > 0); + printf("SI5ter: %s\n", osmo_hexdump((uint8_t *)si5ter, rc)); + /* Validate BA-IND == 1 */ + OSMO_ASSERT(si5ter->bcch_frequency_list[0] & 0x10); +} + int main(int argc, char **argv) { osmo_init_logging(&log_info); @@ -691,6 +752,8 @@ test_si2q_mu(); test_si2q_long(); + test_si_ba_ind(); + printf("Done.\n"); return EXIT_SUCCESS; diff --git a/openbsc/tests/gsm0408/gsm0408_test.ok b/openbsc/tests/gsm0408/gsm0408_test.ok index 8eba927..4fff78f 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.ok +++ b/openbsc/tests/gsm0408/gsm0408_test.ok @@ -201,4 +201,11 @@ generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +Testing if BA-IND is set as expected in SI2xxx and SI5xxx +SI2: 59 06 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI2bis: 59 06 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI2ter: 59 06 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5: 06 1d 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5bis: 06 05 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +SI5ter: 06 06 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Done. -- To view, visit https://gerrit.osmocom.org/4113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:45:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:45:58 +0000 Subject: [MERGED] openbsc[master]: Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' ...................................................................... Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' In masurement reports sent by the MS, this can then be used to correlate if a given measurement report was in response to a BCCH/neighbor list received on BCCH (SI2xxx) or on dowlink SACCH (SI5xxx). Closes: OS#2525 Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a --- M openbsc/src/libbsc/rest_octets.c M openbsc/src/libbsc/system_information.c M openbsc/tests/gsm0408/gsm0408_test.ok 3 files changed, 110 insertions(+), 92 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c index 78e7413..7b77ce2 100644 --- a/openbsc/src/libbsc/rest_octets.c +++ b/openbsc/src/libbsc/rest_octets.c @@ -361,8 +361,12 @@ bv.data_len = 20; bitvec_zero(&bv); - /* BA_IND */ - bitvec_set_bit(&bv, 1); + /* BA_IND: Set to '0' as that's what we use for SI2xxx type, + * whereas '1' is used for SI5xxx type messages. The point here + * is to be able to correlate whether a given MS measurement + * report was using the neighbor cells advertised in SI2 or in + * SI5, as those two could very well be different */ + bitvec_set_bit(&bv, 0); /* 3G_BA_IND */ bitvec_set_bit(&bv, 1); /* MP_CHANGE_MARK */ diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index c7fc4bf..abb1a6d 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -586,6 +586,7 @@ { struct gsm_bts *cur_bts; struct bitvec *bv; + int rc; if (si5 && bts->neigh_list_manual_mode == NL_MODE_MANUAL_SI5SEP) bv = &bts->si_common.si5_neigh_list; @@ -606,7 +607,20 @@ } /* then we generate a GSM 04.08 frequency list from the bitvec */ - return bitvec2freq_list(chan_list, bv, bts, bis, ter); + rc = bitvec2freq_list(chan_list, bv, bts, bis, ter); + if (rc < 0) + return rc; + + /* Set BA-IND depending on whether we're generating SI2 or SI5. + * The point here is to be able to correlate whether a given MS + * measurement report was using the neighbor cells advertised in + * SI2 or in SI5, as those two could very well be different */ + if (si5) + chan_list[0] |= 0x10; + else + chan_list[0] &= ~0x10; + + return rc; } static int list_arfcn(uint8_t *chan_list, uint8_t mask, char *text) diff --git a/openbsc/tests/gsm0408/gsm0408_test.ok b/openbsc/tests/gsm0408/gsm0408_test.ok index d30f421..8eba927 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.ok +++ b/openbsc/tests/gsm0408/gsm0408_test.ok @@ -64,141 +64,141 @@ Allocated reference: 1 Test SI2quater UARFCN (same scrambling code and diversity): generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b Testing SYSINFO_TYPE_2quater EARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... generated invalid SI2quater [00/00]: [23] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 added EARFCN 1917 - generating SI2quater for 1 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b removed EARFCN 1917 - generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated invalid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be e8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1917 - generating SI2quater for 1 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be c8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be c8 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1932 - generating SI2quater for 2 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 30 14 03 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 30 14 03 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1937 - generating SI2quater for 3 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a0 a0 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a0 a0 2b 2b 2b 2b 2b 2b added EARFCN 1945 - generating SI2quater for 4 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a8 3c c8 28 0b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a8 3c c8 28 0b 2b 2b 2b added EARFCN 1965 - generating SI2quater for 5 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b added EARFCN 1967 - generating SI2quater for 6 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 04 86 59 83 d7 e0 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 04 86 59 83 d7 e0 50 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b added EARFCN 1982 - generating SI2quater for 7 EARFCNs and 0 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 04 86 59 83 d7 e4 1e fa c2 80 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 04 86 59 83 be cc 1e 31 07 91 a8 3c ca 0f 5a 0a 03 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 04 86 59 83 d7 e4 1e fa c2 80 2b 2b 2b 2b 2b 2b 2b 2b Testing SYSINFO_TYPE_2quater UARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... generated invalid SI2quater [00/00]: [23] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 0c 1a 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 0c 1a 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 14 1a 1f 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 14 1a 1f 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 18 58 12 f0 83 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 18 58 12 f0 83 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 20 58 2e f0 f2 03 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 20 58 2e f0 f2 03 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 28 58 2e 22 f2 4e 83 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 28 58 2e 22 f2 4e 83 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 34 1a 64 26 5d f2 05 03 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 34 1a 64 26 5d f2 05 03 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 38 58 12 22 fd ce 8e 05 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 38 58 12 22 fd ce 8e 05 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 40 58 1d 22 fa ce 88 85 7b 0b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 40 58 1d 22 fa ce 88 85 7b 0b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 9 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 4c 7a 34 0e 64 77 85 43 55 c8 0b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 4c 7a 34 0e 64 77 85 43 55 c8 0b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 10 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 50 1c 3b 31 fa dd 88 85 7b c4 1c 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 50 1c 3b 31 fa dd 88 85 7b c4 1c 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 11 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 0f 7c 58 1c 3b 25 7a ea 08 91 fb c4 1f b0 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 58 1c 3b 25 7a ea 08 91 fb c4 1f b0 2b 2b 2b Test SI2quater multiple UARFCNs: generating SI2quater for 0 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 0a 7f 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 12 7e e0 a9 44 05 3e 0b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 12 7e e0 a9 44 05 3e 0b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 ea 08 81 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 ea 08 81 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 25 52 ea 08 81 52 e8 10 3f f4 a9 75 04 a4 0b 2b 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 25 52 e8 28 81 df 7f fa 32 d4 a2 02 9f 03 2b 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 08 81 52 e8 10 3f f4 a9 75 04 a4 0b 2b 2b 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 28 81 df 7f fa 32 d4 a2 02 9f 03 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 c0 20 25 52 ea 10 81 ce a9 74 08 1f fa 54 ba 82 52 03 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 c2 20 25 52 e8 30 81 d3 7f fd b2 86 54 a2 02 9f 03 2b 2b 2b +generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 10 81 ce a9 74 08 1f fa 54 ba 82 52 03 2b 2b +generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 30 81 d3 7f fd b2 86 54 a2 02 9f 03 2b 2b 2b Testing SYSINFO_TYPE_2quater combined EARFCN & UARFCN generation: generating SI2quater for 17 EARFCNs and 1 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 0c 1a 10 99 66 0f 04 83 c1 1c bb 2b 03 2b 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 0c 1a 10 99 66 0f 04 83 c1 1c bb 2b 03 2b 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 14 4d e7 00 44 b3 07 82 41 e0 8e 5d 95 83 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 14 4d e7 00 44 b3 07 82 41 e0 8e 5d 95 83 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 1c 4d e7 03 04 86 59 83 c1 20 f0 47 2e ca c1 -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 1c 4d e7 03 04 86 59 83 c1 20 f0 47 2e ca c1 +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c2 6c 1e 0f 60 f0 bb 08 3f d7 2e ca c1 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 20 64 21 06 e1 08 55 08 53 d7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 2a 64 21 56 e1 0a d5 08 49 d7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 25 64 21 2e e1 09 94 e5 d9 58 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 24 59 fa 26 73 84 86 59 83 c1 1c bb 2b 03 2b -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 24 59 fa 26 73 84 86 59 83 c1 1c bb 2b 03 2b +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b generating SI2quater for 17 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/04]: [23] 59 06 07 c0 80 25 0f 70 2c 59 fa 30 73 f6 04 86 59 83 c1 1c bb 2b 03 -generated valid SI2quater [01/04]: [23] 59 06 07 c2 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b -generated valid SI2quater [02/04]: [23] 59 06 07 c4 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b -generated valid SI2quater [03/04]: [23] 59 06 07 c6 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b -generated valid SI2quater [04/04]: [23] 59 06 07 c8 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b +generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 2c 59 fa 30 73 f6 04 86 59 83 c1 1c bb 2b 03 +generated valid SI2quater [01/04]: [23] 59 06 07 42 80 04 86 59 83 c1 20 f0 9b 07 83 d8 3c 2e b9 76 56 0b 2b +generated valid SI2quater [02/04]: [23] 59 06 07 44 80 04 86 59 84 1f ec 21 03 21 08 37 08 42 a7 2e ca c1 2b +generated valid SI2quater [03/04]: [23] 59 06 07 46 80 04 86 59 84 29 ec 21 53 21 0a b7 08 56 a7 2e ca c1 2b +generated valid SI2quater [04/04]: [23] 59 06 07 48 80 04 86 59 84 24 ec 21 2b 21 09 77 08 4c a7 2e ca c1 2b generating SI2quater for 17 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 34 f1 ae 15 f3 f4 83 04 86 59 72 ec ac 0b 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 34 f1 ae 15 f3 f4 83 04 86 59 72 ec ac 0b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 3c f1 ae 15 f3 f4 83 01 84 86 59 72 ec ac 0b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 3c f1 ae 15 f3 f4 83 01 84 86 59 72 ec ac 0b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 c0 40 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 00 44 b3 07 82 41 -generated valid SI2quater [01/02]: [23] 59 06 07 c2 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 c4 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 00 44 b3 07 82 41 +generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 9 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 c0 40 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 10 99 66 0f 04 -generated valid SI2quater [01/02]: [23] 59 06 07 c2 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 c4 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 10 99 66 0f 04 +generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 10 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 04 12 c8 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 04 12 c8 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 11 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 c0 a0 25 0f 70 5d 47 89 1e fd 7c b0 01 67 9b b3 f8 2b 2b 2b -generated valid SI2quater [01/05]: [23] 59 06 07 c2 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b -generated valid SI2quater [02/05]: [23] 59 06 07 c4 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b -generated valid SI2quater [03/05]: [23] 59 06 07 c6 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -generated valid SI2quater [04/05]: [23] 59 06 07 c8 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [05/05]: [23] 59 06 07 ca a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 5d 47 89 1e fd 7c b0 01 67 9b b3 f8 2b 2b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b Done. -- To view, visit https://gerrit.osmocom.org/4112 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 03:45:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 03:45:59 +0000 Subject: [MERGED] openbsc[master]: libbsc: document arguments of generate_bcch_chan_list() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libbsc: document arguments of generate_bcch_chan_list() ...................................................................... libbsc: document arguments of generate_bcch_chan_list() Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b --- M openbsc/src/libbsc/system_information.c 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index 2bc8769..c7fc4bf 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -574,7 +574,13 @@ return bitvec2freq_list(chan_list, bv, bts, false, false); } -/* generate a cell channel list as per Section 10.5.2.1b of 04.08 */ +/*! generate a cell channel list as per Section 10.5.2.22 of 04.08 + * \param[out] chan_list caller-provided output buffer + * \param[in] bts BTS descriptor used for input data + * \param[in] si5 Are we generating SI5xxx (true) or SI2xxx (false) + * \param[in] bis Are we generating SIXbis (true) or not (false) + * \param[in] ter Are we generating SIXter (true) or not (false) + */ static int generate_bcch_chan_list(uint8_t *chan_list, struct gsm_bts *bts, bool si5, bool bis, bool ter) { -- To view, visit https://gerrit.osmocom.org/4111 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:20:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:20:10 +0000 Subject: [PATCH] osmo-ggsn[master]: apn_start(): fix clean-up after errors bringing up APN Message-ID: Review at https://gerrit.osmocom.org/4117 apn_start(): fix clean-up after errors bringing up APN When there's an interim error (e.g. in resolving the link-local address or setting up the tun device), apn_start() simply calls apn_stop() on the not-yet-fully-started apn_ctx. This only works if apn_stop() doesn't bail out early in case of a not-started apn_ctx, so let's remove the related check at the start of the function. Change-Id: I2917a6258cb73cc12fd9d81296ff0eaa616890b9 --- M ggsn/ggsn.c 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/17/4117/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 462b395..c1f0c1a 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -112,9 +112,6 @@ int apn_stop(struct apn_ctx *apn, bool force) { - if (!apn->started) - return 0; - LOGPAPN(LOGL_NOTICE, apn, "%sStopping\n", force ? "FORCED " : ""); /* check if pools have any active PDP contexts and bail out */ pool_close_all_pdp(apn->v4.pool); -- To view, visit https://gerrit.osmocom.org/4117 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2917a6258cb73cc12fd9d81296ff0eaa616890b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:20:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:20:10 +0000 Subject: [PATCH] osmo-ggsn[master]: create_context_ind(): ignore any non-started APNs Message-ID: Review at https://gerrit.osmocom.org/4118 create_context_ind(): ignore any non-started APNs If we receive a GTP-C CREATE PDP CONTEXT for an APN that we were unable (or not configured) to start, ignore that APN. Change-Id: I8011a9ccc1d5effd3779f184c9055af46838ccaf --- M ggsn/ggsn.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/18/4118/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c1f0c1a..dd71957 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -447,6 +447,9 @@ /* First find an exact APN name match */ apn = ggsn_find_apn(ggsn, name_buf); + /* ignore if the APN has not been started */ + if (!apn->started) + apn = NULL; /* then try default (if any) */ if (!apn) apn = ggsn->cfg.default_apn; -- To view, visit https://gerrit.osmocom.org/4118 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8011a9ccc1d5effd3779f184c9055af46838ccaf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:20:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:20:10 +0000 Subject: [PATCH] osmo-ggsn[master]: apn_stop(): Print tun device name when closing tun device Message-ID: Review at https://gerrit.osmocom.org/4119 apn_stop(): Print tun device name when closing tun device Change-Id: If981cc0696122cb69c01ceac6f54ae01bcbf4a2d --- M ggsn/ggsn.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/19/4119/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index dd71957..bafcb1b 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -125,7 +125,7 @@ tun_runscript(apn->tun.tun, apn->tun.cfg.ipdown_script); } /* release tun device */ - LOGPAPN(LOGL_INFO, apn, "Closing TUN device\n"); + LOGPAPN(LOGL_INFO, apn, "Closing TUN device %s\n", apn->tun.tun->devname); osmo_fd_unregister(&apn->tun.fd); tun_free(apn->tun.tun); apn->tun.tun = NULL; -- To view, visit https://gerrit.osmocom.org/4119 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If981cc0696122cb69c01ceac6f54ae01bcbf4a2d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:20:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:20:10 +0000 Subject: [PATCH] osmo-ggsn[master]: apn_start(): Extend error message when setting IPv6 address ... Message-ID: Review at https://gerrit.osmocom.org/4120 apn_start(): Extend error message when setting IPv6 address fails Tell the user about possible causes of failure to set the IPv6 address of the tun device, such as general lack of IPv6 support in the kernel/OS, or the use of /proc/sys/net/ipv6/conf/default/disable_ipv6 Change-Id: I5ff812425ee12b8386bb66521e05c93e825a4506 --- M ggsn/ggsn.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/20/4120/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index bafcb1b..f8aec9d 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -186,7 +186,8 @@ in46p_ntoa(&apn->v6.cfg.ifconfig_prefix)); if (tun_setaddr(apn->tun.tun, &apn->v6.cfg.ifconfig_prefix.addr, NULL, apn->v6.cfg.ifconfig_prefix.prefixlen)) { - LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv6 address %s: %s\n", + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv6 address %s: %s. " + "Ensure you have ipv6 support and not used the disable_ipv6 sysctl?\n", in46p_ntoa(&apn->v6.cfg.ifconfig_prefix), strerror(errno)); apn_stop(apn, false); return -1; -- To view, visit https://gerrit.osmocom.org/4120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ff812425ee12b8386bb66521e05c93e825a4506 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:21:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:21:15 +0000 Subject: osmo-ggsn[master]: apn_start(): fix clean-up after errors bringing up APN In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4117 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2917a6258cb73cc12fd9d81296ff0eaa616890b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:21:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:21:27 +0000 Subject: osmo-ggsn[master]: create_context_ind(): ignore any non-started APNs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4118 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8011a9ccc1d5effd3779f184c9055af46838ccaf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:21:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:21:36 +0000 Subject: osmo-ggsn[master]: apn_stop(): Print tun device name when closing tun device In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4119 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If981cc0696122cb69c01ceac6f54ae01bcbf4a2d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:21:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:21:48 +0000 Subject: osmo-ggsn[master]: apn_start(): Extend error message when setting IPv6 address ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ff812425ee12b8386bb66521e05c93e825a4506 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:22:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:22:22 +0000 Subject: osmo-ggsn[master]: Replace EUA magic numbers for IETF, IPv4 and IPv6 with #defines In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33f65e404217e717bd795e5229c8d9456a7b3739 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:22:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:22:56 +0000 Subject: osmo-ggsn[master]: sgsnemu: Allow specification of PDP (EUA) Type IPv4 or IPv6 In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I157f9157a7ff2ea56c37a4a902d4706de4c7d35d Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:23:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:23:30 +0000 Subject: osmo-ggsn[master]: sgsnemu: Add IPv6 support via tun device and "-t v6 --createif" In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:23:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:23:45 +0000 Subject: [MERGED] osmo-ggsn[master]: apn_stop(): Print tun device name when closing tun device In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: apn_stop(): Print tun device name when closing tun device ...................................................................... apn_stop(): Print tun device name when closing tun device Change-Id: If981cc0696122cb69c01ceac6f54ae01bcbf4a2d --- M ggsn/ggsn.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index dd71957..bafcb1b 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -125,7 +125,7 @@ tun_runscript(apn->tun.tun, apn->tun.cfg.ipdown_script); } /* release tun device */ - LOGPAPN(LOGL_INFO, apn, "Closing TUN device\n"); + LOGPAPN(LOGL_INFO, apn, "Closing TUN device %s\n", apn->tun.tun->devname); osmo_fd_unregister(&apn->tun.fd); tun_free(apn->tun.tun); apn->tun.tun = NULL; -- To view, visit https://gerrit.osmocom.org/4119 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If981cc0696122cb69c01ceac6f54ae01bcbf4a2d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:23:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:23:45 +0000 Subject: [MERGED] osmo-ggsn[master]: apn_start(): Extend error message when setting IPv6 address ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: apn_start(): Extend error message when setting IPv6 address fails ...................................................................... apn_start(): Extend error message when setting IPv6 address fails Tell the user about possible causes of failure to set the IPv6 address of the tun device, such as general lack of IPv6 support in the kernel/OS, or the use of /proc/sys/net/ipv6/conf/default/disable_ipv6 Change-Id: I5ff812425ee12b8386bb66521e05c93e825a4506 --- M ggsn/ggsn.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index bafcb1b..f8aec9d 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -186,7 +186,8 @@ in46p_ntoa(&apn->v6.cfg.ifconfig_prefix)); if (tun_setaddr(apn->tun.tun, &apn->v6.cfg.ifconfig_prefix.addr, NULL, apn->v6.cfg.ifconfig_prefix.prefixlen)) { - LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv6 address %s: %s\n", + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv6 address %s: %s. " + "Ensure you have ipv6 support and not used the disable_ipv6 sysctl?\n", in46p_ntoa(&apn->v6.cfg.ifconfig_prefix), strerror(errno)); apn_stop(apn, false); return -1; -- To view, visit https://gerrit.osmocom.org/4120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ff812425ee12b8386bb66521e05c93e825a4506 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:23:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:23:46 +0000 Subject: [MERGED] osmo-ggsn[master]: create_context_ind(): ignore any non-started APNs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: create_context_ind(): ignore any non-started APNs ...................................................................... create_context_ind(): ignore any non-started APNs If we receive a GTP-C CREATE PDP CONTEXT for an APN that we were unable (or not configured) to start, ignore that APN. Change-Id: I8011a9ccc1d5effd3779f184c9055af46838ccaf --- M ggsn/ggsn.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c1f0c1a..dd71957 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -447,6 +447,9 @@ /* First find an exact APN name match */ apn = ggsn_find_apn(ggsn, name_buf); + /* ignore if the APN has not been started */ + if (!apn->started) + apn = NULL; /* then try default (if any) */ if (!apn) apn = ggsn->cfg.default_apn; -- To view, visit https://gerrit.osmocom.org/4118 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8011a9ccc1d5effd3779f184c9055af46838ccaf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:23:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:23:46 +0000 Subject: [MERGED] osmo-ggsn[master]: apn_start(): fix clean-up after errors bringing up APN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: apn_start(): fix clean-up after errors bringing up APN ...................................................................... apn_start(): fix clean-up after errors bringing up APN When there's an interim error (e.g. in resolving the link-local address or setting up the tun device), apn_start() simply calls apn_stop() on the not-yet-fully-started apn_ctx. This only works if apn_stop() doesn't bail out early in case of a not-started apn_ctx, so let's remove the related check at the start of the function. Change-Id: I2917a6258cb73cc12fd9d81296ff0eaa616890b9 --- M ggsn/ggsn.c 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 462b395..c1f0c1a 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -112,9 +112,6 @@ int apn_stop(struct apn_ctx *apn, bool force) { - if (!apn->started) - return 0; - LOGPAPN(LOGL_NOTICE, apn, "%sStopping\n", force ? "FORCED " : ""); /* check if pools have any active PDP contexts and bail out */ pool_close_all_pdp(apn->v4.pool); -- To view, visit https://gerrit.osmocom.org/4117 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2917a6258cb73cc12fd9d81296ff0eaa616890b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:23:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:23:50 +0000 Subject: [MERGED] osmo-ggsn[master]: Replace EUA magic numbers for IETF, IPv4 and IPv6 with #defines In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Replace EUA magic numbers for IETF, IPv4 and IPv6 with #defines ...................................................................... Replace EUA magic numbers for IETF, IPv4 and IPv6 with #defines Change-Id: I33f65e404217e717bd795e5229c8d9456a7b3739 --- M gtp/gtp.c M gtp/pdp.c M gtp/pdp.h M lib/in46_addr.c 4 files changed, 17 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index fee49b5..3051aaa 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3259,8 +3259,8 @@ int ipv42eua(struct ul66_t *eua, struct in_addr *src) { - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x21; /* IPv4 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v4; if (src) { eua->l = 6; memcpy(&eua->v[2], src, 4); @@ -3272,7 +3272,7 @@ int eua2ipv4(struct in_addr *dst, struct ul66_t *eua) { - if ((eua->l != 6) || (eua->v[0] != 0xf1) || (eua->v[1] = 0x21)) + if ((eua->l != 6) || (eua->v[0] != PDP_EUA_ORG_IETF) || (eua->v[1] != PDP_EUA_TYPE_v4)) return -1; /* Not IPv4 address */ memcpy(dst, &eua->v[2], 4); return 0; diff --git a/gtp/pdp.c b/gtp/pdp.c index d3e9232..b1e1ff3 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -367,15 +367,15 @@ int pdp_ntoeua(struct in_addr *src, struct ul66_t *eua) { eua->l = 6; - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x21; /* IPv4 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v4; memcpy(&eua->v[2], src, 4); /* Copy a 4 byte address */ return 0; } int pdp_euaton(struct ul66_t *eua, struct in_addr *dst) { - if ((eua->l != 6) || (eua->v[0] != 0xf1) || (eua->v[1] != 0x21)) { + if ((eua->l != 6) || (eua->v[0] != PDP_EUA_ORG_IETF) || (eua->v[1] != PDP_EUA_TYPE_v4)) { return EOF; } memcpy(dst, &eua->v[2], 4); /* Copy a 4 byte address */ diff --git a/gtp/pdp.h b/gtp/pdp.h index 106d544..f1d8ad6 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -23,6 +23,10 @@ #define PDP_MAX 1024 /* Max number of PDP contexts */ #define PDP_MAXNSAPI 16 /* Max number of NSAPI */ +#define PDP_EUA_ORG_IETF 0xF1 +#define PDP_EUA_TYPE_v4 0x21 +#define PDP_EUA_TYPE_v6 0x57 + /* GTP Information elements from 29.060 v3.9.0 7.7 Information Elements */ /* Also covers version 0. Note that version 0 6: QOS Profile was superceded * * by 135: QOS Profile in version 1 */ diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 4b5fd64..f78a40b 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -10,6 +10,7 @@ */ #include "../lib/in46_addr.h" +#include "../gtp/pdp.h" #include @@ -201,15 +202,15 @@ switch (src->len) { case 4: eua->l = 6; - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x21; /* IPv4 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v4; memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */ break; case 8: case 16: eua->l = 18; - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x57; /* IPv6 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v6; memcpy(&eua->v[2], &src->v6, 16); /* Copy a 16 byte address */ break; default: @@ -230,14 +231,14 @@ return -1; switch (eua->v[1]) { - case 0x21: + case PDP_EUA_TYPE_v4: dst->len = 4; if (eua->l >= 6) memcpy(&dst->v4, &eua->v[2], 4); /* Copy a 4 byte address */ else dst->v4.s_addr = 0; break; - case 0x57: + case PDP_EUA_TYPE_v6: dst->len = 16; if (eua->l >= 18) memcpy(&dst->v6, &eua->v[2], 16); /* Copy a 16 byte address */ -- To view, visit https://gerrit.osmocom.org/4045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I33f65e404217e717bd795e5229c8d9456a7b3739 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:24:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:24:59 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Allow specification of PDP (EUA) Type IPv4 or IPv6 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Allow specification of PDP (EUA) Type IPv4 or IPv6 ...................................................................... sgsnemu: Allow specification of PDP (EUA) Type IPv4 or IPv6 This just adds the capability to sgsnemu to request a certain PDP EUA type. It doesn't mean it actually handles anything beyond the existing IPv4 yet. Change-Id: I157f9157a7ff2ea56c37a4a902d4706de4c7d35d --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h M sgsnemu/sgsnemu.c 4 files changed, 44 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 6df8fc1..60c0a25 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -76,6 +76,7 @@ " --pingcount=INT Number of ping req to send (default=`0')", " --pingquiet Do not print ping packet info (default=off)", " --no-tx-gpdu-seq Don't transmit G-PDU sequence nums\n (default=off)", + " -t, --pdp-type=(v4|v6) PDP Type (default=`v4')", 0 }; @@ -161,6 +162,7 @@ args_info->pingcount_given = 0; args_info->pingquiet_given = 0; args_info->no_tx_gpdu_seq_given = 0; + args_info->pdp_type_given = 0; } static @@ -241,6 +243,8 @@ args_info->pingcount_orig = NULL; args_info->pingquiet_flag = 0; args_info->no_tx_gpdu_seq_flag = 0; + args_info->pdp_type_arg = gengetopt_strdup("v4"); + args_info->pdp_type_orig = NULL; } @@ -290,6 +294,7 @@ args_info->pingcount_help = gengetopt_args_info_help[39]; args_info->pingquiet_help = gengetopt_args_info_help[40]; args_info->no_tx_gpdu_seq_help = gengetopt_args_info_help[41]; + args_info->pdp_type_help = gengetopt_args_info_help[42]; } @@ -419,6 +424,8 @@ free_string_field(&(args_info->pingrate_orig)); free_string_field(&(args_info->pingsize_orig)); free_string_field(&(args_info->pingcount_orig)); + free_string_field(&(args_info->pdp_type_arg)); + free_string_field(&(args_info->pdp_type_orig)); clear_given(args_info); } @@ -538,6 +545,9 @@ write_into_file(outfile, "pingquiet", 0, 0); if (args_info->no_tx_gpdu_seq_given) write_into_file(outfile, "no-tx-gpdu-seq", 0, 0); + if (args_info->pdp_type_given) + write_into_file(outfile, "pdp-type", args_info->pdp_type_orig, + 0); i = EXIT_SUCCESS; return i; @@ -833,10 +843,11 @@ {"pingcount", 1, NULL, 0}, {"pingquiet", 0, NULL, 0}, {"no-tx-gpdu-seq", 0, NULL, 0}, + {"pdp-type", 1, NULL, 't'}, {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "hVdc:l:r:a:i:m:q:u:p:n:", + c = getopt_long(argc, argv, "hVdc:l:r:a:i:m:q:u:p:n:t:", long_options, &option_index); if (c == -1) @@ -982,6 +993,18 @@ goto failure; break; + case 't': /* PDP Type. */ + + if (update_arg((void *)&(args_info->pdp_type_arg), + &(args_info->pdp_type_orig), + &(args_info->pdp_type_given), + &(local_args_info.pdp_type_given), + optarg, 0, "v4", ARG_STRING, + check_ambiguity, override, 0, 0, + "pdp-type", 't', additional_error)) + goto failure; + + break; case 0: /* Long option with no short option */ /* Filename of process id file. */ diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index a2681f1..d8b3c26 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -61,3 +61,4 @@ option "pingcount" - "Number of ping req to send" int default="0" no option "pingquiet" - "Do not print ping packet info" flag off option "no-tx-gpdu-seq" - "Don't transmit G-PDU sequence nums" flag off +option "pdp-type" t "PDP Type" string default="v4" no typestr="(v4|v6)" diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 38db7da..1accfd0 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -268,6 +268,12 @@ /**< @brief Don't transmit G-PDU sequence nums (default=off). */ const char *no_tx_gpdu_seq_help; /**< @brief Don't transmit G-PDU sequence nums help description. */ + char *pdp_type_arg; + /**< @brief PDP Type (default='v4'). */ + char *pdp_type_orig; + /**< @brief PDP Type original value given at command line. */ + const char *pdp_type_help; + /**< @brief PDP Type help description. */ unsigned int help_given; /**< @brief Whether help was given. */ @@ -353,6 +359,8 @@ /**< @brief Whether pingquiet was given. */ unsigned int no_tx_gpdu_seq_given; /**< @brief Whether no-tx-gpdu-seq was given. */ + unsigned int pdp_type_given; + /**< @brief Whether pdp-type was given. */ }; diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 4cc2021..c181603 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -118,6 +118,7 @@ struct ul16_t msisdn; int norecovery_given; int tx_gpdu_seq; + uint8_t pdp_type; } options; /* Definitions to use for PING. Most of the ping code was derived from */ @@ -926,6 +927,12 @@ else options.tx_gpdu_seq = 1; + /* PDP Type */ + if (!strcmp(args_info.pdp_type_arg, "v6")) + options.pdp_type = PDP_EUA_TYPE_v6; + else + options.pdp_type = PDP_EUA_TYPE_v4; + return 0; } @@ -1580,7 +1587,10 @@ msisdn_add(&options.msisdn, &pdp->msisdn, n); } - ipv42eua(&pdp->eua, NULL); /* Request dynamic IP address */ + /* Request dynamic IP address */ + pdp->eua.v[0] = PDP_EUA_ORG_IETF; + pdp->eua.v[1] = options.pdp_type; + pdp->eua.l = 2; if (options.pco.l > sizeof(pdp->pco_req.v)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, -- To view, visit https://gerrit.osmocom.org/4046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I157f9157a7ff2ea56c37a4a902d4706de4c7d35d Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:29:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:29:58 +0000 Subject: [PATCH] osmo-ggsn[master]: create_context_ind(): ignore a non-started default APN Message-ID: Review at https://gerrit.osmocom.org/4121 create_context_ind(): ignore a non-started default APN If the default APN has not been started, it is not eligible to be used in starting of new PDP contexts. Change-Id: I93b5c205c033f275824ee8bc8cdcf1428fb086df --- M ggsn/ggsn.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/21/4121/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index f8aec9d..5852ef6 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -451,9 +451,14 @@ /* ignore if the APN has not been started */ if (!apn->started) apn = NULL; + /* then try default (if any) */ if (!apn) apn = ggsn->cfg.default_apn; + /* ignore if the APN has not been started */ + if (!apn->started) + apn = NULL; + if (!apn) { /* no APN found for what user requested */ LOGPPDP(LOGL_NOTICE, pdp, "Unknown APN '%s', rejecting\n", name_buf); -- To view, visit https://gerrit.osmocom.org/4121 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93b5c205c033f275824ee8bc8cdcf1428fb086df Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:30:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:30:52 +0000 Subject: osmo-ggsn[master]: create_context_ind(): ignore a non-started default APN In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4121 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93b5c205c033f275824ee8bc8cdcf1428fb086df Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 1 10:31:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Oct 2017 10:31:09 +0000 Subject: [MERGED] osmo-ggsn[master]: create_context_ind(): ignore a non-started default APN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: create_context_ind(): ignore a non-started default APN ...................................................................... create_context_ind(): ignore a non-started default APN If the default APN has not been started, it is not eligible to be used in starting of new PDP contexts. Change-Id: I93b5c205c033f275824ee8bc8cdcf1428fb086df --- M ggsn/ggsn.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index f8aec9d..5852ef6 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -451,9 +451,14 @@ /* ignore if the APN has not been started */ if (!apn->started) apn = NULL; + /* then try default (if any) */ if (!apn) apn = ggsn->cfg.default_apn; + /* ignore if the APN has not been started */ + if (!apn->started) + apn = NULL; + if (!apn) { /* no APN found for what user requested */ LOGPPDP(LOGL_NOTICE, pdp, "Unknown APN '%s', rejecting\n", name_buf); -- To view, visit https://gerrit.osmocom.org/4121 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I93b5c205c033f275824ee8bc8cdcf1428fb086df Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Sun Oct 1 12:14:28 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 01 Oct 2017 12:14:28 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59d0dc2a617df_368bb44f7477519c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.04/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 273s] -[..] Encoding / Decoding cycle : OK [ 273s] -[..] Encoding / Decoding cycle : OK [ 273s] -[..] Encoding / Decoding cycle : OK [ 273s] - [ 273s] -[+] Testing: gsm0503_mcs9 [ 273s] -[.] Input length : ret = 606 exp = 606 -> OK [ 273s] -[.] Output length : ret = 1836 exp = 1836 -> OK [ 273s] -[.] Random vector checks: [ 273s] -[..] Encoding / Decoding cycle : OK [ 273s] -[..] Encoding / Decoding cycle : OK [ 273s] -[..] Encoding / Decoding cycle : OK [ 273s] - [ 273s] ./testsuite.at:57: exit code was 132, expected 0 [ 273s] 9. testsuite.at:54: 9. conv_gsm0503 (testsuite.at:54): FAILED (testsuite.at:57) [ 273s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 273s] make[1]: *** [override_dh_auto_test] Error 1 [ 273s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 273s] debian/rules:15: recipe for target 'build' failed [ 273s] make: *** [build] Error 2 [ 273s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 273s] [ 273s] build35 failed "build libosmocore_0.9.6.20171001.dsc" at Sun Oct 1 12:14:22 UTC 2017. [ 273s] [ 273s] ### VM INTERACTION START ### [ 275s] [ 264.644500] reboot: Power down [ 276s] ### VM INTERACTION END ### [ 276s] [ 276s] build35 failed "build libosmocore_0.9.6.20171001.dsc" at Sun Oct 1 12:14:26 UTC 2017. [ 276s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 1 12:14:28 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 01 Oct 2017 12:14:28 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59d0dc2ba333e_368bb44f7477537b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/x86_64 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 276s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 276s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 276s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 276s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 276s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 276s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 276s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 276s] -Success [ 276s] ./testsuite.at:63: exit code was 132, expected 0 [ 276s] 10. testsuite.at:60: 10. coding (testsuite.at:60): FAILED (testsuite.at:63) [ 276s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 276s] make[1]: *** [override_dh_auto_test] Error 1 [ 276s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 276s] debian/rules:15: recipe for target 'build' failed [ 276s] make: *** [build] Error 2 [ 276s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 276s] [ 276s] build35 failed "build libosmocore_0.9.6.20171001.dsc" at Sun Oct 1 12:14:13 UTC 2017. [ 276s] [ 276s] ### VM INTERACTION START ### [ 276s] [ 259.004089] serial8250: too much work for irq4 [ 276s] [ 259.072917] serial8250: too much work for irq4 [ 276s] [ 259.224060] serial8250: too much work for irq4 [ 276s] [ 259.300144] serial8250: too much work for irq4 [ 279s] [ 262.531117] reboot: Power down [ 281s] ### VM INTERACTION END ### [ 282s] [ 282s] build35 failed "build libosmocore_0.9.6.20171001.dsc" at Sun Oct 1 12:14:21 UTC 2017. [ 282s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 1 12:30:10 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 01 Oct 2017 12:30:10 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59d0dfe67e09f_368bb44f7478474e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 71s] bsc_vty.c:321:45: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 5 has type 'int' [-Wformat=] [ 71s] vty_out(vty, " %llu days %llu hours %llu min. %llu sec.%s", [ 71s] ^ [ 72s] cc1: some warnings being treated as errors [ 72s] Makefile:521: recipe for target 'bsc_vty.o' failed [ 72s] make[4]: *** [bsc_vty.o] Error 1 [ 72s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/src/libbsc' [ 72s] Makefile:456: recipe for target 'all-recursive' failed [ 72s] make[3]: *** [all-recursive] Error 1 [ 72s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src' [ 72s] Makefile:527: recipe for target 'all-recursive' failed [ 72s] make[2]: *** [all-recursive] Error 1 [ 72s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 72s] Makefile:436: recipe for target 'all' failed [ 72s] make[1]: *** [all] Error 2 [ 72s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 72s] dh_auto_build: make -j1 returned exit code 2 [ 72s] debian/rules:13: recipe for target 'build' failed [ 72s] make: *** [build] Error 2 [ 72s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 72s] [ 72s] build77 failed "build openbsc_0.15.1.20171001.dsc" at Sun Oct 1 12:29:57 UTC 2017. [ 72s] [ 72s] ### VM INTERACTION START ### [ 75s] [ 69.806535] reboot: Power down [ 75s] ### VM INTERACTION END ### [ 75s] [ 75s] build77 failed "build openbsc_0.15.1.20171001.dsc" at Sun Oct 1 12:30:00 UTC 2017. [ 75s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sun Oct 1 23:03:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 1 Oct 2017 23:03:54 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 7: (2 comments) https://gerrit.osmocom.org/#/c/4003/7/src/libosmo-mgcp/mgcp_vty.c File src/libosmo-mgcp/mgcp_vty.c: Line 1083: whitespace Line 1084: return CMD_SUCCESS; CMD_WARNING? -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 7 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 1 23:23:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 1 Oct 2017 23:23:07 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 7: (17 comments) I did not take a close look at function, but so far spotted a number of cosmetics... it's also a lot, can't read all of it now. https://gerrit.osmocom.org/#/c/4003/7/include/osmocom/mgcp/mgcp.h File include/osmocom/mgcp/mgcp.h: Line 36: #define RTP_PORT_DEFAULT_RANGE_START 16002 is 16002 a backwards compat consideration? rather start at 16000? https://gerrit.osmocom.org/#/c/4003/7/include/osmocom/mgcp/mgcp_internal.h File include/osmocom/mgcp/mgcp_internal.h: Line 324: /*! \brief get the ip-address where the mgw application is bound on let's not introduce more \brief comments. Firstly, we don't have doxygen here yet, secondly, in libosmocore we use AUTOBRIEF now. Hence just end the first sentence in a dot (as always!) and any future doxygen will use that as \brief implicitly. see https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation https://gerrit.osmocom.org/#/c/4003/7/include/osmocom/mgcp/mgcp_msg.h File include/osmocom/mgcp/mgcp_msg.h: Line 4: /* I guess we should add a sysmocom copyright including 2017 in it https://gerrit.osmocom.org/#/c/4003/7/include/osmocom/mgcp/mgcp_stat.h File include/osmocom/mgcp/mgcp_stat.h: Line 4: /* 2017? https://gerrit.osmocom.org/#/c/4003/7/include/osmocom/mgcp/osmux.h File include/osmocom/mgcp/osmux.h: Line 2: #define _OPENBSC_OSMUX_H_ (at some point we want to replace this with #pragma once and drop the OPENBSC name) https://gerrit.osmocom.org/#/c/4003/7/src/libosmo-mgcp/mgcp_conn.c File src/libosmo-mgcp/mgcp_conn.c: Line 73: /*! \brief allocate a new connection list entry (no \brief as before, also below) https://gerrit.osmocom.org/#/c/4003/7/src/libosmo-mgcp/mgcp_ep.c File src/libosmo-mgcp/mgcp_ep.c: Line 27: /* Endpoint typeset definistion */ definistion https://gerrit.osmocom.org/#/c/4003/7/src/libosmo-mgcp/mgcp_msg.c File src/libosmo-mgcp/mgcp_msg.c: Line 4: /* 2017? Line 71: /*! \brief Parse connection mode. brief https://gerrit.osmocom.org/#/c/4003/7/src/libosmo-mgcp/mgcp_network.c File src/libosmo-mgcp/mgcp_network.c: Line 55: * 1/unit seconds. */ (I know this just changes the comment style; noticing that I don't fully get what 1/unit means, maybe an example would be good) Line 76: /*! \brief send udp packet. brief Line 89: len, inet_ntoa(*addr), ntohs(port)); printing int len as %u, probably causes compiler to warn Line 190: (int16_t) (seq - sstate->last_seq); is this lindent again? let's rather not do this whitespace change. Line 220: ts_aligment_error(sstate, state->packet_duration, timestamp); aligment? interestingly, the old function also was misspelled. should be "alignment" Line 232: (int32_t) (timestamp - sstate->last_timestamp), lindent Line 304: state->timestamp_offset); also unnecessary ws changes Line 321: 0); whitespace changes -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 7 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From admin at opensuse.org Mon Oct 2 03:50:44 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 02 Oct 2017 03:50:44 +0000 Subject: Build failure of network:osmocom:nightly/libsmpp34 in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59d1b7a9ea8d_368bb44f7494751b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libsmpp34/Debian_9.0/x86_64 Package network:osmocom:nightly/libsmpp34 failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libsmpp34 Last lines of build log: [ 20s] Processing triggers for libc-bin (2.24-11+deb9u1) ... [ 21s] [41/195] installing libnghttp2-14-1.18.1-1 [ 21s] Processing triggers for libc-bin (2.24-11+deb9u1) ... [ 21s] [42/195] installing libpipeline1-1.4.1-2 [ 21s] Processing triggers for libc-bin (2.24-11+deb9u1) ... [ 21s] [43/195] installing libsepol1-2.6-2 [ 21s] Processing triggers for libc-bin (2.24-11+deb9u1) ... [ 21s] [44/195] installing libsigsegv2-2.10-5 [ 21s] Processing triggers for libc-bin (2.24-11+deb9u1) ... [ 21s] [45/195] installing libslang2-2.3.1-5 [ 21s] Processing triggers for libc-bin (2.24-11+deb9u1) ... [ 21s] [46/195] installing libsmartcols1-2.29.2-1 [ 21s] Processing triggers for libc-bin (2.24-11+deb9u1) ... [ 21s] [47/195] installing libtasn1-6-4.10-1.1 [ 21s] Processing triggers for libc-bin (2.24-11+deb9u1) ... [ 22s] [48/195] installing libtinfo5-6.0+20161126-1 [ 22s] Processing triggers for libc-bin (2.24-11+deb9u1) ... [ 22s] [49/195] installing libudev1-232-25+deb9u1 [ 22s] Processing triggers for libc-bin (2.24-11+deb9u1) ... [ 22s] [50/195] installing libunistring0-0.9.6+really0.9.3-0.1 [ 22s] Processing triggers for libc-bin (2.24-11+deb9u1) ... [ 22s] [51/195] installing libustr-1.0-1-1.0.4-6 [28826s] qemu-system-x86_64: terminating on signal 15 from pid 18776 () [28826s] ### VM INTERACTION END ### [28826s] No buildstatus set, either the base system is broken (kernel/initrd/udev/glibc/bash/perl) [28826s] or the build host has a kernel or hardware problem... Job seems to be stuck here, killed. (after 28800 seconds of inactivity) -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Mon Oct 2 08:37:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 2 Oct 2017 08:37:37 +0000 Subject: osmo-ci[master]: Use new GPRS repositories In-Reply-To: References: Message-ID: Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/4056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia49969cbfb9ef57b635a3b5759f411f71a54f8e1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 2 08:37:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 2 Oct 2017 08:37:40 +0000 Subject: [MERGED] osmo-ci[master]: Use new GPRS repositories In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Use new GPRS repositories ...................................................................... Use new GPRS repositories * use coverity check on osmo-ggsn instead of openggsn * move osmo-sgsn and osmo-ggsn from nightly-split into nightly Change-Id: Ia49969cbfb9ef57b635a3b5759f411f71a54f8e1 --- M coverity/build_Osmocom.sh M coverity/prepare_source_Osmcocom.sh M scripts/osmocom-nightly-nitb-split.sh M scripts/osmocom-nightly-packages.sh 4 files changed, 6 insertions(+), 10 deletions(-) Approvals: Max: Verified Harald Welte: Looks good to me, approved diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 58a74f2..bccd7ea 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -69,8 +69,8 @@ popd } -build_openggsn() { - pushd openggsn +build_osmoggsn() { + pushd osmo-ggsn do_build popd } @@ -155,7 +155,7 @@ build_libosmonetif build_libosmosccp build_libsmpp34 -build_openggsn +build_osmoggsn #IU build_osmoiuh build_osmopcu build_osmobts diff --git a/coverity/prepare_source_Osmcocom.sh b/coverity/prepare_source_Osmcocom.sh index 6d226b2..386e16e 100755 --- a/coverity/prepare_source_Osmcocom.sh +++ b/coverity/prepare_source_Osmcocom.sh @@ -13,7 +13,7 @@ libosmo-sccp \ libsmpp34 \ openbsc \ - openggsn \ + osmo-ggsn \ osmo-bts \ osmo-gmr \ osmo-iuh \ diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh index 3b547bf..4484214 100755 --- a/scripts/osmocom-nightly-nitb-split.sh +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -90,11 +90,9 @@ checkout libasn1c checkout osmo-iuh checkout osmo-hlr - checkout osmo-ggsn checkout osmo-mgw checkout osmo-bsc checkout osmo-msc - checkout osmo-sgsn build libosmocore build libosmo-abis @@ -104,11 +102,9 @@ build libasn1c build osmo-iuh build osmo-hlr - build osmo-ggsn build osmo-mgw build osmo-bsc build osmo-msc - build osmo-sgsn post } diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 84cf6e4..032bd49 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -14,7 +14,7 @@ git clone git://git.osmocom.org/libosmo-abis git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 -git clone git://git.osmocom.org/openggsn +git clone git://git.osmocom.org/osmo-sgsn git clone git://git.osmocom.org/osmo-ggsn git clone git://git.osmocom.org/openbsc git clone git://git.osmocom.org/osmo-pcap @@ -51,7 +51,7 @@ build libosmo-abis build libosmo-netif build libsmpp34 -build openggsn +build osmo-sgsn build osmo-ggsn build openbsc build osmo-pcap -- To view, visit https://gerrit.osmocom.org/4056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia49969cbfb9ef57b635a3b5759f411f71a54f8e1 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Mon Oct 2 08:37:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 2 Oct 2017 08:37:57 +0000 Subject: [MERGED] osmo-sgsn[master]: Cleanup configure checks In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Cleanup configure checks ...................................................................... Cleanup configure checks * remove unused sqlite3 check * remove unused NAT/SMPP/BSC/MGCP test checks Change-Id: I83ae896f57cfb4cb139a42fbf3d77d4b11313f65 --- M configure.ac M tests/atlocal.in 2 files changed, 0 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 532b977..cd60f07 100644 --- a/configure.ac +++ b/configure.ac @@ -88,11 +88,6 @@ AC_CHECK_HEADERS(cdk/cdk.h,,found_cdk=no) AM_CONDITIONAL(HAVE_LIBCDK, test "$found_cdk" = yes) -found_sqlite3=yes -PKG_CHECK_MODULES(SQLITE3, sqlite3, ,found_sqlite3=no) -AM_CONDITIONAL(HAVE_SQLITE3, test "$found_sqlite3" = yes) -AC_SUBST(found_sqlite3) - dnl Checks for typedefs, structures and compiler characteristics diff --git a/tests/atlocal.in b/tests/atlocal.in index 362bfa9..c854487 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -1,7 +1,3 @@ -enable_nat_test='@osmo_ac_build_nat@' -enable_smpp_test='@osmo_ac_build_smpp@' -enable_bsc_test='@osmo_ac_build_bsc@' -enable_mgcp_transcoding_test='@osmo_ac_mgcp_transcoding@' enable_sgsn_test='@found_libgtp_and_libcares@' enable_oap_test='@found_libgtp_and_libcares@' enable_gtphub_test='@found_libgtp_and_libcares@' -- To view, visit https://gerrit.osmocom.org/4074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I83ae896f57cfb4cb139a42fbf3d77d4b11313f65 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 2 08:38:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 2 Oct 2017 08:38:12 +0000 Subject: [MERGED] osmo-sgsn[master]: Use extended logging for PDP contexts In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Use extended logging for PDP contexts ...................................................................... Use extended logging for PDP contexts Log additional details (IMSI, NSAPI etc) on PDP context creation/deletion by using appropriate LOGP() wrappers. Change-Id: I91a126952ae75ae9ba1f42aac4d26413384bba5d Related: SYS#3610 --- M configure.ac M src/gprs/sgsn_libgtp.c 2 files changed, 4 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index cd60f07..c8e23e5 100644 --- a/configure.ac +++ b/configure.ac @@ -62,7 +62,7 @@ found_libgtp=yes -PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no) +PKG_CHECK_MODULES(LIBGTP, libgtp >= 1.0.0, , found_libgtp=no) AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) AC_SUBST(found_libgtp) diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 9a00266..9b8fe16 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -145,7 +145,6 @@ const uint8_t *qos; int rc; - LOGP(DGPRS, LOGL_ERROR, "Create PDP Context\n"); pctx = sgsn_pdp_ctx_alloc(mmctx, nsapi); if (!pctx) { LOGP(DGPRS, LOGL_ERROR, "Couldn't allocate PDP Ctx\n"); @@ -174,6 +173,7 @@ pdp->selmode = 0xFC | 0x00; /* IMSI, TEID/TEIC, FLLU/FLLC, TID, NSAPI set in pdp_newpdp */ + LOGPDPCTXP(LOGL_NOTICE, pctx, "Create PDP Context\n"); /* Put the MSISDN in case we have it */ if (mmctx->subscr && mmctx->subscr->sgsn_data->msisdn_len) { @@ -635,7 +635,8 @@ /* Called whenever a PDP context is deleted for any reason */ static int cb_delete_context(struct pdp_t *pdp) { - LOGP(DGPRS, LOGL_INFO, "PDP Context was deleted\n"); + LOGPDPX(DGPRS, LOGL_INFO, pdp, "Context was deleted\n") ; + return 0; } -- To view, visit https://gerrit.osmocom.org/4073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I91a126952ae75ae9ba1f42aac4d26413384bba5d Gerrit-PatchSet: 4 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 2 08:38:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 2 Oct 2017 08:38:34 +0000 Subject: [MERGED] osmo-bsc[master]: Fix repo split aftermath In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix repo split aftermath ...................................................................... Fix repo split aftermath * remove checks for non-existent tests * always enable bsc and nat-trie tests because both are built unconditionally * enable gsm0408 test which was removed by mistake * adjust gsm0408 test output to remove SMS-related results Change-Id: I73ad079a6333ba56e73b7c4d1d0e9c8255c2a03b Related: OS#2257 --- M tests/atlocal.in M tests/testsuite.at 2 files changed, 6 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/atlocal.in b/tests/atlocal.in index 362bfa9..e69de29 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -1,7 +0,0 @@ -enable_nat_test='@osmo_ac_build_nat@' -enable_smpp_test='@osmo_ac_build_smpp@' -enable_bsc_test='@osmo_ac_build_bsc@' -enable_mgcp_transcoding_test='@osmo_ac_mgcp_transcoding@' -enable_sgsn_test='@found_libgtp_and_libcares@' -enable_oap_test='@found_libgtp_and_libcares@' -enable_gtphub_test='@found_libgtp_and_libcares@' diff --git a/tests/testsuite.at b/tests/testsuite.at index a412f7c..50f68e1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -1,6 +1,12 @@ AT_INIT AT_BANNER([Regression tests.]) +AT_SETUP([gsm0408]) +AT_KEYWORDS([gsm0408]) +cat $abs_srcdir/gsm0408/gsm0408_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gsm0408/gsm0408_test], [], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([bsc_subscr]) AT_KEYWORDS([bsc_subscr]) cat $abs_srcdir/subscr/bsc_subscr_test.ok > expout @@ -16,7 +22,6 @@ AT_SETUP([bsc-nat-trie]) AT_KEYWORDS([bsc-nat-trie]) -AT_CHECK([test "$enable_nat_test" != no || exit 77]) cp $abs_srcdir/bsc-nat-trie/prefixes.csv . cat $abs_srcdir/bsc-nat-trie/bsc_nat_trie_test.ok > expout AT_CHECK([$abs_top_builddir/tests/bsc-nat-trie/bsc_nat_trie_test], [], [expout], [ignore]) @@ -30,7 +35,6 @@ AT_SETUP([bsc]) AT_KEYWORDS([bsc]) -AT_CHECK([test "$enable_bsc_test" != no || exit 77]) cat $abs_srcdir/bsc/bsc_test.ok > expout AT_CHECK([$abs_top_builddir/tests/bsc/bsc_test], [], [expout], [ignore]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4108 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73ad079a6333ba56e73b7c4d1d0e9c8255c2a03b Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 2 10:47:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 2 Oct 2017 10:47:07 +0000 Subject: osmo-ggsn[master]: sgsnemu: Add IPv6 support via tun device and "-t v6 --createif" In-Reply-To: References: Message-ID: Patch Set 4: > For this to work, you must have /proc/sys/net/conf/$tun/accept_ra set There's no such path on my system but there is /proc/sys/net/ipv6/conf/*/accept_ra. Also, if it's known not to work for certain settings, than we can check accept_ra for a given interface and fail with error message if it's incompatible with "-t v6 --createif" setting. That would save some troubleshooting time in future. -- To view, visit https://gerrit.osmocom.org/4047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 2 12:46:57 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 2 Oct 2017 12:46:57 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: > You'll have to update test output too when updating the code. > Btw, how does it looks like when testing against real phone? Which > effect is caused by old code and how it differs when using new > code? Without this fix, the MS does not response UL packet control ack as 4 successive PRACH bursts ifthe CONTROL ACK type sets to 4 access burst in SI13. Note: I am currently working on PCU to support UL packet control ack as 4 PRACH -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 2 12:49:45 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 2 Oct 2017 12:49:45 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: > in case you're unaware: 'make check' executes the testsuite. It's > good practise to run a 'make distcheck' before pushing a patch to > gerrit to ensure all unit tests are still building, and that > out-of-source builds also still work (and no files were forgotten > in the commit). I got an error about missing QEMU when running make check without our LC15 toolchain built from Yocto framework. Any suggestion? -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 2 12:57:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 2 Oct 2017 12:57:58 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: Weird, works for me on master. What about "make check" - does it work for you after applying your patch? What about "make distcheck" on master branch - does it work on your machine? -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 2 13:38:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Oct 2017 13:38:26 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: > I got an error about missing QEMU when running make check without > our LC15 toolchain built from Yocto framework. I suspect you're still doing a cross-compile, i.e. the './configure' was executed with the environment for your cross-toolchain? > Any suggestion? If you do a native compile on your PC, rendering an x86/x68_64 executable for osmo-pcu, make check should work for master. This is what all of us execute on our various development machines (all flavors of Linux from Gentoo to Arch to Debian to Ubuntu), and which is also what our jenkins.osmoocom.org is testing continuously e.g. for verifying patch submissions. In case of doubt, feel free to open a redmine issue attaching your config.log and "make check" output. Thanks! -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 2 14:18:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Oct 2017 14:18:14 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: fix build of osmo-sgsn: use osmo-ggsn Message-ID: Review at https://gerrit.osmocom.org/4122 jenkins: fix build of osmo-sgsn: use osmo-ggsn osmo-sgsn change-id I91a126952ae75ae9ba1f42aac4d26413384bba5d and commit a3b73e917b653d13d027cff2c95a56bbc1264446 has broken compatibility with openggsn.git, by requiring current osmo-ggsn version (1.0.0). Fix build fallout: use osmo-ggsn instead of openggsn.git. Change-Id: I5161983ef625465e21b95578ab5648ecc73d6069 --- M contrib/jenkins-build-osmo-sgsn.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/22/4122/1 diff --git a/contrib/jenkins-build-osmo-sgsn.sh b/contrib/jenkins-build-osmo-sgsn.sh index 1979e8c..45fae5e 100755 --- a/contrib/jenkins-build-osmo-sgsn.sh +++ b/contrib/jenkins-build-osmo-sgsn.sh @@ -8,7 +8,7 @@ build_repo libosmo-abis build_repo libosmo-netif --disable-doxygen build_repo libosmo-sccp -build_repo openggsn +build_repo osmo-ggsn build_repo osmo-sgsn --disable-iu create_bin_tgz osmo-sgsn -- To view, visit https://gerrit.osmocom.org/4122 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5161983ef625465e21b95578ab5648ecc73d6069 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 2 14:27:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Oct 2017 14:27:28 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: move smpp.adoc to common chapters, generalize In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4104 to look at the new patch set (#2). move smpp.adoc to common chapters, generalize OsmoMSC will need the same SMPP chapter as OsmoNITB. In smpp.adoc, replace program name with parameter, add parameter to OsmoNITB's main adoc and move smpp.adoc to common/chapters. Change-Id: I15febdea6569316dad3eed5f9dc7158adb5b078c --- M OsmoNITB/osmonitb-usermanual.adoc R common/chapters/smpp.adoc 2 files changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/04/4104/2 diff --git a/OsmoNITB/osmonitb-usermanual.adoc b/OsmoNITB/osmonitb-usermanual.adoc index 85b4c7d..63d430a 100644 --- a/OsmoNITB/osmonitb-usermanual.adoc +++ b/OsmoNITB/osmonitb-usermanual.adoc @@ -28,7 +28,7 @@ include::chapters/hlr.adoc[] -include::chapters/smpp.adoc[] +include::../common/chapters/smpp.adoc[] include::../common/chapters/mncc.adoc[] diff --git a/OsmoNITB/chapters/smpp.adoc b/common/chapters/smpp.adoc similarity index 92% rename from OsmoNITB/chapters/smpp.adoc rename to common/chapters/smpp.adoc index 23951ba..e62a844 100644 --- a/OsmoNITB/chapters/smpp.adoc +++ b/common/chapters/smpp.adoc @@ -2,16 +2,19 @@ == Short Message Peer to Peer (SMPP) The _Short Message Peer to Peer (SMPP) Protocol_ <> has been -used for the communication with SMSCs. OsmoNITB implements version 3.4 +used for the communication with SMSCs. Osmocom implements version 3.4 of the protocol. Using this interface one can send MT-SMS to an attached subscriber or receive unrouted MO-SMS. + +SMPP is served by the Osmocom MSC layer (both in the old OsmoNITB as well as +the new OsmoMSC. SMPP describes a situation where multiple ESMEs (External SMS Entities) interact with a SMSC (SMS Service Center) via the SMPP protocol. Each entity is identified by its System Id. The System ID is a character string which is configured by the system administrator. -OsmoNITB implements the SMSC side of SMPP and subsequently acts as a TCP +{program-name} implements the SMSC side of SMPP and subsequently acts as a TCP server accepting incoming connections from ESME client programs. Each ESME identifies itself to the SMSC with its system-id and an @@ -21,13 +24,13 @@ === Global SMPP configuration -There is a `smpp` vty node at the top level of the OsmoNITB +There is a `smpp` vty node at the top level of the {program-name} configuration. Under this node, the global SMPP configuration is performed. Use the `local-tcp-ip` command to define the TCP IP and port at which the -OsmoNITB internal SMSC should listen for incoming SMPP connections. The +{program-name} internal SMSC should listen for incoming SMPP connections. The default behaviour is to listen on all IPs (0.0.0.0), and the default port assigned to SMPP is 2775. -- To view, visit https://gerrit.osmocom.org/4104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I15febdea6569316dad3eed5f9dc7158adb5b078c Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 2 14:29:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Oct 2017 14:29:09 +0000 Subject: osmo-gsm-manuals[master]: move smpp.adoc to common chapters, generalize In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15febdea6569316dad3eed5f9dc7158adb5b078c Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 2 14:29:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Oct 2017 14:29:20 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: move smpp.adoc to common chapters, generalize In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move smpp.adoc to common chapters, generalize ...................................................................... move smpp.adoc to common chapters, generalize OsmoMSC will need the same SMPP chapter as OsmoNITB. In smpp.adoc, replace program name with parameter, add parameter to OsmoNITB's main adoc and move smpp.adoc to common/chapters. Change-Id: I15febdea6569316dad3eed5f9dc7158adb5b078c --- M OsmoNITB/osmonitb-usermanual.adoc R common/chapters/smpp.adoc 2 files changed, 8 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoNITB/osmonitb-usermanual.adoc b/OsmoNITB/osmonitb-usermanual.adoc index 85b4c7d..63d430a 100644 --- a/OsmoNITB/osmonitb-usermanual.adoc +++ b/OsmoNITB/osmonitb-usermanual.adoc @@ -28,7 +28,7 @@ include::chapters/hlr.adoc[] -include::chapters/smpp.adoc[] +include::../common/chapters/smpp.adoc[] include::../common/chapters/mncc.adoc[] diff --git a/OsmoNITB/chapters/smpp.adoc b/common/chapters/smpp.adoc similarity index 92% rename from OsmoNITB/chapters/smpp.adoc rename to common/chapters/smpp.adoc index 23951ba..e62a844 100644 --- a/OsmoNITB/chapters/smpp.adoc +++ b/common/chapters/smpp.adoc @@ -2,16 +2,19 @@ == Short Message Peer to Peer (SMPP) The _Short Message Peer to Peer (SMPP) Protocol_ <> has been -used for the communication with SMSCs. OsmoNITB implements version 3.4 +used for the communication with SMSCs. Osmocom implements version 3.4 of the protocol. Using this interface one can send MT-SMS to an attached subscriber or receive unrouted MO-SMS. + +SMPP is served by the Osmocom MSC layer (both in the old OsmoNITB as well as +the new OsmoMSC. SMPP describes a situation where multiple ESMEs (External SMS Entities) interact with a SMSC (SMS Service Center) via the SMPP protocol. Each entity is identified by its System Id. The System ID is a character string which is configured by the system administrator. -OsmoNITB implements the SMSC side of SMPP and subsequently acts as a TCP +{program-name} implements the SMSC side of SMPP and subsequently acts as a TCP server accepting incoming connections from ESME client programs. Each ESME identifies itself to the SMSC with its system-id and an @@ -21,13 +24,13 @@ === Global SMPP configuration -There is a `smpp` vty node at the top level of the OsmoNITB +There is a `smpp` vty node at the top level of the {program-name} configuration. Under this node, the global SMPP configuration is performed. Use the `local-tcp-ip` command to define the TCP IP and port at which the -OsmoNITB internal SMSC should listen for incoming SMPP connections. The +{program-name} internal SMSC should listen for incoming SMPP connections. The default behaviour is to listen on all IPs (0.0.0.0), and the default port assigned to SMPP is 2775. -- To view, visit https://gerrit.osmocom.org/4104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I15febdea6569316dad3eed5f9dc7158adb5b078c Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 2 14:29:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Oct 2017 14:29:21 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: mncc.adoc: clarify MNCC_BRIDGE, with future outlook In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: mncc.adoc: clarify MNCC_BRIDGE, with future outlook ...................................................................... mncc.adoc: clarify MNCC_BRIDGE, with future outlook Change-Id: Ic71a83d71f2da87e1066fcc060b2b942643eddbc --- M common/chapters/mncc.adoc 1 file changed, 14 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/mncc.adoc b/common/chapters/mncc.adoc index 74ca6cf..77579a5 100644 --- a/common/chapters/mncc.adoc +++ b/common/chapters/mncc.adoc @@ -131,8 +131,20 @@ Requests that the TCH (voice) channels of two calls shall be inter-connected. This is the old-fashioned way of using MNCC, -primarily required for circuit-switched BTSs whose TRAU frames are -received via an E1 interface card on the {program-name} machine. +historically required for circuit-switched BTSs whose TRAU frames are +received via an E1 interface card, and works only when the TCH channel types +match. + +NOTE: Internal MNCC uses MNCC_BRIDGE to connect calls directly between +connected BTSs or RNCs, in effect disallowing calls between mismatching TCH +types and forcing all BTSs to be configured with exactly one TCH type and +codec. This is a limitation that will probably remain for the old OsmoNITB. For +the new OsmoMSC, the MNCC_BRIDGE command will instruct the separate OsmoMGW to +bridge calls, which will be able to handle transcoding between different TCH as +well as 3G (IuUP) payloads (but note: not yet implemented at the time of +writing this). Hence an external MNCC may decide to bridge calls directly +between BTSs or RNCs that both are internal to the OsmoMSC, for optimization +reasons. ==== MNCC_FRAME_RECV -- To view, visit https://gerrit.osmocom.org/4103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic71a83d71f2da87e1066fcc060b2b942643eddbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 2 14:29:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Oct 2017 14:29:21 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: tweak common/mncc.adoc: use variable for program name In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: tweak common/mncc.adoc: use variable for program name ...................................................................... tweak common/mncc.adoc: use variable for program name Change-Id: I993a3c3bf617b9823f49898364b5f728a4549330 --- M OsmoNITB/osmonitb-usermanual.adoc M common/chapters/mncc.adoc 2 files changed, 32 insertions(+), 34 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoNITB/osmonitb-usermanual.adoc b/OsmoNITB/osmonitb-usermanual.adoc index 7d342c5..85b4c7d 100644 --- a/OsmoNITB/osmonitb-usermanual.adoc +++ b/OsmoNITB/osmonitb-usermanual.adoc @@ -1,4 +1,5 @@ :gfdl-enabled: +:program-name: OsmoNITB OsmoNITB User Manual ==================== diff --git a/common/chapters/mncc.adoc b/common/chapters/mncc.adoc index 47dfcbe..74ca6cf 100644 --- a/common/chapters/mncc.adoc +++ b/common/chapters/mncc.adoc @@ -17,16 +17,16 @@ It is exposed by the Osmocom MSC layer (both in the old OsmoNITB as well as the new OsmoMSC. -Osmocom's MSCs can run in two different modes: +{program-name} can run in two different modes: . with internal MNCC handler . with external MNCC handler === Internal MNCC handler -When the internal MNCC handler is enabled, OsmoMSC/OsmoNITB will switch voice +When the internal MNCC handler is enabled, {program-name} will switch voice calls between GSM subscribers internally and automatically based on the -subscribers __extension__ number. No external software is required. +the subscribers _extension_ number. No external software is required. NOTE: Internal MNCC is the default behavior. @@ -48,11 +48,11 @@ [[mncc-external]] === External MNCC handler -When the external MNCC handler is enabled, OsmoMSC/OsmoNITB will not perform +When the external MNCC handler is enabled, {program-name} will not perform any internal call switching, but delegate all call-control handling towards the external MNCC program connected via the MNCC socket. -If you intend to operate with external MNCC handler, you have +If you intend to operate {program-name} with external MNCC handler, you have to start it with the `-m` or `--mncc-sock` command line option. At the time of this writing, the only external application implementing the @@ -63,10 +63,9 @@ === MNCC protocol description The protocol follows the primitives specified in 3GPP TS 04.07 Chapter 7.1. -The encoding of the primitives is provided in the `mncc.h` header file -(`osmocom/msc/mncc.h` in `osmo-msc.git` or `openbsc/mncc.h` in old -`openbsc.git`), which uses some common definitions from `osmocom/gsm/mncc.h` -(part of `libosmocore.git`). +The encoding of the primitives is provided in the `mncc.h` header file in +{program-name}'s source tree, which uses some common definitions from +`osmocom/gsm/mncc.h` (part of libosmocore.git). However, Osmocom's MNCC specifies a number of additional primitives beyond those listed in the 3GPP specification. @@ -74,106 +73,104 @@ The different calls in the network are distinguished by their callref (call reference), which is a unique unsigned 32bit integer. -NOTE: _MSC_ below refers to both OsmoMSC and _libmsc_ of the OsmoNITB. - ==== MNCC_HOLD_IND -Direction: MSC -> Handler +Direction: {program-name} -> Handler A 'CC HOLD' message was received from the MS. ==== MNCC_HOLD_CNF -Direction: Handler -> MSC +Direction: Handler -> {program-name} Acknowledge a previously-received 'CC HOLD' message, causes the transmission of a 'CC HOLD ACK' message to the MS. ==== MNCC_HOLD_REJ -Direction: Handler -> MSC +Direction: Handler -> {program-name} Reject a previously-received 'CC HOLD' message, causes the transmission of a 'CC HOLD REJ' message to the MS. ==== MNCC_RETRIEVE_IND -Direction: MSC -> Handler +Direction: {program-name} -> Handler A 'CC RETRIEVE' message was received from the MS. ==== MNCC_RETRIEVE_CNF -Direction: Handler -> MSC +Direction: Handler -> {program-name} Acknowledge a previously-received 'CC RETRIEVE' message, causes the transmission of a 'CC RETRIEVE ACK' message to the MS. ==== MNCC_RETRIEVE_REJ -Direction: Handler -> MSC +Direction: Handler -> {program-name} Reject a previously-received 'CC RETRIEVE' message, causes the transmission of a 'CC RETRIEVE REJ' message to the MS. ==== MNCC_USERINFO_REQ -Direction: MSC -> Handler +Direction: {program-name} -> Handler Causes a 'CC USER INFO' message to be sent to the MS. ==== MNCC_USERINFO_IND -Direction: MSC -> Handler +Direction: {program-name} -> Handler Indicates that a 'CC USER-USER' message has been received from the MS. ==== MNCC_BRIDGE -Direction: Handler -> MSC +Direction: Handler -> {program-name} Requests that the TCH (voice) channels of two calls shall be inter-connected. This is the old-fashioned way of using MNCC, primarily required for circuit-switched BTSs whose TRAU frames are -received via an E1 interface card on the MSC machine. +received via an E1 interface card on the {program-name} machine. ==== MNCC_FRAME_RECV -Direction: Handler -> MSC +Direction: Handler -> {program-name} Enable the forwarding of TCHF voice frames via the MNCC interface in -MSC->Handler direction for the specified call. +{program-name}->Handler direction for the specified call. ==== MNCC_FRAME_DROP -Direction: Handler -> MSC +Direction: Handler -> {program-name} Disable the forwarding of TCHF voice frames via the MNCC interface in -MSC->Handler direction for the specified call. +{program-name}->Handler direction for the specified call. ==== MNCC_LCHAN_MODIFY -Direction: Handler -> MSC +Direction: Handler -> {program-name} Modify the current dedicated radio channel from signalling to voice, or if it is a signalling-only channel (SDCCH), assign a TCH to the MS. ==== MNCC_RTP_CREATE -Direction: Handler -> MSC +Direction: Handler -> {program-name} Create a RTP socket for this call at the BTS/TRAU that serves this BTS. ==== MNCC_RTP_CONNECT -Direction: Handler -> MSC +Direction: Handler -> {program-name} Connect the RTP socket of this call to the given remote IP address and port. ==== MNCC_RTP_FREE -Direction: Handler -> MSC +Direction: Handler -> {program-name} Release a RTP connection for one given call. @@ -182,32 +179,32 @@ Direction: both Transfer the payload of a GSM Full-Rate (FR) voice frame between the -MSC and an external MNCC handler. +{program-name} and an external MNCC handler. ==== GSM_TCHF_FRAME_EFR Direction: both Transfer the payload of a GSM Enhanced Full-Rate (EFR) voice frame -between the MSC and an external MNCC handler. +between the {program-name} and an external MNCC handler. ==== GSM_TCHH_FRAME Direction: both Transfer the payload of a GSM Half-Rate (HR) voice frame between the -MSC and an external MNCC handler. +{program-name} and an external MNCC handler. ==== GSM_TCH_FRAE_AMR Direction: both Transfer the payload of a GSM Adaptive-Multi-Rate (AMR) voice frame -between the MSC and an external MNCC handler. +between the {program-name} and an external MNCC handler. ==== GSM_BAD_FRAME -Direction: MSC -> Handler +Direction: {program-name} -> Handler Indicate that no valid voice frame, but a 'bad frame' was received over the radio link from the MS. -- To view, visit https://gerrit.osmocom.org/4102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I993a3c3bf617b9823f49898364b5f728a4549330 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 2 14:30:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Oct 2017 14:30:49 +0000 Subject: osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Patch Set 4: Is using the new one, but same mistake as last time: forgot to remove the added .adoc from OsmoMSC/ from prev patch set ... thanks -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 2 14:32:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Oct 2017 14:32:39 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4012 to look at the new patch set (#5). add OsmoMSC manual Add OsmoMSC and OsmoHLR to bibliography (even though the OsmoHLR manual does not yet exist, a reference to it has been added in OsmoMSC's manual). Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee --- M Makefile A OsmoMSC/Makefile A OsmoMSC/chapters/control.adoc A OsmoMSC/chapters/net.adoc A OsmoMSC/chapters/overview.adoc A OsmoMSC/chapters/running.adoc A OsmoMSC/osmomsc-usermanual-docinfo.xml A OsmoMSC/osmomsc-usermanual.adoc A OsmoMSC/osmomsc-vty-reference.xml A OsmoMSC/vty/msc_vty_additions.xml A OsmoMSC/vty/msc_vty_reference.xml M common/chapters/bibliography.adoc 12 files changed, 3,678 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/12/4012/5 diff --git a/Makefile b/Makefile index c09dd58..ffa25de 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ cd OsmoNAT; $(MAKE) cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) + cd OsmoMSC; $(MAKE) clean: cd OsmoBTS; $(MAKE) clean @@ -19,6 +20,7 @@ cd OsmoNAT; $(MAKE) clean cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean + cd OsmoMSC; $(MAKE) clean upload: cd OsmoBTS; $(MAKE) upload @@ -30,6 +32,7 @@ cd OsmoNAT; $(MAKE) upload cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload + cd OsmoMSC; $(MAKE) upload check: cd OsmoBTS; $(MAKE) check @@ -42,6 +45,7 @@ #cd OsmoMGCP; $(MAKE) check #cd OsmoNAT; $(MAKE) check cd OsmoGSMTester; $(MAKE) check + cd OsmoMSC; $(MAKE) check define check_dep_bin @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; } diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile new file mode 100644 index 0000000..febf7d1 --- /dev/null +++ b/OsmoMSC/Makefile @@ -0,0 +1,42 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +topdir = . +msc_reference = $(topdir)/osmomsc-vty-reference.xml +manuals = $(msc_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + +TOPDIR := .. +ASCIIDOCS := osmomsc-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml + +clean: + -rm -rf $(cleanfiles) + -rm osmomsc-usermanual__*.svg + -rm osmomsc-usermanual__*.png + -rm osmomsc-usermanual.check + +generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/msc_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging Common BSC VTY) + $(call command,xsltproc -o generated/combined3.xml \ + --stringparam with $(PWD)/vty/msc_vty_additions.xml \ + $(MERGE_DOC) generated/combined2.xml, \ + XSLTPROC,Merging MSC VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting MSC VTY to DocBook) diff --git a/OsmoMSC/chapters/control.adoc b/OsmoMSC/chapters/control.adoc new file mode 100644 index 0000000..af03be7 --- /dev/null +++ b/OsmoMSC/chapters/control.adoc @@ -0,0 +1,31 @@ +[[control]] +== Control interface + +The actual protocol is described in <>, the variables common +to all programs using it are described in <>. This section +describes the CTRL interface variables specific to OsmoMSC. + +.Variables available on OsmoMSC's Control interface +[options="header",width="100%",cols="20%,5%,5%,50%,20%"] +|=== +|Name|Access|Trap|Value|Comment +|subscriber-list-active-v1|RO|No||Return list of active subscribers. +|=== + +=== subscriber-list-active-v1 + +Return a list of subscribers that are successfully attached (including full +successful authentication and ciphering if those are enabled). + +The reply comprises of one subscriber per line, of the format + +---- +,\n[,\n[...]] +---- + +For example: + +---- +901700000015252,22801 +901700000015253,22802 +---- diff --git a/OsmoMSC/chapters/net.adoc b/OsmoMSC/chapters/net.adoc new file mode 100644 index 0000000..06be4ba --- /dev/null +++ b/OsmoMSC/chapters/net.adoc @@ -0,0 +1,154 @@ +[[net]] +== Configuring the Core Network + +The core network parameters are configured by the config file (as in `osmo-msc +-c osmo-msc.cfg`). The config file is parsed by the VTY, which is also +available via telnet in the running `osmo-msc` instance. Be aware that even +though you may be able to change these parameters without restarting +`osmo-msc`, some may not take immediate effect, and it is safest to use the +config file to have these parameters set at startup time. + +The core network parameters are found in the `config` / `network`. + +A full reference to the available commands can be found in the _OsmoMSC VTY +reference manual_ <>. This section describes only the most +commonly used settings. + +Here is an overview of the config items, described in more detail below: + +---- +network + network country code 262 + mobile network code 89 + mm info 1 + short name OsmoMSC + long name OsmoMSC + authentication required + encryption a5 3 +---- + +[TIP] +==== +Use the telnet VTY interface to query the current configuration of a running +`osmo-msc` process: + +---- +$ telnet localhost 4254 +OsmoMSC> enable +OsmoMSC# show running-config +---- + +Some parameters may be changed without restarting `osmo-msc`. To reach the +`network` node, enter: + +---- +OsmoMSC> enable +OsmoMSC# configure terminal +OsmoMSC(config)# network +OsmoMSC(config-net)# short name Example-Name +OsmoMSC(config-net)# exit +OsmoMSC(config)# +---- + +The telnet VTY features tab-completion as well as context sensitive help shown +when entering a `?` question mark. + +You can always use the `list` VTY command or enter `?` on the blank prompt to +get a list of all possible commands at the current node. +==== + + +=== MCC/MNC + +The key identities of every GSM PLMN is the Mobile Country Code and the Mobile +Network Code. They are identical over the entire network. In most cases, the +MCC/MNC will be allocated to the operator by the respective local regulatory +authority. For example, to set the MCC/MNC of 262-89, have this in your +osmo-msc.cfg: + +---- +network + network country code 262 + mobile network code 89 +---- + + +=== Configuring MM INFO + +The _MM INFO_ procedure can be used after a successful _LOCATION UPDATE_ in +order to transmit the human-readable network name as well as local time zone +information to the MS. By default, _MM INFO_ is not active, i.e. `0`. Set to `1` +to activate this feature: + +---- +network + mm info 1 + short name OsmoMSC + long name OsmoMSC +---- + +[NOTE] +==== +Not all phones support the MM INFO procedure. If a phone is not +factory-programmed to contain the name for your MCC/MNC, it will likely only +provide a numeric display of the network name, such as _262-89_, or show the +country code transformed into a letter, such as _D 89_. +==== + +The time information transmitted is determined by the local system time of the +operating system on which OsmoMSC is running. + + +=== Authentication + +Authorized subscribers must be entered in the HLR database, see the _OsmoHLR +reference manual_ <>. If authentication tokens (such as KI for +2G, or K and OP/OPC for UMTS) are present in the HLR, OsmoMSC will only attach +a subscriber after successful authentication. + +If no authentication keys are present in the HLR for a given subscriber, +OsmoMSC will attach the subscriber _without_ authentication. You can reject +subscribers that lack authentication info in the HLR with this setting: + +---- +network + authentication required +---- + +=== Ciphering + +To enable ciphering on the radio link, authentication must take place first: +the Kc resulting from authentication is the key used for ciphering. Hence, all +subscribers must have authentication tokens available in the HLR for ciphering. + +The MS, BTS and MSC must agree on a ciphering algorithm to use. + +- The MS sends its supported ciphering algorithms via Classmark IEs during + Location Updating. +- Typically the BSC needs to know which A5 ciphers are supported by connected + BTSes. +- Finally, OsmoMSC may impose that specific A5 ciphers shall not be considered. + +It is the responsibility of the BSC to then pick an A5 cipher that satisfies +all requirements. + +- In OsmoMSC, A5/0 means that ciphering is turned off. ++ +---- +network + encryption a5 0 +---- + +- A5/1 and A5/3 are currently supported by Osmocom. ++ +---- +network + encryption a5 3 +---- + +- Never use A5/2: it is an "export grade cipher" and has been deprecated for + its low ciphering strength. + +NOTE: At the time of writing, OsmoMSC supports setting only a single A5 cipher, +while it should be able to allow a set of ciphers. This is subject to ongoing +development. diff --git a/OsmoMSC/chapters/overview.adoc b/OsmoMSC/chapters/overview.adoc new file mode 100644 index 0000000..0bb47d7 --- /dev/null +++ b/OsmoMSC/chapters/overview.adoc @@ -0,0 +1,127 @@ +[[overview]] +== Overview + +This manual should help you getting started with OsmoMSC. It will cover +aspects of configuring and running the OsmoMSC. + +[[intro_overview]] +=== About OsmoMSC + +OsmoMSC is the Osmocom implementation of a Mobile Switching Center (MSC) for 2G +and 3G GSM and UMTS mobile networks. Its interfaces are: + +- GSUP towards OsmoHLR (or a MAP proxy); +- A over IP towards a BSC (e.g. OsmoBSC); +- IuCS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G voice; +- MNCC (Mobile Network Call Control derived from GSM TS 04.07); +- SMPP 3.4 (Short Message Peer-to-Peer); +- The Osmocom typical telnet VTY and CTRL interfaces. + +OsmoMSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. +Before it was split off, OsmoMSC originated from libmsc of the old openbsc.git. +Since a true _A_ interface and IuCS for 3G support is available, OsmoMSC +exists only as a separate standalone entity. + +Key differences of the new OsmoMSC compared to the old OsmoNITB are: + +- The complete VLR implementation that communicates with the separate HLR + (OsmoHLR) for subscriber management. In contrast to the OsmoNITB, HLR queries + are fully asynchronous, and the separate HLR allows using centralized + subscriber management for both circuit-switched and packet-switched domains + (i.e. one OsmoHLR for both OsmoMSC and OsmoSGSN). + +- VLR and HLR brought full UMTS AKA (Authentication and Key Agreement) support, + i.e. Milenage authentication in both the full 3G variant as well as the + backwards compatible 2G variant. + +- Addition of a true _A_ interface for 2G voice services. Previously, OsmoBSC + had an SCCPlite based _A_ interface towards 3rd party MSC implementations. + OsmoMSC features a true SCCP/M3UA _A_ interface, which allows running OsmoBSC + against this Osmocom based MSC implementation. The new SCCP/M3UA SIGTRAN for + the _A_ interface is implemented in libosmo-sccp, which is used by OsmoMSC + and OsmoBSC (and others), to establish a link via an STP (e.g. OsmoSTP). + +- Addition of an _IuCS_ interface to allow operating 3G voice services, also + via SCCP/M3UA SIGTRAN, for example connecting via OsmoHNBGW to a 3G small + cell device. + +Find the OsmoMSC issue tracker and wiki online at + +- https://osmocom.org/projects/osmomsc +- https://osmocom.org/projects/osmomsc/wiki + + +[[fig-gsm]] +.Typical GSM network architecture used with OsmoMSC +[graphviz] +---- +digraph G { + rankdir=LR; + MS0 [label="MS"] + MS1 [label="MS"] + MS2 [label="MS"] + MS3 [label="MS"] + UE0 [label="UE"] + UE1 [label="UE"] + BTS0 [label="BTS"] + BTS1 [label="BTS"] + STP [label="STP\n(SCCP routing)"] + HLR [label="HLR+AUC+EIR"] + HNB [label="RNC or hNodeB"] + MGW + MS0->BTS0 [label="Um"] + MS1->BTS0 [label="Um"] + MS2->BTS1 [label="Um"] + MS3->BTS1 [label="Um"] + UE0->HNB + UE1->HNB + BTS0->BSC [label="Abis"] + BTS1->BSC [label="Abis"] + BSC->STP [label="A/SCCP/M3UA"] + STP->MSC [label="A/SCCP/M3UA"] + STP->MSC [label="IuCS/SCCP/M3UA"] + VLR->HLR [label="GSUP"] + HNB->HNBGW [label="Iuh"] + HNBGW->STP [label="IuCS/SCCP/M3UA"] + MSC->MGW [label="MGCP"] + BTS0->MGW [label="RTP"] + BTS1->MGW [label="RTP"] + subgraph cluster_msc { + label = "OsmoMSC"; + MSC->SMSC; + MSC->VLR + } +} +---- + + +=== Software Components + +This is a brief description of OsmoMSC's internal software components. + +==== SMSC + +A minimal store-and-forward server for SMS, supporting both MO and MT +SMS service, as well as multi-part messages. + +The built-in SMSC also supports an external SMSC interface. For more +information, see <>. + +==== MSC + +The MSC component implements the mobility management (MM) functions of the TS +04.08 and delegates to SMSC for SMS message handling and the VLR for subscriber +management. + +Furthermore, it can handle TS 04.08 Call Control (CC), either by use of +an internal MNCC handler, or by use of an external MNCC agent. For more +information see <>. + +==== VLR + +A fully featured Visitor Location Register handles the subscriber management +and authentication, and interfaces via GSUP to the external HLR. diff --git a/OsmoMSC/chapters/running.adoc b/OsmoMSC/chapters/running.adoc new file mode 100644 index 0000000..5925e02 --- /dev/null +++ b/OsmoMSC/chapters/running.adoc @@ -0,0 +1,148 @@ +== Running OsmoMSC + +The OsmoMSC executable (`osmo-msc`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-msc* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-T] [-e 'LOGLEVEL'] [-l 'DATABASE'] [-M 'SOCKETPATH'] [-C] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-d, --debug 'DBGMASK','DBGLEVELS'*:: + Set the log subsystems and levels for logging to stderr. This + has mostly been superseded by VTY-based logging configuration, + see <> for further information. +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `openbsc.cfg` in the current + working directory. +*-s, --disable-color*:: + Disable colors for logging to stderr. This has mostly been + deprecated by VTY based logging configuration, see <> + for more information. +*-T, --timestamp*:: + Enable time-stamping of log messages to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-e, --log-level 'LOGLEVEL'*:: + Set the global log level for logging to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-l, --database 'DATABASE'*:: + Specify the file name of the SQLite3 database to use as SMS storage +*-M, --mncc-sock-path*:: + Enable the MNCC socket for an external MNCC handler. See + <> for further information. +*-m, --mncc-sock*:: + Same as option -M (deprecated). +*-C, --no-dbcounter*:: + Disable the regular periodic synchronization of statistics + counters to the database. + + +=== Multiple instances + +Running multiple instances of `osmo-msc` is possible if all interfaces (VTY, +CTRL) are separated using the appropriate configuration options. The IP based +interfaces are binding to local host by default. In order to separate the +processes, the user has to bind those services to specific but different IP +addresses. + +The VTY and the Control interface can be bound to IP addresses from the loopback +address range, for example: + +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- + +If external SMPP is enabled, you may bind it to a different interface using: + +---- +smpp + local-tcp-ip 10.23.42.1 2775 +---- + +More on SMPP configuration in <>. + +The external MNCC handler is configured by the `--mncc-sock` commandline +argument. Choose a different such socket path for each OsmoMSC instance running +on the same file system. See more in <>. + +For the following links, OsmoMSC acts as a client and does not listen/bind to a +specific interface, and will hence not encounter conflicts for multiple instances +running on the same interface: + +- The SCCP/M3UA links are established by OsmoMSC contacting an STP. +- The GSUP link is established by OsmoMSC contacting an HLR. + + +=== Configure primary links + +==== Configure SCCP/M3UA to accept _A_ and _IuCS_ links + +OsmoMSC will contact an STP instance to establish an SCCP/M3UA link. BSC and +HNBGW will then reach the MSC via this link. By default, an STP instance is +assumed to listen on the default M3UA port (2905) on the local host. + +Establishing an SCCP/M3UA link towards an STP instance not on the local host +can be configured as follows: + +---- +cs7 instance 0 + asp my-OsmoMSC 2905 0 m3ua + ! IP address of the remote STP: + remote-ip 10.23.24.1 +---- + +Note that _A_ and _IuCS_ may use different SCCP instances, if so desired: + +---- +cs7 instance 0 + asp my-OsmoMSC-A 2905 0 m3ua + remote-ip 10.23.42.1 +cs7 instance 1 + asp my-OsmoMSC-Iu 2905 0 m3ua + remote-ip 10.23.42.2 +msc + cs7-instance-a 0 + cs7-instance-iu 1 +---- + +A full configuration needs an `asp` on an `as` -- an Application Server Process +running on an Application Server -- as well as a local point code and routing +configuration. The SCCP VTY automatically creates those parts that are missing, +by assuming sane defaults. A complete configuration would look like this: + +---- +cs7 instance 0 + point-code 0.23.1 + asp my-OsmoMSC-A-Iu 2905 0 m3ua + remote-ip 127.0.0.1 + as my-as-for-OsmoMSC-A-Iu m3ua + asp my-OsmoMSC-A-Iu + routing-key 0 0.23.1 +---- + +==== Configure GSUP to reach the HLR + +OsmoMSC will assume a GSUP server (OsmoHLR) to run on the local host and the +default GSUP port (4222). Contacting an HLR at a different IP address can be +configured as follows: + +---- +hlr + ! IP address of the remote HLR: + remote-ip 10.23.42.1 + ! default port is 4222, optionally configurable by: + remote-port 1234 +---- diff --git a/OsmoMSC/osmomsc-usermanual-docinfo.xml b/OsmoMSC/osmomsc-usermanual-docinfo.xml new file mode 100644 index 0000000..d99bba7 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual-docinfo.xml @@ -0,0 +1,47 @@ + + + 1 + September 18th, 2017 + NH + + Initial version; based on OsmoNITB manual version 2. + + + + + + + Neels + Hofmeyr + nhofmeyr at sysmocom.de + NH + + sysmocom + sysmocom - s.f.m.c. GmbH + Senior Developer + + + + + + 2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with the Invariant Sections being just 'Foreword', + 'Acknowledgements' and 'Preface', with no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoMSC/osmomsc-usermanual.adoc b/OsmoMSC/osmomsc-usermanual.adoc new file mode 100644 index 0000000..7c20020 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual.adoc @@ -0,0 +1,36 @@ +:gfdl-enabled: +:program-name: OsmoMSC + +OsmoMSC User Manual +==================== +Neels Hofmeyr + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +include::chapters/control.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + +include::chapters/net.adoc[] + +include::../common/chapters/smpp.adoc[] + +include::../common/chapters/mncc.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] + diff --git a/OsmoMSC/osmomsc-vty-reference.xml b/OsmoMSC/osmomsc-vty-reference.xml new file mode 100644 index 0000000..a954b84 --- /dev/null +++ b/OsmoMSC/osmomsc-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 18th September 2017 + nh + Initial + + + + OsmoMSC VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoMSC/vty/msc_vty_additions.xml b/OsmoMSC/vty/msc_vty_additions.xml new file mode 100644 index 0000000..0d473bd --- /dev/null +++ b/OsmoMSC/vty/msc_vty_additions.xml @@ -0,0 +1,24 @@ + + + + MNCC Internal Configuration + This node allows to configure the default codecs for + the internal call control handling. + + + + SMPP Configuration + This node allows to configure the SMPP interface + for interfacing with external SMS applications. This section + contains generic/common SMPP related configuration, and no + per-ESME specific parameters. + + + + ESME Configuration + This node allows to configure one particular SMPP + ESME, which is an External SMS Entity such as a SMS based + application server. You can define any number of ESME within + the SMPP node of the OsmoNITB VTY. + + diff --git a/OsmoMSC/vty/msc_vty_reference.xml b/OsmoMSC/vty/msc_vty_reference.xml new file mode 100644 index 0000000..b7311ab --- /dev/null +++ b/OsmoMSC/vty/msc_vty_reference.xml @@ -0,0 +1,3019 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/chapters/bibliography.adoc b/common/chapters/bibliography.adoc index 9d4c234..129758f 100644 --- a/common/chapters/bibliography.adoc +++ b/common/chapters/bibliography.adoc @@ -14,6 +14,14 @@ http://ftp.osmocom.org/docs/latest/osmobsc-usermanual.pdf - [[[vty-ref-osmobsc]]] Osmocom Project: OsmoBSC VTY Reference Manual. http://ftp.osmocom.org/docs/latest/osmobsc-vty-reference.pdf +- [[[userman-osmomsc]]] Osmocom Project: OsmoMSC User Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-usermanual.pdf +- [[[vty-ref-osmomsc]]] Osmocom Project: OsmoMSC VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-vty-reference.pdf +- [[[userman-osmohlr]]] Osmocom Project: OsmoHLR User Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-usermanual.pdf +- [[[vty-ref-osmohlr]]] Osmocom Project: OsmoHLR VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-vty-reference.pdf - [[[userman-osmopcu]]] Osmocom Project: OsmoPCU User Manual. http://ftp.osmocom.org/docs/latest/osmopcu-usermanual.pdf - [[[vty-ref-osmopcu]]] Osmocom Project: OsmoPCU VTY Reference Manual. -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 2 14:40:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Oct 2017 14:40:31 +0000 Subject: [PATCH] osmo-msc[master]: fix vty tests: long timeout due to unreachable STP address Message-ID: Review at https://gerrit.osmocom.org/4123 fix vty tests: long timeout due to unreachable STP address The doc/examples/osmo-msc SCCP config examples with 10.23.42.1 as asp ip-remote cause >5 minutes timeout for each VTY config test being run before the VTY becomes available. This hugely elongates the config tests, we didn't spot it before because it does succeed after that timeout. Rather use link-local addresses in order to immediately note the lack of connection and carry on with the VTY config tests. Related: OS#2333 Change-Id: I5ea4ef8a7e181bd3a38edf9c3b5d098f6ba65ee5 --- M doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg M doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/23/4123/1 diff --git a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg index 3de478a..4ccb0d0 100644 --- a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg +++ b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg @@ -18,7 +18,7 @@ point-code 0.23.1 asp asp-clnt-OsmoMSC-A-Iu 2905 0 m3ua ! where to reach the STP: - remote-ip 10.23.24.1 + remote-ip 127.0.0.5 ! local-ip 10.23.24.1 msc cs7-instance-a 0 diff --git a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg index 3c38445..8b481de 100644 --- a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg +++ b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg @@ -17,11 +17,11 @@ cs7 instance 0 point-code 0.23.1 asp asp-clnt-OsmoMSC-A 2905 0 m3ua - remote-ip 10.23.24.1 + remote-ip 127.0.0.5 cs7 instance 1 point-code 0.23.2 asp asp-clnt-OsmoMSC-Iu 2905 0 m3ua - remote-ip 10.23.24.2 + remote-ip 127.0.0.6 msc cs7-instance-a 0 cs7-instance-iu 1 -- To view, visit https://gerrit.osmocom.org/4123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ea4ef8a7e181bd3a38edf9c3b5d098f6ba65ee5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 2 15:00:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Oct 2017 15:00:16 +0000 Subject: [MERGED] osmo-hlr[master]: debian: remove unneeded dependency libdbd-sqlite3 In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: debian: remove unneeded dependency libdbd-sqlite3 ...................................................................... debian: remove unneeded dependency libdbd-sqlite3 Take the opportunity to remove duplicated pkg-config dependency. Change-Id: I5bfe9c71740c1ced5bad0a41dfca568b9e00070c --- M debian/control 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 0ff3801..7104c37 100644 --- a/debian/control +++ b/debian/control @@ -7,12 +7,10 @@ dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, - pkg-config, python-minimal, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, - libdbd-sqlite3, libsqlite3-dev Standards-Version: 3.9.6 Vcs-Browser: http://cgit.osmocom.org/osmo-hlr -- To view, visit https://gerrit.osmocom.org/4107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5bfe9c71740c1ced5bad0a41dfca568b9e00070c Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 2 16:29:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Oct 2017 16:29:15 +0000 Subject: osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 2 16:42:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 2 Oct 2017 16:42:13 +0000 Subject: [PATCH] osmo-bsc[master]: SI2q: cleanup UARFCN addition In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4110 to look at the new patch set (#3). SI2q: cleanup UARFCN addition * expand comments, fix typos * constify parameter * move try-add-adjust routine into separate function to facilitate further modifications * remove excessive checks and unnecessary return values * move (UARFCN, Scrambling Code) tuple uniqueness check into separate function and use it early Change-Id: Ia72f848dec40723510ca56868e08081804227d47 Related: OS#2357 --- M src/libbsc/rest_octets.c M src/libbsc/system_information.c 2 files changed, 90 insertions(+), 88 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/4110/3 diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index 09c4a90..b1516ec 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -232,7 +232,7 @@ } /* Estimate how many bits it'll take to append single FDD UARFCN */ -static inline int append_utran_fdd_length(uint16_t u, int *sc, size_t sc_len, size_t length) +static inline int append_utran_fdd_length(uint16_t u, const int *sc, size_t sc_len, size_t length) { uint8_t chan_list[16] = { 0 }; int tmp[sc_len], f0; @@ -274,18 +274,42 @@ return 21 + range1024_p(length); } -/* Append multiple FDD UARFCNs */ -static inline int append_uarfcns(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) +static inline int try_adding_uarfcn(struct bitvec *bv, struct gsm_bts *bts, uint16_t uarfcn, + uint8_t num_sc, uint8_t start_pos, uint8_t budget) { - const uint16_t *u = bts->si_common.data.uarfcn_list, *sc = bts->si_common.data.scramble_list; - int i, j, k, rc, st = 0, a[bts->si_common.uarfcn_length]; + int i, k, rc, a[bts->si_common.uarfcn_length]; + + if (budget < 23) + return -ENOMEM; + + /* copy corresponding Scrambling Codes: range encoder make in-place modifications */ + for (i = start_pos, k = 0; i < num_sc; a[k++] = bts->si_common.data.scramble_list[i++]); + + /* estimate bit length requirements */ + rc = append_utran_fdd_length(uarfcn, a, bts->si_common.uarfcn_length, k); + if (rc < 0) + return rc; /* range encoder failure */ + + if (budget - rc <= 0) + return -ENOMEM; /* we have ran out of budget in current SI2q */ + + /* compute next offset */ + bts->u_offset += k; + + return budget - append_utran_fdd(bv, uarfcn, a, k); +} + +/* Append multiple FDD UARFCNs */ +static inline void append_uarfcns(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) +{ + const uint16_t *u = bts->si_common.data.uarfcn_list; + int i, rem = budget - 7, st = 0; /* account for constant bits right away */ uint16_t cu = u[bts->u_offset]; /* caller ensures that length is positive */ - uint8_t rem = budget - 7, offset_diff; /* account for constant bits right away */ OSMO_ASSERT(budget <= SI2Q_MAX_LEN); if (budget <= 7) - return -ENOMEM; + return; /* 3G Neighbour Cell Description */ bitvec_set_bit(bv, 1); @@ -299,53 +323,24 @@ /* No Bandwidth_FDD */ bitvec_set_bit(bv, 0); - for (i = bts->u_offset; i < bts->si_common.uarfcn_length; i++) { - offset_diff = 0; - for (j = st, k = 0; j < i; j++) { - a[k++] = sc[j]; /* copy corresponding SCs */ - offset_diff++; /* compute proper offset step */ - } + for (i = bts->u_offset; i <= bts->si_common.uarfcn_length; i++) if (u[i] != cu) { /* we've reached new UARFCN */ - rc = append_utran_fdd_length(cu, a, bts->si_common.uarfcn_length, k); - if (rc < 0) { /* estimate bit length requirements */ - return rc; - } + rem = try_adding_uarfcn(bv, bts, cu, i, st, rem); + if (rem < 0) + break; - if (rem - rc <= 0) - break; /* we have ran out of budget in current SI2q */ - else { - rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset += offset_diff; - } - cu = u[i]; - st = i; /* update start position */ + if (i < bts->si_common.uarfcn_length) { + cu = u[i]; + st = i; + } else + break; } - } - - if (rem > 22) { /* add last UARFCN not covered by previous cycle if it could possibly fit into budget */ - offset_diff = 0; - for (i = st, k = 0; i < bts->si_common.uarfcn_length; i++) { - a[k++] = sc[i]; - offset_diff++; - } - rc = append_utran_fdd_length(cu, a, bts->si_common.uarfcn_length, k); - if (rc < 0) { - return rc; - } - - if (rem - rc >= 0) { - rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset += offset_diff; - } - } /* stop bit - end of Repeated UTRAN FDD Neighbour Cells */ bitvec_set_bit(bv, 0); /* UTRAN TDD Description */ bitvec_set_bit(bv, 0); - - return 0; } /* generate SI2quater rest octets: 3GPP TS 44.018 ? 10.5.2.33b */ @@ -393,15 +388,9 @@ bitvec_set_bit(&bv, 0); rc = SI2Q_MAX_LEN - (bv.cur_bit + 3); - if (rc > 0 && bts->si_common.uarfcn_length - bts->u_offset > 0) { - rc = append_uarfcns(&bv, bts, rc); - if (rc < 0) { - LOGP(DRR, LOGL_ERROR, "SI2quater [%u/%u]: failed to append %zu UARFCNs due to range encoding " - "failure: %s\n", - bts->si2q_index, bts->si2q_count, bts->si_common.uarfcn_length, strerror(-rc)); - return rc; - } - } else /* No 3G Neighbour Cell Description */ + if (rc > 0 && bts->si_common.uarfcn_length - bts->u_offset > 0) + append_uarfcns(&bv, bts, rc); + else /* No 3G Neighbour Cell Description */ bitvec_set_bit(&bv, 0); /* No 3G Measurement Parameters Description */ diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index 7bdb80a..761e848 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -182,7 +182,7 @@ int rc = make_si2quaters(bts, true); uint8_t num = bts->si2q_index + 1; /* number of SI2quater messages */ - /* N. B: si2q_num() should NEVER be called during actualSI2q rest octets generation + /* N. B: si2q_num() should NEVER be called during actual SI2q rest octets generation we're not re-entrant because of the following code: */ bts->u_offset = 0; bts->e_offset = 0; @@ -239,26 +239,40 @@ return r; } +/* Scrambling Code as defined in 3GPP TS 25.213 is 9 bit long so number below is unreacheable upper bound */ +#define SC_BOUND 600 + +/* Find position for a given UARFCN (take SC into consideration if it's available) in a sorted list + N. B: we rely on the assumption that (uarfcn, scramble) tuple is unique in the lists */ +static int uarfcn_sc_pos(const struct gsm_bts *bts, uint16_t uarfcn, uint16_t scramble) +{ + const uint16_t *sc = bts->si_common.data.scramble_list; + uint16_t i, scramble0 = encode_fdd(scramble, false), scramble1 = encode_fdd(scramble, true); + for (i = 0; i < bts->si_common.uarfcn_length; i++) + if (uarfcn == bts->si_common.data.uarfcn_list[i]) { + if (scramble < SC_BOUND) { + if (scramble0 == sc[i] || scramble1 == sc[i]) + return i; + } else + return i; + } + + return -1; +} + int bts_uarfcn_del(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble) { - uint16_t sc0 = encode_fdd(scramble, false), sc1 = encode_fdd(scramble, true), - *ual = bts->si_common.data.uarfcn_list, - *scl = bts->si_common.data.scramble_list; - size_t len = bts->si_common.uarfcn_length, i; - for (i = 0; i < len; i++) { - if (arfcn == ual[i] && (sc0 == scl[i] || sc1 == scl[i])) { - /* we rely on the assumption that (uarfcn, scramble) - tuple is unique in the lists */ - if (i != len - 1) { /* move the tail if necessary */ - memmove(ual + i, ual + i + 1, 2 * (len - i + 1)); - memmove(scl + i, scl + i + 1, 2 * (len - i + 1)); - } - break; - } - } + uint16_t *ual = bts->si_common.data.uarfcn_list, *scl = bts->si_common.data.scramble_list; + size_t len = bts->si_common.uarfcn_length; + int pos = uarfcn_sc_pos(bts, arfcn, scramble); - if (i == len) + if (pos < 0) return -EINVAL; + + if (pos != len - 1) { /* move the tail if necessary */ + memmove(ual + pos, ual + pos + 1, 2 * (len - pos + 1)); + memmove(scl + pos, scl + pos + 1, 2 * (len - pos + 1)); + } bts->si_common.uarfcn_length--; return 0; @@ -267,29 +281,27 @@ int bts_uarfcn_add(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble, bool diversity) { size_t len = bts->si_common.uarfcn_length, i, k = 0; - uint16_t scr, chk, + uint8_t si2q; + int pos = uarfcn_sc_pos(bts, arfcn, scramble); + uint16_t scr = diversity ? encode_fdd(scramble, true) : encode_fdd(scramble, false), *ual = bts->si_common.data.uarfcn_list, - *scl = bts->si_common.data.scramble_list, - scramble1 = encode_fdd(scramble, true), - scramble0 = encode_fdd(scramble, false); - - scr = diversity ? scramble1 : scramble0; - chk = diversity ? scramble0 : scramble1; + *scl = bts->si_common.data.scramble_list; if (len == MAX_EARFCN_LIST) return -ENOMEM; - for (i = 0; i < len; i++) /* find the position of arfcn if any */ - if (arfcn == ual[i]) - break; + if (pos >= 0) + return -EADDRINUSE; - for (k = 0; i < len; i++) { - if (arfcn == ual[i] && (scr == scl[i] || chk == scl[i])) - return -EADDRINUSE; + /* find the suitable position for arfcn if any */ + pos = uarfcn_sc_pos(bts, arfcn, SC_BOUND); + i = (pos < 0) ? len : pos; + + for (k = 0; i < len; i++) if (scr > scl[i]) k = i + 1; - } - /* we keep lists sorted by scramble code: + + /* we keep lists sorted by scramble code of a given UARFCN: insert into appropriate position and move the tail */ if (len - k) { memmove(ual + k + 1, ual + k, (len - k) * 2); @@ -299,9 +311,10 @@ ual[k] = arfcn; scl[k] = scr; bts->si_common.uarfcn_length++; + si2q = si2q_num(bts); - if (si2q_num(bts) <= SI2Q_MAX_NUM) { - bts->si2q_count = si2q_num(bts) - 1; + if (si2q <= SI2Q_MAX_NUM) { + bts->si2q_count = si2q - 1; return 0; } -- To view, visit https://gerrit.osmocom.org/4110 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia72f848dec40723510ca56868e08081804227d47 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 3 01:48:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 01:48:40 +0000 Subject: [PATCH] osmo-msc[master]: Update .gitignore for post-nitb-split Message-ID: Review at https://gerrit.osmocom.org/4124 Update .gitignore for post-nitb-split Change-Id: I8bac4399a35b722908a4dc4d47c4962946ed52e9 --- M .gitignore 1 file changed, 11 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/24/4124/1 diff --git a/.gitignore b/.gitignore index a9e6b84..4873bbe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,15 +7,8 @@ Makefile.in bscconfig.h bscconfig.h.in -openbsc.pc -src/osmo-nitb/osmo-nitb -src/osmo-bsc_mgcp/osmo-bsc_mgcp -src/osmo-bsc/osmo-bsc -src/utils/meas_vis -src/utils/meas_json -src/utils/osmo-meas-pcap2db -src/utils/osmo-meas-udp2db -src/utils/smpp_mirror +*.pc + *.*~ *.sw? .libs @@ -38,27 +31,22 @@ stamp-h1 libtool ltmain.sh +m4/*.m4 # git-version-gen magic .tarball-version .version - # apps and app data -hlr.sqlite3 -src/utils/bs11_config -src/ipaccess/ipaccess-config -src/ipaccess/abisip-find -src/ipaccess/ipaccess-firmware -src/ipaccess/ipaccess-proxy -src/utils/isdnsync -src/nat/bsc_nat -src/gprs/osmo-sgsn -src/gprs/osmo-gbproxy -src/gprs/osmo-gtphub -src/osmo-bsc_nat/osmo-bsc_nat -src/libcommon/gsup_test_client src/osmo-msc/osmo-msc +src/libcommon/gsup_test_client +src/utils/meas_vis +src/utils/meas_json +src/utils/osmo-meas-pcap2db +src/utils/osmo-meas-udp2db +src/utils/smpp_mirror +sms.db +src/osmo-msc/*.cfg* #tests tests/testsuite.dir @@ -77,7 +65,4 @@ tests/testsuite tests/testsuite.log -gsn_restart -src/openbsc.cfg* writtenconfig/ -gtphub_restart_count -- To view, visit https://gerrit.osmocom.org/4124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8bac4399a35b722908a4dc4d47c4962946ed52e9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 3 01:48:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 01:48:41 +0000 Subject: [PATCH] osmo-msc[master]: remove further files and autotest/autoconf bits irrelevant t... Message-ID: Review at https://gerrit.osmocom.org/4125 remove further files and autotest/autoconf bits irrelevant to osmo-msc Change-Id: I68e879e7474cbd3dd053f23bc4d5d22dc2748c5b --- M configure.ac D include/osmocom/msc/gtphub.h M tests/atlocal.in 3 files changed, 0 insertions(+), 534 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/25/4125/1 diff --git a/configure.ac b/configure.ac index 8f8bdb9..8f468d5 100644 --- a/configure.ac +++ b/configure.ac @@ -59,11 +59,6 @@ AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") AC_SUBST(osmo_ac_build_smpp) -# Enable/disable transcoding within osmo-bsc_mgcp? -AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])], - [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) -AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) - # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) diff --git a/include/osmocom/msc/gtphub.h b/include/osmocom/msc/gtphub.h deleted file mode 100644 index d7b6f1b..0000000 --- a/include/osmocom/msc/gtphub.h +++ /dev/null @@ -1,523 +0,0 @@ -/* GTP Hub Implementation */ - -/* (C) 2015 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include - -#include -#include -#include - -#include - - -/* support */ - -/* TODO move to osmocom/core/socket.c ? */ -#include /* for IPPROTO_* etc */ -struct osmo_sockaddr { - struct sockaddr_storage a; - socklen_t l; -}; - -/* TODO move to osmocom/core/socket.c ? */ -/*! \brief Initialize a sockaddr - * \param[out] addr Valid osmo_sockaddr pointer to write result to - * \param[in] family Address Family like AF_INET, AF_INET6, AF_UNSPEC - * \param[in] type Socket type like SOCK_DGRAM, SOCK_STREAM - * \param[in] proto Protocol like IPPROTO_TCP, IPPROTO_UDP - * \param[in] host Remote host name or IP address in string form - * \param[in] port Remote port number in host byte order - * \returns 0 on success, otherwise an error code (from getaddrinfo()). - * - * Copy the first result from a getaddrinfo() call with the given parameters to - * *addr and *addr_len. On error, do not change *addr and return nonzero. - */ -int osmo_sockaddr_init(struct osmo_sockaddr *addr, - uint16_t family, uint16_t type, uint8_t proto, - const char *host, uint16_t port); - -/* Conveniently pass AF_UNSPEC, SOCK_DGRAM and IPPROTO_UDP to - * osmo_sockaddr_init(). */ -static inline int osmo_sockaddr_init_udp(struct osmo_sockaddr *addr, - const char *host, uint16_t port) -{ - return osmo_sockaddr_init(addr, AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, - host, port); -} - -/*! \brief convert sockaddr to human readable string. - * \param[out] addr_str Valid pointer to a buffer of length addr_str_len. - * \param[in] addr_str_len Size of buffer addr_str points at. - * \param[out] port_str Valid pointer to a buffer of length port_str_len. - * \param[in] port_str_len Size of buffer port_str points at. - * \param[in] addr Binary representation as returned by osmo_sockaddr_init(). - * \param[in] flags flags as passed to getnameinfo(). - * \returns 0 on success, an error code on error. - * - * Return the IPv4 or IPv6 address string and the port (a.k.a. service) string - * representations of the given struct osmo_sockaddr in two caller provided - * char buffers. Flags of (NI_NUMERICHOST | NI_NUMERICSERV) return numeric - * address and port. Either one of addr_str or port_str may be NULL, in which - * case nothing is returned there. - * - * See also osmo_sockaddr_to_str() (less flexible, but much more convenient). */ -int osmo_sockaddr_to_strs(char *addr_str, size_t addr_str_len, - char *port_str, size_t port_str_len, - const struct osmo_sockaddr *addr, - int flags); - - -/*! \brief concatenate the parts returned by osmo_sockaddr_to_strs(). - * \param[in] addr Binary representation as returned by osmo_sockaddr_init(). - * \param[in] buf A buffer to use for string operations. - * \param[in] buf_len Length of the buffer. - * \returns Address string (in buffer). - * - * Compose a string of the numeric IP-address and port represented by *addr of - * the form " port ". The returned string is valid until the - * next invocation of this function. - */ -const char *osmo_sockaddr_to_strb(const struct osmo_sockaddr *addr, - char *buf, size_t buf_len); - -/*! \brief conveniently return osmo_sockaddr_to_strb() in a static buffer. - * \param[in] addr Binary representation as returned by osmo_sockaddr_init(). - * \returns Address string in static buffer. - * - * See osmo_sockaddr_to_strb(). - * - * Note: only one osmo_sockaddr_to_str() call will work per print/log - * statement. For two or more, use osmo_sockaddr_to_strb() with a separate - * buffer each. - */ -const char *osmo_sockaddr_to_str(const struct osmo_sockaddr *addr); - -/*! \brief compare two osmo_sockaddr. - * \param[in] a The first address to compare. - * \param[in] b The other address to compare. - * \returns 0 if equal, otherwise -1 or 1. - */ -int osmo_sockaddr_cmp(const struct osmo_sockaddr *a, - const struct osmo_sockaddr *b); - -/*! \brief Overwrite *dst with *src. - * Like memcpy(), but copy only the valid bytes. */ -void osmo_sockaddr_copy(struct osmo_sockaddr *dst, - const struct osmo_sockaddr *src); - - -/* general */ - -enum gtphub_plane_idx { - GTPH_PLANE_CTRL = 0, - GTPH_PLANE_USER = 1, - GTPH_PLANE_N -}; - -enum gtphub_side_idx { - GTPH_SIDE_SGSN = 0, - GTPH_SIDE_GGSN = 1, - GTPH_SIDE_N -}; - -#define for_each_side(I) for (I = 0; I < GTPH_SIDE_N; I++) -#define for_each_plane(I) for (I = 0; I < GTPH_PLANE_N; I++) -#define for_each_side_and_plane(I,J) for_each_side(I) for_each_plane(J) - -static inline int other_side_idx(int side_idx) -{ - return (side_idx + 1) & 1; -} - -extern const char* const gtphub_plane_idx_names[GTPH_PLANE_N]; -extern const uint16_t gtphub_plane_idx_default_port[GTPH_PLANE_N]; - -extern const char* const gtphub_side_idx_names[GTPH_SIDE_N]; - -/* A host address in the form that is expected in the 7.7.32 GSN Address IE. - * len is either 4 (IPv4) or 16 (IPv6), any other value is invalid. If no - * address is set, len shall be 0. */ -struct gsn_addr { - uint16_t len; - uint8_t buf[16]; -}; - -void gsn_addr_copy(struct gsn_addr *gsna, const struct gsn_addr *src); -int gsn_addr_from_str(struct gsn_addr *gsna, const char *numeric_addr_str); - -/* Return gsna in numeric string form, in a static buffer. */ -const char *gsn_addr_to_str(const struct gsn_addr *gsna); - -/* note: strbuf_len doesn't need to be larger than INET6_ADDRSTRLEN + 1. */ -const char *gsn_addr_to_strb(const struct gsn_addr *gsna, - char *strbuf, int strbuf_len); - -/* Return 1 on match, zero otherwise. */ -int gsn_addr_same(const struct gsn_addr *a, const struct gsn_addr *b); - -/* Decode sa to gsna. Return 0 on success. If port is non-NULL, the port number - * from sa is also returned. */ -int gsn_addr_from_sockaddr(struct gsn_addr *gsna, uint16_t *port, - const struct osmo_sockaddr *sa); - -/* expiry */ - -struct expiring_item; -typedef void (*del_cb_t)(struct expiring_item *); - -struct expiring_item { - struct llist_head entry; - time_t expiry; - del_cb_t del_cb; -}; - -struct expiry { - int expiry_in_seconds; - struct llist_head items; -}; - -/* Initialize an expiry queue. */ -void expiry_init(struct expiry *exq, int expiry_in_seconds); - -/* Add a new mapping, or restart the expiry timeout for an already listed - * mapping. */ -void expiry_add(struct expiry *exq, struct expiring_item *item, time_t now); - -/* Initialize to all-empty; must be called before using the item in any way. */ -void expiring_item_init(struct expiring_item *item); - -/* Remove the given item from its expiry queue, and call item->del_cb, if set. - * This sets item->del_cb to NULL and is harmless when run a second time on the - * same item, so the del_cb may choose to call this function, too, to allow - * deleting items from several code paths. */ -void expiring_item_del(struct expiring_item *item); - -/* Carry out due expiry of mappings. Must be invoked regularly. - * 'now' is the current clock count in seconds and must correspond to the clock - * count passed to nr_map_add(). A monotonous clock counter should be used. */ -int expiry_tick(struct expiry *exq, time_t now); - -/* Expire all items. */ -void expiry_clear(struct expiry *exq); - - -/* number map */ - -/* A number map assigns a "random" mapped number to each user provided number. - * If the same number is requested multiple times, the same mapped number is - * returned. - * - * Number maps plug into possibly shared pools and expiry queues, for example: - * - * mapA -----------+-> pool1 <-+-- mapB - * {10->1, 11->5} | {1, 2, 3, ...} | {10->2, 11->3} - * | | - * | | - * /-> \-> expiry1 <-/ - * | (30 seconds) - * | - * mapC -------+-----> pool2 <-+-- mapD - * {10->1, 11->3} {1, 2, 3, ...} | {10->2, 11->5} - * | - * expiry2 <-/ - * (60 seconds) - * - * A map contains mappings ("10->1"). Each map needs a number pool, which can - * be shared with other maps. Each new mapping receives a number from the pool, - * which is then unavailable to any other map using the same pool. - * - * A map may point at an expiry queue, in which case all mappings added to it - * are also appended to the expiry queue (using a separate llist entry in the - * mapping). Any number of maps may submit to the same expiry queue, if they - * desire the same expiry timeout. An expiry queue stores the mappings in - * chronological order, so that expiry checking is needed only from the start - * of the queue; hence only mappings with identical expiry timeout can be added - * to the same expiry queue. Upon expiry, a mapping is dropped from the map it - * was submitted at. expiry_tick() needs to be called regularly for each expiry - * queue. - * - * A nr_mapping can be embedded in a larger struct: each mapping can have a - * distinct destructor (del_cb), and each del_cb can figure out the container - * struct's address and free that upon expiry or manual deletion. So in expiry - * queues (and even maps), mappings of different container types can be mixed. - * This can help to drastically reduce the amount of unnecessary visits during - * expiry checking, for the case that no expiry is pending. An expiry queue - * always knows which mappings to expire next, because they are right at the - * start of its list. - * - * Mapping allocation and a del_cb are provided by the caller. If del_cb is - * NULL, no deallocation will be done (allowing statically allocated entries). - */ - -typedef unsigned int nr_t; - -/* Generator for unused numbers. So far this counts upwards from zero, but the - * implementation may change in the future. Treat this like an opaque struct. - * If this becomes random, the tests need to be fixed. */ -struct nr_pool { - nr_t last_nr; - nr_t nr_min; - nr_t nr_max; -}; - -struct nr_mapping { - struct llist_head entry; - struct expiring_item expiry_entry; - - void *origin; - nr_t orig; - nr_t repl; -}; - -struct nr_map { - struct nr_pool *pool; /* multiple nr_maps can share a nr_pool. */ - struct expiry *add_items_to_expiry; - struct llist_head mappings; -}; - - -void nr_pool_init(struct nr_pool *pool, nr_t nr_min, nr_t nr_max); - -/* Return the next unused number from the nr_pool. */ -nr_t nr_pool_next(struct nr_pool *pool); - -/* Initialize the nr_mapping to zero/empty values. */ -void nr_mapping_init(struct nr_mapping *mapping); - -/* Remove the given mapping from its parent map and expiry queue, and call - * mapping->del_cb, if set. */ -void nr_mapping_del(struct nr_mapping *mapping); - -/* Initialize an (already allocated) nr_map, and set the map's number pool. - * Multiple nr_map instances may use the same nr_pool. Set the nr_map's expiry - * queue to exq, so that all added mappings are automatically expired after the - * time configured in exq. exq may be NULL to disable automatic expiry. */ -void nr_map_init(struct nr_map *map, struct nr_pool *pool, - struct expiry *exq); - -/* Add a new entry to the map. mapping->orig, mapping->origin and - * mapping->del_cb must be set before calling this function. The remaining - * fields of *mapping will be overwritten. mapping->repl is set to the next - * available mapped number from map->pool. 'now' is the current clock count in - * seconds; if no map->expiry is used, just pass 0 for 'now'. */ -void nr_map_add(struct nr_map *map, struct nr_mapping *mapping, - time_t now); - -/* Restart the timeout for the given mapping. mapping must be a member of map. - */ -void nr_map_refresh(struct nr_map *map, struct nr_mapping *mapping, - time_t now); - -/* Return a known mapping from nr_orig and the given origin. If nr_orig is - * unknown, return NULL. */ -struct nr_mapping *nr_map_get(const struct nr_map *map, - void *origin, nr_t nr_orig); - -/* Return a known mapping to nr_repl. If nr_repl is unknown, return NULL. */ -struct nr_mapping *nr_map_get_inv(const struct nr_map *map, nr_t nr_repl); - -/* Remove all mappings from map. */ -void nr_map_clear(struct nr_map *map); - -/* Return 1 if map has no entries, 0 otherwise. */ -int nr_map_empty(const struct nr_map *map); - - -/* config */ - -static const int GTPH_EXPIRE_QUICKLY_SECS = 30; /* TODO is there a spec for this? */ -static const int GTPH_EXPIRE_SLOWLY_MINUTES = 6 * 60; /* TODO is there a spec for this? */ - -struct gtphub_cfg_addr { - const char *addr_str; - uint16_t port; -}; - -struct gtphub_cfg_bind { - struct gtphub_cfg_addr bind; -}; - -struct gtphub_cfg { - struct gtphub_cfg_bind to_gsns[GTPH_SIDE_N][GTPH_PLANE_N]; - struct gtphub_cfg_addr proxy[GTPH_SIDE_N][GTPH_PLANE_N]; - int sgsn_use_sender; /* Use sender, not GSN addr IE with std ports */ -}; - - -/* state */ - -struct gtphub_peer { - struct llist_head entry; - - struct llist_head addresses; /* Alternatives, not load balancing. */ - struct nr_pool seq_pool; - struct nr_map seq_map; -}; - -struct gtphub_peer_addr { - struct llist_head entry; - - struct gtphub_peer *peer; - struct gsn_addr addr; - struct llist_head ports; -}; - -struct gtphub_peer_port { - struct llist_head entry; - - struct gtphub_peer_addr *peer_addr; - uint16_t port; - unsigned int ref_count; /* references from other peers' seq_maps */ - struct osmo_sockaddr sa; /* a "cache" for (peer_addr->addr, port) */ - int last_restart_count; /* 0..255 = valid, all else means unknown */ - - struct rate_ctr_group *counters_io; -}; - -struct gtphub_tunnel_endpoint { - struct gtphub_peer_port *peer; - uint32_t tei_orig; /* from/to peer */ - - struct rate_ctr_group *counters_io; -}; - -struct gtphub_tunnel { - struct llist_head entry; - struct expiring_item expiry_entry; - - uint32_t tei_repl; /* unique TEI to replace peers' TEIs */ - struct gtphub_tunnel_endpoint endpoint[GTPH_SIDE_N][GTPH_PLANE_N]; -}; - -struct gtphub_bind { - struct gsn_addr local_addr; - uint16_t local_port; - struct osmo_fd ofd; - - /* list of struct gtphub_peer */ - struct llist_head peers; - - const char *label; /* For logging */ - struct rate_ctr_group *counters_io; -}; - -struct gtphub_resolved_ggsn { - struct llist_head entry; - struct expiring_item expiry_entry; - - /* The APN OI, the Operator Identifier, is the combined address, - * including parts of the IMSI and APN NI, and ending with ".gprs". */ - char apn_oi_str[GSM_APN_LENGTH]; - - /* Which address and port we resolved that to. */ - struct gtphub_peer_port *peer; -}; - -struct gtphub { - struct gtphub_bind to_gsns[GTPH_SIDE_N][GTPH_PLANE_N]; - - /* pointers to an entry of to_gsns[s][p].peers */ - struct gtphub_peer_port *proxy[GTPH_SIDE_N][GTPH_PLANE_N]; - - /* The TEI numbers will simply wrap and be reused, which will work out - * in practice. Problems would arise if one given peer maintained the - * same TEI for a time long enough for the TEI nr map to wrap an entire - * uint32_t; if a new TEI were mapped every second, this would take - * more than 100 years (in which a single given TEI must not time out) - * to cause a problem. */ - struct nr_pool tei_pool; - - struct llist_head tunnels; /* struct gtphub_tunnel */ - struct llist_head pending_deletes; /* opaque (gtphub.c) */ - - struct llist_head ggsn_lookups; /* opaque (gtphub_ares.c) */ - struct llist_head resolved_ggsns; /* struct gtphub_resolved_ggsn */ - - struct osmo_timer_list gc_timer; - struct expiry expire_quickly; - struct expiry expire_slowly; - - uint8_t restart_counter; - - int sgsn_use_sender; -}; - -struct gtp_packet_desc; - - -/* api */ - -int gtphub_vty_init(struct gtphub *global_hub, struct gtphub_cfg *global_cfg); -int gtphub_cfg_read(struct gtphub_cfg *cfg, const char *config_file); - -/* Initialize and start gtphub: bind to ports, run expiry timers. */ -int gtphub_start(struct gtphub *hub, struct gtphub_cfg *cfg, - uint8_t restart_counter); - -/* Close all sockets, expire all maps and peers and free all allocations. The - * struct is then unusable, unless gtphub_start() is run on it again. */ -void gtphub_stop(struct gtphub *hub); - -time_t gtphub_now(void); - -/* Remove expired items, empty peers, ... */ -void gtphub_gc(struct gtphub *hub, time_t now); - -/* Return the string of the first address for this peer. */ -const char *gtphub_peer_str(struct gtphub_peer *peer); - -/* Return a human readable description of tun in a static buffer. */ -const char *gtphub_tunnel_str(struct gtphub_tunnel *tun); - -/* Return 1 if all of tun's endpoints are fully established, 0 otherwise. */ -int gtphub_tunnel_complete(struct gtphub_tunnel *tun); - -int gtphub_handle_buf(struct gtphub *hub, - unsigned int side_idx, - unsigned int port_idx, - const struct osmo_sockaddr *from_addr, - uint8_t *buf, - size_t received, - time_t now, - uint8_t **reply_buf, - struct osmo_fd **to_ofd, - struct osmo_sockaddr *to_addr); - -struct gtphub_peer_port *gtphub_port_have(struct gtphub *hub, - struct gtphub_bind *bind, - const struct gsn_addr *addr, - uint16_t port); - -struct gtphub_peer_port *gtphub_port_find_sa(const struct gtphub_bind *bind, - const struct osmo_sockaddr *addr); - -void gtphub_resolved_ggsn(struct gtphub *hub, const char *apn_oi_str, - struct gsn_addr *resolved_addr, - time_t now); - -const char *gtphub_port_str(struct gtphub_peer_port *port); - -int gtphub_write(const struct osmo_fd *to, - const struct osmo_sockaddr *to_addr, - const uint8_t *buf, size_t buf_len); diff --git a/tests/atlocal.in b/tests/atlocal.in index 362bfa9..f361387 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -1,7 +1 @@ -enable_nat_test='@osmo_ac_build_nat@' enable_smpp_test='@osmo_ac_build_smpp@' -enable_bsc_test='@osmo_ac_build_bsc@' -enable_mgcp_transcoding_test='@osmo_ac_mgcp_transcoding@' -enable_sgsn_test='@found_libgtp_and_libcares@' -enable_oap_test='@found_libgtp_and_libcares@' -enable_gtphub_test='@found_libgtp_and_libcares@' -- To view, visit https://gerrit.osmocom.org/4125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68e879e7474cbd3dd053f23bc4d5d22dc2748c5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 3 01:54:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 01:54:43 +0000 Subject: [PATCH] osmo-bsc[master]: .gitignore: Update to post-NITB-split realities Message-ID: Review at https://gerrit.osmocom.org/4126 .gitignore: Update to post-NITB-split realities Change-Id: I4655e7e0f79073061b97e0918583b7eaf99bf797 --- M .gitignore 1 file changed, 13 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/26/4126/1 diff --git a/.gitignore b/.gitignore index a9e6b84..3481bad 100644 --- a/.gitignore +++ b/.gitignore @@ -7,15 +7,8 @@ Makefile.in bscconfig.h bscconfig.h.in -openbsc.pc -src/osmo-nitb/osmo-nitb -src/osmo-bsc_mgcp/osmo-bsc_mgcp -src/osmo-bsc/osmo-bsc -src/utils/meas_vis -src/utils/meas_json -src/utils/osmo-meas-pcap2db -src/utils/osmo-meas-udp2db -src/utils/smpp_mirror +*.pc + *.*~ *.sw? .libs @@ -38,11 +31,13 @@ stamp-h1 libtool ltmain.sh +m4/*.m4 # git-version-gen magic .tarball-version .version - +osmo-bsc-*.tar.bz2 +osmo-bsc-*.tar.gz # apps and app data hlr.sqlite3 @@ -52,24 +47,19 @@ src/ipaccess/ipaccess-firmware src/ipaccess/ipaccess-proxy src/utils/isdnsync -src/nat/bsc_nat -src/gprs/osmo-sgsn -src/gprs/osmo-gbproxy -src/gprs/osmo-gtphub src/osmo-bsc_nat/osmo-bsc_nat -src/libcommon/gsup_test_client -src/osmo-msc/osmo-msc +src/osmo-bsc_nat/*.cfg* +src/osmo-bsc/osmo-bsc +src/osmo-bsc/*.cfg* +src/utils/meas_vis +src/utils/meas_json +src/utils/osmo-meas-pcap2db +src/utils/osmo-meas-udp2db + #tests tests/testsuite.dir tests/*/*_test -# ignore compiled binaries like msc_vlr_test_foo; do not ignore -# msc_vlr_test_foo.{c,ok,err}, but do still ignore the corresponding .o object -# files: -tests/msc_vlr/msc_vlr_test_* -!tests/msc_vlr/msc_vlr_test_*.* -tests/msc_vlr/msc_vlr_test_*.o - tests/atconfig tests/atlocal @@ -77,7 +67,4 @@ tests/testsuite tests/testsuite.log -gsn_restart -src/openbsc.cfg* writtenconfig/ -gtphub_restart_count -- To view, visit https://gerrit.osmocom.org/4126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4655e7e0f79073061b97e0918583b7eaf99bf797 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 3 06:22:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 06:22:18 +0000 Subject: osmo-msc[master]: Update .gitignore for post-nitb-split In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8bac4399a35b722908a4dc4d47c4962946ed52e9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 3 06:22:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 06:22:22 +0000 Subject: osmo-msc[master]: remove further files and autotest/autoconf bits irrelevant t... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68e879e7474cbd3dd053f23bc4d5d22dc2748c5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 3 06:22:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 06:22:24 +0000 Subject: [MERGED] osmo-msc[master]: remove further files and autotest/autoconf bits irrelevant t... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove further files and autotest/autoconf bits irrelevant to osmo-msc ...................................................................... remove further files and autotest/autoconf bits irrelevant to osmo-msc Change-Id: I68e879e7474cbd3dd053f23bc4d5d22dc2748c5b --- M configure.ac D include/osmocom/msc/gtphub.h M tests/atlocal.in 3 files changed, 0 insertions(+), 534 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 8f8bdb9..8f468d5 100644 --- a/configure.ac +++ b/configure.ac @@ -59,11 +59,6 @@ AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") AC_SUBST(osmo_ac_build_smpp) -# Enable/disable transcoding within osmo-bsc_mgcp? -AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])], - [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) -AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) - # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) diff --git a/include/osmocom/msc/gtphub.h b/include/osmocom/msc/gtphub.h deleted file mode 100644 index d7b6f1b..0000000 --- a/include/osmocom/msc/gtphub.h +++ /dev/null @@ -1,523 +0,0 @@ -/* GTP Hub Implementation */ - -/* (C) 2015 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include - -#include -#include -#include - -#include - - -/* support */ - -/* TODO move to osmocom/core/socket.c ? */ -#include /* for IPPROTO_* etc */ -struct osmo_sockaddr { - struct sockaddr_storage a; - socklen_t l; -}; - -/* TODO move to osmocom/core/socket.c ? */ -/*! \brief Initialize a sockaddr - * \param[out] addr Valid osmo_sockaddr pointer to write result to - * \param[in] family Address Family like AF_INET, AF_INET6, AF_UNSPEC - * \param[in] type Socket type like SOCK_DGRAM, SOCK_STREAM - * \param[in] proto Protocol like IPPROTO_TCP, IPPROTO_UDP - * \param[in] host Remote host name or IP address in string form - * \param[in] port Remote port number in host byte order - * \returns 0 on success, otherwise an error code (from getaddrinfo()). - * - * Copy the first result from a getaddrinfo() call with the given parameters to - * *addr and *addr_len. On error, do not change *addr and return nonzero. - */ -int osmo_sockaddr_init(struct osmo_sockaddr *addr, - uint16_t family, uint16_t type, uint8_t proto, - const char *host, uint16_t port); - -/* Conveniently pass AF_UNSPEC, SOCK_DGRAM and IPPROTO_UDP to - * osmo_sockaddr_init(). */ -static inline int osmo_sockaddr_init_udp(struct osmo_sockaddr *addr, - const char *host, uint16_t port) -{ - return osmo_sockaddr_init(addr, AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, - host, port); -} - -/*! \brief convert sockaddr to human readable string. - * \param[out] addr_str Valid pointer to a buffer of length addr_str_len. - * \param[in] addr_str_len Size of buffer addr_str points at. - * \param[out] port_str Valid pointer to a buffer of length port_str_len. - * \param[in] port_str_len Size of buffer port_str points at. - * \param[in] addr Binary representation as returned by osmo_sockaddr_init(). - * \param[in] flags flags as passed to getnameinfo(). - * \returns 0 on success, an error code on error. - * - * Return the IPv4 or IPv6 address string and the port (a.k.a. service) string - * representations of the given struct osmo_sockaddr in two caller provided - * char buffers. Flags of (NI_NUMERICHOST | NI_NUMERICSERV) return numeric - * address and port. Either one of addr_str or port_str may be NULL, in which - * case nothing is returned there. - * - * See also osmo_sockaddr_to_str() (less flexible, but much more convenient). */ -int osmo_sockaddr_to_strs(char *addr_str, size_t addr_str_len, - char *port_str, size_t port_str_len, - const struct osmo_sockaddr *addr, - int flags); - - -/*! \brief concatenate the parts returned by osmo_sockaddr_to_strs(). - * \param[in] addr Binary representation as returned by osmo_sockaddr_init(). - * \param[in] buf A buffer to use for string operations. - * \param[in] buf_len Length of the buffer. - * \returns Address string (in buffer). - * - * Compose a string of the numeric IP-address and port represented by *addr of - * the form " port ". The returned string is valid until the - * next invocation of this function. - */ -const char *osmo_sockaddr_to_strb(const struct osmo_sockaddr *addr, - char *buf, size_t buf_len); - -/*! \brief conveniently return osmo_sockaddr_to_strb() in a static buffer. - * \param[in] addr Binary representation as returned by osmo_sockaddr_init(). - * \returns Address string in static buffer. - * - * See osmo_sockaddr_to_strb(). - * - * Note: only one osmo_sockaddr_to_str() call will work per print/log - * statement. For two or more, use osmo_sockaddr_to_strb() with a separate - * buffer each. - */ -const char *osmo_sockaddr_to_str(const struct osmo_sockaddr *addr); - -/*! \brief compare two osmo_sockaddr. - * \param[in] a The first address to compare. - * \param[in] b The other address to compare. - * \returns 0 if equal, otherwise -1 or 1. - */ -int osmo_sockaddr_cmp(const struct osmo_sockaddr *a, - const struct osmo_sockaddr *b); - -/*! \brief Overwrite *dst with *src. - * Like memcpy(), but copy only the valid bytes. */ -void osmo_sockaddr_copy(struct osmo_sockaddr *dst, - const struct osmo_sockaddr *src); - - -/* general */ - -enum gtphub_plane_idx { - GTPH_PLANE_CTRL = 0, - GTPH_PLANE_USER = 1, - GTPH_PLANE_N -}; - -enum gtphub_side_idx { - GTPH_SIDE_SGSN = 0, - GTPH_SIDE_GGSN = 1, - GTPH_SIDE_N -}; - -#define for_each_side(I) for (I = 0; I < GTPH_SIDE_N; I++) -#define for_each_plane(I) for (I = 0; I < GTPH_PLANE_N; I++) -#define for_each_side_and_plane(I,J) for_each_side(I) for_each_plane(J) - -static inline int other_side_idx(int side_idx) -{ - return (side_idx + 1) & 1; -} - -extern const char* const gtphub_plane_idx_names[GTPH_PLANE_N]; -extern const uint16_t gtphub_plane_idx_default_port[GTPH_PLANE_N]; - -extern const char* const gtphub_side_idx_names[GTPH_SIDE_N]; - -/* A host address in the form that is expected in the 7.7.32 GSN Address IE. - * len is either 4 (IPv4) or 16 (IPv6), any other value is invalid. If no - * address is set, len shall be 0. */ -struct gsn_addr { - uint16_t len; - uint8_t buf[16]; -}; - -void gsn_addr_copy(struct gsn_addr *gsna, const struct gsn_addr *src); -int gsn_addr_from_str(struct gsn_addr *gsna, const char *numeric_addr_str); - -/* Return gsna in numeric string form, in a static buffer. */ -const char *gsn_addr_to_str(const struct gsn_addr *gsna); - -/* note: strbuf_len doesn't need to be larger than INET6_ADDRSTRLEN + 1. */ -const char *gsn_addr_to_strb(const struct gsn_addr *gsna, - char *strbuf, int strbuf_len); - -/* Return 1 on match, zero otherwise. */ -int gsn_addr_same(const struct gsn_addr *a, const struct gsn_addr *b); - -/* Decode sa to gsna. Return 0 on success. If port is non-NULL, the port number - * from sa is also returned. */ -int gsn_addr_from_sockaddr(struct gsn_addr *gsna, uint16_t *port, - const struct osmo_sockaddr *sa); - -/* expiry */ - -struct expiring_item; -typedef void (*del_cb_t)(struct expiring_item *); - -struct expiring_item { - struct llist_head entry; - time_t expiry; - del_cb_t del_cb; -}; - -struct expiry { - int expiry_in_seconds; - struct llist_head items; -}; - -/* Initialize an expiry queue. */ -void expiry_init(struct expiry *exq, int expiry_in_seconds); - -/* Add a new mapping, or restart the expiry timeout for an already listed - * mapping. */ -void expiry_add(struct expiry *exq, struct expiring_item *item, time_t now); - -/* Initialize to all-empty; must be called before using the item in any way. */ -void expiring_item_init(struct expiring_item *item); - -/* Remove the given item from its expiry queue, and call item->del_cb, if set. - * This sets item->del_cb to NULL and is harmless when run a second time on the - * same item, so the del_cb may choose to call this function, too, to allow - * deleting items from several code paths. */ -void expiring_item_del(struct expiring_item *item); - -/* Carry out due expiry of mappings. Must be invoked regularly. - * 'now' is the current clock count in seconds and must correspond to the clock - * count passed to nr_map_add(). A monotonous clock counter should be used. */ -int expiry_tick(struct expiry *exq, time_t now); - -/* Expire all items. */ -void expiry_clear(struct expiry *exq); - - -/* number map */ - -/* A number map assigns a "random" mapped number to each user provided number. - * If the same number is requested multiple times, the same mapped number is - * returned. - * - * Number maps plug into possibly shared pools and expiry queues, for example: - * - * mapA -----------+-> pool1 <-+-- mapB - * {10->1, 11->5} | {1, 2, 3, ...} | {10->2, 11->3} - * | | - * | | - * /-> \-> expiry1 <-/ - * | (30 seconds) - * | - * mapC -------+-----> pool2 <-+-- mapD - * {10->1, 11->3} {1, 2, 3, ...} | {10->2, 11->5} - * | - * expiry2 <-/ - * (60 seconds) - * - * A map contains mappings ("10->1"). Each map needs a number pool, which can - * be shared with other maps. Each new mapping receives a number from the pool, - * which is then unavailable to any other map using the same pool. - * - * A map may point at an expiry queue, in which case all mappings added to it - * are also appended to the expiry queue (using a separate llist entry in the - * mapping). Any number of maps may submit to the same expiry queue, if they - * desire the same expiry timeout. An expiry queue stores the mappings in - * chronological order, so that expiry checking is needed only from the start - * of the queue; hence only mappings with identical expiry timeout can be added - * to the same expiry queue. Upon expiry, a mapping is dropped from the map it - * was submitted at. expiry_tick() needs to be called regularly for each expiry - * queue. - * - * A nr_mapping can be embedded in a larger struct: each mapping can have a - * distinct destructor (del_cb), and each del_cb can figure out the container - * struct's address and free that upon expiry or manual deletion. So in expiry - * queues (and even maps), mappings of different container types can be mixed. - * This can help to drastically reduce the amount of unnecessary visits during - * expiry checking, for the case that no expiry is pending. An expiry queue - * always knows which mappings to expire next, because they are right at the - * start of its list. - * - * Mapping allocation and a del_cb are provided by the caller. If del_cb is - * NULL, no deallocation will be done (allowing statically allocated entries). - */ - -typedef unsigned int nr_t; - -/* Generator for unused numbers. So far this counts upwards from zero, but the - * implementation may change in the future. Treat this like an opaque struct. - * If this becomes random, the tests need to be fixed. */ -struct nr_pool { - nr_t last_nr; - nr_t nr_min; - nr_t nr_max; -}; - -struct nr_mapping { - struct llist_head entry; - struct expiring_item expiry_entry; - - void *origin; - nr_t orig; - nr_t repl; -}; - -struct nr_map { - struct nr_pool *pool; /* multiple nr_maps can share a nr_pool. */ - struct expiry *add_items_to_expiry; - struct llist_head mappings; -}; - - -void nr_pool_init(struct nr_pool *pool, nr_t nr_min, nr_t nr_max); - -/* Return the next unused number from the nr_pool. */ -nr_t nr_pool_next(struct nr_pool *pool); - -/* Initialize the nr_mapping to zero/empty values. */ -void nr_mapping_init(struct nr_mapping *mapping); - -/* Remove the given mapping from its parent map and expiry queue, and call - * mapping->del_cb, if set. */ -void nr_mapping_del(struct nr_mapping *mapping); - -/* Initialize an (already allocated) nr_map, and set the map's number pool. - * Multiple nr_map instances may use the same nr_pool. Set the nr_map's expiry - * queue to exq, so that all added mappings are automatically expired after the - * time configured in exq. exq may be NULL to disable automatic expiry. */ -void nr_map_init(struct nr_map *map, struct nr_pool *pool, - struct expiry *exq); - -/* Add a new entry to the map. mapping->orig, mapping->origin and - * mapping->del_cb must be set before calling this function. The remaining - * fields of *mapping will be overwritten. mapping->repl is set to the next - * available mapped number from map->pool. 'now' is the current clock count in - * seconds; if no map->expiry is used, just pass 0 for 'now'. */ -void nr_map_add(struct nr_map *map, struct nr_mapping *mapping, - time_t now); - -/* Restart the timeout for the given mapping. mapping must be a member of map. - */ -void nr_map_refresh(struct nr_map *map, struct nr_mapping *mapping, - time_t now); - -/* Return a known mapping from nr_orig and the given origin. If nr_orig is - * unknown, return NULL. */ -struct nr_mapping *nr_map_get(const struct nr_map *map, - void *origin, nr_t nr_orig); - -/* Return a known mapping to nr_repl. If nr_repl is unknown, return NULL. */ -struct nr_mapping *nr_map_get_inv(const struct nr_map *map, nr_t nr_repl); - -/* Remove all mappings from map. */ -void nr_map_clear(struct nr_map *map); - -/* Return 1 if map has no entries, 0 otherwise. */ -int nr_map_empty(const struct nr_map *map); - - -/* config */ - -static const int GTPH_EXPIRE_QUICKLY_SECS = 30; /* TODO is there a spec for this? */ -static const int GTPH_EXPIRE_SLOWLY_MINUTES = 6 * 60; /* TODO is there a spec for this? */ - -struct gtphub_cfg_addr { - const char *addr_str; - uint16_t port; -}; - -struct gtphub_cfg_bind { - struct gtphub_cfg_addr bind; -}; - -struct gtphub_cfg { - struct gtphub_cfg_bind to_gsns[GTPH_SIDE_N][GTPH_PLANE_N]; - struct gtphub_cfg_addr proxy[GTPH_SIDE_N][GTPH_PLANE_N]; - int sgsn_use_sender; /* Use sender, not GSN addr IE with std ports */ -}; - - -/* state */ - -struct gtphub_peer { - struct llist_head entry; - - struct llist_head addresses; /* Alternatives, not load balancing. */ - struct nr_pool seq_pool; - struct nr_map seq_map; -}; - -struct gtphub_peer_addr { - struct llist_head entry; - - struct gtphub_peer *peer; - struct gsn_addr addr; - struct llist_head ports; -}; - -struct gtphub_peer_port { - struct llist_head entry; - - struct gtphub_peer_addr *peer_addr; - uint16_t port; - unsigned int ref_count; /* references from other peers' seq_maps */ - struct osmo_sockaddr sa; /* a "cache" for (peer_addr->addr, port) */ - int last_restart_count; /* 0..255 = valid, all else means unknown */ - - struct rate_ctr_group *counters_io; -}; - -struct gtphub_tunnel_endpoint { - struct gtphub_peer_port *peer; - uint32_t tei_orig; /* from/to peer */ - - struct rate_ctr_group *counters_io; -}; - -struct gtphub_tunnel { - struct llist_head entry; - struct expiring_item expiry_entry; - - uint32_t tei_repl; /* unique TEI to replace peers' TEIs */ - struct gtphub_tunnel_endpoint endpoint[GTPH_SIDE_N][GTPH_PLANE_N]; -}; - -struct gtphub_bind { - struct gsn_addr local_addr; - uint16_t local_port; - struct osmo_fd ofd; - - /* list of struct gtphub_peer */ - struct llist_head peers; - - const char *label; /* For logging */ - struct rate_ctr_group *counters_io; -}; - -struct gtphub_resolved_ggsn { - struct llist_head entry; - struct expiring_item expiry_entry; - - /* The APN OI, the Operator Identifier, is the combined address, - * including parts of the IMSI and APN NI, and ending with ".gprs". */ - char apn_oi_str[GSM_APN_LENGTH]; - - /* Which address and port we resolved that to. */ - struct gtphub_peer_port *peer; -}; - -struct gtphub { - struct gtphub_bind to_gsns[GTPH_SIDE_N][GTPH_PLANE_N]; - - /* pointers to an entry of to_gsns[s][p].peers */ - struct gtphub_peer_port *proxy[GTPH_SIDE_N][GTPH_PLANE_N]; - - /* The TEI numbers will simply wrap and be reused, which will work out - * in practice. Problems would arise if one given peer maintained the - * same TEI for a time long enough for the TEI nr map to wrap an entire - * uint32_t; if a new TEI were mapped every second, this would take - * more than 100 years (in which a single given TEI must not time out) - * to cause a problem. */ - struct nr_pool tei_pool; - - struct llist_head tunnels; /* struct gtphub_tunnel */ - struct llist_head pending_deletes; /* opaque (gtphub.c) */ - - struct llist_head ggsn_lookups; /* opaque (gtphub_ares.c) */ - struct llist_head resolved_ggsns; /* struct gtphub_resolved_ggsn */ - - struct osmo_timer_list gc_timer; - struct expiry expire_quickly; - struct expiry expire_slowly; - - uint8_t restart_counter; - - int sgsn_use_sender; -}; - -struct gtp_packet_desc; - - -/* api */ - -int gtphub_vty_init(struct gtphub *global_hub, struct gtphub_cfg *global_cfg); -int gtphub_cfg_read(struct gtphub_cfg *cfg, const char *config_file); - -/* Initialize and start gtphub: bind to ports, run expiry timers. */ -int gtphub_start(struct gtphub *hub, struct gtphub_cfg *cfg, - uint8_t restart_counter); - -/* Close all sockets, expire all maps and peers and free all allocations. The - * struct is then unusable, unless gtphub_start() is run on it again. */ -void gtphub_stop(struct gtphub *hub); - -time_t gtphub_now(void); - -/* Remove expired items, empty peers, ... */ -void gtphub_gc(struct gtphub *hub, time_t now); - -/* Return the string of the first address for this peer. */ -const char *gtphub_peer_str(struct gtphub_peer *peer); - -/* Return a human readable description of tun in a static buffer. */ -const char *gtphub_tunnel_str(struct gtphub_tunnel *tun); - -/* Return 1 if all of tun's endpoints are fully established, 0 otherwise. */ -int gtphub_tunnel_complete(struct gtphub_tunnel *tun); - -int gtphub_handle_buf(struct gtphub *hub, - unsigned int side_idx, - unsigned int port_idx, - const struct osmo_sockaddr *from_addr, - uint8_t *buf, - size_t received, - time_t now, - uint8_t **reply_buf, - struct osmo_fd **to_ofd, - struct osmo_sockaddr *to_addr); - -struct gtphub_peer_port *gtphub_port_have(struct gtphub *hub, - struct gtphub_bind *bind, - const struct gsn_addr *addr, - uint16_t port); - -struct gtphub_peer_port *gtphub_port_find_sa(const struct gtphub_bind *bind, - const struct osmo_sockaddr *addr); - -void gtphub_resolved_ggsn(struct gtphub *hub, const char *apn_oi_str, - struct gsn_addr *resolved_addr, - time_t now); - -const char *gtphub_port_str(struct gtphub_peer_port *port); - -int gtphub_write(const struct osmo_fd *to, - const struct osmo_sockaddr *to_addr, - const uint8_t *buf, size_t buf_len); diff --git a/tests/atlocal.in b/tests/atlocal.in index 362bfa9..f361387 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -1,7 +1 @@ -enable_nat_test='@osmo_ac_build_nat@' enable_smpp_test='@osmo_ac_build_smpp@' -enable_bsc_test='@osmo_ac_build_bsc@' -enable_mgcp_transcoding_test='@osmo_ac_mgcp_transcoding@' -enable_sgsn_test='@found_libgtp_and_libcares@' -enable_oap_test='@found_libgtp_and_libcares@' -enable_gtphub_test='@found_libgtp_and_libcares@' -- To view, visit https://gerrit.osmocom.org/4125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I68e879e7474cbd3dd053f23bc4d5d22dc2748c5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 3 06:22:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 06:22:25 +0000 Subject: [MERGED] osmo-msc[master]: Update .gitignore for post-nitb-split In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Update .gitignore for post-nitb-split ...................................................................... Update .gitignore for post-nitb-split Change-Id: I8bac4399a35b722908a4dc4d47c4962946ed52e9 --- M .gitignore 1 file changed, 11 insertions(+), 26 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index a9e6b84..4873bbe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,15 +7,8 @@ Makefile.in bscconfig.h bscconfig.h.in -openbsc.pc -src/osmo-nitb/osmo-nitb -src/osmo-bsc_mgcp/osmo-bsc_mgcp -src/osmo-bsc/osmo-bsc -src/utils/meas_vis -src/utils/meas_json -src/utils/osmo-meas-pcap2db -src/utils/osmo-meas-udp2db -src/utils/smpp_mirror +*.pc + *.*~ *.sw? .libs @@ -38,27 +31,22 @@ stamp-h1 libtool ltmain.sh +m4/*.m4 # git-version-gen magic .tarball-version .version - # apps and app data -hlr.sqlite3 -src/utils/bs11_config -src/ipaccess/ipaccess-config -src/ipaccess/abisip-find -src/ipaccess/ipaccess-firmware -src/ipaccess/ipaccess-proxy -src/utils/isdnsync -src/nat/bsc_nat -src/gprs/osmo-sgsn -src/gprs/osmo-gbproxy -src/gprs/osmo-gtphub -src/osmo-bsc_nat/osmo-bsc_nat -src/libcommon/gsup_test_client src/osmo-msc/osmo-msc +src/libcommon/gsup_test_client +src/utils/meas_vis +src/utils/meas_json +src/utils/osmo-meas-pcap2db +src/utils/osmo-meas-udp2db +src/utils/smpp_mirror +sms.db +src/osmo-msc/*.cfg* #tests tests/testsuite.dir @@ -77,7 +65,4 @@ tests/testsuite tests/testsuite.log -gsn_restart -src/openbsc.cfg* writtenconfig/ -gtphub_restart_count -- To view, visit https://gerrit.osmocom.org/4124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8bac4399a35b722908a4dc4d47c4962946ed52e9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 3 06:22:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 06:22:34 +0000 Subject: osmo-bsc[master]: .gitignore: Update to post-NITB-split realities In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4655e7e0f79073061b97e0918583b7eaf99bf797 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 3 09:38:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 09:38:14 +0000 Subject: [PATCH] libosmocore[master]: WIP: Fixup severe build performance issues introduced by osm... Message-ID: Review at https://gerrit.osmocom.org/4127 WIP: Fixup severe build performance issues introduced by osmo-release.mk Make variable substitution calling bumpversion and other commands introduce by osmo-release.mk has severely slowed down builds. Inside the makefile we could use $(eval FOO:=$(shell...)) constructs to have variable substitution only happen once the 'release' target is executed. However, 'ifeq' and friends don't work with such late constructs. Let's shift all release action into a helper shell script that is called from the Makefile instead. This way we get the best of both worlds: No performance impact during normal builds, and the convenience of 'make release' TODO: installation of the helper script, or alternatively calling it from $(LIBOSMO_DIR) as we do in osmo-gsm-manuals? Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea --- M osmo-release.mk A osmo-release.sh 2 files changed, 51 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/4127/1 diff --git a/osmo-release.mk b/osmo-release.mk index 40eb121..01285b1 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -2,43 +2,8 @@ REL := patch endif -BUMPVER := $(shell bumpversion) -NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') -LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) -MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am) -ISODATE := $(shell date -I) - release: - -ifeq ($(BUMPVER),) - @$(error Unable to find 'bumpversion' command.) -endif - -ifeq ($(NEW_VER),) - @$(error Please fix versioning to match http://semver.org/ spec (current is $(VERSION)) before proceeding.) -endif - ifeq ($(origin REL), file) @echo "No REL value specified, defaulting to 'patch' release" endif - - @echo "Releasing" $(VERSION) "->" $(NEW_VER)"..." - -ifeq ($(LIBVERS),) - @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch -else - @echo "You should NOT be doing this unless you've read and understood following article:" - @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" - @grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries - @grep '#' TODO-RELEASE > TODO-RELEASE.clean - @mv TODO-RELEASE.clean TODO-RELEASE -ifeq ($(MAKEMOD),) - @$(if $(shell git status -s -uno TODO-RELEASE),,$(error Before releasing, please modify some of the libversions: $(LIBVERS))) -endif - @xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $(NEW_VER) "entry" -endif - @dch -r -m --distribution "unstable" "" - @git add -u - @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VER) --allow-dirty - @git tag -s $(NEW_VER) -f -m "Release v$(NEW_VER) on $(ISODATE)." - @echo "Release" $(NEW_VER) "prepared, tagged and signed." + @osmo-release.sh $(VERSION) $(REL) diff --git a/osmo-release.sh b/osmo-release.sh new file mode 100755 index 0000000..ff82e4c --- /dev/null +++ b/osmo-release.sh @@ -0,0 +1,50 @@ +#!/bin/sh +VERSION=$1 +REL=$2 + +if [ "z$REL" = "z" ]; then + echo "No REL value specified, defaulting to 'patch' release" + REL=patch +fi + +BUMPVER=`command -v bumpversion` + +NEW_VER=`bumpversion --list --current-version $VERSION $REL --allow-dirty | awk -F '=' '{ print $2 }'` +LIBVERS=`git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS` +MAKEMOD=`git diff -GLIBVERSION --stat | grep Makefile.am` +ISODATE=`date -I` + +if [ "z$BUMPVER" = "z" ]; then + echo Unable to find 'bumpversion' command. + exit 1 +fi + +if [ "z$NEW_VER" = "z" ]; then + echo "Please fix versioning to match http://semver.org/ spec (current is $VERSION) before proceeding." + exit 1 +fi + +echo "Releasing $VERSION -> $NEW_VER..." + +if [ "z$LIBVERS" = "z" ]; then + gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch +else + echo "You should NOT be doing this unless you've read and understood following article:" + echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries + grep '#' TODO-RELEASE > TODO-RELEASE.clean + mv TODO-RELEASE.clean TODO-RELEASE + if [ "z$MAKEMOD" = "z" ]; then + git status -s -uno TODO-RELEASE + if [ $? -ne 0 ]; then + echo "Before releasing, please modify some of the libversions: $LIBVERS" + exit 1 + fi + fi + xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $NEW_VER "entry" +fi +dch -r -m --distribution "unstable" "" +git add -u +bumpversion --current-version $VERSION $REL --tag --commit --tag-name $NEW_VER --allow-dirty +git tag -s $NEW_VER -f -m "Release v$NEW_VER on $ISODATE." +echo "Release $NEW_VER prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/4127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 3 09:54:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 09:54:16 +0000 Subject: libosmocore[master]: WIP: Fixup severe build performance issues introduced by osm... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 just putting this here as WIP, Max should resolve this, either based on this proposal or any other way that doesn't impose compile time overhead -- To view, visit https://gerrit.osmocom.org/4127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 3 09:54:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 09:54:32 +0000 Subject: [MERGED] osmo-bsc[master]: .gitignore: Update to post-NITB-split realities In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: .gitignore: Update to post-NITB-split realities ...................................................................... .gitignore: Update to post-NITB-split realities Change-Id: I4655e7e0f79073061b97e0918583b7eaf99bf797 --- M .gitignore 1 file changed, 13 insertions(+), 26 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index a9e6b84..3481bad 100644 --- a/.gitignore +++ b/.gitignore @@ -7,15 +7,8 @@ Makefile.in bscconfig.h bscconfig.h.in -openbsc.pc -src/osmo-nitb/osmo-nitb -src/osmo-bsc_mgcp/osmo-bsc_mgcp -src/osmo-bsc/osmo-bsc -src/utils/meas_vis -src/utils/meas_json -src/utils/osmo-meas-pcap2db -src/utils/osmo-meas-udp2db -src/utils/smpp_mirror +*.pc + *.*~ *.sw? .libs @@ -38,11 +31,13 @@ stamp-h1 libtool ltmain.sh +m4/*.m4 # git-version-gen magic .tarball-version .version - +osmo-bsc-*.tar.bz2 +osmo-bsc-*.tar.gz # apps and app data hlr.sqlite3 @@ -52,24 +47,19 @@ src/ipaccess/ipaccess-firmware src/ipaccess/ipaccess-proxy src/utils/isdnsync -src/nat/bsc_nat -src/gprs/osmo-sgsn -src/gprs/osmo-gbproxy -src/gprs/osmo-gtphub src/osmo-bsc_nat/osmo-bsc_nat -src/libcommon/gsup_test_client -src/osmo-msc/osmo-msc +src/osmo-bsc_nat/*.cfg* +src/osmo-bsc/osmo-bsc +src/osmo-bsc/*.cfg* +src/utils/meas_vis +src/utils/meas_json +src/utils/osmo-meas-pcap2db +src/utils/osmo-meas-udp2db + #tests tests/testsuite.dir tests/*/*_test -# ignore compiled binaries like msc_vlr_test_foo; do not ignore -# msc_vlr_test_foo.{c,ok,err}, but do still ignore the corresponding .o object -# files: -tests/msc_vlr/msc_vlr_test_* -!tests/msc_vlr/msc_vlr_test_*.* -tests/msc_vlr/msc_vlr_test_*.o - tests/atconfig tests/atlocal @@ -77,7 +67,4 @@ tests/testsuite tests/testsuite.log -gsn_restart -src/openbsc.cfg* writtenconfig/ -gtphub_restart_count -- To view, visit https://gerrit.osmocom.org/4126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4655e7e0f79073061b97e0918583b7eaf99bf797 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 3 10:21:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 10:21:43 +0000 Subject: [PATCH] libosmocore[master]: Introduce osmo_identifier_valid() function to check validity... Message-ID: Review at https://gerrit.osmocom.org/4128 Introduce osmo_identifier_valid() function to check validity of identifier We define the notion of an 'osmocom identifier' which is basically a 7-bit US-ASCII without any special characters beyond "-_:@". We introduce a function to verify if an identifier consists only of the permitted characters. Change-Id: I96a8d345c5a69238a12d040f39b70c485a5c421c --- M include/osmocom/core/utils.h M src/utils.c 2 files changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/28/4128/1 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 855e653..1127217 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -20,6 +20,7 @@ /*! Number of bytes necessary to store given BITS */ #define OSMO_BYTES_FOR_BITS(BITS) ((BITS + 8 - 1) / 8) +#include #include #include @@ -89,4 +90,6 @@ size_t osmo_strlcpy(char *dst, const char *src, size_t siz); +bool osmo_identifier_valid(const char *str); + /*! @} */ diff --git a/src/utils.c b/src/utils.c index 1c176f8..2ed5b16 100644 --- a/src/utils.c +++ b/src/utils.c @@ -22,6 +22,7 @@ */ +#include #include #include #include @@ -375,4 +376,30 @@ return ret; } +/*! Determine if a given identifier is valid, i.e. doesn't contain illegal chars + * \param[in] str String to validate + * \returns true in case string contains valid identifier, false otherwise + */ +bool osmo_identifier_valid(const char *str) +{ + /* characters that are illegal in names */ + static const char illegal_chars[] = "., {}[]()<>|~\\^`'\"?=;/+*&%$#!"; + unsigned int i; + + /* an empty string is not a valid identifier */ + if (!str || strlen(str) == 0) + return false; + + for (i = 0; i < strlen(str); i++) { + /* check for 7-bit ASCII */ + if (str[i] & 0x80) + return false; + /* check for some explicit reserved control characters */ + if (strchr(illegal_chars, str[i])) + return false; + } + + return true; +} + /*! @} */ -- To view, visit https://gerrit.osmocom.org/4128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I96a8d345c5a69238a12d040f39b70c485a5c421c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 3 10:21:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 10:21:44 +0000 Subject: [PATCH] libosmocore[master]: fsm: Enforce FSM and FSM instance names are valid osmocom id... Message-ID: Review at https://gerrit.osmocom.org/4129 fsm: Enforce FSM and FSM instance names are valid osmocom identifiers Let's enforce that the names of FSMs and their instances are valid osmocom identifiers. This is important as the FSMs are automatically exported via those names on the CTRL inteface, and we have to make sure CTRL syntax actually permits them. Change-Id: I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 --- M src/fsm.c 1 file changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/4129/1 diff --git a/src/fsm.c b/src/fsm.c index d62fd79..3f8de9c 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -146,6 +146,10 @@ */ int osmo_fsm_register(struct osmo_fsm *fsm) { + if (!osmo_identifier_valid(fsm->name)) { + LOGP(DLGLOBAL, LOGL_ERROR, "Attempting to register FSM with illegal identifier '%s'\n", fsm->name); + return -EINVAL; + } if (osmo_fsm_find_by_name(fsm->name)) return -EEXIST; llist_add_tail(&fsm->list, &osmo_g_fsms); @@ -206,8 +210,15 @@ fi->priv = priv; fi->log_level = log_level; osmo_timer_setup(&fi->timer, fsm_tmr_cb, fi); - if (id) + if (id) { + if (!osmo_identifier_valid(id)) { + LOGP(DLGLOBAL, LOGL_ERROR, "Attempting to allocate FSM instance of type '%s'" + " with illegal identifier '%s'\n", fsm->name, id); + talloc_free(fi); + return NULL; + } fi->id = talloc_strdup(fi, id); + } if (!fsm_log_addr) { if (id) -- To view, visit https://gerrit.osmocom.org/4129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 3 10:21:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 10:21:44 +0000 Subject: [PATCH] libosmocore[master]: rate_ctr: Enforce counter (and ctr_group) names are valid id... Message-ID: Review at https://gerrit.osmocom.org/4130 rate_ctr: Enforce counter (and ctr_group) names are valid identifiers As rate counters are automatically exposed on the CTRL interface, we need to make sure they don't contain special characters such as '.' which are not permitted/supported by CTRL. In order to be able to run old versions of osmocom programs with libosmocore versions after this commit, we introduce some special name mangling: Any '.' in the names are replaced with ':' during counter group registration, if valid identifiers can be obtained this way. Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 --- M include/osmocom/core/rate_ctr.h M src/rate_ctr.c 2 files changed, 118 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/4130/1 diff --git a/include/osmocom/core/rate_ctr.h b/include/osmocom/core/rate_ctr.h index 74414e9..6ce2dfe 100644 --- a/include/osmocom/core/rate_ctr.h +++ b/include/osmocom/core/rate_ctr.h @@ -48,7 +48,7 @@ /*! The class to which this group belongs */ int class_id; /*! The number of counters in this group */ - const unsigned int num_ctr; + unsigned int num_ctr; /*! Pointer to array of counter names */ const struct rate_ctr_desc *ctr_desc; }; diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 2985bbb..0519eaf 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -1,4 +1,4 @@ -/* (C) 2009-2010 by Harald Welte +/* (C) 2009-2017 by Harald Welte * * All Rights Reserved * @@ -24,6 +24,7 @@ * * \file rate_ctr.c */ +#include #include #include @@ -32,10 +33,116 @@ #include #include #include +#include static LLIST_HEAD(rate_ctr_groups); static void *tall_rate_ctr_ctx; + + +static bool rate_ctrl_group_desc_validate(const struct rate_ctr_group_desc *desc, bool quiet) +{ + unsigned int i; + const struct rate_ctr_desc *ctr_desc = desc->ctr_desc; + + if (!desc) { + LOGP(DLGLOBAL, LOGL_ERROR, "NULL is not a valid counter group descriptor\n"); + return false; + } + + DEBUGP(DLGLOBAL, "validating counter group %p(%s) with %u counters\n", desc, + desc->group_name_prefix, desc->num_ctr); + + if (!osmo_identifier_valid(desc->group_name_prefix)) { + if (!quiet) + LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter group identifier\n", + desc->group_name_prefix); + return false; + } + + for (i = 0; i < desc->num_ctr; i++) { + if (!osmo_identifier_valid(ctr_desc[i].name)) { + if (!quiet) + LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter identifier\n", + ctr_desc[i].name); + return false; + } + } + + return true; +} + +/* return 'in' if it doesn't contaon any '.'; otherwise allocate a copy and + * replace all '.' with ':' */ +static char *mangle_identifier_ifneeded(const void *ctx, const char *in) +{ + char *out; + unsigned int i; + + if (!in) + return NULL; + + if (!strchr(in, '.')) + return (char *)in; + + out = talloc_strdup(ctx, in); + OSMO_ASSERT(out); + + for (i = 0; i < strlen(out); i++) { + if (out[i] == '.') + out[i] = ':'; + } + + return out; +} + +/* "mangle" a rate counter group descriptor, i.e. replace any '.' with ':' */ +static struct rate_ctr_group_desc * +rate_ctr_group_desc_mangle(void *ctx, const struct rate_ctr_group_desc *desc) +{ + struct rate_ctr_group_desc *desc_new = talloc_zero(ctx, struct rate_ctr_group_desc); + int i; + + OSMO_ASSERT(desc_new); + + /* mangle the name_prefix but copy/keep the rest */ + desc_new->group_name_prefix = mangle_identifier_ifneeded(desc_new, desc->group_name_prefix); + desc_new->group_description = desc->group_description; + desc_new->class_id = desc->class_id; + desc_new->num_ctr = desc->num_ctr; + desc_new->ctr_desc = talloc_array(desc_new, struct rate_ctr_desc, desc_new->num_ctr); + OSMO_ASSERT(desc_new->ctr_desc); + + for (i = 0; i < desc->num_ctr; i++) { + struct rate_ctr_desc *ctrd_new = (struct rate_ctr_desc *) desc_new->ctr_desc; + const struct rate_ctr_desc *ctrd = desc->ctr_desc; + + if (!ctrd[i].name) { + LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s'[%d] == NULL, aborting\n", + desc->group_name_prefix, i); + goto err_free; + } + + ctrd_new[i].name = mangle_identifier_ifneeded(desc_new->ctr_desc, ctrd[i].name); + ctrd_new[i].description = ctrd[i].description; + } + + if (!rate_ctrl_group_desc_validate(desc_new, false)) { + /* simple mangling of identifiers ('.' -> ':') was not sufficient to render a valid + * descriptor, we have to bail out */ + LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s' still invalid after mangling\n", + desc->group_name_prefix); + goto err_free; + } + + LOGP(DLGLOBAL, LOGL_INFO, "Needed to mangle ounter group '%s' names still using '.' as " + "separator, please consider updating the application\n", desc->group_name_prefix); + + return desc_new; +err_free: + talloc_free(desc_new); + return NULL; +} /*! Allocate a new group of counters according to description * \param[in] ctx \ref talloc context @@ -49,6 +156,15 @@ unsigned int size; struct rate_ctr_group *group; + /* attempt to mangle all '.' in identifiers to ':' for backwards compat */ + if (!rate_ctrl_group_desc_validate(desc, true)) { + /* don't use 'ctx' here as it would screw up memory leak debugging e.g. + * in osmo-msc */ + desc = rate_ctr_group_desc_mangle(NULL, desc); + if (!desc) + return NULL; + } + size = sizeof(struct rate_ctr_group) + desc->num_ctr * sizeof(struct rate_ctr); -- To view, visit https://gerrit.osmocom.org/4130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 3 10:21:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 10:21:44 +0000 Subject: [PATCH] libosmocore[master]: Convert lib-internal rate_ctr from '.' separator to ':' sepa... Message-ID: Review at https://gerrit.osmocom.org/4131 Convert lib-internal rate_ctr from '.' separator to ':' separator The rate_ctr.c code would do this mangling automatically, but let's avoid using this from new versions of our code for simplicity/explicitness. Change-Id: I24a556f447cfac25efb6e83cac2d0c2972d98fe3 --- M src/gb/gprs_bssgp.c M src/gb/gprs_ns.c M tests/gb/gprs_ns_test.ok M tests/stats/stats_test.c M tests/stats/stats_test.ok 5 files changed, 294 insertions(+), 57 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/4131/1 diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 2552849..b906643 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -43,17 +43,17 @@ void *bssgp_tall_ctx = NULL; static const struct rate_ctr_desc bssgp_ctr_description[] = { - { "packets.in", "Packets at BSSGP Level ( In)" }, - { "packets.out","Packets at BSSGP Level (Out)" }, - { "bytes.in", "Bytes at BSSGP Level ( In)" }, - { "bytes.out", "Bytes at BSSGP Level (Out)" }, + { "packets:in", "Packets at BSSGP Level ( In)" }, + { "packets:out","Packets at BSSGP Level (Out)" }, + { "bytes:in", "Bytes at BSSGP Level ( In)" }, + { "bytes:out", "Bytes at BSSGP Level (Out)" }, { "blocked", "BVC Blocking count" }, { "discarded", "BVC LLC Discarded count" }, { "status", "BVC Status count" }, }; static const struct rate_ctr_group_desc bssgp_ctrg_desc = { - .group_name_prefix = "bssgp.bss_ctx", + .group_name_prefix = "bssgp:bss_ctx", .group_description = "BSSGP Peer Statistics", .num_ctr = ARRAY_SIZE(bssgp_ctr_description), .ctr_desc = bssgp_ctr_description, diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index d20ed23..6b457e7 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -110,22 +110,22 @@ }; static const struct rate_ctr_desc nsvc_ctr_description[] = { - { "packets.in", "Packets at NS Level ( In)" }, - { "packets.out","Packets at NS Level (Out)" }, - { "bytes.in", "Bytes at NS Level ( In)" }, - { "bytes.out", "Bytes at NS Level (Out)" }, + { "packets:in", "Packets at NS Level ( In)" }, + { "packets:out","Packets at NS Level (Out)" }, + { "bytes:in", "Bytes at NS Level ( In)" }, + { "bytes:out", "Bytes at NS Level (Out)" }, { "blocked", "NS-VC Block count " }, { "dead", "NS-VC gone dead count " }, { "replaced", "NS-VC replaced other count" }, { "nsei-chg", "NS-VC changed NSEI count " }, { "inv-nsvci", "NS-VCI was invalid count " }, { "inv-nsei", "NSEI was invalid count " }, - { "lost.alive", "ALIVE ACK missing count " }, - { "lost.reset", "RESET ACK missing count " }, + { "lost:alive", "ALIVE ACK missing count " }, + { "lost:reset", "RESET ACK missing count " }, }; static const struct rate_ctr_group_desc nsvc_ctrg_desc = { - .group_name_prefix = "ns.nsvc", + .group_name_prefix = "ns:nsvc", .group_description = "NSVC Peer Statistics", .num_ctr = ARRAY_SIZE(nsvc_ctr_description), .ctr_desc = nsvc_ctr_description, diff --git a/tests/gb/gprs_ns_test.ok b/tests/gb/gprs_ns_test.ok index b0c81e4..bd3cca8 100644 --- a/tests/gb/gprs_ns_test.ok +++ b/tests/gb/gprs_ns_test.ok @@ -15,6 +15,10 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 --- Delete nsvc object (round 0)--- @@ -36,6 +40,10 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 --- Delete nsvc object (round 1)--- @@ -57,6 +65,10 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 --- Delete nsvc object (round 2)--- @@ -78,6 +90,10 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 --- Delete nsvc object (round 3)--- @@ -146,6 +162,10 @@ Current NS-VCIs: VCI 0x1122, NSEI 0x1122, peer 0x01020304:1111 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 PROCESSING BSSGP RESET from 0x01020304:1111 00 00 00 00 22 04 82 4a 2e 07 81 08 08 88 10 20 30 40 50 60 10 00 @@ -171,6 +191,10 @@ Current NS-VCIs: VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 49 + Bytes at NS Level (Out): 22 --- Peer port changes, RESET, VCI changes --- @@ -188,7 +212,15 @@ Current NS-VCIs: VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 49 + Bytes at NS Level (Out): 22 --- Peer port changes, RESET, NSEI changes --- @@ -206,7 +238,15 @@ Current NS-VCIs: VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 VCI 0x1122, NSEI 0x3344, peer 0x01020304:4444, blocked + Packets at NS Level ( In): 7 + Packets at NS Level (Out): 8 + Bytes at NS Level ( In): 61 + Bytes at NS Level (Out): 32 NS-VC changed NSEI count : 1 --- Peer port 3333, RESET, VCI is changed back --- @@ -226,7 +266,15 @@ Current NS-VCIs: VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, blocked + Packets at NS Level ( In): 2 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 10 VCI 0x1122, NSEI 0x1122, peer 0x01020304:3333, blocked + Packets at NS Level ( In): 7 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 61 + Bytes at NS Level (Out): 42 NS-VC replaced other count: 1 NS-VC changed NSEI count : 2 @@ -246,7 +294,15 @@ Current NS-VCIs: VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, blocked + Packets at NS Level ( In): 2 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 10 VCI 0x1122, NSEI 0x1122, peer 0x01020304:4444, blocked + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 12 + Bytes at NS Level ( In): 73 + Bytes at NS Level (Out): 52 NS-VC replaced other count: 1 NS-VC changed NSEI count : 2 @@ -290,6 +346,10 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 --- Setup VC 2 BSS -> SGSN --- @@ -331,7 +391,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 --- Setup VC 1 SGSN -> BSS --- @@ -348,7 +416,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 25 NS-VC Block count : 1 --- Exchange NSEI 1 + 2 links --- @@ -369,7 +445,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, blocked, dead + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 24 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 7 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 26 NS-VC Block count : 2 NS-VC replaced other count: 1 @@ -390,7 +474,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, blocked, dead + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 36 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 33 + Bytes at NS Level (Out): 39 NS-VC Block count : 3 NS-VC replaced other count: 1 @@ -434,7 +526,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 33 + Bytes at NS Level (Out): 39 NS-VC Block count : 3 NS-VC replaced other count: 1 @@ -454,7 +554,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 7 + Packets at NS Level (Out): 11 + Bytes at NS Level ( In): 45 + Bytes at NS Level (Out): 49 NS-VC Block count : 3 NS-VC replaced other count: 1 NS-VC changed NSEI count : 1 @@ -476,9 +584,19 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level (Out): 2 + Bytes at NS Level (Out): 10 NS-VC replaced other count: 1 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 11 + Bytes at NS Level ( In): 57 + Bytes at NS Level (Out): 49 NS-VC Block count : 3 NS-VC replaced other count: 1 NS-VC changed NSEI count : 1 @@ -500,9 +618,21 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 NS-VC replaced other count: 1 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 57 + Bytes at NS Level (Out): 59 NS-VC Block count : 3 NS-VC replaced other count: 2 NS-VC changed NSEI count : 2 @@ -516,9 +646,21 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 NS-VC replaced other count: 1 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 66 + Bytes at NS Level (Out): 59 NS-VC Block count : 3 NS-VC replaced other count: 2 NS-VC changed NSEI count : 2 @@ -538,9 +680,21 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 NS-VC replaced other count: 1 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 10 + Packets at NS Level (Out): 15 + Bytes at NS Level ( In): 75 + Bytes at NS Level (Out): 72 NS-VC Block count : 4 NS-VC replaced other count: 2 NS-VC changed NSEI count : 3 @@ -561,10 +715,22 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 11 NS-VC Block count : 1 NS-VC replaced other count: 2 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, blocked, dead + Packets at NS Level ( In): 11 + Packets at NS Level (Out): 16 + Bytes at NS Level ( In): 84 + Bytes at NS Level (Out): 84 NS-VC Block count : 4 NS-VC replaced other count: 2 NS-VC changed NSEI count : 3 @@ -619,10 +785,22 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 2 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 11 NS-VC Block count : 1 NS-VC replaced other count: 2 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222 + Packets at NS Level ( In): 15 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 88 + Bytes at NS Level (Out): 108 NS-VC Block count : 4 NS-VC replaced other count: 3 NS-VC changed NSEI count : 4 @@ -645,13 +823,26 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 2 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 11 NS-VC Block count : 1 NS-VC replaced other count: 2 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 17 + Packets at NS Level (Out): 23 + Bytes at NS Level ( In): 106 + Bytes at NS Level (Out): 121 NS-VC Block count : 5 NS-VC replaced other count: 3 NS-VC changed NSEI count : 4 + RESET ACK missing count : 1 Current NS-VCIs: @@ -684,6 +875,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 3 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 11 + Bytes at NS Level (Out): 14 NS-VC Block count : 1 --- RESET, SGSN -> BSS --- @@ -702,6 +897,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 23 + Bytes at NS Level (Out): 24 NS-VC Block count : 1 --- RESET with invalid NSEI, SGSN -> BSS --- @@ -717,6 +916,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 35 + Bytes at NS Level (Out): 33 NS-VC Block count : 1 NSEI was invalid count : 1 @@ -733,6 +936,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 7 + Bytes at NS Level ( In): 47 + Bytes at NS Level (Out): 42 NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -753,6 +960,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 7 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 59 + Bytes at NS Level (Out): 52 NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -766,6 +977,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 68 + Bytes at NS Level (Out): 52 NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -783,6 +998,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 77 + Bytes at NS Level (Out): 64 NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 2 @@ -800,6 +1019,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + Packets at NS Level ( In): 10 + Packets at NS Level (Out): 11 + Bytes at NS Level ( In): 86 + Bytes at NS Level (Out): 76 NS-VC Block count : 1 NS-VCI was invalid count : 2 NSEI was invalid count : 2 @@ -836,6 +1059,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 3 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 11 + Bytes at NS Level (Out): 14 NS-VC Block count : 1 --- Time out local test procedure --- @@ -939,6 +1166,8 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + Packets at NS Level (Out): 1 + Bytes at NS Level (Out): 12 --- Send message to SGSN --- @@ -968,6 +1197,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 2 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 10 + Bytes at NS Level (Out): 14 NS-VC Block count : 1 --- Send message to SGSN --- @@ -996,6 +1229,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Send message to SGSN --- diff --git a/tests/stats/stats_test.c b/tests/stats/stats_test.c index 0234460..61673ba 100644 --- a/tests/stats/stats_test.c +++ b/tests/stats/stats_test.c @@ -35,12 +35,12 @@ }; static const struct rate_ctr_desc ctr_description[] = { - [TEST_A_CTR] = { "ctr.a", "The A counter value"}, - [TEST_B_CTR] = { "ctr.b", "The B counter value"}, + [TEST_A_CTR] = { "ctr:a", "The A counter value"}, + [TEST_B_CTR] = { "ctr:b", "The B counter value"}, }; static const struct rate_ctr_group_desc ctrg_desc = { - .group_name_prefix = "ctr-test.one", + .group_name_prefix = "ctr-test:one", .group_description = "Counter test number 1", .num_ctr = ARRAY_SIZE(ctr_description), .ctr_desc = ctr_description, diff --git a/tests/stats/stats_test.ok b/tests/stats/stats_test.ok index a0c001b..cb9daf2 100644 --- a/tests/stats/stats_test.ok +++ b/tests/stats/stats_test.ok @@ -2,14 +2,14 @@ test1: open test2: open report (initial): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -19,19 +19,19 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 global): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 peer): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -41,14 +41,14 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 subscriber): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -59,49 +59,49 @@ test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 disabled): test2: close - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.a v=-1 u=ma test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 enabled, no flush forced): test2: open - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (should be empty): report (group 1, counter 1 update): - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=1 d=1 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=1 d=1 report (group 1, item 1 update): test2: item p= g=test.one i=1 n=item.a v=10 u=ma test1: item p= g=test.one i=1 n=item.a v=10 u=ma report (remove statg1, ctrg1): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test1: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove srep1): test1: close - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove statg2): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 report (remove srep2): test2: close report (remove ctrg2, should be empty): -- To view, visit https://gerrit.osmocom.org/4131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24a556f447cfac25efb6e83cac2d0c2972d98fe3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 3 10:41:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 10:41:42 +0000 Subject: [PATCH] libosmocore[master]: rate_ctr: Enforce counter (and ctr_group) names are valid id... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4130 to look at the new patch set (#2). rate_ctr: Enforce counter (and ctr_group) names are valid identifiers As rate counters are automatically exposed on the CTRL interface, we need to make sure they don't contain special characters such as '.' which are not permitted/supported by CTRL. In order to be able to run old versions of osmocom programs with libosmocore versions after this commit, we introduce some special name mangling: Any '.' in the names are replaced with ':' during counter group registration, if valid identifiers can be obtained this way. Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 --- M include/osmocom/core/rate_ctr.h M src/rate_ctr.c M tests/gb/gprs_ns_test.ok M tests/stats/stats_test.ok 4 files changed, 397 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/4130/2 diff --git a/include/osmocom/core/rate_ctr.h b/include/osmocom/core/rate_ctr.h index 74414e9..6ce2dfe 100644 --- a/include/osmocom/core/rate_ctr.h +++ b/include/osmocom/core/rate_ctr.h @@ -48,7 +48,7 @@ /*! The class to which this group belongs */ int class_id; /*! The number of counters in this group */ - const unsigned int num_ctr; + unsigned int num_ctr; /*! Pointer to array of counter names */ const struct rate_ctr_desc *ctr_desc; }; diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 2985bbb..0519eaf 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -1,4 +1,4 @@ -/* (C) 2009-2010 by Harald Welte +/* (C) 2009-2017 by Harald Welte * * All Rights Reserved * @@ -24,6 +24,7 @@ * * \file rate_ctr.c */ +#include #include #include @@ -32,10 +33,116 @@ #include #include #include +#include static LLIST_HEAD(rate_ctr_groups); static void *tall_rate_ctr_ctx; + + +static bool rate_ctrl_group_desc_validate(const struct rate_ctr_group_desc *desc, bool quiet) +{ + unsigned int i; + const struct rate_ctr_desc *ctr_desc = desc->ctr_desc; + + if (!desc) { + LOGP(DLGLOBAL, LOGL_ERROR, "NULL is not a valid counter group descriptor\n"); + return false; + } + + DEBUGP(DLGLOBAL, "validating counter group %p(%s) with %u counters\n", desc, + desc->group_name_prefix, desc->num_ctr); + + if (!osmo_identifier_valid(desc->group_name_prefix)) { + if (!quiet) + LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter group identifier\n", + desc->group_name_prefix); + return false; + } + + for (i = 0; i < desc->num_ctr; i++) { + if (!osmo_identifier_valid(ctr_desc[i].name)) { + if (!quiet) + LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter identifier\n", + ctr_desc[i].name); + return false; + } + } + + return true; +} + +/* return 'in' if it doesn't contaon any '.'; otherwise allocate a copy and + * replace all '.' with ':' */ +static char *mangle_identifier_ifneeded(const void *ctx, const char *in) +{ + char *out; + unsigned int i; + + if (!in) + return NULL; + + if (!strchr(in, '.')) + return (char *)in; + + out = talloc_strdup(ctx, in); + OSMO_ASSERT(out); + + for (i = 0; i < strlen(out); i++) { + if (out[i] == '.') + out[i] = ':'; + } + + return out; +} + +/* "mangle" a rate counter group descriptor, i.e. replace any '.' with ':' */ +static struct rate_ctr_group_desc * +rate_ctr_group_desc_mangle(void *ctx, const struct rate_ctr_group_desc *desc) +{ + struct rate_ctr_group_desc *desc_new = talloc_zero(ctx, struct rate_ctr_group_desc); + int i; + + OSMO_ASSERT(desc_new); + + /* mangle the name_prefix but copy/keep the rest */ + desc_new->group_name_prefix = mangle_identifier_ifneeded(desc_new, desc->group_name_prefix); + desc_new->group_description = desc->group_description; + desc_new->class_id = desc->class_id; + desc_new->num_ctr = desc->num_ctr; + desc_new->ctr_desc = talloc_array(desc_new, struct rate_ctr_desc, desc_new->num_ctr); + OSMO_ASSERT(desc_new->ctr_desc); + + for (i = 0; i < desc->num_ctr; i++) { + struct rate_ctr_desc *ctrd_new = (struct rate_ctr_desc *) desc_new->ctr_desc; + const struct rate_ctr_desc *ctrd = desc->ctr_desc; + + if (!ctrd[i].name) { + LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s'[%d] == NULL, aborting\n", + desc->group_name_prefix, i); + goto err_free; + } + + ctrd_new[i].name = mangle_identifier_ifneeded(desc_new->ctr_desc, ctrd[i].name); + ctrd_new[i].description = ctrd[i].description; + } + + if (!rate_ctrl_group_desc_validate(desc_new, false)) { + /* simple mangling of identifiers ('.' -> ':') was not sufficient to render a valid + * descriptor, we have to bail out */ + LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s' still invalid after mangling\n", + desc->group_name_prefix); + goto err_free; + } + + LOGP(DLGLOBAL, LOGL_INFO, "Needed to mangle ounter group '%s' names still using '.' as " + "separator, please consider updating the application\n", desc->group_name_prefix); + + return desc_new; +err_free: + talloc_free(desc_new); + return NULL; +} /*! Allocate a new group of counters according to description * \param[in] ctx \ref talloc context @@ -49,6 +156,15 @@ unsigned int size; struct rate_ctr_group *group; + /* attempt to mangle all '.' in identifiers to ':' for backwards compat */ + if (!rate_ctrl_group_desc_validate(desc, true)) { + /* don't use 'ctx' here as it would screw up memory leak debugging e.g. + * in osmo-msc */ + desc = rate_ctr_group_desc_mangle(NULL, desc); + if (!desc) + return NULL; + } + size = sizeof(struct rate_ctr_group) + desc->num_ctr * sizeof(struct rate_ctr); diff --git a/tests/gb/gprs_ns_test.ok b/tests/gb/gprs_ns_test.ok index b0c81e4..bd3cca8 100644 --- a/tests/gb/gprs_ns_test.ok +++ b/tests/gb/gprs_ns_test.ok @@ -15,6 +15,10 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 --- Delete nsvc object (round 0)--- @@ -36,6 +40,10 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 --- Delete nsvc object (round 1)--- @@ -57,6 +65,10 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 --- Delete nsvc object (round 2)--- @@ -78,6 +90,10 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 --- Delete nsvc object (round 3)--- @@ -146,6 +162,10 @@ Current NS-VCIs: VCI 0x1122, NSEI 0x1122, peer 0x01020304:1111 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 PROCESSING BSSGP RESET from 0x01020304:1111 00 00 00 00 22 04 82 4a 2e 07 81 08 08 88 10 20 30 40 50 60 10 00 @@ -171,6 +191,10 @@ Current NS-VCIs: VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 49 + Bytes at NS Level (Out): 22 --- Peer port changes, RESET, VCI changes --- @@ -188,7 +212,15 @@ Current NS-VCIs: VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 49 + Bytes at NS Level (Out): 22 --- Peer port changes, RESET, NSEI changes --- @@ -206,7 +238,15 @@ Current NS-VCIs: VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 VCI 0x1122, NSEI 0x3344, peer 0x01020304:4444, blocked + Packets at NS Level ( In): 7 + Packets at NS Level (Out): 8 + Bytes at NS Level ( In): 61 + Bytes at NS Level (Out): 32 NS-VC changed NSEI count : 1 --- Peer port 3333, RESET, VCI is changed back --- @@ -226,7 +266,15 @@ Current NS-VCIs: VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, blocked + Packets at NS Level ( In): 2 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 10 VCI 0x1122, NSEI 0x1122, peer 0x01020304:3333, blocked + Packets at NS Level ( In): 7 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 61 + Bytes at NS Level (Out): 42 NS-VC replaced other count: 1 NS-VC changed NSEI count : 2 @@ -246,7 +294,15 @@ Current NS-VCIs: VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, blocked + Packets at NS Level ( In): 2 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 10 VCI 0x1122, NSEI 0x1122, peer 0x01020304:4444, blocked + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 12 + Bytes at NS Level ( In): 73 + Bytes at NS Level (Out): 52 NS-VC replaced other count: 1 NS-VC changed NSEI count : 2 @@ -290,6 +346,10 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 --- Setup VC 2 BSS -> SGSN --- @@ -331,7 +391,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 --- Setup VC 1 SGSN -> BSS --- @@ -348,7 +416,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 25 NS-VC Block count : 1 --- Exchange NSEI 1 + 2 links --- @@ -369,7 +445,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, blocked, dead + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 24 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 7 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 26 NS-VC Block count : 2 NS-VC replaced other count: 1 @@ -390,7 +474,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, blocked, dead + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 36 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 33 + Bytes at NS Level (Out): 39 NS-VC Block count : 3 NS-VC replaced other count: 1 @@ -434,7 +526,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 33 + Bytes at NS Level (Out): 39 NS-VC Block count : 3 NS-VC replaced other count: 1 @@ -454,7 +554,15 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 7 + Packets at NS Level (Out): 11 + Bytes at NS Level ( In): 45 + Bytes at NS Level (Out): 49 NS-VC Block count : 3 NS-VC replaced other count: 1 NS-VC changed NSEI count : 1 @@ -476,9 +584,19 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level (Out): 2 + Bytes at NS Level (Out): 10 NS-VC replaced other count: 1 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 11 + Bytes at NS Level ( In): 57 + Bytes at NS Level (Out): 49 NS-VC Block count : 3 NS-VC replaced other count: 1 NS-VC changed NSEI count : 1 @@ -500,9 +618,21 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 NS-VC replaced other count: 1 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 57 + Bytes at NS Level (Out): 59 NS-VC Block count : 3 NS-VC replaced other count: 2 NS-VC changed NSEI count : 2 @@ -516,9 +646,21 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 NS-VC replaced other count: 1 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 66 + Bytes at NS Level (Out): 59 NS-VC Block count : 3 NS-VC replaced other count: 2 NS-VC changed NSEI count : 2 @@ -538,9 +680,21 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 2 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 10 NS-VC replaced other count: 1 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 10 + Packets at NS Level (Out): 15 + Bytes at NS Level ( In): 75 + Bytes at NS Level (Out): 72 NS-VC Block count : 4 NS-VC replaced other count: 2 NS-VC changed NSEI count : 3 @@ -561,10 +715,22 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 1 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 11 NS-VC Block count : 1 NS-VC replaced other count: 2 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, blocked, dead + Packets at NS Level ( In): 11 + Packets at NS Level (Out): 16 + Bytes at NS Level ( In): 84 + Bytes at NS Level (Out): 84 NS-VC Block count : 4 NS-VC replaced other count: 2 NS-VC changed NSEI count : 3 @@ -619,10 +785,22 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 2 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 11 NS-VC Block count : 1 NS-VC replaced other count: 2 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222 + Packets at NS Level ( In): 15 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 88 + Bytes at NS Level (Out): 108 NS-VC Block count : 4 NS-VC replaced other count: 3 NS-VC changed NSEI count : 4 @@ -645,13 +823,26 @@ Current NS-VCIs: VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + Packets at NS Level ( In): 2 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 24 + Bytes at NS Level (Out): 11 NS-VC Block count : 1 NS-VC replaced other count: 2 VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 48 VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + Packets at NS Level ( In): 17 + Packets at NS Level (Out): 23 + Bytes at NS Level ( In): 106 + Bytes at NS Level (Out): 121 NS-VC Block count : 5 NS-VC replaced other count: 3 NS-VC changed NSEI count : 4 + RESET ACK missing count : 1 Current NS-VCIs: @@ -684,6 +875,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 3 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 11 + Bytes at NS Level (Out): 14 NS-VC Block count : 1 --- RESET, SGSN -> BSS --- @@ -702,6 +897,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 23 + Bytes at NS Level (Out): 24 NS-VC Block count : 1 --- RESET with invalid NSEI, SGSN -> BSS --- @@ -717,6 +916,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 35 + Bytes at NS Level (Out): 33 NS-VC Block count : 1 NSEI was invalid count : 1 @@ -733,6 +936,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 7 + Bytes at NS Level ( In): 47 + Bytes at NS Level (Out): 42 NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -753,6 +960,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 7 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 59 + Bytes at NS Level (Out): 52 NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -766,6 +977,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 68 + Bytes at NS Level (Out): 52 NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -783,6 +998,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 10 + Bytes at NS Level ( In): 77 + Bytes at NS Level (Out): 64 NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 2 @@ -800,6 +1019,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + Packets at NS Level ( In): 10 + Packets at NS Level (Out): 11 + Bytes at NS Level ( In): 86 + Bytes at NS Level (Out): 76 NS-VC Block count : 1 NS-VCI was invalid count : 2 NSEI was invalid count : 2 @@ -836,6 +1059,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 3 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 11 + Bytes at NS Level (Out): 14 NS-VC Block count : 1 --- Time out local test procedure --- @@ -939,6 +1166,8 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + Packets at NS Level (Out): 1 + Bytes at NS Level (Out): 12 --- Send message to SGSN --- @@ -968,6 +1197,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + Packets at NS Level ( In): 2 + Packets at NS Level (Out): 3 + Bytes at NS Level ( In): 10 + Bytes at NS Level (Out): 14 NS-VC Block count : 1 --- Send message to SGSN --- @@ -996,6 +1229,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Send message to SGSN --- diff --git a/tests/stats/stats_test.ok b/tests/stats/stats_test.ok index a0c001b..cb9daf2 100644 --- a/tests/stats/stats_test.ok +++ b/tests/stats/stats_test.ok @@ -2,14 +2,14 @@ test1: open test2: open report (initial): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -19,19 +19,19 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 global): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 peer): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -41,14 +41,14 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 subscriber): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -59,49 +59,49 @@ test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 disabled): test2: close - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.a v=-1 u=ma test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 enabled, no flush forced): test2: open - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (should be empty): report (group 1, counter 1 update): - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=1 d=1 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=1 d=1 report (group 1, item 1 update): test2: item p= g=test.one i=1 n=item.a v=10 u=ma test1: item p= g=test.one i=1 n=item.a v=10 u=ma report (remove statg1, ctrg1): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test1: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove srep1): test1: close - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove statg2): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 report (remove srep2): test2: close report (remove ctrg2, should be empty): -- To view, visit https://gerrit.osmocom.org/4130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 3 10:41:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 10:41:42 +0000 Subject: [PATCH] libosmocore[master]: Convert lib-internal rate_ctr from '.' separator to ':' sepa... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4131 to look at the new patch set (#2). Convert lib-internal rate_ctr from '.' separator to ':' separator The rate_ctr.c code would do this mangling automatically, but let's avoid using this from new versions of our code for simplicity/explicitness. Change-Id: I24a556f447cfac25efb6e83cac2d0c2972d98fe3 --- M src/gb/gprs_bssgp.c M src/gb/gprs_ns.c M tests/stats/stats_test.c 3 files changed, 15 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/4131/2 diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 2552849..b906643 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -43,17 +43,17 @@ void *bssgp_tall_ctx = NULL; static const struct rate_ctr_desc bssgp_ctr_description[] = { - { "packets.in", "Packets at BSSGP Level ( In)" }, - { "packets.out","Packets at BSSGP Level (Out)" }, - { "bytes.in", "Bytes at BSSGP Level ( In)" }, - { "bytes.out", "Bytes at BSSGP Level (Out)" }, + { "packets:in", "Packets at BSSGP Level ( In)" }, + { "packets:out","Packets at BSSGP Level (Out)" }, + { "bytes:in", "Bytes at BSSGP Level ( In)" }, + { "bytes:out", "Bytes at BSSGP Level (Out)" }, { "blocked", "BVC Blocking count" }, { "discarded", "BVC LLC Discarded count" }, { "status", "BVC Status count" }, }; static const struct rate_ctr_group_desc bssgp_ctrg_desc = { - .group_name_prefix = "bssgp.bss_ctx", + .group_name_prefix = "bssgp:bss_ctx", .group_description = "BSSGP Peer Statistics", .num_ctr = ARRAY_SIZE(bssgp_ctr_description), .ctr_desc = bssgp_ctr_description, diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index d20ed23..6b457e7 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -110,22 +110,22 @@ }; static const struct rate_ctr_desc nsvc_ctr_description[] = { - { "packets.in", "Packets at NS Level ( In)" }, - { "packets.out","Packets at NS Level (Out)" }, - { "bytes.in", "Bytes at NS Level ( In)" }, - { "bytes.out", "Bytes at NS Level (Out)" }, + { "packets:in", "Packets at NS Level ( In)" }, + { "packets:out","Packets at NS Level (Out)" }, + { "bytes:in", "Bytes at NS Level ( In)" }, + { "bytes:out", "Bytes at NS Level (Out)" }, { "blocked", "NS-VC Block count " }, { "dead", "NS-VC gone dead count " }, { "replaced", "NS-VC replaced other count" }, { "nsei-chg", "NS-VC changed NSEI count " }, { "inv-nsvci", "NS-VCI was invalid count " }, { "inv-nsei", "NSEI was invalid count " }, - { "lost.alive", "ALIVE ACK missing count " }, - { "lost.reset", "RESET ACK missing count " }, + { "lost:alive", "ALIVE ACK missing count " }, + { "lost:reset", "RESET ACK missing count " }, }; static const struct rate_ctr_group_desc nsvc_ctrg_desc = { - .group_name_prefix = "ns.nsvc", + .group_name_prefix = "ns:nsvc", .group_description = "NSVC Peer Statistics", .num_ctr = ARRAY_SIZE(nsvc_ctr_description), .ctr_desc = nsvc_ctr_description, diff --git a/tests/stats/stats_test.c b/tests/stats/stats_test.c index 0234460..61673ba 100644 --- a/tests/stats/stats_test.c +++ b/tests/stats/stats_test.c @@ -35,12 +35,12 @@ }; static const struct rate_ctr_desc ctr_description[] = { - [TEST_A_CTR] = { "ctr.a", "The A counter value"}, - [TEST_B_CTR] = { "ctr.b", "The B counter value"}, + [TEST_A_CTR] = { "ctr:a", "The A counter value"}, + [TEST_B_CTR] = { "ctr:b", "The B counter value"}, }; static const struct rate_ctr_group_desc ctrg_desc = { - .group_name_prefix = "ctr-test.one", + .group_name_prefix = "ctr-test:one", .group_description = "Counter test number 1", .num_ctr = ARRAY_SIZE(ctr_description), .ctr_desc = ctr_description, -- To view, visit https://gerrit.osmocom.org/4131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I24a556f447cfac25efb6e83cac2d0c2972d98fe3 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 3 10:41:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 10:41:43 +0000 Subject: [PATCH] libosmocore[master]: stats_test: Extend check to include test for counter group n... Message-ID: Review at https://gerrit.osmocom.org/4132 stats_test: Extend check to include test for counter group name mangling In Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 we introduce name mangling to replace any '.' in counter (group) names to be converted to ':'. Let's test for this functionality explicitly as part of the stats_test. Change-Id: Ie35682aa79526e2ffeab6995cd640b7847d855bf --- M tests/stats/stats_test.c M tests/stats/stats_test.ok 2 files changed, 51 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/4132/1 diff --git a/tests/stats/stats_test.c b/tests/stats/stats_test.c index 61673ba..59fc449 100644 --- a/tests/stats/stats_test.c +++ b/tests/stats/stats_test.c @@ -47,6 +47,19 @@ .class_id = OSMO_STATS_CLASS_SUBSCRIBER, }; +static const struct rate_ctr_desc ctr_description_dot[] = { + [TEST_A_CTR] = { "ctr.a", "The A counter value with ."}, + [TEST_B_CTR] = { "ctr.b", "The B counter value with ."}, +}; + +static const struct rate_ctr_group_desc ctrg_desc_dot = { + .group_name_prefix = "ctr-test.one_dot", + .group_description = "Counter test number 1dot", + .num_ctr = ARRAY_SIZE(ctr_description_dot), + .ctr_desc = ctr_description_dot, + .class_id = OSMO_STATS_CLASS_SUBSCRIBER, +}; + enum test_items { TEST_A_ITEM, TEST_B_ITEM, @@ -296,7 +309,7 @@ { struct osmo_stats_reporter *srep1, *srep2, *srep; struct osmo_stat_item_group *statg1, *statg2; - struct rate_ctr_group *ctrg1, *ctrg2; + struct rate_ctr_group *ctrg1, *ctrg2, *ctrg3; void *stats_ctx = talloc_named_const(NULL, 1, "stats test context"); int rc; @@ -312,6 +325,8 @@ OSMO_ASSERT(ctrg1 != NULL); ctrg2 = rate_ctr_group_alloc(stats_ctx, &ctrg_desc, 2); OSMO_ASSERT(ctrg2 != NULL); + ctrg3 = rate_ctr_group_alloc(stats_ctx, &ctrg_desc_dot, 3); + OSMO_ASSERT(ctrg3 != NULL); srep1 = stats_reporter_create_test("test1"); OSMO_ASSERT(srep1 != NULL); @@ -339,7 +354,7 @@ printf("report (initial):\n"); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 16); + OSMO_ASSERT(send_count == 20); printf("report (srep1 global):\n"); /* force single flush */ @@ -348,7 +363,7 @@ srep2->force_single_flush = 1; send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 8); + OSMO_ASSERT(send_count == 10); printf("report (srep1 peer):\n"); /* force single flush */ @@ -357,7 +372,7 @@ srep2->force_single_flush = 1; send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 12); + OSMO_ASSERT(send_count == 14); printf("report (srep1 subscriber):\n"); /* force single flush */ @@ -366,7 +381,7 @@ srep2->force_single_flush = 1; send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 16); + OSMO_ASSERT(send_count == 20); printf("report (srep2 disabled):\n"); /* force single flush */ @@ -376,14 +391,14 @@ OSMO_ASSERT(rc >= 0); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 8); + OSMO_ASSERT(send_count == 10); printf("report (srep2 enabled, no flush forced):\n"); rc = osmo_stats_reporter_enable(srep2); OSMO_ASSERT(rc >= 0); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 8); + OSMO_ASSERT(send_count == 10); printf("report (should be empty):\n"); send_count = 0; @@ -410,7 +425,7 @@ rate_ctr_group_free(ctrg1); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 8); + OSMO_ASSERT(send_count == 12); printf("report (remove srep1):\n"); /* force single flush */ @@ -419,7 +434,7 @@ osmo_stats_reporter_free(srep1); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 4); + OSMO_ASSERT(send_count == 6); printf("report (remove statg2):\n"); /* force single flush */ @@ -427,7 +442,7 @@ osmo_stat_item_group_free(statg2); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 2); + OSMO_ASSERT(send_count == 4); printf("report (remove srep2):\n"); /* force single flush */ @@ -443,6 +458,8 @@ osmo_stats_report(); OSMO_ASSERT(send_count == 0); + rate_ctr_group_free(ctrg3); + /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); talloc_free(stats_ctx); diff --git a/tests/stats/stats_test.ok b/tests/stats/stats_test.ok index cb9daf2..8628adb 100644 --- a/tests/stats/stats_test.ok +++ b/tests/stats/stats_test.ok @@ -2,6 +2,10 @@ test1: open test2: open report (initial): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 @@ -19,6 +23,8 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 global): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 @@ -28,6 +34,8 @@ test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 peer): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 @@ -41,6 +49,10 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 subscriber): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 @@ -59,6 +71,8 @@ test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 disabled): test2: close + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 @@ -69,6 +83,8 @@ test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 enabled, no flush forced): test2: open + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 @@ -85,6 +101,10 @@ test2: item p= g=test.one i=1 n=item.a v=10 u=ma test1: item p= g=test.one i=1 n=item.a v=10 u=ma report (remove statg1, ctrg1): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 @@ -95,11 +115,15 @@ test1: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove srep1): test1: close + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove statg2): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 report (remove srep2): -- To view, visit https://gerrit.osmocom.org/4132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie35682aa79526e2ffeab6995cd640b7847d855bf Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 3 10:50:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Oct 2017 10:50:22 +0000 Subject: [PATCH] libosmocore[master]: rate_ctr: Enforce counter (and ctr_group) names are valid id... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4130 to look at the new patch set (#3). rate_ctr: Enforce counter (and ctr_group) names are valid identifiers As rate counters are automatically exposed on the CTRL interface, we need to make sure they don't contain special characters such as '.' which are not permitted/supported by CTRL. In order to be able to run old versions of osmocom programs with libosmocore versions after this commit, we introduce some special name mangling: Any '.' in the names are replaced with ':' during counter group registration, if valid identifiers can be obtained this way. Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 --- M include/osmocom/core/rate_ctr.h M src/rate_ctr.c M tests/gb/gprs_ns_test.c M tests/stats/stats_test.ok 4 files changed, 161 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/4130/3 diff --git a/include/osmocom/core/rate_ctr.h b/include/osmocom/core/rate_ctr.h index 74414e9..6ce2dfe 100644 --- a/include/osmocom/core/rate_ctr.h +++ b/include/osmocom/core/rate_ctr.h @@ -48,7 +48,7 @@ /*! The class to which this group belongs */ int class_id; /*! The number of counters in this group */ - const unsigned int num_ctr; + unsigned int num_ctr; /*! Pointer to array of counter names */ const struct rate_ctr_desc *ctr_desc; }; diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 2985bbb..0519eaf 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -1,4 +1,4 @@ -/* (C) 2009-2010 by Harald Welte +/* (C) 2009-2017 by Harald Welte * * All Rights Reserved * @@ -24,6 +24,7 @@ * * \file rate_ctr.c */ +#include #include #include @@ -32,10 +33,116 @@ #include #include #include +#include static LLIST_HEAD(rate_ctr_groups); static void *tall_rate_ctr_ctx; + + +static bool rate_ctrl_group_desc_validate(const struct rate_ctr_group_desc *desc, bool quiet) +{ + unsigned int i; + const struct rate_ctr_desc *ctr_desc = desc->ctr_desc; + + if (!desc) { + LOGP(DLGLOBAL, LOGL_ERROR, "NULL is not a valid counter group descriptor\n"); + return false; + } + + DEBUGP(DLGLOBAL, "validating counter group %p(%s) with %u counters\n", desc, + desc->group_name_prefix, desc->num_ctr); + + if (!osmo_identifier_valid(desc->group_name_prefix)) { + if (!quiet) + LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter group identifier\n", + desc->group_name_prefix); + return false; + } + + for (i = 0; i < desc->num_ctr; i++) { + if (!osmo_identifier_valid(ctr_desc[i].name)) { + if (!quiet) + LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter identifier\n", + ctr_desc[i].name); + return false; + } + } + + return true; +} + +/* return 'in' if it doesn't contaon any '.'; otherwise allocate a copy and + * replace all '.' with ':' */ +static char *mangle_identifier_ifneeded(const void *ctx, const char *in) +{ + char *out; + unsigned int i; + + if (!in) + return NULL; + + if (!strchr(in, '.')) + return (char *)in; + + out = talloc_strdup(ctx, in); + OSMO_ASSERT(out); + + for (i = 0; i < strlen(out); i++) { + if (out[i] == '.') + out[i] = ':'; + } + + return out; +} + +/* "mangle" a rate counter group descriptor, i.e. replace any '.' with ':' */ +static struct rate_ctr_group_desc * +rate_ctr_group_desc_mangle(void *ctx, const struct rate_ctr_group_desc *desc) +{ + struct rate_ctr_group_desc *desc_new = talloc_zero(ctx, struct rate_ctr_group_desc); + int i; + + OSMO_ASSERT(desc_new); + + /* mangle the name_prefix but copy/keep the rest */ + desc_new->group_name_prefix = mangle_identifier_ifneeded(desc_new, desc->group_name_prefix); + desc_new->group_description = desc->group_description; + desc_new->class_id = desc->class_id; + desc_new->num_ctr = desc->num_ctr; + desc_new->ctr_desc = talloc_array(desc_new, struct rate_ctr_desc, desc_new->num_ctr); + OSMO_ASSERT(desc_new->ctr_desc); + + for (i = 0; i < desc->num_ctr; i++) { + struct rate_ctr_desc *ctrd_new = (struct rate_ctr_desc *) desc_new->ctr_desc; + const struct rate_ctr_desc *ctrd = desc->ctr_desc; + + if (!ctrd[i].name) { + LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s'[%d] == NULL, aborting\n", + desc->group_name_prefix, i); + goto err_free; + } + + ctrd_new[i].name = mangle_identifier_ifneeded(desc_new->ctr_desc, ctrd[i].name); + ctrd_new[i].description = ctrd[i].description; + } + + if (!rate_ctrl_group_desc_validate(desc_new, false)) { + /* simple mangling of identifiers ('.' -> ':') was not sufficient to render a valid + * descriptor, we have to bail out */ + LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s' still invalid after mangling\n", + desc->group_name_prefix); + goto err_free; + } + + LOGP(DLGLOBAL, LOGL_INFO, "Needed to mangle ounter group '%s' names still using '.' as " + "separator, please consider updating the application\n", desc->group_name_prefix); + + return desc_new; +err_free: + talloc_free(desc_new); + return NULL; +} /*! Allocate a new group of counters according to description * \param[in] ctx \ref talloc context @@ -49,6 +156,15 @@ unsigned int size; struct rate_ctr_group *group; + /* attempt to mangle all '.' in identifiers to ':' for backwards compat */ + if (!rate_ctrl_group_desc_validate(desc, true)) { + /* don't use 'ctx' here as it would screw up memory leak debugging e.g. + * in osmo-msc */ + desc = rate_ctr_group_desc_mangle(NULL, desc); + if (!desc) + return NULL; + } + size = sizeof(struct rate_ctr_group) + desc->num_ctr * sizeof(struct rate_ctr); diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c index 456d8e3..6d95125 100644 --- a/tests/gb/gprs_ns_test.c +++ b/tests/gb/gprs_ns_test.c @@ -261,7 +261,7 @@ for (i = 0; i < ctrg->desc->num_ctr; i++) { struct rate_ctr *ctr = &ctrg->ctr[i]; - if (ctr->current && !strchr(ctrg->desc->ctr_desc[i].name, '.')) + if (ctr->current && !strchr(ctrg->desc->ctr_desc[i].name, ':')) fprintf(stream, " %s%s: %llu%s", prefix, ctrg->desc->ctr_desc[i].description, (long long)ctr->current, diff --git a/tests/stats/stats_test.ok b/tests/stats/stats_test.ok index a0c001b..cb9daf2 100644 --- a/tests/stats/stats_test.ok +++ b/tests/stats/stats_test.ok @@ -2,14 +2,14 @@ test1: open test2: open report (initial): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -19,19 +19,19 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 global): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 peer): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -41,14 +41,14 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 subscriber): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -59,49 +59,49 @@ test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 disabled): test2: close - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.a v=-1 u=ma test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 enabled, no flush forced): test2: open - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (should be empty): report (group 1, counter 1 update): - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=1 d=1 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=1 d=1 report (group 1, item 1 update): test2: item p= g=test.one i=1 n=item.a v=10 u=ma test1: item p= g=test.one i=1 n=item.a v=10 u=ma report (remove statg1, ctrg1): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test1: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove srep1): test1: close - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove statg2): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 report (remove srep2): test2: close report (remove ctrg2, should be empty): -- To view, visit https://gerrit.osmocom.org/4130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 3 20:27:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 3 Oct 2017 20:27:32 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add OsmoMSC manual ...................................................................... add OsmoMSC manual Add OsmoMSC and OsmoHLR to bibliography (even though the OsmoHLR manual does not yet exist, a reference to it has been added in OsmoMSC's manual). Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee --- M Makefile A OsmoMSC/Makefile A OsmoMSC/chapters/control.adoc A OsmoMSC/chapters/net.adoc A OsmoMSC/chapters/overview.adoc A OsmoMSC/chapters/running.adoc A OsmoMSC/osmomsc-usermanual-docinfo.xml A OsmoMSC/osmomsc-usermanual.adoc A OsmoMSC/osmomsc-vty-reference.xml A OsmoMSC/vty/msc_vty_additions.xml A OsmoMSC/vty/msc_vty_reference.xml M common/chapters/bibliography.adoc 12 files changed, 3,678 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile b/Makefile index c09dd58..ffa25de 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ cd OsmoNAT; $(MAKE) cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) + cd OsmoMSC; $(MAKE) clean: cd OsmoBTS; $(MAKE) clean @@ -19,6 +20,7 @@ cd OsmoNAT; $(MAKE) clean cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean + cd OsmoMSC; $(MAKE) clean upload: cd OsmoBTS; $(MAKE) upload @@ -30,6 +32,7 @@ cd OsmoNAT; $(MAKE) upload cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload + cd OsmoMSC; $(MAKE) upload check: cd OsmoBTS; $(MAKE) check @@ -42,6 +45,7 @@ #cd OsmoMGCP; $(MAKE) check #cd OsmoNAT; $(MAKE) check cd OsmoGSMTester; $(MAKE) check + cd OsmoMSC; $(MAKE) check define check_dep_bin @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; } diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile new file mode 100644 index 0000000..febf7d1 --- /dev/null +++ b/OsmoMSC/Makefile @@ -0,0 +1,42 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +topdir = . +msc_reference = $(topdir)/osmomsc-vty-reference.xml +manuals = $(msc_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + +TOPDIR := .. +ASCIIDOCS := osmomsc-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml + +clean: + -rm -rf $(cleanfiles) + -rm osmomsc-usermanual__*.svg + -rm osmomsc-usermanual__*.png + -rm osmomsc-usermanual.check + +generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/msc_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging Common BSC VTY) + $(call command,xsltproc -o generated/combined3.xml \ + --stringparam with $(PWD)/vty/msc_vty_additions.xml \ + $(MERGE_DOC) generated/combined2.xml, \ + XSLTPROC,Merging MSC VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting MSC VTY to DocBook) diff --git a/OsmoMSC/chapters/control.adoc b/OsmoMSC/chapters/control.adoc new file mode 100644 index 0000000..af03be7 --- /dev/null +++ b/OsmoMSC/chapters/control.adoc @@ -0,0 +1,31 @@ +[[control]] +== Control interface + +The actual protocol is described in <>, the variables common +to all programs using it are described in <>. This section +describes the CTRL interface variables specific to OsmoMSC. + +.Variables available on OsmoMSC's Control interface +[options="header",width="100%",cols="20%,5%,5%,50%,20%"] +|=== +|Name|Access|Trap|Value|Comment +|subscriber-list-active-v1|RO|No||Return list of active subscribers. +|=== + +=== subscriber-list-active-v1 + +Return a list of subscribers that are successfully attached (including full +successful authentication and ciphering if those are enabled). + +The reply comprises of one subscriber per line, of the format + +---- +,\n[,\n[...]] +---- + +For example: + +---- +901700000015252,22801 +901700000015253,22802 +---- diff --git a/OsmoMSC/chapters/net.adoc b/OsmoMSC/chapters/net.adoc new file mode 100644 index 0000000..06be4ba --- /dev/null +++ b/OsmoMSC/chapters/net.adoc @@ -0,0 +1,154 @@ +[[net]] +== Configuring the Core Network + +The core network parameters are configured by the config file (as in `osmo-msc +-c osmo-msc.cfg`). The config file is parsed by the VTY, which is also +available via telnet in the running `osmo-msc` instance. Be aware that even +though you may be able to change these parameters without restarting +`osmo-msc`, some may not take immediate effect, and it is safest to use the +config file to have these parameters set at startup time. + +The core network parameters are found in the `config` / `network`. + +A full reference to the available commands can be found in the _OsmoMSC VTY +reference manual_ <>. This section describes only the most +commonly used settings. + +Here is an overview of the config items, described in more detail below: + +---- +network + network country code 262 + mobile network code 89 + mm info 1 + short name OsmoMSC + long name OsmoMSC + authentication required + encryption a5 3 +---- + +[TIP] +==== +Use the telnet VTY interface to query the current configuration of a running +`osmo-msc` process: + +---- +$ telnet localhost 4254 +OsmoMSC> enable +OsmoMSC# show running-config +---- + +Some parameters may be changed without restarting `osmo-msc`. To reach the +`network` node, enter: + +---- +OsmoMSC> enable +OsmoMSC# configure terminal +OsmoMSC(config)# network +OsmoMSC(config-net)# short name Example-Name +OsmoMSC(config-net)# exit +OsmoMSC(config)# +---- + +The telnet VTY features tab-completion as well as context sensitive help shown +when entering a `?` question mark. + +You can always use the `list` VTY command or enter `?` on the blank prompt to +get a list of all possible commands at the current node. +==== + + +=== MCC/MNC + +The key identities of every GSM PLMN is the Mobile Country Code and the Mobile +Network Code. They are identical over the entire network. In most cases, the +MCC/MNC will be allocated to the operator by the respective local regulatory +authority. For example, to set the MCC/MNC of 262-89, have this in your +osmo-msc.cfg: + +---- +network + network country code 262 + mobile network code 89 +---- + + +=== Configuring MM INFO + +The _MM INFO_ procedure can be used after a successful _LOCATION UPDATE_ in +order to transmit the human-readable network name as well as local time zone +information to the MS. By default, _MM INFO_ is not active, i.e. `0`. Set to `1` +to activate this feature: + +---- +network + mm info 1 + short name OsmoMSC + long name OsmoMSC +---- + +[NOTE] +==== +Not all phones support the MM INFO procedure. If a phone is not +factory-programmed to contain the name for your MCC/MNC, it will likely only +provide a numeric display of the network name, such as _262-89_, or show the +country code transformed into a letter, such as _D 89_. +==== + +The time information transmitted is determined by the local system time of the +operating system on which OsmoMSC is running. + + +=== Authentication + +Authorized subscribers must be entered in the HLR database, see the _OsmoHLR +reference manual_ <>. If authentication tokens (such as KI for +2G, or K and OP/OPC for UMTS) are present in the HLR, OsmoMSC will only attach +a subscriber after successful authentication. + +If no authentication keys are present in the HLR for a given subscriber, +OsmoMSC will attach the subscriber _without_ authentication. You can reject +subscribers that lack authentication info in the HLR with this setting: + +---- +network + authentication required +---- + +=== Ciphering + +To enable ciphering on the radio link, authentication must take place first: +the Kc resulting from authentication is the key used for ciphering. Hence, all +subscribers must have authentication tokens available in the HLR for ciphering. + +The MS, BTS and MSC must agree on a ciphering algorithm to use. + +- The MS sends its supported ciphering algorithms via Classmark IEs during + Location Updating. +- Typically the BSC needs to know which A5 ciphers are supported by connected + BTSes. +- Finally, OsmoMSC may impose that specific A5 ciphers shall not be considered. + +It is the responsibility of the BSC to then pick an A5 cipher that satisfies +all requirements. + +- In OsmoMSC, A5/0 means that ciphering is turned off. ++ +---- +network + encryption a5 0 +---- + +- A5/1 and A5/3 are currently supported by Osmocom. ++ +---- +network + encryption a5 3 +---- + +- Never use A5/2: it is an "export grade cipher" and has been deprecated for + its low ciphering strength. + +NOTE: At the time of writing, OsmoMSC supports setting only a single A5 cipher, +while it should be able to allow a set of ciphers. This is subject to ongoing +development. diff --git a/OsmoMSC/chapters/overview.adoc b/OsmoMSC/chapters/overview.adoc new file mode 100644 index 0000000..0bb47d7 --- /dev/null +++ b/OsmoMSC/chapters/overview.adoc @@ -0,0 +1,127 @@ +[[overview]] +== Overview + +This manual should help you getting started with OsmoMSC. It will cover +aspects of configuring and running the OsmoMSC. + +[[intro_overview]] +=== About OsmoMSC + +OsmoMSC is the Osmocom implementation of a Mobile Switching Center (MSC) for 2G +and 3G GSM and UMTS mobile networks. Its interfaces are: + +- GSUP towards OsmoHLR (or a MAP proxy); +- A over IP towards a BSC (e.g. OsmoBSC); +- IuCS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G voice; +- MNCC (Mobile Network Call Control derived from GSM TS 04.07); +- SMPP 3.4 (Short Message Peer-to-Peer); +- The Osmocom typical telnet VTY and CTRL interfaces. + +OsmoMSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. +Before it was split off, OsmoMSC originated from libmsc of the old openbsc.git. +Since a true _A_ interface and IuCS for 3G support is available, OsmoMSC +exists only as a separate standalone entity. + +Key differences of the new OsmoMSC compared to the old OsmoNITB are: + +- The complete VLR implementation that communicates with the separate HLR + (OsmoHLR) for subscriber management. In contrast to the OsmoNITB, HLR queries + are fully asynchronous, and the separate HLR allows using centralized + subscriber management for both circuit-switched and packet-switched domains + (i.e. one OsmoHLR for both OsmoMSC and OsmoSGSN). + +- VLR and HLR brought full UMTS AKA (Authentication and Key Agreement) support, + i.e. Milenage authentication in both the full 3G variant as well as the + backwards compatible 2G variant. + +- Addition of a true _A_ interface for 2G voice services. Previously, OsmoBSC + had an SCCPlite based _A_ interface towards 3rd party MSC implementations. + OsmoMSC features a true SCCP/M3UA _A_ interface, which allows running OsmoBSC + against this Osmocom based MSC implementation. The new SCCP/M3UA SIGTRAN for + the _A_ interface is implemented in libosmo-sccp, which is used by OsmoMSC + and OsmoBSC (and others), to establish a link via an STP (e.g. OsmoSTP). + +- Addition of an _IuCS_ interface to allow operating 3G voice services, also + via SCCP/M3UA SIGTRAN, for example connecting via OsmoHNBGW to a 3G small + cell device. + +Find the OsmoMSC issue tracker and wiki online at + +- https://osmocom.org/projects/osmomsc +- https://osmocom.org/projects/osmomsc/wiki + + +[[fig-gsm]] +.Typical GSM network architecture used with OsmoMSC +[graphviz] +---- +digraph G { + rankdir=LR; + MS0 [label="MS"] + MS1 [label="MS"] + MS2 [label="MS"] + MS3 [label="MS"] + UE0 [label="UE"] + UE1 [label="UE"] + BTS0 [label="BTS"] + BTS1 [label="BTS"] + STP [label="STP\n(SCCP routing)"] + HLR [label="HLR+AUC+EIR"] + HNB [label="RNC or hNodeB"] + MGW + MS0->BTS0 [label="Um"] + MS1->BTS0 [label="Um"] + MS2->BTS1 [label="Um"] + MS3->BTS1 [label="Um"] + UE0->HNB + UE1->HNB + BTS0->BSC [label="Abis"] + BTS1->BSC [label="Abis"] + BSC->STP [label="A/SCCP/M3UA"] + STP->MSC [label="A/SCCP/M3UA"] + STP->MSC [label="IuCS/SCCP/M3UA"] + VLR->HLR [label="GSUP"] + HNB->HNBGW [label="Iuh"] + HNBGW->STP [label="IuCS/SCCP/M3UA"] + MSC->MGW [label="MGCP"] + BTS0->MGW [label="RTP"] + BTS1->MGW [label="RTP"] + subgraph cluster_msc { + label = "OsmoMSC"; + MSC->SMSC; + MSC->VLR + } +} +---- + + +=== Software Components + +This is a brief description of OsmoMSC's internal software components. + +==== SMSC + +A minimal store-and-forward server for SMS, supporting both MO and MT +SMS service, as well as multi-part messages. + +The built-in SMSC also supports an external SMSC interface. For more +information, see <>. + +==== MSC + +The MSC component implements the mobility management (MM) functions of the TS +04.08 and delegates to SMSC for SMS message handling and the VLR for subscriber +management. + +Furthermore, it can handle TS 04.08 Call Control (CC), either by use of +an internal MNCC handler, or by use of an external MNCC agent. For more +information see <>. + +==== VLR + +A fully featured Visitor Location Register handles the subscriber management +and authentication, and interfaces via GSUP to the external HLR. diff --git a/OsmoMSC/chapters/running.adoc b/OsmoMSC/chapters/running.adoc new file mode 100644 index 0000000..5925e02 --- /dev/null +++ b/OsmoMSC/chapters/running.adoc @@ -0,0 +1,148 @@ +== Running OsmoMSC + +The OsmoMSC executable (`osmo-msc`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-msc* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-T] [-e 'LOGLEVEL'] [-l 'DATABASE'] [-M 'SOCKETPATH'] [-C] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-d, --debug 'DBGMASK','DBGLEVELS'*:: + Set the log subsystems and levels for logging to stderr. This + has mostly been superseded by VTY-based logging configuration, + see <> for further information. +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `openbsc.cfg` in the current + working directory. +*-s, --disable-color*:: + Disable colors for logging to stderr. This has mostly been + deprecated by VTY based logging configuration, see <> + for more information. +*-T, --timestamp*:: + Enable time-stamping of log messages to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-e, --log-level 'LOGLEVEL'*:: + Set the global log level for logging to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-l, --database 'DATABASE'*:: + Specify the file name of the SQLite3 database to use as SMS storage +*-M, --mncc-sock-path*:: + Enable the MNCC socket for an external MNCC handler. See + <> for further information. +*-m, --mncc-sock*:: + Same as option -M (deprecated). +*-C, --no-dbcounter*:: + Disable the regular periodic synchronization of statistics + counters to the database. + + +=== Multiple instances + +Running multiple instances of `osmo-msc` is possible if all interfaces (VTY, +CTRL) are separated using the appropriate configuration options. The IP based +interfaces are binding to local host by default. In order to separate the +processes, the user has to bind those services to specific but different IP +addresses. + +The VTY and the Control interface can be bound to IP addresses from the loopback +address range, for example: + +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- + +If external SMPP is enabled, you may bind it to a different interface using: + +---- +smpp + local-tcp-ip 10.23.42.1 2775 +---- + +More on SMPP configuration in <>. + +The external MNCC handler is configured by the `--mncc-sock` commandline +argument. Choose a different such socket path for each OsmoMSC instance running +on the same file system. See more in <>. + +For the following links, OsmoMSC acts as a client and does not listen/bind to a +specific interface, and will hence not encounter conflicts for multiple instances +running on the same interface: + +- The SCCP/M3UA links are established by OsmoMSC contacting an STP. +- The GSUP link is established by OsmoMSC contacting an HLR. + + +=== Configure primary links + +==== Configure SCCP/M3UA to accept _A_ and _IuCS_ links + +OsmoMSC will contact an STP instance to establish an SCCP/M3UA link. BSC and +HNBGW will then reach the MSC via this link. By default, an STP instance is +assumed to listen on the default M3UA port (2905) on the local host. + +Establishing an SCCP/M3UA link towards an STP instance not on the local host +can be configured as follows: + +---- +cs7 instance 0 + asp my-OsmoMSC 2905 0 m3ua + ! IP address of the remote STP: + remote-ip 10.23.24.1 +---- + +Note that _A_ and _IuCS_ may use different SCCP instances, if so desired: + +---- +cs7 instance 0 + asp my-OsmoMSC-A 2905 0 m3ua + remote-ip 10.23.42.1 +cs7 instance 1 + asp my-OsmoMSC-Iu 2905 0 m3ua + remote-ip 10.23.42.2 +msc + cs7-instance-a 0 + cs7-instance-iu 1 +---- + +A full configuration needs an `asp` on an `as` -- an Application Server Process +running on an Application Server -- as well as a local point code and routing +configuration. The SCCP VTY automatically creates those parts that are missing, +by assuming sane defaults. A complete configuration would look like this: + +---- +cs7 instance 0 + point-code 0.23.1 + asp my-OsmoMSC-A-Iu 2905 0 m3ua + remote-ip 127.0.0.1 + as my-as-for-OsmoMSC-A-Iu m3ua + asp my-OsmoMSC-A-Iu + routing-key 0 0.23.1 +---- + +==== Configure GSUP to reach the HLR + +OsmoMSC will assume a GSUP server (OsmoHLR) to run on the local host and the +default GSUP port (4222). Contacting an HLR at a different IP address can be +configured as follows: + +---- +hlr + ! IP address of the remote HLR: + remote-ip 10.23.42.1 + ! default port is 4222, optionally configurable by: + remote-port 1234 +---- diff --git a/OsmoMSC/osmomsc-usermanual-docinfo.xml b/OsmoMSC/osmomsc-usermanual-docinfo.xml new file mode 100644 index 0000000..d99bba7 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual-docinfo.xml @@ -0,0 +1,47 @@ + + + 1 + September 18th, 2017 + NH + + Initial version; based on OsmoNITB manual version 2. + + + + + + + Neels + Hofmeyr + nhofmeyr at sysmocom.de + NH + + sysmocom + sysmocom - s.f.m.c. GmbH + Senior Developer + + + + + + 2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with the Invariant Sections being just 'Foreword', + 'Acknowledgements' and 'Preface', with no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoMSC/osmomsc-usermanual.adoc b/OsmoMSC/osmomsc-usermanual.adoc new file mode 100644 index 0000000..7c20020 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual.adoc @@ -0,0 +1,36 @@ +:gfdl-enabled: +:program-name: OsmoMSC + +OsmoMSC User Manual +==================== +Neels Hofmeyr + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +include::chapters/control.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + +include::chapters/net.adoc[] + +include::../common/chapters/smpp.adoc[] + +include::../common/chapters/mncc.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] + diff --git a/OsmoMSC/osmomsc-vty-reference.xml b/OsmoMSC/osmomsc-vty-reference.xml new file mode 100644 index 0000000..a954b84 --- /dev/null +++ b/OsmoMSC/osmomsc-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 18th September 2017 + nh + Initial + + + + OsmoMSC VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoMSC/vty/msc_vty_additions.xml b/OsmoMSC/vty/msc_vty_additions.xml new file mode 100644 index 0000000..0d473bd --- /dev/null +++ b/OsmoMSC/vty/msc_vty_additions.xml @@ -0,0 +1,24 @@ + + + + MNCC Internal Configuration + This node allows to configure the default codecs for + the internal call control handling. + + + + SMPP Configuration + This node allows to configure the SMPP interface + for interfacing with external SMS applications. This section + contains generic/common SMPP related configuration, and no + per-ESME specific parameters. + + + + ESME Configuration + This node allows to configure one particular SMPP + ESME, which is an External SMS Entity such as a SMS based + application server. You can define any number of ESME within + the SMPP node of the OsmoNITB VTY. + + diff --git a/OsmoMSC/vty/msc_vty_reference.xml b/OsmoMSC/vty/msc_vty_reference.xml new file mode 100644 index 0000000..b7311ab --- /dev/null +++ b/OsmoMSC/vty/msc_vty_reference.xml @@ -0,0 +1,3019 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/chapters/bibliography.adoc b/common/chapters/bibliography.adoc index 9d4c234..129758f 100644 --- a/common/chapters/bibliography.adoc +++ b/common/chapters/bibliography.adoc @@ -14,6 +14,14 @@ http://ftp.osmocom.org/docs/latest/osmobsc-usermanual.pdf - [[[vty-ref-osmobsc]]] Osmocom Project: OsmoBSC VTY Reference Manual. http://ftp.osmocom.org/docs/latest/osmobsc-vty-reference.pdf +- [[[userman-osmomsc]]] Osmocom Project: OsmoMSC User Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-usermanual.pdf +- [[[vty-ref-osmomsc]]] Osmocom Project: OsmoMSC VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-vty-reference.pdf +- [[[userman-osmohlr]]] Osmocom Project: OsmoHLR User Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-usermanual.pdf +- [[[vty-ref-osmohlr]]] Osmocom Project: OsmoHLR VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-vty-reference.pdf - [[[userman-osmopcu]]] Osmocom Project: OsmoPCU User Manual. http://ftp.osmocom.org/docs/latest/osmopcu-usermanual.pdf - [[[vty-ref-osmopcu]]] Osmocom Project: OsmoPCU VTY Reference Manual. -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 3 20:30:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 3 Oct 2017 20:30:18 +0000 Subject: [MERGED] osmo-msc[master]: fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() ...................................................................... fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() Add required msgb_free() to vlr_gsupc_read_cb(). Adjust msc_vlr_tests.c gsup_rx() to *not* free the msgb again after vlr_gsupc_read_cb() did. Related: OS#2476 Change-Id: I347c53f57a7fa79921aed3f6e42599841acf27c0 --- M src/libvlr/vlr.c M tests/msc_vlr/msc_vlr_tests.c 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: dexter: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index 6094c9c..adfe258 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -804,6 +804,7 @@ osmo_hexdump_nospc(msgb_l2(msg), msgb_l2len(msg))); rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup); + msgb_free(msg); if (rc < 0) { LOGP(DVLR, LOGL_ERROR, "decoding GSUP message fails with error '%s' (%d)\n", diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index a6e0f29..f9dc278 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -130,12 +130,12 @@ label = osmo_gsup_message_type_name(msg->l2h[0]); fprintf(stderr, "<-- GSUP rx %s: %s\n", label, osmo_hexdump_nospc(msgb_l2(msg), msgb_l2len(msg))); + /* GSUP read cb takes ownership of msgb */ rc = vlr_gsupc_read_cb(net->vlr->gsup_client, msg); fprintf(stderr, "<-- GSUP rx %s: vlr_gsupc_read_cb() returns %d\n", label, rc); if (expect_tx_hex) OSMO_ASSERT(gsup_tx_confirmed); - talloc_free(msg); } bool conn_exists(struct gsm_subscriber_connection *conn) -- To view, visit https://gerrit.osmocom.org/4077 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I347c53f57a7fa79921aed3f6e42599841acf27c0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Oct 3 20:31:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 3 Oct 2017 20:31:40 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: mncc: not 'TCHF', rather 'TCH' In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: mncc: not 'TCHF', rather 'TCH' ...................................................................... mncc: not 'TCHF', rather 'TCH' Change-Id: I0edf1763122f182c66ad4c7155ddd4bea0c1d608 --- M common/chapters/mncc.adoc 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/mncc.adoc b/common/chapters/mncc.adoc index 77579a5..4f098e6 100644 --- a/common/chapters/mncc.adoc +++ b/common/chapters/mncc.adoc @@ -150,14 +150,14 @@ Direction: Handler -> {program-name} -Enable the forwarding of TCHF voice frames via the MNCC interface in +Enable the forwarding of TCH voice frames via the MNCC interface in {program-name}->Handler direction for the specified call. ==== MNCC_FRAME_DROP Direction: Handler -> {program-name} -Disable the forwarding of TCHF voice frames via the MNCC interface in +Disable the forwarding of TCH voice frames via the MNCC interface in {program-name}->Handler direction for the specified call. ==== MNCC_LCHAN_MODIFY -- To view, visit https://gerrit.osmocom.org/4105 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0edf1763122f182c66ad4c7155ddd4bea0c1d608 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 4 00:08:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 00:08:38 +0000 Subject: [PATCH] libsmpp34[master]: Fix 'make distcheck' by adding .version to EXTRA_DISTI Message-ID: Review at https://gerrit.osmocom.org/4133 Fix 'make distcheck' by adding .version to EXTRA_DISTI Commit 1648066f1652e758d93393a875b1337a27fc0cf7 introduced osmocom-style git-version-gen, .version, etc. - but failed to include .version in the EXTRA_DIST list of files. Change-Id: If191e82677d851ca486ec78da6643958d05eb5f6 --- M Makefile.am 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/33/4133/1 diff --git a/Makefile.am b/Makefile.am index d526301..3e44376 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,8 @@ test_apps/esme.xml\ test_apps/sendwp.xml\ test_apps/recv_and_unpack.inc \ - README.md + README.md \ + .version @RELMAKE@ -- To view, visit https://gerrit.osmocom.org/4133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If191e82677d851ca486ec78da6643958d05eb5f6 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 4 00:16:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 00:16:00 +0000 Subject: [PATCH] osmo-bsc[master]: Remove any references to RANAP and Iu Message-ID: Review at https://gerrit.osmocom.org/4134 Remove any references to RANAP and Iu This is a BSC, it has norelation to RANAP or Iu(h). Let's remove an references to it, and also the build dependency to libosmo-ranap-dev Change-Id: I517b9f69309b2ed0540dd6c186b3d4a2a03aed44 --- M debian/control M include/osmocom/bsc/gsm_data.h D include/osmocom/bsc/iu_dummy.h 3 files changed, 0 insertions(+), 66 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/34/4134/1 diff --git a/debian/control b/debian/control index f931341..7b25ecc 100644 --- a/debian/control +++ b/debian/control @@ -18,7 +18,6 @@ libgtp-dev, libosmocore-dev, libosmo-sccp-dev, - libosmo-ranap-dev, libosmo-abis-dev, libosmo-netif-dev, libosmo-legacy-mgcp-dev diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 4e56db5..6814662 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -29,7 +29,6 @@ struct bsc_subscr; struct vlr_instance; struct vlr_subscr; -struct ranap_ue_conn_ctx; struct gprs_ra_id; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -200,12 +199,6 @@ uint16_t port_subscr; uint16_t port_cn; } rtp; - - /* which Iu-CS connection, if any. */ - struct { - struct ranap_ue_conn_ctx *ue_ctx; - uint8_t rab_id; - } iu; struct { /* A pointer to the SCCP user that handles @@ -484,13 +477,6 @@ /* Periodic location update default value */ uint8_t t3212; - - struct { - /* CS7 instance id number (set via VTY) */ - uint32_t cs7_instance; - int rab_assign_addr_enc; - struct osmo_sccp_instance *sccp; - } iu; struct { /* CS7 instance id number (set via VTY) */ diff --git a/include/osmocom/bsc/iu_dummy.h b/include/osmocom/bsc/iu_dummy.h deleted file mode 100644 index d5e1428..0000000 --- a/include/osmocom/bsc/iu_dummy.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Trivial switch-off of external Iu dependencies, - * allowing to run full unit tests even when built without Iu support. */ - -/* - * (C) 2016,2017 by sysmocom s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include - -struct msgb; -struct gsm_auth_tuple; -struct RANAP_Cause; -struct osmo_auth_vector; - -struct ranap_ue_conn_ctx { - struct llist_head list; - uint32_t conn_id; -}; - -int ranap_iu_tx(struct msgb *msg, uint8_t sapi); -int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, - int send_ck); -int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); -struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap); -int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); -int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); -int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); -- To view, visit https://gerrit.osmocom.org/4134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I517b9f69309b2ed0540dd6c186b3d4a2a03aed44 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 4 00:38:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 00:38:36 +0000 Subject: libsmpp34[master]: Fix 'make distcheck' by adding .version to EXTRA_DISTI In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If191e82677d851ca486ec78da6643958d05eb5f6 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 00:38:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 00:38:39 +0000 Subject: [MERGED] libsmpp34[master]: Fix 'make distcheck' by adding .version to EXTRA_DISTI In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix 'make distcheck' by adding .version to EXTRA_DISTI ...................................................................... Fix 'make distcheck' by adding .version to EXTRA_DISTI Commit 1648066f1652e758d93393a875b1337a27fc0cf7 introduced osmocom-style git-version-gen, .version, etc. - but failed to include .version in the EXTRA_DIST list of files. Change-Id: If191e82677d851ca486ec78da6643958d05eb5f6 --- M Makefile.am 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index d526301..3e44376 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,8 @@ test_apps/esme.xml\ test_apps/sendwp.xml\ test_apps/recv_and_unpack.inc \ - README.md + README.md \ + .version @RELMAKE@ -- To view, visit https://gerrit.osmocom.org/4133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If191e82677d851ca486ec78da6643958d05eb5f6 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 4 00:39:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 00:39:46 +0000 Subject: osmo-bsc[master]: Remove any references to RANAP and Iu In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I517b9f69309b2ed0540dd6c186b3d4a2a03aed44 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 00:40:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 00:40:15 +0000 Subject: libosmocore[master]: Introduce osmo_identifier_valid() function to check validity... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I96a8d345c5a69238a12d040f39b70c485a5c421c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 00:40:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 00:40:23 +0000 Subject: libosmocore[master]: fsm: Enforce FSM and FSM instance names are valid osmocom id... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 00:40:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 00:40:29 +0000 Subject: libosmocore[master]: rate_ctr: Enforce counter (and ctr_group) names are valid id... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 00:40:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 00:40:36 +0000 Subject: libosmocore[master]: Convert lib-internal rate_ctr from '.' separator to ':' sepa... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24a556f447cfac25efb6e83cac2d0c2972d98fe3 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 00:40:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 00:40:42 +0000 Subject: libosmocore[master]: stats_test: Extend check to include test for counter group n... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie35682aa79526e2ffeab6995cd640b7847d855bf Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 03:42:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 03:42:59 +0000 Subject: [PATCH] libosmo-sccp[master]: Makefile.am: Link libosmo-sigtran against libvty Message-ID: Review at https://gerrit.osmocom.org/4135 Makefile.am: Link libosmo-sigtran against libvty libosmo-sigtran is using symbols from libosmo-vty, so make sure that we explicitly link against libosmo-vty to ensure the dependency shows up in `ldd` of the library. Change-Id: I4d96612a0df5a1232ed8fe280c5d592f462ef7b1 --- M src/Makefile.am 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/35/4135/1 diff --git a/src/Makefile.am b/src/Makefile.am index 5f0b3f9..1001d19 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMONETIF_CFLAGS) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) noinst_HEADERS = sccp_internal.h xua_asp_fsm.h xua_as_fsm.h xua_internal.h @@ -32,4 +33,5 @@ osmo_ss7.c osmo_ss7_hmrt.c xua_asp_fsm.c xua_as_fsm.c \ osmo_ss7_vty.c sccp_vty.c ipa.c libosmo_sigtran_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined -export-symbols-regex '^osmo_' -libosmo_sigtran_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMONETIF_LIBS) $(LIBSCTP_LIBS) +libosmo_sigtran_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) \ + $(LIBOSMONETIF_LIBS) $(LIBSCTP_LIBS) -- To view, visit https://gerrit.osmocom.org/4135 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d96612a0df5a1232ed8fe280c5d592f462ef7b1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 4 03:49:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 03:49:03 +0000 Subject: [PATCH] osmo-iuh[master]: Makefile.am: Link libosmo-ranap against libosmo-sigtran Message-ID: Review at https://gerrit.osmocom.org/4136 Makefile.am: Link libosmo-ranap against libosmo-sigtran In Change-Id I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 we introduced the somewhat arguable combination of Iu code in libosmo-ranap. This Iu code uses functions provided by libosmo-sigtran. However, at the time it was overlooked to explicitly link libosmo-ranap against libosmo-sigtran, which caused linking failures of programs using libosmo-ranap, such as the unit tests included in this package. Change-Id: Ibfbcafd31c91dc630d406ec39b3b076bdb1f4c19 --- M src/Makefile.am 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/36/4136/1 diff --git a/src/Makefile.am b/src/Makefile.am index 48918b0..62f09e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -52,7 +52,8 @@ RANAP_LIBVERSION=0:0:0 lib_LTLIBRARIES = libosmo-ranap.la libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) -libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la +libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOSIGTRAN_LIBS) \ + $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la libosmo_ranap_la_SOURCES = ranap_common.c ranap_encoder.c ranap_decoder.c ranap_msg_factory.c iu_helpers.c \ ranap_common_cn.c iu_client.c iu_client_vty.c -- To view, visit https://gerrit.osmocom.org/4136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibfbcafd31c91dc630d406ec39b3b076bdb1f4c19 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 4 03:50:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 03:50:01 +0000 Subject: [PATCH] osmo-iuh[master]: Makefile.am: Link libosmo-ranap against libosmo-sigtran In-Reply-To: References: Message-ID: Makefile.am: Link libosmo-ranap against libosmo-sigtran In Change-Id I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 we introduced the somewhat arguable combination of Iu code in libosmo-ranap. This Iu code uses functions provided by libosmo-sigtran. However, at the time it was overlooked to explicitly link libosmo-ranap against libosmo-sigtran, which caused linking failures of programs using libosmo-ranap, such as the unit tests included in this package. Below example is from building using contrib/jenkins.sh on Ubuntu 17.04: CCLD test-ranap ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_sccp_local_addr_by_instance' ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_sccp_tx_unitdata_msg' ../../src/.libs/libosmo-ranap.so: undefined reference to `vty_out' ../../src/.libs/libosmo-ranap.so: undefined reference to `install_element' ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_sccp_user_bind' ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_sccp_user_sap_down' ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_scu_prim_name' ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_sccp_addr_dump' collect2: error: ld returned 1 exit status Makefile:418: recipe for target 'test-ranap' failed Change-Id: Ibfbcafd31c91dc630d406ec39b3b076bdb1f4c19 --- M src/Makefile.am 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/36/4136/2 diff --git a/src/Makefile.am b/src/Makefile.am index 48918b0..62f09e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -52,7 +52,8 @@ RANAP_LIBVERSION=0:0:0 lib_LTLIBRARIES = libosmo-ranap.la libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) -libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la +libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOSIGTRAN_LIBS) \ + $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la libosmo_ranap_la_SOURCES = ranap_common.c ranap_encoder.c ranap_decoder.c ranap_msg_factory.c iu_helpers.c \ ranap_common_cn.c iu_client.c iu_client_vty.c -- To view, visit https://gerrit.osmocom.org/4136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibfbcafd31c91dc630d406ec39b3b076bdb1f4c19 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 4 03:50:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 03:50:30 +0000 Subject: libosmo-sccp[master]: Makefile.am: Link libosmo-sigtran against libvty In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4135 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4d96612a0df5a1232ed8fe280c5d592f462ef7b1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 03:50:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 03:50:33 +0000 Subject: [MERGED] libosmo-sccp[master]: Makefile.am: Link libosmo-sigtran against libvty In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Makefile.am: Link libosmo-sigtran against libvty ...................................................................... Makefile.am: Link libosmo-sigtran against libvty libosmo-sigtran is using symbols from libosmo-vty, so make sure that we explicitly link against libosmo-vty to ensure the dependency shows up in `ldd` of the library. Change-Id: I4d96612a0df5a1232ed8fe280c5d592f462ef7b1 --- M src/Makefile.am 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/Makefile.am b/src/Makefile.am index 5f0b3f9..1001d19 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMONETIF_CFLAGS) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) noinst_HEADERS = sccp_internal.h xua_asp_fsm.h xua_as_fsm.h xua_internal.h @@ -32,4 +33,5 @@ osmo_ss7.c osmo_ss7_hmrt.c xua_asp_fsm.c xua_as_fsm.c \ osmo_ss7_vty.c sccp_vty.c ipa.c libosmo_sigtran_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined -export-symbols-regex '^osmo_' -libosmo_sigtran_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMONETIF_LIBS) $(LIBSCTP_LIBS) +libosmo_sigtran_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) \ + $(LIBOSMONETIF_LIBS) $(LIBSCTP_LIBS) -- To view, visit https://gerrit.osmocom.org/4135 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4d96612a0df5a1232ed8fe280c5d592f462ef7b1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 4 03:59:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 03:59:24 +0000 Subject: osmo-iuh[master]: Makefile.am: Link libosmo-ranap against libosmo-sigtran In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfbcafd31c91dc630d406ec39b3b076bdb1f4c19 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 03:59:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 03:59:26 +0000 Subject: [MERGED] osmo-iuh[master]: Makefile.am: Link libosmo-ranap against libosmo-sigtran In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Makefile.am: Link libosmo-ranap against libosmo-sigtran ...................................................................... Makefile.am: Link libosmo-ranap against libosmo-sigtran In Change-Id I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 we introduced the somewhat arguable combination of Iu code in libosmo-ranap. This Iu code uses functions provided by libosmo-sigtran. However, at the time it was overlooked to explicitly link libosmo-ranap against libosmo-sigtran, which caused linking failures of programs using libosmo-ranap, such as the unit tests included in this package. Below example is from building using contrib/jenkins.sh on Ubuntu 17.04: CCLD test-ranap ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_sccp_local_addr_by_instance' ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_sccp_tx_unitdata_msg' ../../src/.libs/libosmo-ranap.so: undefined reference to `vty_out' ../../src/.libs/libosmo-ranap.so: undefined reference to `install_element' ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_sccp_user_bind' ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_sccp_user_sap_down' ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_scu_prim_name' ../../src/.libs/libosmo-ranap.so: undefined reference to `osmo_sccp_addr_dump' collect2: error: ld returned 1 exit status Makefile:418: recipe for target 'test-ranap' failed Change-Id: Ibfbcafd31c91dc630d406ec39b3b076bdb1f4c19 --- M src/Makefile.am 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/Makefile.am b/src/Makefile.am index 48918b0..62f09e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -52,7 +52,8 @@ RANAP_LIBVERSION=0:0:0 lib_LTLIBRARIES = libosmo-ranap.la libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) -libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la +libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOSIGTRAN_LIBS) \ + $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la libosmo_ranap_la_SOURCES = ranap_common.c ranap_encoder.c ranap_decoder.c ranap_msg_factory.c iu_helpers.c \ ranap_common_cn.c iu_client.c iu_client_vty.c -- To view, visit https://gerrit.osmocom.org/4136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibfbcafd31c91dc630d406ec39b3b076bdb1f4c19 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 4 09:13:27 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 4 Oct 2017 09:13:27 +0000 Subject: meta-telephony[201705]: Update osmocom versions to point to current master In-Reply-To: References: Message-ID: Patch Set 2: This is the only patch in the series missing a +2. Once I get it I'll merge the whole patchset and merge pespin/split-openbsc->201705 in meta-sysmocom-bsp. -- To view, visit https://gerrit.osmocom.org/4087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 09:15:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 4 Oct 2017 09:15:25 +0000 Subject: [PATCH] osmo-sgsn[master]: deb: fix copyright file issues Message-ID: Review at https://gerrit.osmocom.org/4137 deb: fix copyright file issues * remove non-existent files * fix ax_check_compile_flag.m4 to match autoconf-archive Change-Id: I6881c0a16017d80d142a6cfa756a9c153bee94d3 Related: OS#2527 --- M debian/copyright 1 file changed, 1 insertion(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/37/4137/1 diff --git a/debian/copyright b/debian/copyright index ad911c0..db20919 100644 --- a/debian/copyright +++ b/debian/copyright @@ -11,72 +11,25 @@ README.vty-tests configure.ac contrib/Makefile.am - contrib/a-link/sccp-split-by-con.lua - contrib/bsc-test/README - contrib/bsc-test/all_dial - contrib/bsc-test/dial.sh - contrib/bsc-test/drop-oml.sh - contrib/bsc-test/drop.sh - contrib/bsc-test/hangup - contrib/bsc-test/msc.sh - contrib/bsc_control.py - contrib/bt.py - contrib/convert_to_enum.py - contrib/ctrl2sse.py contrib/gprs/gb-proxy-unblock-bug.py contrib/gprs/gprs-bssgp-histogram.lua contrib/gprs/gprs-buffer-count.lua contrib/gprs/gprs-split-trace-by-tlli.lua contrib/gprs/gprs-verify-nu.lua - contrib/hlr-remove-old.sql - contrib/hlrsync/hlrsync.py contrib/ipa.py contrib/jenkins.sh - contrib/mgcp_server.py - contrib/nat/test_regexp.c - contrib/nat/ussd_example.py - contrib/rtp/gen_rtp_header.erl - contrib/rtp/rtp_replay.st - contrib/rtp/rtp_replay_shared.st - contrib/rtp/rtp_replay_sip.st - contrib/rtp/timestamp_rtp.lua - contrib/sms/fill-hlr.st - contrib/sms/hlr-query.st - contrib/sms/sqlite-probe.tap.d contrib/soap.py - contrib/systemd/osmo-bsc-mgcp.service - contrib/systemd/osmo-bsc.service contrib/systemd/osmo-gbproxy.service - contrib/systemd/osmo-msc.service - contrib/systemd/osmo-nitb.service contrib/systemd/osmo-sgsn.service - contrib/testconv/Makefile - contrib/testconv/testconv_main.c contrib/twisted_ipa.py - doc/BS11-OML.txt doc/Makefile.am - doc/call-routing.txt - doc/channel_release.txt - doc/e1-data-model.txt doc/examples/Makefile.am - doc/examples/osmo-bsc/osmo-bsc.cfg - doc/examples/osmo-bsc_mgcp/mgcp.cfg - doc/examples/osmo-bsc_nat/black-list.cfg - doc/examples/osmo-bsc_nat/bscs.cfg - doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg doc/examples/osmo-gbproxy/osmo-gbproxy.cfg doc/examples/osmo-gtphub/gtphub-example.txt doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg doc/examples/osmo-gtphub/osmo-gtphub.cfg - doc/examples/osmo-msc/osmo-msc.cfg doc/examples/osmo-sgsn/osmo-sgsn.cfg - doc/gsm-hopping.txt - doc/handover.txt - doc/ipa-sccp.txt - doc/oml-interface.txt - doc/osmo-nitb-data_structures.dot - doc/paging.txt include/Makefile.am include/osmocom/sgsn/Makefile.am include/osmocom/sgsn/common.h @@ -108,9 +61,6 @@ tests/gprs/gprs_test.ok tests/gtphub/Makefile.am tests/gtphub/gtphub_test.ok - tests/libiudummy/Makefile.am - tests/libiudummy/README - tests/libiudummy/iudummy.c tests/oap/Makefile.am tests/oap/oap_client_test.err tests/oap/oap_client_test.ok @@ -125,7 +75,6 @@ tests/v42bis/v42bis_test.ok tests/xid/Makefile.am tests/xid/xid_test.ok - tools/hlrstat.pl Copyright: __NO_COPYRIGHT_NOR_LICENSE__ License: __NO_COPYRIGHT_NOR_LICENSE__ @@ -421,7 +370,7 @@ Files: m4/ax_check_compile_flag.m4 Copyright: 2008 Guido U. Draheim 2011 Maarten Bosmans -License: GPL-3.0+ with unknown exception *** check multiple exceptions *** +License: GNU-All-Permissive-License This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your -- To view, visit https://gerrit.osmocom.org/4137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6881c0a16017d80d142a6cfa756a9c153bee94d3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 4 10:04:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 4 Oct 2017 10:04:59 +0000 Subject: [PATCH] osmo-sgsn[master]: deb: fix copyright file issues In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4137 to look at the new patch set (#2). deb: fix copyright file issues * remove non-existent files * fix ax_check_compile_flag.m4 license to match autoconf-archive * fix various .py license to match OpenBSC description Change-Id: I6881c0a16017d80d142a6cfa756a9c153bee94d3 Related: OS#2527 --- M debian/copyright 1 file changed, 8 insertions(+), 93 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/37/4137/2 diff --git a/debian/copyright b/debian/copyright index ad911c0..97b890e 100644 --- a/debian/copyright +++ b/debian/copyright @@ -11,72 +11,25 @@ README.vty-tests configure.ac contrib/Makefile.am - contrib/a-link/sccp-split-by-con.lua - contrib/bsc-test/README - contrib/bsc-test/all_dial - contrib/bsc-test/dial.sh - contrib/bsc-test/drop-oml.sh - contrib/bsc-test/drop.sh - contrib/bsc-test/hangup - contrib/bsc-test/msc.sh - contrib/bsc_control.py - contrib/bt.py - contrib/convert_to_enum.py - contrib/ctrl2sse.py contrib/gprs/gb-proxy-unblock-bug.py contrib/gprs/gprs-bssgp-histogram.lua contrib/gprs/gprs-buffer-count.lua contrib/gprs/gprs-split-trace-by-tlli.lua contrib/gprs/gprs-verify-nu.lua - contrib/hlr-remove-old.sql - contrib/hlrsync/hlrsync.py contrib/ipa.py contrib/jenkins.sh - contrib/mgcp_server.py - contrib/nat/test_regexp.c - contrib/nat/ussd_example.py - contrib/rtp/gen_rtp_header.erl - contrib/rtp/rtp_replay.st - contrib/rtp/rtp_replay_shared.st - contrib/rtp/rtp_replay_sip.st - contrib/rtp/timestamp_rtp.lua - contrib/sms/fill-hlr.st - contrib/sms/hlr-query.st - contrib/sms/sqlite-probe.tap.d contrib/soap.py - contrib/systemd/osmo-bsc-mgcp.service - contrib/systemd/osmo-bsc.service contrib/systemd/osmo-gbproxy.service - contrib/systemd/osmo-msc.service - contrib/systemd/osmo-nitb.service contrib/systemd/osmo-sgsn.service - contrib/testconv/Makefile - contrib/testconv/testconv_main.c contrib/twisted_ipa.py - doc/BS11-OML.txt doc/Makefile.am - doc/call-routing.txt - doc/channel_release.txt - doc/e1-data-model.txt doc/examples/Makefile.am - doc/examples/osmo-bsc/osmo-bsc.cfg - doc/examples/osmo-bsc_mgcp/mgcp.cfg - doc/examples/osmo-bsc_nat/black-list.cfg - doc/examples/osmo-bsc_nat/bscs.cfg - doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg doc/examples/osmo-gbproxy/osmo-gbproxy.cfg doc/examples/osmo-gtphub/gtphub-example.txt doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg doc/examples/osmo-gtphub/osmo-gtphub.cfg - doc/examples/osmo-msc/osmo-msc.cfg doc/examples/osmo-sgsn/osmo-sgsn.cfg - doc/gsm-hopping.txt - doc/handover.txt - doc/ipa-sccp.txt - doc/oml-interface.txt - doc/osmo-nitb-data_structures.dot - doc/paging.txt include/Makefile.am include/osmocom/sgsn/Makefile.am include/osmocom/sgsn/common.h @@ -108,9 +61,6 @@ tests/gprs/gprs_test.ok tests/gtphub/Makefile.am tests/gtphub/gtphub_test.ok - tests/libiudummy/Makefile.am - tests/libiudummy/README - tests/libiudummy/iudummy.c tests/oap/Makefile.am tests/oap/oap_client_test.err tests/oap/oap_client_test.ok @@ -125,7 +75,6 @@ tests/v42bis/v42bis_test.ok tests/xid/Makefile.am tests/xid/xid_test.ok - tools/hlrstat.pl Copyright: __NO_COPYRIGHT_NOR_LICENSE__ License: __NO_COPYRIGHT_NOR_LICENSE__ @@ -214,7 +163,6 @@ Files: src/gprs/gtphub_ares.c src/gprs/gtphub_sock.c - tests/ctrl_test_runner.py tests/gbproxy/gbproxy_test.c Copyright: 2013 Jacob Erlbeck 2013 sysmocom s.f.m.c. GmbH @@ -244,26 +192,13 @@ On Debian systems, the complete text of the GNU Lesser General Public License Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. -Files: osmoappdesc.py -Copyright: 2013 Katerina Barone-Adesi -License: GPL-3.0+ - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see - . - Most systems won't be able to use these, so they're separated out - . - On Debian systems, the complete text of the GNU General Public License - Version 3 can be found in `/usr/share/common-licenses/GPL-3'. +Files: osmoappdesc.py + tests/ctrl_test_runner.py + tests/vty_test_runner.py +Copyright: 2013 Katerina Barone-Adesi + 2013 Jacob Erlbeck + 2013-2014 Holger Hans Peter Freyther +License: GPL-3+ Files: git-version-gen Copyright: 2007-2010 Free Software Foundation, Inc. @@ -315,26 +250,6 @@ automatically be up-to-date each time configure is run (and note that since configure.ac no longer includes a version string, Makefile rules should not depend on configure.ac for version updates). - . - On Debian systems, the complete text of the GNU General Public License - Version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -Files: tests/vty_test_runner.py -Copyright: 2013 Holger Hans Peter Freyther - 2013 Katerina Barone-Adesi -License: GPL-3.0+ - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . . On Debian systems, the complete text of the GNU General Public License Version 3 can be found in `/usr/share/common-licenses/GPL-3'. @@ -421,7 +336,7 @@ Files: m4/ax_check_compile_flag.m4 Copyright: 2008 Guido U. Draheim 2011 Maarten Bosmans -License: GPL-3.0+ with unknown exception *** check multiple exceptions *** +License: GNU-All-Permissive-License This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your -- To view, visit https://gerrit.osmocom.org/4137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6881c0a16017d80d142a6cfa756a9c153bee94d3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 4 10:09:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 4 Oct 2017 10:09:23 +0000 Subject: [PATCH] osmo-ci[master]: Fix OsmoSGSN nightly build Message-ID: Review at https://gerrit.osmocom.org/4138 Fix OsmoSGSN nightly build It depends on libgtp provided by OsmoGGSN so let's build it in that order. Change-Id: Icedc259ddc3a3b83ce8fe87f5572596ef29d6814 Related: OS#2527 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/38/4138/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 032bd49..432e7a1 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -51,8 +51,8 @@ build libosmo-abis build libosmo-netif build libsmpp34 -build osmo-sgsn build osmo-ggsn +build osmo-sgsn build openbsc build osmo-pcap build osmo-stp -- To view, visit https://gerrit.osmocom.org/4138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icedc259ddc3a3b83ce8fe87f5572596ef29d6814 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 4 10:15:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 4 Oct 2017 10:15:13 +0000 Subject: osmo-ci[master]: Fix OsmoSGSN nightly build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icedc259ddc3a3b83ce8fe87f5572596ef29d6814 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 10:18:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 4 Oct 2017 10:18:16 +0000 Subject: libosmocore[master]: WIP: Fixup severe build performance issues introduced by osm... In-Reply-To: References: Message-ID: Patch Set 1: Looks good to me but I wonder how was the performance impact measured? Is there some command/script I can run to check before/after the patch status? -- To view, visit https://gerrit.osmocom.org/4127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 10:22:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 4 Oct 2017 10:22:46 +0000 Subject: osmo-bsc[master]: Remove any references to RANAP and Iu In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I517b9f69309b2ed0540dd6c186b3d4a2a03aed44 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 10:23:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 4 Oct 2017 10:23:46 +0000 Subject: osmo-gsm-tester[master]: jenkins: fix build of osmo-sgsn: use osmo-ggsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4122 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5161983ef625465e21b95578ab5648ecc73d6069 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 10:57:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 10:57:11 +0000 Subject: libosmocore[master]: WIP: Fixup severe build performance issues introduced by osm... In-Reply-To: References: Message-ID: Patch Set 1: > Looks good to me but I wonder how was the performance impact > measured? Is there some command/script I can run to check > before/after the patch status? If the difference is not obvious to you as a human being, I suggest something like "make clean; time make". Each time "bumpversion" is called from make, it takes about 0.6 seconds wall-clock time on my system. Calling it twice each time we're building in a new directory easily adds multiple seconds to each project build. Even a 'make clean' of libosmocore itself takes 2.6s with your osmo-release.mk vs. 0.33s with my approach. That's more than a factor 8 difference. -- To view, visit https://gerrit.osmocom.org/4127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 11:13:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 11:13:55 +0000 Subject: osmo-gsm-tester[master]: jenkins: fix build of osmo-sgsn: use osmo-ggsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4122 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5161983ef625465e21b95578ab5648ecc73d6069 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 11:13:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 11:13:56 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins: fix build of osmo-sgsn: use osmo-ggsn In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: fix build of osmo-sgsn: use osmo-ggsn ...................................................................... jenkins: fix build of osmo-sgsn: use osmo-ggsn osmo-sgsn change-id I91a126952ae75ae9ba1f42aac4d26413384bba5d and commit a3b73e917b653d13d027cff2c95a56bbc1264446 has broken compatibility with openggsn.git, by requiring current osmo-ggsn version (1.0.0). Fix build fallout: use osmo-ggsn instead of openggsn.git. Change-Id: I5161983ef625465e21b95578ab5648ecc73d6069 --- M contrib/jenkins-build-osmo-sgsn.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-osmo-sgsn.sh b/contrib/jenkins-build-osmo-sgsn.sh index 1979e8c..45fae5e 100755 --- a/contrib/jenkins-build-osmo-sgsn.sh +++ b/contrib/jenkins-build-osmo-sgsn.sh @@ -8,7 +8,7 @@ build_repo libosmo-abis build_repo libosmo-netif --disable-doxygen build_repo libosmo-sccp -build_repo openggsn +build_repo osmo-ggsn build_repo osmo-sgsn --disable-iu create_bin_tgz osmo-sgsn -- To view, visit https://gerrit.osmocom.org/4122 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5161983ef625465e21b95578ab5648ecc73d6069 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 4 11:14:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 11:14:14 +0000 Subject: osmo-msc[master]: fix vty tests: long timeout due to unreachable STP address In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ea4ef8a7e181bd3a38edf9c3b5d098f6ba65ee5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 11:14:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 11:14:16 +0000 Subject: [MERGED] osmo-msc[master]: fix vty tests: long timeout due to unreachable STP address In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix vty tests: long timeout due to unreachable STP address ...................................................................... fix vty tests: long timeout due to unreachable STP address The doc/examples/osmo-msc SCCP config examples with 10.23.42.1 as asp ip-remote cause >5 minutes timeout for each VTY config test being run before the VTY becomes available. This hugely elongates the config tests, we didn't spot it before because it does succeed after that timeout. Rather use link-local addresses in order to immediately note the lack of connection and carry on with the VTY config tests. Related: OS#2333 Change-Id: I5ea4ef8a7e181bd3a38edf9c3b5d098f6ba65ee5 --- M doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg M doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg index 3de478a..4ccb0d0 100644 --- a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg +++ b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg @@ -18,7 +18,7 @@ point-code 0.23.1 asp asp-clnt-OsmoMSC-A-Iu 2905 0 m3ua ! where to reach the STP: - remote-ip 10.23.24.1 + remote-ip 127.0.0.5 ! local-ip 10.23.24.1 msc cs7-instance-a 0 diff --git a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg index 3c38445..8b481de 100644 --- a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg +++ b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg @@ -17,11 +17,11 @@ cs7 instance 0 point-code 0.23.1 asp asp-clnt-OsmoMSC-A 2905 0 m3ua - remote-ip 10.23.24.1 + remote-ip 127.0.0.5 cs7 instance 1 point-code 0.23.2 asp asp-clnt-OsmoMSC-Iu 2905 0 m3ua - remote-ip 10.23.24.2 + remote-ip 127.0.0.6 msc cs7-instance-a 0 cs7-instance-iu 1 -- To view, visit https://gerrit.osmocom.org/4123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ea4ef8a7e181bd3a38edf9c3b5d098f6ba65ee5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 4 11:14:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 11:14:39 +0000 Subject: [MERGED] osmo-msc[master]: cosmetic: vlr: declare a struct in .h; drop unused header In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: vlr: declare a struct in .h; drop unused header ...................................................................... cosmetic: vlr: declare a struct in .h; drop unused header In vlr_core.h, "pre-declare" a struct used in function declaration. In vlr_lu_fsm.c, gsup.h is not used, drop the #include. Change-Id: I61d793c3001abbe6d381be1ae0bb350b07403e88 --- M src/libvlr/vlr_core.h M src/libvlr/vlr_lu_fsm.c 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libvlr/vlr_core.h b/src/libvlr/vlr_core.h index 6ca54e8..310cd97 100644 --- a/src/libvlr/vlr_core.h +++ b/src/libvlr/vlr_core.h @@ -2,6 +2,8 @@ #include +struct osmo_gsup_message; + #define LOGGSUPP(level, gsup, fmt, args...) \ LOGP(DVLR, level, "GSUP(%s) " fmt, \ (gsup)->imsi, \ diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index ea7529e..37fe235 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -21,7 +21,6 @@ #include #include -#include #include #include -- To view, visit https://gerrit.osmocom.org/4078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61d793c3001abbe6d381be1ae0bb350b07403e88 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 4 11:37:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 11:37:30 +0000 Subject: [ABANDON] osmo-msc[master]: a_iface: remove obsolete include In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: a_iface: remove obsolete include ...................................................................... Abandoned already merged elsewhere -- To view, visit https://gerrit.osmocom.org/3956 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ic6d32769819ecfcb585c61360d3df97824a2ef03 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 4 11:47:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 11:47:01 +0000 Subject: libosmocore[master]: Remove bogus error message In-Reply-To: References: Message-ID: Patch Set 5: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3973/5/osmo-release.mk File osmo-release.mk: Line 6: NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty 2>/dev/null | awk -F '=' '{ print $$2 }') I am referring to this line. This invocation of 'bumpversion' may produce error messages on stderr. You are silencing them. Let's not do that if other ways exist to keep the "bumpversion not found" message from appearing in each and every 'make' invocation, like Harald's separate release script: https://gerrit.osmocom.org/4127 . Furthermore I am still waiting for an explanation of what bumpversion is intended to do for us in the first place. Let's not start another tennis match of questions, please. -- To view, visit https://gerrit.osmocom.org/3973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 4 11:54:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 11:54:23 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/4003/7/include/osmocom/mgcp/mgcp_stat.h File include/osmocom/mgcp/mgcp_stat.h: Line 7: * (C) 2017 by sysmocom s.f.m.c. GmbH oversaw this one, sorry, ignore my comment above; same for others like this if there are more -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 7 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 4 12:11:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 12:11:27 +0000 Subject: libosmocore[master]: IPA msgb: on ipa_msg_alloc(), set caller as talloc string In-Reply-To: References: Message-ID: Patch Set 1: solving with a macro was handy to find the mem leak because I did not need to edit each and every ipa_msg_alloc() invocation. I agree that ABI wise we should keep the old one. So I could deprecate the ipa_msg_alloc() and we would later edit all invocations ... but I guess it's not worth our time; we can do this same temporary hack next time we need to investigate an IPA mem leak. I think I'll drop this patch, agreed? -- To view, visit https://gerrit.osmocom.org/4076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic67ca94b27a4f36ba1bf655b4cd1c7e78fd06ab8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 12:31:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 12:31:02 +0000 Subject: osmo-sgsn[master]: deb: fix copyright file issues In-Reply-To: References: Message-ID: Patch Set 2: (3 comments) https://gerrit.osmocom.org/#/c/4137/2//COMMIT_MSG Commit Message: Line 11: * fix various .py license to match OpenBSC description what OpenBSC description are you referring to? https://gerrit.osmocom.org/#/c/4137/2/debian/copyright File debian/copyright: Line 205: License: GPL-3.0+ I notice this says "GPL-3.0+" but it was changed above to "GPL-3+" ... is this related to what I saw in the build error mails complaining about the version? E: osmo-sgsn source: license-problem-undefined-license gpl-3.0+ with unknown exception *** check multiple exceptions *** (paragraph at line 421) Line 339: License: GNU-All-Permissive-License ah! :) it had the whole error string in here :) -- To view, visit https://gerrit.osmocom.org/4137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6881c0a16017d80d142a6cfa756a9c153bee94d3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 4 12:31:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 12:31:10 +0000 Subject: osmo-sgsn[master]: deb: fix copyright file issues In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6881c0a16017d80d142a6cfa756a9c153bee94d3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 12:33:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 4 Oct 2017 12:33:11 +0000 Subject: osmo-sgsn[master]: deb: fix copyright file issues In-Reply-To: References: Message-ID: Patch Set 2: > OpenBSC description are you referring to? Same file in OpenBSC: the files were copied from there so it make sense to copy license description as well. -- To view, visit https://gerrit.osmocom.org/4137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6881c0a16017d80d142a6cfa756a9c153bee94d3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 12:34:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 4 Oct 2017 12:34:34 +0000 Subject: osmo-sgsn[master]: deb: fix copyright file issues In-Reply-To: References: Message-ID: Patch Set 2: > is this related to what I saw in the build error mails complaining about the version? Yepp. Same story here: the file is copied from autoconf-archive so I've just copied corresponding license entry from debian/copyright in there too. -- To view, visit https://gerrit.osmocom.org/4137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6881c0a16017d80d142a6cfa756a9c153bee94d3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 13:02:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 13:02:08 +0000 Subject: osmo-sgsn[master]: deb: fix copyright file issues In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6881c0a16017d80d142a6cfa756a9c153bee94d3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 13:02:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 13:02:26 +0000 Subject: osmo-ci[master]: Fix OsmoSGSN nightly build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icedc259ddc3a3b83ce8fe87f5572596ef29d6814 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 13:02:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 13:02:38 +0000 Subject: [MERGED] osmo-ci[master]: Fix OsmoSGSN nightly build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix OsmoSGSN nightly build ...................................................................... Fix OsmoSGSN nightly build It depends on libgtp provided by OsmoGGSN so let's build it in that order. Change-Id: Icedc259ddc3a3b83ce8fe87f5572596ef29d6814 Related: OS#2527 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 032bd49..432e7a1 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -51,8 +51,8 @@ build libosmo-abis build libosmo-netif build libsmpp34 -build osmo-sgsn build osmo-ggsn +build osmo-sgsn build openbsc build osmo-pcap build osmo-stp -- To view, visit https://gerrit.osmocom.org/4138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icedc259ddc3a3b83ce8fe87f5572596ef29d6814 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 4 13:02:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 13:02:44 +0000 Subject: [MERGED] osmo-sgsn[master]: deb: fix copyright file issues In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: deb: fix copyright file issues ...................................................................... deb: fix copyright file issues * remove non-existent files * fix ax_check_compile_flag.m4 license to match autoconf-archive * fix various .py license to match OpenBSC description Change-Id: I6881c0a16017d80d142a6cfa756a9c153bee94d3 Related: OS#2527 --- M debian/copyright 1 file changed, 8 insertions(+), 93 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/copyright b/debian/copyright index ad911c0..97b890e 100644 --- a/debian/copyright +++ b/debian/copyright @@ -11,72 +11,25 @@ README.vty-tests configure.ac contrib/Makefile.am - contrib/a-link/sccp-split-by-con.lua - contrib/bsc-test/README - contrib/bsc-test/all_dial - contrib/bsc-test/dial.sh - contrib/bsc-test/drop-oml.sh - contrib/bsc-test/drop.sh - contrib/bsc-test/hangup - contrib/bsc-test/msc.sh - contrib/bsc_control.py - contrib/bt.py - contrib/convert_to_enum.py - contrib/ctrl2sse.py contrib/gprs/gb-proxy-unblock-bug.py contrib/gprs/gprs-bssgp-histogram.lua contrib/gprs/gprs-buffer-count.lua contrib/gprs/gprs-split-trace-by-tlli.lua contrib/gprs/gprs-verify-nu.lua - contrib/hlr-remove-old.sql - contrib/hlrsync/hlrsync.py contrib/ipa.py contrib/jenkins.sh - contrib/mgcp_server.py - contrib/nat/test_regexp.c - contrib/nat/ussd_example.py - contrib/rtp/gen_rtp_header.erl - contrib/rtp/rtp_replay.st - contrib/rtp/rtp_replay_shared.st - contrib/rtp/rtp_replay_sip.st - contrib/rtp/timestamp_rtp.lua - contrib/sms/fill-hlr.st - contrib/sms/hlr-query.st - contrib/sms/sqlite-probe.tap.d contrib/soap.py - contrib/systemd/osmo-bsc-mgcp.service - contrib/systemd/osmo-bsc.service contrib/systemd/osmo-gbproxy.service - contrib/systemd/osmo-msc.service - contrib/systemd/osmo-nitb.service contrib/systemd/osmo-sgsn.service - contrib/testconv/Makefile - contrib/testconv/testconv_main.c contrib/twisted_ipa.py - doc/BS11-OML.txt doc/Makefile.am - doc/call-routing.txt - doc/channel_release.txt - doc/e1-data-model.txt doc/examples/Makefile.am - doc/examples/osmo-bsc/osmo-bsc.cfg - doc/examples/osmo-bsc_mgcp/mgcp.cfg - doc/examples/osmo-bsc_nat/black-list.cfg - doc/examples/osmo-bsc_nat/bscs.cfg - doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg doc/examples/osmo-gbproxy/osmo-gbproxy.cfg doc/examples/osmo-gtphub/gtphub-example.txt doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg doc/examples/osmo-gtphub/osmo-gtphub.cfg - doc/examples/osmo-msc/osmo-msc.cfg doc/examples/osmo-sgsn/osmo-sgsn.cfg - doc/gsm-hopping.txt - doc/handover.txt - doc/ipa-sccp.txt - doc/oml-interface.txt - doc/osmo-nitb-data_structures.dot - doc/paging.txt include/Makefile.am include/osmocom/sgsn/Makefile.am include/osmocom/sgsn/common.h @@ -108,9 +61,6 @@ tests/gprs/gprs_test.ok tests/gtphub/Makefile.am tests/gtphub/gtphub_test.ok - tests/libiudummy/Makefile.am - tests/libiudummy/README - tests/libiudummy/iudummy.c tests/oap/Makefile.am tests/oap/oap_client_test.err tests/oap/oap_client_test.ok @@ -125,7 +75,6 @@ tests/v42bis/v42bis_test.ok tests/xid/Makefile.am tests/xid/xid_test.ok - tools/hlrstat.pl Copyright: __NO_COPYRIGHT_NOR_LICENSE__ License: __NO_COPYRIGHT_NOR_LICENSE__ @@ -214,7 +163,6 @@ Files: src/gprs/gtphub_ares.c src/gprs/gtphub_sock.c - tests/ctrl_test_runner.py tests/gbproxy/gbproxy_test.c Copyright: 2013 Jacob Erlbeck 2013 sysmocom s.f.m.c. GmbH @@ -244,26 +192,13 @@ On Debian systems, the complete text of the GNU Lesser General Public License Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. -Files: osmoappdesc.py -Copyright: 2013 Katerina Barone-Adesi -License: GPL-3.0+ - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see - . - Most systems won't be able to use these, so they're separated out - . - On Debian systems, the complete text of the GNU General Public License - Version 3 can be found in `/usr/share/common-licenses/GPL-3'. +Files: osmoappdesc.py + tests/ctrl_test_runner.py + tests/vty_test_runner.py +Copyright: 2013 Katerina Barone-Adesi + 2013 Jacob Erlbeck + 2013-2014 Holger Hans Peter Freyther +License: GPL-3+ Files: git-version-gen Copyright: 2007-2010 Free Software Foundation, Inc. @@ -315,26 +250,6 @@ automatically be up-to-date each time configure is run (and note that since configure.ac no longer includes a version string, Makefile rules should not depend on configure.ac for version updates). - . - On Debian systems, the complete text of the GNU General Public License - Version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -Files: tests/vty_test_runner.py -Copyright: 2013 Holger Hans Peter Freyther - 2013 Katerina Barone-Adesi -License: GPL-3.0+ - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . . On Debian systems, the complete text of the GNU General Public License Version 3 can be found in `/usr/share/common-licenses/GPL-3'. @@ -421,7 +336,7 @@ Files: m4/ax_check_compile_flag.m4 Copyright: 2008 Guido U. Draheim 2011 Maarten Bosmans -License: GPL-3.0+ with unknown exception *** check multiple exceptions *** +License: GNU-All-Permissive-License This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your -- To view, visit https://gerrit.osmocom.org/4137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6881c0a16017d80d142a6cfa756a9c153bee94d3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 4 13:11:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Oct 2017 13:11:30 +0000 Subject: libosmocore[master]: IPA msgb: on ipa_msg_alloc(), set caller as talloc string In-Reply-To: References: Message-ID: Patch Set 1: > I think I'll drop this patch, agreed? agreed. you can also always add breakpoints to get the backtrace / calling function like the following 4 gdb lines: break ipa_msg_alloc commands bt 2 continue end It will print you a "depth-2" backtrace every time the function is called, revealing the caller. -- To view, visit https://gerrit.osmocom.org/4076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic67ca94b27a4f36ba1bf655b4cd1c7e78fd06ab8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 14:35:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 4 Oct 2017 14:35:24 +0000 Subject: [PATCH] libosmocore[master]: Fixup severe build performance issues In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4127 to look at the new patch set (#2). Fixup severe build performance issues Make variable substitution calling bumpversion and other commands introduce by osmo-release.mk has severely slowed down builds. Inside the makefile we could use $(eval FOO:=$(shell...)) constructs to have variable substitution only happen once the 'release' target is executed. However, 'ifeq' and friends don't work with such late constructs. Let's shift all release action into a helper shell script that is called from the Makefile instead. This way we get the best of both worlds: No performance impact during normal builds, and the convenience of 'make release'. Modified-by: Max Related: OS#2524 Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea --- M Makefile.am M debian/libosmocore-dev.install M osmo-release.mk A osmo-release.sh 4 files changed, 55 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/4127/2 diff --git a/Makefile.am b/Makefile.am index 8b35856..5f23673 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,6 +12,8 @@ relengdir = $(includedir) releng_DATA = osmo-release.mk +dist_bin_SCRIPTS = osmo-release.sh + osmo-release.mk: git-version-gen BUILT_SOURCES = $(top_srcdir)/.version @@ -20,7 +22,7 @@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md osmo-release.mk +EXTRA_DIST = git-version-gen .version README.md osmo-release.mk osmo-release.sh if HAVE_DOXYGEN diff --git a/debian/libosmocore-dev.install b/debian/libosmocore-dev.install index 465f933..944a7bf 100644 --- a/debian/libosmocore-dev.install +++ b/debian/libosmocore-dev.install @@ -3,3 +3,4 @@ usr/lib/*/lib*.so usr/lib/*/lib*.la usr/lib/*/pkgconfig/* +usr/bin/osmo-release.sh diff --git a/osmo-release.mk b/osmo-release.mk index 40eb121..01285b1 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -2,43 +2,8 @@ REL := patch endif -BUMPVER := $(shell bumpversion) -NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') -LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) -MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am) -ISODATE := $(shell date -I) - release: - -ifeq ($(BUMPVER),) - @$(error Unable to find 'bumpversion' command.) -endif - -ifeq ($(NEW_VER),) - @$(error Please fix versioning to match http://semver.org/ spec (current is $(VERSION)) before proceeding.) -endif - ifeq ($(origin REL), file) @echo "No REL value specified, defaulting to 'patch' release" endif - - @echo "Releasing" $(VERSION) "->" $(NEW_VER)"..." - -ifeq ($(LIBVERS),) - @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch -else - @echo "You should NOT be doing this unless you've read and understood following article:" - @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" - @grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries - @grep '#' TODO-RELEASE > TODO-RELEASE.clean - @mv TODO-RELEASE.clean TODO-RELEASE -ifeq ($(MAKEMOD),) - @$(if $(shell git status -s -uno TODO-RELEASE),,$(error Before releasing, please modify some of the libversions: $(LIBVERS))) -endif - @xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $(NEW_VER) "entry" -endif - @dch -r -m --distribution "unstable" "" - @git add -u - @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VER) --allow-dirty - @git tag -s $(NEW_VER) -f -m "Release v$(NEW_VER) on $(ISODATE)." - @echo "Release" $(NEW_VER) "prepared, tagged and signed." + @osmo-release.sh $(VERSION) $(REL) diff --git a/osmo-release.sh b/osmo-release.sh new file mode 100755 index 0000000..ff82e4c --- /dev/null +++ b/osmo-release.sh @@ -0,0 +1,50 @@ +#!/bin/sh +VERSION=$1 +REL=$2 + +if [ "z$REL" = "z" ]; then + echo "No REL value specified, defaulting to 'patch' release" + REL=patch +fi + +BUMPVER=`command -v bumpversion` + +NEW_VER=`bumpversion --list --current-version $VERSION $REL --allow-dirty | awk -F '=' '{ print $2 }'` +LIBVERS=`git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS` +MAKEMOD=`git diff -GLIBVERSION --stat | grep Makefile.am` +ISODATE=`date -I` + +if [ "z$BUMPVER" = "z" ]; then + echo Unable to find 'bumpversion' command. + exit 1 +fi + +if [ "z$NEW_VER" = "z" ]; then + echo "Please fix versioning to match http://semver.org/ spec (current is $VERSION) before proceeding." + exit 1 +fi + +echo "Releasing $VERSION -> $NEW_VER..." + +if [ "z$LIBVERS" = "z" ]; then + gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch +else + echo "You should NOT be doing this unless you've read and understood following article:" + echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries + grep '#' TODO-RELEASE > TODO-RELEASE.clean + mv TODO-RELEASE.clean TODO-RELEASE + if [ "z$MAKEMOD" = "z" ]; then + git status -s -uno TODO-RELEASE + if [ $? -ne 0 ]; then + echo "Before releasing, please modify some of the libversions: $LIBVERS" + exit 1 + fi + fi + xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $NEW_VER "entry" +fi +dch -r -m --distribution "unstable" "" +git add -u +bumpversion --current-version $VERSION $REL --tag --commit --tag-name $NEW_VER --allow-dirty +git tag -s $NEW_VER -f -m "Release v$NEW_VER on $ISODATE." +echo "Release $NEW_VER prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/4127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 4 14:36:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 4 Oct 2017 14:36:18 +0000 Subject: libosmocore[master]: Fixup severe build performance issues In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 I think it's better to install helper script too - that way it's available regardless of directory structure we run in. -- To view, visit https://gerrit.osmocom.org/4127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 14:45:47 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 4 Oct 2017 14:45:47 +0000 Subject: [PATCH] osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4003 to look at the new patch set (#8). Initially implement the new osmo-mgw and libosmo-mgcp Leave the old osmo-bsc_mgcp and libosmo-legacy-mgcp as it is; on a copy thereof (added by a previous commit), apply changes to initially implement the new osmo-mgw. Adjust build system and debian packaging to accomodate the new libosmo-mgcp and osmo-mgw. The main differences: *) use a list to manage rtp connections. Aggregate all rtp related information inside a single struct. Use a linked list to manage the both connections (net and bts). The idea behind using a list is that we might support conference calls at some later point. Store the linked list in struct mgcp_endpoint, have a private linked list for each endpoint. The list contains connection items which are implemented in struct mgcp_conn. A connection is allocated and freed using the functions in mgcp_conn.c. A connection is allocated on the reception of a CRCX command and freed with the reception of a DLCX command. *) remove external transcoder feature Fortunatelly the external transcoder feature is not needed anymore. This patch removes the related code. *) vty: get rid of CONN_BTS and CONN_NET Since the new connection model does not make a difference between BTS and NET connections the VTY should not use the fixed CONN_BTS and CONN_NET constants. - Handle the conns list inside the endpoint directly - introduce function to dump basic rtp connection info - introduce human readable names for connections Parts of the code adjusted to use generalized connections instead of explicit BTS/NET ones: - teach mgcp_send_dummy() to send dummy packets to any RTP connection - network: generalize mgcp_bind_net/bts_rtp_port() - network: generalize mgcp_send() - tap: generalize call tapping feature - stat: generalize statistics - Replace rtp_data_net() and rtp_data_bts() with generalized rtp_data_rx() *) mgcp_protocol.c fixes: - check ci string before it is converted: In case of missing ci, a nullpointer is delivered to strtoul(). Add a function that takes ci, checks it and converts it to an uint32_t. Use the return code to react on missing ci. - output error message on missing CI. - when parsing the mode, print log message when mode is missing. - use mode_orig when mode is missing. - fix ptime formatstring to use %u rather than %d. - cosmetic: log when connection is deleted on DLCX. - change loglevels of CRCX, MDCX, DLCX events from DEBUG to NOTICE. *) mgcp_test - apply rename of strline_r() to mgcp_strline(). - MGCP command macros: - Add 'I: 1' parameters. - Use proper port numbers: from m=audio 0 RTP/AVP 126 to m=audio 16002 RTP/AVP 128 - Change ptime to 'a=ptime:40' because this is what the MGW currently returns. CRCX generally feed a ptime:40 and this is expected to be returned. - struct mgcp_test: Use only one ptype, there are no explicit BTS and NET endpoints anymore. Hence remove one column from tests[]. - test_messages(): - Enable: remove '#if 0' - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. - remove endpoint init, now done internally. - add false asserts in error cases. - test_retransmission(): - remove endpoint init, now done internally. - add false asserts in error cases. - test_packet_error_detection(): - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - remove endpoint init, now done internally. - add false assert in error case. - Assert that a conn really vanishes on DLCX, previously the conn would remain and just be unused, now it is actually discarded. - test_no_cycle() - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - test_no_name() - Enable: remove '#if 0'. - remove endpoint init, now done internally. - add false assert in error case. - mgcp_test.ok: adjust expected results to status quo: - We now see two dummy packets instead of one, now sent to both sides because we don't know of BTS or NET side. (maybe drop dummy packets later...) - packet duration, conn mode: now sane defaults show instead of unset. - various whitespace and formatting changes from lindent. Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 --- M Makefile.am M configure.ac M debian/control A debian/libosmo-mgcp-dev.install A debian/libosmo-mgcp0.install M doc/examples/osmo-mgw/osmo-mgw.cfg M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_conn.h A include/osmocom/mgcp/mgcp_ep.h M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_msg.h A include/osmocom/mgcp/mgcp_stat.h D include/osmocom/mgcp/mgcp_transcode.h M include/osmocom/mgcp/osmux.h A libosmo-mgcp.pc.in M osmoappdesc.py M src/Makefile.am M src/libosmo-mgcp/Makefile.am M src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_conn.c A src/libosmo-mgcp/mgcp_ep.c A src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_stat.c D src/libosmo-mgcp/mgcp_transcode.c M src/libosmo-mgcp/mgcp_vty.c M src/osmo-mgw/Makefile.am R src/osmo-mgw/mgw_main.c M tests/Makefile.am M tests/legacy_mgcp/mgcp_test.c M tests/mgcp/Makefile.am M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok M tests/testsuite.at 42 files changed, 3,402 insertions(+), 4,597 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/03/4003/8 -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 8 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 4 14:57:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 14:57:50 +0000 Subject: [ABANDON] libosmocore[master]: IPA msgb: on ipa_msg_alloc(), set caller as talloc string In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: IPA msgb: on ipa_msg_alloc(), set caller as talloc string ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ic67ca94b27a4f36ba1bf655b4cd1c7e78fd06ab8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 4 14:57:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 4 Oct 2017 14:57:47 +0000 Subject: libosmocore[master]: IPA msgb: on ipa_msg_alloc(), set caller as talloc string In-Reply-To: References: Message-ID: Patch Set 1: nice, I used 'break' but didn't know about 'commands' -- To view, visit https://gerrit.osmocom.org/4076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic67ca94b27a4f36ba1bf655b4cd1c7e78fd06ab8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 4 17:09:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 4 Oct 2017 17:09:34 +0000 Subject: meta-telephony[201705]: Update osmocom versions to point to current master In-Reply-To: References: Message-ID: Patch Set 2: So this include compatibility-breaking vty-changes in libosmocore? We should be extra-careful when propagating this beyond 201705. -- To view, visit https://gerrit.osmocom.org/4087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 00:16:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 00:16:53 +0000 Subject: [MERGED] osmo-bsc[master]: Remove any references to RANAP and Iu In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove any references to RANAP and Iu ...................................................................... Remove any references to RANAP and Iu This is a BSC, it has norelation to RANAP or Iu(h). Let's remove an references to it, and also the build dependency to libosmo-ranap-dev Change-Id: I517b9f69309b2ed0540dd6c186b3d4a2a03aed44 --- M debian/control M include/osmocom/bsc/gsm_data.h D include/osmocom/bsc/iu_dummy.h 3 files changed, 0 insertions(+), 66 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index f931341..7b25ecc 100644 --- a/debian/control +++ b/debian/control @@ -18,7 +18,6 @@ libgtp-dev, libosmocore-dev, libosmo-sccp-dev, - libosmo-ranap-dev, libosmo-abis-dev, libosmo-netif-dev, libosmo-legacy-mgcp-dev diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 4e56db5..6814662 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -29,7 +29,6 @@ struct bsc_subscr; struct vlr_instance; struct vlr_subscr; -struct ranap_ue_conn_ctx; struct gprs_ra_id; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -200,12 +199,6 @@ uint16_t port_subscr; uint16_t port_cn; } rtp; - - /* which Iu-CS connection, if any. */ - struct { - struct ranap_ue_conn_ctx *ue_ctx; - uint8_t rab_id; - } iu; struct { /* A pointer to the SCCP user that handles @@ -484,13 +477,6 @@ /* Periodic location update default value */ uint8_t t3212; - - struct { - /* CS7 instance id number (set via VTY) */ - uint32_t cs7_instance; - int rab_assign_addr_enc; - struct osmo_sccp_instance *sccp; - } iu; struct { /* CS7 instance id number (set via VTY) */ diff --git a/include/osmocom/bsc/iu_dummy.h b/include/osmocom/bsc/iu_dummy.h deleted file mode 100644 index d5e1428..0000000 --- a/include/osmocom/bsc/iu_dummy.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Trivial switch-off of external Iu dependencies, - * allowing to run full unit tests even when built without Iu support. */ - -/* - * (C) 2016,2017 by sysmocom s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include - -struct msgb; -struct gsm_auth_tuple; -struct RANAP_Cause; -struct osmo_auth_vector; - -struct ranap_ue_conn_ctx { - struct llist_head list; - uint32_t conn_id; -}; - -int ranap_iu_tx(struct msgb *msg, uint8_t sapi); -int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, - int send_ck); -int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); -struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap); -int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); -int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); -int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); -- To view, visit https://gerrit.osmocom.org/4134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I517b9f69309b2ed0540dd6c186b3d4a2a03aed44 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 5 00:17:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 00:17:32 +0000 Subject: meta-telephony[201705]: Update osmocom versions to point to current master In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 00:19:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 00:19:38 +0000 Subject: libosmocore[master]: Fixup severe build performance issues In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 Max, did you test the result works as expected when issuing "make release"? If yes, we can get this merged. -- To view, visit https://gerrit.osmocom.org/4127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 01:25:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 01:25:43 +0000 Subject: [PATCH] libosmo-netif[master]: rs232.c: Don't #include Message-ID: Review at https://gerrit.osmocom.org/4139 rs232.c: Don't #include There's no need for the rs232 code to include a files from libosmoabis. The only users of libosmoabis left now are the LAPD examples: examples/lapd-over-datagram-network.c examples/lapd-over-datagram-user.c Change-Id: Ie1bc0dd811362cec546486edc41d632740ed19cd --- M src/rs232.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/39/4139/1 diff --git a/src/rs232.c b/src/rs232.c index 49520d8..df73452 100644 --- a/src/rs232.c +++ b/src/rs232.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include struct osmo_rs232 { struct osmo_fd ofd; -- To view, visit https://gerrit.osmocom.org/4139 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1bc0dd811362cec546486edc41d632740ed19cd Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Oct 5 01:27:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 01:27:43 +0000 Subject: [PATCH] openpcd[master]: firmware: Makefiles: enable changing toolchain Message-ID: Review at https://gerrit.osmocom.org/4140 firmware: Makefiles: enable changing toolchain Without that the user was expected to either patch the Makefiles or to get a toolchain with the arm-elf- prefix. Change-Id: I0c362cde7afd6de025e8fe2c1e9abe3d3a1e04a6 Signed-off-by: Denis 'GNUtoo' Carikli --- M firmware/Makefile M firmware/Makefile.dfu 2 files changed, 14 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openpcd refs/changes/40/4140/1 diff --git a/firmware/Makefile b/firmware/Makefile index 350b0dc..1581a1f 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -352,12 +352,13 @@ # Define programs and commands. SHELL = sh -CC = arm-elf-gcc -CPP = arm-elf-g++ -OBJCOPY = arm-elf-objcopy -OBJDUMP = arm-elf-objdump -SIZE = arm-elf-size -NM = arm-elf-nm +CROSS_COMPILE ?= arm-elf- +CC = $(CROSS_COMPILE)gcc +CPP = $(CROSS_COMPILE)g++ +OBJCOPY = $(CROSS_COMPILE)objcopy +OBJDUMP = $(CROSS_COMPILE)objdump +SIZE = $(CROSS_COMPILE)size +NM = $(CROSS_COMPILE)nm REMOVE = rm -f COPY = cp diff --git a/firmware/Makefile.dfu b/firmware/Makefile.dfu index 3c797ef..1e9e71c 100644 --- a/firmware/Makefile.dfu +++ b/firmware/Makefile.dfu @@ -303,12 +303,13 @@ # Define programs and commands. SHELL = sh -CC = arm-elf-gcc -CPP = arm-elf-g++ -OBJCOPY = arm-elf-objcopy -OBJDUMP = arm-elf-objdump -SIZE = arm-elf-size -NM = arm-elf-nm +CROSS_COMPILE ?= arm-elf- +CC = $(CROSS_COMPILE)gcc +CPP = $(CROSS_COMPILE)g++ +OBJCOPY = $(CROSS_COMPILE)objcopy +OBJDUMP = $(CROSS_COMPILE)objdump +SIZE = $(CROSS_COMPILE)size +NM = $(CROSS_COMPILE)nm REMOVE = rm -f COPY = cp -- To view, visit https://gerrit.osmocom.org/4140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c362cde7afd6de025e8fe2c1e9abe3d3a1e04a6 Gerrit-PatchSet: 1 Gerrit-Project: openpcd Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Oct 5 01:29:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 01:29:11 +0000 Subject: libosmo-netif[master]: rs232.c: Don't #include In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4139 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie1bc0dd811362cec546486edc41d632740ed19cd Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 01:29:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 01:29:13 +0000 Subject: [MERGED] libosmo-netif[master]: rs232.c: Don't #include In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rs232.c: Don't #include ...................................................................... rs232.c: Don't #include There's no need for the rs232 code to include a files from libosmoabis. The only users of libosmoabis left now are the LAPD examples: examples/lapd-over-datagram-network.c examples/lapd-over-datagram-user.c Change-Id: Ie1bc0dd811362cec546486edc41d632740ed19cd --- M src/rs232.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/rs232.c b/src/rs232.c index 49520d8..df73452 100644 --- a/src/rs232.c +++ b/src/rs232.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include struct osmo_rs232 { struct osmo_fd ofd; -- To view, visit https://gerrit.osmocom.org/4139 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1bc0dd811362cec546486edc41d632740ed19cd Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 5 01:30:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 01:30:08 +0000 Subject: [ABANDON] libosmocore[master]: Remove bogus error message In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: Remove bogus error message ...................................................................... Abandoned we are moving this code to a shell script right now -- To view, visit https://gerrit.osmocom.org/3973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Oct 5 01:34:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 01:34:05 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 8 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 01:40:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 01:40:43 +0000 Subject: [MERGED] osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Initially implement the new osmo-mgw and libosmo-mgcp ...................................................................... Initially implement the new osmo-mgw and libosmo-mgcp Leave the old osmo-bsc_mgcp and libosmo-legacy-mgcp as it is; on a copy thereof (added by a previous commit), apply changes to initially implement the new osmo-mgw. Adjust build system and debian packaging to accomodate the new libosmo-mgcp and osmo-mgw. The main differences: *) use a list to manage rtp connections. Aggregate all rtp related information inside a single struct. Use a linked list to manage the both connections (net and bts). The idea behind using a list is that we might support conference calls at some later point. Store the linked list in struct mgcp_endpoint, have a private linked list for each endpoint. The list contains connection items which are implemented in struct mgcp_conn. A connection is allocated and freed using the functions in mgcp_conn.c. A connection is allocated on the reception of a CRCX command and freed with the reception of a DLCX command. *) remove external transcoder feature Fortunatelly the external transcoder feature is not needed anymore. This patch removes the related code. *) vty: get rid of CONN_BTS and CONN_NET Since the new connection model does not make a difference between BTS and NET connections the VTY should not use the fixed CONN_BTS and CONN_NET constants. - Handle the conns list inside the endpoint directly - introduce function to dump basic rtp connection info - introduce human readable names for connections Parts of the code adjusted to use generalized connections instead of explicit BTS/NET ones: - teach mgcp_send_dummy() to send dummy packets to any RTP connection - network: generalize mgcp_bind_net/bts_rtp_port() - network: generalize mgcp_send() - tap: generalize call tapping feature - stat: generalize statistics - Replace rtp_data_net() and rtp_data_bts() with generalized rtp_data_rx() *) mgcp_protocol.c fixes: - check ci string before it is converted: In case of missing ci, a nullpointer is delivered to strtoul(). Add a function that takes ci, checks it and converts it to an uint32_t. Use the return code to react on missing ci. - output error message on missing CI. - when parsing the mode, print log message when mode is missing. - use mode_orig when mode is missing. - fix ptime formatstring to use %u rather than %d. - cosmetic: log when connection is deleted on DLCX. - change loglevels of CRCX, MDCX, DLCX events from DEBUG to NOTICE. *) mgcp_test - apply rename of strline_r() to mgcp_strline(). - MGCP command macros: - Add 'I: 1' parameters. - Use proper port numbers: from m=audio 0 RTP/AVP 126 to m=audio 16002 RTP/AVP 128 - Change ptime to 'a=ptime:40' because this is what the MGW currently returns. CRCX generally feed a ptime:40 and this is expected to be returned. - struct mgcp_test: Use only one ptype, there are no explicit BTS and NET endpoints anymore. Hence remove one column from tests[]. - test_messages(): - Enable: remove '#if 0' - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. - remove endpoint init, now done internally. - add false asserts in error cases. - test_retransmission(): - remove endpoint init, now done internally. - add false asserts in error cases. - test_packet_error_detection(): - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - remove endpoint init, now done internally. - add false assert in error case. - Assert that a conn really vanishes on DLCX, previously the conn would remain and just be unused, now it is actually discarded. - test_no_cycle() - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - test_no_name() - Enable: remove '#if 0'. - remove endpoint init, now done internally. - add false assert in error case. - mgcp_test.ok: adjust expected results to status quo: - We now see two dummy packets instead of one, now sent to both sides because we don't know of BTS or NET side. (maybe drop dummy packets later...) - packet duration, conn mode: now sane defaults show instead of unset. - various whitespace and formatting changes from lindent. Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 --- M Makefile.am M configure.ac M debian/control A debian/libosmo-mgcp-dev.install A debian/libosmo-mgcp0.install M doc/examples/osmo-mgw/osmo-mgw.cfg M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_conn.h A include/osmocom/mgcp/mgcp_ep.h M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_msg.h A include/osmocom/mgcp/mgcp_stat.h D include/osmocom/mgcp/mgcp_transcode.h M include/osmocom/mgcp/osmux.h A libosmo-mgcp.pc.in M osmoappdesc.py M src/Makefile.am M src/libosmo-mgcp/Makefile.am M src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_conn.c A src/libosmo-mgcp/mgcp_ep.c A src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_stat.c D src/libosmo-mgcp/mgcp_transcode.c M src/libosmo-mgcp/mgcp_vty.c M src/osmo-mgw/Makefile.am R src/osmo-mgw/mgw_main.c M tests/Makefile.am M tests/legacy_mgcp/mgcp_test.c M tests/mgcp/Makefile.am M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok M tests/testsuite.at 42 files changed, 3,402 insertions(+), 4,597 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 9 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 5 01:40:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 01:40:43 +0000 Subject: [MERGED] osmo-mgw[master]: create libosmo-mgcp and osmo-mgw by copying legacy code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: create libosmo-mgcp and osmo-mgw by copying legacy code ...................................................................... create libosmo-mgcp and osmo-mgw by copying legacy code This a cosmetic commit, copying libosmo-legacy-mgcp to libosmo-mgcp and osmo-bsc_mgcp to osmo-mgw 1:1 at first, to provide a basis for next patches that highlight the changes from legacy to new code. Until osmo-msc and osmo-bsc are adjusted to operate with the new code, we will keep the legacy code alongside the new code. The legacy code might be dropped later. Change-Id: Idf54481754a1765bdb2d0d7033bc0d7dc2018024 --- A doc/examples/osmo-mgw/osmo-mgw.cfg A include/osmocom/mgcp/Makefile.am A include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_transcode.h A include/osmocom/mgcp/osmux.h A include/osmocom/mgcp/vty.h A src/libosmo-mgcp/Makefile.am A src/libosmo-mgcp/g711common.h A src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_network.c A src/libosmo-mgcp/mgcp_osmux.c A src/libosmo-mgcp/mgcp_protocol.c A src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_transcode.c A src/libosmo-mgcp/mgcp_vty.c A src/osmo-mgw/Makefile.am A src/osmo-mgw/mgcp_main.c A tests/mgcp/Makefile.am A tests/mgcp/mgcp_test.c A tests/mgcp/mgcp_test.ok A tests/mgcp/mgcp_transcoding_test.c A tests/mgcp/mgcp_transcoding_test.ok 23 files changed, 10,325 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/4002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idf54481754a1765bdb2d0d7033bc0d7dc2018024 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 5 01:43:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 01:43:15 +0000 Subject: osmo-mgw[master]: drop code dup between libosmo-mgcp-client and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 08:27:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 5 Oct 2017 08:27:12 +0000 Subject: libosmocore[master]: Fixup severe build performance issues In-Reply-To: References: Message-ID: Patch Set 2: Of course I did: I've built libosmocore's .deb with the patch included, installed it, used "make release" in osmo-bts and libosmo-abis, verified that the commit/tag are generated properly. -- To view, visit https://gerrit.osmocom.org/4127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 08:45:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 08:45:43 +0000 Subject: libosmocore[master]: Fixup severe build performance issues In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 > Of course I did great. I just wanted to make sure as I didn't give it a lot of testing before. -- To view, visit https://gerrit.osmocom.org/4127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 08:46:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 08:46:09 +0000 Subject: [MERGED] libosmocore[master]: Fixup severe build performance issues In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fixup severe build performance issues ...................................................................... Fixup severe build performance issues Make variable substitution calling bumpversion and other commands introduce by osmo-release.mk has severely slowed down builds. Inside the makefile we could use $(eval FOO:=$(shell...)) constructs to have variable substitution only happen once the 'release' target is executed. However, 'ifeq' and friends don't work with such late constructs. Let's shift all release action into a helper shell script that is called from the Makefile instead. This way we get the best of both worlds: No performance impact during normal builds, and the convenience of 'make release'. Modified-by: Max Related: OS#2524 Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea --- M Makefile.am M debian/libosmocore-dev.install M osmo-release.mk A osmo-release.sh 4 files changed, 55 insertions(+), 37 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 8b35856..5f23673 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,6 +12,8 @@ relengdir = $(includedir) releng_DATA = osmo-release.mk +dist_bin_SCRIPTS = osmo-release.sh + osmo-release.mk: git-version-gen BUILT_SOURCES = $(top_srcdir)/.version @@ -20,7 +22,7 @@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md osmo-release.mk +EXTRA_DIST = git-version-gen .version README.md osmo-release.mk osmo-release.sh if HAVE_DOXYGEN diff --git a/debian/libosmocore-dev.install b/debian/libosmocore-dev.install index 465f933..944a7bf 100644 --- a/debian/libosmocore-dev.install +++ b/debian/libosmocore-dev.install @@ -3,3 +3,4 @@ usr/lib/*/lib*.so usr/lib/*/lib*.la usr/lib/*/pkgconfig/* +usr/bin/osmo-release.sh diff --git a/osmo-release.mk b/osmo-release.mk index 40eb121..01285b1 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -2,43 +2,8 @@ REL := patch endif -BUMPVER := $(shell bumpversion) -NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') -LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) -MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am) -ISODATE := $(shell date -I) - release: - -ifeq ($(BUMPVER),) - @$(error Unable to find 'bumpversion' command.) -endif - -ifeq ($(NEW_VER),) - @$(error Please fix versioning to match http://semver.org/ spec (current is $(VERSION)) before proceeding.) -endif - ifeq ($(origin REL), file) @echo "No REL value specified, defaulting to 'patch' release" endif - - @echo "Releasing" $(VERSION) "->" $(NEW_VER)"..." - -ifeq ($(LIBVERS),) - @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch -else - @echo "You should NOT be doing this unless you've read and understood following article:" - @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" - @grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries - @grep '#' TODO-RELEASE > TODO-RELEASE.clean - @mv TODO-RELEASE.clean TODO-RELEASE -ifeq ($(MAKEMOD),) - @$(if $(shell git status -s -uno TODO-RELEASE),,$(error Before releasing, please modify some of the libversions: $(LIBVERS))) -endif - @xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $(NEW_VER) "entry" -endif - @dch -r -m --distribution "unstable" "" - @git add -u - @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VER) --allow-dirty - @git tag -s $(NEW_VER) -f -m "Release v$(NEW_VER) on $(ISODATE)." - @echo "Release" $(NEW_VER) "prepared, tagged and signed." + @osmo-release.sh $(VERSION) $(REL) diff --git a/osmo-release.sh b/osmo-release.sh new file mode 100755 index 0000000..ff82e4c --- /dev/null +++ b/osmo-release.sh @@ -0,0 +1,50 @@ +#!/bin/sh +VERSION=$1 +REL=$2 + +if [ "z$REL" = "z" ]; then + echo "No REL value specified, defaulting to 'patch' release" + REL=patch +fi + +BUMPVER=`command -v bumpversion` + +NEW_VER=`bumpversion --list --current-version $VERSION $REL --allow-dirty | awk -F '=' '{ print $2 }'` +LIBVERS=`git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS` +MAKEMOD=`git diff -GLIBVERSION --stat | grep Makefile.am` +ISODATE=`date -I` + +if [ "z$BUMPVER" = "z" ]; then + echo Unable to find 'bumpversion' command. + exit 1 +fi + +if [ "z$NEW_VER" = "z" ]; then + echo "Please fix versioning to match http://semver.org/ spec (current is $VERSION) before proceeding." + exit 1 +fi + +echo "Releasing $VERSION -> $NEW_VER..." + +if [ "z$LIBVERS" = "z" ]; then + gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch +else + echo "You should NOT be doing this unless you've read and understood following article:" + echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries + grep '#' TODO-RELEASE > TODO-RELEASE.clean + mv TODO-RELEASE.clean TODO-RELEASE + if [ "z$MAKEMOD" = "z" ]; then + git status -s -uno TODO-RELEASE + if [ $? -ne 0 ]; then + echo "Before releasing, please modify some of the libversions: $LIBVERS" + exit 1 + fi + fi + xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $NEW_VER "entry" +fi +dch -r -m --distribution "unstable" "" +git add -u +bumpversion --current-version $VERSION $REL --tag --commit --tag-name $NEW_VER --allow-dirty +git tag -s $NEW_VER -f -m "Release v$NEW_VER on $ISODATE." +echo "Release $NEW_VER prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/4127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 5 08:54:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 08:54:52 +0000 Subject: openpcd[master]: firmware: Makefiles: enable changing toolchain In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c362cde7afd6de025e8fe2c1e9abe3d3a1e04a6 Gerrit-PatchSet: 1 Gerrit-Project: openpcd Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 08:54:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Oct 2017 08:54:54 +0000 Subject: [MERGED] openpcd[master]: firmware: Makefiles: enable changing toolchain In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: firmware: Makefiles: enable changing toolchain ...................................................................... firmware: Makefiles: enable changing toolchain Without that the user was expected to either patch the Makefiles or to get a toolchain with the arm-elf- prefix. Change-Id: I0c362cde7afd6de025e8fe2c1e9abe3d3a1e04a6 Signed-off-by: Denis 'GNUtoo' Carikli --- M firmware/Makefile M firmware/Makefile.dfu 2 files changed, 14 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/firmware/Makefile b/firmware/Makefile index 350b0dc..1581a1f 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -352,12 +352,13 @@ # Define programs and commands. SHELL = sh -CC = arm-elf-gcc -CPP = arm-elf-g++ -OBJCOPY = arm-elf-objcopy -OBJDUMP = arm-elf-objdump -SIZE = arm-elf-size -NM = arm-elf-nm +CROSS_COMPILE ?= arm-elf- +CC = $(CROSS_COMPILE)gcc +CPP = $(CROSS_COMPILE)g++ +OBJCOPY = $(CROSS_COMPILE)objcopy +OBJDUMP = $(CROSS_COMPILE)objdump +SIZE = $(CROSS_COMPILE)size +NM = $(CROSS_COMPILE)nm REMOVE = rm -f COPY = cp diff --git a/firmware/Makefile.dfu b/firmware/Makefile.dfu index 3c797ef..1e9e71c 100644 --- a/firmware/Makefile.dfu +++ b/firmware/Makefile.dfu @@ -303,12 +303,13 @@ # Define programs and commands. SHELL = sh -CC = arm-elf-gcc -CPP = arm-elf-g++ -OBJCOPY = arm-elf-objcopy -OBJDUMP = arm-elf-objdump -SIZE = arm-elf-size -NM = arm-elf-nm +CROSS_COMPILE ?= arm-elf- +CC = $(CROSS_COMPILE)gcc +CPP = $(CROSS_COMPILE)g++ +OBJCOPY = $(CROSS_COMPILE)objcopy +OBJDUMP = $(CROSS_COMPILE)objdump +SIZE = $(CROSS_COMPILE)size +NM = $(CROSS_COMPILE)nm REMOVE = rm -f COPY = cp -- To view, visit https://gerrit.osmocom.org/4140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c362cde7afd6de025e8fe2c1e9abe3d3a1e04a6 Gerrit-PatchSet: 1 Gerrit-Project: openpcd Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Oct 5 09:11:14 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 5 Oct 2017 09:11:14 +0000 Subject: osmo-pcu[master]: TS alloc: use standard function In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 > I've tried to implement this comparison and got really weird > results: > I might be missing smth but home come lsb in a byte can be more > than 8? Could it be that using negation on unsigned type somehow > confused gcc? Or some sort of template optimization magic went > wrong? This sends a red signal. First the commit message doesn't explain the motivation. How things are verified, requires Pespin to look at the ffs implementation and Harald to ask you to compare them. Such churn is very dangerous. it can create subtle changes and apparently we don't have good coverage here. So ffs returns you the bit number (1 << ffs(16)) while pcb_lsb returns a number with the lsb set. > Anyway, I think it's yet another reason to replace it with standard > function which behaves as expected. Neither pespin nor me have used ffs. So "expected" is vague here but the question is which semantic is expected by the code around? -- To view, visit https://gerrit.osmocom.org/3896 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2d14ef327b09173d56ee3bca7e3ca85897d381c7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 09:23:29 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 5 Oct 2017 09:23:29 +0000 Subject: osmo-pcu[master]: Add missing multislot classes In-Reply-To: References: Message-ID: Patch Set 1: (6 comments) Assuming these tables are correctly copy and pasted. What is the minimal dependency to get this in? Which patch removes the <= 32 assumption? tests/alloc/AllocTest.cpp requires updates to use/test the new classes as well. The commit message needs some work. You are not "adding missing" classes but you extend from one version of the specification to the other. Also indicate which devices use the classes and if you had a change to verify it.. Also how you intend to address the 35-45 TA issue. The comment that old code had it too might be misleading as the requirement didn't exist for the other classes or if they did we have more work to do on the tables. https://gerrit.osmocom.org/#/c/4072/1//COMMIT_MSG Commit Message: Line 10: Emacs macros into C struct to avoid typos. We don't do reformat and extend in one go. We rarely do. As a reviewer I still have to see if things change. :( Line 13: yet (this was the case with the old code too). Good to describe it. https://gerrit.osmocom.org/#/c/4072/1/src/gprs_rlcmac_ts_alloc.cpp File src/gprs_rlcmac_ts_alloc.cpp: Line 41: /* FIXME: use actual TA offset for computation - make sure to adjust "1 + MS_TO" accordingly */ Good to communicate it. Line 52: /* | Rx Tx Sum | Tta Ttb Tra Trb | */ this header is nice Line 54: /* 1 */ { 1, 1, 2, 3, 2, 4, 2, 1 }, To be more interesting we can even do [0] = {}, [1].. but that is not a call to action just to illustrate that there are always things to do better but the cost vs. value vs. danger might not be big enough to warrant making a change. Line 83: /* 30 */ { 5, 1, 6, 2, 1, 1, 1, 1 }, Any idea why we padded the structs before? Were they not assigned? Why did we extend it? -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 5 09:24:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 5 Oct 2017 09:24:03 +0000 Subject: [PATCH] osmo-ci[master]: Add osmo-iuh to nightly .deb builds Message-ID: Review at https://gerrit.osmocom.org/4141 Add osmo-iuh to nightly .deb builds It produces libosmo-ranap-dev which is required by osmo-sgsn. Change-Id: Ief40137cc94e2c54da8c12e2a00953834a578171 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/41/4141/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 432e7a1..fd9b2b2 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -14,6 +14,7 @@ git clone git://git.osmocom.org/libosmo-abis git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 +git clone git://git.osmocom.org/osmo-iuh git clone git://git.osmocom.org/osmo-sgsn git clone git://git.osmocom.org/osmo-ggsn git clone git://git.osmocom.org/openbsc @@ -51,6 +52,7 @@ build libosmo-abis build libosmo-netif build libsmpp34 +build osmo-iuh build osmo-ggsn build osmo-sgsn build openbsc -- To view, visit https://gerrit.osmocom.org/4141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief40137cc94e2c54da8c12e2a00953834a578171 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 5 09:28:07 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 5 Oct 2017 09:28:07 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: use defines for constants In-Reply-To: References: Message-ID: Patch Set 5: (4 comments) https://gerrit.osmocom.org/#/c/3920/5//COMMIT_MSG Commit Message: Line 10: magic number all over the place Okay. What I would have liked to have in the commit message is the discussion of int vs. unsigned long in used types. Why is this change correct? Line 11: * use libosmocore's define for bit pretty-printer Make sure to increase the PKG_CONFIG dependency in configure.ac for the new feature we require! https://gerrit.osmocom.org/#/c/3920/5/src/bts.h File src/bts.h: Line 47: #define NO_FREE_TFI 0xffffffff Why not make this unsigned? We have at least one place where this was used as unsigned... https://gerrit.osmocom.org/#/c/3920/5/src/gprs_rlcmac_ts_alloc.cpp File src/gprs_rlcmac_ts_alloc.cpp: Line 131 You change the type in comparison. Not sure why we wanted it UL on this side? U for sure but L? -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:26 +0000 Subject: meta-telephony[201705]: Update osmocom versions to point to current master In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:29 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:29 +0000 Subject: meta-telephony[201705]: libosmo-sccp: Attempt to fix link issue on 201705-nightly bu... In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:32 +0000 Subject: meta-telephony[201705]: update PV versions for libosmocore, libosmo-sccp and openggsn In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib45238e95156f215412d51d975b1acb33633a3e1 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:34 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:34 +0000 Subject: meta-telephony[201705]: libosmo-abis: modify PV to match recent release In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:37 +0000 Subject: meta-telephony[201705]: libosmo-sccp: Install cfg and service file for osmo-stp In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id82a12bbfb72b421c75140072048a963fb50f684 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:39 +0000 Subject: meta-telephony[201705]: Drop openggsn and introduce osmo-ggsn In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:42 +0000 Subject: meta-telephony[201705]: libasn1c: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I50d990b06c56c3bfa71e7268694702300c0c9a26 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:44 +0000 Subject: meta-telephony[201705]: osmo-iuh: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33d6dccad2336b83f4b4e89769b0796d1c87ed94 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:46 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:48 +0000 Subject: meta-telephony[201705]: osmo-mgw: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9c2d6b5dd8dfd8a0b462d87e93e0733e57f7b0a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:51 +0000 Subject: meta-telephony[201705]: osmo-hlr: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7f47dca8d7e5e50792104ae0c7cb557391542f7 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:54 +0000 Subject: meta-telephony[201705]: osmo-msc: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68715d1970fde83fd6647344b82c6a859404ef9e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:56 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:56 +0000 Subject: meta-telephony[201705]: osmo-bsc: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06c529c01a72e16aa20a2c7a20e8b043718edab3 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:36:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:36:59 +0000 Subject: meta-telephony[201705]: openbsc: Drop packages present in other recipes after split In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd029cbd36417ee980bff51b4112705be16175d3 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:01 +0000 Subject: meta-telephony[201705]: osmo-msc: Avoid installed duplicated binaries in osmo-bsc In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic582450f1881373785f12714ffa3bd150d37417e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:04 +0000 Subject: meta-telephony[201705]: Fix typo with DESCRIPTION var in several recipes In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2637afdb1c868a1f9b54dcbbe55b1a1ee7519d14 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:10 +0000 Subject: [MERGED] meta-telephony[201705]: Fix typo with DESCRIPTION var in several recipes In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Fix typo with DESCRIPTION var in several recipes ...................................................................... Fix typo with DESCRIPTION var in several recipes Change-Id: I2637afdb1c868a1f9b54dcbbe55b1a1ee7519d14 --- M recipes-isdn/dahdi-linux/dahdi-linux_2.10.2.bb M recipes-isdn/dahdi-tools/dahdi-tools_2.10.2.bb M recipes-isdn/lcr/lcr_git.bb M recipes-isdn/misdn/misdn-utils_git.bb M recipes-osmocom/libosmo-abis/libosmo-abis.inc M recipes-osmocom/libosmo-netif/libosmo-netif.inc M recipes-osmocom/libosmo-sccp/libosmo-sccp.inc M recipes-osmocom/libosmocore/libosmocore.inc 8 files changed, 8 insertions(+), 8 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-isdn/dahdi-linux/dahdi-linux_2.10.2.bb b/recipes-isdn/dahdi-linux/dahdi-linux_2.10.2.bb index dc7926e..122b819 100644 --- a/recipes-isdn/dahdi-linux/dahdi-linux_2.10.2.bb +++ b/recipes-isdn/dahdi-linux/dahdi-linux_2.10.2.bb @@ -1,4 +1,4 @@ -DESCRITOPN = "Digium Asterisk Hardware Driver Interface - Linux kernel part" +DESCRIPTION = "Digium Asterisk Hardware Driver Interface - Linux kernel part" SECTION = "base" HOMEPAGE = "http://www.asterisk.org" LICENSE = "GPLv2" diff --git a/recipes-isdn/dahdi-tools/dahdi-tools_2.10.2.bb b/recipes-isdn/dahdi-tools/dahdi-tools_2.10.2.bb index 337186d..eb8aa60 100644 --- a/recipes-isdn/dahdi-tools/dahdi-tools_2.10.2.bb +++ b/recipes-isdn/dahdi-tools/dahdi-tools_2.10.2.bb @@ -1,4 +1,4 @@ -DESCRITOPN = "Utilities for the DAHDI Asterisk Linux kernel drivers" +DESCRIPTION = "Utilities for the DAHDI Asterisk Linux kernel drivers" HOMEPAGE = "http://www.asterisk.org" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "\ diff --git a/recipes-isdn/lcr/lcr_git.bb b/recipes-isdn/lcr/lcr_git.bb index 5858c89..4bcf762 100644 --- a/recipes-isdn/lcr/lcr_git.bb +++ b/recipes-isdn/lcr/lcr_git.bb @@ -1,4 +1,4 @@ -DESCRITOPN = "Linux Call Router" +DESCRIPTION = "Linux Call Router" DEPENDS = "libgsm libopencore-amr sofia-sip" HOMEPAGE = "http://isdn.eversberg.eu/" LICENSE = "GPLv2+" diff --git a/recipes-isdn/misdn/misdn-utils_git.bb b/recipes-isdn/misdn/misdn-utils_git.bb index 1d9f0f2..74acc62 100644 --- a/recipes-isdn/misdn/misdn-utils_git.bb +++ b/recipes-isdn/misdn/misdn-utils_git.bb @@ -1,4 +1,4 @@ -DESCRITOPN = "mISDNutils userspace library" +DESCRIPTION = "mISDNutils userspace library" HOMEPAGE = "http://misdn.org" LICENSE = "LGPLv2+" LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=55ca817ccb7d5b5b66355690e9abc605" diff --git a/recipes-osmocom/libosmo-abis/libosmo-abis.inc b/recipes-osmocom/libosmo-abis/libosmo-abis.inc index f6c19f5..15a512a 100644 --- a/recipes-osmocom/libosmo-abis/libosmo-abis.inc +++ b/recipes-osmocom/libosmo-abis/libosmo-abis.inc @@ -1,4 +1,4 @@ -DESCRITOPN = "An utility library for Open Source Mobile Communications" +DESCRIPTION = "An utility library for Open Source Mobile Communications" DEPENDS = "libosmocore ortp" DEPENDS_append_geode = "dahdi-linux" HOMEPAGE = "http://openbsc.gnumonks.org" diff --git a/recipes-osmocom/libosmo-netif/libosmo-netif.inc b/recipes-osmocom/libosmo-netif/libosmo-netif.inc index e8c6e21..2b7c0fa 100644 --- a/recipes-osmocom/libosmo-netif/libosmo-netif.inc +++ b/recipes-osmocom/libosmo-netif/libosmo-netif.inc @@ -1,4 +1,4 @@ -DESCRITOPN = "Osmux utility classes" +DESCRIPTION = "Osmux utility classes" DEPENDS = "libosmo-abis" HOMEPAGE = "http://git.osmocom.org" LICENSE = "GPLv2+" diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc b/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc index 744e80b..d269dae 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc @@ -1,4 +1,4 @@ -DESCRITOPN = "An utility library for Open Source Mobile Communications" +DESCRIPTION = "An utility library for Open Source Mobile Communications" DEPENDS = "libosmocore libosmo-netif" HOMEPAGE = "https://osmocom.org/projects/libosmo-sccp" LICENSE = "AGPLv3" diff --git a/recipes-osmocom/libosmocore/libosmocore.inc b/recipes-osmocom/libosmocore/libosmocore.inc index de5742f..25ed5c3 100644 --- a/recipes-osmocom/libosmocore/libosmocore.inc +++ b/recipes-osmocom/libosmocore/libosmocore.inc @@ -1,4 +1,4 @@ -DESCRITOPN = "An utility library for Open Source Mobile Communications" +DESCRIPTION = "An utility library for Open Source Mobile Communications" HOMEPAGE = "http://openbsc.gnumonks.org" LICENSE = "GPLv2+" -- To view, visit https://gerrit.osmocom.org/4109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2637afdb1c868a1f9b54dcbbe55b1a1ee7519d14 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:10 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-msc: Avoid installed duplicated binaries in osmo-bsc In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-msc: Avoid installed duplicated binaries in osmo-bsc ...................................................................... osmo-msc: Avoid installed duplicated binaries in osmo-bsc Those two binaries are currently being installed by osmo-bsc too: - /usr/bin/osmo-meas-udp2db - /usr/bin/meas_json Change-Id: Ic582450f1881373785f12714ffa3bd150d37417e --- M recipes-osmocom/osmo-msc/osmo-msc.inc 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-msc/osmo-msc.inc b/recipes-osmocom/osmo-msc/osmo-msc.inc index b4decf9..829f947 100644 --- a/recipes-osmocom/osmo-msc/osmo-msc.inc +++ b/recipes-osmocom/osmo-msc/osmo-msc.inc @@ -5,7 +5,7 @@ DEPENDS = "libdbi libasn1c osmo-iuh libosmocore libosmo-abis libosmo-sccp libosmo-netif libsmpp34 osmo-mgw" -INC_PR="r0.${META_TELEPHONY_OSMO_INC}" +INC_PR="r1.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd @@ -19,6 +19,10 @@ install -m 0644 ${S}/doc/examples/osmo-msc/osmo-msc.cfg ${D}${sysconfdir}/osmocom/ install -m 0644 ${S}/contrib/systemd/osmo-msc.service ${D}${systemd_system_unitdir}/ + + # osmo-bsc already provides these, see issue Osmocom #2522: + rm -f ${D}${bindir}/.debug/*meas* + rm -f ${D}${bindir}/*meas* } SYSTEMD_SERVICE_${PN} = "${PN}.service" -- To view, visit https://gerrit.osmocom.org/4101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic582450f1881373785f12714ffa3bd150d37417e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:10 +0000 Subject: [MERGED] meta-telephony[201705]: openbsc: Drop packages present in other recipes after split In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: openbsc: Drop packages present in other recipes after split ...................................................................... openbsc: Drop packages present in other recipes after split The osmo-bsc one is renamed to osmo-bsc-sccplite and kept because the code in the new osmo-bsc repository still doesn't support SCCPLite, this this one can still be used by installing the osmo-bsc-sccplite package. Change-Id: Ifd029cbd36417ee980bff51b4112705be16175d3 --- M recipes-osmocom/openbsc/openbsc.inc R recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init A recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service D recipes-osmocom/openbsc/openbsc/osmo-bsc_mgcp.init D recipes-osmocom/openbsc/openbsc/osmo-sgsn.init 5 files changed, 39 insertions(+), 151 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/openbsc/openbsc.inc b/recipes-osmocom/openbsc/openbsc.inc index 164b492..e04911d 100644 --- a/recipes-osmocom/openbsc/openbsc.inc +++ b/recipes-osmocom/openbsc/openbsc.inc @@ -7,14 +7,14 @@ RDEPENDS_osmo-nitb = "libdbd-sqlite3" SRC_URI = "file://osmo-nitb.init \ - file://osmo-bsc_mgcp.init \ - file://osmo-bsc.init \ - file://osmo-sgsn.init" + file://osmo-bsc-sccplite.init \ + file://osmo-bsc-sccplite.service \ + " -INC_PR = "r22.${META_TELEPHONY_OSMO_INC}" +INC_PR = "r23.${META_TELEPHONY_OSMO_INC}" -EXTRA_OECONF += " --enable-nat --enable-osmo-bsc --enable-smpp --enable-mgcp-transcoding --with-g729" +EXTRA_OECONF += "--enable-osmo-bsc --enable-mgcp-transcoding --with-g729" inherit autotools update-rc.d pkgconfig @@ -26,50 +26,38 @@ do_install_append() { install -d ${D}${sysconfdir}/osmocom install -m 0660 ${S}/doc/examples/osmo-nitb/nanobts/openbsc.cfg ${D}${sysconfdir}/osmocom/osmo-nitb.cfg - install -m 0660 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/osmo-bsc.cfg - install -m 0660 ${S}/doc/examples/osmo-bsc_mgcp/mgcp.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg - install -m 0660 ${S}/doc/examples/osmo-sgsn/osmo-sgsn.cfg ${D}${sysconfdir}/osmocom/osmo-sgsn.cfg + install -m 0660 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg # Install sysv-init files install -d ${D}${sysconfdir}/init.d install -d ${D}${sysconfdir}/rc5.d install -m 0775 ${WORKDIR}/osmo-nitb.init ${D}${sysconfdir}/init.d/osmo-nitb - install -m 0775 ${WORKDIR}/osmo-bsc_mgcp.init ${D}${sysconfdir}/init.d/osmo-bsc-mgcp - install -m 0775 ${WORKDIR}/osmo-bsc.init ${D}${sysconfdir}/init.d/osmo-bsc - install -m 0775 ${WORKDIR}/osmo-sgsn.init ${D}${sysconfdir}/init.d/osmo-sgsn + install -m 0775 ${WORKDIR}/osmo-bsc-sccplite.init ${D}${sysconfdir}/init.d/osmo-bsc-sccplite # Install systemd files and enable on sysinit - install -d ${D}${systemd_unitdir}/system - for i in `ls ${S}/contrib/systemd`; do - install -m 0644 ${S}/contrib/systemd/$i ${D}${systemd_unitdir}/system/ - done + install -d ${D}${systemd_system_unitdir}/ + install -m 0644 ${S}/contrib/systemd/osmo-nitb.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${WORKDIR}/osmo-bsc-sccplite.service ${D}${systemd_system_unitdir}/ install -d ${D}/var/lib/osmocom + + mv ${D}${bindir}/osmo-bsc ${D}${bindir}/osmo-bsc-sccplite } -PACKAGES =+ "osmo-bsc osmo-nitb osmo-gbproxy osmo-gbproxy-dbg osmo-sgsn ipaccess-utils osmo-bsc-mgcp osmo-bsc-nat" +PACKAGES =+ "osmo-bsc-sccplite osmo-nitb" -INITSCRIPT_PACKAGES = "osmo-bsc osmo-bsc-mgcp osmo-nitb osmo-sgsn" +INITSCRIPT_PACKAGES = "osmo-bsc-sccplite osmo-nitb" # Do not start any of the services by default SYSTEMD_AUTO_ENABLE = "disable" -CONFFILES_osmo-bsc = "${sysconfdir}/osmocom/osmo-bsc.cfg" -INITSCRIPT_NAME_osmo-bsc = "osmo-bsc" -INITSCRIPT_PARAMS_osmo-bsc = "defaults 30 30" -FILES_osmo-bsc = " ${bindir}/osmo-bsc \ - ${sysconfdir}/osmocom/osmo-bsc.cfg \ - ${sysconfdir}/init.d/osmo-bsc \ - ${systemd_unitdir}/system/osmo-bsc.service \ - " - -CONFFILES_osmo-bsc-mgcp = "${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg" -INITSCRIPT_NAME_osmo-bsc-mgcp = "osmo-bsc-mgcp" -INITSCRIPT_PARAMS_osmo-bsc-mgcp = "defaults 30 30" -FILES_osmo-bsc-mgcp = " ${bindir}/osmo-bsc_mgcp \ - ${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg \ - ${sysconfdir}/init.d/osmo-bsc-mgcp \ - ${systemd_unitdir}/system/osmo-bsc-mgcp.service \ +CONFFILES_osmo-bsc-sccplite = "${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg" +INITSCRIPT_NAME_osmo-bsc-sccplite = "osmo-bsc-sccplite" +INITSCRIPT_PARAMS_osmo-bsc-sccplite = "defaults 30 30" +FILES_osmo-bsc-sccplite = " ${bindir}/osmo-bsc-sccplite \ + ${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg \ + ${sysconfdir}/init.d/osmo-bsc-sccplite \ + ${systemd_system_unitdir}/osmo-bsc-sccplite.service \ " CONFFILES_osmo-nitb = "${sysconfdir}/osmocom/osmo-nitb.cfg" @@ -81,19 +69,3 @@ ${sysconfdir}/osmocom/osmo-nitb.cfg \ ${systemd_unitdir}/system/osmo-nitb.service \ " - -CONFFILES_osmo-sgsn = "${sysconfdir}/osmocom/osmo-sgsn.cfg" -INITSCRIPT_NAME_osmo-sgsn = "osmo-sgsn" -INITSCRIPT_PARAMS_osmo-sgsn = "defaults 30 30" -FILES_osmo-sgsn = " ${bindir}/osmo-sgsn \ - ${sysconfdir}/init.d/osmo-sgsn \ - ${sysconfdir}/osmocom/osmo-sgsn.cfg \ - ${systemd_unitdir}/system/osmo-sgsn.service \ - " - -FILES_ipaccess-utils = " ${bindir}/ipaccess-find ${bindir}/ipaccess-config ${bindir}/ipaccess-proxy " -FILES_osmo-bsc-nat = " ${bindir}/osmo-bsc_nat " -FILES_osmo-gbproxy = " ${bindir}/osmo-gbproxy \ - ${systemd_unitdir}/system/osmo-gbproxy.service \ - " -FILES_osmo-gbproxy-dbg = " ${bindir}/.debug/osmo-gbproxy " diff --git a/recipes-osmocom/openbsc/openbsc/osmo-bsc.init b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init similarity index 66% rename from recipes-osmocom/openbsc/openbsc/osmo-bsc.init rename to recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init index c793a0b..3186f6d 100755 --- a/recipes-osmocom/openbsc/openbsc/osmo-bsc.init +++ b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init @@ -1,24 +1,24 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: osmo-bsc +# Provides: osmo-bsc-sccplite # Required-Start: $syslog $networking # Required-Stop: $syslog # Default-Start: 5 # Default-Stop: 1 -# Short-Description: Osmocom GSM Base Station Controller +# Short-Description: Osmocom GSM Base Station Controller (legacy, with SCCPLite) ### END INIT INFO -DAEMON=/usr/bin/osmo-bsc -NAME=osmo-bsc +DAEMON=/usr/bin/osmo-bsc-sccplite +NAME=osmo-bsc-sccplite DESC="Osmocom GSM Base Station Controller" -NORMAL_ARGS="-D -c /etc/osmocom/osmo-bsc.cfg -r /var/run/openbsc.ctl" +NORMAL_ARGS="-D -c /etc/osmocom/osmo-bsc-sccplite.cfg -r /var/run/openbsc.ctl" OSMOBTS_EXTRA_ARGS="" NO_START=1 set -e -test ! -r /etc/default/osmo-bsc || . /etc/default/osmo-bsc +test ! -r /etc/default/osmo-bsc-sccplite || . /etc/default/osmo-bsc-sccplite test "$NO_START" = "0" || exit 0 test -x "$DAEMON" || exit 0 diff --git a/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service new file mode 100644 index 0000000..3edd35c --- /dev/null +++ b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service @@ -0,0 +1,12 @@ +[Unit] +Description=OpenBSC BSC (legacy, with SCCPLite) +Wants=osmo-bsc-mgcp.service + +[Service] +Type=simple +Restart=always +ExecStart=/usr/bin/osmo-bsc-sccplite -c /etc/osmocom/osmo-bsc-sccplite.cfg -s +RestartSec=2 + +[Install] +WantedBy=multi-user.target diff --git a/recipes-osmocom/openbsc/openbsc/osmo-bsc_mgcp.init b/recipes-osmocom/openbsc/openbsc/osmo-bsc_mgcp.init deleted file mode 100755 index f417588..0000000 --- a/recipes-osmocom/openbsc/openbsc/osmo-bsc_mgcp.init +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-bsc_mgcp -# Required-Start: $syslog $networking -# Required-Stop: $syslog -# Default-Start: 5 -# Default-Stop: 1 -# Short-Description: Osmocom GSM BSC MGCP proxy -### END INIT INFO - -DAEMON=/usr/bin/osmo-bsc_mgcp -NAME=osmo-bsc_mgcp -DESC="Osmocom GSM BSC MGCP proxy" -NORMAL_ARGS="-D -c /etc/osmocom/osmo-bsc-mgcp.cfg" - -OSMOBTS_EXTRA_ARGS="" -NO_START=1 - -set -e - -test ! -r /etc/default/osmo-bsc_mgcp || . /etc/default/osmo-bsc_mgcp -test "$NO_START" = "0" || exit 0 -test -x "$DAEMON" || exit 0 - -case "$1" in - start) - echo -n "Starting $DESC: " - start-stop-daemon -S \ - -x "$DAEMON" -- $NORMAL_ARGS $OSMOBTS_EXTRA_ARGS - echo "$NAME." - ;; - stop) - echo -n "Stopping $DESC: " - start-stop-daemon -K -x "$DAEMON" - echo "$NAME." - ;; - restart) - $0 stop - $0 start - ;; - *) - N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|restart}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/recipes-osmocom/openbsc/openbsc/osmo-sgsn.init b/recipes-osmocom/openbsc/openbsc/osmo-sgsn.init deleted file mode 100755 index 4481135..0000000 --- a/recipes-osmocom/openbsc/openbsc/osmo-sgsn.init +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-sgsn -# Required-Start: $syslog $networking -# Required-Stop: $syslog -# Default-Start: 5 -# Default-Stop: 1 -# Short-Description: Osmocom Serving GPRS Support Node -### END INIT INFO - -DAEMON=/usr/bin/osmo-sgsn -NAME=osmo-sgsn -DESC="Osmocom Serving GPRS Support Node" -NORMAL_ARGS="-D -c /etc/osmocom/osmo-sgsn.cfg" - -OSMOSGSN_EXTRA_ARGS="" -NO_START=0 - -set -e - -test ! -r /etc/default/osmo-sgsn || . /etc/default/osmo-sgsn -test "$NO_START" = "0" || exit 0 -test -x "$DAEMON" || exit 0 - -case "$1" in - start) - echo -n "Starting $DESC: " - start-stop-daemon -S \ - -x "$DAEMON" -- $NORMAL_ARGS $OSMOSGSN_EXTRA_ARGS - echo "$NAME." - ;; - stop) - echo -n "Stopping $DESC: " - start-stop-daemon -K -x "$DAEMON" - echo "$NAME." - ;; - restart|force-reload) - $0 stop - $0 start - ;; - *) - N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|restart}" >&2 - exit 1 - ;; -esac - -exit 0 -- To view, visit https://gerrit.osmocom.org/4100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifd029cbd36417ee980bff51b4112705be16175d3 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:10 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-bsc: Introduce recipe In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-bsc: Introduce recipe ...................................................................... osmo-bsc: Introduce recipe This recipe provides osmo-bsc package from new osmo-bsc.git repository, and replaces old osmo-bsc from openbc.git. Change-Id: I06c529c01a72e16aa20a2c7a20e8b043718edab3 --- A recipes-osmocom/osmo-bsc/osmo-bsc.inc A recipes-osmocom/osmo-bsc/osmo-bsc_git.bb 2 files changed, 44 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc b/recipes-osmocom/osmo-bsc/osmo-bsc.inc new file mode 100644 index 0000000..dfa332a --- /dev/null +++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc @@ -0,0 +1,37 @@ +DESCRIPTION = "Osmocom BSC implementation" +HOMEPAGE = "https://osmocom.org/projects/osmobsc" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "sqlite3 libosmocore libosmo-abis libosmo-sccp libosmo-netif osmo-mgw" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/contrib/systemd/osmo-bsc.service ${D}${systemd_system_unitdir}/ +} + +PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils" +SYSTEMD_PACKAGES = "osmo-bsc" +SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service" + +FILES_ipaccess-utils = " \ + ${bindir}/ipaccess-find \ + ${bindir}/ipaccess-config \ + ${bindir}/ipaccess-proxy \ + " + +FILES_osmo-bsc-nat = " \ + ${bindir}/osmo-bsc_nat \ + ${sysconfdir}/osmocom/osmo-bsc_nat.cfg \ + " + +FILES_osmo-bsc-nat-doc = " ${docdir}/osmo-bsc/examples/osmo-bsc_nat " diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb b/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb new file mode 100644 index 0000000..234e054 --- /dev/null +++ b/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "00c22464a0c1b51bb4b29efecab39e993224949c" +SRC_URI = "git://git.osmocom.org/osmo-bsc.git;protocol=git" +PV = "1.0.1+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06c529c01a72e16aa20a2c7a20e8b043718edab3 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:11 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:11 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-msc: Introduce recipe In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-msc: Introduce recipe ...................................................................... osmo-msc: Introduce recipe Change-Id: I68715d1970fde83fd6647344b82c6a859404ef9e --- A recipes-osmocom/osmo-msc/osmo-msc.inc A recipes-osmocom/osmo-msc/osmo-msc_git.bb 2 files changed, 31 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-msc/osmo-msc.inc b/recipes-osmocom/osmo-msc/osmo-msc.inc new file mode 100644 index 0000000..b4decf9 --- /dev/null +++ b/recipes-osmocom/osmo-msc/osmo-msc.inc @@ -0,0 +1,24 @@ +DESCRIPTION = "Osmocom MSC implementation" +HOMEPAGE = "https://osmocom.org/projects/osmomsc" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libdbi libasn1c osmo-iuh libosmocore libosmo-abis libosmo-sccp libosmo-netif libsmpp34 osmo-mgw" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +EXTRA_OECONF += "--enable-smpp --enable-iu" + +RDEPENDS_${PN} = "libdbd-sqlite3" + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-msc/osmo-msc.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-msc.service ${D}${systemd_system_unitdir}/ +} + +SYSTEMD_SERVICE_${PN} = "${PN}.service" diff --git a/recipes-osmocom/osmo-msc/osmo-msc_git.bb b/recipes-osmocom/osmo-msc/osmo-msc_git.bb new file mode 100644 index 0000000..7d55237 --- /dev/null +++ b/recipes-osmocom/osmo-msc/osmo-msc_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "4e7ece0bd969389132d7babf8de4f57cf7d0126f" +SRC_URI = "git://git.osmocom.org/osmo-msc.git;protocol=git" +PV = "1.0.1+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I68715d1970fde83fd6647344b82c6a859404ef9e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:11 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:11 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-hlr: Introduce recipe In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-hlr: Introduce recipe ...................................................................... osmo-hlr: Introduce recipe Change-Id: Ie7f47dca8d7e5e50792104ae0c7cb557391542f7 --- A recipes-osmocom/osmo-hlr/osmo-hlr.inc A recipes-osmocom/osmo-hlr/osmo-hlr_git.bb 2 files changed, 33 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-hlr/osmo-hlr.inc b/recipes-osmocom/osmo-hlr/osmo-hlr.inc new file mode 100644 index 0000000..8afe774 --- /dev/null +++ b/recipes-osmocom/osmo-hlr/osmo-hlr.inc @@ -0,0 +1,26 @@ +DESCRIPTION = "Osmocom HLR implementation" +HOMEPAGE = "https://osmocom.org/projects/osmo-hlr" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libtalloc libosmocore libosmo-abis sqlite3 sqlite3-native" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +do_compile_append() { + sqlite3 ${WORKDIR}/hlr.db < ${S}/sql/hlr.sql +} + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + install -d ${D}${localstatedir}/lib/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-hlr.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-hlr.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${WORKDIR}/hlr.db ${D}${localstatedir}/lib/osmocom/hlr.db +} + +SYSTEMD_SERVICE_${PN} = "${PN}.service" diff --git a/recipes-osmocom/osmo-hlr/osmo-hlr_git.bb b/recipes-osmocom/osmo-hlr/osmo-hlr_git.bb new file mode 100644 index 0000000..8a08d94 --- /dev/null +++ b/recipes-osmocom/osmo-hlr/osmo-hlr_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "05c8b465ab2fe13edb67c95210a9b475f91ebeb3" +SRC_URI = "git://git.osmocom.org/osmo-hlr.git;protocol=git" +PV = "0.0.1+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7f47dca8d7e5e50792104ae0c7cb557391542f7 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:12 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-mgw: Introduce recipe In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-mgw: Introduce recipe ...................................................................... osmo-mgw: Introduce recipe Change-Id: If9c2d6b5dd8dfd8a0b462d87e93e0733e57f7b0a --- A recipes-osmocom/osmo-mgw/osmo-mgw.inc A recipes-osmocom/osmo-mgw/osmo-mgw_git.bb 2 files changed, 29 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-mgw/osmo-mgw.inc b/recipes-osmocom/osmo-mgw/osmo-mgw.inc new file mode 100644 index 0000000..45ee338 --- /dev/null +++ b/recipes-osmocom/osmo-mgw/osmo-mgw.inc @@ -0,0 +1,22 @@ +DESCRIPTION = "Osmocom Media Gateway (MGCP) implementation" +HOMEPAGE = "https://osmocom.org/projects/osmo-mgw" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libosmocore libosmo-netif bcg729 libgsm" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +EXTRA_OECONF += "--enable-mgcp-transcoding --with-g729" + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-bsc_mgcp/mgcp.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg + install -m 0644 ${S}/contrib/systemd/osmo-bsc-mgcp.service ${D}${systemd_system_unitdir}/ +} + +SYSTEMD_SERVICE_osmo-mgw = "osmo-bsc-mgcp.service" diff --git a/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb b/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb new file mode 100644 index 0000000..1ea1a7b --- /dev/null +++ b/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "1c8d67d7f5f6f8788d92df65a0b68e0ec19a34dc" +SRC_URI = "git://git.osmocom.org/osmo-mgw.git;protocol=git" +PV = "1.0.2+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If9c2d6b5dd8dfd8a0b462d87e93e0733e57f7b0a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:12 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-sgsn: Introduce recipe In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-sgsn: Introduce recipe ...................................................................... osmo-sgsn: Introduce recipe Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 --- A recipes-osmocom/osmo-sgsn/osmo-sgsn.inc A recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb 2 files changed, 48 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc new file mode 100644 index 0000000..3669b79 --- /dev/null +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc @@ -0,0 +1,41 @@ +DESCRIPTION = "Osmocom SGSN implementation" +HOMEPAGE = "https://osmocom.org/projects/osmosgsn" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "c-ares libpcap libasn1c libosmocore libosmo-netif osmo-iuh osmo-ggsn" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +EXTRA_OECONF += "--enable-iu" + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-sgsn/osmo-sgsn.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/contrib/systemd/osmo-sgsn.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${S}/contrib/systemd/osmo-gbproxy.service ${D}${systemd_system_unitdir}/ +} + +PACKAGES =+ "osmo-gbproxy-doc osmo-gtphub-doc osmo-gbproxy osmo-gtphub" +SYSTEMD_PACKAGES = "osmo-sgsn osmo-gbproxy" +SYSTEMD_SERVICE_osmo-sgsn = "osmo-sgsn.service" +SYSTEMD_SERVICE_osmo-gbproxy = "osmo-gbproxy.service" + +FILES_osmo-gbproxy = " \ + ${bindir}/osmo-gbproxy \ + ${sysconfdir}/osmocom/osmo-gbproxy.cfg \ + " + +FILES_osmo-gtphub = " \ + ${bindir}/osmo-gtphub \ + ${sysconfdir}/osmocom/osmo-gtphub.cfg \ + " + +FILES_osmo-gbproxy-doc = " ${docdir}/osmo-sgsn/examples/osmo-gbproxy " +FILES_osmo-gtphub-doc = " ${docdir}/osmo-sgsn/examples/osmo-gtphub " diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb b/recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb new file mode 100644 index 0000000..e94618f --- /dev/null +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "341d446b4db87b48812afe8d2149ebc840e8a357" +SRC_URI = "git://git.osmocom.org/osmo-sgsn.git;protocol=git" +PV = "0.1.0+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:12 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-iuh: Introduce recipe In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-iuh: Introduce recipe ...................................................................... osmo-iuh: Introduce recipe Change-Id: I33d6dccad2336b83f4b4e89769b0796d1c87ed94 --- A recipes-osmocom/osmo-iuh/osmo-iuh.inc A recipes-osmocom/osmo-iuh/osmo-iuh_git.bb 2 files changed, 27 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-iuh/osmo-iuh.inc b/recipes-osmocom/osmo-iuh/osmo-iuh.inc new file mode 100644 index 0000000..118827e --- /dev/null +++ b/recipes-osmocom/osmo-iuh/osmo-iuh.inc @@ -0,0 +1,20 @@ +DESCRIPTION = "Osmocom Iuh and HNB-GW implementation" +HOMEPAGE = "https://osmocom.org/projects/osmohnbgw" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libosmocore libosmo-netif libosmo-sccp libasn1c" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-hnbgw.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-hnbgw.service ${D}${systemd_system_unitdir}/ +} + +SYSTEMD_SERVICE_${PN} = "osmo-hnbgw.service" diff --git a/recipes-osmocom/osmo-iuh/osmo-iuh_git.bb b/recipes-osmocom/osmo-iuh/osmo-iuh_git.bb new file mode 100644 index 0000000..821373d --- /dev/null +++ b/recipes-osmocom/osmo-iuh/osmo-iuh_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "5a3df8fa9ffc4400367250a0f9ff0e20dc4b5d3b" +SRC_URI = "git://git.osmocom.org/osmo-iuh.git;protocol=git" +PV = "0.1.0+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I33d6dccad2336b83f4b4e89769b0796d1c87ed94 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:12 +0000 Subject: [MERGED] meta-telephony[201705]: libasn1c: Introduce recipe In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: libasn1c: Introduce recipe ...................................................................... libasn1c: Introduce recipe Change-Id: I50d990b06c56c3bfa71e7268694702300c0c9a26 --- A recipes-osmocom/libasn1c/libasn1c.inc A recipes-osmocom/libasn1c/libasn1c_git.bb 2 files changed, 17 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/libasn1c/libasn1c.inc b/recipes-osmocom/libasn1c/libasn1c.inc new file mode 100644 index 0000000..f1aa7b1 --- /dev/null +++ b/recipes-osmocom/libasn1c/libasn1c.inc @@ -0,0 +1,10 @@ +SUMMARY = "Runtime library of Lev Walkin's asn1c split out as separate library" +HOMEPAGE = "https://osmocom.org/" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=25192323023bb0db6998ac6fcd5aa6a1" + +DEPENDS = "libtalloc" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig diff --git a/recipes-osmocom/libasn1c/libasn1c_git.bb b/recipes-osmocom/libasn1c/libasn1c_git.bb new file mode 100644 index 0000000..0d4800a --- /dev/null +++ b/recipes-osmocom/libasn1c/libasn1c_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "aaae8c76496a97050264e4c49e539b0420496737" +SRC_URI = "git://git.osmocom.org/libasn1c.git;protocol=git" +PV = "0.9.28+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I50d990b06c56c3bfa71e7268694702300c0c9a26 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:13 +0000 Subject: [MERGED] meta-telephony[201705]: Drop openggsn and introduce osmo-ggsn In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Drop openggsn and introduce osmo-ggsn ...................................................................... Drop openggsn and introduce osmo-ggsn Take the opportunity to enable systemd service instead of sysvint like other osmocom services already do. Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a --- M recipes-osmocom/openbsc/openbsc.inc D recipes-osmocom/openggsn/openggsn_git.bb R recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch R recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init A recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb M recipes-telephony/tasks/task-telephony-all.bb 6 files changed, 49 insertions(+), 49 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/openbsc/openbsc.inc b/recipes-osmocom/openbsc/openbsc.inc index a965040..164b492 100644 --- a/recipes-osmocom/openbsc/openbsc.inc +++ b/recipes-osmocom/openbsc/openbsc.inc @@ -1,5 +1,5 @@ DESCRIPTION = "OpenBSC a Free Software GSM BaseStationController" -DEPENDS = "libdbi libosmocore libosmo-sccp libosmo-abis libosmo-netif openggsn libsmpp34 bcg729 libgsm libpcap c-ares" +DEPENDS = "libdbi libosmocore libosmo-sccp libosmo-abis libosmo-netif osmo-ggsn libsmpp34 bcg729 libgsm libpcap c-ares" HOMEPAGE = "http://openbsc.osmocom.org/" LICENSE = "AGPLv3+" LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" @@ -11,7 +11,7 @@ file://osmo-bsc.init \ file://osmo-sgsn.init" -INC_PR = "r21.${META_TELEPHONY_OSMO_INC}" +INC_PR = "r22.${META_TELEPHONY_OSMO_INC}" EXTRA_OECONF += " --enable-nat --enable-osmo-bsc --enable-smpp --enable-mgcp-transcoding --with-g729" @@ -97,4 +97,3 @@ ${systemd_unitdir}/system/osmo-gbproxy.service \ " FILES_osmo-gbproxy-dbg = " ${bindir}/.debug/osmo-gbproxy " - diff --git a/recipes-osmocom/openggsn/openggsn_git.bb b/recipes-osmocom/openggsn/openggsn_git.bb deleted file mode 100644 index 6190b22..0000000 --- a/recipes-osmocom/openggsn/openggsn_git.bb +++ /dev/null @@ -1,40 +0,0 @@ -DESCRITOPN = "OpenGGSN a Free Software GGSN" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" -PV = "0.94+gitr${SRCPV}" -PR = "r0" - -SRCREV = "6045efb642918ac43056ca6a40cda2fe2e6db08d" -SRC_URI = "git://git.osmocom.org/openggsn \ - file://openggsn.init \ - file://libgtp-queue_depth_32.patch \ - " -S = "${WORKDIR}/git" - -DEPENDS = "libosmocore" - -PACKAGES =+ " libgtp libgtp-dev libgtp-staticdev openggsn-sgsnemu" -RDEPENDS_${PN} += "kernel-module-tun" - -inherit autotools update-rc.d pkgconfig - -do_install_append() { - install -d ${D}${sysconfdir}/init.d - install -d ${D}${systemd_unitdir}/system - - install -m 0776 ${WORKDIR}/openggsn.init ${D}${sysconfdir}/init.d/openggsn - install -m 0644 ${S}/contrib/openggsn.service ${D}${systemd_unitdir}/system/ -} - -INITSCRIPT_PACKAGES = "openggsn" - -INITSCRIPT_NAME_openggsn = "openggsn" -INITSCRIPT_PARAMS_openggsn = "defaults 29 29" -RDEPENDS_${PN} += "iptables kernel-module-ipt-masquerade" - -FILES_libgtp = "${libdir}/*${SOLIBS}" -FILES_libgtp-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la" -FILES_libgtp-staticdev = "${libdir}/*.a" - -FILES_openggsn-sgsnemu = "${bindir}/sgsnemu" -FILES_${PN} += "${systemd_unitdir}/system/*" diff --git a/recipes-osmocom/openggsn/files/libgtp-queue_depth_32.patch b/recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch similarity index 100% rename from recipes-osmocom/openggsn/files/libgtp-queue_depth_32.patch rename to recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch diff --git a/recipes-osmocom/openggsn/files/openggsn.init b/recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init similarity index 97% rename from recipes-osmocom/openggsn/files/openggsn.init rename to recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init index 695a6cc..157d6dd 100755 --- a/recipes-osmocom/openggsn/files/openggsn.init +++ b/recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init @@ -1,6 +1,6 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: openggsn +# Provides: osmo-ggsn # Required-Start: $network $local_fs # Required-Stop: # Default-Start: 2 3 4 5 @@ -15,8 +15,8 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="OpenGGSN Gateway GPRS Support Node" -NAME=openggsn +DESC="Osmocom GGSN implementation" +NAME=osmo-ggsn DAEMON=/usr/bin/ggsn DAEMON_ARGS="" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid diff --git a/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb b/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb new file mode 100644 index 0000000..5a383b9 --- /dev/null +++ b/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb @@ -0,0 +1,42 @@ +DESCRIPTION = "Osmocom GGSN implementation" +HOMEPAGE = "https://osmocom.org/projects/openggsn" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" +PV = "1.0.0+gitr${SRCPV}" +PR = "r0" + +SRCREV = "b5624c3d4838cd774c3a6df4208b709890174a25" +SRC_URI = "git://git.osmocom.org/osmo-ggsn \ + file://osmo-ggsn.init \ + file://libgtp-queue_depth_32.patch \ + " +S = "${WORKDIR}/git" + +DEPENDS = "libosmocore" + +PACKAGES =+ " libgtp libgtp-dev libgtp-staticdev osmo-sgsnemu" +RDEPENDS_${PN} += "iptables kernel-module-ipt-masquerade kernel-module-tun" + +inherit autotools update-rc.d pkgconfig systemd + +do_install_append() { + install -d ${D}${sysconfdir}/init.d + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}/${sysconfdir}/osmocom/ + + install -m 0776 ${WORKDIR}/osmo-ggsn.init ${D}${sysconfdir}/init.d/osmo-ggsn + install -m 0644 ${S}/contrib/osmo-ggsn.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${S}/doc/examples/osmo-ggsn.cfg ${D}${sysconfdir}/osmocom/ +} + +SYSTEMD_SERVICE_osmo-ggsn = "osmo-ggsn.service" + +INITSCRIPT_PACKAGES = "osmo-ggsn" +INITSCRIPT_NAME_osmo-ggsn = "osmo-ggsn" +INITSCRIPT_PARAMS_osmo-ggsn = "defaults 29 29" + +FILES_libgtp = "${libdir}/*${SOLIBS}" +FILES_libgtp-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la" +FILES_libgtp-staticdev = "${libdir}/*.a" + +FILES_osmo-sgsnemu = "${bindir}/sgsnemu" diff --git a/recipes-telephony/tasks/task-telephony-all.bb b/recipes-telephony/tasks/task-telephony-all.bb index cc1ca0b..5efec10 100644 --- a/recipes-telephony/tasks/task-telephony-all.bb +++ b/recipes-telephony/tasks/task-telephony-all.bb @@ -3,7 +3,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" ALLOW_EMPTY_${PN} = "1" -PR = "r4" +PR = "r5" DEPENDS = "\ libosmo-abis \ @@ -11,7 +11,7 @@ libosmocore \ openbsc \ packagegroup-osmocom \ - openggsn \ + osmo-ggsn \ misdn-utils \ dahdi-linux \ dahdi-tools \ @@ -21,4 +21,3 @@ libdbi \ libdbi-drivers \ " - -- To view, visit https://gerrit.osmocom.org/4092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:13 +0000 Subject: [MERGED] meta-telephony[201705]: libosmo-sccp: Install cfg and service file for osmo-stp In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: libosmo-sccp: Install cfg and service file for osmo-stp ...................................................................... libosmo-sccp: Install cfg and service file for osmo-stp Patch with systemd service file is added while waiting to have it merged in upstream. Change-Id: Id82a12bbfb72b421c75140072048a963fb50f684 --- M recipes-osmocom/libosmo-sccp/libosmo-sccp.inc M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb 2 files changed, 20 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc b/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc index bac8527..744e80b 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc @@ -1,12 +1,12 @@ DESCRITOPN = "An utility library for Open Source Mobile Communications" DEPENDS = "libosmocore libosmo-netif" -HOMEPAGE = "http://openbsc.gnumonks.org" +HOMEPAGE = "https://osmocom.org/projects/libosmo-sccp" LICENSE = "AGPLv3" INC_PR="r1.${META_TELEPHONY_OSMO_INC}" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" -inherit autotools pkgconfig +inherit autotools pkgconfig systemd ALLOW_EMPTY_libosmo-sccp = "1" diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 7ec2224..ed28cea 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -4,13 +4,30 @@ SRCREV = "54fa75b85c91bb4bb79960942f63968f6423f6a5" SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" PV = "0.7.0+gitr${SRCPV}" -PR = "${INC_PR}.0" +PR = "${INC_PR}.1" # we require the tests to link to the static libosmo-sigtran library to # access symbols not starting with osmo_* EXTRA_OECONF_remove = "--disable-static" +PACKAGES =+ "osmo-stp" +SYSTEMD_PACKAGES = "osmo-stp" +SYSTEMD_SERVICE_osmo-stp = "osmo-stp.service" + # because "${WORKDIR}/git" is not a git repo, it can't figure out the version do_configure_prepend() { echo "${PV}" > ${S}/.tarball-version } + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-stp.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-stp.service ${D}${systemd_system_unitdir}/ +} + +FILES_osmo-stp = " \ + ${bindir}/osmo-stp \ + ${sysconfdir}/osmocom/osmo-stp.cfg \ + " -- To view, visit https://gerrit.osmocom.org/4091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id82a12bbfb72b421c75140072048a963fb50f684 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:13 +0000 Subject: [MERGED] meta-telephony[201705]: libosmo-abis: modify PV to match recent release In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: libosmo-abis: modify PV to match recent release ...................................................................... libosmo-abis: modify PV to match recent release The upstream release commit is 7f17b8c45d094941292036143f3292a1d5789cf5. This should fix current issue with 201705/nightly package feed: $ opkg upgrade Not selecting libosmo-abis 0.3.2+gitr0+d3292913ac as installing it would break existing dependencies. $ opkg list_installed | grep libosmo-abis libosmo-abis - 0.3.2+gitr2+d3292913ac-r2.18.1.0 See that gitr in repos is 0 while the previously installed one has gitr2, which is higher. Explanations I can find for this: - PR server was somehow reset? - the value in gitr is calculated based on offset from latest tag. As new release introduced new tag, gitr may have been reset. In any case, updating PV to have the correct value should fix this issue. Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe --- M recipes-osmocom/libosmo-abis/libosmo-abis_git.bb 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Verified Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb index f796948..6f9c2fd 100644 --- a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb +++ b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb @@ -5,5 +5,5 @@ S = "${WORKDIR}/git" SRCREV = "01543a1ea392fa98974ea2f99cafbc28e9966656" SRC_URI = "git://git.osmocom.org/libosmo-abis.git;protocol=git" -PV = "0.3.2+gitr${SRCPV}" +PV = "0.4.0+gitr${SRCPV}" PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:13 +0000 Subject: [MERGED] meta-telephony[201705]: update PV versions for libosmocore, libosmo-sccp and openggsn In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: update PV versions for libosmocore, libosmo-sccp and openggsn ...................................................................... update PV versions for libosmocore, libosmo-sccp and openggsn As we're building git master, we need to make sure PV is not lagging behind. I wish there was some OE magic by which it could discover PV from the source it builds. Change-Id: Ib45238e95156f215412d51d975b1acb33633a3e1 --- M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb M recipes-osmocom/libosmocore/libosmocore_git.bb M recipes-osmocom/openggsn/openggsn_git.bb 3 files changed, 3 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 3d55f69..7ec2224 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -3,6 +3,7 @@ S = "${WORKDIR}/git" SRCREV = "54fa75b85c91bb4bb79960942f63968f6423f6a5" SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" +PV = "0.7.0+gitr${SRCPV}" PR = "${INC_PR}.0" # we require the tests to link to the static libosmo-sigtran library to diff --git a/recipes-osmocom/libosmocore/libosmocore_git.bb b/recipes-osmocom/libosmocore/libosmocore_git.bb index c8a794c..5d702a3 100644 --- a/recipes-osmocom/libosmocore/libosmocore_git.bb +++ b/recipes-osmocom/libosmocore/libosmocore_git.bb @@ -3,7 +3,7 @@ S = "${WORKDIR}/git" SRCREV = "657c5b6cadcef470c7ff9bffed3caab227026e6a" SRC_URI = "git://git.osmocom.org/libosmocore.git;protocol=git;nobranch=1" -PV = "0.9.0+gitr${SRCPV}" +PV = "0.9.6+gitr${SRCPV}" PR = "r0" DEPENDS += "libtalloc" diff --git a/recipes-osmocom/openggsn/openggsn_git.bb b/recipes-osmocom/openggsn/openggsn_git.bb index 55ca924..6190b22 100644 --- a/recipes-osmocom/openggsn/openggsn_git.bb +++ b/recipes-osmocom/openggsn/openggsn_git.bb @@ -1,7 +1,7 @@ DESCRITOPN = "OpenGGSN a Free Software GGSN" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" -PV = "0.92+gitr${SRCPV}" +PV = "0.94+gitr${SRCPV}" PR = "r0" SRCREV = "6045efb642918ac43056ca6a40cda2fe2e6db08d" -- To view, visit https://gerrit.osmocom.org/4089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib45238e95156f215412d51d975b1acb33633a3e1 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:14 +0000 Subject: [MERGED] meta-telephony[201705]: libosmo-sccp: Attempt to fix link issue on 201705-nightly bu... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: libosmo-sccp: Attempt to fix link issue on 201705-nightly builds ...................................................................... libosmo-sccp: Attempt to fix link issue on 201705-nightly builds This project will build some static libraries needed for testing and also for downstream users. Do not disable the static build on newer Poky versions. arm-poky-linux-gnueabi-libtool: link: arm-poky-linux-gnueabi-gcc -march=armv5te -marm --sysroot=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot -Wall -I/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot/usr/include/ -I/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot/usr/include/ -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1=/usr/src/debug/libosmo-sccp/git-r1.18.1 -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot-native= -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o xua_test xua_test.o sccp_test_data.o ../../src/.libs/libosmo-sigtran.so -losmogsm -ltalloc -losmovty -losmocore -losmonetif -lsctp | xua_test.o: In function `test_helpers': | /usr/src/debug/libosmo-sccp/git-r1.18.1/git/tests/xua/xua_test.c:160: undefined reference to `xua_part_add_gt' | /usr/src/debug/libosmo-sccp/git-r1.18.1/git/tests/xua/xua_test.c:168: undefined reference to `sua_parse_gt' | xua_test.o: In function `test_sccp2sua_case': Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 --- M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 1ce9efc..3d55f69 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -5,6 +5,10 @@ SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" PR = "${INC_PR}.0" +# we require the tests to link to the static libosmo-sigtran library to +# access symbols not starting with osmo_* +EXTRA_OECONF_remove = "--disable-static" + # because "${WORKDIR}/git" is not a git repo, it can't figure out the version do_configure_prepend() { echo "${PV}" > ${S}/.tarball-version -- To view, visit https://gerrit.osmocom.org/4088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 10:37:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 10:37:14 +0000 Subject: [MERGED] meta-telephony[201705]: Update osmocom versions to point to current master In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Update osmocom versions to point to current master ...................................................................... Update osmocom versions to point to current master New versions are required in order to build new git repositories which will deprecate osmo-nitb soon. Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f --- M recipes-osmocom/libosmo-abis/libosmo-abis_git.bb M recipes-osmocom/libosmo-netif/libosmo-netif_git.bb M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb M recipes-osmocom/libosmocore/libosmocore_git.bb M recipes-osmocom/openbsc/openbsc_git.bb M recipes-osmocom/openggsn/openggsn_git.bb 6 files changed, 12 insertions(+), 16 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb index c9c2077..f796948 100644 --- a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb +++ b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb @@ -3,7 +3,7 @@ DEPENDS += "libtalloc" S = "${WORKDIR}/git" -SRCREV = "35003ec2ea7de49d67e5332938a66fe92580b94d" +SRCREV = "01543a1ea392fa98974ea2f99cafbc28e9966656" SRC_URI = "git://git.osmocom.org/libosmo-abis.git;protocol=git" PV = "0.3.2+gitr${SRCPV}" -PR = "${INC_PR}.1" +PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb b/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb index bea2435..0e55628 100644 --- a/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb +++ b/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb @@ -3,7 +3,7 @@ DEPENDS += "libtalloc lksctp-tools" S = "${WORKDIR}/git" -SRCREV = "243a3b0372fe738b01c2d32d6f6cb7b7c99a1180" +SRCREV = "59941982083f7f0d6ab11f7bbb42c297a3fb8d69" SRC_URI = "git://git.osmocom.org/libosmo-netif.git;protocol=git" PV = "0.4.0+gitr${SRCPV}" -PR = "${INC_PR}.2" +PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 1e5af41..1ce9efc 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -1,13 +1,9 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "882f340b6c394f581f6c32cafefa10c7b57073b9" +SRCREV = "54fa75b85c91bb4bb79960942f63968f6423f6a5" SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" -PR = "${INC_PR}.1" - -# we require the tests to link to the static libosmo-sigtran library to -# access symbols not starting with osmo_* -EXTRA_OECONF_remove = "--disable-static" +PR = "${INC_PR}.0" # because "${WORKDIR}/git" is not a git repo, it can't figure out the version do_configure_prepend() { diff --git a/recipes-osmocom/libosmocore/libosmocore_git.bb b/recipes-osmocom/libosmocore/libosmocore_git.bb index 964dea2..c8a794c 100644 --- a/recipes-osmocom/libosmocore/libosmocore_git.bb +++ b/recipes-osmocom/libosmocore/libosmocore_git.bb @@ -1,10 +1,10 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "a8a8d3977dc3b31352f8a87ca005763677bd7e8c" +SRCREV = "657c5b6cadcef470c7ff9bffed3caab227026e6a" SRC_URI = "git://git.osmocom.org/libosmocore.git;protocol=git;nobranch=1" PV = "0.9.0+gitr${SRCPV}" -PR = "r1" +PR = "r0" DEPENDS += "libtalloc" diff --git a/recipes-osmocom/openbsc/openbsc_git.bb b/recipes-osmocom/openbsc/openbsc_git.bb index ac0d257..59667f7 100644 --- a/recipes-osmocom/openbsc/openbsc_git.bb +++ b/recipes-osmocom/openbsc/openbsc_git.bb @@ -2,9 +2,9 @@ PV = "0.15.0+gitr${SRCPV}" PRINC = "0" -PR = "${INC_PR}.6" +PR = "${INC_PR}.0" -SRCREV = "ba66e79953cb1c2230fe2916ef7d8de78500c7fd" +SRCREV = "3ae8682f974058970fa564f09a34a51e867b896b" SRC_URI += "git://git.osmocom.org/openbsc.git;protocol=git" S = "${WORKDIR}/git/openbsc" diff --git a/recipes-osmocom/openggsn/openggsn_git.bb b/recipes-osmocom/openggsn/openggsn_git.bb index d704bc5..55ca924 100644 --- a/recipes-osmocom/openggsn/openggsn_git.bb +++ b/recipes-osmocom/openggsn/openggsn_git.bb @@ -2,9 +2,9 @@ LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" PV = "0.92+gitr${SRCPV}" -PR = "r1" +PR = "r0" -SRCREV = "283188790bb1b3af673d4edbd56ff649b7464e1e" +SRCREV = "6045efb642918ac43056ca6a40cda2fe2e6db08d" SRC_URI = "git://git.osmocom.org/openggsn \ file://openggsn.init \ file://libgtp-queue_depth_32.patch \ -- To view, visit https://gerrit.osmocom.org/4087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 13:30:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 5 Oct 2017 13:30:38 +0000 Subject: [PATCH] osmo-bsc[master]: add ';' after OSMO_ASSERT() Message-ID: Review at https://gerrit.osmocom.org/4142 add ';' after OSMO_ASSERT() Currently, OSMO_ASSERT() is defined such that it ends in a semicolon, hence an added ';' is redundant. However, the usual way this kind of macro should be defined is #define OSMO_ASSERT(x) do { ... } while(0) so that the compiler requires a trailing semicolon. To prepare for such a change possibly coming up in libosmocore, add ';' to all OSMO_ASSERT() users. Change-Id: If6dce81faee9177737a6e1b572a871aaf7e37138 --- M src/osmo-bsc_nat/bsc_nat_utils.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/42/4142/1 diff --git a/src/osmo-bsc_nat/bsc_nat_utils.c b/src/osmo-bsc_nat/bsc_nat_utils.c index a9906b9..3094bbd 100644 --- a/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/src/osmo-bsc_nat/bsc_nat_utils.c @@ -206,7 +206,7 @@ llist_del(&cfg->entry); rate_ctr_group_free(cfg->stats.ctrg); cfg->nat->num_bsc--; - OSMO_ASSERT(cfg->nat->num_bsc >= 0) + OSMO_ASSERT(cfg->nat->num_bsc >= 0); talloc_free(cfg); } -- To view, visit https://gerrit.osmocom.org/4142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If6dce81faee9177737a6e1b572a871aaf7e37138 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 5 13:33:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 5 Oct 2017 13:33:18 +0000 Subject: [PATCH] osmo-msc[master]: add ';' after OSMO_ASSERT() Message-ID: Review at https://gerrit.osmocom.org/4143 add ';' after OSMO_ASSERT() Currently, OSMO_ASSERT() is defined such that it ends in a semicolon, hence an added ';' is redundant. However, the usual way this kind of macro should be defined is #define OSMO_ASSERT(x) do { ... } while(0) so that the compiler requires a trailing semicolon. To prepare for such a change possibly coming up in libosmocore, add ';' to all OSMO_ASSERT() users. Change-Id: Ic79c8b8f98a7f3bef761751d55a7e6125cf2c46d --- M src/libmsc/gsm_04_08.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/43/4143/1 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 84f52c6..8a5265b 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -3220,7 +3220,7 @@ uint8_t pdisc; int rc = 0; - OSMO_ASSERT(msg->l3h) + OSMO_ASSERT(msg->l3h); OSMO_ASSERT(conn); OSMO_ASSERT(msg); -- To view, visit https://gerrit.osmocom.org/4143 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic79c8b8f98a7f3bef761751d55a7e6125cf2c46d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 5 15:45:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 5 Oct 2017 15:45:08 +0000 Subject: [PATCH] libosmocore[master]: add osmo_imsi_str_valid() and osmo_msisdn_str_valid() Message-ID: Review at https://gerrit.osmocom.org/4144 add osmo_imsi_str_valid() and osmo_msisdn_str_valid() Add GSM23003_IMSI_MIN_DIGITS definition. Add regression test gsm23003_test.c to test the two new functions. Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 --- M include/osmocom/gsm/gsm23003.h M include/osmocom/gsm/protocol/gsm_23_003.h M src/gsm/Makefile.am A src/gsm/gsm23003.c M src/gsm/libosmogsm.map M tests/Makefile.am A tests/gsm23003/gsm23003_test.c A tests/gsm23003/gsm23003_test.ok M tests/testsuite.at 9 files changed, 252 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/4144/1 diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index 2bc7583..dd41bc5 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -3,6 +3,7 @@ #pragma once #include +#include /* 23.003 Chapter 12.1 */ struct osmo_plmn_id { @@ -81,3 +82,6 @@ struct osmo_gummei gummei; uint32_t mtmsi; }; + +bool osmo_imsi_str_valid(const char *imsi); +bool osmo_msisdn_str_valid(const char *msisdn); diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index 94243fe..0e66939 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -4,6 +4,7 @@ /* Chapter 2.2 */ #define GSM23003_IMSI_MAX_DIGITS 15 +#define GSM23003_IMSI_MIN_DIGITS 6 /* Chapter 2.4 */ #define GSM23003_TMSI_NUM_BYTES 4 /* Chapter 2.5 */ diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 08cd5e6..48b8b2c 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -29,7 +29,8 @@ auth_milenage.c milenage/aes-encblock.c gea.c \ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ - gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c + gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ + gsm23003.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c new file mode 100644 index 0000000..073d2e4 --- /dev/null +++ b/src/gsm/gsm23003.c @@ -0,0 +1,62 @@ +/*! \file gsm23003.c + * Utility function implementations related to 3GPP TS 23.003 */ +/* + * (C) 2017 sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +static bool is_n_digits(const char *str, int min_digits, int max_digits) +{ + int len; + for (len = 0; *str && len < max_digits; len++, str++) + if (!isdigit(*str)) + return false; + if (len < min_digits) + return false; + /* With not too many digits, we should have reached *str == nul */ + if (*str) + return false; + return true; +} + +/*! Determine whether the given IMSI is valid according to 3GPP TS 23.003. + * \param imsi IMSI digits in ASCII string representation. + * \returns true when the IMSI is valid, false for invalid characters or number + * of digits. + */ +bool osmo_imsi_str_valid(const char *imsi) +{ + return is_n_digits(imsi, GSM23003_IMSI_MIN_DIGITS, GSM23003_IMSI_MAX_DIGITS); +} + +/*! Determine whether the given MSISDN is valid according to 3GPP TS 23.003. + * \param msisdn MSISDN digits in ASCII string representation. + * \returns true when the MSISDN is valid, false for invalid characters or number + * of digits. + */ +bool osmo_msisdn_str_valid(const char *msisdn) +{ + return is_n_digits(msisdn, 1, 15); +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 066f410..95b2ca9 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -418,5 +418,8 @@ osmo_oap_encode; osmo_oap_decode; +osmo_imsi_str_valid; +osmo_msisdn_str_valid; + local: *; }; diff --git a/tests/Makefile.am b/tests/Makefile.am index b138717..dbe349f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test prbs/prbs_test + stats/stats_test prbs/prbs_test gsm23003/gsm23003_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -186,6 +186,9 @@ prbs_prbs_test_SOURCES = prbs/prbs_test.c prbs_prbs_test_LDADD = $(top_builddir)/src/libosmocore.la +gsm23003_gsm23003_test_SOURCES = gsm23003/gsm23003_test.c +gsm23003_gsm23003_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -241,7 +244,8 @@ osmo-auc-gen/osmo-auc-gen_test.ok \ osmo-auc-gen/osmo-auc-gen_test.err \ conv/conv_gsm0503_test.ok endian/endian_test.ok \ - sercomm/sercomm_test.ok prbs/prbs_test.ok + sercomm/sercomm_test.ok prbs/prbs_test.ok \ + gsm23003/gsm23003_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/gsm23003/gsm23003_test.c b/tests/gsm23003/gsm23003_test.c new file mode 100644 index 0000000..f1f80f5 --- /dev/null +++ b/tests/gsm23003/gsm23003_test.c @@ -0,0 +1,126 @@ +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +#define BOOL_STR(b) ((b)? "true" : "false") + +static struct { + const char *imsi; + bool expect_ok; +} test_imsis[] = { + { "", false }, + { " ", false }, + { "1", false }, + { "123", false }, + { "12345", false }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_imsi() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_imsis); i++) { + ok = osmo_imsi_str_valid(test_imsis[i].imsi); + pass = pass && (ok == test_imsis[i].expect_ok); + printf("%2d: expect=%s result=%s imsi='%s'\n", + i, BOOL_STR(test_imsis[i].expect_ok), BOOL_STR(ok), + test_imsis[i].imsi); + } + return pass; +} + +static struct { + const char *msisdn; + bool expect_ok; +} test_msisdns[] = { + { "", false }, + { " ", false }, + { "1", true }, + { "123", true }, + { "12345", true }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_msisdn() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_msisdns); i++) { + ok = osmo_msisdn_str_valid(test_msisdns[i].msisdn); + pass = pass && (ok == test_msisdns[i].expect_ok); + printf("%2d: expect=%s result=%s msisdn='%s'\n", + i, BOOL_STR(test_msisdns[i].expect_ok), BOOL_STR(ok), + test_msisdns[i].msisdn); + } + return pass; +} + +int main(int argc, char **argv) +{ + bool pass = true; + + msgb_talloc_ctx_init(NULL, 0); + + pass = pass && test_valid_imsi(); + pass = pass && test_valid_msisdn(); + + OSMO_ASSERT(pass); + + return EXIT_SUCCESS; +} diff --git a/tests/gsm23003/gsm23003_test.ok b/tests/gsm23003/gsm23003_test.ok new file mode 100644 index 0000000..777451a --- /dev/null +++ b/tests/gsm23003/gsm23003_test.ok @@ -0,0 +1,42 @@ +----- test_valid_imsi + 0: expect=false result=false imsi='' + 1: expect=false result=false imsi=' ' + 2: expect=false result=false imsi='1' + 3: expect=false result=false imsi='123' + 4: expect=false result=false imsi='12345' + 5: expect=true result=true imsi='123456' + 6: expect=true result=true imsi='1234567' + 7: expect=true result=true imsi='1234567890123' + 8: expect=true result=true imsi='123456789012345' + 9: expect=true result=true imsi='000000000000000' +10: expect=true result=true imsi='999999999999999' +11: expect=false result=false imsi='1234567890123456' +12: expect=false result=false imsi='a23456789012345' +13: expect=false result=false imsi='1234567b9012345' +14: expect=false result=false imsi='12345678901234c' +15: expect=false result=false imsi='123456789 01234' +16: expect=false result=false imsi='1234567 +123456' +17: expect=false result=false imsi='123456 123456' +18: expect=false result=false imsi='123456 123456' +----- test_valid_msisdn + 0: expect=false result=false msisdn='' + 1: expect=false result=false msisdn=' ' + 2: expect=true result=true msisdn='1' + 3: expect=true result=true msisdn='123' + 4: expect=true result=true msisdn='12345' + 5: expect=true result=true msisdn='123456' + 6: expect=true result=true msisdn='1234567' + 7: expect=true result=true msisdn='1234567890123' + 8: expect=true result=true msisdn='123456789012345' + 9: expect=true result=true msisdn='000000000000000' +10: expect=true result=true msisdn='999999999999999' +11: expect=false result=false msisdn='1234567890123456' +12: expect=false result=false msisdn='a23456789012345' +13: expect=false result=false msisdn='1234567b9012345' +14: expect=false result=false msisdn='12345678901234c' +15: expect=false result=false msisdn='123456789 01234' +16: expect=false result=false msisdn='1234567 +123456' +17: expect=false result=false msisdn='123456 123456' +18: expect=false result=false msisdn='123456 123456' diff --git a/tests/testsuite.at b/tests/testsuite.at index 1954e66..483860f 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -287,3 +287,9 @@ cat $abs_srcdir/prbs/prbs_test.ok > expout AT_CHECK([$abs_top_builddir/tests/prbs/prbs_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([gsm23003]) +AT_KEYWORDS([gsm23003]) +cat $abs_srcdir/gsm23003/gsm23003_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gsm23003/gsm23003_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 5 15:50:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Oct 2017 15:50:08 +0000 Subject: [PATCH] osmo-gsm-tester[master]: modem: reset cancellable after cancelling dbus methods Message-ID: Review at https://gerrit.osmocom.org/4145 modem: reset cancellable after cancelling dbus methods I first wanted to use "reset" method, but according to [1]: "The recommended practice is to drop the reference to a cancellable after cancelling it, and let it die with the outstanding async operations. You should create a fresh cancellable for further async operations." Pretty weird that in other parts of documentation it still says that it can be used for concurrent events. [1] https://developer.gnome.org/gio/2.54/GCancellable.html#g-cancellable-reset Change-Id: I7392275620576fd0037be5b9d9f360a46a4f8312 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/45/4145/1 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 30e2b55..e301ed6 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -502,6 +502,8 @@ # Cancel op is applied as a signal coming from glib mainloop, so we # need to run it and wait for the callbacks to handle cancellations. poll_glib() + # once it has been triggered, create a new one for next operation: + self.cancellable = Gio.Cancellable.new() def power_cycle(self): 'Power the modem and put it online, power cycle it if it was already on' -- To view, visit https://gerrit.osmocom.org/4145 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7392275620576fd0037be5b9d9f360a46a4f8312 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 5 16:35:12 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Oct 2017 16:35:12 +0000 Subject: [PATCH] osmo-mgw[master]: client: add unified function to generate MGCP messages Message-ID: Review at https://gerrit.osmocom.org/4146 client: add unified function to generate MGCP messages currently the only way to generate MGCP messages is to use mgcp_msg_crcx(), mgcp_msg_mdcx() and mgcp_msg_dlcx(). All three function take a fixed set of parameters via their parameter list. There is no way to add or leave away optional parameters. add function mgcp_msg_gen(), this function takes a unified message struct. The struct features a presence bitmask which allows to enable and disable parameters as needed. It is also possible to add new parameters in the future without breaking the API. Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 237 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/4146/1 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index efc1f76..9368a76 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include @@ -37,6 +38,33 @@ uint16_t audio_port; }; +enum mgcp_verb { + MGCP_VERB_CRCX, + MGCP_VERB_MDCX, + MGCP_VERB_DLCX, + MGCP_VERB_AUEP, + MGCP_VERB_RSIP, +}; + +#define MGCP_MSG_T_ENDPOINT 0x0001 +#define MGCP_MSG_T_CALL_ID 0x0002 +#define MGCP_MSG_T_CONN_ID 0x0004 +#define MGCP_MSG_T_RTP_ADDR 0x0008 +#define MGCP_MSG_T_CONN_MODE 0x0010 + +/* See also RFC3435 section 3.2.1.3 */ +#define MGCP_EINDPOINT_MAXLEN (255*2+1+1) + +struct mgcp_msg { + enum mgcp_verb verb; + uint32_t presence; + char endpoint[MGCP_EINDPOINT_MAXLEN]; + unsigned int call_id; + uint32_t conn_id; + struct sockaddr_storage rtp_addr; + enum mgcp_connection_mode conn_mode; +}; + void mgcp_client_conf_init(struct mgcp_client_conf *conf); void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf); int mgcp_client_config_write(struct vty *vty, const char *indent); @@ -63,17 +91,22 @@ enum mgcp_connection_mode; +/* Deprecated, please use mgcp_msg_gen() instead */ struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, enum mgcp_connection_mode mode); +/* Deprecated, please use mgcp_msg_gen() instead */ struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, const char *rtp_conn_addr, uint16_t rtp_port, enum mgcp_connection_mode mode); +/* Deprecated, please use mgcp_msg_gen() instead */ struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg); + extern const struct value_string mgcp_client_connection_mode_strs[]; static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 1cd37be..175f81a 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -568,6 +569,7 @@ return mgcp->next_trans_id ++; } +/* Deprecated, please use mgcp_msg_gen() instead */ struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, enum mgcp_connection_mode mode) @@ -585,6 +587,7 @@ mgcp_client_cmode_name(mode)); } +/* Deprecated, please use mgcp_msg_gen() instead */ struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, const char *rtp_conn_addr, uint16_t rtp_port, enum mgcp_connection_mode mode) @@ -605,6 +608,7 @@ rtp_port); } +/* Deprecated, please use mgcp_msg_gen() instead */ struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id) { @@ -614,6 +618,113 @@ "C: %x\r\n", trans_id, rtp_endpoint, call_id); } +#define MGCP_CRCX_MANDATORY (MGCP_MSG_T_ENDPOINT | MGCP_MSG_T_CALL_ID | MGCP_MSG_T_CONN_ID | MGCP_MSG_T_CONN_MODE) +#define MGCP_MDCX_MANDATORY (MGCP_MSG_T_ENDPOINT | MGCP_MSG_T_CONN_ID) +#define MGCP_DLCX_MANDATORY (MGCP_MSG_T_ENDPOINT) +#define MGCP_AUEP_MANDATORY (MGCP_MSG_T_ENDPOINT) +#define MGCP_RSIP_MANDATORY 0 /* none */ + +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg) +{ + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); + uint32_t mandatory_mask; + static char compose[4096 - 128]; + struct sockaddr_in *sin; + struct sockaddr_in6 *sin6; + struct sockaddr_storage *ss; + uint16_t port = 0; + char addr[INET6_ADDRSTRLEN]; + + /* Add command verb */ + switch (mgcp_msg->verb) { + case MGCP_VERB_CRCX: + mandatory_mask = MGCP_CRCX_MANDATORY; + sprintf(compose, "CRCX %u", trans_id); + break; + case MGCP_VERB_MDCX: + mandatory_mask = MGCP_MDCX_MANDATORY; + sprintf(compose, "MDCX %u", trans_id); + break; + case MGCP_VERB_DLCX: + mandatory_mask = MGCP_DLCX_MANDATORY; + sprintf(compose, "DLCX %u", trans_id); + break; + case MGCP_VERB_AUEP: + mandatory_mask = MGCP_AUEP_MANDATORY; + sprintf(compose, "AUEP %u", trans_id); + break; + case MGCP_VERB_RSIP: + mandatory_mask = MGCP_RSIP_MANDATORY; + sprintf(compose, "RSIP %u", trans_id); + break; + default: + /* Invalid command verb -- abort */ + return NULL; + } + + /* Check if mandatory fiels are missing */ + if (!((mgcp_msg->presence & mandatory_mask) == mandatory_mask)) + return NULL; + + /* Add endpoint name */ + if (mgcp_msg->presence & MGCP_MSG_T_ENDPOINT) + sprintf(compose + strlen(compose), " %s", mgcp_msg->endpoint); + + /* Add protocol version */ + sprintf(compose + strlen(compose), " MGCP 1.0\r\n"); + + /* Add call id */ + if (mgcp_msg->presence & MGCP_MSG_T_CALL_ID) + sprintf(compose + strlen(compose), "C: %x\r\n", + mgcp_msg->call_id); + + /* Add connection id */ + if (mgcp_msg->presence & MGCP_MSG_T_CONN_ID) + sprintf(compose + strlen(compose), "I: %u\r\n", + mgcp_msg->conn_id); + + /* Add local connection options */ + if (mgcp_msg->presence & MGCP_MSG_T_CONN_ID + && mgcp_msg->verb == MGCP_VERB_CRCX) + sprintf(compose + strlen(compose), "L: p:20, a:AMR, nt:IN\r\n"); + + /* Add mode */ + if (mgcp_msg->presence & MGCP_MSG_T_CONN_MODE) + sprintf(compose + strlen(compose), "M: %s\r\n", + mgcp_client_cmode_name(mgcp_msg->conn_mode)); + + /* Add RTP address and port (SDP) */ + if (mgcp_msg->presence & MGCP_MSG_T_RTP_ADDR) { + sprintf(compose + strlen(compose), "\r\n"); + + ss = &mgcp_msg->rtp_addr; + switch (ss->ss_family) { + case AF_INET: + sin = (struct sockaddr_in *)ss; + port = osmo_ntohs(sin->sin_port); + inet_ntop(AF_INET, &sin->sin_addr, addr, + INET_ADDRSTRLEN); + sprintf(compose + strlen(compose), "c=IN IP4 %s\r\n", + addr); + + break; + case AF_INET6: + sin6 = (struct sockaddr_in6 *)ss; + port = osmo_ntohs(sin6->sin6_port); + inet_ntop(AF_INET6, &sin6->sin6_addr, addr, + INET6_ADDRSTRLEN); + sprintf(compose + strlen(compose), "c=IN IP6 %s\r\n", + addr); + break; + } + + sprintf(compose + strlen(compose), "m=audio %u RTP/AVP 255\r\n", + port); + } + + return mgcp_msg_from_str(trans_id, compose); +} + struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index f2f0e0f..1ed6a9a 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -19,6 +19,9 @@ */ #include +#include +#include +#include #include #include @@ -149,6 +152,67 @@ "a=ptime:20\r\n"); } +void test_mgcp_msg(void) +{ + struct msgb *msg; + + struct mgcp_msg mgcp_msg; + struct sockaddr_in *sin; + + if (mgcp) + talloc_free(mgcp); + mgcp = mgcp_client_init(ctx, &conf); + + /* Pre-fill the message struct with some arbitary values */ + sin = (struct sockaddr_in *)&mgcp_msg.rtp_addr; + sin->sin_family = AF_INET; + sin->sin_port = htons(1234); + inet_aton("192.168.100.23", &sin->sin_addr); + strcpy(mgcp_msg.endpoint, "23 at mgw"); + mgcp_msg.call_id = 47; + mgcp_msg.conn_id = 11; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + + printf("\n"); + + printf("Generated CRCX message:\n"); + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_T_ENDPOINT | MGCP_MSG_T_CALL_ID | MGCP_MSG_T_CONN_ID | + MGCP_MSG_T_CONN_MODE); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated MDCX message:\n"); + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_T_ENDPOINT | MGCP_MSG_T_CALL_ID | MGCP_MSG_T_CONN_ID | + MGCP_MSG_T_CONN_MODE | MGCP_MSG_T_RTP_ADDR); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated DLCX message:\n"); + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = + (MGCP_MSG_T_ENDPOINT | MGCP_MSG_T_CALL_ID | MGCP_MSG_T_CONN_ID); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated AUEP message:\n"); + mgcp_msg.verb = MGCP_VERB_AUEP; + mgcp_msg.presence = (MGCP_MSG_T_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated RSIP message:\n"); + mgcp_msg.verb = MGCP_VERB_RSIP; + mgcp_msg.presence = (MGCP_MSG_T_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + msgb_free(msg); +} + static const struct log_info_cat log_categories[] = { }; @@ -167,6 +231,7 @@ mgcp_client_conf_init(&conf); test_crcx(); + test_mgcp_msg(); printf("Done\n"); fprintf(stderr, "Done\n"); diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index d35f2d6..7c4819d 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,4 +28,32 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + +Generated CRCX message: +CRCX 1 23 at mgw MGCP 1.0 +C: 2f +I: 11 +L: p:20, a:AMR, nt:IN +M: sendrecv + +Generated MDCX message: +MDCX 2 23 at mgw MGCP 1.0 +C: 2f +I: 11 +M: sendrecv + +c=IN IP4 192.168.100.23 +m=audio 1234 RTP/AVP 255 + +Generated DLCX message: +DLCX 3 23 at mgw MGCP 1.0 +C: 2f +I: 11 + +Generated AUEP message: +AUEP 4 23 at mgw MGCP 1.0 + +Generated RSIP message: +RSIP 5 23 at mgw MGCP 1.0 + Done -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 5 16:51:20 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Oct 2017 16:51:20 +0000 Subject: [PATCH] osmo-mgw[master]: client: add ip address parsing to the client Message-ID: Review at https://gerrit.osmocom.org/4147 client: add ip address parsing to the client Some MGCP messages (CRCX, MDCX) return IP-Addresses. Make use of this information. Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 41 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/47/4147/1 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 9368a76..f0d5fdc 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -36,6 +36,7 @@ char *body; struct mgcp_response_head head; uint16_t audio_port; + uint32_t audio_ip; }; enum mgcp_verb { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 175f81a..bbab3f4 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -174,7 +174,7 @@ } /* Parse a line like "m=audio 16002 RTP/AVP 98" */ -static int mgcp_parse_audio(struct mgcp_response *r, const char *line) +static int mgcp_parse_audio_port(struct mgcp_response *r, const char *line) { if (sscanf(line, "m=audio %hu", &r->audio_port) != 1) @@ -184,7 +184,28 @@ response_parse_failure: LOGP(DLMGCP, LOGL_ERROR, - "Failed to parse MGCP response header\n"); + "Failed to parse MGCP response header (audio port)\n"); + return -EINVAL; +} + +/* Parse a line like "c=IN IP4 10.11.12.13" */ +static int mgcp_parse_audio_ip(struct mgcp_response *r, const char *line) +{ + char buf[32]; + + if (strlen(line) < 16) + goto response_parse_failure; + + if (memcmp("c=IN IP4 ", line, 9) != 0) + goto response_parse_failure; + + strcpy(buf, line + 9); + r->audio_ip = inet_addr(buf); + return 0; + +response_parse_failure: + LOGP(DLMGCP, LOGL_ERROR, + "Failed to parse MGCP response header (audio ip)\n"); return -EINVAL; } @@ -213,7 +234,12 @@ switch (line[0]) { case 'm': - rc = mgcp_parse_audio(r, line); + rc = mgcp_parse_audio_port(r, line); + if (rc) + return rc; + break; + case 'c': + rc = mgcp_parse_audio_ip(r, line); if (rc) return rc; break; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 1ed6a9a..b648986 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -97,16 +97,24 @@ { OSMO_ASSERT(priv == mgcp); mgcp_response_parse_params(response); + char buf[256]; + struct sockaddr_in sa; + + struct in_addr addr; + addr.s_addr = response->audio_ip; + inet_ntop(AF_INET, &(sa.sin_addr), buf, INET_ADDRSTRLEN); printf("response cb received:\n" " head.response_code = %d\n" " head.trans_id = %u\n" " head.comment = %s\n" - " audio_port = %u\n", + " audio_port = %u\n" + " audio_ip = %s\n", response->head.response_code, response->head.trans_id, response->head.comment, - response->audio_port + response->audio_port, + inet_ntoa(addr) ); } diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index 7c4819d..3e84e89 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,6 +28,7 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + audio_ip = 10.9.1.120 Generated CRCX message: CRCX 1 23 at mgw MGCP 1.0 -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 5 17:21:28 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Thu, 5 Oct 2017 17:21:28 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: > > I got an error about missing QEMU when running make check without > > our LC15 toolchain built from Yocto framework. > > I suspect you're still doing a cross-compile, i.e. the > './configure' was executed with the environment for your > cross-toolchain? > > > Any suggestion? > > If you do a native compile on your PC, rendering an x86/x68_64 > executable for osmo-pcu, make check should work for master. This > is what all of us execute on our various development machines (all > flavors of Linux from Gentoo to Arch to Debian to Ubuntu), and > which is also what our jenkins.osmoocom.org is testing continuously > e.g. for verifying patch submissions. > > In case of doubt, feel free to open a redmine issue attaching your > config.log and "make check" output. Thanks! I found out an issue with patch set #2 using two successive bitvec_set_bit(dest, H ,2) calls making bit index increased by 4 bits which is not correct. I have also noticed that my MS is able to send packet control ack as 4 successive PRACH bursts without this patch using a clean Yocto image built with up-to-date libraries. Therefore, I would prefer to drop this patch. -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 5 17:28:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 5 Oct 2017 17:28:45 +0000 Subject: [PATCH] libosmocore[master]: add osmo_imsi_str_valid() and osmo_msisdn_str_valid() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4144 to look at the new patch set (#2). add osmo_imsi_str_valid() and osmo_msisdn_str_valid() Add GSM23003_IMSI_MIN_DIGITS definition. Add regression test gsm23003_test.c to test the two new functions. Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 --- M include/osmocom/gsm/gsm23003.h M include/osmocom/gsm/protocol/gsm_23_003.h M src/gsm/Makefile.am A src/gsm/gsm23003.c M src/gsm/libosmogsm.map M tests/Makefile.am A tests/gsm23003/gsm23003_test.c A tests/gsm23003/gsm23003_test.ok M tests/testsuite.at 9 files changed, 250 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/4144/2 diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index 2bc7583..dd41bc5 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -3,6 +3,7 @@ #pragma once #include +#include /* 23.003 Chapter 12.1 */ struct osmo_plmn_id { @@ -81,3 +82,6 @@ struct osmo_gummei gummei; uint32_t mtmsi; }; + +bool osmo_imsi_str_valid(const char *imsi); +bool osmo_msisdn_str_valid(const char *msisdn); diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index 94243fe..0e66939 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -4,6 +4,7 @@ /* Chapter 2.2 */ #define GSM23003_IMSI_MAX_DIGITS 15 +#define GSM23003_IMSI_MIN_DIGITS 6 /* Chapter 2.4 */ #define GSM23003_TMSI_NUM_BYTES 4 /* Chapter 2.5 */ diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 08cd5e6..48b8b2c 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -29,7 +29,8 @@ auth_milenage.c milenage/aes-encblock.c gea.c \ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ - gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c + gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ + gsm23003.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c new file mode 100644 index 0000000..073d2e4 --- /dev/null +++ b/src/gsm/gsm23003.c @@ -0,0 +1,62 @@ +/*! \file gsm23003.c + * Utility function implementations related to 3GPP TS 23.003 */ +/* + * (C) 2017 sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +static bool is_n_digits(const char *str, int min_digits, int max_digits) +{ + int len; + for (len = 0; *str && len < max_digits; len++, str++) + if (!isdigit(*str)) + return false; + if (len < min_digits) + return false; + /* With not too many digits, we should have reached *str == nul */ + if (*str) + return false; + return true; +} + +/*! Determine whether the given IMSI is valid according to 3GPP TS 23.003. + * \param imsi IMSI digits in ASCII string representation. + * \returns true when the IMSI is valid, false for invalid characters or number + * of digits. + */ +bool osmo_imsi_str_valid(const char *imsi) +{ + return is_n_digits(imsi, GSM23003_IMSI_MIN_DIGITS, GSM23003_IMSI_MAX_DIGITS); +} + +/*! Determine whether the given MSISDN is valid according to 3GPP TS 23.003. + * \param msisdn MSISDN digits in ASCII string representation. + * \returns true when the MSISDN is valid, false for invalid characters or number + * of digits. + */ +bool osmo_msisdn_str_valid(const char *msisdn) +{ + return is_n_digits(msisdn, 1, 15); +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 066f410..95b2ca9 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -418,5 +418,8 @@ osmo_oap_encode; osmo_oap_decode; +osmo_imsi_str_valid; +osmo_msisdn_str_valid; + local: *; }; diff --git a/tests/Makefile.am b/tests/Makefile.am index b138717..dbe349f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test prbs/prbs_test + stats/stats_test prbs/prbs_test gsm23003/gsm23003_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -186,6 +186,9 @@ prbs_prbs_test_SOURCES = prbs/prbs_test.c prbs_prbs_test_LDADD = $(top_builddir)/src/libosmocore.la +gsm23003_gsm23003_test_SOURCES = gsm23003/gsm23003_test.c +gsm23003_gsm23003_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -241,7 +244,8 @@ osmo-auc-gen/osmo-auc-gen_test.ok \ osmo-auc-gen/osmo-auc-gen_test.err \ conv/conv_gsm0503_test.ok endian/endian_test.ok \ - sercomm/sercomm_test.ok prbs/prbs_test.ok + sercomm/sercomm_test.ok prbs/prbs_test.ok \ + gsm23003/gsm23003_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/gsm23003/gsm23003_test.c b/tests/gsm23003/gsm23003_test.c new file mode 100644 index 0000000..682f162 --- /dev/null +++ b/tests/gsm23003/gsm23003_test.c @@ -0,0 +1,124 @@ +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +#define BOOL_STR(b) ((b)? "true" : "false") + +static struct { + const char *imsi; + bool expect_ok; +} test_imsis[] = { + { "", false }, + { " ", false }, + { "1", false }, + { "123", false }, + { "12345", false }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_imsi() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_imsis); i++) { + ok = osmo_imsi_str_valid(test_imsis[i].imsi); + pass = pass && (ok == test_imsis[i].expect_ok); + printf("%2d: expect=%s result=%s imsi='%s'\n", + i, BOOL_STR(test_imsis[i].expect_ok), BOOL_STR(ok), + test_imsis[i].imsi); + } + return pass; +} + +static struct { + const char *msisdn; + bool expect_ok; +} test_msisdns[] = { + { "", false }, + { " ", false }, + { "1", true }, + { "123", true }, + { "12345", true }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_msisdn() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_msisdns); i++) { + ok = osmo_msisdn_str_valid(test_msisdns[i].msisdn); + pass = pass && (ok == test_msisdns[i].expect_ok); + printf("%2d: expect=%s result=%s msisdn='%s'\n", + i, BOOL_STR(test_msisdns[i].expect_ok), BOOL_STR(ok), + test_msisdns[i].msisdn); + } + return pass; +} + +int main(int argc, char **argv) +{ + bool pass = true; + + pass = pass && test_valid_imsi(); + pass = pass && test_valid_msisdn(); + + OSMO_ASSERT(pass); + + return EXIT_SUCCESS; +} diff --git a/tests/gsm23003/gsm23003_test.ok b/tests/gsm23003/gsm23003_test.ok new file mode 100644 index 0000000..777451a --- /dev/null +++ b/tests/gsm23003/gsm23003_test.ok @@ -0,0 +1,42 @@ +----- test_valid_imsi + 0: expect=false result=false imsi='' + 1: expect=false result=false imsi=' ' + 2: expect=false result=false imsi='1' + 3: expect=false result=false imsi='123' + 4: expect=false result=false imsi='12345' + 5: expect=true result=true imsi='123456' + 6: expect=true result=true imsi='1234567' + 7: expect=true result=true imsi='1234567890123' + 8: expect=true result=true imsi='123456789012345' + 9: expect=true result=true imsi='000000000000000' +10: expect=true result=true imsi='999999999999999' +11: expect=false result=false imsi='1234567890123456' +12: expect=false result=false imsi='a23456789012345' +13: expect=false result=false imsi='1234567b9012345' +14: expect=false result=false imsi='12345678901234c' +15: expect=false result=false imsi='123456789 01234' +16: expect=false result=false imsi='1234567 +123456' +17: expect=false result=false imsi='123456 123456' +18: expect=false result=false imsi='123456 123456' +----- test_valid_msisdn + 0: expect=false result=false msisdn='' + 1: expect=false result=false msisdn=' ' + 2: expect=true result=true msisdn='1' + 3: expect=true result=true msisdn='123' + 4: expect=true result=true msisdn='12345' + 5: expect=true result=true msisdn='123456' + 6: expect=true result=true msisdn='1234567' + 7: expect=true result=true msisdn='1234567890123' + 8: expect=true result=true msisdn='123456789012345' + 9: expect=true result=true msisdn='000000000000000' +10: expect=true result=true msisdn='999999999999999' +11: expect=false result=false msisdn='1234567890123456' +12: expect=false result=false msisdn='a23456789012345' +13: expect=false result=false msisdn='1234567b9012345' +14: expect=false result=false msisdn='12345678901234c' +15: expect=false result=false msisdn='123456789 01234' +16: expect=false result=false msisdn='1234567 +123456' +17: expect=false result=false msisdn='123456 123456' +18: expect=false result=false msisdn='123456 123456' diff --git a/tests/testsuite.at b/tests/testsuite.at index 1954e66..483860f 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -287,3 +287,9 @@ cat $abs_srcdir/prbs/prbs_test.ok > expout AT_CHECK([$abs_top_builddir/tests/prbs/prbs_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([gsm23003]) +AT_KEYWORDS([gsm23003]) +cat $abs_srcdir/gsm23003/gsm23003_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gsm23003/gsm23003_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 5 17:33:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 5 Oct 2017 17:33:19 +0000 Subject: [PATCH] osmo-mgw[master]: drop code dup between libosmo-mgcp-client and libosmo-mgcp In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4055 to look at the new patch set (#2). drop code dup between libosmo-mgcp-client and libosmo-mgcp Remove mgcp_common.c and replace with mgcp_common.h. Move mgcp_common.h from mgcp_client/ to mgcp/; Place a compile-time copy of it back in mgcp_client/. Add builddir/include to compiler -I paths to find generated header. Rationale: - Keep separate copies of the file for each of the library to not require debian dependencies between the two libraries. - Avoid code dup by copying during 'make' (think: a generated header, BUILT_SOURCE). - The copy does not have implications for linking (like mgcp_common.c did) nor is it a source for build confusion or fallout in other projects, because it does not reach across several git source trees (like gsm_data_shared.h did). mgcp_connection_mode_strs are not actually used in libosmo-mgcp, so drop them. (It would make semantic sense to have then in mgcp, but we can add it when it is needed. A similar value string array remains in libosmo-mgcp-client.) Change-Id: I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 --- M include/Makefile.am M include/osmocom/mgcp/mgcp.h R include/osmocom/mgcp/mgcp_common.h M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp_client/Makefile.am M src/libosmo-mgcp-client/Makefile.am M src/libosmo-mgcp/Makefile.am D src/libosmo-mgcp/mgcp_common.c M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c M tests/mgcp_client/Makefile.am 15 files changed, 19 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/55/4055/2 diff --git a/include/Makefile.am b/include/Makefile.am index 3cc4b1d..b52e5ea 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -9,6 +9,7 @@ osmocom/mgcp_client/mgcp_client.h \ osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ + osmocom/mgcp/mgcp_common.h \ osmocom/mgcp/mgcp_internal.h \ osmocom/mgcp/osmux.h \ $(NULL) diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 67c499b..07d9516 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -28,6 +28,8 @@ #include #include +#include + #include #include #include @@ -166,21 +168,6 @@ MGCP_BSC = 0, MGCP_BSC_NAT, }; - -enum mgcp_connection_mode { - MGCP_CONN_NONE = 0, - MGCP_CONN_RECV_ONLY = 1, - MGCP_CONN_SEND_ONLY = 2, - MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY, - MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, -}; - -extern const struct value_string mgcp_connection_mode_strs[]; - -static inline const char *mgcp_cmode_name(enum mgcp_connection_mode mode) -{ - return get_value_string(mgcp_connection_mode_strs, mode); -} struct mgcp_config { int source_port; diff --git a/include/osmocom/mgcp_client/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h similarity index 100% rename from include/osmocom/mgcp_client/mgcp_common.h rename to include/osmocom/mgcp/mgcp_common.h diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 3a22d51..751aba5 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -330,5 +330,3 @@ return endp->cfg->net_ports.bind_addr; return endp->cfg->source_addr; } - -int mgcp_msg_terminate_nul(struct msgb *msg); diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am index 24401f1..0eaafcc 100644 --- a/include/osmocom/mgcp_client/Makefile.am +++ b/include/osmocom/mgcp_client/Makefile.am @@ -1,3 +1,11 @@ +BUILT_SOURCES = \ + mgcp_common.h \ + $(NULL) + noinst_HEADERS = \ mgcp_client_internal.h \ $(NULL) + +mgcp_common.h: $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h + echo -e "/*\n\n DO NOT EDIT THIS FILE!\n THIS IS OVERWRITTEN DURING BUILD\n This is an automatic copy of \n\n */" > mgcp_common.h + cat $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h >> mgcp_common.h diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index a2eb2be..3dd21db 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = \ $(all_includes) \ -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ -I$(top_builddir) \ $(NULL) diff --git a/src/libosmo-mgcp/Makefile.am b/src/libosmo-mgcp/Makefile.am index 20959b8..e121fea 100644 --- a/src/libosmo-mgcp/Makefile.am +++ b/src/libosmo-mgcp/Makefile.am @@ -32,7 +32,6 @@ $(NULL) libosmo_mgcp_la_SOURCES = \ - mgcp_common.c \ mgcp_protocol.c \ mgcp_network.c \ mgcp_vty.c \ diff --git a/src/libosmo-mgcp/mgcp_common.c b/src/libosmo-mgcp/mgcp_common.c deleted file mode 100644 index c246742..0000000 --- a/src/libosmo-mgcp/mgcp_common.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Media Gateway Control Protocol Media Gateway: RFC 3435 */ -/* Implementations useful both for the MGCP GW as well as MGCP GW clients */ - -/* - * (C) 2016 by sysmocom s.m.f.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include -#include - -const struct value_string mgcp_connection_mode_strs[] = { - { MGCP_CONN_NONE, "none" }, - { MGCP_CONN_RECV_SEND, "sendrecv" }, - { MGCP_CONN_SEND_ONLY, "sendonly" }, - { MGCP_CONN_RECV_ONLY, "recvonly" }, - { MGCP_CONN_LOOPBACK, "loopback" }, - { 0, NULL } -}; - -/* Ensure that the msg->l2h is NUL terminated. */ -int mgcp_msg_terminate_nul(struct msgb *msg) -{ - unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ - if (tail[-1] == '\0') - /* nothing to do */; - else if (msgb_tailroom(msg) > 0) - tail[0] = '\0'; - else if (tail[-1] == '\r' || tail[-1] == '\n') - tail[-1] = '\0'; - else { - LOGP(DLMGCP, LOGL_ERROR, "Cannot NUL terminate MGCP message: " - "Length: %d, Buffer size: %d\n", - msgb_l2len(msg), msg->data_len); - return -ENOTSUP; - } - return 0; -} diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index 1a295e7..0da62bc 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -23,7 +23,7 @@ #include #include -#include +#include /* Reset codec state and free memory */ static void mgcp_rtp_codec_reset(struct mgcp_rtp_codec *codec) diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index f4ecb03..d686bca 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -25,6 +25,7 @@ #include #include +#include #include #include diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 4a1eb74..dac1698 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index ac25894..c00cdc6 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index aaa0429..a1299b2 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index c91de8f..e783dac 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/tests/mgcp_client/Makefile.am b/tests/mgcp_client/Makefile.am index e33f0e8..5cd0d8a 100644 --- a/tests/mgcp_client/Makefile.am +++ b/tests/mgcp_client/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = \ $(all_includes) \ -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ -I$(top_srcdir) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/4055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 5 17:38:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 5 Oct 2017 17:38:46 +0000 Subject: [PATCH] libosmocore[master]: add osmo_imsi_str_valid() and osmo_msisdn_str_valid() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4144 to look at the new patch set (#3). add osmo_imsi_str_valid() and osmo_msisdn_str_valid() Add GSM23003_IMSI_MIN_DIGITS definition. Add regression test gsm23003_test.c to test the two new functions. Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 --- M include/osmocom/gsm/gsm23003.h M include/osmocom/gsm/protocol/gsm_23_003.h M src/gsm/Makefile.am A src/gsm/gsm23003.c M src/gsm/libosmogsm.map M tests/Makefile.am A tests/gsm23003/gsm23003_test.c A tests/gsm23003/gsm23003_test.ok M tests/testsuite.at 9 files changed, 253 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/4144/3 diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index 2bc7583..dd41bc5 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -3,6 +3,7 @@ #pragma once #include +#include /* 23.003 Chapter 12.1 */ struct osmo_plmn_id { @@ -81,3 +82,6 @@ struct osmo_gummei gummei; uint32_t mtmsi; }; + +bool osmo_imsi_str_valid(const char *imsi); +bool osmo_msisdn_str_valid(const char *msisdn); diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index 94243fe..0e66939 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -4,6 +4,7 @@ /* Chapter 2.2 */ #define GSM23003_IMSI_MAX_DIGITS 15 +#define GSM23003_IMSI_MIN_DIGITS 6 /* Chapter 2.4 */ #define GSM23003_TMSI_NUM_BYTES 4 /* Chapter 2.5 */ diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 08cd5e6..48b8b2c 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -29,7 +29,8 @@ auth_milenage.c milenage/aes-encblock.c gea.c \ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ - gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c + gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ + gsm23003.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c new file mode 100644 index 0000000..145df3f --- /dev/null +++ b/src/gsm/gsm23003.c @@ -0,0 +1,65 @@ +/*! \file gsm23003.c + * Utility function implementations related to 3GPP TS 23.003 */ +/* + * (C) 2017 sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +static bool is_n_digits(const char *str, int min_digits, int max_digits) +{ + int len; + /* Use unsigned char * to avoid a compiler warning of + * "error: array subscript has type 'char' [-Werror=char-subscripts]" */ + unsigned char *pos = str; + for (len = 0; *pos && len < max_digits; len++, pos++) + if (!isdigit(*pos)) + return false; + if (len < min_digits) + return false; + /* With not too many digits, we should have reached *str == nul */ + if (*pos) + return false; + return true; +} + +/*! Determine whether the given IMSI is valid according to 3GPP TS 23.003. + * \param imsi IMSI digits in ASCII string representation. + * \returns true when the IMSI is valid, false for invalid characters or number + * of digits. + */ +bool osmo_imsi_str_valid(const char *imsi) +{ + return is_n_digits(imsi, GSM23003_IMSI_MIN_DIGITS, GSM23003_IMSI_MAX_DIGITS); +} + +/*! Determine whether the given MSISDN is valid according to 3GPP TS 23.003. + * \param msisdn MSISDN digits in ASCII string representation. + * \returns true when the MSISDN is valid, false for invalid characters or number + * of digits. + */ +bool osmo_msisdn_str_valid(const char *msisdn) +{ + return is_n_digits(msisdn, 1, 15); +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 066f410..95b2ca9 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -418,5 +418,8 @@ osmo_oap_encode; osmo_oap_decode; +osmo_imsi_str_valid; +osmo_msisdn_str_valid; + local: *; }; diff --git a/tests/Makefile.am b/tests/Makefile.am index b138717..dbe349f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test prbs/prbs_test + stats/stats_test prbs/prbs_test gsm23003/gsm23003_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -186,6 +186,9 @@ prbs_prbs_test_SOURCES = prbs/prbs_test.c prbs_prbs_test_LDADD = $(top_builddir)/src/libosmocore.la +gsm23003_gsm23003_test_SOURCES = gsm23003/gsm23003_test.c +gsm23003_gsm23003_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -241,7 +244,8 @@ osmo-auc-gen/osmo-auc-gen_test.ok \ osmo-auc-gen/osmo-auc-gen_test.err \ conv/conv_gsm0503_test.ok endian/endian_test.ok \ - sercomm/sercomm_test.ok prbs/prbs_test.ok + sercomm/sercomm_test.ok prbs/prbs_test.ok \ + gsm23003/gsm23003_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/gsm23003/gsm23003_test.c b/tests/gsm23003/gsm23003_test.c new file mode 100644 index 0000000..682f162 --- /dev/null +++ b/tests/gsm23003/gsm23003_test.c @@ -0,0 +1,124 @@ +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +#define BOOL_STR(b) ((b)? "true" : "false") + +static struct { + const char *imsi; + bool expect_ok; +} test_imsis[] = { + { "", false }, + { " ", false }, + { "1", false }, + { "123", false }, + { "12345", false }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_imsi() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_imsis); i++) { + ok = osmo_imsi_str_valid(test_imsis[i].imsi); + pass = pass && (ok == test_imsis[i].expect_ok); + printf("%2d: expect=%s result=%s imsi='%s'\n", + i, BOOL_STR(test_imsis[i].expect_ok), BOOL_STR(ok), + test_imsis[i].imsi); + } + return pass; +} + +static struct { + const char *msisdn; + bool expect_ok; +} test_msisdns[] = { + { "", false }, + { " ", false }, + { "1", true }, + { "123", true }, + { "12345", true }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_msisdn() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_msisdns); i++) { + ok = osmo_msisdn_str_valid(test_msisdns[i].msisdn); + pass = pass && (ok == test_msisdns[i].expect_ok); + printf("%2d: expect=%s result=%s msisdn='%s'\n", + i, BOOL_STR(test_msisdns[i].expect_ok), BOOL_STR(ok), + test_msisdns[i].msisdn); + } + return pass; +} + +int main(int argc, char **argv) +{ + bool pass = true; + + pass = pass && test_valid_imsi(); + pass = pass && test_valid_msisdn(); + + OSMO_ASSERT(pass); + + return EXIT_SUCCESS; +} diff --git a/tests/gsm23003/gsm23003_test.ok b/tests/gsm23003/gsm23003_test.ok new file mode 100644 index 0000000..777451a --- /dev/null +++ b/tests/gsm23003/gsm23003_test.ok @@ -0,0 +1,42 @@ +----- test_valid_imsi + 0: expect=false result=false imsi='' + 1: expect=false result=false imsi=' ' + 2: expect=false result=false imsi='1' + 3: expect=false result=false imsi='123' + 4: expect=false result=false imsi='12345' + 5: expect=true result=true imsi='123456' + 6: expect=true result=true imsi='1234567' + 7: expect=true result=true imsi='1234567890123' + 8: expect=true result=true imsi='123456789012345' + 9: expect=true result=true imsi='000000000000000' +10: expect=true result=true imsi='999999999999999' +11: expect=false result=false imsi='1234567890123456' +12: expect=false result=false imsi='a23456789012345' +13: expect=false result=false imsi='1234567b9012345' +14: expect=false result=false imsi='12345678901234c' +15: expect=false result=false imsi='123456789 01234' +16: expect=false result=false imsi='1234567 +123456' +17: expect=false result=false imsi='123456 123456' +18: expect=false result=false imsi='123456 123456' +----- test_valid_msisdn + 0: expect=false result=false msisdn='' + 1: expect=false result=false msisdn=' ' + 2: expect=true result=true msisdn='1' + 3: expect=true result=true msisdn='123' + 4: expect=true result=true msisdn='12345' + 5: expect=true result=true msisdn='123456' + 6: expect=true result=true msisdn='1234567' + 7: expect=true result=true msisdn='1234567890123' + 8: expect=true result=true msisdn='123456789012345' + 9: expect=true result=true msisdn='000000000000000' +10: expect=true result=true msisdn='999999999999999' +11: expect=false result=false msisdn='1234567890123456' +12: expect=false result=false msisdn='a23456789012345' +13: expect=false result=false msisdn='1234567b9012345' +14: expect=false result=false msisdn='12345678901234c' +15: expect=false result=false msisdn='123456789 01234' +16: expect=false result=false msisdn='1234567 +123456' +17: expect=false result=false msisdn='123456 123456' +18: expect=false result=false msisdn='123456 123456' diff --git a/tests/testsuite.at b/tests/testsuite.at index 1954e66..483860f 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -287,3 +287,9 @@ cat $abs_srcdir/prbs/prbs_test.ok > expout AT_CHECK([$abs_top_builddir/tests/prbs/prbs_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([gsm23003]) +AT_KEYWORDS([gsm23003]) +cat $abs_srcdir/gsm23003/gsm23003_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gsm23003/gsm23003_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 5 17:40:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 5 Oct 2017 17:40:30 +0000 Subject: [PATCH] libosmocore[master]: add osmo_imsi_str_valid() and osmo_msisdn_str_valid() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4144 to look at the new patch set (#4). add osmo_imsi_str_valid() and osmo_msisdn_str_valid() Add GSM23003_IMSI_MIN_DIGITS definition. Add regression test gsm23003_test.c to test the two new functions. Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 --- M include/osmocom/gsm/gsm23003.h M include/osmocom/gsm/protocol/gsm_23_003.h M src/gsm/Makefile.am A src/gsm/gsm23003.c M src/gsm/libosmogsm.map M tests/Makefile.am A tests/gsm23003/gsm23003_test.c A tests/gsm23003/gsm23003_test.ok M tests/testsuite.at 9 files changed, 253 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/4144/4 diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index 2bc7583..dd41bc5 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -3,6 +3,7 @@ #pragma once #include +#include /* 23.003 Chapter 12.1 */ struct osmo_plmn_id { @@ -81,3 +82,6 @@ struct osmo_gummei gummei; uint32_t mtmsi; }; + +bool osmo_imsi_str_valid(const char *imsi); +bool osmo_msisdn_str_valid(const char *msisdn); diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index 94243fe..0e66939 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -4,6 +4,7 @@ /* Chapter 2.2 */ #define GSM23003_IMSI_MAX_DIGITS 15 +#define GSM23003_IMSI_MIN_DIGITS 6 /* Chapter 2.4 */ #define GSM23003_TMSI_NUM_BYTES 4 /* Chapter 2.5 */ diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 08cd5e6..48b8b2c 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -29,7 +29,8 @@ auth_milenage.c milenage/aes-encblock.c gea.c \ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ - gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c + gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ + gsm23003.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c new file mode 100644 index 0000000..1c5884f --- /dev/null +++ b/src/gsm/gsm23003.c @@ -0,0 +1,65 @@ +/*! \file gsm23003.c + * Utility function implementations related to 3GPP TS 23.003 */ +/* + * (C) 2017 sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +static bool is_n_digits(const char *str, int min_digits, int max_digits) +{ + int len; + /* Use unsigned char * to avoid a compiler warning of + * "error: array subscript has type 'char' [-Werror=char-subscripts]" */ + const unsigned char *pos = str; + for (len = 0; *pos && len < max_digits; len++, pos++) + if (!isdigit(*pos)) + return false; + if (len < min_digits) + return false; + /* With not too many digits, we should have reached *str == nul */ + if (*pos) + return false; + return true; +} + +/*! Determine whether the given IMSI is valid according to 3GPP TS 23.003. + * \param imsi IMSI digits in ASCII string representation. + * \returns true when the IMSI is valid, false for invalid characters or number + * of digits. + */ +bool osmo_imsi_str_valid(const char *imsi) +{ + return is_n_digits(imsi, GSM23003_IMSI_MIN_DIGITS, GSM23003_IMSI_MAX_DIGITS); +} + +/*! Determine whether the given MSISDN is valid according to 3GPP TS 23.003. + * \param msisdn MSISDN digits in ASCII string representation. + * \returns true when the MSISDN is valid, false for invalid characters or number + * of digits. + */ +bool osmo_msisdn_str_valid(const char *msisdn) +{ + return is_n_digits(msisdn, 1, 15); +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 066f410..95b2ca9 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -418,5 +418,8 @@ osmo_oap_encode; osmo_oap_decode; +osmo_imsi_str_valid; +osmo_msisdn_str_valid; + local: *; }; diff --git a/tests/Makefile.am b/tests/Makefile.am index b138717..dbe349f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test prbs/prbs_test + stats/stats_test prbs/prbs_test gsm23003/gsm23003_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -186,6 +186,9 @@ prbs_prbs_test_SOURCES = prbs/prbs_test.c prbs_prbs_test_LDADD = $(top_builddir)/src/libosmocore.la +gsm23003_gsm23003_test_SOURCES = gsm23003/gsm23003_test.c +gsm23003_gsm23003_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -241,7 +244,8 @@ osmo-auc-gen/osmo-auc-gen_test.ok \ osmo-auc-gen/osmo-auc-gen_test.err \ conv/conv_gsm0503_test.ok endian/endian_test.ok \ - sercomm/sercomm_test.ok prbs/prbs_test.ok + sercomm/sercomm_test.ok prbs/prbs_test.ok \ + gsm23003/gsm23003_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/gsm23003/gsm23003_test.c b/tests/gsm23003/gsm23003_test.c new file mode 100644 index 0000000..682f162 --- /dev/null +++ b/tests/gsm23003/gsm23003_test.c @@ -0,0 +1,124 @@ +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +#define BOOL_STR(b) ((b)? "true" : "false") + +static struct { + const char *imsi; + bool expect_ok; +} test_imsis[] = { + { "", false }, + { " ", false }, + { "1", false }, + { "123", false }, + { "12345", false }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_imsi() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_imsis); i++) { + ok = osmo_imsi_str_valid(test_imsis[i].imsi); + pass = pass && (ok == test_imsis[i].expect_ok); + printf("%2d: expect=%s result=%s imsi='%s'\n", + i, BOOL_STR(test_imsis[i].expect_ok), BOOL_STR(ok), + test_imsis[i].imsi); + } + return pass; +} + +static struct { + const char *msisdn; + bool expect_ok; +} test_msisdns[] = { + { "", false }, + { " ", false }, + { "1", true }, + { "123", true }, + { "12345", true }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_msisdn() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_msisdns); i++) { + ok = osmo_msisdn_str_valid(test_msisdns[i].msisdn); + pass = pass && (ok == test_msisdns[i].expect_ok); + printf("%2d: expect=%s result=%s msisdn='%s'\n", + i, BOOL_STR(test_msisdns[i].expect_ok), BOOL_STR(ok), + test_msisdns[i].msisdn); + } + return pass; +} + +int main(int argc, char **argv) +{ + bool pass = true; + + pass = pass && test_valid_imsi(); + pass = pass && test_valid_msisdn(); + + OSMO_ASSERT(pass); + + return EXIT_SUCCESS; +} diff --git a/tests/gsm23003/gsm23003_test.ok b/tests/gsm23003/gsm23003_test.ok new file mode 100644 index 0000000..777451a --- /dev/null +++ b/tests/gsm23003/gsm23003_test.ok @@ -0,0 +1,42 @@ +----- test_valid_imsi + 0: expect=false result=false imsi='' + 1: expect=false result=false imsi=' ' + 2: expect=false result=false imsi='1' + 3: expect=false result=false imsi='123' + 4: expect=false result=false imsi='12345' + 5: expect=true result=true imsi='123456' + 6: expect=true result=true imsi='1234567' + 7: expect=true result=true imsi='1234567890123' + 8: expect=true result=true imsi='123456789012345' + 9: expect=true result=true imsi='000000000000000' +10: expect=true result=true imsi='999999999999999' +11: expect=false result=false imsi='1234567890123456' +12: expect=false result=false imsi='a23456789012345' +13: expect=false result=false imsi='1234567b9012345' +14: expect=false result=false imsi='12345678901234c' +15: expect=false result=false imsi='123456789 01234' +16: expect=false result=false imsi='1234567 +123456' +17: expect=false result=false imsi='123456 123456' +18: expect=false result=false imsi='123456 123456' +----- test_valid_msisdn + 0: expect=false result=false msisdn='' + 1: expect=false result=false msisdn=' ' + 2: expect=true result=true msisdn='1' + 3: expect=true result=true msisdn='123' + 4: expect=true result=true msisdn='12345' + 5: expect=true result=true msisdn='123456' + 6: expect=true result=true msisdn='1234567' + 7: expect=true result=true msisdn='1234567890123' + 8: expect=true result=true msisdn='123456789012345' + 9: expect=true result=true msisdn='000000000000000' +10: expect=true result=true msisdn='999999999999999' +11: expect=false result=false msisdn='1234567890123456' +12: expect=false result=false msisdn='a23456789012345' +13: expect=false result=false msisdn='1234567b9012345' +14: expect=false result=false msisdn='12345678901234c' +15: expect=false result=false msisdn='123456789 01234' +16: expect=false result=false msisdn='1234567 +123456' +17: expect=false result=false msisdn='123456 123456' +18: expect=false result=false msisdn='123456 123456' diff --git a/tests/testsuite.at b/tests/testsuite.at index 1954e66..483860f 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -287,3 +287,9 @@ cat $abs_srcdir/prbs/prbs_test.ok > expout AT_CHECK([$abs_top_builddir/tests/prbs/prbs_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([gsm23003]) +AT_KEYWORDS([gsm23003]) +cat $abs_srcdir/gsm23003/gsm23003_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gsm23003/gsm23003_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 5 17:44:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 5 Oct 2017 17:44:31 +0000 Subject: [PATCH] libosmocore[master]: add osmo_imsi_str_valid() and osmo_msisdn_str_valid() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4144 to look at the new patch set (#5). add osmo_imsi_str_valid() and osmo_msisdn_str_valid() Add GSM23003_IMSI_MIN_DIGITS definition. Add regression test gsm23003_test.c to test the two new functions. Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 --- M include/osmocom/gsm/gsm23003.h M include/osmocom/gsm/protocol/gsm_23_003.h M src/gsm/Makefile.am A src/gsm/gsm23003.c M src/gsm/libosmogsm.map M tests/Makefile.am A tests/gsm23003/gsm23003_test.c A tests/gsm23003/gsm23003_test.ok M tests/testsuite.at 9 files changed, 253 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/4144/5 diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index 2bc7583..dd41bc5 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -3,6 +3,7 @@ #pragma once #include +#include /* 23.003 Chapter 12.1 */ struct osmo_plmn_id { @@ -81,3 +82,6 @@ struct osmo_gummei gummei; uint32_t mtmsi; }; + +bool osmo_imsi_str_valid(const char *imsi); +bool osmo_msisdn_str_valid(const char *msisdn); diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index 94243fe..0e66939 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -4,6 +4,7 @@ /* Chapter 2.2 */ #define GSM23003_IMSI_MAX_DIGITS 15 +#define GSM23003_IMSI_MIN_DIGITS 6 /* Chapter 2.4 */ #define GSM23003_TMSI_NUM_BYTES 4 /* Chapter 2.5 */ diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 08cd5e6..48b8b2c 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -29,7 +29,8 @@ auth_milenage.c milenage/aes-encblock.c gea.c \ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ - gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c + gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ + gsm23003.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c new file mode 100644 index 0000000..004e20f --- /dev/null +++ b/src/gsm/gsm23003.c @@ -0,0 +1,65 @@ +/*! \file gsm23003.c + * Utility function implementations related to 3GPP TS 23.003 */ +/* + * (C) 2017 sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +static bool is_n_digits(const char *str, int min_digits, int max_digits) +{ + int len; + /* Use unsigned char * to avoid a compiler warning of + * "error: array subscript has type 'char' [-Werror=char-subscripts]" */ + const unsigned char *pos = (const unsigned char *)str; + for (len = 0; *pos && len < max_digits; len++, pos++) + if (!isdigit(*pos)) + return false; + if (len < min_digits) + return false; + /* With not too many digits, we should have reached *str == nul */ + if (*pos) + return false; + return true; +} + +/*! Determine whether the given IMSI is valid according to 3GPP TS 23.003. + * \param imsi IMSI digits in ASCII string representation. + * \returns true when the IMSI is valid, false for invalid characters or number + * of digits. + */ +bool osmo_imsi_str_valid(const char *imsi) +{ + return is_n_digits(imsi, GSM23003_IMSI_MIN_DIGITS, GSM23003_IMSI_MAX_DIGITS); +} + +/*! Determine whether the given MSISDN is valid according to 3GPP TS 23.003. + * \param msisdn MSISDN digits in ASCII string representation. + * \returns true when the MSISDN is valid, false for invalid characters or number + * of digits. + */ +bool osmo_msisdn_str_valid(const char *msisdn) +{ + return is_n_digits(msisdn, 1, 15); +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 066f410..95b2ca9 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -418,5 +418,8 @@ osmo_oap_encode; osmo_oap_decode; +osmo_imsi_str_valid; +osmo_msisdn_str_valid; + local: *; }; diff --git a/tests/Makefile.am b/tests/Makefile.am index b138717..dbe349f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test prbs/prbs_test + stats/stats_test prbs/prbs_test gsm23003/gsm23003_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -186,6 +186,9 @@ prbs_prbs_test_SOURCES = prbs/prbs_test.c prbs_prbs_test_LDADD = $(top_builddir)/src/libosmocore.la +gsm23003_gsm23003_test_SOURCES = gsm23003/gsm23003_test.c +gsm23003_gsm23003_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -241,7 +244,8 @@ osmo-auc-gen/osmo-auc-gen_test.ok \ osmo-auc-gen/osmo-auc-gen_test.err \ conv/conv_gsm0503_test.ok endian/endian_test.ok \ - sercomm/sercomm_test.ok prbs/prbs_test.ok + sercomm/sercomm_test.ok prbs/prbs_test.ok \ + gsm23003/gsm23003_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/gsm23003/gsm23003_test.c b/tests/gsm23003/gsm23003_test.c new file mode 100644 index 0000000..682f162 --- /dev/null +++ b/tests/gsm23003/gsm23003_test.c @@ -0,0 +1,124 @@ +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +#define BOOL_STR(b) ((b)? "true" : "false") + +static struct { + const char *imsi; + bool expect_ok; +} test_imsis[] = { + { "", false }, + { " ", false }, + { "1", false }, + { "123", false }, + { "12345", false }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_imsi() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_imsis); i++) { + ok = osmo_imsi_str_valid(test_imsis[i].imsi); + pass = pass && (ok == test_imsis[i].expect_ok); + printf("%2d: expect=%s result=%s imsi='%s'\n", + i, BOOL_STR(test_imsis[i].expect_ok), BOOL_STR(ok), + test_imsis[i].imsi); + } + return pass; +} + +static struct { + const char *msisdn; + bool expect_ok; +} test_msisdns[] = { + { "", false }, + { " ", false }, + { "1", true }, + { "123", true }, + { "12345", true }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_msisdn() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_msisdns); i++) { + ok = osmo_msisdn_str_valid(test_msisdns[i].msisdn); + pass = pass && (ok == test_msisdns[i].expect_ok); + printf("%2d: expect=%s result=%s msisdn='%s'\n", + i, BOOL_STR(test_msisdns[i].expect_ok), BOOL_STR(ok), + test_msisdns[i].msisdn); + } + return pass; +} + +int main(int argc, char **argv) +{ + bool pass = true; + + pass = pass && test_valid_imsi(); + pass = pass && test_valid_msisdn(); + + OSMO_ASSERT(pass); + + return EXIT_SUCCESS; +} diff --git a/tests/gsm23003/gsm23003_test.ok b/tests/gsm23003/gsm23003_test.ok new file mode 100644 index 0000000..777451a --- /dev/null +++ b/tests/gsm23003/gsm23003_test.ok @@ -0,0 +1,42 @@ +----- test_valid_imsi + 0: expect=false result=false imsi='' + 1: expect=false result=false imsi=' ' + 2: expect=false result=false imsi='1' + 3: expect=false result=false imsi='123' + 4: expect=false result=false imsi='12345' + 5: expect=true result=true imsi='123456' + 6: expect=true result=true imsi='1234567' + 7: expect=true result=true imsi='1234567890123' + 8: expect=true result=true imsi='123456789012345' + 9: expect=true result=true imsi='000000000000000' +10: expect=true result=true imsi='999999999999999' +11: expect=false result=false imsi='1234567890123456' +12: expect=false result=false imsi='a23456789012345' +13: expect=false result=false imsi='1234567b9012345' +14: expect=false result=false imsi='12345678901234c' +15: expect=false result=false imsi='123456789 01234' +16: expect=false result=false imsi='1234567 +123456' +17: expect=false result=false imsi='123456 123456' +18: expect=false result=false imsi='123456 123456' +----- test_valid_msisdn + 0: expect=false result=false msisdn='' + 1: expect=false result=false msisdn=' ' + 2: expect=true result=true msisdn='1' + 3: expect=true result=true msisdn='123' + 4: expect=true result=true msisdn='12345' + 5: expect=true result=true msisdn='123456' + 6: expect=true result=true msisdn='1234567' + 7: expect=true result=true msisdn='1234567890123' + 8: expect=true result=true msisdn='123456789012345' + 9: expect=true result=true msisdn='000000000000000' +10: expect=true result=true msisdn='999999999999999' +11: expect=false result=false msisdn='1234567890123456' +12: expect=false result=false msisdn='a23456789012345' +13: expect=false result=false msisdn='1234567b9012345' +14: expect=false result=false msisdn='12345678901234c' +15: expect=false result=false msisdn='123456789 01234' +16: expect=false result=false msisdn='1234567 +123456' +17: expect=false result=false msisdn='123456 123456' +18: expect=false result=false msisdn='123456 123456' diff --git a/tests/testsuite.at b/tests/testsuite.at index 1954e66..483860f 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -287,3 +287,9 @@ cat $abs_srcdir/prbs/prbs_test.ok > expout AT_CHECK([$abs_top_builddir/tests/prbs/prbs_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([gsm23003]) +AT_KEYWORDS([gsm23003]) +cat $abs_srcdir/gsm23003/gsm23003_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gsm23003/gsm23003_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 6 00:45:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 00:45:25 +0000 Subject: libosmocore[master]: Add function to generate random identifier In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 6 00:46:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 00:46:25 +0000 Subject: libosmocore[master]: add osmo_imsi_str_valid() and osmo_msisdn_str_valid() In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 6 00:46:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 00:46:58 +0000 Subject: osmo-bsc[master]: add ';' after OSMO_ASSERT() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If6dce81faee9177737a6e1b572a871aaf7e37138 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 6 00:47:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 00:47:01 +0000 Subject: osmo-msc[master]: add ';' after OSMO_ASSERT() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4143 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic79c8b8f98a7f3bef761751d55a7e6125cf2c46d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 6 00:49:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 00:49:25 +0000 Subject: osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4147/1/include/osmocom/mgcp_client/mgcp_client.h File include/osmocom/mgcp_client/mgcp_client.h: Line 39: uint32_t audio_ip; I think for years in most places in osmocom code, we started to represent IP addresses as "char *host" instead, in order to not introduce further IPv6 incompatibilities. So even if the current parser can only deal with parsing an IPv4 address in the MGCP messsage, the library APIs (and hence applications) could already be written independent of the specific address family. -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 6 01:02:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 01:02:08 +0000 Subject: osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Patch Set 1: (5 comments) https://gerrit.osmocom.org/#/c/4146/1/include/osmocom/mgcp_client/mgcp_client.h File include/osmocom/mgcp_client/mgcp_client.h: PS1, Line 49: MSG_T msg_t typically referst to "message type", which it isn't. What about MGCP_MSG_PRES_... ? or MGCP_MGS_PAR_... ? https://gerrit.osmocom.org/#/c/4146/1/src/libosmo-mgcp-client/mgcp_client.c File src/libosmo-mgcp-client/mgcp_client.c: Line 572: /* Deprecated, please use mgcp_msg_gen() instead */ We do have a way to annotate our functions as deprecated that will lead to compiler warnings when code uses them. See OSMO_DEPRECATED Line 631: static char compose[4096 - 128]; where do these magic numbers come from? how are we sure we don't overflow them? Line 639: switch (mgcp_msg->verb) { this could be a 'const' table in the code rather than an open-coded select in the code, but don't bother changing it, just maybe as an idea you run into this kind of problem next time. Line 671: sprintf(compose + strlen(compose), " %s", mgcp_msg->endpoint); so we have a long series of "sprintf(compose + strlen(compose)" statements here, and in the end we generate a msgb from it. This means we have dozens of calls to strlen(), we have a buffer on the stack and we don't really check whether we overflow that buffer or not. What about instead doing this in the msgb itself? I.e. first allocate the msgb, and then have msgb_append_str() or msgb_append_sprintf() or the like. That function then will use msgb_put() which in turn ensures sufficient tailroom. The msgb will also keep track of what was the last byte written (offset) so we avoid all the strlen() calls. In summary, we get safer code and possibly even faster code (performance is not key here, the safety aspect is what I care). Alternatively, there's talloc_asprintf_append() which is a safe method of appending a format-printed string to an existing string buffer. However, that's of course on the heap and each call might likely re-allocate the underliyng buffer, so we'd have a dozen or so dynamic memory allocations in this function. Probably not as fast, but also safe. -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 6 01:53:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 01:53:15 +0000 Subject: osmo-ci[master]: Add osmo-iuh to nightly .deb builds In-Reply-To: References: Message-ID: Patch Set 1: this will not work and will acutally break the build (further) unless you create the respective osmo-iuh package in OBS. https://build.opensuse.org/project/show/network:osmocom:nightly doesn't list it. You need to "copypac" it. -- To view, visit https://gerrit.osmocom.org/4141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ief40137cc94e2c54da8c12e2a00953834a578171 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 6 01:55:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 01:55:06 +0000 Subject: osmo-ci[master]: Add osmo-iuh to nightly .deb builds In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 > this will not work and will acutally break the build (further) > unless you create the respective osmo-iuh package in OBS. > https://build.opensuse.org/project/show/network:osmocom:nightly > doesn't list it. You need to "copypac" it. > this will not work and will acutally break the build (further) > unless you create the respective osmo-iuh package in OBS. > https://build.opensuse.org/project/show/network:osmocom:nightly > doesn't list it. You need to "copypac" it. > this will not work and will acutally break the build (further) > unless you create the respective osmo-iuh package in OBS. > https://build.opensuse.org/project/show/network:osmocom:nightly > doesn't list it. You need to "copypac" it. I just executed "osc copypac network:osmocom:nitb-split:nightly osmo-iuh network:osmocom:nightly" -- To view, visit https://gerrit.osmocom.org/4141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ief40137cc94e2c54da8c12e2a00953834a578171 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 6 01:55:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 01:55:09 +0000 Subject: osmo-ci[master]: Add osmo-iuh to nightly .deb builds In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ief40137cc94e2c54da8c12e2a00953834a578171 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 6 01:55:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 01:55:11 +0000 Subject: [MERGED] osmo-ci[master]: Add osmo-iuh to nightly .deb builds In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add osmo-iuh to nightly .deb builds ...................................................................... Add osmo-iuh to nightly .deb builds It produces libosmo-ranap-dev which is required by osmo-sgsn. Change-Id: Ief40137cc94e2c54da8c12e2a00953834a578171 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 432e7a1..fd9b2b2 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -14,6 +14,7 @@ git clone git://git.osmocom.org/libosmo-abis git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 +git clone git://git.osmocom.org/osmo-iuh git clone git://git.osmocom.org/osmo-sgsn git clone git://git.osmocom.org/osmo-ggsn git clone git://git.osmocom.org/openbsc @@ -51,6 +52,7 @@ build libosmo-abis build libosmo-netif build libsmpp34 +build osmo-iuh build osmo-ggsn build osmo-sgsn build openbsc -- To view, visit https://gerrit.osmocom.org/4141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ief40137cc94e2c54da8c12e2a00953834a578171 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From admin at opensuse.org Fri Oct 6 02:02:48 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 06 Oct 2017 02:02:48 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59d6e44b1ab50_58e2dcaf7833875d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/x86_64 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 230s] | [ 230s] | This file was extended by libosmocore config.status 0.9.6.20171006, which was [ 230s] | generated by GNU Autoconf 2.69. Invocation command line was [ 230s] | [ 230s] | CONFIG_FILES = [ 230s] | CONFIG_HEADERS = [ 230s] | CONFIG_LINKS = [ 230s] | CONFIG_COMMANDS = [ 230s] | $ ./config.status Doxyfile.core [ 230s] | [ 230s] | on build35 [ 230s] | [ 230s] | config.status:1173: creating Doxyfile.core [ 230s] [ 230s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 230s] make[1]: *** [override_dh_auto_test] Error 1 [ 230s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 230s] debian/rules:15: recipe for target 'build' failed [ 230s] make: *** [build] Error 2 [ 230s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 230s] [ 230s] build35 failed "build libosmocore_0.9.6.20171006.dsc" at Fri Oct 6 02:02:36 UTC 2017. [ 230s] [ 230s] ### VM INTERACTION START ### [ 233s] [ 221.021590] reboot: Power down [ 234s] ### VM INTERACTION END ### [ 234s] [ 235s] build35 failed "build libosmocore_0.9.6.20171006.dsc" at Fri Oct 6 02:02:43 UTC 2017. [ 235s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Oct 6 02:04:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 02:04:09 +0000 Subject: [PATCH] osmo-ci[master]: osmocom-nightly-packages.sh: Add libasn1c required by osmo-iuh Message-ID: Review at https://gerrit.osmocom.org/4148 osmocom-nightly-packages.sh: Add libasn1c required by osmo-iuh Change-Id: Ia455655eaf53faeab6c3049a54c153cb9ddd3d37 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/48/4148/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index fd9b2b2..69f020c 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -14,6 +14,7 @@ git clone git://git.osmocom.org/libosmo-abis git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 +git clone git://git.osmocom.org/libasn1c git clone git://git.osmocom.org/osmo-iuh git clone git://git.osmocom.org/osmo-sgsn git clone git://git.osmocom.org/osmo-ggsn @@ -52,6 +53,7 @@ build libosmo-abis build libosmo-netif build libsmpp34 +build libasn1c build osmo-iuh build osmo-ggsn build osmo-sgsn -- To view, visit https://gerrit.osmocom.org/4148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia455655eaf53faeab6c3049a54c153cb9ddd3d37 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From admin at opensuse.org Fri Oct 6 02:03:56 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 06 Oct 2017 02:03:56 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59d6e4a5b5d3a_58e2dcaf783390a5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 287s] | [ 287s] | This file was extended by libosmocore config.status 0.9.6.20171006, which was [ 287s] | generated by GNU Autoconf 2.69. Invocation command line was [ 287s] | [ 287s] | CONFIG_FILES = [ 287s] | CONFIG_HEADERS = [ 287s] | CONFIG_LINKS = [ 287s] | CONFIG_COMMANDS = [ 287s] | $ ./config.status Doxyfile.core [ 287s] | [ 287s] | on build31 [ 287s] | [ 287s] | config.status:1173: creating Doxyfile.core [ 287s] [ 287s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 287s] make[1]: *** [override_dh_auto_test] Error 1 [ 287s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 287s] debian/rules:15: recipe for target 'build' failed [ 287s] make: *** [build] Error 2 [ 287s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 287s] [ 287s] build31 failed "build libosmocore_0.9.6.20171006.dsc" at Fri Oct 6 02:03:34 UTC 2017. [ 287s] [ 287s] ### VM INTERACTION START ### [ 290s] [ 265.450239] reboot: Power down [ 292s] ### VM INTERACTION END ### [ 293s] [ 293s] build31 failed "build libosmocore_0.9.6.20171006.dsc" at Fri Oct 6 02:03:40 UTC 2017. [ 293s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Oct 6 02:14:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 02:14:11 +0000 Subject: [PATCH] osmo-ci[master]: osmocom:nitb-split:nightly Re-introduce osmo-sgsn + osmo-ggsn Message-ID: Review at https://gerrit.osmocom.org/4149 osmocom:nitb-split:nightly Re-introduce osmo-sgsn + osmo-ggsn For some strange reason, in commit 8e9fe0808072d3f5eca8b4c6fac9865a52c9beb3, the osmocom:nitb-split:nightly package feed was rendered to use old packages for sgsn+ggsn, rather than current ones by removing the "osc upload" from this script, but still leaving the packages in OBS at https://build.opensuse.org/project/show/network:osmocom:nitb-split:nightly Removing them half (only in osmo-ci but not at OBS) is a bad idea, as it leaves people with old packages who actually want to use nightly builds. Also, removing the packages in general is a very bad idea. People are *either* using osmocom:nightly, *or* they are using the osmocom:nitb-split:nightly feed, but not both. So we cannot remove any packages from the osmocom:nitb-split:nightly feed until we have introduced all those packages to osmocom:nightly *and* we have given people sufficient notice to update! Change-Id: I5c091127d92a4b4beb7355e16abd9788fa3b9fe5 --- M scripts/osmocom-nightly-nitb-split.sh 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/49/4149/1 diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh index 4484214..3b547bf 100755 --- a/scripts/osmocom-nightly-nitb-split.sh +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -90,9 +90,11 @@ checkout libasn1c checkout osmo-iuh checkout osmo-hlr + checkout osmo-ggsn checkout osmo-mgw checkout osmo-bsc checkout osmo-msc + checkout osmo-sgsn build libosmocore build libosmo-abis @@ -102,9 +104,11 @@ build libasn1c build osmo-iuh build osmo-hlr + build osmo-ggsn build osmo-mgw build osmo-bsc build osmo-msc + build osmo-sgsn post } -- To view, visit https://gerrit.osmocom.org/4149 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c091127d92a4b4beb7355e16abd9788fa3b9fe5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 6 02:15:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 02:15:00 +0000 Subject: osmo-ci[master]: osmocom:nitb-split:nightly Re-introduce osmo-sgsn + osmo-ggsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4149 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c091127d92a4b4beb7355e16abd9788fa3b9fe5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 6 02:15:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 02:15:26 +0000 Subject: osmo-ci[master]: osmocom-nightly-packages.sh: Add libasn1c required by osmo-iuh In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia455655eaf53faeab6c3049a54c153cb9ddd3d37 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 6 02:15:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 02:15:30 +0000 Subject: [MERGED] osmo-ci[master]: osmocom-nightly-packages.sh: Add libasn1c required by osmo-iuh In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmocom-nightly-packages.sh: Add libasn1c required by osmo-iuh ...................................................................... osmocom-nightly-packages.sh: Add libasn1c required by osmo-iuh Change-Id: Ia455655eaf53faeab6c3049a54c153cb9ddd3d37 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index fd9b2b2..69f020c 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -14,6 +14,7 @@ git clone git://git.osmocom.org/libosmo-abis git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 +git clone git://git.osmocom.org/libasn1c git clone git://git.osmocom.org/osmo-iuh git clone git://git.osmocom.org/osmo-sgsn git clone git://git.osmocom.org/osmo-ggsn @@ -52,6 +53,7 @@ build libosmo-abis build libosmo-netif build libsmpp34 +build libasn1c build osmo-iuh build osmo-ggsn build osmo-sgsn -- To view, visit https://gerrit.osmocom.org/4148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia455655eaf53faeab6c3049a54c153cb9ddd3d37 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 6 02:15:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Oct 2017 02:15:30 +0000 Subject: [MERGED] osmo-ci[master]: osmocom:nitb-split:nightly Re-introduce osmo-sgsn + osmo-ggsn In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmocom:nitb-split:nightly Re-introduce osmo-sgsn + osmo-ggsn ...................................................................... osmocom:nitb-split:nightly Re-introduce osmo-sgsn + osmo-ggsn For some strange reason, in commit 8e9fe0808072d3f5eca8b4c6fac9865a52c9beb3, the osmocom:nitb-split:nightly package feed was rendered to use old packages for sgsn+ggsn, rather than current ones by removing the "osc upload" from this script, but still leaving the packages in OBS at https://build.opensuse.org/project/show/network:osmocom:nitb-split:nightly Removing them half (only in osmo-ci but not at OBS) is a bad idea, as it leaves people with old packages who actually want to use nightly builds. Also, removing the packages in general is a very bad idea. People are *either* using osmocom:nightly, *or* they are using the osmocom:nitb-split:nightly feed, but not both. So we cannot remove any packages from the osmocom:nitb-split:nightly feed until we have introduced all those packages to osmocom:nightly *and* we have given people sufficient notice to update! Change-Id: I5c091127d92a4b4beb7355e16abd9788fa3b9fe5 --- M scripts/osmocom-nightly-nitb-split.sh 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh index 4484214..3b547bf 100755 --- a/scripts/osmocom-nightly-nitb-split.sh +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -90,9 +90,11 @@ checkout libasn1c checkout osmo-iuh checkout osmo-hlr + checkout osmo-ggsn checkout osmo-mgw checkout osmo-bsc checkout osmo-msc + checkout osmo-sgsn build libosmocore build libosmo-abis @@ -102,9 +104,11 @@ build libasn1c build osmo-iuh build osmo-hlr + build osmo-ggsn build osmo-mgw build osmo-bsc build osmo-msc + build osmo-sgsn post } -- To view, visit https://gerrit.osmocom.org/4149 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c091127d92a4b4beb7355e16abd9788fa3b9fe5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 6 10:07:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Oct 2017 10:07:50 +0000 Subject: osmo-gsm-tester[master]: modem: reset cancellable after cancelling dbus methods In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Merging as it fixes cancellation of all dbus async Scan() methods. It was tested for a while in jenkins jobs running in prod and the output in logs is good now. -- To view, visit https://gerrit.osmocom.org/4145 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7392275620576fd0037be5b9d9f360a46a4f8312 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 6 10:08:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Oct 2017 10:08:00 +0000 Subject: [MERGED] osmo-gsm-tester[master]: modem: reset cancellable after cancelling dbus methods In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: modem: reset cancellable after cancelling dbus methods ...................................................................... modem: reset cancellable after cancelling dbus methods I first wanted to use "reset" method, but according to [1]: "The recommended practice is to drop the reference to a cancellable after cancelling it, and let it die with the outstanding async operations. You should create a fresh cancellable for further async operations." Pretty weird that in other parts of documentation it still says that it can be used for concurrent events. [1] https://developer.gnome.org/gio/2.54/GCancellable.html#g-cancellable-reset Change-Id: I7392275620576fd0037be5b9d9f360a46a4f8312 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 30e2b55..e301ed6 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -502,6 +502,8 @@ # Cancel op is applied as a signal coming from glib mainloop, so we # need to run it and wait for the callbacks to handle cancellations. poll_glib() + # once it has been triggered, create a new one for next operation: + self.cancellable = Gio.Cancellable.new() def power_cycle(self): 'Power the modem and put it online, power cycle it if it was already on' -- To view, visit https://gerrit.osmocom.org/4145 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7392275620576fd0037be5b9d9f360a46a4f8312 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 6 11:57:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 6 Oct 2017 11:57:18 +0000 Subject: [PATCH] libosmocore[master]: Add function to generate random identifier In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1526 to look at the new patch set (#9). Add function to generate random identifier The function is a wrapper on top of getrandom() (if available via glibc) or corresponding syscall. If neither is available than failure is always returned. It's intended to generate small random data good enough for session identifiers and keys. To generate long-term cryptographic keys it's better to use special crypto libraries (like GnuTLS for example) instead. As an example it's used to replace old insecure random number generator in osmo-auc-gen utility. Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Related: OS#1694 --- M configure.ac M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map M utils/osmo-auc-gen.c 5 files changed, 60 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/1526/9 diff --git a/configure.ac b/configure.ac index 33c151e..d9390cf 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,9 @@ AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") +# check for syscal fallback on glibc < 2.25 - can be removed once glibc version requirement is bumped +AC_CHECK_DECLS([SYS_getrandom], [], [], [[#include ]]) + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index bfcef08..83e29ca 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -38,6 +38,9 @@ #define GSM_MAX_FN (26*51*2048) +/* Max length of random identifier which can be requested via osmo_get_rand_id() */ +#define OSMO_MAX_RAND_ID_LEN 16 + struct gsm_time { uint32_t fn; /* FN count */ uint16_t t1; /* FN div (26*51) */ @@ -60,6 +63,8 @@ const char *gsm_band_name(enum gsm_band band); enum gsm_band gsm_band_parse(const char *mhz); +int osmo_get_rand_id(uint8_t *out, size_t len); + /*! * Decode a sequence of GSM 03.38 encoded 7 bit characters. * diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 477f076..0aa7863 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -91,6 +91,12 @@ #include #include #include +#include +#include + +#include +/* FIXME: this can be removed once we bump glibc requirements to 2.25: */ +#include #include "../../config.h" @@ -387,6 +393,45 @@ return y; } +/*! Generate random identifier + * We use /dev/urandom (default when GRND_RANDOM flag is not set). + * Both /dev/(u)random numbers are coming from the same CSPRNG anyway (at least on GNU/Linux >= 4.8). + * See also RFC4086. + * \param[out] out Buffer to be filled with random data + * \param[in] len Number of random bytes required + * \returns 0 on success, or a negative error code on error. + */ +int osmo_get_rand_id(uint8_t *out, size_t len) +{ + int rc; + + /* this function is intended for generating short identifiers only, not arbitrary-length random data */ + if (len > OSMO_MAX_RAND_ID_LEN) + return -E2BIG; + +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) + rc = getrandom(out, len, GRND_NONBLOCK); +#elif HAVE_DECL_SYS_GETRANDOM +#pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") + /* FIXME: this can be removed once we bump glibc requirements to 2.25: */ + rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK); +#else +#pragma message ("Secure random unavailable: calls to osmo_get_rand_id() will always fail!") + return -ENOTSUP; +#endif + /* getrandom() failed entirely: */ + if (rc < 0) + return -errno; + + /* getrandom() failed partially due to signal interruption: + this should never happen (according to getrandom(2)) as long as OSMO_MAX_RAND_ID_LEN < 256 + because we do not set GRND_RANDOM but it's better to be paranoid and check anyway */ + if (rc != len) + return -EAGAIN; + + return 0; +} + /*! Build the RSL uplink measurement IE (3GPP TS 08.58 ? 9.3.25) * \param[in] mru Unidirectional measurement report structure * \param[in] dtxd_used Indicates if DTXd was used during measurement report diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 066f410..7a98201 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -39,6 +39,7 @@ osmo_sitype_strs; osmo_c4; +osmo_get_rand_id; bitvec_add_range1024; comp128; comp128v2; diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 1f5c838..9d1215c 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -34,6 +34,7 @@ #include #include +#include static void dump_triplets_dat(struct osmo_auth_vector *vec) { @@ -247,14 +248,11 @@ } if (!rand_is_set) { - int i; - printf("WARNING: We're using really weak random numbers!\n\n"); - srand(time(NULL)); - - for (i = 0; i < 4; ++i) { - uint32_t r; - r = rand(); - memcpy(&_rand[i*4], &r, 4); + rc = osmo_get_rand_id(_rand, 16); + if (rc < 0) { + fprintf(stderr, "\nError: unable to obtain secure random numbers: %s!\n", + strerror(-rc)); + exit(3); } } -- To view, visit https://gerrit.osmocom.org/1526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Fri Oct 6 12:26:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 6 Oct 2017 12:26:28 +0000 Subject: [PATCH] libosmocore[master]: Add function to generate random identifier In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1526 to look at the new patch set (#10). Add function to generate random identifier The function is a wrapper on top of getrandom() (if available via glibc) or corresponding syscall. If neither is available than failure is always returned. It's intended to generate small random data good enough for session identifiers and keys. To generate long-term cryptographic keys it's better to use special crypto libraries (like GnuTLS for example) instead. As an example it's used to replace old insecure random number generator in osmo-auc-gen utility. Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Related: OS#1694 --- M configure.ac M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map M utils/osmo-auc-gen.c 5 files changed, 67 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/1526/10 diff --git a/configure.ac b/configure.ac index 33c151e..d9390cf 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,9 @@ AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") +# check for syscal fallback on glibc < 2.25 - can be removed once glibc version requirement is bumped +AC_CHECK_DECLS([SYS_getrandom], [], [], [[#include ]]) + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index bfcef08..83e29ca 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -38,6 +38,9 @@ #define GSM_MAX_FN (26*51*2048) +/* Max length of random identifier which can be requested via osmo_get_rand_id() */ +#define OSMO_MAX_RAND_ID_LEN 16 + struct gsm_time { uint32_t fn; /* FN count */ uint16_t t1; /* FN div (26*51) */ @@ -60,6 +63,8 @@ const char *gsm_band_name(enum gsm_band band); enum gsm_band gsm_band_parse(const char *mhz); +int osmo_get_rand_id(uint8_t *out, size_t len); + /*! * Decode a sequence of GSM 03.38 encoded 7 bit characters. * diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 477f076..8e93a3b 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -91,6 +91,19 @@ #include #include #include +#include +#include + +/* FIXME: this check be removed once we bump glibc requirements to 2.25: */ +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) +#include +#endif + +/* FIXME: this can be removed once we bump glibc requirements to 2.25: */ +#include +#ifndef GRND_NONBLOCK +#define GRND_NONBLOCK 0x0001 +#endif #include "../../config.h" @@ -387,6 +400,45 @@ return y; } +/*! Generate random identifier + * We use /dev/urandom (default when GRND_RANDOM flag is not set). + * Both /dev/(u)random numbers are coming from the same CSPRNG anyway (at least on GNU/Linux >= 4.8). + * See also RFC4086. + * \param[out] out Buffer to be filled with random data + * \param[in] len Number of random bytes required + * \returns 0 on success, or a negative error code on error. + */ +int osmo_get_rand_id(uint8_t *out, size_t len) +{ + int rc; + + /* this function is intended for generating short identifiers only, not arbitrary-length random data */ + if (len > OSMO_MAX_RAND_ID_LEN) + return -E2BIG; + +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) + rc = getrandom(out, len, GRND_NONBLOCK); +#elif HAVE_DECL_SYS_GETRANDOM +#pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") + /* FIXME: this can be removed once we bump glibc requirements to 2.25: */ + rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK); +#else +#pragma message ("Secure random unavailable: calls to osmo_get_rand_id() will always fail!") + return -ENOTSUP; +#endif + /* getrandom() failed entirely: */ + if (rc < 0) + return -errno; + + /* getrandom() failed partially due to signal interruption: + this should never happen (according to getrandom(2)) as long as OSMO_MAX_RAND_ID_LEN < 256 + because we do not set GRND_RANDOM but it's better to be paranoid and check anyway */ + if (rc != len) + return -EAGAIN; + + return 0; +} + /*! Build the RSL uplink measurement IE (3GPP TS 08.58 ? 9.3.25) * \param[in] mru Unidirectional measurement report structure * \param[in] dtxd_used Indicates if DTXd was used during measurement report diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 066f410..7a98201 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -39,6 +39,7 @@ osmo_sitype_strs; osmo_c4; +osmo_get_rand_id; bitvec_add_range1024; comp128; comp128v2; diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 1f5c838..9d1215c 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -34,6 +34,7 @@ #include #include +#include static void dump_triplets_dat(struct osmo_auth_vector *vec) { @@ -247,14 +248,11 @@ } if (!rand_is_set) { - int i; - printf("WARNING: We're using really weak random numbers!\n\n"); - srand(time(NULL)); - - for (i = 0; i < 4; ++i) { - uint32_t r; - r = rand(); - memcpy(&_rand[i*4], &r, 4); + rc = osmo_get_rand_id(_rand, 16); + if (rc < 0) { + fprintf(stderr, "\nError: unable to obtain secure random numbers: %s!\n", + strerror(-rc)); + exit(3); } } -- To view, visit https://gerrit.osmocom.org/1526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Gerrit-PatchSet: 10 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Fri Oct 6 12:45:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 6 Oct 2017 12:45:43 +0000 Subject: [PATCH] libosmocore[master]: Add function to generate random identifier In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1526 to look at the new patch set (#12). Add function to generate random identifier The function is a wrapper on top of getrandom() (if available via glibc) or corresponding syscall. If neither is available than failure is always returned. It's intended to generate small random data good enough for session identifiers and keys. To generate long-term cryptographic keys it's better to use special crypto libraries (like GnuTLS for example) instead. As an example it's used to replace old insecure random number generator in osmo-auc-gen utility. Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Related: OS#1694 --- M configure.ac M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map M utils/osmo-auc-gen.c 5 files changed, 63 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/1526/12 diff --git a/configure.ac b/configure.ac index 33c151e..d9390cf 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,9 @@ AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") +# check for syscal fallback on glibc < 2.25 - can be removed once glibc version requirement is bumped +AC_CHECK_DECLS([SYS_getrandom], [], [], [[#include ]]) + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index bfcef08..83e29ca 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -38,6 +38,9 @@ #define GSM_MAX_FN (26*51*2048) +/* Max length of random identifier which can be requested via osmo_get_rand_id() */ +#define OSMO_MAX_RAND_ID_LEN 16 + struct gsm_time { uint32_t fn; /* FN count */ uint16_t t1; /* FN div (26*51) */ @@ -60,6 +63,8 @@ const char *gsm_band_name(enum gsm_band band); enum gsm_band gsm_band_parse(const char *mhz); +int osmo_get_rand_id(uint8_t *out, size_t len); + /*! * Decode a sequence of GSM 03.38 encoded 7 bit characters. * diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 477f076..f572c64 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -91,8 +91,17 @@ #include #include #include +#include +#include #include "../../config.h" + +/* FIXME: this can be removed once we bump glibc requirements to 2.25: */ +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) +#include +#elif HAVE_DECL_SYS_GETRANDOM +#include +#endif /* ETSI GSM 03.38 6.2.1 and 6.2.1.1 default alphabet * Greek symbols at hex positions 0x10 and 0x12-0x1a @@ -387,6 +396,45 @@ return y; } +/*! Generate random identifier + * We use /dev/urandom (default when GRND_RANDOM flag is not set). + * Both /dev/(u)random numbers are coming from the same CSPRNG anyway (at least on GNU/Linux >= 4.8). + * See also RFC4086. + * \param[out] out Buffer to be filled with random data + * \param[in] len Number of random bytes required + * \returns 0 on success, or a negative error code on error. + */ +int osmo_get_rand_id(uint8_t *out, size_t len) +{ + int rc; + + /* this function is intended for generating short identifiers only, not arbitrary-length random data */ + if (len > OSMO_MAX_RAND_ID_LEN) + return -E2BIG; + +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) + rc = getrandom(out, len, GRND_NONBLOCK); +#elif HAVE_DECL_SYS_GETRANDOM +#pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") + /* FIXME: this can be removed once we bump glibc requirements to 2.25: */ + rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK); +#else +#pragma message ("Secure random unavailable: calls to osmo_get_rand_id() will always fail!") + return -ENOTSUP; +#endif + /* getrandom() failed entirely: */ + if (rc < 0) + return -errno; + + /* getrandom() failed partially due to signal interruption: + this should never happen (according to getrandom(2)) as long as OSMO_MAX_RAND_ID_LEN < 256 + because we do not set GRND_RANDOM but it's better to be paranoid and check anyway */ + if (rc != len) + return -EAGAIN; + + return 0; +} + /*! Build the RSL uplink measurement IE (3GPP TS 08.58 ? 9.3.25) * \param[in] mru Unidirectional measurement report structure * \param[in] dtxd_used Indicates if DTXd was used during measurement report diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 066f410..7a98201 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -39,6 +39,7 @@ osmo_sitype_strs; osmo_c4; +osmo_get_rand_id; bitvec_add_range1024; comp128; comp128v2; diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 1f5c838..9d1215c 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -34,6 +34,7 @@ #include #include +#include static void dump_triplets_dat(struct osmo_auth_vector *vec) { @@ -247,14 +248,11 @@ } if (!rand_is_set) { - int i; - printf("WARNING: We're using really weak random numbers!\n\n"); - srand(time(NULL)); - - for (i = 0; i < 4; ++i) { - uint32_t r; - r = rand(); - memcpy(&_rand[i*4], &r, 4); + rc = osmo_get_rand_id(_rand, 16); + if (rc < 0) { + fprintf(stderr, "\nError: unable to obtain secure random numbers: %s!\n", + strerror(-rc)); + exit(3); } } -- To view, visit https://gerrit.osmocom.org/1526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Gerrit-PatchSet: 12 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Fri Oct 6 13:58:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 6 Oct 2017 13:58:54 +0000 Subject: osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Patch Set 1: (11 comments) https://gerrit.osmocom.org/#/c/4146/1/include/osmocom/mgcp_client/mgcp_client.h File include/osmocom/mgcp_client/mgcp_client.h: PS1, Line 49: MSG_T > msg_t typically referst to "message type", which it isn't. What about MGCP (I like MGCP_MSG_PRESENCE_*) Line 60: uint32_t presence; (and a comment here "see MGCP_MSG_PRESENCE_*") Line 61: char endpoint[MGCP_EINDPOINT_MAXLEN]; "EIND" -> "END" Line 64: struct sockaddr_storage rtp_addr; Would it be less complex to store the address as a string? Then we can leave sockaddr complexities out of message composition / parsing, sticking to plain string tokens ... would this bring up other problems? Line 97: enum mgcp_connection_mode mode); void foo(...) OSMO_DEPRECATED("Use bar() instead"); https://gerrit.osmocom.org/#/c/4146/1/src/libosmo-mgcp-client/mgcp_client.c File src/libosmo-mgcp-client/mgcp_client.c: Line 631: static char compose[4096 - 128]; > where do these magic numbers come from? how are we sure we don't overflow t 4kb less headroom, right? :) Line 662: return NULL; log an error? Line 665: /* Check if mandatory fiels are missing */ ("fields") Line 667: return NULL; log an error? Line 671: sprintf(compose + strlen(compose), " %s", mgcp_msg->endpoint); > so we have a long series of "sprintf(compose + strlen(compose)" statements I agree that we need more safety here. The implementation is not trivial. I agree that a kind of msgb_printf() utility function would be useful to cover everything generically. A difficulty though is that e.g. for printf("C: %x\r\n", call_id) we don't know in advance how much length to request from msgb_put(). A way would be to use snprintf, limiting printed chars by the size parameter, and using the return val of snprintf, to obtain the nr of chars written. i.e. obtain from the msgb the remaining tail room and where the next string goes, feed those to snprintf(), then tell msgb_put() the returned length after snprintf() is completed. We also need to detect a situation where we have hit the end of the buffer (when the len returned by snprintf() is > the remaining buffer length), log an error and return NULL. Every time we append to the buf. https://gerrit.osmocom.org/#/c/4146/1/tests/mgcp_client/mgcp_client_test.c File tests/mgcp_client/mgcp_client_test.c: Line 213: msgb_free(msg); (also add tests that hit the buffer size limits) -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 6 14:33:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 6 Oct 2017 14:33:18 +0000 Subject: osmo-mgw[master]: drop code dup between libosmo-mgcp-client and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 re-add previous +2 -- To view, visit https://gerrit.osmocom.org/4055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 6 14:33:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 6 Oct 2017 14:33:20 +0000 Subject: [MERGED] osmo-mgw[master]: drop code dup between libosmo-mgcp-client and libosmo-mgcp In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: drop code dup between libosmo-mgcp-client and libosmo-mgcp ...................................................................... drop code dup between libosmo-mgcp-client and libosmo-mgcp Remove mgcp_common.c and replace with mgcp_common.h. Move mgcp_common.h from mgcp_client/ to mgcp/; Place a compile-time copy of it back in mgcp_client/. Add builddir/include to compiler -I paths to find generated header. Rationale: - Keep separate copies of the file for each of the library to not require debian dependencies between the two libraries. - Avoid code dup by copying during 'make' (think: a generated header, BUILT_SOURCE). - The copy does not have implications for linking (like mgcp_common.c did) nor is it a source for build confusion or fallout in other projects, because it does not reach across several git source trees (like gsm_data_shared.h did). mgcp_connection_mode_strs are not actually used in libosmo-mgcp, so drop them. (It would make semantic sense to have then in mgcp, but we can add it when it is needed. A similar value string array remains in libosmo-mgcp-client.) Change-Id: I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 --- M include/Makefile.am M include/osmocom/mgcp/mgcp.h R include/osmocom/mgcp/mgcp_common.h M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp_client/Makefile.am M src/libosmo-mgcp-client/Makefile.am M src/libosmo-mgcp/Makefile.am D src/libosmo-mgcp/mgcp_common.c M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c M tests/mgcp_client/Makefile.am 15 files changed, 19 insertions(+), 73 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/Makefile.am b/include/Makefile.am index 3cc4b1d..b52e5ea 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -9,6 +9,7 @@ osmocom/mgcp_client/mgcp_client.h \ osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ + osmocom/mgcp/mgcp_common.h \ osmocom/mgcp/mgcp_internal.h \ osmocom/mgcp/osmux.h \ $(NULL) diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 67c499b..07d9516 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -28,6 +28,8 @@ #include #include +#include + #include #include #include @@ -166,21 +168,6 @@ MGCP_BSC = 0, MGCP_BSC_NAT, }; - -enum mgcp_connection_mode { - MGCP_CONN_NONE = 0, - MGCP_CONN_RECV_ONLY = 1, - MGCP_CONN_SEND_ONLY = 2, - MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY, - MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, -}; - -extern const struct value_string mgcp_connection_mode_strs[]; - -static inline const char *mgcp_cmode_name(enum mgcp_connection_mode mode) -{ - return get_value_string(mgcp_connection_mode_strs, mode); -} struct mgcp_config { int source_port; diff --git a/include/osmocom/mgcp_client/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h similarity index 100% rename from include/osmocom/mgcp_client/mgcp_common.h rename to include/osmocom/mgcp/mgcp_common.h diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 3a22d51..751aba5 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -330,5 +330,3 @@ return endp->cfg->net_ports.bind_addr; return endp->cfg->source_addr; } - -int mgcp_msg_terminate_nul(struct msgb *msg); diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am index 24401f1..0eaafcc 100644 --- a/include/osmocom/mgcp_client/Makefile.am +++ b/include/osmocom/mgcp_client/Makefile.am @@ -1,3 +1,11 @@ +BUILT_SOURCES = \ + mgcp_common.h \ + $(NULL) + noinst_HEADERS = \ mgcp_client_internal.h \ $(NULL) + +mgcp_common.h: $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h + echo -e "/*\n\n DO NOT EDIT THIS FILE!\n THIS IS OVERWRITTEN DURING BUILD\n This is an automatic copy of \n\n */" > mgcp_common.h + cat $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h >> mgcp_common.h diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index a2eb2be..3dd21db 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = \ $(all_includes) \ -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ -I$(top_builddir) \ $(NULL) diff --git a/src/libosmo-mgcp/Makefile.am b/src/libosmo-mgcp/Makefile.am index 20959b8..e121fea 100644 --- a/src/libosmo-mgcp/Makefile.am +++ b/src/libosmo-mgcp/Makefile.am @@ -32,7 +32,6 @@ $(NULL) libosmo_mgcp_la_SOURCES = \ - mgcp_common.c \ mgcp_protocol.c \ mgcp_network.c \ mgcp_vty.c \ diff --git a/src/libosmo-mgcp/mgcp_common.c b/src/libosmo-mgcp/mgcp_common.c deleted file mode 100644 index c246742..0000000 --- a/src/libosmo-mgcp/mgcp_common.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Media Gateway Control Protocol Media Gateway: RFC 3435 */ -/* Implementations useful both for the MGCP GW as well as MGCP GW clients */ - -/* - * (C) 2016 by sysmocom s.m.f.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include -#include - -const struct value_string mgcp_connection_mode_strs[] = { - { MGCP_CONN_NONE, "none" }, - { MGCP_CONN_RECV_SEND, "sendrecv" }, - { MGCP_CONN_SEND_ONLY, "sendonly" }, - { MGCP_CONN_RECV_ONLY, "recvonly" }, - { MGCP_CONN_LOOPBACK, "loopback" }, - { 0, NULL } -}; - -/* Ensure that the msg->l2h is NUL terminated. */ -int mgcp_msg_terminate_nul(struct msgb *msg) -{ - unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ - if (tail[-1] == '\0') - /* nothing to do */; - else if (msgb_tailroom(msg) > 0) - tail[0] = '\0'; - else if (tail[-1] == '\r' || tail[-1] == '\n') - tail[-1] = '\0'; - else { - LOGP(DLMGCP, LOGL_ERROR, "Cannot NUL terminate MGCP message: " - "Length: %d, Buffer size: %d\n", - msgb_l2len(msg), msg->data_len); - return -ENOTSUP; - } - return 0; -} diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index 1a295e7..0da62bc 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -23,7 +23,7 @@ #include #include -#include +#include /* Reset codec state and free memory */ static void mgcp_rtp_codec_reset(struct mgcp_rtp_codec *codec) diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index f4ecb03..d686bca 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -25,6 +25,7 @@ #include #include +#include #include #include diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 4a1eb74..dac1698 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index ac25894..c00cdc6 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index aaa0429..a1299b2 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index c91de8f..e783dac 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/tests/mgcp_client/Makefile.am b/tests/mgcp_client/Makefile.am index e33f0e8..5cd0d8a 100644 --- a/tests/mgcp_client/Makefile.am +++ b/tests/mgcp_client/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = \ $(all_includes) \ -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ -I$(top_srcdir) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/4055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 6 14:33:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 6 Oct 2017 14:33:31 +0000 Subject: [MERGED] osmo-bsc[master]: add ';' after OSMO_ASSERT() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add ';' after OSMO_ASSERT() ...................................................................... add ';' after OSMO_ASSERT() Currently, OSMO_ASSERT() is defined such that it ends in a semicolon, hence an added ';' is redundant. However, the usual way this kind of macro should be defined is #define OSMO_ASSERT(x) do { ... } while(0) so that the compiler requires a trailing semicolon. To prepare for such a change possibly coming up in libosmocore, add ';' to all OSMO_ASSERT() users. Change-Id: If6dce81faee9177737a6e1b572a871aaf7e37138 --- M src/osmo-bsc_nat/bsc_nat_utils.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc_nat/bsc_nat_utils.c b/src/osmo-bsc_nat/bsc_nat_utils.c index a9906b9..3094bbd 100644 --- a/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/src/osmo-bsc_nat/bsc_nat_utils.c @@ -206,7 +206,7 @@ llist_del(&cfg->entry); rate_ctr_group_free(cfg->stats.ctrg); cfg->nat->num_bsc--; - OSMO_ASSERT(cfg->nat->num_bsc >= 0) + OSMO_ASSERT(cfg->nat->num_bsc >= 0); talloc_free(cfg); } -- To view, visit https://gerrit.osmocom.org/4142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If6dce81faee9177737a6e1b572a871aaf7e37138 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 6 14:33:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 6 Oct 2017 14:33:37 +0000 Subject: [MERGED] osmo-msc[master]: add ';' after OSMO_ASSERT() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add ';' after OSMO_ASSERT() ...................................................................... add ';' after OSMO_ASSERT() Currently, OSMO_ASSERT() is defined such that it ends in a semicolon, hence an added ';' is redundant. However, the usual way this kind of macro should be defined is #define OSMO_ASSERT(x) do { ... } while(0) so that the compiler requires a trailing semicolon. To prepare for such a change possibly coming up in libosmocore, add ';' to all OSMO_ASSERT() users. Change-Id: Ic79c8b8f98a7f3bef761751d55a7e6125cf2c46d --- M src/libmsc/gsm_04_08.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 84f52c6..8a5265b 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -3220,7 +3220,7 @@ uint8_t pdisc; int rc = 0; - OSMO_ASSERT(msg->l3h) + OSMO_ASSERT(msg->l3h); OSMO_ASSERT(conn); OSMO_ASSERT(msg); -- To view, visit https://gerrit.osmocom.org/4143 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic79c8b8f98a7f3bef761751d55a7e6125cf2c46d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 6 14:33:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 6 Oct 2017 14:33:45 +0000 Subject: [MERGED] libosmocore[master]: add osmo_imsi_str_valid() and osmo_msisdn_str_valid() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add osmo_imsi_str_valid() and osmo_msisdn_str_valid() ...................................................................... add osmo_imsi_str_valid() and osmo_msisdn_str_valid() Add GSM23003_IMSI_MIN_DIGITS definition. Add regression test gsm23003_test.c to test the two new functions. Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 --- M include/osmocom/gsm/gsm23003.h M include/osmocom/gsm/protocol/gsm_23_003.h M src/gsm/Makefile.am A src/gsm/gsm23003.c M src/gsm/libosmogsm.map M tests/Makefile.am A tests/gsm23003/gsm23003_test.c A tests/gsm23003/gsm23003_test.ok M tests/testsuite.at 9 files changed, 253 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index 2bc7583..dd41bc5 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -3,6 +3,7 @@ #pragma once #include +#include /* 23.003 Chapter 12.1 */ struct osmo_plmn_id { @@ -81,3 +82,6 @@ struct osmo_gummei gummei; uint32_t mtmsi; }; + +bool osmo_imsi_str_valid(const char *imsi); +bool osmo_msisdn_str_valid(const char *msisdn); diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index 94243fe..0e66939 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -4,6 +4,7 @@ /* Chapter 2.2 */ #define GSM23003_IMSI_MAX_DIGITS 15 +#define GSM23003_IMSI_MIN_DIGITS 6 /* Chapter 2.4 */ #define GSM23003_TMSI_NUM_BYTES 4 /* Chapter 2.5 */ diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 08cd5e6..48b8b2c 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -29,7 +29,8 @@ auth_milenage.c milenage/aes-encblock.c gea.c \ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ - gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c + gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ + gsm23003.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c new file mode 100644 index 0000000..004e20f --- /dev/null +++ b/src/gsm/gsm23003.c @@ -0,0 +1,65 @@ +/*! \file gsm23003.c + * Utility function implementations related to 3GPP TS 23.003 */ +/* + * (C) 2017 sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +static bool is_n_digits(const char *str, int min_digits, int max_digits) +{ + int len; + /* Use unsigned char * to avoid a compiler warning of + * "error: array subscript has type 'char' [-Werror=char-subscripts]" */ + const unsigned char *pos = (const unsigned char *)str; + for (len = 0; *pos && len < max_digits; len++, pos++) + if (!isdigit(*pos)) + return false; + if (len < min_digits) + return false; + /* With not too many digits, we should have reached *str == nul */ + if (*pos) + return false; + return true; +} + +/*! Determine whether the given IMSI is valid according to 3GPP TS 23.003. + * \param imsi IMSI digits in ASCII string representation. + * \returns true when the IMSI is valid, false for invalid characters or number + * of digits. + */ +bool osmo_imsi_str_valid(const char *imsi) +{ + return is_n_digits(imsi, GSM23003_IMSI_MIN_DIGITS, GSM23003_IMSI_MAX_DIGITS); +} + +/*! Determine whether the given MSISDN is valid according to 3GPP TS 23.003. + * \param msisdn MSISDN digits in ASCII string representation. + * \returns true when the MSISDN is valid, false for invalid characters or number + * of digits. + */ +bool osmo_msisdn_str_valid(const char *msisdn) +{ + return is_n_digits(msisdn, 1, 15); +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 066f410..95b2ca9 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -418,5 +418,8 @@ osmo_oap_encode; osmo_oap_decode; +osmo_imsi_str_valid; +osmo_msisdn_str_valid; + local: *; }; diff --git a/tests/Makefile.am b/tests/Makefile.am index b138717..dbe349f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test prbs/prbs_test + stats/stats_test prbs/prbs_test gsm23003/gsm23003_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -186,6 +186,9 @@ prbs_prbs_test_SOURCES = prbs/prbs_test.c prbs_prbs_test_LDADD = $(top_builddir)/src/libosmocore.la +gsm23003_gsm23003_test_SOURCES = gsm23003/gsm23003_test.c +gsm23003_gsm23003_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -241,7 +244,8 @@ osmo-auc-gen/osmo-auc-gen_test.ok \ osmo-auc-gen/osmo-auc-gen_test.err \ conv/conv_gsm0503_test.ok endian/endian_test.ok \ - sercomm/sercomm_test.ok prbs/prbs_test.ok + sercomm/sercomm_test.ok prbs/prbs_test.ok \ + gsm23003/gsm23003_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/gsm23003/gsm23003_test.c b/tests/gsm23003/gsm23003_test.c new file mode 100644 index 0000000..682f162 --- /dev/null +++ b/tests/gsm23003/gsm23003_test.c @@ -0,0 +1,124 @@ +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include +#include + +#define BOOL_STR(b) ((b)? "true" : "false") + +static struct { + const char *imsi; + bool expect_ok; +} test_imsis[] = { + { "", false }, + { " ", false }, + { "1", false }, + { "123", false }, + { "12345", false }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_imsi() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_imsis); i++) { + ok = osmo_imsi_str_valid(test_imsis[i].imsi); + pass = pass && (ok == test_imsis[i].expect_ok); + printf("%2d: expect=%s result=%s imsi='%s'\n", + i, BOOL_STR(test_imsis[i].expect_ok), BOOL_STR(ok), + test_imsis[i].imsi); + } + return pass; +} + +static struct { + const char *msisdn; + bool expect_ok; +} test_msisdns[] = { + { "", false }, + { " ", false }, + { "1", true }, + { "123", true }, + { "12345", true }, + { "123456", true }, + { "1234567", true }, + { "1234567890123", true }, + { "123456789012345", true }, + { "000000000000000", true }, + { "999999999999999", true }, + { "1234567890123456", false }, + { "a23456789012345", false }, + { "1234567b9012345", false }, + { "12345678901234c", false }, + { "123456789 01234", false }, + { "1234567\n123456", false }, + { "123456\t123456", false }, + { "123456\r123456", false }, +}; + +bool test_valid_msisdn() +{ + int i; + bool pass = true; + bool ok = true; + printf("----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_msisdns); i++) { + ok = osmo_msisdn_str_valid(test_msisdns[i].msisdn); + pass = pass && (ok == test_msisdns[i].expect_ok); + printf("%2d: expect=%s result=%s msisdn='%s'\n", + i, BOOL_STR(test_msisdns[i].expect_ok), BOOL_STR(ok), + test_msisdns[i].msisdn); + } + return pass; +} + +int main(int argc, char **argv) +{ + bool pass = true; + + pass = pass && test_valid_imsi(); + pass = pass && test_valid_msisdn(); + + OSMO_ASSERT(pass); + + return EXIT_SUCCESS; +} diff --git a/tests/gsm23003/gsm23003_test.ok b/tests/gsm23003/gsm23003_test.ok new file mode 100644 index 0000000..777451a --- /dev/null +++ b/tests/gsm23003/gsm23003_test.ok @@ -0,0 +1,42 @@ +----- test_valid_imsi + 0: expect=false result=false imsi='' + 1: expect=false result=false imsi=' ' + 2: expect=false result=false imsi='1' + 3: expect=false result=false imsi='123' + 4: expect=false result=false imsi='12345' + 5: expect=true result=true imsi='123456' + 6: expect=true result=true imsi='1234567' + 7: expect=true result=true imsi='1234567890123' + 8: expect=true result=true imsi='123456789012345' + 9: expect=true result=true imsi='000000000000000' +10: expect=true result=true imsi='999999999999999' +11: expect=false result=false imsi='1234567890123456' +12: expect=false result=false imsi='a23456789012345' +13: expect=false result=false imsi='1234567b9012345' +14: expect=false result=false imsi='12345678901234c' +15: expect=false result=false imsi='123456789 01234' +16: expect=false result=false imsi='1234567 +123456' +17: expect=false result=false imsi='123456 123456' +18: expect=false result=false imsi='123456 123456' +----- test_valid_msisdn + 0: expect=false result=false msisdn='' + 1: expect=false result=false msisdn=' ' + 2: expect=true result=true msisdn='1' + 3: expect=true result=true msisdn='123' + 4: expect=true result=true msisdn='12345' + 5: expect=true result=true msisdn='123456' + 6: expect=true result=true msisdn='1234567' + 7: expect=true result=true msisdn='1234567890123' + 8: expect=true result=true msisdn='123456789012345' + 9: expect=true result=true msisdn='000000000000000' +10: expect=true result=true msisdn='999999999999999' +11: expect=false result=false msisdn='1234567890123456' +12: expect=false result=false msisdn='a23456789012345' +13: expect=false result=false msisdn='1234567b9012345' +14: expect=false result=false msisdn='12345678901234c' +15: expect=false result=false msisdn='123456789 01234' +16: expect=false result=false msisdn='1234567 +123456' +17: expect=false result=false msisdn='123456 123456' +18: expect=false result=false msisdn='123456 123456' diff --git a/tests/testsuite.at b/tests/testsuite.at index 1954e66..483860f 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -287,3 +287,9 @@ cat $abs_srcdir/prbs/prbs_test.ok > expout AT_CHECK([$abs_top_builddir/tests/prbs/prbs_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([gsm23003]) +AT_KEYWORDS([gsm23003]) +cat $abs_srcdir/gsm23003/gsm23003_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gsm23003/gsm23003_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 6 17:28:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Oct 2017 17:28:48 +0000 Subject: [PATCH] osmo-gsm-tester[master]: modem: Implement voice calls in modem and add voice suite Message-ID: Review at https://gerrit.osmocom.org/4150 modem: Implement voice calls in modem and add voice suite Change-Id: Ib402effc830db293f27a877658894e454a93a606 --- M example/resources.conf M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/schema.py A suites/voice/mo_mt_call.py A suites/voice/suite.conf 5 files changed, 129 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/50/4150/1 diff --git a/example/resources.conf b/example/resources.conf index 3daf677..70c1c35 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -60,7 +60,7 @@ ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' ciphers: [a5_0, a5_1] - features: ['sms'] + features: ['sms', 'voice'] - label: sierra_2 path: '/sierra_2' @@ -68,7 +68,7 @@ ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' ciphers: [a5_0, a5_1] - features: ['sms'] + features: ['sms', 'voice'] - label: gobi_0 path: '/gobi_0' diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index e301ed6..3ea5ddf 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -37,6 +37,8 @@ I_MODEM = 'org.ofono.Modem' I_NETREG = 'org.ofono.NetworkRegistration' I_SMS = 'org.ofono.MessageManager' +I_CALLMGR = 'org.ofono.VoiceCallManager' +I_CALL = 'org.ofono.VoiceCall' # See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78 NETREG_ST_REGISTERED = 'registered' @@ -338,11 +340,15 @@ self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) self.register_attempts = 0 + self.call_list = [] # one Cancellable can handle several concurrent methods. self.cancellable = Gio.Cancellable.new() self.dbus.required_signals = { I_SMS: ( ('IncomingMessage', self._on_incoming_message), ), I_NETREG: ( ('PropertyChanged', self._on_netreg_property_changed), ), + I_CALLMGR: ( ('PropertyChanged', self._on_callmgr_property_changed), + ('CallAdded', self._on_callmgr_call_added), + ('CallRemoved', self._on_callmgr_call_removed), ), } self.dbus.watch_interfaces() @@ -558,6 +564,63 @@ return True return False + def call_id_list(self): + self.dbg('call_id_list: %r' % self.call_list) + return self.call_list + + def call_dial(self, to_msisdn_or_modem): + if isinstance(to_msisdn_or_modem, Modem): + to_msisdn = to_msisdn_or_modem.msisdn + else: + to_msisdn = str(to_msisdn_or_modem) + self.dbg('Dialing:', to_msisdn) + cmgr = self.dbus.interface(I_CALLMGR) + call_obj_path = cmgr.Dial(to_msisdn, 'default') + if call_obj_path not in self.call_list: + self.dbg('Adding %s to call list' % call_obj_path) + self.call_list.append(call_obj_path) + else: + self.log('Dial returned already existing call!') + return call_obj_path + + def call_answer(self, call_id): + self.dbg('Answer call %s' % call_id) + event_loop.wait(self, lambda: self.call_state(call_id) == 'incoming') + call_dbus_obj = systembus_get(call_id) + call_dbus_obj.Answer() + + def call_hangup(self, call_id): + self.dbg('Hang up call %s' % call_id) + call_dbus_obj = systembus_get(call_id) + call_dbus_obj.Hangup() + + def call_is_active(self, call_id): + return self.call_state(call_id) == 'active' + + def call_state(self, call_id): + call_dbus_obj = systembus_get(call_id) + props = call_dbus_obj.GetProperties() + state = props.get('State') + self.dbg('call state: %s' % state) + return state + + def _on_callmgr_call_added(self, obj_path, properties): + self.dbg('%r.CallAdded() -> %s=%r' % (I_CALLMGR, obj_path, repr(properties))) + if obj_path not in self.call_list: + self.call_list.append(obj_path) + else: + self.dbg('Call already exists!') + + def _on_callmgr_call_removed(self, obj_path): + self.dbg('%r.CallRemoved() -> %s' % (I_CALLMGR, obj_path)) + if obj_path in self.call_list: + self.call_list.remove(obj_path) + else: + self.dbg('Trying to remove non-existing call!') + + def _on_callmgr_property_changed(self, name, value): + self.dbg('%r.PropertyChanged() -> %s=%s' % (I_CALLMGR, name, value)) + def info(self, keys=('Manufacturer', 'Model', 'Revision', 'Serial')): props = self.properties() return ', '.join(['%s: %r'%(k,props.get(k)) for k in keys]) diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 6d5f7ad..9b142d3 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -82,7 +82,7 @@ raise ValueError('Unknown Cipher value: %r' % val) def modem_feature(val): - if val in ('sms', 'gprs', 'voicecall', 'ussd'): + if val in ('sms', 'gprs', 'voice', 'ussd'): return raise ValueError('Unknown Modem Feature: %r' % val) diff --git a/suites/voice/mo_mt_call.py b/suites/voice/mo_mt_call.py new file mode 100755 index 0000000..8546ffa --- /dev/null +++ b/suites/voice/mo_mt_call.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms_mo = suite.modem() +ms_mt = suite.modem() + +hlr.start() +stp.start() +msc.start() +mgcpgw.start() + +bsc.bts_add(bts) +bsc.start() + +bts.start() + +hlr.subscriber_add(ms_mo) +hlr.subscriber_add(ms_mt) + +ms_mo.connect(msc.mcc_mnc()) +ms_mt.connect(msc.mcc_mnc()) + +ms_mo.log_info() +ms_mt.log_info() + +print('waiting for modems to attach...') +wait(ms_mo.is_connected, msc.mcc_mnc()) +wait(ms_mt.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms_mo, ms_mt) + +mo_call_id = ms_mo.call_dial(ms_mt) +wait(lambda: mo_call_id in ms_mo.call_id_list()) +wait(lambda: len(ms_mt.call_id_list()) > 0) +mt_call_id = ms_mt.call_id_list()[0] +assert not ms_mo.call_is_active(mo_call_id) and not ms_mt.call_is_active(mt_call_id) +print('dial success') + +ms_mt.call_answer(mt_call_id) +wait(ms_mo.call_is_active, mo_call_id) +wait(ms_mt.call_is_active, mt_call_id) +print('answer success, call established and ongoing') + +sleep(5) # maintain the call active for 5 seconds + +assert ms_mo.call_is_active(mo_call_id) and ms_mt.call_is_active(mt_call_id) +ms_mt.call_hangup(mt_call_id) +wait(lambda: len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0) +print('hangup success') diff --git a/suites/voice/suite.conf b/suites/voice/suite.conf new file mode 100644 index 0000000..40d9f97 --- /dev/null +++ b/suites/voice/suite.conf @@ -0,0 +1,9 @@ +resources: + ip_address: + - times: 5 # msc, bsc, hlr, stp, mgw + bts: + - times: 1 + modem: + - times: 2 + features: + - voice -- To view, visit https://gerrit.osmocom.org/4150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib402effc830db293f27a877658894e454a93a606 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 6 17:28:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Oct 2017 17:28:48 +0000 Subject: [PATCH] osmo-gsm-tester[master]: debug: Add voicecall related method to interactive shell Message-ID: Review at https://gerrit.osmocom.org/4151 debug: Add voicecall related method to interactive shell Change-Id: Id2df68bf4fba0fb542eebdeb515a3dac6d5e575e --- M suites/aoip_debug/interactive.py M suites/debug/interactive.py 2 files changed, 72 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/51/4151/1 diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index d596b68..4db82e6 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -23,11 +23,14 @@ m.connect(msc.mcc_mnc()) while True: - cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') + cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-answer , call-hangup ') cmd = cmd.strip().lower() if not cmd: continue + + params = cmd.split() + if 'quit'.startswith(cmd): break elif 'wait-registered'.startswith(cmd): @@ -46,3 +49,35 @@ for mo in modems: for mt in modems: mo.sms_send(mt.msisdn, 'to ' + mt.name()) + elif cmd.startswith('call-list'): + if len(params) != 1 and len(params) != 2: + print('wrong format') + continue + for ms in modems: + if len(params) == 1 or str(ms.msisdn) == params[1]: + print('call_list: %r' % ms.call_id_list()) + elif cmd.startswith('call-dial'): + if len(params) != 3: + print('wrong format') + continue + for mo in modems: + if str(mo.msisdn) == params[1]: + print('dial %s->%s, %s' % (params[1],params[2],str(mo.call_dial(params[2])))) + elif cmd.startswith('call-answer'): + if len(params) != 3: + print('wrong format') + continue + for ms in modems: + if str(ms.msisdn) == params[1]: + print('answer %s' % params[2]) + ms.call_answer(params[2]) + elif cmd.startswith('call-hangup'): + if len(params) != 3: + print('wrong format') + continue + for ms in modems: + if str(ms.msisdn) == params[1]: + print('hang up %s' % params[2]) + ms.call_hangup(params[2]) + else: + print('Unknown command: %s' % cmd) diff --git a/suites/debug/interactive.py b/suites/debug/interactive.py index 37076dc..70188d7 100755 --- a/suites/debug/interactive.py +++ b/suites/debug/interactive.py @@ -16,11 +16,14 @@ m.connect(nitb.mcc_mnc()) while True: - cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') + cmd = prompt('Enter command: (q)uit, (s)ms, (g)et-registered, (w)ait-registered, call-list [], call-dial , call-answer , call-hangup ') cmd = cmd.strip().lower() if not cmd: continue + + params = cmd.split() + if 'quit'.startswith(cmd): break elif 'wait-registered'.startswith(cmd): @@ -39,3 +42,35 @@ for mo in modems: for mt in modems: mo.sms_send(mt.msisdn, 'to ' + mt.name()) + elif cmd.startswith('call-list'): + if len(params) != 1 and len(params) != 2: + print('wrong format') + continue + for ms in modems: + if len(params) == 1 or str(ms.msisdn) == params[1]: + print('call_list: %r' % ms.call_id_list()) + elif cmd.startswith('call-dial'): + if len(params) != 3: + print('wrong format') + continue + for mo in modems: + if str(mo.msisdn) == params[1]: + print('dial %s->%s, %s' % (params[1],params[2],str(mo.call_dial(params[2])))) + elif cmd.startswith('call-answer'): + if len(params) != 3: + print('wrong format') + continue + for ms in modems: + if str(ms.msisdn) == params[1]: + print('answer %s' % params[2]) + ms.call_answer(params[2]) + elif cmd.startswith('call-hangup'): + if len(params) != 3: + print('wrong format') + continue + for ms in modems: + if str(ms.msisdn) == params[1]: + print('hang up %s' % params[2]) + ms.call_hangup(params[2]) + else: + print('Unknown command: %s' % cmd) -- To view, visit https://gerrit.osmocom.org/4151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id2df68bf4fba0fb542eebdeb515a3dac6d5e575e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 6 17:28:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Oct 2017 17:28:48 +0000 Subject: [PATCH] osmo-gsm-tester[master]: default-suites: Enable voice suite Message-ID: Review at https://gerrit.osmocom.org/4152 default-suites: Enable voice suite Change-Id: I89174514b2af8909fd252ba4f694818b7353db8c --- M example/default-suites.conf 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/52/4152/1 diff --git a/example/default-suites.conf b/example/default-suites.conf index 1e8d47a..c70ce9d 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -1,9 +1,12 @@ - sms:sysmo - aoip_sms:sysmo +- voice:sysmo - sms:trx-b200 - aoip_sms:trx-b200 +- voice:trx-b200 - sms:trx-sysmocell5000 - aoip_sms:trx-sysmocell5000 +- voice:trx-sysmocell5000 - smpp - aoip_smpp - aoip_encryption:cipher-a50+cipher-a51 -- To view, visit https://gerrit.osmocom.org/4152 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I89174514b2af8909fd252ba4f694818b7353db8c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 6 18:03:08 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 6 Oct 2017 18:03:08 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: logging: replace OpenBSC -> OsmoBSC in examples Message-ID: Review at https://gerrit.osmocom.org/4153 logging: replace OpenBSC -> OsmoBSC in examples Change-Id: Id55dcd41b0d2b3408969d1858e925da55fb5427c --- M common/chapters/logging.adoc 1 file changed, 14 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/53/4153/1 diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index 564f6d2..28b6d3e 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -47,7 +47,7 @@ Next, you can configure the log levels for your VTY session. Each sub-system of the program in question typically logs its messages as a different category, allowing fine-grained control over which log -messages you will or will not see. For example, in OpenBSC, there are +messages you will or will not see. For example, in OsmoBSC, there are categories for the protocol layers `rsl`, `rr`, `mm`, `cc` and many others. To get a a list of categories interactively on the vty, type: `logging level ?` @@ -80,7 +80,7 @@ really means that all events with a level of at least __info__ will be logged, i.e. including events of __notice__, __error__ and __fatal__. -So for example, in OpenBSC, to set the log level of the Mobility +So for example, in OsmoBSC, to set the log level of the Mobility Management category to info, you can use the following command: `log level mm info`. @@ -117,10 +117,10 @@ To configure a new log file, enter the following sequence of commands: ---- -OpenBSC> enable -OpenBSC# configure terminal -OpenBSC(config)# log file /path/to/my/file -OpenBSC(config-log)# +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log file /path/to/my/file +OsmoBSC(config-log)# ---- This leaves you at the config-log prompt, from where you can set the @@ -151,10 +151,10 @@ following commands on the VTY: ---- -OpenBSC> enable -OpenBSC# configure terminal -OpenBSC(config)# log syslog daemon -OpenBSC(config-log)# +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log syslog daemon +OsmoBSC(config-log)# ---- This leaves you at the config-log prompt, from where you can set the @@ -177,8 +177,8 @@ In order to configure logging to stderr, you can use the following commands: ---- -OpenBSC> enable -OpenBSC# configure terminal -OpenBSC(config)# log stderr -OpenBSC(config-log)# +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log stderr +OsmoBSC(config-log)# ---- -- To view, visit https://gerrit.osmocom.org/4153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id55dcd41b0d2b3408969d1858e925da55fb5427c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 6 18:03:08 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 6 Oct 2017 18:03:08 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: logging: restructure sections Message-ID: Review at https://gerrit.osmocom.org/4154 logging: restructure sections The basic logging concepts like filters and levels which are target-independent. It's counter-intuitive that they are described inside vty target section. * fix that by putting them in separate sections which are referenced from target sections as necessary * move all targets into subsections under "Log targets" section Change-Id: I5acde815c66eb3d57e06ecd8dc65fe338216fe63 Related: OS#1913 --- M common/chapters/logging.adoc 1 file changed, 50 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/54/4154/1 diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index 28b6d3e..94fa898 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -25,34 +25,20 @@ configured by means of VTY commands that can either be entered interactively, or read from a configuration file at process start time. -=== Logging to the VTY +[[log_categories]] +=== Log categories -Logging messages to the interactive command-line interface (VTY) is most -useful for occasional investigation by the system administrator. - -Logging to the VTY is disabled by default, and needs to be enabled -explicitly for each such session. This means that multiple concurrent -VTY sessions each have their own logging configuration. Once you close -a VTY session, the log target will be destroyed and your log settings be -lost. If you re-connect to the VTY, you have to again activate and -configure logging, if you wish. - -To create a logging target bound to a VTY, you have to use the following -command: `logging enable` This doesn't really activate the -generation of any output messages yet, it merely creates and attaches a -log target to the VTY session. The newly-created target still doesn't -have any filter installed, i.e. __all log messages will be suppressed -by default__ - -Next, you can configure the log levels for your VTY session. Each -sub-system of the program in question typically logs its messages as a +Each sub-system of the program in question typically logs its messages as a different category, allowing fine-grained control over which log messages you will or will not see. For example, in OsmoBSC, there are categories for the protocol layers `rsl`, `rr`, `mm`, `cc` and many others. To get a a list of categories interactively on the vty, type: `logging level ?` -For each of those categories, you can set an independent log level, +[[log_levels]] +=== Log levels + +For each of the log categories (see <>), you can set an independent log level, controlling the level of verbosity. Log levels include: fatal:: @@ -84,12 +70,10 @@ Management category to info, you can use the following command: `log level mm info`. -Equally, to set the log level of the Call Control category to debug, you -can use: - `log level cc debug` +[[log_filters]] +=== Log filters -Finally, after having configured the levels, you still need to set the -filter. The default behavior is to filter out everything, i.e. not to +The default behavior is to filter out everything, i.e. not to log anything. The reason is quite simple: On a busy production setup, logging all events for a given subsystem may very quickly be flooding your console before you have a chance to set a more restrictive filter. @@ -101,13 +85,49 @@ subscriber identified by his IMSI, you may use: `log filter imsi 262020123456789` +=== Log targets + +Each of the log targets represent certain destination for log messages. +It can be configured independently by selecting levels (see <>) for categories +(see <>) as well as filtering (see <>) and +other options like `logging timestamp` for example. + +==== Logging to the VTY + +Logging messages to the interactive command-line interface (VTY) is most +useful for occasional investigation by the system administrator. + +Logging to the VTY is disabled by default, and needs to be enabled +explicitly for each such session. This means that multiple concurrent +VTY sessions each have their own logging configuration. Once you close +a VTY session, the log target will be destroyed and your log settings be +lost. If you re-connect to the VTY, you have to again activate and +configure logging, if you wish. + +To create a logging target bound to a VTY, you have to use the following +command: `logging enable` This doesn't really activate the +generation of any output messages yet, it merely creates and attaches a +log target to the VTY session. The newly-created target still doesn't +have any filter installed, i.e. __all log messages will be suppressed +by default__ + +Next, you can configure the log levels for desired categories in your VTY session. +See <> for more details on categories and <> for the log level details. + +For example, to set the log level of the Call Control category to debug, you +can use: + `log level cc debug` + +Finally, after having configured the levels, you still need to set the +filter as it's described in <>. + TIP: If many messages are being logged to a VTY session, it may be hard to impossible to still use the same session for any commands. We therefore recommend to open a second VTY session in parallel, and use one only for logging, while the other is used for interacting with the -system. +system. Another option would be to use different log target. -=== Logging to a file +==== Logging to a file As opposed to Logging to the VTY, logging to files is persistent and stored in the configuration file. As such, it is configured in @@ -139,7 +159,7 @@ implemented. -=== Logging to syslog +==== Logging to syslog syslog is a standard for computer data logging maintained by the IETF. Unix-like operating systems like GNU/Linux provide several syslog @@ -168,7 +188,7 @@ by issuing the `logging timestamp 0` command. -=== Logging to stderr +==== Logging to stderr If you're not running the respective application as a daemon in the background, you can also use the stderr log target in order to log to -- To view, visit https://gerrit.osmocom.org/4154 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5acde815c66eb3d57e06ecd8dc65fe338216fe63 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 6 18:03:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 6 Oct 2017 18:03:09 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: logging: document alarms target Message-ID: Review at https://gerrit.osmocom.org/4155 logging: document alarms target Add subsection describing "log alarms" target. Change-Id: I95ce5f3db38616608590e02ee79eb3a7e6e4ea14 Fixes: OS#1913 --- M common/chapters/logging.adoc 1 file changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/55/4155/1 diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index 94fa898..da304b5 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -127,6 +127,23 @@ one only for logging, while the other is used for interacting with the system. Another option would be to use different log target. +==== Logging to the ring buffer + +To avoid having separate VTY session just for logging output while still having immediate access to them, +one can use `alarms` target. It lets you store the log messages inside the ring buffer of a given size which +is available with `show alarms` command. + +It's configured as follows: +---- +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log alarms 10000 +OsmoBSC(config-log)# +---- + +In the example above 10000 is the desired size of the ring buffer (number of messages). Once it's filled, +the incoming log messages will push out the oldest messages available in the buffer. + ==== Logging to a file As opposed to Logging to the VTY, logging to files is persistent and -- To view, visit https://gerrit.osmocom.org/4155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95ce5f3db38616608590e02ee79eb3a7e6e4ea14 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sat Oct 7 02:48:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 7 Oct 2017 02:48:13 +0000 Subject: [PATCH] libosmocore[master]: gsm: make osmo_imsi_str_valid() NULL-safe Message-ID: Review at https://gerrit.osmocom.org/4156 gsm: make osmo_imsi_str_valid() NULL-safe No callers that would pass NULL exist, but let's check against NULL from the start. Fixup for recent change I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522. Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e --- M src/gsm/gsm23003.c M tests/gsm23003/gsm23003_test.c M tests/gsm23003/gsm23003_test.ok 3 files changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/56/4156/1 diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c index 004e20f..732d3d3 100644 --- a/src/gsm/gsm23003.c +++ b/src/gsm/gsm23003.c @@ -33,13 +33,13 @@ /* Use unsigned char * to avoid a compiler warning of * "error: array subscript has type 'char' [-Werror=char-subscripts]" */ const unsigned char *pos = (const unsigned char *)str; - for (len = 0; *pos && len < max_digits; len++, pos++) + for (len = 0; pos && *pos && len < max_digits; len++, pos++) if (!isdigit(*pos)) return false; if (len < min_digits) return false; /* With not too many digits, we should have reached *str == nul */ - if (*pos) + if (pos && *pos) return false; return true; } diff --git a/tests/gsm23003/gsm23003_test.c b/tests/gsm23003/gsm23003_test.c index 682f162..a408b73 100644 --- a/tests/gsm23003/gsm23003_test.c +++ b/tests/gsm23003/gsm23003_test.c @@ -50,6 +50,7 @@ { "1234567\n123456", false }, { "123456\t123456", false }, { "123456\r123456", false }, + { NULL, false }, }; bool test_valid_imsi() @@ -92,6 +93,7 @@ { "1234567\n123456", false }, { "123456\t123456", false }, { "123456\r123456", false }, + { NULL, false }, }; bool test_valid_msisdn() diff --git a/tests/gsm23003/gsm23003_test.ok b/tests/gsm23003/gsm23003_test.ok index 777451a..7d7ffd1 100644 --- a/tests/gsm23003/gsm23003_test.ok +++ b/tests/gsm23003/gsm23003_test.ok @@ -19,6 +19,7 @@ 123456' 17: expect=false result=false imsi='123456 123456' 18: expect=false result=false imsi='123456 123456' +19: expect=false result=false imsi='(null)' ----- test_valid_msisdn 0: expect=false result=false msisdn='' 1: expect=false result=false msisdn=' ' @@ -40,3 +41,4 @@ 123456' 17: expect=false result=false msisdn='123456 123456' 18: expect=false result=false msisdn='123456 123456' +19: expect=false result=false msisdn='(null)' -- To view, visit https://gerrit.osmocom.org/4156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 7 02:48:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 7 Oct 2017 02:48:31 +0000 Subject: [PATCH] libosmocore[master]: auth: add value_strings for osmo_sub_auth_type, comment on o... Message-ID: Review at https://gerrit.osmocom.org/4157 auth: add value_strings for osmo_sub_auth_type, comment on osmo_auth_alg_name() Add osmo_sub_auth_type_names[] and osmo_sub_auth_type_name(). Also add a hint to enum osmo_auth_algo's API doc that osmo_auth_alg_name() already exists (it is defined further below). Change-Id: I652a929bcd11c694d86812fb03d0a1cbd985efda --- M include/osmocom/crypt/auth.h M src/gsm/auth_core.c M src/gsm/libosmogsm.map 3 files changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/4157/1 diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 2f2a8d3..7064c99 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -7,6 +7,7 @@ #include #include +#include #define OSMO_A5_MAX_KEY_LEN_BYTES (128/8) @@ -17,7 +18,12 @@ OSMO_AUTH_TYPE_UMTS = 0x02, }; -/*! Authentication Algorithm */ +extern const struct value_string osmo_sub_auth_type_names[]; +static inline const char *osmo_sub_auth_type_name(enum osmo_sub_auth_type val) +{ return get_value_string(osmo_sub_auth_type_names, val); } + +/*! Authentication Algorithm. + * See also osmo_auth_alg_name() and osmo_auth_alg_parse(). */ enum osmo_auth_algo { OSMO_AUTH_ALG_NONE, OSMO_AUTH_ALG_COMP128v1, diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index 4156695..738e860 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -221,4 +221,11 @@ return get_string_value(auth_alg_vals, name); } +const struct value_string osmo_sub_auth_type_names[] = { + { OSMO_AUTH_TYPE_NONE, "None" }, + { OSMO_AUTH_TYPE_GSM, "GSM" }, + { OSMO_AUTH_TYPE_UMTS, "UMTS" }, + { 0, NULL } +}; + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 95b2ca9..2bf1683 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -338,6 +338,7 @@ osmo_auth_load; osmo_auth_register; osmo_auth_supported; +osmo_sub_auth_type_names; osmo_rsl2sitype; osmo_sitype2rsl; -- To view, visit https://gerrit.osmocom.org/4157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I652a929bcd11c694d86812fb03d0a1cbd985efda Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 7 02:48:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 7 Oct 2017 02:48:31 +0000 Subject: [PATCH] libosmocore[master]: auth: add OSMO_MILENAGE_IND_BITLEN_MAX Message-ID: Review at https://gerrit.osmocom.org/4158 auth: add OSMO_MILENAGE_IND_BITLEN_MAX Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: Ic39f3404d1a49ffd06070aa9897b36f219eacf4d --- M include/osmocom/crypt/auth.h M src/gsm/auth_milenage.c 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/4158/1 diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 7064c99..1b017c0 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -10,6 +10,7 @@ #include #define OSMO_A5_MAX_KEY_LEN_BYTES (128/8) +#define OSMO_MILENAGE_IND_BITLEN_MAX 28 /*! Authentication Type (GSM/UMTS) */ enum osmo_sub_auth_type { diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index e1a1dfb..2ddf712 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -112,7 +112,7 @@ * { .ind_bitlen = 0, .ind = 0, .sqn = (desired_sqn - 1) } */ - if (aud->u.umts.ind_bitlen > 28) + if (aud->u.umts.ind_bitlen > OSMO_MILENAGE_IND_BITLEN_MAX) return -2; seq_1 = 1LL << aud->u.umts.ind_bitlen; -- To view, visit https://gerrit.osmocom.org/4158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic39f3404d1a49ffd06070aa9897b36f219eacf4d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 7 03:13:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 7 Oct 2017 03:13:09 +0000 Subject: [PATCH] libosmocore[master]: utils: add osmo_is_hexstr(), add unit test Message-ID: Review at https://gerrit.osmocom.org/4159 utils: add osmo_is_hexstr(), add unit test Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a --- M include/osmocom/core/utils.h M src/utils.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 4 files changed, 130 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/59/4159/1 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 855e653..5f41213 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include @@ -89,4 +91,7 @@ size_t osmo_strlcpy(char *dst, const char *src, size_t siz); +bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, + bool require_even); + /*! @} */ diff --git a/src/utils.c b/src/utils.c index 1c176f8..a3d6653 100644 --- a/src/utils.c +++ b/src/utils.c @@ -375,4 +375,35 @@ return ret; } +/*! Validate that a given string is a hex string within given size limits. + * Note that each hex digit amounts to a nibble, so if checking for a hex + * string to result in N bytes, pass amount of digits as 2*N. + * \param str A nul-terminated string to validate, or NULL. + * \param min_digits least permitted amount of digits. + * \param max_digits most permitted amount of digits. + * \param require_even if true, require an even amount of digits. + * \returns true when the hex_str contains only hexadecimal digits (no + * whitespace) and matches the requested length; also true + * when min_digits <= 0 and str is NULL. + */ +bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, + bool require_even) +{ + int len; + /* Use unsigned char * to avoid a compiler warning of + * "error: array subscript has type 'char' [-Werror=char-subscripts]" */ + const unsigned char *pos = (const unsigned char *)str; + for (len = 0; pos && *pos && len < max_digits; len++, pos++) + if (!isxdigit(*pos)) + return false; + if (len < min_digits) + return false; + /* With not too many digits, we should have reached *str == nul */ + if (pos && *pos) + return false; + if (require_even && (len & 1)) + return false; + return true; +} + /*! @} */ diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index cad162d..4a4b121 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -219,6 +219,68 @@ OSMO_ASSERT(!TLVP_PRESENT(&tvp, 0x25)); } +static struct { + const char *str; + int min_digits; + int max_digits; + bool require_even; + bool expect_ok; +} test_hexstrs[] = { + { NULL, 0, 10, false, true }, + { NULL, 1, 10, false, false }, + { "", 0, 10, false, true }, + { "", 1, 10, false, false }, + { " ", 0, 10, false, false }, + { "1", 0, 10, false, true }, + { "1", 1, 10, false, true }, + { "1", 1, 10, true, false }, + { "1", 2, 10, false, false }, + { "123", 1, 10, false, true }, + { "123", 1, 10, true, false }, + { "123", 4, 10, false, false }, + { "1234", 4, 10, true, true }, + { "12345", 4, 10, true, false }, + { "123456", 4, 10, true, true }, + { "1234567", 4, 10, true, false }, + { "12345678", 4, 10, true, true }, + { "123456789", 4, 10, true, false }, + { "123456789a", 4, 10, true, true }, + { "123456789ab", 4, 10, true, false }, + { "123456789abc", 4, 10, true, false }, + { "123456789ab", 4, 10, false, false }, + { "123456789abc", 4, 10, false, false }, + { "0123456789abcdefABCDEF", 0, 100, false, true }, + { "0123456789 abcdef ABCDEF", 0, 100, false, false }, + { "foobar", 0, 100, false, false }, + { "BeadedBeeAced1EbbedDefacedFacade", 32, 32, true, true }, + { "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 32, 32, false, true }, + { "DeafBeddedBabeAcceededFadedDecaff", 32, 32, false, false }, +}; + +bool test_is_hexstr() +{ + int i; + bool pass = true; + bool ok = true; + printf("\n----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_hexstrs); i++) { + ok = osmo_is_hexstr(test_hexstrs[i].str, + test_hexstrs[i].min_digits, + test_hexstrs[i].max_digits, + test_hexstrs[i].require_even); + pass = pass && (ok == test_hexstrs[i].expect_ok); + printf("%2d: %s str='%s' min=%d max=%d even=%d expect=%s\n", + i, test_hexstrs[i].expect_ok == ok ? "pass" : "FAIL", + test_hexstrs[i].str, + test_hexstrs[i].min_digits, + test_hexstrs[i].max_digits, + test_hexstrs[i].require_even, + test_hexstrs[i].expect_ok ? "valid" : "invalid"); + } + return pass; +} + int main(int argc, char **argv) { static const struct log_info log_info = {}; @@ -227,5 +289,6 @@ hexdump_test(); hexparse_test(); test_idtag_parsing(); + test_is_hexstr(); return 0; } diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index e9be018..45156f7 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -26,3 +26,34 @@ rc = -1 Hexparse with invalid char rc = -1 + +----- test_is_hexstr + 0: pass str='(null)' min=0 max=10 even=0 expect=valid + 1: pass str='(null)' min=1 max=10 even=0 expect=invalid + 2: pass str='' min=0 max=10 even=0 expect=valid + 3: pass str='' min=1 max=10 even=0 expect=invalid + 4: pass str=' ' min=0 max=10 even=0 expect=invalid + 5: pass str='1' min=0 max=10 even=0 expect=valid + 6: pass str='1' min=1 max=10 even=0 expect=valid + 7: pass str='1' min=1 max=10 even=1 expect=invalid + 8: pass str='1' min=2 max=10 even=0 expect=invalid + 9: pass str='123' min=1 max=10 even=0 expect=valid +10: pass str='123' min=1 max=10 even=1 expect=invalid +11: pass str='123' min=4 max=10 even=0 expect=invalid +12: pass str='1234' min=4 max=10 even=1 expect=valid +13: pass str='12345' min=4 max=10 even=1 expect=invalid +14: pass str='123456' min=4 max=10 even=1 expect=valid +15: pass str='1234567' min=4 max=10 even=1 expect=invalid +16: pass str='12345678' min=4 max=10 even=1 expect=valid +17: pass str='123456789' min=4 max=10 even=1 expect=invalid +18: pass str='123456789a' min=4 max=10 even=1 expect=valid +19: pass str='123456789ab' min=4 max=10 even=1 expect=invalid +20: pass str='123456789abc' min=4 max=10 even=1 expect=invalid +21: pass str='123456789ab' min=4 max=10 even=0 expect=invalid +22: pass str='123456789abc' min=4 max=10 even=0 expect=invalid +23: pass str='0123456789abcdefABCDEF' min=0 max=100 even=0 expect=valid +24: pass str='0123456789 abcdef ABCDEF' min=0 max=100 even=0 expect=invalid +25: pass str='foobar' min=0 max=100 even=0 expect=invalid +26: pass str='BeadedBeeAced1EbbedDefacedFacade' min=32 max=32 even=1 expect=valid +27: pass str='C01ffedC1cadaeAc1d1f1edAcac1aB0a' min=32 max=32 even=0 expect=valid +28: pass str='DeafBeddedBabeAcceededFadedDecaff' min=32 max=32 even=0 expect=invalid -- To view, visit https://gerrit.osmocom.org/4159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From admin at opensuse.org Sat Oct 7 19:55:04 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 07 Oct 2017 19:55:04 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59d931322542b_58e2dcaf78101194b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 228s] | [ 228s] | This file was extended by libosmocore config.status 0.9.6.20171007, which was [ 228s] | generated by GNU Autoconf 2.69. Invocation command line was [ 228s] | [ 228s] | CONFIG_FILES = [ 228s] | CONFIG_HEADERS = [ 228s] | CONFIG_LINKS = [ 228s] | CONFIG_COMMANDS = [ 228s] | $ ./config.status Doxyfile.core [ 228s] | [ 228s] | on build32 [ 228s] | [ 228s] | config.status:1173: creating Doxyfile.core [ 228s] [ 228s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 228s] make[1]: *** [override_dh_auto_test] Error 1 [ 228s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 228s] debian/rules:15: recipe for target 'build' failed [ 228s] make: *** [build] Error 2 [ 228s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 228s] [ 228s] build32 failed "build libosmocore_0.9.6.20171007.dsc" at Sat Oct 7 19:54:51 UTC 2017. [ 228s] [ 228s] ### VM INTERACTION START ### [ 231s] [ 217.746002] reboot: Power down [ 233s] ### VM INTERACTION END ### [ 233s] [ 233s] build32 failed "build libosmocore_0.9.6.20171007.dsc" at Sat Oct 7 19:54:57 UTC 2017. [ 233s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sun Oct 8 12:52:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 8 Oct 2017 12:52:22 +0000 Subject: libosmocore[master]: gsm: make osmo_imsi_str_valid() NULL-safe In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4156/1/src/gsm/gsm23003.c File src/gsm/gsm23003.c: Line 36: for (len = 0; pos && *pos && len < max_digits; len++, pos++) I thought so far the idea was to "fail early". Why not check str == NULL and immediately return instead of checking pos everytime it's used? -- To view, visit https://gerrit.osmocom.org/4156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 8 12:54:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 8 Oct 2017 12:54:53 +0000 Subject: libosmocore[master]: auth: add OSMO_MILENAGE_IND_BITLEN_MAX In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4158/1/include/osmocom/crypt/auth.h File include/osmocom/crypt/auth.h: Line 14: Good idea. Could you also add short spec reference to see where this limitation comes from? -- To view, visit https://gerrit.osmocom.org/4158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic39f3404d1a49ffd06070aa9897b36f219eacf4d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 8 12:57:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 8 Oct 2017 12:57:57 +0000 Subject: libosmocore[master]: utils: add osmo_is_hexstr(), add unit test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4159/1/src/utils.c File src/utils.c: Line 395: const unsigned char *pos = (const unsigned char *)str; That looks weird. Why not just use "const unsigned char *str" in parameters? -- To view, visit https://gerrit.osmocom.org/4159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 8 12:59:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 8 Oct 2017 12:59:09 +0000 Subject: libosmocore[master]: auth: add value_strings for osmo_sub_auth_type, comment on o... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I652a929bcd11c694d86812fb03d0a1cbd985efda Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 8 14:49:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 8 Oct 2017 14:49:33 +0000 Subject: [PATCH] osmo-bsc[master]: SI2q: fix generation for multiple UARFCNs Message-ID: Review at https://gerrit.osmocom.org/4160 SI2q: fix generation for multiple UARFCNs * fix insert routine to keep the list sorted by UARFCN * fix rest octets generator to properly account for offset * adjust test results accordingly Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794 Related: OS#2357 --- M src/libbsc/rest_octets.c M src/libbsc/system_information.c M tests/gsm0408/gsm0408_test.ok 3 files changed, 22 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/60/4160/1 diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index b1516ec..a22b8e6 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -303,7 +303,7 @@ static inline void append_uarfcns(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) { const uint16_t *u = bts->si_common.data.uarfcn_list; - int i, rem = budget - 7, st = 0; /* account for constant bits right away */ + int i, rem = budget - 7, st = bts->u_offset; /* account for constant bits right away */ uint16_t cu = u[bts->u_offset]; /* caller ensures that length is positive */ OSMO_ASSERT(budget <= SI2Q_MAX_LEN); diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index 761e848..ae7d390 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -280,7 +280,7 @@ int bts_uarfcn_add(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble, bool diversity) { - size_t len = bts->si_common.uarfcn_length, i, k = 0; + size_t len = bts->si_common.uarfcn_length, i; uint8_t si2q; int pos = uarfcn_sc_pos(bts, arfcn, scramble); uint16_t scr = diversity ? encode_fdd(scramble, true) : encode_fdd(scramble, false), @@ -297,19 +297,14 @@ pos = uarfcn_sc_pos(bts, arfcn, SC_BOUND); i = (pos < 0) ? len : pos; - for (k = 0; i < len; i++) - if (scr > scl[i]) - k = i + 1; - - /* we keep lists sorted by scramble code of a given UARFCN: - insert into appropriate position and move the tail */ - if (len - k) { - memmove(ual + k + 1, ual + k, (len - k) * 2); - memmove(scl + k + 1, scl + k, (len - k) * 2); + /* insert into appropriate position and move the tail */ + if (len - i) { + memmove(ual + i + 1, ual + i, (len - i) * 2); + memmove(scl + i + 1, scl + i, (len - i) * 2); } - ual[k] = arfcn; - scl[k] = scr; + ual[i] = arfcn; + scl[i] = scr; bts->si_common.uarfcn_length++; si2q = si2q_num(bts); diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index d23cebb..d200539 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -62,9 +62,9 @@ generating SI2quater for 0 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7f 52 e8 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7f 52 e8 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b Testing SYSINFO_TYPE_2quater EARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... generated invalid SI2quater [00/00]: [23] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -96,17 +96,17 @@ generating SI2quater for 0 EARFCNs and 2 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 14 1a 1f 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 18 58 12 f0 83 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 1c 7b d0 f7 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 20 58 2e f0 f2 03 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 24 b3 e4 e9 68 03 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 28 58 2e 22 f2 4e 83 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 2c 7a 34 0e 4e e9 83 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 34 1a 64 26 5d f2 05 03 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 34 7a 34 0e 4e e9 85 03 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 38 58 12 22 fd ce 8e 05 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 3c 70 39 02 ce f7 85 0e 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 40 58 1d 22 fa ce 88 85 7b 0b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 44 7a 34 05 e4 72 05 08 d5 0b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 9 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 4c 7a 34 0e 64 77 85 43 55 c8 0b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 10 UARFCNs... @@ -117,19 +117,17 @@ generating SI2quater for 0 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 12 7e e0 a9 44 05 3e 0b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 12 7e e0 0b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 ea 08 81 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 54 ba 82 20 03 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 08 81 52 e8 10 3f f4 a9 75 04 a4 0b 2b 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 28 81 df 7f fa 32 d4 a2 02 9f 03 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 54 ba 84 52 67 03 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 10 81 ce a9 74 08 1f fa 54 ba 82 52 03 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 30 81 d3 7f fd b2 86 54 a2 02 9f 03 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 54 ba 86 20 73 8c 81 Testing SYSINFO_TYPE_2quater combined EARFCN & UARFCN generation: generating SI2quater for 17 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 0c 1a 10 99 66 0f 04 83 c1 1c bb 2b 03 2b 2b -- To view, visit https://gerrit.osmocom.org/4160 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Oct 8 16:10:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 8 Oct 2017 16:10:53 +0000 Subject: [PATCH] osmo-bts[master]: Remove build dependency on legacy OpenBSC Message-ID: Review at https://gerrit.osmocom.org/4161 Remove build dependency on legacy OpenBSC * copy-paste gsm_data_shared.h from OpenBSC master * remove corresponding configure check and option * remove .deb dependency Actual refactoring with removal of unnecessary structures/parts, moving common OpenBSC/OsmoBSC parts into libraries etc. are left for further patches. Current patch will make coexistence with *BSC easier and will simplify our build infrastructure. Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13 Related: OS#1923 --- M configure.ac M debian/control M include/osmo-bts/Makefile.am M include/osmo-bts/gsm_data.h A include/osmo-bts/gsm_data_shared.h 5 files changed, 1,001 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/4161/1 diff --git a/configure.ac b/configure.ac index bc36456..1a09f4b 100644 --- a/configure.ac +++ b/configure.ac @@ -147,22 +147,6 @@ CPPFLAGS=$oldCPPFLAGS fi -# We share gsm_data.h with OpenBSC and need to be pointed to the source -# directory of OpenBSC for now. -AC_ARG_WITH([openbsc], - [AS_HELP_STRING([--with-openbsc=INCLUDE_DIR], - [OpenBSC include directory for openbsc/gsm_data_shared.h])], - [openbsc_incdir="$withval"], - [openbsc_incdir="`cd $srcdir; pwd`/../openbsc/openbsc/include"]) -AC_SUBST([OPENBSC_INCDIR], $openbsc_incdir) - -oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" -AC_CHECK_HEADER([openbsc/gsm_data_shared.h],[], - [AC_MSG_ERROR([openbsc/gsm_data_shared.h can not be found in $openbsc_incdir])], - [#include ]) -CPPFLAGS=$oldCPPFLAGS - # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR $LIBOSMOCORE_CFLAGS" diff --git a/debian/control b/debian/control index e1a58b2..074f687 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,6 @@ autotools-dev, pkg-config, libosmocore-dev, - openbsc-dev, libosmo-abis-dev, libosmo-netif-dev, libgps-dev, diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index ef4165f..a15ce3d 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,4 +1,4 @@ -noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ +noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h gsm_data_shared.h logging.h measurement.h \ oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \ power_control.h scheduler.h scheduler_backend.h phy_link.h \ diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index aeac4b2..dcffcf6 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -133,7 +133,7 @@ #define bts_role_bts(x) ((struct gsm_bts_role_bts *)(x)->role) -#include "openbsc/gsm_data_shared.h" +#include void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state); int conf_lchans_as_pchan(struct gsm_bts_trx_ts *ts, diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h new file mode 100644 index 0000000..c19b125 --- /dev/null +++ b/include/osmo-bts/gsm_data_shared.h @@ -0,0 +1,999 @@ +#ifndef _GSM_DATA_SHAREDH +#define _GSM_DATA_SHAREDH + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifndef ROLE_BSC +#include +#endif + +/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: + 4-bit index is used (2#1111 = 10#15) */ +#define SI2Q_MAX_NUM 16 +/* length in bits (for single SI2quater message) */ +#define SI2Q_MAX_LEN 160 +#define SI2Q_MIN_LEN 18 + +struct osmo_bsc_data; + +struct osmo_bsc_sccp_con; +struct gsm_sms_queue; + +/* RRLP mode of operation */ +enum rrlp_mode { + RRLP_MODE_NONE, + RRLP_MODE_MS_BASED, + RRLP_MODE_MS_PREF, + RRLP_MODE_ASS_PREF, +}; + +/* Channel Request reason */ +enum gsm_chreq_reason_t { + GSM_CHREQ_REASON_EMERG, + GSM_CHREQ_REASON_PAG, + GSM_CHREQ_REASON_CALL, + GSM_CHREQ_REASON_LOCATION_UPD, + GSM_CHREQ_REASON_OTHER, + GSM_CHREQ_REASON_PDCH, +}; + +/* lchans 0..3 are SDCCH in combined channel configuration, + use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */ +#define CCCH_LCHAN 4 + +#define TRX_NR_TS 8 +#define TS_MAX_LCHAN 8 + +#define HARDCODED_ARFCN 123 +#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */ + +/* for multi-drop config */ +#define HARDCODED_BTS0_TS 1 +#define HARDCODED_BTS1_TS 6 +#define HARDCODED_BTS2_TS 11 + +#define MAX_VERSION_LENGTH 64 + +#define MAX_BTS_FEATURES 128 + +enum gsm_hooks { + GSM_HOOK_NM_SWLOAD, + GSM_HOOK_RR_PAGING, + GSM_HOOK_RR_SECURITY, +}; + +enum gsm_paging_event { + GSM_PAGING_SUCCEEDED, + GSM_PAGING_EXPIRED, + GSM_PAGING_OOM, + GSM_PAGING_BUSY, +}; + +enum bts_gprs_mode { + BTS_GPRS_NONE = 0, + BTS_GPRS_GPRS = 1, + BTS_GPRS_EGPRS = 2, +}; + +struct gsm_lchan; +struct gsm_subscriber; +struct gsm_mncc; +struct osmo_rtp_socket; +struct rtp_socket; +struct bsc_api; + +/* Network Management State */ +struct gsm_nm_state { + uint8_t operational; + uint8_t administrative; + uint8_t availability; +}; + +struct gsm_abis_mo { + uint8_t obj_class; + uint8_t procedure_pending; + struct abis_om_obj_inst obj_inst; + const char *name; + struct gsm_nm_state nm_state; + struct tlv_parsed *nm_attr; + struct gsm_bts *bts; +}; + +/* Ericsson OM2000 Managed Object */ +struct abis_om2k_mo { + uint8_t class; + uint8_t bts; + uint8_t assoc_so; + uint8_t inst; +} __attribute__ ((packed)); + +struct om2k_mo { + struct abis_om2k_mo addr; + struct osmo_fsm_inst *fsm; +}; + +#define MAX_A5_KEY_LEN (128/8) +#define A38_XOR_MIN_KEY_LEN 12 +#define A38_XOR_MAX_KEY_LEN 16 +#define A38_COMP128_KEY_LEN 16 +#define RSL_ENC_ALG_A5(x) (x+1) +#define MAX_EARFCN_LIST 32 + +/* is the data link established? who established it? */ +#define LCHAN_SAPI_UNUSED 0 +#define LCHAN_SAPI_MS 1 +#define LCHAN_SAPI_NET 2 +#define LCHAN_SAPI_REL 3 + +/* state of a logical channel */ +enum gsm_lchan_state { + LCHAN_S_NONE, /* channel is not active */ + LCHAN_S_ACT_REQ, /* channel activation requested */ + LCHAN_S_ACTIVE, /* channel is active and operational */ + LCHAN_S_REL_REQ, /* channel release has been requested */ + LCHAN_S_REL_ERR, /* channel is in an error state */ + LCHAN_S_BROKEN, /* channel is somehow unusable */ + LCHAN_S_INACTIVE, /* channel is set inactive */ +}; + +/* BTS ONLY */ +#define MAX_NUM_UL_MEAS 104 +#define LC_UL_M_F_L1_VALID (1 << 0) +#define LC_UL_M_F_RES_VALID (1 << 1) + +struct bts_ul_meas { + /* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */ + uint16_t ber10k; + /* timing advance offset (in quarter bits) */ + int16_t ta_offs_qbits; + /* C/I ratio in dB */ + float c_i; + /* flags */ + uint8_t is_sub:1; + /* RSSI in dBm * -1 */ + uint8_t inv_rssi; +}; + +struct bts_codec_conf { + uint8_t hr; + uint8_t efr; + uint8_t amr; +}; + +struct amr_mode { + uint8_t mode; + uint8_t threshold; + uint8_t hysteresis; +}; + +struct amr_multirate_conf { + uint8_t gsm48_ie[2]; + struct amr_mode ms_mode[4]; + struct amr_mode bts_mode[4]; + uint8_t num_modes; +}; +/* /BTS ONLY */ + +enum lchan_csd_mode { + LCHAN_CSD_M_NT, + LCHAN_CSD_M_T_1200_75, + LCHAN_CSD_M_T_600, + LCHAN_CSD_M_T_1200, + LCHAN_CSD_M_T_2400, + LCHAN_CSD_M_T_9600, + LCHAN_CSD_M_T_14400, + LCHAN_CSD_M_T_29000, + LCHAN_CSD_M_T_32000, +}; + +/* State of the SAPIs in the lchan */ +enum lchan_sapi_state { + LCHAN_SAPI_S_NONE, + LCHAN_SAPI_S_REQ, + LCHAN_SAPI_S_ASSIGNED, + LCHAN_SAPI_S_REL, + LCHAN_SAPI_S_ERROR, +}; + +struct gsm_lchan { + /* The TS that we're part of */ + struct gsm_bts_trx_ts *ts; + /* The logical subslot number in the TS */ + uint8_t nr; + /* The logical channel type */ + enum gsm_chan_t type; + /* RSL channel mode */ + enum rsl_cmod_spd rsl_cmode; + /* If TCH, traffic channel mode */ + enum gsm48_chan_mode tch_mode; + enum lchan_csd_mode csd_mode; + /* State */ + enum gsm_lchan_state state; + const char *broken_reason; + /* Power levels for MS and BTS */ + uint8_t bs_power; + uint8_t ms_power; + /* Encryption information */ + struct { + uint8_t alg_id; + uint8_t key_len; + uint8_t key[MAX_A5_KEY_LEN]; + } encr; + + /* AMR bits */ + uint8_t mr_ms_lv[7]; + uint8_t mr_bts_lv[7]; + + /* Established data link layer services */ + uint8_t sapis[8]; + int sacch_deact; + + struct { + uint32_t bound_ip; + uint32_t connect_ip; + uint16_t bound_port; + uint16_t connect_port; + uint16_t conn_id; + uint8_t rtp_payload; + uint8_t rtp_payload2; + uint8_t speech_mode; +#ifdef ROLE_BSC + struct rtp_socket *rtp_socket; +#else + struct osmo_rtp_socket *rtp_socket; +#endif + } abis_ip; + + uint8_t rqd_ta; + + char *name; + +#ifdef ROLE_BSC + struct osmo_timer_list T3101; + struct osmo_timer_list T3109; + struct osmo_timer_list T3111; + struct osmo_timer_list error_timer; + struct osmo_timer_list act_timer; + struct osmo_timer_list rel_work; + uint8_t error_cause; + + /* table of neighbor cell measurements */ + struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; + + /* cache of last measurement reports on this lchan */ + struct gsm_meas_rep meas_rep[6]; + int meas_rep_idx; + + /* GSM Random Access data */ + struct gsm48_req_ref *rqd_ref; + + struct gsm_subscriber_connection *conn; + + struct { + /* channel activation type and handover ref */ + uint8_t act_type; + uint8_t ho_ref; + struct gsm48_req_ref *rqd_ref; + uint8_t rqd_ta; + } dyn; +#else + /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. + * Currently we don't share these headers so this is a magic number. */ + struct llist_head sapi_cmds; + uint8_t sapis_dl[23]; + uint8_t sapis_ul[23]; + struct lapdm_channel lapdm_ch; + struct llist_head dl_tch_queue; + struct { + /* bitmask of all SI that are present/valid in si_buf */ + uint32_t valid; + uint32_t last; + /* buffers where we put the pre-computed SI: + SI2Q_MAX_NUM is the max number of SI2quater messages (see 3GPP TS 44.018) */ + sysinfo_buf_t buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; + } si; + struct { + uint8_t flags; + /* RSL measurment result number, 0 at lchan_act */ + uint8_t res_nr; + /* current Tx power level of the BTS */ + uint8_t bts_tx_pwr; + /* number of measurements stored in array below */ + uint8_t num_ul_meas; + struct bts_ul_meas uplink[MAX_NUM_UL_MEAS]; + /* last L1 header from the MS */ + uint8_t l1_info[2]; + struct gsm_meas_rep_unidir ul_res; + } meas; + struct { + struct amr_multirate_conf amr_mr; + struct { + struct osmo_fsm_inst *dl_amr_fsm; + /* TCH cache */ + uint8_t cache[20]; + /* FACCH cache */ + uint8_t facch[GSM_MACBLOCK_LEN]; + uint8_t len; + uint32_t fn; + bool is_update; + /* set for each SID frame to detect talkspurt for codecs + without explicit ONSET event */ + bool ul_sid; + /* indicates if DTXd was active during DL measurement + period */ + bool dl_active; + } dtx; + uint8_t last_cmr; + uint32_t last_fn; + } tch; + + /* 3GPP TS 48.058 ? 9.3.37: [0; 255] ok, -1 means invalid*/ + int16_t ms_t_offs; + /* 3GPP TS 45.010 ? 1.2 round trip propagation delay (in symbols) or -1 */ + int16_t p_offs; + + /* BTS-side ciphering state (rx only, bi-directional, ...) */ + uint8_t ciph_state; + uint8_t ciph_ns; + uint8_t loopback; + struct { + uint8_t active; + uint8_t ref; + /* T3105: PHYS INF retransmission */ + struct osmo_timer_list t3105; + /* counts up to Ny1 */ + unsigned int phys_info_count; + } ho; + /* S counter for link loss */ + int s; + /* Kind of the release/activation. E.g. RSL or PCU */ + int rel_act_kind; + /* RTP header Marker bit to indicate beginning of speech after pause */ + bool rtp_tx_marker; + /* power handling */ + struct { + uint8_t current; + uint8_t fixed; + } ms_power_ctrl; + + struct msgb *pending_rel_ind_msg; +#endif +}; + +enum { + TS_F_PDCH_ACTIVE = 0x1000, + TS_F_PDCH_ACT_PENDING = 0x2000, + TS_F_PDCH_DEACT_PENDING = 0x4000, + TS_F_PDCH_PENDING_MASK = 0x6000 /*< + TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */ +} gsm_bts_trx_ts_flags; + +/* One Timeslot in a TRX */ +struct gsm_bts_trx_ts { + struct gsm_bts_trx *trx; + /* number of this timeslot at the TRX */ + uint8_t nr; + + enum gsm_phys_chan_config pchan; + + struct { + enum gsm_phys_chan_config pchan_is; + enum gsm_phys_chan_config pchan_want; + struct msgb *pending_chan_activ; + } dyn; + + unsigned int flags; + struct gsm_abis_mo mo; + struct tlv_parsed nm_attr; + uint8_t nm_chan_comb; + int tsc; /* -1 == use BTS TSC */ + + struct { + /* Parameters below are configured by VTY */ + int enabled; + uint8_t maio; + uint8_t hsn; + struct bitvec arfcns; + uint8_t arfcns_data[1024/8]; + /* This is the pre-computed MA for channel assignments */ + struct bitvec ma; + uint8_t ma_len; /* part of ma_data that is used */ + uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */ + } hopping; + + /* To which E1 subslot are we connected */ + struct gsm_e1_subslot e1_link; + + union { + struct { + struct om2k_mo om2k_mo; + } rbs2000; + }; + + struct gsm_lchan lchan[TS_MAX_LCHAN]; +}; + +/* One TRX in a BTS */ +struct gsm_bts_trx { + /* list header in bts->trx_list */ + struct llist_head list; + + struct gsm_bts *bts; + /* number of this TRX in the BTS */ + uint8_t nr; + /* human readable name / description */ + char *description; + /* how do we talk RSL with this TRX? */ + struct gsm_e1_subslot rsl_e1_link; + uint8_t rsl_tei; + struct e1inp_sign_link *rsl_link; + + /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */ + struct e1inp_sign_link *oml_link; + + struct gsm_abis_mo mo; + struct tlv_parsed nm_attr; + struct { + struct gsm_abis_mo mo; + } bb_transc; + + uint16_t arfcn; + int nominal_power; /* in dBm */ + unsigned int max_power_red; /* in actual dB */ + +#ifndef ROLE_BSC + struct trx_power_params power_params; + int ms_power_control; + + struct { + void *l1h; + } role_bts; +#endif + + union { + struct { + struct { + struct gsm_abis_mo mo; + } bbsig; + struct { + struct gsm_abis_mo mo; + } pa; + } bs11; + struct { + unsigned int test_state; + uint8_t test_nr; + struct rxlev_stats rxlev_stat; + } ipaccess; + struct { + struct { + struct om2k_mo om2k_mo; + } trxc; + struct { + struct om2k_mo om2k_mo; + } rx; + struct { + struct om2k_mo om2k_mo; + } tx; + } rbs2000; + }; + struct gsm_bts_trx_ts ts[TRX_NR_TS]; +}; + +#define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i]) +#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i)) +#define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i][0]) +#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0]) + +enum gsm_bts_type { + GSM_BTS_TYPE_UNKNOWN, + GSM_BTS_TYPE_BS11, + GSM_BTS_TYPE_NANOBTS, + GSM_BTS_TYPE_RBS2000, + GSM_BTS_TYPE_NOKIA_SITE, + GSM_BTS_TYPE_OSMOBTS, + _NUM_GSM_BTS_TYPE +}; + +enum gsm_bts_type_variant { + BTS_UNKNOWN, + BTS_OSMO_LITECELL15, + BTS_OSMO_OCTPHY, + BTS_OSMO_SYSMO, + BTS_OSMO_TRX, + _NUM_BTS_VARIANT +}; + +/* Used by OML layer for BTS Attribute reporting */ +enum bts_attribute { + BTS_TYPE_VARIANT, + BTS_SUB_MODEL, + TRX_PHY_VERSION, +}; + +struct vty; + +struct gsm_bts_model { + struct llist_head list; + + enum gsm_bts_type type; + enum gsm_bts_type_variant variant; + const char *name; + + bool started; + int (*start)(struct gsm_network *net); + int (*oml_rcvmsg)(struct msgb *msg); + + void (*e1line_bind_ops)(struct e1inp_line *line); + + void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts); + void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx); + void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts); + + struct tlv_definition nm_att_tlvdef; + + /* features of a given BTS model set via gsm_bts_model_register() locally */ + struct bitvec features; + uint8_t _features_data[MAX_BTS_FEATURES/8]; +}; + +/* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility + with BTS compiled against earlier version of this header */ +enum gsm_bts_features { + BTS_FEAT_HSCSD, + BTS_FEAT_GPRS, + BTS_FEAT_EGPRS, + BTS_FEAT_ECSD, + BTS_FEAT_HOPPING, + BTS_FEAT_MULTI_TSC, + BTS_FEAT_OML_ALERTS, + BTS_FEAT_AGCH_PCH_PROP, + BTS_FEAT_CBCH, + _NUM_BTS_FEAT +}; + +extern const struct value_string gsm_bts_features_descs[]; + +/* + * This keeps track of the paging status of one BTS. It + * includes a number of pending requests, a back pointer + * to the gsm_bts, a timer and some more state. + */ +struct gsm_bts_paging_state { + /* pending requests */ + struct llist_head pending_requests; + struct gsm_bts *bts; + + struct osmo_timer_list work_timer; + struct osmo_timer_list credit_timer; + + /* free chans needed */ + int free_chans_need; + + /* load */ + uint16_t available_slots; +}; + +struct gsm_envabtse { + struct gsm_abis_mo mo; +}; + +struct gsm_bts_gprs_nsvc { + struct gsm_bts *bts; + /* data read via VTY config file, to configure the BTS + * via OML from BSC */ + int id; + uint16_t nsvci; + uint16_t local_port; /* on the BTS */ + uint16_t remote_port; /* on the SGSN */ + uint32_t remote_ip; /* on the SGSN */ + + struct gsm_abis_mo mo; +}; + +enum gprs_rlc_par { + RLC_T3142, + RLC_T3169, + RLC_T3191, + RLC_T3193, + RLC_T3195, + RLC_N3101, + RLC_N3103, + RLC_N3105, + CV_COUNTDOWN, + T_DL_TBF_EXT, /* ms */ + T_UL_TBF_EXT, /* ms */ + _NUM_RLC_PAR +}; + +enum gprs_cs { + GPRS_CS1, + GPRS_CS2, + GPRS_CS3, + GPRS_CS4, + GPRS_MCS1, + GPRS_MCS2, + GPRS_MCS3, + GPRS_MCS4, + GPRS_MCS5, + GPRS_MCS6, + GPRS_MCS7, + GPRS_MCS8, + GPRS_MCS9, + _NUM_GRPS_CS +}; + +struct gprs_rlc_cfg { + uint16_t parameter[_NUM_RLC_PAR]; + struct { + uint16_t repeat_time; /* ms */ + uint8_t repeat_count; + } paging; + uint32_t cs_mask; /* bitmask of gprs_cs */ + uint8_t initial_cs; + uint8_t initial_mcs; +}; + + +enum neigh_list_manual_mode { + NL_MODE_AUTOMATIC = 0, + NL_MODE_MANUAL = 1, + NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */ +}; + +enum bts_loc_fix { + BTS_LOC_FIX_INVALID = 0, + BTS_LOC_FIX_2D = 1, + BTS_LOC_FIX_3D = 2, +}; + +extern const struct value_string bts_loc_fix_names[]; + +struct bts_location { + struct llist_head list; + time_t tstamp; + enum bts_loc_fix valid; + double lat; + double lon; + double height; +}; + +/* One BTS */ +struct gsm_bts { + /* list header in net->bts_list */ + struct llist_head list; + + /* Geographical location of the BTS */ + struct llist_head loc_list; + + /* number of ths BTS in network */ + uint8_t nr; + /* human readable name / description */ + char *description; + /* Cell Identity */ + uint16_t cell_identity; + /* location area code of this BTS */ + uint16_t location_area_code; + /* Base Station Identification Code (BSIC), lower 3 bits is BCC, + * which is used as TSC for the CCCH */ + uint8_t bsic; + /* type of BTS */ + enum gsm_bts_type type; + enum gsm_bts_type_variant variant; + struct gsm_bts_model *model; + enum gsm_band band; + char version[MAX_VERSION_LENGTH]; + char sub_model[MAX_VERSION_LENGTH]; + + /* features of a given BTS set/reported via OML */ + struct bitvec features; + uint8_t _features_data[MAX_BTS_FEATURES/8]; + + /* Connected PCU version (if any) */ + char pcu_version[MAX_VERSION_LENGTH]; + + /* maximum Tx power that the MS is permitted to use in this cell */ + int ms_max_power; + + /* how do we talk OML with this TRX? */ + struct gsm_e1_subslot oml_e1_link; + uint8_t oml_tei; + struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; + + /* Abis network management O&M handle */ + struct abis_nm_h *nmh; + + struct gsm_abis_mo mo; + + /* number of this BTS on given E1 link */ + uint8_t bts_nr; + + /* DTX features of this BTS */ + enum gsm48_dtx_mode dtxu; + bool dtxd; + + /* paging state and control */ + struct gsm_bts_paging_state paging; + + /* CCCH is on C0 */ + struct gsm_bts_trx *c0; + + struct { + struct gsm_abis_mo mo; + } site_mgr; + + /* bitmask of all SI that are present/valid in si_buf */ + uint32_t si_valid; + /* 3GPP TS 44.018 Table 10.5.2.33b.1 INDEX and COUNT for SI2quater */ + uint8_t si2q_index; /* distinguish individual SI2quater messages */ + uint8_t si2q_count; /* si2q_index for the last (highest indexed) individual SI2quater message */ + /* buffers where we put the pre-computed SI */ + sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; + /* offsets used while generating SI2quater */ + size_t e_offset; + size_t u_offset; + + /* ip.accesss Unit ID's have Site/BTS/TRX layout */ + union { + struct { + uint16_t site_id; + uint16_t bts_id; + uint32_t flags; + uint32_t rsl_ip; + } ip_access; + struct { + struct { + struct gsm_abis_mo mo; + } cclk; + struct { + struct gsm_abis_mo mo; + } rack; + struct gsm_envabtse envabtse[4]; + } bs11; + struct { + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } cf; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } is; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } con; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + } dp; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + } tf; + uint32_t use_superchannel:1; + } rbs2000; + struct { + uint8_t bts_type; + unsigned int configured:1, + skip_reset:1, + no_loc_rel_cnf:1, + bts_reset_timer_cnf, + did_reset:1, + wait_reset:1; + struct osmo_timer_list reset_timer; + } nokia; + }; + + /* Not entirely sure how ip.access specific this is */ + struct { + uint8_t supports_egprs_11bit_rach; + enum bts_gprs_mode mode; + struct { + struct gsm_abis_mo mo; + uint16_t nsei; + uint8_t timer[7]; + } nse; + struct { + struct gsm_abis_mo mo; + uint16_t bvci; + uint8_t timer[11]; + struct gprs_rlc_cfg rlc_cfg; + } cell; + struct gsm_bts_gprs_nsvc nsvc[2]; + uint8_t rac; + uint8_t net_ctrl_ord; + bool ctrl_ack_type_use_block; + } gprs; + + /* RACH NM values */ + int rach_b_thresh; + int rach_ldavg_slots; + + /* transceivers */ + int num_trx; + struct llist_head trx_list; + + /* SI related items */ + int force_combined_si; + int bcch_change_mark; + +#ifdef ROLE_BSC + /* Abis NM queue */ + struct llist_head abis_queue; + int abis_nm_pend; + + struct gsm_network *network; + + /* should the channel allocator allocate channels from high TRX to TRX0, + * rather than starting from TRX0 and go upwards? */ + int chan_alloc_reverse; + + enum neigh_list_manual_mode neigh_list_manual_mode; + /* parameters from which we build SYSTEM INFORMATION */ + struct { + struct gsm48_rach_control rach_control; + uint8_t ncc_permitted; + struct gsm48_cell_sel_par cell_sel_par; + struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */ + struct gsm48_cell_options cell_options; + struct gsm48_control_channel_descr chan_desc; + struct bitvec neigh_list; + struct bitvec cell_alloc; + struct bitvec si5_neigh_list; + struct osmo_earfcn_si2q si2quater_neigh_list; + size_t uarfcn_length; /* index for uarfcn and scramble lists */ + struct { + /* bitmask large enough for all possible ARFCN's */ + uint8_t neigh_list[1024/8]; + uint8_t cell_alloc[1024/8]; + /* If the user wants a different neighbor list in SI5 than in SI2 */ + uint8_t si5_neigh_list[1024/8]; + uint8_t meas_bw_list[MAX_EARFCN_LIST]; + uint16_t earfcn_list[MAX_EARFCN_LIST]; + uint16_t uarfcn_list[MAX_EARFCN_LIST]; + uint16_t scramble_list[MAX_EARFCN_LIST]; + } data; + } si_common; + bool early_classmark_allowed; + /* for testing only: Have an infinitely long radio link timeout */ + bool infinite_radio_link_timeout; + + /* do we use static (user-defined) system information messages? (bitmask) */ + uint32_t si_mode_static; + + /* exclude the BTS from the global RF Lock handling */ + int excl_from_rf_lock; + + /* supported codecs beside FR */ + struct bts_codec_conf codec; + + /* BTS dependencies bit field */ + uint32_t depends_on[256/(8*4)]; + + /* full and half rate multirate config */ + struct amr_multirate_conf mr_full; + struct amr_multirate_conf mr_half; + + /* PCU socket state */ + char *pcu_sock_path; + struct pcu_sock_state *pcu_state; + +#endif /* ROLE_BSC */ + void *role; +}; + + +struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); +struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); + +struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); +struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); + +enum gsm_bts_type str2btstype(const char *arg); +const char *btstype2str(enum gsm_bts_type type); + +enum bts_attribute str2btsattr(const char *s); +const char *btsatttr2str(enum bts_attribute v); + +enum gsm_bts_type_variant str2btsvariant(const char *arg); +const char *btsvariant2str(enum gsm_bts_type_variant v); + +extern const struct value_string gsm_chreq_descs[]; +const struct value_string gsm_pchant_names[13]; +const struct value_string gsm_pchant_descs[13]; +const char *gsm_pchan_name(enum gsm_phys_chan_config c); +enum gsm_phys_chan_config gsm_pchan_parse(const char *name); +const char *gsm_lchant_name(enum gsm_chan_t c); +const char *gsm_chreq_name(enum gsm_chreq_reason_t c); +char *gsm_trx_name(const struct gsm_bts_trx *trx); +char *gsm_ts_name(const struct gsm_bts_trx_ts *ts); +char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts); +char *gsm_lchan_name_compute(const struct gsm_lchan *lchan); +const char *gsm_lchans_name(enum gsm_lchan_state s); + +static inline char *gsm_lchan_name(const struct gsm_lchan *lchan) +{ + return lchan->name; +} + +static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat) +{ + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); + return bitvec_set_bit_pos(&bts->features, feat, 1); +} + +static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat) +{ + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); + return bitvec_get_bit_pos(&bts->features, feat); +} + +void gsm_abis_mo_reset(struct gsm_abis_mo *mo); + +struct gsm_abis_mo * +gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); + +struct gsm_nm_state * +gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); +void * +gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); + +/* reset the state of all MO in the BTS */ +void gsm_bts_mo_reset(struct gsm_bts *bts); + +uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, + uint8_t ts_nr, uint8_t lchan_nr); +uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan); +uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, + enum gsm_phys_chan_config as_pchan); + +/* return the gsm_lchan for the CBCH (if it exists at all) */ +struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts); + +/* + * help with parsing regexps + */ +int gsm_parse_reg(void *ctx, regex_t *reg, char **str, + int argc, const char **argv) __attribute__ ((warn_unused_result)); + +static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts) +{ + if (ts->tsc != -1) + return ts->tsc; + else + return ts->trx->bts->bsic & 7; +} + +struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, + int *rc); + +enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts); +uint8_t ts_subslots(struct gsm_bts_trx_ts *ts); +bool ts_is_tch(struct gsm_bts_trx_ts *ts); + +#endif -- To view, visit https://gerrit.osmocom.org/4161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Oct 8 16:22:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 8 Oct 2017 16:22:29 +0000 Subject: [PATCH] osmo-bts[master]: Remove build dependency on legacy OpenBSC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4161 to look at the new patch set (#2). Remove build dependency on legacy OpenBSC * copy-paste gsm_data_shared.* from OpenBSC master * remove corresponding configure check and option * remove .deb dependency Actual refactoring with removal of unnecessary structures/parts, moving common OpenBSC/OsmoBSC parts into libraries etc. are left for further patches. Current patch will make coexistence with *BSC easier and will simplify our build infrastructure. Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13 Related: OS#1923 --- M configure.ac M debian/control M include/osmo-bts/Makefile.am M include/osmo-bts/gsm_data.h A include/osmo-bts/gsm_data_shared.h M src/common/gsm_data_shared.c 6 files changed, 1,854 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/4161/2 diff --git a/configure.ac b/configure.ac index bc36456..1a09f4b 100644 --- a/configure.ac +++ b/configure.ac @@ -147,22 +147,6 @@ CPPFLAGS=$oldCPPFLAGS fi -# We share gsm_data.h with OpenBSC and need to be pointed to the source -# directory of OpenBSC for now. -AC_ARG_WITH([openbsc], - [AS_HELP_STRING([--with-openbsc=INCLUDE_DIR], - [OpenBSC include directory for openbsc/gsm_data_shared.h])], - [openbsc_incdir="$withval"], - [openbsc_incdir="`cd $srcdir; pwd`/../openbsc/openbsc/include"]) -AC_SUBST([OPENBSC_INCDIR], $openbsc_incdir) - -oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" -AC_CHECK_HEADER([openbsc/gsm_data_shared.h],[], - [AC_MSG_ERROR([openbsc/gsm_data_shared.h can not be found in $openbsc_incdir])], - [#include ]) -CPPFLAGS=$oldCPPFLAGS - # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR $LIBOSMOCORE_CFLAGS" diff --git a/debian/control b/debian/control index e1a58b2..074f687 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,6 @@ autotools-dev, pkg-config, libosmocore-dev, - openbsc-dev, libosmo-abis-dev, libosmo-netif-dev, libgps-dev, diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index ef4165f..a15ce3d 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,4 +1,4 @@ -noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ +noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h gsm_data_shared.h logging.h measurement.h \ oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \ power_control.h scheduler.h scheduler_backend.h phy_link.h \ diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index aeac4b2..dcffcf6 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -133,7 +133,7 @@ #define bts_role_bts(x) ((struct gsm_bts_role_bts *)(x)->role) -#include "openbsc/gsm_data_shared.h" +#include void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state); int conf_lchans_as_pchan(struct gsm_bts_trx_ts *ts, diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h new file mode 100644 index 0000000..c19b125 --- /dev/null +++ b/include/osmo-bts/gsm_data_shared.h @@ -0,0 +1,999 @@ +#ifndef _GSM_DATA_SHAREDH +#define _GSM_DATA_SHAREDH + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifndef ROLE_BSC +#include +#endif + +/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: + 4-bit index is used (2#1111 = 10#15) */ +#define SI2Q_MAX_NUM 16 +/* length in bits (for single SI2quater message) */ +#define SI2Q_MAX_LEN 160 +#define SI2Q_MIN_LEN 18 + +struct osmo_bsc_data; + +struct osmo_bsc_sccp_con; +struct gsm_sms_queue; + +/* RRLP mode of operation */ +enum rrlp_mode { + RRLP_MODE_NONE, + RRLP_MODE_MS_BASED, + RRLP_MODE_MS_PREF, + RRLP_MODE_ASS_PREF, +}; + +/* Channel Request reason */ +enum gsm_chreq_reason_t { + GSM_CHREQ_REASON_EMERG, + GSM_CHREQ_REASON_PAG, + GSM_CHREQ_REASON_CALL, + GSM_CHREQ_REASON_LOCATION_UPD, + GSM_CHREQ_REASON_OTHER, + GSM_CHREQ_REASON_PDCH, +}; + +/* lchans 0..3 are SDCCH in combined channel configuration, + use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */ +#define CCCH_LCHAN 4 + +#define TRX_NR_TS 8 +#define TS_MAX_LCHAN 8 + +#define HARDCODED_ARFCN 123 +#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */ + +/* for multi-drop config */ +#define HARDCODED_BTS0_TS 1 +#define HARDCODED_BTS1_TS 6 +#define HARDCODED_BTS2_TS 11 + +#define MAX_VERSION_LENGTH 64 + +#define MAX_BTS_FEATURES 128 + +enum gsm_hooks { + GSM_HOOK_NM_SWLOAD, + GSM_HOOK_RR_PAGING, + GSM_HOOK_RR_SECURITY, +}; + +enum gsm_paging_event { + GSM_PAGING_SUCCEEDED, + GSM_PAGING_EXPIRED, + GSM_PAGING_OOM, + GSM_PAGING_BUSY, +}; + +enum bts_gprs_mode { + BTS_GPRS_NONE = 0, + BTS_GPRS_GPRS = 1, + BTS_GPRS_EGPRS = 2, +}; + +struct gsm_lchan; +struct gsm_subscriber; +struct gsm_mncc; +struct osmo_rtp_socket; +struct rtp_socket; +struct bsc_api; + +/* Network Management State */ +struct gsm_nm_state { + uint8_t operational; + uint8_t administrative; + uint8_t availability; +}; + +struct gsm_abis_mo { + uint8_t obj_class; + uint8_t procedure_pending; + struct abis_om_obj_inst obj_inst; + const char *name; + struct gsm_nm_state nm_state; + struct tlv_parsed *nm_attr; + struct gsm_bts *bts; +}; + +/* Ericsson OM2000 Managed Object */ +struct abis_om2k_mo { + uint8_t class; + uint8_t bts; + uint8_t assoc_so; + uint8_t inst; +} __attribute__ ((packed)); + +struct om2k_mo { + struct abis_om2k_mo addr; + struct osmo_fsm_inst *fsm; +}; + +#define MAX_A5_KEY_LEN (128/8) +#define A38_XOR_MIN_KEY_LEN 12 +#define A38_XOR_MAX_KEY_LEN 16 +#define A38_COMP128_KEY_LEN 16 +#define RSL_ENC_ALG_A5(x) (x+1) +#define MAX_EARFCN_LIST 32 + +/* is the data link established? who established it? */ +#define LCHAN_SAPI_UNUSED 0 +#define LCHAN_SAPI_MS 1 +#define LCHAN_SAPI_NET 2 +#define LCHAN_SAPI_REL 3 + +/* state of a logical channel */ +enum gsm_lchan_state { + LCHAN_S_NONE, /* channel is not active */ + LCHAN_S_ACT_REQ, /* channel activation requested */ + LCHAN_S_ACTIVE, /* channel is active and operational */ + LCHAN_S_REL_REQ, /* channel release has been requested */ + LCHAN_S_REL_ERR, /* channel is in an error state */ + LCHAN_S_BROKEN, /* channel is somehow unusable */ + LCHAN_S_INACTIVE, /* channel is set inactive */ +}; + +/* BTS ONLY */ +#define MAX_NUM_UL_MEAS 104 +#define LC_UL_M_F_L1_VALID (1 << 0) +#define LC_UL_M_F_RES_VALID (1 << 1) + +struct bts_ul_meas { + /* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */ + uint16_t ber10k; + /* timing advance offset (in quarter bits) */ + int16_t ta_offs_qbits; + /* C/I ratio in dB */ + float c_i; + /* flags */ + uint8_t is_sub:1; + /* RSSI in dBm * -1 */ + uint8_t inv_rssi; +}; + +struct bts_codec_conf { + uint8_t hr; + uint8_t efr; + uint8_t amr; +}; + +struct amr_mode { + uint8_t mode; + uint8_t threshold; + uint8_t hysteresis; +}; + +struct amr_multirate_conf { + uint8_t gsm48_ie[2]; + struct amr_mode ms_mode[4]; + struct amr_mode bts_mode[4]; + uint8_t num_modes; +}; +/* /BTS ONLY */ + +enum lchan_csd_mode { + LCHAN_CSD_M_NT, + LCHAN_CSD_M_T_1200_75, + LCHAN_CSD_M_T_600, + LCHAN_CSD_M_T_1200, + LCHAN_CSD_M_T_2400, + LCHAN_CSD_M_T_9600, + LCHAN_CSD_M_T_14400, + LCHAN_CSD_M_T_29000, + LCHAN_CSD_M_T_32000, +}; + +/* State of the SAPIs in the lchan */ +enum lchan_sapi_state { + LCHAN_SAPI_S_NONE, + LCHAN_SAPI_S_REQ, + LCHAN_SAPI_S_ASSIGNED, + LCHAN_SAPI_S_REL, + LCHAN_SAPI_S_ERROR, +}; + +struct gsm_lchan { + /* The TS that we're part of */ + struct gsm_bts_trx_ts *ts; + /* The logical subslot number in the TS */ + uint8_t nr; + /* The logical channel type */ + enum gsm_chan_t type; + /* RSL channel mode */ + enum rsl_cmod_spd rsl_cmode; + /* If TCH, traffic channel mode */ + enum gsm48_chan_mode tch_mode; + enum lchan_csd_mode csd_mode; + /* State */ + enum gsm_lchan_state state; + const char *broken_reason; + /* Power levels for MS and BTS */ + uint8_t bs_power; + uint8_t ms_power; + /* Encryption information */ + struct { + uint8_t alg_id; + uint8_t key_len; + uint8_t key[MAX_A5_KEY_LEN]; + } encr; + + /* AMR bits */ + uint8_t mr_ms_lv[7]; + uint8_t mr_bts_lv[7]; + + /* Established data link layer services */ + uint8_t sapis[8]; + int sacch_deact; + + struct { + uint32_t bound_ip; + uint32_t connect_ip; + uint16_t bound_port; + uint16_t connect_port; + uint16_t conn_id; + uint8_t rtp_payload; + uint8_t rtp_payload2; + uint8_t speech_mode; +#ifdef ROLE_BSC + struct rtp_socket *rtp_socket; +#else + struct osmo_rtp_socket *rtp_socket; +#endif + } abis_ip; + + uint8_t rqd_ta; + + char *name; + +#ifdef ROLE_BSC + struct osmo_timer_list T3101; + struct osmo_timer_list T3109; + struct osmo_timer_list T3111; + struct osmo_timer_list error_timer; + struct osmo_timer_list act_timer; + struct osmo_timer_list rel_work; + uint8_t error_cause; + + /* table of neighbor cell measurements */ + struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; + + /* cache of last measurement reports on this lchan */ + struct gsm_meas_rep meas_rep[6]; + int meas_rep_idx; + + /* GSM Random Access data */ + struct gsm48_req_ref *rqd_ref; + + struct gsm_subscriber_connection *conn; + + struct { + /* channel activation type and handover ref */ + uint8_t act_type; + uint8_t ho_ref; + struct gsm48_req_ref *rqd_ref; + uint8_t rqd_ta; + } dyn; +#else + /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. + * Currently we don't share these headers so this is a magic number. */ + struct llist_head sapi_cmds; + uint8_t sapis_dl[23]; + uint8_t sapis_ul[23]; + struct lapdm_channel lapdm_ch; + struct llist_head dl_tch_queue; + struct { + /* bitmask of all SI that are present/valid in si_buf */ + uint32_t valid; + uint32_t last; + /* buffers where we put the pre-computed SI: + SI2Q_MAX_NUM is the max number of SI2quater messages (see 3GPP TS 44.018) */ + sysinfo_buf_t buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; + } si; + struct { + uint8_t flags; + /* RSL measurment result number, 0 at lchan_act */ + uint8_t res_nr; + /* current Tx power level of the BTS */ + uint8_t bts_tx_pwr; + /* number of measurements stored in array below */ + uint8_t num_ul_meas; + struct bts_ul_meas uplink[MAX_NUM_UL_MEAS]; + /* last L1 header from the MS */ + uint8_t l1_info[2]; + struct gsm_meas_rep_unidir ul_res; + } meas; + struct { + struct amr_multirate_conf amr_mr; + struct { + struct osmo_fsm_inst *dl_amr_fsm; + /* TCH cache */ + uint8_t cache[20]; + /* FACCH cache */ + uint8_t facch[GSM_MACBLOCK_LEN]; + uint8_t len; + uint32_t fn; + bool is_update; + /* set for each SID frame to detect talkspurt for codecs + without explicit ONSET event */ + bool ul_sid; + /* indicates if DTXd was active during DL measurement + period */ + bool dl_active; + } dtx; + uint8_t last_cmr; + uint32_t last_fn; + } tch; + + /* 3GPP TS 48.058 ? 9.3.37: [0; 255] ok, -1 means invalid*/ + int16_t ms_t_offs; + /* 3GPP TS 45.010 ? 1.2 round trip propagation delay (in symbols) or -1 */ + int16_t p_offs; + + /* BTS-side ciphering state (rx only, bi-directional, ...) */ + uint8_t ciph_state; + uint8_t ciph_ns; + uint8_t loopback; + struct { + uint8_t active; + uint8_t ref; + /* T3105: PHYS INF retransmission */ + struct osmo_timer_list t3105; + /* counts up to Ny1 */ + unsigned int phys_info_count; + } ho; + /* S counter for link loss */ + int s; + /* Kind of the release/activation. E.g. RSL or PCU */ + int rel_act_kind; + /* RTP header Marker bit to indicate beginning of speech after pause */ + bool rtp_tx_marker; + /* power handling */ + struct { + uint8_t current; + uint8_t fixed; + } ms_power_ctrl; + + struct msgb *pending_rel_ind_msg; +#endif +}; + +enum { + TS_F_PDCH_ACTIVE = 0x1000, + TS_F_PDCH_ACT_PENDING = 0x2000, + TS_F_PDCH_DEACT_PENDING = 0x4000, + TS_F_PDCH_PENDING_MASK = 0x6000 /*< + TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */ +} gsm_bts_trx_ts_flags; + +/* One Timeslot in a TRX */ +struct gsm_bts_trx_ts { + struct gsm_bts_trx *trx; + /* number of this timeslot at the TRX */ + uint8_t nr; + + enum gsm_phys_chan_config pchan; + + struct { + enum gsm_phys_chan_config pchan_is; + enum gsm_phys_chan_config pchan_want; + struct msgb *pending_chan_activ; + } dyn; + + unsigned int flags; + struct gsm_abis_mo mo; + struct tlv_parsed nm_attr; + uint8_t nm_chan_comb; + int tsc; /* -1 == use BTS TSC */ + + struct { + /* Parameters below are configured by VTY */ + int enabled; + uint8_t maio; + uint8_t hsn; + struct bitvec arfcns; + uint8_t arfcns_data[1024/8]; + /* This is the pre-computed MA for channel assignments */ + struct bitvec ma; + uint8_t ma_len; /* part of ma_data that is used */ + uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */ + } hopping; + + /* To which E1 subslot are we connected */ + struct gsm_e1_subslot e1_link; + + union { + struct { + struct om2k_mo om2k_mo; + } rbs2000; + }; + + struct gsm_lchan lchan[TS_MAX_LCHAN]; +}; + +/* One TRX in a BTS */ +struct gsm_bts_trx { + /* list header in bts->trx_list */ + struct llist_head list; + + struct gsm_bts *bts; + /* number of this TRX in the BTS */ + uint8_t nr; + /* human readable name / description */ + char *description; + /* how do we talk RSL with this TRX? */ + struct gsm_e1_subslot rsl_e1_link; + uint8_t rsl_tei; + struct e1inp_sign_link *rsl_link; + + /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */ + struct e1inp_sign_link *oml_link; + + struct gsm_abis_mo mo; + struct tlv_parsed nm_attr; + struct { + struct gsm_abis_mo mo; + } bb_transc; + + uint16_t arfcn; + int nominal_power; /* in dBm */ + unsigned int max_power_red; /* in actual dB */ + +#ifndef ROLE_BSC + struct trx_power_params power_params; + int ms_power_control; + + struct { + void *l1h; + } role_bts; +#endif + + union { + struct { + struct { + struct gsm_abis_mo mo; + } bbsig; + struct { + struct gsm_abis_mo mo; + } pa; + } bs11; + struct { + unsigned int test_state; + uint8_t test_nr; + struct rxlev_stats rxlev_stat; + } ipaccess; + struct { + struct { + struct om2k_mo om2k_mo; + } trxc; + struct { + struct om2k_mo om2k_mo; + } rx; + struct { + struct om2k_mo om2k_mo; + } tx; + } rbs2000; + }; + struct gsm_bts_trx_ts ts[TRX_NR_TS]; +}; + +#define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i]) +#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i)) +#define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i][0]) +#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0]) + +enum gsm_bts_type { + GSM_BTS_TYPE_UNKNOWN, + GSM_BTS_TYPE_BS11, + GSM_BTS_TYPE_NANOBTS, + GSM_BTS_TYPE_RBS2000, + GSM_BTS_TYPE_NOKIA_SITE, + GSM_BTS_TYPE_OSMOBTS, + _NUM_GSM_BTS_TYPE +}; + +enum gsm_bts_type_variant { + BTS_UNKNOWN, + BTS_OSMO_LITECELL15, + BTS_OSMO_OCTPHY, + BTS_OSMO_SYSMO, + BTS_OSMO_TRX, + _NUM_BTS_VARIANT +}; + +/* Used by OML layer for BTS Attribute reporting */ +enum bts_attribute { + BTS_TYPE_VARIANT, + BTS_SUB_MODEL, + TRX_PHY_VERSION, +}; + +struct vty; + +struct gsm_bts_model { + struct llist_head list; + + enum gsm_bts_type type; + enum gsm_bts_type_variant variant; + const char *name; + + bool started; + int (*start)(struct gsm_network *net); + int (*oml_rcvmsg)(struct msgb *msg); + + void (*e1line_bind_ops)(struct e1inp_line *line); + + void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts); + void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx); + void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts); + + struct tlv_definition nm_att_tlvdef; + + /* features of a given BTS model set via gsm_bts_model_register() locally */ + struct bitvec features; + uint8_t _features_data[MAX_BTS_FEATURES/8]; +}; + +/* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility + with BTS compiled against earlier version of this header */ +enum gsm_bts_features { + BTS_FEAT_HSCSD, + BTS_FEAT_GPRS, + BTS_FEAT_EGPRS, + BTS_FEAT_ECSD, + BTS_FEAT_HOPPING, + BTS_FEAT_MULTI_TSC, + BTS_FEAT_OML_ALERTS, + BTS_FEAT_AGCH_PCH_PROP, + BTS_FEAT_CBCH, + _NUM_BTS_FEAT +}; + +extern const struct value_string gsm_bts_features_descs[]; + +/* + * This keeps track of the paging status of one BTS. It + * includes a number of pending requests, a back pointer + * to the gsm_bts, a timer and some more state. + */ +struct gsm_bts_paging_state { + /* pending requests */ + struct llist_head pending_requests; + struct gsm_bts *bts; + + struct osmo_timer_list work_timer; + struct osmo_timer_list credit_timer; + + /* free chans needed */ + int free_chans_need; + + /* load */ + uint16_t available_slots; +}; + +struct gsm_envabtse { + struct gsm_abis_mo mo; +}; + +struct gsm_bts_gprs_nsvc { + struct gsm_bts *bts; + /* data read via VTY config file, to configure the BTS + * via OML from BSC */ + int id; + uint16_t nsvci; + uint16_t local_port; /* on the BTS */ + uint16_t remote_port; /* on the SGSN */ + uint32_t remote_ip; /* on the SGSN */ + + struct gsm_abis_mo mo; +}; + +enum gprs_rlc_par { + RLC_T3142, + RLC_T3169, + RLC_T3191, + RLC_T3193, + RLC_T3195, + RLC_N3101, + RLC_N3103, + RLC_N3105, + CV_COUNTDOWN, + T_DL_TBF_EXT, /* ms */ + T_UL_TBF_EXT, /* ms */ + _NUM_RLC_PAR +}; + +enum gprs_cs { + GPRS_CS1, + GPRS_CS2, + GPRS_CS3, + GPRS_CS4, + GPRS_MCS1, + GPRS_MCS2, + GPRS_MCS3, + GPRS_MCS4, + GPRS_MCS5, + GPRS_MCS6, + GPRS_MCS7, + GPRS_MCS8, + GPRS_MCS9, + _NUM_GRPS_CS +}; + +struct gprs_rlc_cfg { + uint16_t parameter[_NUM_RLC_PAR]; + struct { + uint16_t repeat_time; /* ms */ + uint8_t repeat_count; + } paging; + uint32_t cs_mask; /* bitmask of gprs_cs */ + uint8_t initial_cs; + uint8_t initial_mcs; +}; + + +enum neigh_list_manual_mode { + NL_MODE_AUTOMATIC = 0, + NL_MODE_MANUAL = 1, + NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */ +}; + +enum bts_loc_fix { + BTS_LOC_FIX_INVALID = 0, + BTS_LOC_FIX_2D = 1, + BTS_LOC_FIX_3D = 2, +}; + +extern const struct value_string bts_loc_fix_names[]; + +struct bts_location { + struct llist_head list; + time_t tstamp; + enum bts_loc_fix valid; + double lat; + double lon; + double height; +}; + +/* One BTS */ +struct gsm_bts { + /* list header in net->bts_list */ + struct llist_head list; + + /* Geographical location of the BTS */ + struct llist_head loc_list; + + /* number of ths BTS in network */ + uint8_t nr; + /* human readable name / description */ + char *description; + /* Cell Identity */ + uint16_t cell_identity; + /* location area code of this BTS */ + uint16_t location_area_code; + /* Base Station Identification Code (BSIC), lower 3 bits is BCC, + * which is used as TSC for the CCCH */ + uint8_t bsic; + /* type of BTS */ + enum gsm_bts_type type; + enum gsm_bts_type_variant variant; + struct gsm_bts_model *model; + enum gsm_band band; + char version[MAX_VERSION_LENGTH]; + char sub_model[MAX_VERSION_LENGTH]; + + /* features of a given BTS set/reported via OML */ + struct bitvec features; + uint8_t _features_data[MAX_BTS_FEATURES/8]; + + /* Connected PCU version (if any) */ + char pcu_version[MAX_VERSION_LENGTH]; + + /* maximum Tx power that the MS is permitted to use in this cell */ + int ms_max_power; + + /* how do we talk OML with this TRX? */ + struct gsm_e1_subslot oml_e1_link; + uint8_t oml_tei; + struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; + + /* Abis network management O&M handle */ + struct abis_nm_h *nmh; + + struct gsm_abis_mo mo; + + /* number of this BTS on given E1 link */ + uint8_t bts_nr; + + /* DTX features of this BTS */ + enum gsm48_dtx_mode dtxu; + bool dtxd; + + /* paging state and control */ + struct gsm_bts_paging_state paging; + + /* CCCH is on C0 */ + struct gsm_bts_trx *c0; + + struct { + struct gsm_abis_mo mo; + } site_mgr; + + /* bitmask of all SI that are present/valid in si_buf */ + uint32_t si_valid; + /* 3GPP TS 44.018 Table 10.5.2.33b.1 INDEX and COUNT for SI2quater */ + uint8_t si2q_index; /* distinguish individual SI2quater messages */ + uint8_t si2q_count; /* si2q_index for the last (highest indexed) individual SI2quater message */ + /* buffers where we put the pre-computed SI */ + sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; + /* offsets used while generating SI2quater */ + size_t e_offset; + size_t u_offset; + + /* ip.accesss Unit ID's have Site/BTS/TRX layout */ + union { + struct { + uint16_t site_id; + uint16_t bts_id; + uint32_t flags; + uint32_t rsl_ip; + } ip_access; + struct { + struct { + struct gsm_abis_mo mo; + } cclk; + struct { + struct gsm_abis_mo mo; + } rack; + struct gsm_envabtse envabtse[4]; + } bs11; + struct { + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } cf; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } is; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } con; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + } dp; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + } tf; + uint32_t use_superchannel:1; + } rbs2000; + struct { + uint8_t bts_type; + unsigned int configured:1, + skip_reset:1, + no_loc_rel_cnf:1, + bts_reset_timer_cnf, + did_reset:1, + wait_reset:1; + struct osmo_timer_list reset_timer; + } nokia; + }; + + /* Not entirely sure how ip.access specific this is */ + struct { + uint8_t supports_egprs_11bit_rach; + enum bts_gprs_mode mode; + struct { + struct gsm_abis_mo mo; + uint16_t nsei; + uint8_t timer[7]; + } nse; + struct { + struct gsm_abis_mo mo; + uint16_t bvci; + uint8_t timer[11]; + struct gprs_rlc_cfg rlc_cfg; + } cell; + struct gsm_bts_gprs_nsvc nsvc[2]; + uint8_t rac; + uint8_t net_ctrl_ord; + bool ctrl_ack_type_use_block; + } gprs; + + /* RACH NM values */ + int rach_b_thresh; + int rach_ldavg_slots; + + /* transceivers */ + int num_trx; + struct llist_head trx_list; + + /* SI related items */ + int force_combined_si; + int bcch_change_mark; + +#ifdef ROLE_BSC + /* Abis NM queue */ + struct llist_head abis_queue; + int abis_nm_pend; + + struct gsm_network *network; + + /* should the channel allocator allocate channels from high TRX to TRX0, + * rather than starting from TRX0 and go upwards? */ + int chan_alloc_reverse; + + enum neigh_list_manual_mode neigh_list_manual_mode; + /* parameters from which we build SYSTEM INFORMATION */ + struct { + struct gsm48_rach_control rach_control; + uint8_t ncc_permitted; + struct gsm48_cell_sel_par cell_sel_par; + struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */ + struct gsm48_cell_options cell_options; + struct gsm48_control_channel_descr chan_desc; + struct bitvec neigh_list; + struct bitvec cell_alloc; + struct bitvec si5_neigh_list; + struct osmo_earfcn_si2q si2quater_neigh_list; + size_t uarfcn_length; /* index for uarfcn and scramble lists */ + struct { + /* bitmask large enough for all possible ARFCN's */ + uint8_t neigh_list[1024/8]; + uint8_t cell_alloc[1024/8]; + /* If the user wants a different neighbor list in SI5 than in SI2 */ + uint8_t si5_neigh_list[1024/8]; + uint8_t meas_bw_list[MAX_EARFCN_LIST]; + uint16_t earfcn_list[MAX_EARFCN_LIST]; + uint16_t uarfcn_list[MAX_EARFCN_LIST]; + uint16_t scramble_list[MAX_EARFCN_LIST]; + } data; + } si_common; + bool early_classmark_allowed; + /* for testing only: Have an infinitely long radio link timeout */ + bool infinite_radio_link_timeout; + + /* do we use static (user-defined) system information messages? (bitmask) */ + uint32_t si_mode_static; + + /* exclude the BTS from the global RF Lock handling */ + int excl_from_rf_lock; + + /* supported codecs beside FR */ + struct bts_codec_conf codec; + + /* BTS dependencies bit field */ + uint32_t depends_on[256/(8*4)]; + + /* full and half rate multirate config */ + struct amr_multirate_conf mr_full; + struct amr_multirate_conf mr_half; + + /* PCU socket state */ + char *pcu_sock_path; + struct pcu_sock_state *pcu_state; + +#endif /* ROLE_BSC */ + void *role; +}; + + +struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); +struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); + +struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); +struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); + +enum gsm_bts_type str2btstype(const char *arg); +const char *btstype2str(enum gsm_bts_type type); + +enum bts_attribute str2btsattr(const char *s); +const char *btsatttr2str(enum bts_attribute v); + +enum gsm_bts_type_variant str2btsvariant(const char *arg); +const char *btsvariant2str(enum gsm_bts_type_variant v); + +extern const struct value_string gsm_chreq_descs[]; +const struct value_string gsm_pchant_names[13]; +const struct value_string gsm_pchant_descs[13]; +const char *gsm_pchan_name(enum gsm_phys_chan_config c); +enum gsm_phys_chan_config gsm_pchan_parse(const char *name); +const char *gsm_lchant_name(enum gsm_chan_t c); +const char *gsm_chreq_name(enum gsm_chreq_reason_t c); +char *gsm_trx_name(const struct gsm_bts_trx *trx); +char *gsm_ts_name(const struct gsm_bts_trx_ts *ts); +char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts); +char *gsm_lchan_name_compute(const struct gsm_lchan *lchan); +const char *gsm_lchans_name(enum gsm_lchan_state s); + +static inline char *gsm_lchan_name(const struct gsm_lchan *lchan) +{ + return lchan->name; +} + +static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat) +{ + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); + return bitvec_set_bit_pos(&bts->features, feat, 1); +} + +static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat) +{ + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); + return bitvec_get_bit_pos(&bts->features, feat); +} + +void gsm_abis_mo_reset(struct gsm_abis_mo *mo); + +struct gsm_abis_mo * +gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); + +struct gsm_nm_state * +gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); +void * +gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); + +/* reset the state of all MO in the BTS */ +void gsm_bts_mo_reset(struct gsm_bts *bts); + +uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, + uint8_t ts_nr, uint8_t lchan_nr); +uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan); +uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, + enum gsm_phys_chan_config as_pchan); + +/* return the gsm_lchan for the CBCH (if it exists at all) */ +struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts); + +/* + * help with parsing regexps + */ +int gsm_parse_reg(void *ctx, regex_t *reg, char **str, + int argc, const char **argv) __attribute__ ((warn_unused_result)); + +static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts) +{ + if (ts->tsc != -1) + return ts->tsc; + else + return ts->trx->bts->bsic & 7; +} + +struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, + int *rc); + +enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts); +uint8_t ts_subslots(struct gsm_bts_trx_ts *ts); +bool ts_is_tch(struct gsm_bts_trx_ts *ts); + +#endif diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c index 706892d..2696273 100644 --- a/src/common/gsm_data_shared.c +++ b/src/common/gsm_data_shared.c @@ -1 +1,853 @@ -#include "../../../openbsc/openbsc/src/libcommon/gsm_data_shared.c" +/* (C) 2008-2010 by Harald Welte + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include + +void gsm_abis_mo_reset(struct gsm_abis_mo *mo) +{ + mo->nm_state.operational = NM_OPSTATE_NULL; + mo->nm_state.availability = NM_AVSTATE_POWER_OFF; +} + +static void gsm_mo_init(struct gsm_abis_mo *mo, struct gsm_bts *bts, + uint8_t obj_class, uint8_t p1, uint8_t p2, uint8_t p3) +{ + mo->bts = bts; + mo->obj_class = obj_class; + mo->obj_inst.bts_nr = p1; + mo->obj_inst.trx_nr = p2; + mo->obj_inst.ts_nr = p3; + gsm_abis_mo_reset(mo); +} + +const struct value_string bts_attribute_names[] = { + OSMO_VALUE_STRING(BTS_TYPE_VARIANT), + OSMO_VALUE_STRING(BTS_SUB_MODEL), + OSMO_VALUE_STRING(TRX_PHY_VERSION), + { 0, NULL } +}; + +enum bts_attribute str2btsattr(const char *s) +{ + return get_string_value(bts_attribute_names, s); +} + +const char *btsatttr2str(enum bts_attribute v) +{ + return get_value_string(bts_attribute_names, v); +} + +const struct value_string osmo_bts_variant_names[_NUM_BTS_VARIANT + 1] = { + { BTS_UNKNOWN, "unknown" }, + { BTS_OSMO_LITECELL15, "osmo-bts-lc15" }, + { BTS_OSMO_OCTPHY, "osmo-bts-octphy" }, + { BTS_OSMO_SYSMO, "osmo-bts-sysmo" }, + { BTS_OSMO_TRX, "omso-bts-trx" }, + { 0, NULL } +}; + +enum gsm_bts_type_variant str2btsvariant(const char *arg) +{ + return get_string_value(osmo_bts_variant_names, arg); +} + +const char *btsvariant2str(enum gsm_bts_type_variant v) +{ + return get_value_string(osmo_bts_variant_names, v); +} + +const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE + 1] = { + { GSM_BTS_TYPE_UNKNOWN, "unknown" }, + { GSM_BTS_TYPE_BS11, "bs11" }, + { GSM_BTS_TYPE_NANOBTS, "nanobts" }, + { GSM_BTS_TYPE_RBS2000, "rbs2000" }, + { GSM_BTS_TYPE_NOKIA_SITE, "nokia_site" }, + { GSM_BTS_TYPE_OSMOBTS, "sysmobts" }, + { 0, NULL } +}; + +enum gsm_bts_type str2btstype(const char *arg) +{ + return get_string_value(bts_type_names, arg); +} + +const char *btstype2str(enum gsm_bts_type type) +{ + return get_value_string(bts_type_names, type); +} + +const struct value_string gsm_bts_features_descs[] = { + { BTS_FEAT_HSCSD, "HSCSD" }, + { BTS_FEAT_GPRS, "GPRS" }, + { BTS_FEAT_EGPRS, "EGPRS" }, + { BTS_FEAT_ECSD, "ECSD" }, + { BTS_FEAT_HOPPING, "Frequency Hopping" }, + { BTS_FEAT_MULTI_TSC, "Multi-TSC" }, + { BTS_FEAT_OML_ALERTS, "OML Alerts" }, + { BTS_FEAT_AGCH_PCH_PROP, "AGCH/PCH proportional allocation" }, + { BTS_FEAT_CBCH, "CBCH" }, + { 0, NULL } +}; + +const struct value_string gsm_chreq_descs[] = { + { GSM_CHREQ_REASON_EMERG, "emergency call" }, + { GSM_CHREQ_REASON_PAG, "answer to paging" }, + { GSM_CHREQ_REASON_CALL, "call re-establishment" }, + { GSM_CHREQ_REASON_LOCATION_UPD,"Location updating" }, + { GSM_CHREQ_REASON_PDCH, "one phase packet access" }, + { GSM_CHREQ_REASON_OTHER, "other" }, + { 0, NULL } +}; + +const struct value_string gsm_pchant_names[13] = { + { GSM_PCHAN_NONE, "NONE" }, + { GSM_PCHAN_CCCH, "CCCH" }, + { GSM_PCHAN_CCCH_SDCCH4,"CCCH+SDCCH4" }, + { GSM_PCHAN_TCH_F, "TCH/F" }, + { GSM_PCHAN_TCH_H, "TCH/H" }, + { GSM_PCHAN_SDCCH8_SACCH8C, "SDCCH8" }, + { GSM_PCHAN_PDCH, "PDCH" }, + { GSM_PCHAN_TCH_F_PDCH, "TCH/F_PDCH" }, + { GSM_PCHAN_UNKNOWN, "UNKNOWN" }, + { GSM_PCHAN_CCCH_SDCCH4_CBCH, "CCCH+SDCCH4+CBCH" }, + { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "SDCCH8+CBCH" }, + { GSM_PCHAN_TCH_F_TCH_H_PDCH, "TCH/F_TCH/H_PDCH" }, + { 0, NULL } +}; + +const struct value_string gsm_pchant_descs[13] = { + { GSM_PCHAN_NONE, "Physical Channel not configured" }, + { GSM_PCHAN_CCCH, "FCCH + SCH + BCCH + CCCH (Comb. IV)" }, + { GSM_PCHAN_CCCH_SDCCH4, + "FCCH + SCH + BCCH + CCCH + 4 SDCCH + 2 SACCH (Comb. V)" }, + { GSM_PCHAN_TCH_F, "TCH/F + FACCH/F + SACCH (Comb. I)" }, + { GSM_PCHAN_TCH_H, "2 TCH/H + 2 FACCH/H + 2 SACCH (Comb. II)" }, + { GSM_PCHAN_SDCCH8_SACCH8C, "8 SDCCH + 4 SACCH (Comb. VII)" }, + { GSM_PCHAN_PDCH, "Packet Data Channel for GPRS/EDGE" }, + { GSM_PCHAN_TCH_F_PDCH, "Dynamic TCH/F or GPRS PDCH" }, + { GSM_PCHAN_UNKNOWN, "Unknown / Unsupported channel combination" }, + { GSM_PCHAN_CCCH_SDCCH4_CBCH, "FCCH + SCH + BCCH + CCCH + CBCH + 3 SDCCH + 2 SACCH (Comb. V)" }, + { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "7 SDCCH + 4 SACCH + CBCH (Comb. VII)" }, + { GSM_PCHAN_TCH_F_TCH_H_PDCH, "Dynamic TCH/F or TCH/H or GPRS PDCH" }, + { 0, NULL } +}; + +const char *gsm_pchan_name(enum gsm_phys_chan_config c) +{ + return get_value_string(gsm_pchant_names, c); +} + +enum gsm_phys_chan_config gsm_pchan_parse(const char *name) +{ + return get_string_value(gsm_pchant_names, name); +} + +/* TODO: move to libosmocore, next to gsm_chan_t_names? */ +const char *gsm_lchant_name(enum gsm_chan_t c) +{ + return get_value_string(gsm_chan_t_names, c); +} + +static const struct value_string lchan_s_names[] = { + { LCHAN_S_NONE, "NONE" }, + { LCHAN_S_ACT_REQ, "ACTIVATION REQUESTED" }, + { LCHAN_S_ACTIVE, "ACTIVE" }, + { LCHAN_S_INACTIVE, "INACTIVE" }, + { LCHAN_S_REL_REQ, "RELEASE REQUESTED" }, + { LCHAN_S_REL_ERR, "RELEASE DUE ERROR" }, + { LCHAN_S_BROKEN, "BROKEN UNUSABLE" }, + { 0, NULL } +}; + +const char *gsm_lchans_name(enum gsm_lchan_state s) +{ + return get_value_string(lchan_s_names, s); +} + +static const struct value_string chreq_names[] = { + { GSM_CHREQ_REASON_EMERG, "EMERGENCY" }, + { GSM_CHREQ_REASON_PAG, "PAGING" }, + { GSM_CHREQ_REASON_CALL, "CALL" }, + { GSM_CHREQ_REASON_LOCATION_UPD,"LOCATION_UPDATE" }, + { GSM_CHREQ_REASON_OTHER, "OTHER" }, + { 0, NULL } +}; + +const char *gsm_chreq_name(enum gsm_chreq_reason_t c) +{ + return get_value_string(chreq_names, c); +} + +struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num) +{ + struct gsm_bts *bts; + + if (num >= net->num_bts) + return NULL; + + llist_for_each_entry(bts, &net->bts_list, list) { + if (bts->nr == num) + return bts; + } + + return NULL; +} + +struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx = talloc_zero(bts, struct gsm_bts_trx); + int k; + + if (!trx) + return NULL; + + trx->bts = bts; + trx->nr = bts->num_trx++; + trx->mo.nm_state.administrative = NM_STATE_UNLOCKED; + + gsm_mo_init(&trx->mo, bts, NM_OC_RADIO_CARRIER, + bts->nr, trx->nr, 0xff); + gsm_mo_init(&trx->bb_transc.mo, bts, NM_OC_BASEB_TRANSC, + bts->nr, trx->nr, 0xff); + + for (k = 0; k < TRX_NR_TS; k++) { + struct gsm_bts_trx_ts *ts = &trx->ts[k]; + int l; + + ts->trx = trx; + ts->nr = k; + ts->pchan = GSM_PCHAN_NONE; + ts->dyn.pchan_is = GSM_PCHAN_NONE; + ts->dyn.pchan_want = GSM_PCHAN_NONE; + ts->tsc = -1; + + gsm_mo_init(&ts->mo, bts, NM_OC_CHANNEL, + bts->nr, trx->nr, ts->nr); + + ts->hopping.arfcns.data_len = sizeof(ts->hopping.arfcns_data); + ts->hopping.arfcns.data = ts->hopping.arfcns_data; + ts->hopping.ma.data_len = sizeof(ts->hopping.ma_data); + ts->hopping.ma.data = ts->hopping.ma_data; + + for (l = 0; l < TS_MAX_LCHAN; l++) { + struct gsm_lchan *lchan; + char *name; + lchan = &ts->lchan[l]; + + lchan->ts = ts; + lchan->nr = l; + lchan->type = GSM_LCHAN_NONE; + + name = gsm_lchan_name_compute(lchan); + lchan->name = talloc_strdup(trx, name); +#ifndef ROLE_BSC + INIT_LLIST_HEAD(&lchan->sapi_cmds); +#endif + } + } + + if (trx->nr != 0) + trx->nominal_power = bts->c0->nominal_power; + + llist_add_tail(&trx->list, &bts->trx_list); + + return trx; +} + + +static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 }; +static const uint8_t bts_cell_timer_default[] = + { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }; +static const struct gprs_rlc_cfg rlc_cfg_default = { + .parameter = { + [RLC_T3142] = 20, + [RLC_T3169] = 5, + [RLC_T3191] = 5, + [RLC_T3193] = 160, /* 10ms */ + [RLC_T3195] = 5, + [RLC_N3101] = 10, + [RLC_N3103] = 4, + [RLC_N3105] = 8, + [CV_COUNTDOWN] = 15, + [T_DL_TBF_EXT] = 250 * 10, /* ms */ + [T_UL_TBF_EXT] = 250 * 10, /* ms */ + }, + .paging = { + .repeat_time = 5 * 50, /* ms */ + .repeat_count = 3, + }, + .cs_mask = 0x1fff, + .initial_cs = 2, + .initial_mcs = 6, +}; + +struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) +{ + struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); + int i; + + if (!bts) + return NULL; + + bts->nr = bts_num; + bts->num_trx = 0; + INIT_LLIST_HEAD(&bts->trx_list); + bts->ms_max_power = 15; /* dBm */ + + gsm_mo_init(&bts->mo, bts, NM_OC_BTS, + bts->nr, 0xff, 0xff); + gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER, + 0xff, 0xff, 0xff); + + for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { + bts->gprs.nsvc[i].bts = bts; + bts->gprs.nsvc[i].id = i; + gsm_mo_init(&bts->gprs.nsvc[i].mo, bts, NM_OC_GPRS_NSVC, + bts->nr, i, 0xff); + } + memcpy(&bts->gprs.nse.timer, bts_nse_timer_default, + sizeof(bts->gprs.nse.timer)); + gsm_mo_init(&bts->gprs.nse.mo, bts, NM_OC_GPRS_NSE, + bts->nr, 0xff, 0xff); + memcpy(&bts->gprs.cell.timer, bts_cell_timer_default, + sizeof(bts->gprs.cell.timer)); + gsm_mo_init(&bts->gprs.cell.mo, bts, NM_OC_GPRS_CELL, + bts->nr, 0xff, 0xff); + memcpy(&bts->gprs.cell.rlc_cfg, &rlc_cfg_default, + sizeof(bts->gprs.cell.rlc_cfg)); + + /* create our primary TRX */ + bts->c0 = gsm_bts_trx_alloc(bts); + if (!bts->c0) { + talloc_free(bts); + return NULL; + } + bts->c0->ts[0].pchan = GSM_PCHAN_CCCH_SDCCH4; + + bts->rach_b_thresh = -1; + bts->rach_ldavg_slots = -1; + bts->paging.free_chans_need = -1; + bts->features.data = &bts->_features_data[0]; + bts->features.data_len = sizeof(bts->_features_data); + + /* si handling */ + bts->bcch_change_mark = 1; + + return bts; +} + +/* reset the state of all MO in the BTS */ +void gsm_bts_mo_reset(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx; + unsigned int i; + + gsm_abis_mo_reset(&bts->mo); + gsm_abis_mo_reset(&bts->site_mgr.mo); + for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) + gsm_abis_mo_reset(&bts->gprs.nsvc[i].mo); + gsm_abis_mo_reset(&bts->gprs.nse.mo); + gsm_abis_mo_reset(&bts->gprs.cell.mo); + + llist_for_each_entry(trx, &bts->trx_list, list) { + gsm_abis_mo_reset(&trx->mo); + gsm_abis_mo_reset(&trx->bb_transc.mo); + + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + gsm_abis_mo_reset(&ts->mo); + } + } +} + +struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num) +{ + struct gsm_bts_trx *trx; + + if (num >= bts->num_trx) + return NULL; + + llist_for_each_entry(trx, &bts->trx_list, list) { + if (trx->nr == num) + return trx; + } + + return NULL; +} + +static char ts2str[255]; + +char *gsm_trx_name(const struct gsm_bts_trx *trx) +{ + if (!trx) + snprintf(ts2str, sizeof(ts2str), "(trx=NULL)"); + else + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d)", + trx->bts->nr, trx->nr); + + return ts2str; +} + + +char *gsm_ts_name(const struct gsm_bts_trx_ts *ts) +{ + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d)", + ts->trx->bts->nr, ts->trx->nr, ts->nr); + + return ts2str; +} + +/*! Log timeslot number with full pchan information */ +char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts) +{ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + if (ts->dyn.pchan_is == ts->dyn.pchan_want) + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + gsm_pchan_name(ts->dyn.pchan_is)); + else + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s" + " switching %s -> %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + gsm_pchan_name(ts->dyn.pchan_is), + gsm_pchan_name(ts->dyn.pchan_want)); + break; + case GSM_PCHAN_TCH_F_PDCH: + if ((ts->flags & TS_F_PDCH_PENDING_MASK) == 0) + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" + : "TCH/F"); + else + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s" + " switching %s -> %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" + : "TCH/F", + (ts->flags & TS_F_PDCH_ACT_PENDING)? "PDCH" + : "TCH/F"); + break; + default: + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,pchan=%s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan)); + break; + } + + return ts2str; +} + +char *gsm_lchan_name_compute(const struct gsm_lchan *lchan) +{ + struct gsm_bts_trx_ts *ts = lchan->ts; + + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,ss=%d)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, lchan->nr); + + return ts2str; +} + +/* obtain the MO structure for a given object instance */ +struct gsm_abis_mo * +gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst) +{ + struct gsm_bts_trx *trx; + struct gsm_abis_mo *mo = NULL; + + switch (obj_class) { + case NM_OC_BTS: + mo = &bts->mo; + break; + case NM_OC_RADIO_CARRIER: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->mo; + break; + case NM_OC_BASEB_TRANSC: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->bb_transc.mo; + break; + case NM_OC_CHANNEL: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + if (obj_inst->ts_nr >= TRX_NR_TS) + return NULL; + mo = &trx->ts[obj_inst->ts_nr].mo; + break; + case NM_OC_SITE_MANAGER: + mo = &bts->site_mgr.mo; + break; + case NM_OC_BS11: + switch (obj_inst->bts_nr) { + case BS11_OBJ_CCLK: + mo = &bts->bs11.cclk.mo; + break; + case BS11_OBJ_BBSIG: + if (obj_inst->ts_nr > bts->num_trx) + return NULL; + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->bs11.bbsig.mo; + break; + case BS11_OBJ_PA: + if (obj_inst->ts_nr > bts->num_trx) + return NULL; + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->bs11.pa.mo; + break; + default: + return NULL; + } + break; + case NM_OC_BS11_RACK: + mo = &bts->bs11.rack.mo; + break; + case NM_OC_BS11_ENVABTSE: + if (obj_inst->trx_nr >= ARRAY_SIZE(bts->bs11.envabtse)) + return NULL; + mo = &bts->bs11.envabtse[obj_inst->trx_nr].mo; + break; + case NM_OC_GPRS_NSE: + mo = &bts->gprs.nse.mo; + break; + case NM_OC_GPRS_CELL: + mo = &bts->gprs.cell.mo; + break; + case NM_OC_GPRS_NSVC: + if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) + return NULL; + mo = &bts->gprs.nsvc[obj_inst->trx_nr].mo; + break; + } + return mo; +} + +/* obtain the gsm_nm_state data structure for a given object instance */ +struct gsm_nm_state * +gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst) +{ + struct gsm_abis_mo *mo; + + mo = gsm_objclass2mo(bts, obj_class, obj_inst); + if (!mo) + return NULL; + + return &mo->nm_state; +} + +/* obtain the in-memory data structure of a given object instance */ +void * +gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst) +{ + struct gsm_bts_trx *trx; + void *obj = NULL; + + switch (obj_class) { + case NM_OC_BTS: + obj = bts; + break; + case NM_OC_RADIO_CARRIER: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + obj = trx; + break; + case NM_OC_BASEB_TRANSC: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + obj = &trx->bb_transc; + break; + case NM_OC_CHANNEL: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + if (obj_inst->ts_nr >= TRX_NR_TS) + return NULL; + obj = &trx->ts[obj_inst->ts_nr]; + break; + case NM_OC_SITE_MANAGER: + obj = &bts->site_mgr; + break; + case NM_OC_GPRS_NSE: + obj = &bts->gprs.nse; + break; + case NM_OC_GPRS_CELL: + obj = &bts->gprs.cell; + break; + case NM_OC_GPRS_NSVC: + if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) + return NULL; + obj = &bts->gprs.nsvc[obj_inst->trx_nr]; + break; + } + return obj; +} + +/* See Table 10.5.25 of GSM04.08 */ +uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, + uint8_t ts_nr, uint8_t lchan_nr) +{ + uint8_t cbits, chan_nr; + + switch (pchan) { + case GSM_PCHAN_TCH_F: + case GSM_PCHAN_TCH_F_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = 0x01; + break; + case GSM_PCHAN_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = RSL_CHAN_OSMO_PDCH >> 3; + break; + case GSM_PCHAN_TCH_H: + OSMO_ASSERT(lchan_nr < 2); + cbits = 0x02; + cbits += lchan_nr; + break; + case GSM_PCHAN_CCCH_SDCCH4: + case GSM_PCHAN_CCCH_SDCCH4_CBCH: + /* + * As a special hack for BCCH, lchan_nr == 4 may be passed + * here. This should never be sent in an RSL message. + * See osmo-bts-xxx/oml.c:opstart_compl(). + */ + if (lchan_nr == CCCH_LCHAN) + chan_nr = 0; + else + OSMO_ASSERT(lchan_nr < 4); + cbits = 0x04; + cbits += lchan_nr; + break; + case GSM_PCHAN_SDCCH8_SACCH8C: + case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: + OSMO_ASSERT(lchan_nr < 8); + cbits = 0x08; + cbits += lchan_nr; + break; + default: + case GSM_PCHAN_CCCH: +#ifdef ROLE_BSC + OSMO_ASSERT(lchan_nr == 0); +#else + /* + * FIXME: On octphy and litecell, we hit above assertion (see + * Max's comment at https://gerrit.osmocom.org/589 ); disabled + * for BTS until this is clarified; remove the #ifdef when it + * is fixed. + */ +#warning "fix caller that passes lchan_nr != 0" +#endif + cbits = 0x10; + break; + } + + chan_nr = (cbits << 3) | (ts_nr & 0x7); + + return chan_nr; +} + +uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan) +{ + enum gsm_phys_chan_config pchan = lchan->ts->pchan; + if (pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) + return gsm_lchan_as_pchan2chan_nr(lchan, + lchan->ts->dyn.pchan_is); + return gsm_pchan2chan_nr(lchan->ts->pchan, lchan->ts->nr, lchan->nr); +} + +uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, + enum gsm_phys_chan_config as_pchan) +{ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH + && as_pchan == GSM_PCHAN_PDCH) + return RSL_CHAN_OSMO_PDCH | (lchan->ts->nr & ~RSL_CHAN_NR_MASK); + return gsm_pchan2chan_nr(as_pchan, lchan->ts->nr, lchan->nr); +} + +/* return the gsm_lchan for the CBCH (if it exists at all) */ +struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts) +{ + struct gsm_lchan *lchan = NULL; + struct gsm_bts_trx *trx = bts->c0; + + if (trx->ts[0].pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH) + lchan = &trx->ts[0].lchan[2]; + else { + int i; + for (i = 0; i < 8; i++) { + if (trx->ts[i].pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH) { + lchan = &trx->ts[i].lchan[2]; + break; + } + } + } + + return lchan; +} + +/* determine logical channel based on TRX and channel number IE */ +struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, + int *rc) +{ + uint8_t ts_nr = chan_nr & 0x07; + uint8_t cbits = chan_nr >> 3; + uint8_t lch_idx; + struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; + bool ok = true; + + if (rc) + *rc = -EINVAL; + + if (cbits == 0x01) { + lch_idx = 0; /* TCH/F */ + if (ts->pchan != GSM_PCHAN_TCH_F && + ts->pchan != GSM_PCHAN_PDCH && + ts->pchan != GSM_PCHAN_TCH_F_PDCH + && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH + && (ts->dyn.pchan_is == GSM_PCHAN_TCH_F + || ts->dyn.pchan_want == GSM_PCHAN_TCH_F))) + ok = false; + } else if ((cbits & 0x1e) == 0x02) { + lch_idx = cbits & 0x1; /* TCH/H */ + if (ts->pchan != GSM_PCHAN_TCH_H + && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH + && (ts->dyn.pchan_is == GSM_PCHAN_TCH_H + || ts->dyn.pchan_want == GSM_PCHAN_TCH_H))) + ok = false; + } else if ((cbits & 0x1c) == 0x04) { + lch_idx = cbits & 0x3; /* SDCCH/4 */ + if (ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && + ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) + ok = false; + } else if ((cbits & 0x18) == 0x08) { + lch_idx = cbits & 0x7; /* SDCCH/8 */ + if (ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C && + ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C_CBCH) + ok = false; + } else if (cbits == 0x10 || cbits == 0x11 || cbits == 0x12) { + lch_idx = 0; + if (ts->pchan != GSM_PCHAN_CCCH && + ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && + ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) + ok = false; + /* FIXME: we should not return first sdcch4 !!! */ + } else if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH) { + lch_idx = 0; + if (ts->pchan != GSM_PCHAN_TCH_F_TCH_H_PDCH) + ok = false; + } else + return NULL; + + if (rc && ok) + *rc = 0; + + return &ts->lchan[lch_idx]; +} + +static const uint8_t subslots_per_pchan[] = { + [GSM_PCHAN_NONE] = 0, + [GSM_PCHAN_CCCH] = 0, + [GSM_PCHAN_PDCH] = 0, + [GSM_PCHAN_CCCH_SDCCH4] = 4, + [GSM_PCHAN_TCH_F] = 1, + [GSM_PCHAN_TCH_H] = 2, + [GSM_PCHAN_SDCCH8_SACCH8C] = 8, + [GSM_PCHAN_CCCH_SDCCH4_CBCH] = 4, + [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = 8, + /* + * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be + * part of this, those TS are handled according to their dynamic state. + */ +}; + +/*! Return the actual pchan type, also heeding dynamic TS. */ +enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts) +{ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + return ts->dyn.pchan_is; + case GSM_PCHAN_TCH_F_PDCH: + if (ts->flags & TS_F_PDCH_ACTIVE) + return GSM_PCHAN_PDCH; + else + return GSM_PCHAN_TCH_F; + default: + return ts->pchan; + } +} + +/*! According to ts->pchan and possibly ts->dyn_pchan, return the number of + * logical channels available in the timeslot. */ +uint8_t ts_subslots(struct gsm_bts_trx_ts *ts) +{ + return subslots_per_pchan[ts_pchan(ts)]; +} + +static bool pchan_is_tch(enum gsm_phys_chan_config pchan) +{ + switch (pchan) { + case GSM_PCHAN_TCH_F: + case GSM_PCHAN_TCH_H: + return true; + default: + return false; + } +} + +bool ts_is_tch(struct gsm_bts_trx_ts *ts) +{ + return pchan_is_tch(ts_pchan(ts)); +} -- To view, visit https://gerrit.osmocom.org/4161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 8 16:40:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 8 Oct 2017 16:40:26 +0000 Subject: [PATCH] osmo-bts[master]: Remove build dependency on legacy OpenBSC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4161 to look at the new patch set (#3). Remove build dependency on legacy OpenBSC * copy-paste gsm_data_shared.* from OpenBSC master * remove corresponding configure check and option * remove .deb dependency Actual refactoring with removal of unnecessary structures/parts, moving common OpenBSC/OsmoBSC parts into libraries etc. are left for further patches. Current patch will make coexistence with *BSC easier and will simplify our build infrastructure. Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13 Related: OS#1923 --- M configure.ac M debian/control M debian/rules M include/Makefile.am D include/openbsc/gsm_data.h M include/osmo-bts/Makefile.am M include/osmo-bts/gsm_data.h A include/osmo-bts/gsm_data_shared.h M src/common/Makefile.am M src/common/gsm_data_shared.c M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-octphy/Makefile.am M src/osmo-bts-sysmo/Makefile.am M src/osmo-bts-trx/Makefile.am M src/osmo-bts-virtual/Makefile.am M tests/agch/Makefile.am M tests/cipher/Makefile.am M tests/handover/Makefile.am M tests/meas/Makefile.am M tests/misc/Makefile.am M tests/paging/Makefile.am M tests/sysmobts/Makefile.am M tests/tx_power/Makefile.am 23 files changed, 1,870 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/4161/3 diff --git a/configure.ac b/configure.ac index bc36456..a41f7ec 100644 --- a/configure.ac +++ b/configure.ac @@ -147,25 +147,9 @@ CPPFLAGS=$oldCPPFLAGS fi -# We share gsm_data.h with OpenBSC and need to be pointed to the source -# directory of OpenBSC for now. -AC_ARG_WITH([openbsc], - [AS_HELP_STRING([--with-openbsc=INCLUDE_DIR], - [OpenBSC include directory for openbsc/gsm_data_shared.h])], - [openbsc_incdir="$withval"], - [openbsc_incdir="`cd $srcdir; pwd`/../openbsc/openbsc/include"]) -AC_SUBST([OPENBSC_INCDIR], $openbsc_incdir) - -oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" -AC_CHECK_HEADER([openbsc/gsm_data_shared.h],[], - [AC_MSG_ERROR([openbsc/gsm_data_shared.h can not be found in $openbsc_incdir])], - [#include ]) -CPPFLAGS=$oldCPPFLAGS - # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR $LIBOSMOCORE_CFLAGS" +CPPFLAGS="$CPPFLAGS $LIBOSMOCORE_CFLAGS" AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"],[]) CPPFLAGS=$oldCPPFLAGS diff --git a/debian/control b/debian/control index e1a58b2..074f687 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,6 @@ autotools-dev, pkg-config, libosmocore-dev, - openbsc-dev, libosmo-abis-dev, libosmo-netif-dev, libgps-dev, diff --git a/debian/rules b/debian/rules index 12b3334..80ba0b2 100755 --- a/debian/rules +++ b/debian/rules @@ -19,7 +19,7 @@ dh_autoreconf override_dh_auto_configure: - dh_auto_configure -- --enable-trx --with-openbsc=/usr/src/osmocom/openbsc/openbsc/include/ + dh_auto_configure -- --enable-trx override_dh_clean: dh_clean diff --git a/include/Makefile.am b/include/Makefile.am index e35e696..7585a65 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,3 +1 @@ SUBDIRS = osmo-bts - -noinst_HEADERS = openbsc/gsm_data.h diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h deleted file mode 120000 index f0d49f2..0000000 --- a/include/openbsc/gsm_data.h +++ /dev/null @@ -1 +0,0 @@ -../osmo-bts/gsm_data.h \ No newline at end of file diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index ef4165f..a15ce3d 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,4 +1,4 @@ -noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ +noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h gsm_data_shared.h logging.h measurement.h \ oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \ power_control.h scheduler.h scheduler_backend.h phy_link.h \ diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index aeac4b2..dcffcf6 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -133,7 +133,7 @@ #define bts_role_bts(x) ((struct gsm_bts_role_bts *)(x)->role) -#include "openbsc/gsm_data_shared.h" +#include void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state); int conf_lchans_as_pchan(struct gsm_bts_trx_ts *ts, diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h new file mode 100644 index 0000000..c19b125 --- /dev/null +++ b/include/osmo-bts/gsm_data_shared.h @@ -0,0 +1,999 @@ +#ifndef _GSM_DATA_SHAREDH +#define _GSM_DATA_SHAREDH + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifndef ROLE_BSC +#include +#endif + +/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: + 4-bit index is used (2#1111 = 10#15) */ +#define SI2Q_MAX_NUM 16 +/* length in bits (for single SI2quater message) */ +#define SI2Q_MAX_LEN 160 +#define SI2Q_MIN_LEN 18 + +struct osmo_bsc_data; + +struct osmo_bsc_sccp_con; +struct gsm_sms_queue; + +/* RRLP mode of operation */ +enum rrlp_mode { + RRLP_MODE_NONE, + RRLP_MODE_MS_BASED, + RRLP_MODE_MS_PREF, + RRLP_MODE_ASS_PREF, +}; + +/* Channel Request reason */ +enum gsm_chreq_reason_t { + GSM_CHREQ_REASON_EMERG, + GSM_CHREQ_REASON_PAG, + GSM_CHREQ_REASON_CALL, + GSM_CHREQ_REASON_LOCATION_UPD, + GSM_CHREQ_REASON_OTHER, + GSM_CHREQ_REASON_PDCH, +}; + +/* lchans 0..3 are SDCCH in combined channel configuration, + use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */ +#define CCCH_LCHAN 4 + +#define TRX_NR_TS 8 +#define TS_MAX_LCHAN 8 + +#define HARDCODED_ARFCN 123 +#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */ + +/* for multi-drop config */ +#define HARDCODED_BTS0_TS 1 +#define HARDCODED_BTS1_TS 6 +#define HARDCODED_BTS2_TS 11 + +#define MAX_VERSION_LENGTH 64 + +#define MAX_BTS_FEATURES 128 + +enum gsm_hooks { + GSM_HOOK_NM_SWLOAD, + GSM_HOOK_RR_PAGING, + GSM_HOOK_RR_SECURITY, +}; + +enum gsm_paging_event { + GSM_PAGING_SUCCEEDED, + GSM_PAGING_EXPIRED, + GSM_PAGING_OOM, + GSM_PAGING_BUSY, +}; + +enum bts_gprs_mode { + BTS_GPRS_NONE = 0, + BTS_GPRS_GPRS = 1, + BTS_GPRS_EGPRS = 2, +}; + +struct gsm_lchan; +struct gsm_subscriber; +struct gsm_mncc; +struct osmo_rtp_socket; +struct rtp_socket; +struct bsc_api; + +/* Network Management State */ +struct gsm_nm_state { + uint8_t operational; + uint8_t administrative; + uint8_t availability; +}; + +struct gsm_abis_mo { + uint8_t obj_class; + uint8_t procedure_pending; + struct abis_om_obj_inst obj_inst; + const char *name; + struct gsm_nm_state nm_state; + struct tlv_parsed *nm_attr; + struct gsm_bts *bts; +}; + +/* Ericsson OM2000 Managed Object */ +struct abis_om2k_mo { + uint8_t class; + uint8_t bts; + uint8_t assoc_so; + uint8_t inst; +} __attribute__ ((packed)); + +struct om2k_mo { + struct abis_om2k_mo addr; + struct osmo_fsm_inst *fsm; +}; + +#define MAX_A5_KEY_LEN (128/8) +#define A38_XOR_MIN_KEY_LEN 12 +#define A38_XOR_MAX_KEY_LEN 16 +#define A38_COMP128_KEY_LEN 16 +#define RSL_ENC_ALG_A5(x) (x+1) +#define MAX_EARFCN_LIST 32 + +/* is the data link established? who established it? */ +#define LCHAN_SAPI_UNUSED 0 +#define LCHAN_SAPI_MS 1 +#define LCHAN_SAPI_NET 2 +#define LCHAN_SAPI_REL 3 + +/* state of a logical channel */ +enum gsm_lchan_state { + LCHAN_S_NONE, /* channel is not active */ + LCHAN_S_ACT_REQ, /* channel activation requested */ + LCHAN_S_ACTIVE, /* channel is active and operational */ + LCHAN_S_REL_REQ, /* channel release has been requested */ + LCHAN_S_REL_ERR, /* channel is in an error state */ + LCHAN_S_BROKEN, /* channel is somehow unusable */ + LCHAN_S_INACTIVE, /* channel is set inactive */ +}; + +/* BTS ONLY */ +#define MAX_NUM_UL_MEAS 104 +#define LC_UL_M_F_L1_VALID (1 << 0) +#define LC_UL_M_F_RES_VALID (1 << 1) + +struct bts_ul_meas { + /* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */ + uint16_t ber10k; + /* timing advance offset (in quarter bits) */ + int16_t ta_offs_qbits; + /* C/I ratio in dB */ + float c_i; + /* flags */ + uint8_t is_sub:1; + /* RSSI in dBm * -1 */ + uint8_t inv_rssi; +}; + +struct bts_codec_conf { + uint8_t hr; + uint8_t efr; + uint8_t amr; +}; + +struct amr_mode { + uint8_t mode; + uint8_t threshold; + uint8_t hysteresis; +}; + +struct amr_multirate_conf { + uint8_t gsm48_ie[2]; + struct amr_mode ms_mode[4]; + struct amr_mode bts_mode[4]; + uint8_t num_modes; +}; +/* /BTS ONLY */ + +enum lchan_csd_mode { + LCHAN_CSD_M_NT, + LCHAN_CSD_M_T_1200_75, + LCHAN_CSD_M_T_600, + LCHAN_CSD_M_T_1200, + LCHAN_CSD_M_T_2400, + LCHAN_CSD_M_T_9600, + LCHAN_CSD_M_T_14400, + LCHAN_CSD_M_T_29000, + LCHAN_CSD_M_T_32000, +}; + +/* State of the SAPIs in the lchan */ +enum lchan_sapi_state { + LCHAN_SAPI_S_NONE, + LCHAN_SAPI_S_REQ, + LCHAN_SAPI_S_ASSIGNED, + LCHAN_SAPI_S_REL, + LCHAN_SAPI_S_ERROR, +}; + +struct gsm_lchan { + /* The TS that we're part of */ + struct gsm_bts_trx_ts *ts; + /* The logical subslot number in the TS */ + uint8_t nr; + /* The logical channel type */ + enum gsm_chan_t type; + /* RSL channel mode */ + enum rsl_cmod_spd rsl_cmode; + /* If TCH, traffic channel mode */ + enum gsm48_chan_mode tch_mode; + enum lchan_csd_mode csd_mode; + /* State */ + enum gsm_lchan_state state; + const char *broken_reason; + /* Power levels for MS and BTS */ + uint8_t bs_power; + uint8_t ms_power; + /* Encryption information */ + struct { + uint8_t alg_id; + uint8_t key_len; + uint8_t key[MAX_A5_KEY_LEN]; + } encr; + + /* AMR bits */ + uint8_t mr_ms_lv[7]; + uint8_t mr_bts_lv[7]; + + /* Established data link layer services */ + uint8_t sapis[8]; + int sacch_deact; + + struct { + uint32_t bound_ip; + uint32_t connect_ip; + uint16_t bound_port; + uint16_t connect_port; + uint16_t conn_id; + uint8_t rtp_payload; + uint8_t rtp_payload2; + uint8_t speech_mode; +#ifdef ROLE_BSC + struct rtp_socket *rtp_socket; +#else + struct osmo_rtp_socket *rtp_socket; +#endif + } abis_ip; + + uint8_t rqd_ta; + + char *name; + +#ifdef ROLE_BSC + struct osmo_timer_list T3101; + struct osmo_timer_list T3109; + struct osmo_timer_list T3111; + struct osmo_timer_list error_timer; + struct osmo_timer_list act_timer; + struct osmo_timer_list rel_work; + uint8_t error_cause; + + /* table of neighbor cell measurements */ + struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; + + /* cache of last measurement reports on this lchan */ + struct gsm_meas_rep meas_rep[6]; + int meas_rep_idx; + + /* GSM Random Access data */ + struct gsm48_req_ref *rqd_ref; + + struct gsm_subscriber_connection *conn; + + struct { + /* channel activation type and handover ref */ + uint8_t act_type; + uint8_t ho_ref; + struct gsm48_req_ref *rqd_ref; + uint8_t rqd_ta; + } dyn; +#else + /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. + * Currently we don't share these headers so this is a magic number. */ + struct llist_head sapi_cmds; + uint8_t sapis_dl[23]; + uint8_t sapis_ul[23]; + struct lapdm_channel lapdm_ch; + struct llist_head dl_tch_queue; + struct { + /* bitmask of all SI that are present/valid in si_buf */ + uint32_t valid; + uint32_t last; + /* buffers where we put the pre-computed SI: + SI2Q_MAX_NUM is the max number of SI2quater messages (see 3GPP TS 44.018) */ + sysinfo_buf_t buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; + } si; + struct { + uint8_t flags; + /* RSL measurment result number, 0 at lchan_act */ + uint8_t res_nr; + /* current Tx power level of the BTS */ + uint8_t bts_tx_pwr; + /* number of measurements stored in array below */ + uint8_t num_ul_meas; + struct bts_ul_meas uplink[MAX_NUM_UL_MEAS]; + /* last L1 header from the MS */ + uint8_t l1_info[2]; + struct gsm_meas_rep_unidir ul_res; + } meas; + struct { + struct amr_multirate_conf amr_mr; + struct { + struct osmo_fsm_inst *dl_amr_fsm; + /* TCH cache */ + uint8_t cache[20]; + /* FACCH cache */ + uint8_t facch[GSM_MACBLOCK_LEN]; + uint8_t len; + uint32_t fn; + bool is_update; + /* set for each SID frame to detect talkspurt for codecs + without explicit ONSET event */ + bool ul_sid; + /* indicates if DTXd was active during DL measurement + period */ + bool dl_active; + } dtx; + uint8_t last_cmr; + uint32_t last_fn; + } tch; + + /* 3GPP TS 48.058 ? 9.3.37: [0; 255] ok, -1 means invalid*/ + int16_t ms_t_offs; + /* 3GPP TS 45.010 ? 1.2 round trip propagation delay (in symbols) or -1 */ + int16_t p_offs; + + /* BTS-side ciphering state (rx only, bi-directional, ...) */ + uint8_t ciph_state; + uint8_t ciph_ns; + uint8_t loopback; + struct { + uint8_t active; + uint8_t ref; + /* T3105: PHYS INF retransmission */ + struct osmo_timer_list t3105; + /* counts up to Ny1 */ + unsigned int phys_info_count; + } ho; + /* S counter for link loss */ + int s; + /* Kind of the release/activation. E.g. RSL or PCU */ + int rel_act_kind; + /* RTP header Marker bit to indicate beginning of speech after pause */ + bool rtp_tx_marker; + /* power handling */ + struct { + uint8_t current; + uint8_t fixed; + } ms_power_ctrl; + + struct msgb *pending_rel_ind_msg; +#endif +}; + +enum { + TS_F_PDCH_ACTIVE = 0x1000, + TS_F_PDCH_ACT_PENDING = 0x2000, + TS_F_PDCH_DEACT_PENDING = 0x4000, + TS_F_PDCH_PENDING_MASK = 0x6000 /*< + TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */ +} gsm_bts_trx_ts_flags; + +/* One Timeslot in a TRX */ +struct gsm_bts_trx_ts { + struct gsm_bts_trx *trx; + /* number of this timeslot at the TRX */ + uint8_t nr; + + enum gsm_phys_chan_config pchan; + + struct { + enum gsm_phys_chan_config pchan_is; + enum gsm_phys_chan_config pchan_want; + struct msgb *pending_chan_activ; + } dyn; + + unsigned int flags; + struct gsm_abis_mo mo; + struct tlv_parsed nm_attr; + uint8_t nm_chan_comb; + int tsc; /* -1 == use BTS TSC */ + + struct { + /* Parameters below are configured by VTY */ + int enabled; + uint8_t maio; + uint8_t hsn; + struct bitvec arfcns; + uint8_t arfcns_data[1024/8]; + /* This is the pre-computed MA for channel assignments */ + struct bitvec ma; + uint8_t ma_len; /* part of ma_data that is used */ + uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */ + } hopping; + + /* To which E1 subslot are we connected */ + struct gsm_e1_subslot e1_link; + + union { + struct { + struct om2k_mo om2k_mo; + } rbs2000; + }; + + struct gsm_lchan lchan[TS_MAX_LCHAN]; +}; + +/* One TRX in a BTS */ +struct gsm_bts_trx { + /* list header in bts->trx_list */ + struct llist_head list; + + struct gsm_bts *bts; + /* number of this TRX in the BTS */ + uint8_t nr; + /* human readable name / description */ + char *description; + /* how do we talk RSL with this TRX? */ + struct gsm_e1_subslot rsl_e1_link; + uint8_t rsl_tei; + struct e1inp_sign_link *rsl_link; + + /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */ + struct e1inp_sign_link *oml_link; + + struct gsm_abis_mo mo; + struct tlv_parsed nm_attr; + struct { + struct gsm_abis_mo mo; + } bb_transc; + + uint16_t arfcn; + int nominal_power; /* in dBm */ + unsigned int max_power_red; /* in actual dB */ + +#ifndef ROLE_BSC + struct trx_power_params power_params; + int ms_power_control; + + struct { + void *l1h; + } role_bts; +#endif + + union { + struct { + struct { + struct gsm_abis_mo mo; + } bbsig; + struct { + struct gsm_abis_mo mo; + } pa; + } bs11; + struct { + unsigned int test_state; + uint8_t test_nr; + struct rxlev_stats rxlev_stat; + } ipaccess; + struct { + struct { + struct om2k_mo om2k_mo; + } trxc; + struct { + struct om2k_mo om2k_mo; + } rx; + struct { + struct om2k_mo om2k_mo; + } tx; + } rbs2000; + }; + struct gsm_bts_trx_ts ts[TRX_NR_TS]; +}; + +#define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i]) +#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i)) +#define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i][0]) +#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0]) + +enum gsm_bts_type { + GSM_BTS_TYPE_UNKNOWN, + GSM_BTS_TYPE_BS11, + GSM_BTS_TYPE_NANOBTS, + GSM_BTS_TYPE_RBS2000, + GSM_BTS_TYPE_NOKIA_SITE, + GSM_BTS_TYPE_OSMOBTS, + _NUM_GSM_BTS_TYPE +}; + +enum gsm_bts_type_variant { + BTS_UNKNOWN, + BTS_OSMO_LITECELL15, + BTS_OSMO_OCTPHY, + BTS_OSMO_SYSMO, + BTS_OSMO_TRX, + _NUM_BTS_VARIANT +}; + +/* Used by OML layer for BTS Attribute reporting */ +enum bts_attribute { + BTS_TYPE_VARIANT, + BTS_SUB_MODEL, + TRX_PHY_VERSION, +}; + +struct vty; + +struct gsm_bts_model { + struct llist_head list; + + enum gsm_bts_type type; + enum gsm_bts_type_variant variant; + const char *name; + + bool started; + int (*start)(struct gsm_network *net); + int (*oml_rcvmsg)(struct msgb *msg); + + void (*e1line_bind_ops)(struct e1inp_line *line); + + void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts); + void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx); + void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts); + + struct tlv_definition nm_att_tlvdef; + + /* features of a given BTS model set via gsm_bts_model_register() locally */ + struct bitvec features; + uint8_t _features_data[MAX_BTS_FEATURES/8]; +}; + +/* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility + with BTS compiled against earlier version of this header */ +enum gsm_bts_features { + BTS_FEAT_HSCSD, + BTS_FEAT_GPRS, + BTS_FEAT_EGPRS, + BTS_FEAT_ECSD, + BTS_FEAT_HOPPING, + BTS_FEAT_MULTI_TSC, + BTS_FEAT_OML_ALERTS, + BTS_FEAT_AGCH_PCH_PROP, + BTS_FEAT_CBCH, + _NUM_BTS_FEAT +}; + +extern const struct value_string gsm_bts_features_descs[]; + +/* + * This keeps track of the paging status of one BTS. It + * includes a number of pending requests, a back pointer + * to the gsm_bts, a timer and some more state. + */ +struct gsm_bts_paging_state { + /* pending requests */ + struct llist_head pending_requests; + struct gsm_bts *bts; + + struct osmo_timer_list work_timer; + struct osmo_timer_list credit_timer; + + /* free chans needed */ + int free_chans_need; + + /* load */ + uint16_t available_slots; +}; + +struct gsm_envabtse { + struct gsm_abis_mo mo; +}; + +struct gsm_bts_gprs_nsvc { + struct gsm_bts *bts; + /* data read via VTY config file, to configure the BTS + * via OML from BSC */ + int id; + uint16_t nsvci; + uint16_t local_port; /* on the BTS */ + uint16_t remote_port; /* on the SGSN */ + uint32_t remote_ip; /* on the SGSN */ + + struct gsm_abis_mo mo; +}; + +enum gprs_rlc_par { + RLC_T3142, + RLC_T3169, + RLC_T3191, + RLC_T3193, + RLC_T3195, + RLC_N3101, + RLC_N3103, + RLC_N3105, + CV_COUNTDOWN, + T_DL_TBF_EXT, /* ms */ + T_UL_TBF_EXT, /* ms */ + _NUM_RLC_PAR +}; + +enum gprs_cs { + GPRS_CS1, + GPRS_CS2, + GPRS_CS3, + GPRS_CS4, + GPRS_MCS1, + GPRS_MCS2, + GPRS_MCS3, + GPRS_MCS4, + GPRS_MCS5, + GPRS_MCS6, + GPRS_MCS7, + GPRS_MCS8, + GPRS_MCS9, + _NUM_GRPS_CS +}; + +struct gprs_rlc_cfg { + uint16_t parameter[_NUM_RLC_PAR]; + struct { + uint16_t repeat_time; /* ms */ + uint8_t repeat_count; + } paging; + uint32_t cs_mask; /* bitmask of gprs_cs */ + uint8_t initial_cs; + uint8_t initial_mcs; +}; + + +enum neigh_list_manual_mode { + NL_MODE_AUTOMATIC = 0, + NL_MODE_MANUAL = 1, + NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */ +}; + +enum bts_loc_fix { + BTS_LOC_FIX_INVALID = 0, + BTS_LOC_FIX_2D = 1, + BTS_LOC_FIX_3D = 2, +}; + +extern const struct value_string bts_loc_fix_names[]; + +struct bts_location { + struct llist_head list; + time_t tstamp; + enum bts_loc_fix valid; + double lat; + double lon; + double height; +}; + +/* One BTS */ +struct gsm_bts { + /* list header in net->bts_list */ + struct llist_head list; + + /* Geographical location of the BTS */ + struct llist_head loc_list; + + /* number of ths BTS in network */ + uint8_t nr; + /* human readable name / description */ + char *description; + /* Cell Identity */ + uint16_t cell_identity; + /* location area code of this BTS */ + uint16_t location_area_code; + /* Base Station Identification Code (BSIC), lower 3 bits is BCC, + * which is used as TSC for the CCCH */ + uint8_t bsic; + /* type of BTS */ + enum gsm_bts_type type; + enum gsm_bts_type_variant variant; + struct gsm_bts_model *model; + enum gsm_band band; + char version[MAX_VERSION_LENGTH]; + char sub_model[MAX_VERSION_LENGTH]; + + /* features of a given BTS set/reported via OML */ + struct bitvec features; + uint8_t _features_data[MAX_BTS_FEATURES/8]; + + /* Connected PCU version (if any) */ + char pcu_version[MAX_VERSION_LENGTH]; + + /* maximum Tx power that the MS is permitted to use in this cell */ + int ms_max_power; + + /* how do we talk OML with this TRX? */ + struct gsm_e1_subslot oml_e1_link; + uint8_t oml_tei; + struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; + + /* Abis network management O&M handle */ + struct abis_nm_h *nmh; + + struct gsm_abis_mo mo; + + /* number of this BTS on given E1 link */ + uint8_t bts_nr; + + /* DTX features of this BTS */ + enum gsm48_dtx_mode dtxu; + bool dtxd; + + /* paging state and control */ + struct gsm_bts_paging_state paging; + + /* CCCH is on C0 */ + struct gsm_bts_trx *c0; + + struct { + struct gsm_abis_mo mo; + } site_mgr; + + /* bitmask of all SI that are present/valid in si_buf */ + uint32_t si_valid; + /* 3GPP TS 44.018 Table 10.5.2.33b.1 INDEX and COUNT for SI2quater */ + uint8_t si2q_index; /* distinguish individual SI2quater messages */ + uint8_t si2q_count; /* si2q_index for the last (highest indexed) individual SI2quater message */ + /* buffers where we put the pre-computed SI */ + sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; + /* offsets used while generating SI2quater */ + size_t e_offset; + size_t u_offset; + + /* ip.accesss Unit ID's have Site/BTS/TRX layout */ + union { + struct { + uint16_t site_id; + uint16_t bts_id; + uint32_t flags; + uint32_t rsl_ip; + } ip_access; + struct { + struct { + struct gsm_abis_mo mo; + } cclk; + struct { + struct gsm_abis_mo mo; + } rack; + struct gsm_envabtse envabtse[4]; + } bs11; + struct { + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } cf; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } is; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } con; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + } dp; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + } tf; + uint32_t use_superchannel:1; + } rbs2000; + struct { + uint8_t bts_type; + unsigned int configured:1, + skip_reset:1, + no_loc_rel_cnf:1, + bts_reset_timer_cnf, + did_reset:1, + wait_reset:1; + struct osmo_timer_list reset_timer; + } nokia; + }; + + /* Not entirely sure how ip.access specific this is */ + struct { + uint8_t supports_egprs_11bit_rach; + enum bts_gprs_mode mode; + struct { + struct gsm_abis_mo mo; + uint16_t nsei; + uint8_t timer[7]; + } nse; + struct { + struct gsm_abis_mo mo; + uint16_t bvci; + uint8_t timer[11]; + struct gprs_rlc_cfg rlc_cfg; + } cell; + struct gsm_bts_gprs_nsvc nsvc[2]; + uint8_t rac; + uint8_t net_ctrl_ord; + bool ctrl_ack_type_use_block; + } gprs; + + /* RACH NM values */ + int rach_b_thresh; + int rach_ldavg_slots; + + /* transceivers */ + int num_trx; + struct llist_head trx_list; + + /* SI related items */ + int force_combined_si; + int bcch_change_mark; + +#ifdef ROLE_BSC + /* Abis NM queue */ + struct llist_head abis_queue; + int abis_nm_pend; + + struct gsm_network *network; + + /* should the channel allocator allocate channels from high TRX to TRX0, + * rather than starting from TRX0 and go upwards? */ + int chan_alloc_reverse; + + enum neigh_list_manual_mode neigh_list_manual_mode; + /* parameters from which we build SYSTEM INFORMATION */ + struct { + struct gsm48_rach_control rach_control; + uint8_t ncc_permitted; + struct gsm48_cell_sel_par cell_sel_par; + struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */ + struct gsm48_cell_options cell_options; + struct gsm48_control_channel_descr chan_desc; + struct bitvec neigh_list; + struct bitvec cell_alloc; + struct bitvec si5_neigh_list; + struct osmo_earfcn_si2q si2quater_neigh_list; + size_t uarfcn_length; /* index for uarfcn and scramble lists */ + struct { + /* bitmask large enough for all possible ARFCN's */ + uint8_t neigh_list[1024/8]; + uint8_t cell_alloc[1024/8]; + /* If the user wants a different neighbor list in SI5 than in SI2 */ + uint8_t si5_neigh_list[1024/8]; + uint8_t meas_bw_list[MAX_EARFCN_LIST]; + uint16_t earfcn_list[MAX_EARFCN_LIST]; + uint16_t uarfcn_list[MAX_EARFCN_LIST]; + uint16_t scramble_list[MAX_EARFCN_LIST]; + } data; + } si_common; + bool early_classmark_allowed; + /* for testing only: Have an infinitely long radio link timeout */ + bool infinite_radio_link_timeout; + + /* do we use static (user-defined) system information messages? (bitmask) */ + uint32_t si_mode_static; + + /* exclude the BTS from the global RF Lock handling */ + int excl_from_rf_lock; + + /* supported codecs beside FR */ + struct bts_codec_conf codec; + + /* BTS dependencies bit field */ + uint32_t depends_on[256/(8*4)]; + + /* full and half rate multirate config */ + struct amr_multirate_conf mr_full; + struct amr_multirate_conf mr_half; + + /* PCU socket state */ + char *pcu_sock_path; + struct pcu_sock_state *pcu_state; + +#endif /* ROLE_BSC */ + void *role; +}; + + +struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); +struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); + +struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); +struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); + +enum gsm_bts_type str2btstype(const char *arg); +const char *btstype2str(enum gsm_bts_type type); + +enum bts_attribute str2btsattr(const char *s); +const char *btsatttr2str(enum bts_attribute v); + +enum gsm_bts_type_variant str2btsvariant(const char *arg); +const char *btsvariant2str(enum gsm_bts_type_variant v); + +extern const struct value_string gsm_chreq_descs[]; +const struct value_string gsm_pchant_names[13]; +const struct value_string gsm_pchant_descs[13]; +const char *gsm_pchan_name(enum gsm_phys_chan_config c); +enum gsm_phys_chan_config gsm_pchan_parse(const char *name); +const char *gsm_lchant_name(enum gsm_chan_t c); +const char *gsm_chreq_name(enum gsm_chreq_reason_t c); +char *gsm_trx_name(const struct gsm_bts_trx *trx); +char *gsm_ts_name(const struct gsm_bts_trx_ts *ts); +char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts); +char *gsm_lchan_name_compute(const struct gsm_lchan *lchan); +const char *gsm_lchans_name(enum gsm_lchan_state s); + +static inline char *gsm_lchan_name(const struct gsm_lchan *lchan) +{ + return lchan->name; +} + +static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat) +{ + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); + return bitvec_set_bit_pos(&bts->features, feat, 1); +} + +static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat) +{ + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); + return bitvec_get_bit_pos(&bts->features, feat); +} + +void gsm_abis_mo_reset(struct gsm_abis_mo *mo); + +struct gsm_abis_mo * +gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); + +struct gsm_nm_state * +gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); +void * +gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); + +/* reset the state of all MO in the BTS */ +void gsm_bts_mo_reset(struct gsm_bts *bts); + +uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, + uint8_t ts_nr, uint8_t lchan_nr); +uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan); +uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, + enum gsm_phys_chan_config as_pchan); + +/* return the gsm_lchan for the CBCH (if it exists at all) */ +struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts); + +/* + * help with parsing regexps + */ +int gsm_parse_reg(void *ctx, regex_t *reg, char **str, + int argc, const char **argv) __attribute__ ((warn_unused_result)); + +static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts) +{ + if (ts->tsc != -1) + return ts->tsc; + else + return ts->trx->bts->bsic & 7; +} + +struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, + int *rc); + +enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts); +uint8_t ts_subslots(struct gsm_bts_trx_ts *ts); +bool ts_is_tch(struct gsm_bts_trx_ts *ts); + +#endif diff --git a/src/common/Makefile.am b/src/common/Makefile.am index d104c48..67f3e80 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c index 706892d..c2d196b 100644 --- a/src/common/gsm_data_shared.c +++ b/src/common/gsm_data_shared.c @@ -1 +1,853 @@ -#include "../../../openbsc/openbsc/src/libcommon/gsm_data_shared.c" +/* (C) 2008-2010 by Harald Welte + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include + +void gsm_abis_mo_reset(struct gsm_abis_mo *mo) +{ + mo->nm_state.operational = NM_OPSTATE_NULL; + mo->nm_state.availability = NM_AVSTATE_POWER_OFF; +} + +static void gsm_mo_init(struct gsm_abis_mo *mo, struct gsm_bts *bts, + uint8_t obj_class, uint8_t p1, uint8_t p2, uint8_t p3) +{ + mo->bts = bts; + mo->obj_class = obj_class; + mo->obj_inst.bts_nr = p1; + mo->obj_inst.trx_nr = p2; + mo->obj_inst.ts_nr = p3; + gsm_abis_mo_reset(mo); +} + +const struct value_string bts_attribute_names[] = { + OSMO_VALUE_STRING(BTS_TYPE_VARIANT), + OSMO_VALUE_STRING(BTS_SUB_MODEL), + OSMO_VALUE_STRING(TRX_PHY_VERSION), + { 0, NULL } +}; + +enum bts_attribute str2btsattr(const char *s) +{ + return get_string_value(bts_attribute_names, s); +} + +const char *btsatttr2str(enum bts_attribute v) +{ + return get_value_string(bts_attribute_names, v); +} + +const struct value_string osmo_bts_variant_names[_NUM_BTS_VARIANT + 1] = { + { BTS_UNKNOWN, "unknown" }, + { BTS_OSMO_LITECELL15, "osmo-bts-lc15" }, + { BTS_OSMO_OCTPHY, "osmo-bts-octphy" }, + { BTS_OSMO_SYSMO, "osmo-bts-sysmo" }, + { BTS_OSMO_TRX, "omso-bts-trx" }, + { 0, NULL } +}; + +enum gsm_bts_type_variant str2btsvariant(const char *arg) +{ + return get_string_value(osmo_bts_variant_names, arg); +} + +const char *btsvariant2str(enum gsm_bts_type_variant v) +{ + return get_value_string(osmo_bts_variant_names, v); +} + +const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE + 1] = { + { GSM_BTS_TYPE_UNKNOWN, "unknown" }, + { GSM_BTS_TYPE_BS11, "bs11" }, + { GSM_BTS_TYPE_NANOBTS, "nanobts" }, + { GSM_BTS_TYPE_RBS2000, "rbs2000" }, + { GSM_BTS_TYPE_NOKIA_SITE, "nokia_site" }, + { GSM_BTS_TYPE_OSMOBTS, "sysmobts" }, + { 0, NULL } +}; + +enum gsm_bts_type str2btstype(const char *arg) +{ + return get_string_value(bts_type_names, arg); +} + +const char *btstype2str(enum gsm_bts_type type) +{ + return get_value_string(bts_type_names, type); +} + +const struct value_string gsm_bts_features_descs[] = { + { BTS_FEAT_HSCSD, "HSCSD" }, + { BTS_FEAT_GPRS, "GPRS" }, + { BTS_FEAT_EGPRS, "EGPRS" }, + { BTS_FEAT_ECSD, "ECSD" }, + { BTS_FEAT_HOPPING, "Frequency Hopping" }, + { BTS_FEAT_MULTI_TSC, "Multi-TSC" }, + { BTS_FEAT_OML_ALERTS, "OML Alerts" }, + { BTS_FEAT_AGCH_PCH_PROP, "AGCH/PCH proportional allocation" }, + { BTS_FEAT_CBCH, "CBCH" }, + { 0, NULL } +}; + +const struct value_string gsm_chreq_descs[] = { + { GSM_CHREQ_REASON_EMERG, "emergency call" }, + { GSM_CHREQ_REASON_PAG, "answer to paging" }, + { GSM_CHREQ_REASON_CALL, "call re-establishment" }, + { GSM_CHREQ_REASON_LOCATION_UPD,"Location updating" }, + { GSM_CHREQ_REASON_PDCH, "one phase packet access" }, + { GSM_CHREQ_REASON_OTHER, "other" }, + { 0, NULL } +}; + +const struct value_string gsm_pchant_names[13] = { + { GSM_PCHAN_NONE, "NONE" }, + { GSM_PCHAN_CCCH, "CCCH" }, + { GSM_PCHAN_CCCH_SDCCH4,"CCCH+SDCCH4" }, + { GSM_PCHAN_TCH_F, "TCH/F" }, + { GSM_PCHAN_TCH_H, "TCH/H" }, + { GSM_PCHAN_SDCCH8_SACCH8C, "SDCCH8" }, + { GSM_PCHAN_PDCH, "PDCH" }, + { GSM_PCHAN_TCH_F_PDCH, "TCH/F_PDCH" }, + { GSM_PCHAN_UNKNOWN, "UNKNOWN" }, + { GSM_PCHAN_CCCH_SDCCH4_CBCH, "CCCH+SDCCH4+CBCH" }, + { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "SDCCH8+CBCH" }, + { GSM_PCHAN_TCH_F_TCH_H_PDCH, "TCH/F_TCH/H_PDCH" }, + { 0, NULL } +}; + +const struct value_string gsm_pchant_descs[13] = { + { GSM_PCHAN_NONE, "Physical Channel not configured" }, + { GSM_PCHAN_CCCH, "FCCH + SCH + BCCH + CCCH (Comb. IV)" }, + { GSM_PCHAN_CCCH_SDCCH4, + "FCCH + SCH + BCCH + CCCH + 4 SDCCH + 2 SACCH (Comb. V)" }, + { GSM_PCHAN_TCH_F, "TCH/F + FACCH/F + SACCH (Comb. I)" }, + { GSM_PCHAN_TCH_H, "2 TCH/H + 2 FACCH/H + 2 SACCH (Comb. II)" }, + { GSM_PCHAN_SDCCH8_SACCH8C, "8 SDCCH + 4 SACCH (Comb. VII)" }, + { GSM_PCHAN_PDCH, "Packet Data Channel for GPRS/EDGE" }, + { GSM_PCHAN_TCH_F_PDCH, "Dynamic TCH/F or GPRS PDCH" }, + { GSM_PCHAN_UNKNOWN, "Unknown / Unsupported channel combination" }, + { GSM_PCHAN_CCCH_SDCCH4_CBCH, "FCCH + SCH + BCCH + CCCH + CBCH + 3 SDCCH + 2 SACCH (Comb. V)" }, + { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "7 SDCCH + 4 SACCH + CBCH (Comb. VII)" }, + { GSM_PCHAN_TCH_F_TCH_H_PDCH, "Dynamic TCH/F or TCH/H or GPRS PDCH" }, + { 0, NULL } +}; + +const char *gsm_pchan_name(enum gsm_phys_chan_config c) +{ + return get_value_string(gsm_pchant_names, c); +} + +enum gsm_phys_chan_config gsm_pchan_parse(const char *name) +{ + return get_string_value(gsm_pchant_names, name); +} + +/* TODO: move to libosmocore, next to gsm_chan_t_names? */ +const char *gsm_lchant_name(enum gsm_chan_t c) +{ + return get_value_string(gsm_chan_t_names, c); +} + +static const struct value_string lchan_s_names[] = { + { LCHAN_S_NONE, "NONE" }, + { LCHAN_S_ACT_REQ, "ACTIVATION REQUESTED" }, + { LCHAN_S_ACTIVE, "ACTIVE" }, + { LCHAN_S_INACTIVE, "INACTIVE" }, + { LCHAN_S_REL_REQ, "RELEASE REQUESTED" }, + { LCHAN_S_REL_ERR, "RELEASE DUE ERROR" }, + { LCHAN_S_BROKEN, "BROKEN UNUSABLE" }, + { 0, NULL } +}; + +const char *gsm_lchans_name(enum gsm_lchan_state s) +{ + return get_value_string(lchan_s_names, s); +} + +static const struct value_string chreq_names[] = { + { GSM_CHREQ_REASON_EMERG, "EMERGENCY" }, + { GSM_CHREQ_REASON_PAG, "PAGING" }, + { GSM_CHREQ_REASON_CALL, "CALL" }, + { GSM_CHREQ_REASON_LOCATION_UPD,"LOCATION_UPDATE" }, + { GSM_CHREQ_REASON_OTHER, "OTHER" }, + { 0, NULL } +}; + +const char *gsm_chreq_name(enum gsm_chreq_reason_t c) +{ + return get_value_string(chreq_names, c); +} + +struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num) +{ + struct gsm_bts *bts; + + if (num >= net->num_bts) + return NULL; + + llist_for_each_entry(bts, &net->bts_list, list) { + if (bts->nr == num) + return bts; + } + + return NULL; +} + +struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx = talloc_zero(bts, struct gsm_bts_trx); + int k; + + if (!trx) + return NULL; + + trx->bts = bts; + trx->nr = bts->num_trx++; + trx->mo.nm_state.administrative = NM_STATE_UNLOCKED; + + gsm_mo_init(&trx->mo, bts, NM_OC_RADIO_CARRIER, + bts->nr, trx->nr, 0xff); + gsm_mo_init(&trx->bb_transc.mo, bts, NM_OC_BASEB_TRANSC, + bts->nr, trx->nr, 0xff); + + for (k = 0; k < TRX_NR_TS; k++) { + struct gsm_bts_trx_ts *ts = &trx->ts[k]; + int l; + + ts->trx = trx; + ts->nr = k; + ts->pchan = GSM_PCHAN_NONE; + ts->dyn.pchan_is = GSM_PCHAN_NONE; + ts->dyn.pchan_want = GSM_PCHAN_NONE; + ts->tsc = -1; + + gsm_mo_init(&ts->mo, bts, NM_OC_CHANNEL, + bts->nr, trx->nr, ts->nr); + + ts->hopping.arfcns.data_len = sizeof(ts->hopping.arfcns_data); + ts->hopping.arfcns.data = ts->hopping.arfcns_data; + ts->hopping.ma.data_len = sizeof(ts->hopping.ma_data); + ts->hopping.ma.data = ts->hopping.ma_data; + + for (l = 0; l < TS_MAX_LCHAN; l++) { + struct gsm_lchan *lchan; + char *name; + lchan = &ts->lchan[l]; + + lchan->ts = ts; + lchan->nr = l; + lchan->type = GSM_LCHAN_NONE; + + name = gsm_lchan_name_compute(lchan); + lchan->name = talloc_strdup(trx, name); +#ifndef ROLE_BSC + INIT_LLIST_HEAD(&lchan->sapi_cmds); +#endif + } + } + + if (trx->nr != 0) + trx->nominal_power = bts->c0->nominal_power; + + llist_add_tail(&trx->list, &bts->trx_list); + + return trx; +} + + +static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 }; +static const uint8_t bts_cell_timer_default[] = + { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }; +static const struct gprs_rlc_cfg rlc_cfg_default = { + .parameter = { + [RLC_T3142] = 20, + [RLC_T3169] = 5, + [RLC_T3191] = 5, + [RLC_T3193] = 160, /* 10ms */ + [RLC_T3195] = 5, + [RLC_N3101] = 10, + [RLC_N3103] = 4, + [RLC_N3105] = 8, + [CV_COUNTDOWN] = 15, + [T_DL_TBF_EXT] = 250 * 10, /* ms */ + [T_UL_TBF_EXT] = 250 * 10, /* ms */ + }, + .paging = { + .repeat_time = 5 * 50, /* ms */ + .repeat_count = 3, + }, + .cs_mask = 0x1fff, + .initial_cs = 2, + .initial_mcs = 6, +}; + +struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) +{ + struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); + int i; + + if (!bts) + return NULL; + + bts->nr = bts_num; + bts->num_trx = 0; + INIT_LLIST_HEAD(&bts->trx_list); + bts->ms_max_power = 15; /* dBm */ + + gsm_mo_init(&bts->mo, bts, NM_OC_BTS, + bts->nr, 0xff, 0xff); + gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER, + 0xff, 0xff, 0xff); + + for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { + bts->gprs.nsvc[i].bts = bts; + bts->gprs.nsvc[i].id = i; + gsm_mo_init(&bts->gprs.nsvc[i].mo, bts, NM_OC_GPRS_NSVC, + bts->nr, i, 0xff); + } + memcpy(&bts->gprs.nse.timer, bts_nse_timer_default, + sizeof(bts->gprs.nse.timer)); + gsm_mo_init(&bts->gprs.nse.mo, bts, NM_OC_GPRS_NSE, + bts->nr, 0xff, 0xff); + memcpy(&bts->gprs.cell.timer, bts_cell_timer_default, + sizeof(bts->gprs.cell.timer)); + gsm_mo_init(&bts->gprs.cell.mo, bts, NM_OC_GPRS_CELL, + bts->nr, 0xff, 0xff); + memcpy(&bts->gprs.cell.rlc_cfg, &rlc_cfg_default, + sizeof(bts->gprs.cell.rlc_cfg)); + + /* create our primary TRX */ + bts->c0 = gsm_bts_trx_alloc(bts); + if (!bts->c0) { + talloc_free(bts); + return NULL; + } + bts->c0->ts[0].pchan = GSM_PCHAN_CCCH_SDCCH4; + + bts->rach_b_thresh = -1; + bts->rach_ldavg_slots = -1; + bts->paging.free_chans_need = -1; + bts->features.data = &bts->_features_data[0]; + bts->features.data_len = sizeof(bts->_features_data); + + /* si handling */ + bts->bcch_change_mark = 1; + + return bts; +} + +/* reset the state of all MO in the BTS */ +void gsm_bts_mo_reset(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx; + unsigned int i; + + gsm_abis_mo_reset(&bts->mo); + gsm_abis_mo_reset(&bts->site_mgr.mo); + for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) + gsm_abis_mo_reset(&bts->gprs.nsvc[i].mo); + gsm_abis_mo_reset(&bts->gprs.nse.mo); + gsm_abis_mo_reset(&bts->gprs.cell.mo); + + llist_for_each_entry(trx, &bts->trx_list, list) { + gsm_abis_mo_reset(&trx->mo); + gsm_abis_mo_reset(&trx->bb_transc.mo); + + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + gsm_abis_mo_reset(&ts->mo); + } + } +} + +struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num) +{ + struct gsm_bts_trx *trx; + + if (num >= bts->num_trx) + return NULL; + + llist_for_each_entry(trx, &bts->trx_list, list) { + if (trx->nr == num) + return trx; + } + + return NULL; +} + +static char ts2str[255]; + +char *gsm_trx_name(const struct gsm_bts_trx *trx) +{ + if (!trx) + snprintf(ts2str, sizeof(ts2str), "(trx=NULL)"); + else + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d)", + trx->bts->nr, trx->nr); + + return ts2str; +} + + +char *gsm_ts_name(const struct gsm_bts_trx_ts *ts) +{ + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d)", + ts->trx->bts->nr, ts->trx->nr, ts->nr); + + return ts2str; +} + +/*! Log timeslot number with full pchan information */ +char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts) +{ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + if (ts->dyn.pchan_is == ts->dyn.pchan_want) + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + gsm_pchan_name(ts->dyn.pchan_is)); + else + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s" + " switching %s -> %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + gsm_pchan_name(ts->dyn.pchan_is), + gsm_pchan_name(ts->dyn.pchan_want)); + break; + case GSM_PCHAN_TCH_F_PDCH: + if ((ts->flags & TS_F_PDCH_PENDING_MASK) == 0) + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" + : "TCH/F"); + else + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s" + " switching %s -> %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" + : "TCH/F", + (ts->flags & TS_F_PDCH_ACT_PENDING)? "PDCH" + : "TCH/F"); + break; + default: + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,pchan=%s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan)); + break; + } + + return ts2str; +} + +char *gsm_lchan_name_compute(const struct gsm_lchan *lchan) +{ + struct gsm_bts_trx_ts *ts = lchan->ts; + + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,ss=%d)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, lchan->nr); + + return ts2str; +} + +/* obtain the MO structure for a given object instance */ +struct gsm_abis_mo * +gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst) +{ + struct gsm_bts_trx *trx; + struct gsm_abis_mo *mo = NULL; + + switch (obj_class) { + case NM_OC_BTS: + mo = &bts->mo; + break; + case NM_OC_RADIO_CARRIER: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->mo; + break; + case NM_OC_BASEB_TRANSC: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->bb_transc.mo; + break; + case NM_OC_CHANNEL: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + if (obj_inst->ts_nr >= TRX_NR_TS) + return NULL; + mo = &trx->ts[obj_inst->ts_nr].mo; + break; + case NM_OC_SITE_MANAGER: + mo = &bts->site_mgr.mo; + break; + case NM_OC_BS11: + switch (obj_inst->bts_nr) { + case BS11_OBJ_CCLK: + mo = &bts->bs11.cclk.mo; + break; + case BS11_OBJ_BBSIG: + if (obj_inst->ts_nr > bts->num_trx) + return NULL; + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->bs11.bbsig.mo; + break; + case BS11_OBJ_PA: + if (obj_inst->ts_nr > bts->num_trx) + return NULL; + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->bs11.pa.mo; + break; + default: + return NULL; + } + break; + case NM_OC_BS11_RACK: + mo = &bts->bs11.rack.mo; + break; + case NM_OC_BS11_ENVABTSE: + if (obj_inst->trx_nr >= ARRAY_SIZE(bts->bs11.envabtse)) + return NULL; + mo = &bts->bs11.envabtse[obj_inst->trx_nr].mo; + break; + case NM_OC_GPRS_NSE: + mo = &bts->gprs.nse.mo; + break; + case NM_OC_GPRS_CELL: + mo = &bts->gprs.cell.mo; + break; + case NM_OC_GPRS_NSVC: + if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) + return NULL; + mo = &bts->gprs.nsvc[obj_inst->trx_nr].mo; + break; + } + return mo; +} + +/* obtain the gsm_nm_state data structure for a given object instance */ +struct gsm_nm_state * +gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst) +{ + struct gsm_abis_mo *mo; + + mo = gsm_objclass2mo(bts, obj_class, obj_inst); + if (!mo) + return NULL; + + return &mo->nm_state; +} + +/* obtain the in-memory data structure of a given object instance */ +void * +gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst) +{ + struct gsm_bts_trx *trx; + void *obj = NULL; + + switch (obj_class) { + case NM_OC_BTS: + obj = bts; + break; + case NM_OC_RADIO_CARRIER: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + obj = trx; + break; + case NM_OC_BASEB_TRANSC: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + obj = &trx->bb_transc; + break; + case NM_OC_CHANNEL: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + if (obj_inst->ts_nr >= TRX_NR_TS) + return NULL; + obj = &trx->ts[obj_inst->ts_nr]; + break; + case NM_OC_SITE_MANAGER: + obj = &bts->site_mgr; + break; + case NM_OC_GPRS_NSE: + obj = &bts->gprs.nse; + break; + case NM_OC_GPRS_CELL: + obj = &bts->gprs.cell; + break; + case NM_OC_GPRS_NSVC: + if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) + return NULL; + obj = &bts->gprs.nsvc[obj_inst->trx_nr]; + break; + } + return obj; +} + +/* See Table 10.5.25 of GSM04.08 */ +uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, + uint8_t ts_nr, uint8_t lchan_nr) +{ + uint8_t cbits, chan_nr; + + switch (pchan) { + case GSM_PCHAN_TCH_F: + case GSM_PCHAN_TCH_F_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = 0x01; + break; + case GSM_PCHAN_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = RSL_CHAN_OSMO_PDCH >> 3; + break; + case GSM_PCHAN_TCH_H: + OSMO_ASSERT(lchan_nr < 2); + cbits = 0x02; + cbits += lchan_nr; + break; + case GSM_PCHAN_CCCH_SDCCH4: + case GSM_PCHAN_CCCH_SDCCH4_CBCH: + /* + * As a special hack for BCCH, lchan_nr == 4 may be passed + * here. This should never be sent in an RSL message. + * See osmo-bts-xxx/oml.c:opstart_compl(). + */ + if (lchan_nr == CCCH_LCHAN) + chan_nr = 0; + else + OSMO_ASSERT(lchan_nr < 4); + cbits = 0x04; + cbits += lchan_nr; + break; + case GSM_PCHAN_SDCCH8_SACCH8C: + case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: + OSMO_ASSERT(lchan_nr < 8); + cbits = 0x08; + cbits += lchan_nr; + break; + default: + case GSM_PCHAN_CCCH: +#ifdef ROLE_BSC + OSMO_ASSERT(lchan_nr == 0); +#else + /* + * FIXME: On octphy and litecell, we hit above assertion (see + * Max's comment at https://gerrit.osmocom.org/589 ); disabled + * for BTS until this is clarified; remove the #ifdef when it + * is fixed. + */ +#warning "fix caller that passes lchan_nr != 0" +#endif + cbits = 0x10; + break; + } + + chan_nr = (cbits << 3) | (ts_nr & 0x7); + + return chan_nr; +} + +uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan) +{ + enum gsm_phys_chan_config pchan = lchan->ts->pchan; + if (pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) + return gsm_lchan_as_pchan2chan_nr(lchan, + lchan->ts->dyn.pchan_is); + return gsm_pchan2chan_nr(lchan->ts->pchan, lchan->ts->nr, lchan->nr); +} + +uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, + enum gsm_phys_chan_config as_pchan) +{ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH + && as_pchan == GSM_PCHAN_PDCH) + return RSL_CHAN_OSMO_PDCH | (lchan->ts->nr & ~RSL_CHAN_NR_MASK); + return gsm_pchan2chan_nr(as_pchan, lchan->ts->nr, lchan->nr); +} + +/* return the gsm_lchan for the CBCH (if it exists at all) */ +struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts) +{ + struct gsm_lchan *lchan = NULL; + struct gsm_bts_trx *trx = bts->c0; + + if (trx->ts[0].pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH) + lchan = &trx->ts[0].lchan[2]; + else { + int i; + for (i = 0; i < 8; i++) { + if (trx->ts[i].pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH) { + lchan = &trx->ts[i].lchan[2]; + break; + } + } + } + + return lchan; +} + +/* determine logical channel based on TRX and channel number IE */ +struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, + int *rc) +{ + uint8_t ts_nr = chan_nr & 0x07; + uint8_t cbits = chan_nr >> 3; + uint8_t lch_idx; + struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; + bool ok = true; + + if (rc) + *rc = -EINVAL; + + if (cbits == 0x01) { + lch_idx = 0; /* TCH/F */ + if (ts->pchan != GSM_PCHAN_TCH_F && + ts->pchan != GSM_PCHAN_PDCH && + ts->pchan != GSM_PCHAN_TCH_F_PDCH + && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH + && (ts->dyn.pchan_is == GSM_PCHAN_TCH_F + || ts->dyn.pchan_want == GSM_PCHAN_TCH_F))) + ok = false; + } else if ((cbits & 0x1e) == 0x02) { + lch_idx = cbits & 0x1; /* TCH/H */ + if (ts->pchan != GSM_PCHAN_TCH_H + && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH + && (ts->dyn.pchan_is == GSM_PCHAN_TCH_H + || ts->dyn.pchan_want == GSM_PCHAN_TCH_H))) + ok = false; + } else if ((cbits & 0x1c) == 0x04) { + lch_idx = cbits & 0x3; /* SDCCH/4 */ + if (ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && + ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) + ok = false; + } else if ((cbits & 0x18) == 0x08) { + lch_idx = cbits & 0x7; /* SDCCH/8 */ + if (ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C && + ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C_CBCH) + ok = false; + } else if (cbits == 0x10 || cbits == 0x11 || cbits == 0x12) { + lch_idx = 0; + if (ts->pchan != GSM_PCHAN_CCCH && + ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && + ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) + ok = false; + /* FIXME: we should not return first sdcch4 !!! */ + } else if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH) { + lch_idx = 0; + if (ts->pchan != GSM_PCHAN_TCH_F_TCH_H_PDCH) + ok = false; + } else + return NULL; + + if (rc && ok) + *rc = 0; + + return &ts->lchan[lch_idx]; +} + +static const uint8_t subslots_per_pchan[] = { + [GSM_PCHAN_NONE] = 0, + [GSM_PCHAN_CCCH] = 0, + [GSM_PCHAN_PDCH] = 0, + [GSM_PCHAN_CCCH_SDCCH4] = 4, + [GSM_PCHAN_TCH_F] = 1, + [GSM_PCHAN_TCH_H] = 2, + [GSM_PCHAN_SDCCH8_SACCH8C] = 8, + [GSM_PCHAN_CCCH_SDCCH4_CBCH] = 4, + [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = 8, + /* + * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be + * part of this, those TS are handled according to their dynamic state. + */ +}; + +/*! Return the actual pchan type, also heeding dynamic TS. */ +enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts) +{ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + return ts->dyn.pchan_is; + case GSM_PCHAN_TCH_F_PDCH: + if (ts->flags & TS_F_PDCH_ACTIVE) + return GSM_PCHAN_PDCH; + else + return GSM_PCHAN_TCH_F; + default: + return ts->pchan; + } +} + +/*! According to ts->pchan and possibly ts->dyn_pchan, return the number of + * logical channels available in the timeslot. */ +uint8_t ts_subslots(struct gsm_bts_trx_ts *ts) +{ + return subslots_per_pchan[ts_pchan(ts)]; +} + +static bool pchan_is_tch(enum gsm_phys_chan_config pchan) +{ + switch (pchan) { + case GSM_PCHAN_TCH_F: + case GSM_PCHAN_TCH_H: + return true; + default: + return false; + } +} + +bool ts_is_tch(struct gsm_bts_trx_ts *ts) +{ + return pchan_is_tch(ts_pchan(ts)); +} diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 78a770a..fdb794d 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = subdir-objects -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(LITECELL15_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(LITECELL15_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) $(LIBSYSTEMD_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-octphy/Makefile.am b/src/osmo-bts-octphy/Makefile.am index ac6a83e..9ca9e44 100644 --- a/src/osmo-bts-octphy/Makefile.am +++ b/src/osmo-bts-octphy/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(OCTSDR2G_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OCTSDR2G_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 7b27e70..c48b77c 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-trx/Makefile.am b/src/osmo-bts-trx/Makefile.am index 0a97251..5fe7705 100644 --- a/src/osmo-bts-trx/Makefile.am +++ b/src/osmo-bts-trx/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCODING_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am index d1f05af..6038426 100644 --- a/src/osmo-bts-virtual/Makefile.am +++ b/src/osmo-bts-virtual/Makefile.am @@ -1,5 +1,5 @@ AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -Iinclude +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -Iinclude COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h diff --git a/tests/agch/Makefile.am b/tests/agch/Makefile.am index 46b55e9..1357ea2 100644 --- a/tests/agch/Makefile.am +++ b/tests/agch/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = agch_test diff --git a/tests/cipher/Makefile.am b/tests/cipher/Makefile.am index d76dcd5..a671550 100644 --- a/tests/cipher/Makefile.am +++ b/tests/cipher/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = cipher_test diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 597ab2d..8bff297 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = handover_test diff --git a/tests/meas/Makefile.am b/tests/meas/Makefile.am index 8dd0582..895d474 100644 --- a/tests/meas/Makefile.am +++ b/tests/meas/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = meas_test diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index d5acb18..6575fe8 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) noinst_PROGRAMS = misc_test diff --git a/tests/paging/Makefile.am b/tests/paging/Makefile.am index be9de74..98c6673 100644 --- a/tests/paging/Makefile.am +++ b/tests/paging/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = paging_test diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 2f267f3..654ab5d 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) diff --git a/tests/tx_power/Makefile.am b/tests/tx_power/Makefile.am index 3d4377a..349958c 100644 --- a/tests/tx_power/Makefile.am +++ b/tests/tx_power/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = tx_power_test -- To view, visit https://gerrit.osmocom.org/4161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 8 19:46:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 8 Oct 2017 19:46:05 +0000 Subject: libosmocore[master]: gsm: make osmo_imsi_str_valid() NULL-safe In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/4156/1/src/gsm/gsm23003.c File src/gsm/gsm23003.c: Line 36: for (len = 0; pos && *pos && len < max_digits; len++, pos++) > I thought so far the idea was to "fail early". Why not check str == NULL an a NULL str may still return true when min_digits == 0. Ah, this reminds me that the API doc below lacks documentation of this. Should be like in https://gerrit.osmocom.org/4159 https://gerrit.osmocom.org/#/c/4156/1/tests/gsm23003/gsm23003_test.ok File tests/gsm23003/gsm23003_test.ok: Line 23: ----- test_valid_msisdn (interesting, gerrit highlights the wrong line, probably an '\r' getting it mixed up) -- To view, visit https://gerrit.osmocom.org/4156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 8 19:51:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 8 Oct 2017 19:51:08 +0000 Subject: libosmocore[master]: utils: add osmo_is_hexstr(), add unit test In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4159/1/src/utils.c File src/utils.c: Line 395: const unsigned char *pos = (const unsigned char *)str; > That looks weird. Why not just use "const unsigned char *str" in parameters I want the function to work on normal char strings. But doing pos++ on plain 'char *' causes compiler warnings, as the comment explains. I don't get these warnings on every platform, but it did show in the gerrit checks for https://gerrit.osmocom.org/4144 . If I made str a const unsigned char* param, I would have to cast for each and every caller trying to feed a plain char* to it. It has to be exactly like this, AFAICT, unfortunately. -- To view, visit https://gerrit.osmocom.org/4159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 8 20:04:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 8 Oct 2017 20:04:12 +0000 Subject: libosmocore[master]: gsm: make osmo_imsi_str_valid() NULL-safe In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4156/1/src/gsm/gsm23003.c File src/gsm/gsm23003.c: Line 36: for (len = 0; pos && *pos && len < max_digits; len++, pos++) > a NULL str may still return true when min_digits == 0. Ah, this reminds me ah, nonsense, the osmo_{msisdn,imsi}_valid never call it with min_digits <= 0. If is_n_digits() were available to more users, the current patch would make sense. As it is now you are probably right to complain. It came to be this way because I copied from G#4159 without considering that this one is static and we know all the callers. -- To view, visit https://gerrit.osmocom.org/4156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 8 20:10:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 8 Oct 2017 20:10:36 +0000 Subject: [PATCH] libosmocore[master]: gsm: make osmo_imsi_str_valid() NULL-safe In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4156 to look at the new patch set (#2). gsm: make osmo_imsi_str_valid() NULL-safe No callers that would pass NULL exist, but let's check against NULL from the start. Fixup for recent change I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522. Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e --- M src/gsm/gsm23003.c M tests/gsm23003/gsm23003_test.c M tests/gsm23003/gsm23003_test.ok 3 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/56/4156/2 diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c index 004e20f..3c09aca 100644 --- a/src/gsm/gsm23003.c +++ b/src/gsm/gsm23003.c @@ -33,6 +33,8 @@ /* Use unsigned char * to avoid a compiler warning of * "error: array subscript has type 'char' [-Werror=char-subscripts]" */ const unsigned char *pos = (const unsigned char *)str; + if (!pos) + return min_digits < 1; for (len = 0; *pos && len < max_digits; len++, pos++) if (!isdigit(*pos)) return false; diff --git a/tests/gsm23003/gsm23003_test.c b/tests/gsm23003/gsm23003_test.c index 682f162..a408b73 100644 --- a/tests/gsm23003/gsm23003_test.c +++ b/tests/gsm23003/gsm23003_test.c @@ -50,6 +50,7 @@ { "1234567\n123456", false }, { "123456\t123456", false }, { "123456\r123456", false }, + { NULL, false }, }; bool test_valid_imsi() @@ -92,6 +93,7 @@ { "1234567\n123456", false }, { "123456\t123456", false }, { "123456\r123456", false }, + { NULL, false }, }; bool test_valid_msisdn() diff --git a/tests/gsm23003/gsm23003_test.ok b/tests/gsm23003/gsm23003_test.ok index 777451a..7d7ffd1 100644 --- a/tests/gsm23003/gsm23003_test.ok +++ b/tests/gsm23003/gsm23003_test.ok @@ -19,6 +19,7 @@ 123456' 17: expect=false result=false imsi='123456 123456' 18: expect=false result=false imsi='123456 123456' +19: expect=false result=false imsi='(null)' ----- test_valid_msisdn 0: expect=false result=false msisdn='' 1: expect=false result=false msisdn=' ' @@ -40,3 +41,4 @@ 123456' 17: expect=false result=false msisdn='123456 123456' 18: expect=false result=false msisdn='123456 123456' +19: expect=false result=false msisdn='(null)' -- To view, visit https://gerrit.osmocom.org/4156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 8 20:11:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 8 Oct 2017 20:11:21 +0000 Subject: [PATCH] libosmocore[master]: utils: add osmo_is_hexstr(), add unit test In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4159 to look at the new patch set (#2). utils: add osmo_is_hexstr(), add unit test Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a --- M include/osmocom/core/utils.h M src/utils.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 4 files changed, 132 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/59/4159/2 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 855e653..5f41213 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include @@ -89,4 +91,7 @@ size_t osmo_strlcpy(char *dst, const char *src, size_t siz); +bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, + bool require_even); + /*! @} */ diff --git a/src/utils.c b/src/utils.c index 1c176f8..b4345c7 100644 --- a/src/utils.c +++ b/src/utils.c @@ -375,4 +375,37 @@ return ret; } +/*! Validate that a given string is a hex string within given size limits. + * Note that each hex digit amounts to a nibble, so if checking for a hex + * string to result in N bytes, pass amount of digits as 2*N. + * \param str A nul-terminated string to validate, or NULL. + * \param min_digits least permitted amount of digits. + * \param max_digits most permitted amount of digits. + * \param require_even if true, require an even amount of digits. + * \returns true when the hex_str contains only hexadecimal digits (no + * whitespace) and matches the requested length; also true + * when min_digits <= 0 and str is NULL. + */ +bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, + bool require_even) +{ + int len; + /* Use unsigned char * to avoid a compiler warning of + * "error: array subscript has type 'char' [-Werror=char-subscripts]" */ + const unsigned char *pos = (const unsigned char*)str; + if (!pos) + return min_digits < 1; + for (len = 0; *pos && len < max_digits; len++, pos++) + if (!isxdigit(*pos)) + return false; + if (len < min_digits) + return false; + /* With not too many digits, we should have reached *str == nul */ + if (*pos) + return false; + if (require_even && (len & 1)) + return false; + return true; +} + /*! @} */ diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index cad162d..4a4b121 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -219,6 +219,68 @@ OSMO_ASSERT(!TLVP_PRESENT(&tvp, 0x25)); } +static struct { + const char *str; + int min_digits; + int max_digits; + bool require_even; + bool expect_ok; +} test_hexstrs[] = { + { NULL, 0, 10, false, true }, + { NULL, 1, 10, false, false }, + { "", 0, 10, false, true }, + { "", 1, 10, false, false }, + { " ", 0, 10, false, false }, + { "1", 0, 10, false, true }, + { "1", 1, 10, false, true }, + { "1", 1, 10, true, false }, + { "1", 2, 10, false, false }, + { "123", 1, 10, false, true }, + { "123", 1, 10, true, false }, + { "123", 4, 10, false, false }, + { "1234", 4, 10, true, true }, + { "12345", 4, 10, true, false }, + { "123456", 4, 10, true, true }, + { "1234567", 4, 10, true, false }, + { "12345678", 4, 10, true, true }, + { "123456789", 4, 10, true, false }, + { "123456789a", 4, 10, true, true }, + { "123456789ab", 4, 10, true, false }, + { "123456789abc", 4, 10, true, false }, + { "123456789ab", 4, 10, false, false }, + { "123456789abc", 4, 10, false, false }, + { "0123456789abcdefABCDEF", 0, 100, false, true }, + { "0123456789 abcdef ABCDEF", 0, 100, false, false }, + { "foobar", 0, 100, false, false }, + { "BeadedBeeAced1EbbedDefacedFacade", 32, 32, true, true }, + { "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 32, 32, false, true }, + { "DeafBeddedBabeAcceededFadedDecaff", 32, 32, false, false }, +}; + +bool test_is_hexstr() +{ + int i; + bool pass = true; + bool ok = true; + printf("\n----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_hexstrs); i++) { + ok = osmo_is_hexstr(test_hexstrs[i].str, + test_hexstrs[i].min_digits, + test_hexstrs[i].max_digits, + test_hexstrs[i].require_even); + pass = pass && (ok == test_hexstrs[i].expect_ok); + printf("%2d: %s str='%s' min=%d max=%d even=%d expect=%s\n", + i, test_hexstrs[i].expect_ok == ok ? "pass" : "FAIL", + test_hexstrs[i].str, + test_hexstrs[i].min_digits, + test_hexstrs[i].max_digits, + test_hexstrs[i].require_even, + test_hexstrs[i].expect_ok ? "valid" : "invalid"); + } + return pass; +} + int main(int argc, char **argv) { static const struct log_info log_info = {}; @@ -227,5 +289,6 @@ hexdump_test(); hexparse_test(); test_idtag_parsing(); + test_is_hexstr(); return 0; } diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index e9be018..45156f7 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -26,3 +26,34 @@ rc = -1 Hexparse with invalid char rc = -1 + +----- test_is_hexstr + 0: pass str='(null)' min=0 max=10 even=0 expect=valid + 1: pass str='(null)' min=1 max=10 even=0 expect=invalid + 2: pass str='' min=0 max=10 even=0 expect=valid + 3: pass str='' min=1 max=10 even=0 expect=invalid + 4: pass str=' ' min=0 max=10 even=0 expect=invalid + 5: pass str='1' min=0 max=10 even=0 expect=valid + 6: pass str='1' min=1 max=10 even=0 expect=valid + 7: pass str='1' min=1 max=10 even=1 expect=invalid + 8: pass str='1' min=2 max=10 even=0 expect=invalid + 9: pass str='123' min=1 max=10 even=0 expect=valid +10: pass str='123' min=1 max=10 even=1 expect=invalid +11: pass str='123' min=4 max=10 even=0 expect=invalid +12: pass str='1234' min=4 max=10 even=1 expect=valid +13: pass str='12345' min=4 max=10 even=1 expect=invalid +14: pass str='123456' min=4 max=10 even=1 expect=valid +15: pass str='1234567' min=4 max=10 even=1 expect=invalid +16: pass str='12345678' min=4 max=10 even=1 expect=valid +17: pass str='123456789' min=4 max=10 even=1 expect=invalid +18: pass str='123456789a' min=4 max=10 even=1 expect=valid +19: pass str='123456789ab' min=4 max=10 even=1 expect=invalid +20: pass str='123456789abc' min=4 max=10 even=1 expect=invalid +21: pass str='123456789ab' min=4 max=10 even=0 expect=invalid +22: pass str='123456789abc' min=4 max=10 even=0 expect=invalid +23: pass str='0123456789abcdefABCDEF' min=0 max=100 even=0 expect=valid +24: pass str='0123456789 abcdef ABCDEF' min=0 max=100 even=0 expect=invalid +25: pass str='foobar' min=0 max=100 even=0 expect=invalid +26: pass str='BeadedBeeAced1EbbedDefacedFacade' min=32 max=32 even=1 expect=valid +27: pass str='C01ffedC1cadaeAc1d1f1edAcac1aB0a' min=32 max=32 even=0 expect=valid +28: pass str='DeafBeddedBabeAcceededFadedDecaff' min=32 max=32 even=0 expect=invalid -- To view, visit https://gerrit.osmocom.org/4159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 8 20:50:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 8 Oct 2017 20:50:17 +0000 Subject: osmo-bsc[master]: SI2q: fix generation for multiple UARFCNs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) I don't understand the fix; but apart from that detail there, the code looks like it knows what it is doing. https://gerrit.osmocom.org/#/c/4160/1/src/libbsc/system_information.c File src/libbsc/system_information.c: Line 301: if (len - i) { this is actually if (len != i) and I guess it should either be that, or rather check something like if (i < len) -- To view, visit https://gerrit.osmocom.org/4160 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 8 20:54:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 8 Oct 2017 20:54:47 +0000 Subject: osmo-bts[master]: Remove build dependency on legacy OpenBSC In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:03:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:03:04 +0000 Subject: [PATCH] libosmocore[master]: Ensure __always_inline is defined on operating systems that ... Message-ID: Review at https://gerrit.osmocom.org/4162 Ensure __always_inline is defined on operating systems that don't have it For example, Alpine Linux fails to build libosmocore without us locally defining __always_inline. Change-Id: I0c22aac410e668f8fb8d5de57281bcaeb343eeb1 --- M src/conv_acc_sse_impl.h 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/62/4162/1 diff --git a/src/conv_acc_sse_impl.h b/src/conv_acc_sse_impl.h index e6eaaa6..560af62 100644 --- a/src/conv_acc_sse_impl.h +++ b/src/conv_acc_sse_impl.h @@ -22,6 +22,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +/* Some distributions (notably Alpine Linux) for some strange reason + * don't have this #define */ +#ifndef __always_inline +#define __always_inline inline __attribute__((always_inline)) +#endif + extern int sse41_supported; /* Octo-Viterbi butterfly -- To view, visit https://gerrit.osmocom.org/4162 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c22aac410e668f8fb8d5de57281bcaeb343eeb1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:10:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:10:08 +0000 Subject: libosmocore[master]: Ensure __always_inline is defined on operating systems that ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4162 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c22aac410e668f8fb8d5de57281bcaeb343eeb1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:11:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:11:05 +0000 Subject: [MERGED] libosmocore[master]: Ensure __always_inline is defined on operating systems that ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Ensure __always_inline is defined on operating systems that don't have it ...................................................................... Ensure __always_inline is defined on operating systems that don't have it For example, Alpine Linux fails to build libosmocore without us locally defining __always_inline. Change-Id: I0c22aac410e668f8fb8d5de57281bcaeb343eeb1 --- M src/conv_acc_sse_impl.h 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/conv_acc_sse_impl.h b/src/conv_acc_sse_impl.h index e6eaaa6..560af62 100644 --- a/src/conv_acc_sse_impl.h +++ b/src/conv_acc_sse_impl.h @@ -22,6 +22,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +/* Some distributions (notably Alpine Linux) for some strange reason + * don't have this #define */ +#ifndef __always_inline +#define __always_inline inline __attribute__((always_inline)) +#endif + extern int sse41_supported; /* Octo-Viterbi butterfly -- To view, visit https://gerrit.osmocom.org/4162 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c22aac410e668f8fb8d5de57281bcaeb343eeb1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:27:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:27:33 +0000 Subject: osmo-bts[master]: Remove build dependency on legacy OpenBSC In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:28:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:28:53 +0000 Subject: osmo-bsc[master]: SI2q: cleanup UARFCN addition In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4110 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia72f848dec40723510ca56868e08081804227d47 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:30:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:30:22 +0000 Subject: libosmocore[master]: utils: add osmo_is_hexstr(), add unit test In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:31:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:31:47 +0000 Subject: libosmocore[master]: auth: add OSMO_MILENAGE_IND_BITLEN_MAX In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic39f3404d1a49ffd06070aa9897b36f219eacf4d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:32:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:32:45 +0000 Subject: libosmocore[master]: auth: add value_strings for osmo_sub_auth_type, comment on o... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I652a929bcd11c694d86812fb03d0a1cbd985efda Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:34:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:34:43 +0000 Subject: osmo-gsm-manuals[master]: logging: replace OpenBSC -> OsmoBSC in examples In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id55dcd41b0d2b3408969d1858e925da55fb5427c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:35:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:35:09 +0000 Subject: osmo-gsm-manuals[master]: logging: restructure sections In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4154 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5acde815c66eb3d57e06ecd8dc65fe338216fe63 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:36:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:36:22 +0000 Subject: osmo-gsm-manuals[master]: logging: document alarms target In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4155/1/common/chapters/logging.adoc File common/chapters/logging.adoc: Line 144: In the example above 10000 is the desired size of the ring buffer (number of messages). Once it's filled, please make that example smaller. It's unrealistic that an user would want to see the last 10k alarms. I think something like 100 is already quite a lot for a practical example. Otherwise fine. -- To view, visit https://gerrit.osmocom.org/4155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I95ce5f3db38616608590e02ee79eb3a7e6e4ea14 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:40:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:40:05 +0000 Subject: libosmocore[master]: Add function to generate random identifier In-Reply-To: References: Message-ID: Patch Set 12: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Gerrit-PatchSet: 12 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 03:40:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 9 Oct 2017 03:40:53 +0000 Subject: libosmocore[master]: Add function to generate random identifier In-Reply-To: References: Message-ID: Patch Set 12: please note that in the related thread we stated that rand() fallback should/could be a compile-time option. But anyway, we can think about that once people actually report failures on any affected system that doesn't have getrandom() -- To view, visit https://gerrit.osmocom.org/1526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Gerrit-PatchSet: 12 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 09:39:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Oct 2017 09:39:19 +0000 Subject: [PATCH] osmo-bts[master]: l1sap: Improve log msg when frame diff >1 Message-ID: Review at https://gerrit.osmocom.org/4165 l1sap: Improve log msg when frame diff >1 Print the two fn values to understand better the wrong behaviour. Change-Id: I4f7b3ffbf7ce3a8d8d6872e4281ef228f4c5527f --- M src/common/l1sap.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/65/4165/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 1b3a3ad..763b355 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -456,7 +456,8 @@ frames_expired = info_time_ind->fn - btsb->gsm_time.fn; if (frames_expired > 1) { LOGP(DL1P, LOGL_ERROR, - "Invalid condition detected: Frame difference is > 1!\n"); + "Invalid condition detected: Frame difference is %"PRIu32"-%"PRIu32" > 1!\n", + info_time_ind->fn, btsb->gsm_time.fn); } /* Update our data structures with the current GSM time */ -- To view, visit https://gerrit.osmocom.org/4165 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f7b3ffbf7ce3a8d8d6872e4281ef228f4c5527f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 9 10:07:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 10:07:48 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: logging: restructure sections In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: logging: restructure sections ...................................................................... logging: restructure sections The basic logging concepts like filters and levels which are target-independent. It's counter-intuitive that they are described inside vty target section. * fix that by putting them in separate sections which are referenced from target sections as necessary * move all targets into subsections under "Log targets" section Change-Id: I5acde815c66eb3d57e06ecd8dc65fe338216fe63 Related: OS#1913 --- M common/chapters/logging.adoc 1 file changed, 50 insertions(+), 30 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index 28b6d3e..94fa898 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -25,34 +25,20 @@ configured by means of VTY commands that can either be entered interactively, or read from a configuration file at process start time. -=== Logging to the VTY +[[log_categories]] +=== Log categories -Logging messages to the interactive command-line interface (VTY) is most -useful for occasional investigation by the system administrator. - -Logging to the VTY is disabled by default, and needs to be enabled -explicitly for each such session. This means that multiple concurrent -VTY sessions each have their own logging configuration. Once you close -a VTY session, the log target will be destroyed and your log settings be -lost. If you re-connect to the VTY, you have to again activate and -configure logging, if you wish. - -To create a logging target bound to a VTY, you have to use the following -command: `logging enable` This doesn't really activate the -generation of any output messages yet, it merely creates and attaches a -log target to the VTY session. The newly-created target still doesn't -have any filter installed, i.e. __all log messages will be suppressed -by default__ - -Next, you can configure the log levels for your VTY session. Each -sub-system of the program in question typically logs its messages as a +Each sub-system of the program in question typically logs its messages as a different category, allowing fine-grained control over which log messages you will or will not see. For example, in OsmoBSC, there are categories for the protocol layers `rsl`, `rr`, `mm`, `cc` and many others. To get a a list of categories interactively on the vty, type: `logging level ?` -For each of those categories, you can set an independent log level, +[[log_levels]] +=== Log levels + +For each of the log categories (see <>), you can set an independent log level, controlling the level of verbosity. Log levels include: fatal:: @@ -84,12 +70,10 @@ Management category to info, you can use the following command: `log level mm info`. -Equally, to set the log level of the Call Control category to debug, you -can use: - `log level cc debug` +[[log_filters]] +=== Log filters -Finally, after having configured the levels, you still need to set the -filter. The default behavior is to filter out everything, i.e. not to +The default behavior is to filter out everything, i.e. not to log anything. The reason is quite simple: On a busy production setup, logging all events for a given subsystem may very quickly be flooding your console before you have a chance to set a more restrictive filter. @@ -101,13 +85,49 @@ subscriber identified by his IMSI, you may use: `log filter imsi 262020123456789` +=== Log targets + +Each of the log targets represent certain destination for log messages. +It can be configured independently by selecting levels (see <>) for categories +(see <>) as well as filtering (see <>) and +other options like `logging timestamp` for example. + +==== Logging to the VTY + +Logging messages to the interactive command-line interface (VTY) is most +useful for occasional investigation by the system administrator. + +Logging to the VTY is disabled by default, and needs to be enabled +explicitly for each such session. This means that multiple concurrent +VTY sessions each have their own logging configuration. Once you close +a VTY session, the log target will be destroyed and your log settings be +lost. If you re-connect to the VTY, you have to again activate and +configure logging, if you wish. + +To create a logging target bound to a VTY, you have to use the following +command: `logging enable` This doesn't really activate the +generation of any output messages yet, it merely creates and attaches a +log target to the VTY session. The newly-created target still doesn't +have any filter installed, i.e. __all log messages will be suppressed +by default__ + +Next, you can configure the log levels for desired categories in your VTY session. +See <> for more details on categories and <> for the log level details. + +For example, to set the log level of the Call Control category to debug, you +can use: + `log level cc debug` + +Finally, after having configured the levels, you still need to set the +filter as it's described in <>. + TIP: If many messages are being logged to a VTY session, it may be hard to impossible to still use the same session for any commands. We therefore recommend to open a second VTY session in parallel, and use one only for logging, while the other is used for interacting with the -system. +system. Another option would be to use different log target. -=== Logging to a file +==== Logging to a file As opposed to Logging to the VTY, logging to files is persistent and stored in the configuration file. As such, it is configured in @@ -139,7 +159,7 @@ implemented. -=== Logging to syslog +==== Logging to syslog syslog is a standard for computer data logging maintained by the IETF. Unix-like operating systems like GNU/Linux provide several syslog @@ -168,7 +188,7 @@ by issuing the `logging timestamp 0` command. -=== Logging to stderr +==== Logging to stderr If you're not running the respective application as a daemon in the background, you can also use the stderr log target in order to log to -- To view, visit https://gerrit.osmocom.org/4154 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5acde815c66eb3d57e06ecd8dc65fe338216fe63 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 9 10:07:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 10:07:49 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: logging: replace OpenBSC -> OsmoBSC in examples In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: logging: replace OpenBSC -> OsmoBSC in examples ...................................................................... logging: replace OpenBSC -> OsmoBSC in examples Change-Id: Id55dcd41b0d2b3408969d1858e925da55fb5427c --- M common/chapters/logging.adoc 1 file changed, 14 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index 564f6d2..28b6d3e 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -47,7 +47,7 @@ Next, you can configure the log levels for your VTY session. Each sub-system of the program in question typically logs its messages as a different category, allowing fine-grained control over which log -messages you will or will not see. For example, in OpenBSC, there are +messages you will or will not see. For example, in OsmoBSC, there are categories for the protocol layers `rsl`, `rr`, `mm`, `cc` and many others. To get a a list of categories interactively on the vty, type: `logging level ?` @@ -80,7 +80,7 @@ really means that all events with a level of at least __info__ will be logged, i.e. including events of __notice__, __error__ and __fatal__. -So for example, in OpenBSC, to set the log level of the Mobility +So for example, in OsmoBSC, to set the log level of the Mobility Management category to info, you can use the following command: `log level mm info`. @@ -117,10 +117,10 @@ To configure a new log file, enter the following sequence of commands: ---- -OpenBSC> enable -OpenBSC# configure terminal -OpenBSC(config)# log file /path/to/my/file -OpenBSC(config-log)# +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log file /path/to/my/file +OsmoBSC(config-log)# ---- This leaves you at the config-log prompt, from where you can set the @@ -151,10 +151,10 @@ following commands on the VTY: ---- -OpenBSC> enable -OpenBSC# configure terminal -OpenBSC(config)# log syslog daemon -OpenBSC(config-log)# +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log syslog daemon +OsmoBSC(config-log)# ---- This leaves you at the config-log prompt, from where you can set the @@ -177,8 +177,8 @@ In order to configure logging to stderr, you can use the following commands: ---- -OpenBSC> enable -OpenBSC# configure terminal -OpenBSC(config)# log stderr -OpenBSC(config-log)# +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log stderr +OsmoBSC(config-log)# ---- -- To view, visit https://gerrit.osmocom.org/4153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id55dcd41b0d2b3408969d1858e925da55fb5427c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 9 10:08:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 10:08:16 +0000 Subject: [MERGED] osmo-bsc[master]: SI2q: cleanup UARFCN addition In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: SI2q: cleanup UARFCN addition ...................................................................... SI2q: cleanup UARFCN addition * expand comments, fix typos * constify parameter * move try-add-adjust routine into separate function to facilitate further modifications * remove excessive checks and unnecessary return values * move (UARFCN, Scrambling Code) tuple uniqueness check into separate function and use it early Change-Id: Ia72f848dec40723510ca56868e08081804227d47 Related: OS#2357 --- M src/libbsc/rest_octets.c M src/libbsc/system_information.c 2 files changed, 90 insertions(+), 88 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index 09c4a90..b1516ec 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -232,7 +232,7 @@ } /* Estimate how many bits it'll take to append single FDD UARFCN */ -static inline int append_utran_fdd_length(uint16_t u, int *sc, size_t sc_len, size_t length) +static inline int append_utran_fdd_length(uint16_t u, const int *sc, size_t sc_len, size_t length) { uint8_t chan_list[16] = { 0 }; int tmp[sc_len], f0; @@ -274,18 +274,42 @@ return 21 + range1024_p(length); } -/* Append multiple FDD UARFCNs */ -static inline int append_uarfcns(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) +static inline int try_adding_uarfcn(struct bitvec *bv, struct gsm_bts *bts, uint16_t uarfcn, + uint8_t num_sc, uint8_t start_pos, uint8_t budget) { - const uint16_t *u = bts->si_common.data.uarfcn_list, *sc = bts->si_common.data.scramble_list; - int i, j, k, rc, st = 0, a[bts->si_common.uarfcn_length]; + int i, k, rc, a[bts->si_common.uarfcn_length]; + + if (budget < 23) + return -ENOMEM; + + /* copy corresponding Scrambling Codes: range encoder make in-place modifications */ + for (i = start_pos, k = 0; i < num_sc; a[k++] = bts->si_common.data.scramble_list[i++]); + + /* estimate bit length requirements */ + rc = append_utran_fdd_length(uarfcn, a, bts->si_common.uarfcn_length, k); + if (rc < 0) + return rc; /* range encoder failure */ + + if (budget - rc <= 0) + return -ENOMEM; /* we have ran out of budget in current SI2q */ + + /* compute next offset */ + bts->u_offset += k; + + return budget - append_utran_fdd(bv, uarfcn, a, k); +} + +/* Append multiple FDD UARFCNs */ +static inline void append_uarfcns(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) +{ + const uint16_t *u = bts->si_common.data.uarfcn_list; + int i, rem = budget - 7, st = 0; /* account for constant bits right away */ uint16_t cu = u[bts->u_offset]; /* caller ensures that length is positive */ - uint8_t rem = budget - 7, offset_diff; /* account for constant bits right away */ OSMO_ASSERT(budget <= SI2Q_MAX_LEN); if (budget <= 7) - return -ENOMEM; + return; /* 3G Neighbour Cell Description */ bitvec_set_bit(bv, 1); @@ -299,53 +323,24 @@ /* No Bandwidth_FDD */ bitvec_set_bit(bv, 0); - for (i = bts->u_offset; i < bts->si_common.uarfcn_length; i++) { - offset_diff = 0; - for (j = st, k = 0; j < i; j++) { - a[k++] = sc[j]; /* copy corresponding SCs */ - offset_diff++; /* compute proper offset step */ - } + for (i = bts->u_offset; i <= bts->si_common.uarfcn_length; i++) if (u[i] != cu) { /* we've reached new UARFCN */ - rc = append_utran_fdd_length(cu, a, bts->si_common.uarfcn_length, k); - if (rc < 0) { /* estimate bit length requirements */ - return rc; - } + rem = try_adding_uarfcn(bv, bts, cu, i, st, rem); + if (rem < 0) + break; - if (rem - rc <= 0) - break; /* we have ran out of budget in current SI2q */ - else { - rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset += offset_diff; - } - cu = u[i]; - st = i; /* update start position */ + if (i < bts->si_common.uarfcn_length) { + cu = u[i]; + st = i; + } else + break; } - } - - if (rem > 22) { /* add last UARFCN not covered by previous cycle if it could possibly fit into budget */ - offset_diff = 0; - for (i = st, k = 0; i < bts->si_common.uarfcn_length; i++) { - a[k++] = sc[i]; - offset_diff++; - } - rc = append_utran_fdd_length(cu, a, bts->si_common.uarfcn_length, k); - if (rc < 0) { - return rc; - } - - if (rem - rc >= 0) { - rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset += offset_diff; - } - } /* stop bit - end of Repeated UTRAN FDD Neighbour Cells */ bitvec_set_bit(bv, 0); /* UTRAN TDD Description */ bitvec_set_bit(bv, 0); - - return 0; } /* generate SI2quater rest octets: 3GPP TS 44.018 ? 10.5.2.33b */ @@ -393,15 +388,9 @@ bitvec_set_bit(&bv, 0); rc = SI2Q_MAX_LEN - (bv.cur_bit + 3); - if (rc > 0 && bts->si_common.uarfcn_length - bts->u_offset > 0) { - rc = append_uarfcns(&bv, bts, rc); - if (rc < 0) { - LOGP(DRR, LOGL_ERROR, "SI2quater [%u/%u]: failed to append %zu UARFCNs due to range encoding " - "failure: %s\n", - bts->si2q_index, bts->si2q_count, bts->si_common.uarfcn_length, strerror(-rc)); - return rc; - } - } else /* No 3G Neighbour Cell Description */ + if (rc > 0 && bts->si_common.uarfcn_length - bts->u_offset > 0) + append_uarfcns(&bv, bts, rc); + else /* No 3G Neighbour Cell Description */ bitvec_set_bit(&bv, 0); /* No 3G Measurement Parameters Description */ diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index 7bdb80a..761e848 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -182,7 +182,7 @@ int rc = make_si2quaters(bts, true); uint8_t num = bts->si2q_index + 1; /* number of SI2quater messages */ - /* N. B: si2q_num() should NEVER be called during actualSI2q rest octets generation + /* N. B: si2q_num() should NEVER be called during actual SI2q rest octets generation we're not re-entrant because of the following code: */ bts->u_offset = 0; bts->e_offset = 0; @@ -239,26 +239,40 @@ return r; } +/* Scrambling Code as defined in 3GPP TS 25.213 is 9 bit long so number below is unreacheable upper bound */ +#define SC_BOUND 600 + +/* Find position for a given UARFCN (take SC into consideration if it's available) in a sorted list + N. B: we rely on the assumption that (uarfcn, scramble) tuple is unique in the lists */ +static int uarfcn_sc_pos(const struct gsm_bts *bts, uint16_t uarfcn, uint16_t scramble) +{ + const uint16_t *sc = bts->si_common.data.scramble_list; + uint16_t i, scramble0 = encode_fdd(scramble, false), scramble1 = encode_fdd(scramble, true); + for (i = 0; i < bts->si_common.uarfcn_length; i++) + if (uarfcn == bts->si_common.data.uarfcn_list[i]) { + if (scramble < SC_BOUND) { + if (scramble0 == sc[i] || scramble1 == sc[i]) + return i; + } else + return i; + } + + return -1; +} + int bts_uarfcn_del(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble) { - uint16_t sc0 = encode_fdd(scramble, false), sc1 = encode_fdd(scramble, true), - *ual = bts->si_common.data.uarfcn_list, - *scl = bts->si_common.data.scramble_list; - size_t len = bts->si_common.uarfcn_length, i; - for (i = 0; i < len; i++) { - if (arfcn == ual[i] && (sc0 == scl[i] || sc1 == scl[i])) { - /* we rely on the assumption that (uarfcn, scramble) - tuple is unique in the lists */ - if (i != len - 1) { /* move the tail if necessary */ - memmove(ual + i, ual + i + 1, 2 * (len - i + 1)); - memmove(scl + i, scl + i + 1, 2 * (len - i + 1)); - } - break; - } - } + uint16_t *ual = bts->si_common.data.uarfcn_list, *scl = bts->si_common.data.scramble_list; + size_t len = bts->si_common.uarfcn_length; + int pos = uarfcn_sc_pos(bts, arfcn, scramble); - if (i == len) + if (pos < 0) return -EINVAL; + + if (pos != len - 1) { /* move the tail if necessary */ + memmove(ual + pos, ual + pos + 1, 2 * (len - pos + 1)); + memmove(scl + pos, scl + pos + 1, 2 * (len - pos + 1)); + } bts->si_common.uarfcn_length--; return 0; @@ -267,29 +281,27 @@ int bts_uarfcn_add(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble, bool diversity) { size_t len = bts->si_common.uarfcn_length, i, k = 0; - uint16_t scr, chk, + uint8_t si2q; + int pos = uarfcn_sc_pos(bts, arfcn, scramble); + uint16_t scr = diversity ? encode_fdd(scramble, true) : encode_fdd(scramble, false), *ual = bts->si_common.data.uarfcn_list, - *scl = bts->si_common.data.scramble_list, - scramble1 = encode_fdd(scramble, true), - scramble0 = encode_fdd(scramble, false); - - scr = diversity ? scramble1 : scramble0; - chk = diversity ? scramble0 : scramble1; + *scl = bts->si_common.data.scramble_list; if (len == MAX_EARFCN_LIST) return -ENOMEM; - for (i = 0; i < len; i++) /* find the position of arfcn if any */ - if (arfcn == ual[i]) - break; + if (pos >= 0) + return -EADDRINUSE; - for (k = 0; i < len; i++) { - if (arfcn == ual[i] && (scr == scl[i] || chk == scl[i])) - return -EADDRINUSE; + /* find the suitable position for arfcn if any */ + pos = uarfcn_sc_pos(bts, arfcn, SC_BOUND); + i = (pos < 0) ? len : pos; + + for (k = 0; i < len; i++) if (scr > scl[i]) k = i + 1; - } - /* we keep lists sorted by scramble code: + + /* we keep lists sorted by scramble code of a given UARFCN: insert into appropriate position and move the tail */ if (len - k) { memmove(ual + k + 1, ual + k, (len - k) * 2); @@ -299,9 +311,10 @@ ual[k] = arfcn; scl[k] = scr; bts->si_common.uarfcn_length++; + si2q = si2q_num(bts); - if (si2q_num(bts) <= SI2Q_MAX_NUM) { - bts->si2q_count = si2q_num(bts) - 1; + if (si2q <= SI2Q_MAX_NUM) { + bts->si2q_count = si2q - 1; return 0; } -- To view, visit https://gerrit.osmocom.org/4110 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia72f848dec40723510ca56868e08081804227d47 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 9 10:18:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 10:18:04 +0000 Subject: libosmocore[master]: Add function to generate random identifier In-Reply-To: References: Message-ID: Patch Set 12: Yes, replied in ML. I'll merge this and if necessary fallback code can be easily added as a follow-up patch. -- To view, visit https://gerrit.osmocom.org/1526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Gerrit-PatchSet: 12 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 10:18:08 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 10:18:08 +0000 Subject: [MERGED] libosmocore[master]: Add function to generate random identifier In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add function to generate random identifier ...................................................................... Add function to generate random identifier The function is a wrapper on top of getrandom() (if available via glibc) or corresponding syscall. If neither is available than failure is always returned. It's intended to generate small random data good enough for session identifiers and keys. To generate long-term cryptographic keys it's better to use special crypto libraries (like GnuTLS for example) instead. As an example it's used to replace old insecure random number generator in osmo-auc-gen utility. Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Related: OS#1694 --- M configure.ac M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map M utils/osmo-auc-gen.c 5 files changed, 63 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 33c151e..d9390cf 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,9 @@ AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") +# check for syscal fallback on glibc < 2.25 - can be removed once glibc version requirement is bumped +AC_CHECK_DECLS([SYS_getrandom], [], [], [[#include ]]) + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index bfcef08..83e29ca 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -38,6 +38,9 @@ #define GSM_MAX_FN (26*51*2048) +/* Max length of random identifier which can be requested via osmo_get_rand_id() */ +#define OSMO_MAX_RAND_ID_LEN 16 + struct gsm_time { uint32_t fn; /* FN count */ uint16_t t1; /* FN div (26*51) */ @@ -60,6 +63,8 @@ const char *gsm_band_name(enum gsm_band band); enum gsm_band gsm_band_parse(const char *mhz); +int osmo_get_rand_id(uint8_t *out, size_t len); + /*! * Decode a sequence of GSM 03.38 encoded 7 bit characters. * diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 477f076..f572c64 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -91,8 +91,17 @@ #include #include #include +#include +#include #include "../../config.h" + +/* FIXME: this can be removed once we bump glibc requirements to 2.25: */ +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) +#include +#elif HAVE_DECL_SYS_GETRANDOM +#include +#endif /* ETSI GSM 03.38 6.2.1 and 6.2.1.1 default alphabet * Greek symbols at hex positions 0x10 and 0x12-0x1a @@ -387,6 +396,45 @@ return y; } +/*! Generate random identifier + * We use /dev/urandom (default when GRND_RANDOM flag is not set). + * Both /dev/(u)random numbers are coming from the same CSPRNG anyway (at least on GNU/Linux >= 4.8). + * See also RFC4086. + * \param[out] out Buffer to be filled with random data + * \param[in] len Number of random bytes required + * \returns 0 on success, or a negative error code on error. + */ +int osmo_get_rand_id(uint8_t *out, size_t len) +{ + int rc; + + /* this function is intended for generating short identifiers only, not arbitrary-length random data */ + if (len > OSMO_MAX_RAND_ID_LEN) + return -E2BIG; + +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) + rc = getrandom(out, len, GRND_NONBLOCK); +#elif HAVE_DECL_SYS_GETRANDOM +#pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") + /* FIXME: this can be removed once we bump glibc requirements to 2.25: */ + rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK); +#else +#pragma message ("Secure random unavailable: calls to osmo_get_rand_id() will always fail!") + return -ENOTSUP; +#endif + /* getrandom() failed entirely: */ + if (rc < 0) + return -errno; + + /* getrandom() failed partially due to signal interruption: + this should never happen (according to getrandom(2)) as long as OSMO_MAX_RAND_ID_LEN < 256 + because we do not set GRND_RANDOM but it's better to be paranoid and check anyway */ + if (rc != len) + return -EAGAIN; + + return 0; +} + /*! Build the RSL uplink measurement IE (3GPP TS 08.58 ? 9.3.25) * \param[in] mru Unidirectional measurement report structure * \param[in] dtxd_used Indicates if DTXd was used during measurement report diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 95b2ca9..5598859 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -39,6 +39,7 @@ osmo_sitype_strs; osmo_c4; +osmo_get_rand_id; bitvec_add_range1024; comp128; comp128v2; diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 1f5c838..9d1215c 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -34,6 +34,7 @@ #include #include +#include static void dump_triplets_dat(struct osmo_auth_vector *vec) { @@ -247,14 +248,11 @@ } if (!rand_is_set) { - int i; - printf("WARNING: We're using really weak random numbers!\n\n"); - srand(time(NULL)); - - for (i = 0; i < 4; ++i) { - uint32_t r; - r = rand(); - memcpy(&_rand[i*4], &r, 4); + rc = osmo_get_rand_id(_rand, 16); + if (rc < 0) { + fprintf(stderr, "\nError: unable to obtain secure random numbers: %s!\n", + strerror(-rc)); + exit(3); } } -- To view, visit https://gerrit.osmocom.org/1526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Gerrit-PatchSet: 13 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Mon Oct 9 10:19:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 10:19:50 +0000 Subject: [MERGED] osmo-bts[master]: Remove build dependency on legacy OpenBSC In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove build dependency on legacy OpenBSC ...................................................................... Remove build dependency on legacy OpenBSC * copy-paste gsm_data_shared.* from OpenBSC master * remove corresponding configure check and option * remove .deb dependency Actual refactoring with removal of unnecessary structures/parts, moving common OpenBSC/OsmoBSC parts into libraries etc. are left for further patches. Current patch will make coexistence with *BSC easier and will simplify our build infrastructure. Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13 Related: OS#1923 --- M configure.ac M debian/control M debian/rules M include/Makefile.am D include/openbsc/gsm_data.h M include/osmo-bts/Makefile.am M include/osmo-bts/gsm_data.h A include/osmo-bts/gsm_data_shared.h M src/common/Makefile.am M src/common/gsm_data_shared.c M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-octphy/Makefile.am M src/osmo-bts-sysmo/Makefile.am M src/osmo-bts-trx/Makefile.am M src/osmo-bts-virtual/Makefile.am M tests/agch/Makefile.am M tests/cipher/Makefile.am M tests/handover/Makefile.am M tests/meas/Makefile.am M tests/misc/Makefile.am M tests/paging/Makefile.am M tests/sysmobts/Makefile.am M tests/tx_power/Makefile.am 23 files changed, 1,870 insertions(+), 39 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index bc36456..a41f7ec 100644 --- a/configure.ac +++ b/configure.ac @@ -147,25 +147,9 @@ CPPFLAGS=$oldCPPFLAGS fi -# We share gsm_data.h with OpenBSC and need to be pointed to the source -# directory of OpenBSC for now. -AC_ARG_WITH([openbsc], - [AS_HELP_STRING([--with-openbsc=INCLUDE_DIR], - [OpenBSC include directory for openbsc/gsm_data_shared.h])], - [openbsc_incdir="$withval"], - [openbsc_incdir="`cd $srcdir; pwd`/../openbsc/openbsc/include"]) -AC_SUBST([OPENBSC_INCDIR], $openbsc_incdir) - -oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" -AC_CHECK_HEADER([openbsc/gsm_data_shared.h],[], - [AC_MSG_ERROR([openbsc/gsm_data_shared.h can not be found in $openbsc_incdir])], - [#include ]) -CPPFLAGS=$oldCPPFLAGS - # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR $LIBOSMOCORE_CFLAGS" +CPPFLAGS="$CPPFLAGS $LIBOSMOCORE_CFLAGS" AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"],[]) CPPFLAGS=$oldCPPFLAGS diff --git a/debian/control b/debian/control index e1a58b2..074f687 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,6 @@ autotools-dev, pkg-config, libosmocore-dev, - openbsc-dev, libosmo-abis-dev, libosmo-netif-dev, libgps-dev, diff --git a/debian/rules b/debian/rules index 12b3334..80ba0b2 100755 --- a/debian/rules +++ b/debian/rules @@ -19,7 +19,7 @@ dh_autoreconf override_dh_auto_configure: - dh_auto_configure -- --enable-trx --with-openbsc=/usr/src/osmocom/openbsc/openbsc/include/ + dh_auto_configure -- --enable-trx override_dh_clean: dh_clean diff --git a/include/Makefile.am b/include/Makefile.am index e35e696..7585a65 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,3 +1 @@ SUBDIRS = osmo-bts - -noinst_HEADERS = openbsc/gsm_data.h diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h deleted file mode 120000 index f0d49f2..0000000 --- a/include/openbsc/gsm_data.h +++ /dev/null @@ -1 +0,0 @@ -../osmo-bts/gsm_data.h \ No newline at end of file diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index ef4165f..a15ce3d 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,4 +1,4 @@ -noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ +noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h gsm_data_shared.h logging.h measurement.h \ oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \ power_control.h scheduler.h scheduler_backend.h phy_link.h \ diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index aeac4b2..dcffcf6 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -133,7 +133,7 @@ #define bts_role_bts(x) ((struct gsm_bts_role_bts *)(x)->role) -#include "openbsc/gsm_data_shared.h" +#include void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state); int conf_lchans_as_pchan(struct gsm_bts_trx_ts *ts, diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h new file mode 100644 index 0000000..c19b125 --- /dev/null +++ b/include/osmo-bts/gsm_data_shared.h @@ -0,0 +1,999 @@ +#ifndef _GSM_DATA_SHAREDH +#define _GSM_DATA_SHAREDH + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifndef ROLE_BSC +#include +#endif + +/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: + 4-bit index is used (2#1111 = 10#15) */ +#define SI2Q_MAX_NUM 16 +/* length in bits (for single SI2quater message) */ +#define SI2Q_MAX_LEN 160 +#define SI2Q_MIN_LEN 18 + +struct osmo_bsc_data; + +struct osmo_bsc_sccp_con; +struct gsm_sms_queue; + +/* RRLP mode of operation */ +enum rrlp_mode { + RRLP_MODE_NONE, + RRLP_MODE_MS_BASED, + RRLP_MODE_MS_PREF, + RRLP_MODE_ASS_PREF, +}; + +/* Channel Request reason */ +enum gsm_chreq_reason_t { + GSM_CHREQ_REASON_EMERG, + GSM_CHREQ_REASON_PAG, + GSM_CHREQ_REASON_CALL, + GSM_CHREQ_REASON_LOCATION_UPD, + GSM_CHREQ_REASON_OTHER, + GSM_CHREQ_REASON_PDCH, +}; + +/* lchans 0..3 are SDCCH in combined channel configuration, + use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */ +#define CCCH_LCHAN 4 + +#define TRX_NR_TS 8 +#define TS_MAX_LCHAN 8 + +#define HARDCODED_ARFCN 123 +#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */ + +/* for multi-drop config */ +#define HARDCODED_BTS0_TS 1 +#define HARDCODED_BTS1_TS 6 +#define HARDCODED_BTS2_TS 11 + +#define MAX_VERSION_LENGTH 64 + +#define MAX_BTS_FEATURES 128 + +enum gsm_hooks { + GSM_HOOK_NM_SWLOAD, + GSM_HOOK_RR_PAGING, + GSM_HOOK_RR_SECURITY, +}; + +enum gsm_paging_event { + GSM_PAGING_SUCCEEDED, + GSM_PAGING_EXPIRED, + GSM_PAGING_OOM, + GSM_PAGING_BUSY, +}; + +enum bts_gprs_mode { + BTS_GPRS_NONE = 0, + BTS_GPRS_GPRS = 1, + BTS_GPRS_EGPRS = 2, +}; + +struct gsm_lchan; +struct gsm_subscriber; +struct gsm_mncc; +struct osmo_rtp_socket; +struct rtp_socket; +struct bsc_api; + +/* Network Management State */ +struct gsm_nm_state { + uint8_t operational; + uint8_t administrative; + uint8_t availability; +}; + +struct gsm_abis_mo { + uint8_t obj_class; + uint8_t procedure_pending; + struct abis_om_obj_inst obj_inst; + const char *name; + struct gsm_nm_state nm_state; + struct tlv_parsed *nm_attr; + struct gsm_bts *bts; +}; + +/* Ericsson OM2000 Managed Object */ +struct abis_om2k_mo { + uint8_t class; + uint8_t bts; + uint8_t assoc_so; + uint8_t inst; +} __attribute__ ((packed)); + +struct om2k_mo { + struct abis_om2k_mo addr; + struct osmo_fsm_inst *fsm; +}; + +#define MAX_A5_KEY_LEN (128/8) +#define A38_XOR_MIN_KEY_LEN 12 +#define A38_XOR_MAX_KEY_LEN 16 +#define A38_COMP128_KEY_LEN 16 +#define RSL_ENC_ALG_A5(x) (x+1) +#define MAX_EARFCN_LIST 32 + +/* is the data link established? who established it? */ +#define LCHAN_SAPI_UNUSED 0 +#define LCHAN_SAPI_MS 1 +#define LCHAN_SAPI_NET 2 +#define LCHAN_SAPI_REL 3 + +/* state of a logical channel */ +enum gsm_lchan_state { + LCHAN_S_NONE, /* channel is not active */ + LCHAN_S_ACT_REQ, /* channel activation requested */ + LCHAN_S_ACTIVE, /* channel is active and operational */ + LCHAN_S_REL_REQ, /* channel release has been requested */ + LCHAN_S_REL_ERR, /* channel is in an error state */ + LCHAN_S_BROKEN, /* channel is somehow unusable */ + LCHAN_S_INACTIVE, /* channel is set inactive */ +}; + +/* BTS ONLY */ +#define MAX_NUM_UL_MEAS 104 +#define LC_UL_M_F_L1_VALID (1 << 0) +#define LC_UL_M_F_RES_VALID (1 << 1) + +struct bts_ul_meas { + /* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */ + uint16_t ber10k; + /* timing advance offset (in quarter bits) */ + int16_t ta_offs_qbits; + /* C/I ratio in dB */ + float c_i; + /* flags */ + uint8_t is_sub:1; + /* RSSI in dBm * -1 */ + uint8_t inv_rssi; +}; + +struct bts_codec_conf { + uint8_t hr; + uint8_t efr; + uint8_t amr; +}; + +struct amr_mode { + uint8_t mode; + uint8_t threshold; + uint8_t hysteresis; +}; + +struct amr_multirate_conf { + uint8_t gsm48_ie[2]; + struct amr_mode ms_mode[4]; + struct amr_mode bts_mode[4]; + uint8_t num_modes; +}; +/* /BTS ONLY */ + +enum lchan_csd_mode { + LCHAN_CSD_M_NT, + LCHAN_CSD_M_T_1200_75, + LCHAN_CSD_M_T_600, + LCHAN_CSD_M_T_1200, + LCHAN_CSD_M_T_2400, + LCHAN_CSD_M_T_9600, + LCHAN_CSD_M_T_14400, + LCHAN_CSD_M_T_29000, + LCHAN_CSD_M_T_32000, +}; + +/* State of the SAPIs in the lchan */ +enum lchan_sapi_state { + LCHAN_SAPI_S_NONE, + LCHAN_SAPI_S_REQ, + LCHAN_SAPI_S_ASSIGNED, + LCHAN_SAPI_S_REL, + LCHAN_SAPI_S_ERROR, +}; + +struct gsm_lchan { + /* The TS that we're part of */ + struct gsm_bts_trx_ts *ts; + /* The logical subslot number in the TS */ + uint8_t nr; + /* The logical channel type */ + enum gsm_chan_t type; + /* RSL channel mode */ + enum rsl_cmod_spd rsl_cmode; + /* If TCH, traffic channel mode */ + enum gsm48_chan_mode tch_mode; + enum lchan_csd_mode csd_mode; + /* State */ + enum gsm_lchan_state state; + const char *broken_reason; + /* Power levels for MS and BTS */ + uint8_t bs_power; + uint8_t ms_power; + /* Encryption information */ + struct { + uint8_t alg_id; + uint8_t key_len; + uint8_t key[MAX_A5_KEY_LEN]; + } encr; + + /* AMR bits */ + uint8_t mr_ms_lv[7]; + uint8_t mr_bts_lv[7]; + + /* Established data link layer services */ + uint8_t sapis[8]; + int sacch_deact; + + struct { + uint32_t bound_ip; + uint32_t connect_ip; + uint16_t bound_port; + uint16_t connect_port; + uint16_t conn_id; + uint8_t rtp_payload; + uint8_t rtp_payload2; + uint8_t speech_mode; +#ifdef ROLE_BSC + struct rtp_socket *rtp_socket; +#else + struct osmo_rtp_socket *rtp_socket; +#endif + } abis_ip; + + uint8_t rqd_ta; + + char *name; + +#ifdef ROLE_BSC + struct osmo_timer_list T3101; + struct osmo_timer_list T3109; + struct osmo_timer_list T3111; + struct osmo_timer_list error_timer; + struct osmo_timer_list act_timer; + struct osmo_timer_list rel_work; + uint8_t error_cause; + + /* table of neighbor cell measurements */ + struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; + + /* cache of last measurement reports on this lchan */ + struct gsm_meas_rep meas_rep[6]; + int meas_rep_idx; + + /* GSM Random Access data */ + struct gsm48_req_ref *rqd_ref; + + struct gsm_subscriber_connection *conn; + + struct { + /* channel activation type and handover ref */ + uint8_t act_type; + uint8_t ho_ref; + struct gsm48_req_ref *rqd_ref; + uint8_t rqd_ta; + } dyn; +#else + /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. + * Currently we don't share these headers so this is a magic number. */ + struct llist_head sapi_cmds; + uint8_t sapis_dl[23]; + uint8_t sapis_ul[23]; + struct lapdm_channel lapdm_ch; + struct llist_head dl_tch_queue; + struct { + /* bitmask of all SI that are present/valid in si_buf */ + uint32_t valid; + uint32_t last; + /* buffers where we put the pre-computed SI: + SI2Q_MAX_NUM is the max number of SI2quater messages (see 3GPP TS 44.018) */ + sysinfo_buf_t buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; + } si; + struct { + uint8_t flags; + /* RSL measurment result number, 0 at lchan_act */ + uint8_t res_nr; + /* current Tx power level of the BTS */ + uint8_t bts_tx_pwr; + /* number of measurements stored in array below */ + uint8_t num_ul_meas; + struct bts_ul_meas uplink[MAX_NUM_UL_MEAS]; + /* last L1 header from the MS */ + uint8_t l1_info[2]; + struct gsm_meas_rep_unidir ul_res; + } meas; + struct { + struct amr_multirate_conf amr_mr; + struct { + struct osmo_fsm_inst *dl_amr_fsm; + /* TCH cache */ + uint8_t cache[20]; + /* FACCH cache */ + uint8_t facch[GSM_MACBLOCK_LEN]; + uint8_t len; + uint32_t fn; + bool is_update; + /* set for each SID frame to detect talkspurt for codecs + without explicit ONSET event */ + bool ul_sid; + /* indicates if DTXd was active during DL measurement + period */ + bool dl_active; + } dtx; + uint8_t last_cmr; + uint32_t last_fn; + } tch; + + /* 3GPP TS 48.058 ? 9.3.37: [0; 255] ok, -1 means invalid*/ + int16_t ms_t_offs; + /* 3GPP TS 45.010 ? 1.2 round trip propagation delay (in symbols) or -1 */ + int16_t p_offs; + + /* BTS-side ciphering state (rx only, bi-directional, ...) */ + uint8_t ciph_state; + uint8_t ciph_ns; + uint8_t loopback; + struct { + uint8_t active; + uint8_t ref; + /* T3105: PHYS INF retransmission */ + struct osmo_timer_list t3105; + /* counts up to Ny1 */ + unsigned int phys_info_count; + } ho; + /* S counter for link loss */ + int s; + /* Kind of the release/activation. E.g. RSL or PCU */ + int rel_act_kind; + /* RTP header Marker bit to indicate beginning of speech after pause */ + bool rtp_tx_marker; + /* power handling */ + struct { + uint8_t current; + uint8_t fixed; + } ms_power_ctrl; + + struct msgb *pending_rel_ind_msg; +#endif +}; + +enum { + TS_F_PDCH_ACTIVE = 0x1000, + TS_F_PDCH_ACT_PENDING = 0x2000, + TS_F_PDCH_DEACT_PENDING = 0x4000, + TS_F_PDCH_PENDING_MASK = 0x6000 /*< + TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */ +} gsm_bts_trx_ts_flags; + +/* One Timeslot in a TRX */ +struct gsm_bts_trx_ts { + struct gsm_bts_trx *trx; + /* number of this timeslot at the TRX */ + uint8_t nr; + + enum gsm_phys_chan_config pchan; + + struct { + enum gsm_phys_chan_config pchan_is; + enum gsm_phys_chan_config pchan_want; + struct msgb *pending_chan_activ; + } dyn; + + unsigned int flags; + struct gsm_abis_mo mo; + struct tlv_parsed nm_attr; + uint8_t nm_chan_comb; + int tsc; /* -1 == use BTS TSC */ + + struct { + /* Parameters below are configured by VTY */ + int enabled; + uint8_t maio; + uint8_t hsn; + struct bitvec arfcns; + uint8_t arfcns_data[1024/8]; + /* This is the pre-computed MA for channel assignments */ + struct bitvec ma; + uint8_t ma_len; /* part of ma_data that is used */ + uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */ + } hopping; + + /* To which E1 subslot are we connected */ + struct gsm_e1_subslot e1_link; + + union { + struct { + struct om2k_mo om2k_mo; + } rbs2000; + }; + + struct gsm_lchan lchan[TS_MAX_LCHAN]; +}; + +/* One TRX in a BTS */ +struct gsm_bts_trx { + /* list header in bts->trx_list */ + struct llist_head list; + + struct gsm_bts *bts; + /* number of this TRX in the BTS */ + uint8_t nr; + /* human readable name / description */ + char *description; + /* how do we talk RSL with this TRX? */ + struct gsm_e1_subslot rsl_e1_link; + uint8_t rsl_tei; + struct e1inp_sign_link *rsl_link; + + /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */ + struct e1inp_sign_link *oml_link; + + struct gsm_abis_mo mo; + struct tlv_parsed nm_attr; + struct { + struct gsm_abis_mo mo; + } bb_transc; + + uint16_t arfcn; + int nominal_power; /* in dBm */ + unsigned int max_power_red; /* in actual dB */ + +#ifndef ROLE_BSC + struct trx_power_params power_params; + int ms_power_control; + + struct { + void *l1h; + } role_bts; +#endif + + union { + struct { + struct { + struct gsm_abis_mo mo; + } bbsig; + struct { + struct gsm_abis_mo mo; + } pa; + } bs11; + struct { + unsigned int test_state; + uint8_t test_nr; + struct rxlev_stats rxlev_stat; + } ipaccess; + struct { + struct { + struct om2k_mo om2k_mo; + } trxc; + struct { + struct om2k_mo om2k_mo; + } rx; + struct { + struct om2k_mo om2k_mo; + } tx; + } rbs2000; + }; + struct gsm_bts_trx_ts ts[TRX_NR_TS]; +}; + +#define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i]) +#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i)) +#define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i][0]) +#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0]) + +enum gsm_bts_type { + GSM_BTS_TYPE_UNKNOWN, + GSM_BTS_TYPE_BS11, + GSM_BTS_TYPE_NANOBTS, + GSM_BTS_TYPE_RBS2000, + GSM_BTS_TYPE_NOKIA_SITE, + GSM_BTS_TYPE_OSMOBTS, + _NUM_GSM_BTS_TYPE +}; + +enum gsm_bts_type_variant { + BTS_UNKNOWN, + BTS_OSMO_LITECELL15, + BTS_OSMO_OCTPHY, + BTS_OSMO_SYSMO, + BTS_OSMO_TRX, + _NUM_BTS_VARIANT +}; + +/* Used by OML layer for BTS Attribute reporting */ +enum bts_attribute { + BTS_TYPE_VARIANT, + BTS_SUB_MODEL, + TRX_PHY_VERSION, +}; + +struct vty; + +struct gsm_bts_model { + struct llist_head list; + + enum gsm_bts_type type; + enum gsm_bts_type_variant variant; + const char *name; + + bool started; + int (*start)(struct gsm_network *net); + int (*oml_rcvmsg)(struct msgb *msg); + + void (*e1line_bind_ops)(struct e1inp_line *line); + + void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts); + void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx); + void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts); + + struct tlv_definition nm_att_tlvdef; + + /* features of a given BTS model set via gsm_bts_model_register() locally */ + struct bitvec features; + uint8_t _features_data[MAX_BTS_FEATURES/8]; +}; + +/* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility + with BTS compiled against earlier version of this header */ +enum gsm_bts_features { + BTS_FEAT_HSCSD, + BTS_FEAT_GPRS, + BTS_FEAT_EGPRS, + BTS_FEAT_ECSD, + BTS_FEAT_HOPPING, + BTS_FEAT_MULTI_TSC, + BTS_FEAT_OML_ALERTS, + BTS_FEAT_AGCH_PCH_PROP, + BTS_FEAT_CBCH, + _NUM_BTS_FEAT +}; + +extern const struct value_string gsm_bts_features_descs[]; + +/* + * This keeps track of the paging status of one BTS. It + * includes a number of pending requests, a back pointer + * to the gsm_bts, a timer and some more state. + */ +struct gsm_bts_paging_state { + /* pending requests */ + struct llist_head pending_requests; + struct gsm_bts *bts; + + struct osmo_timer_list work_timer; + struct osmo_timer_list credit_timer; + + /* free chans needed */ + int free_chans_need; + + /* load */ + uint16_t available_slots; +}; + +struct gsm_envabtse { + struct gsm_abis_mo mo; +}; + +struct gsm_bts_gprs_nsvc { + struct gsm_bts *bts; + /* data read via VTY config file, to configure the BTS + * via OML from BSC */ + int id; + uint16_t nsvci; + uint16_t local_port; /* on the BTS */ + uint16_t remote_port; /* on the SGSN */ + uint32_t remote_ip; /* on the SGSN */ + + struct gsm_abis_mo mo; +}; + +enum gprs_rlc_par { + RLC_T3142, + RLC_T3169, + RLC_T3191, + RLC_T3193, + RLC_T3195, + RLC_N3101, + RLC_N3103, + RLC_N3105, + CV_COUNTDOWN, + T_DL_TBF_EXT, /* ms */ + T_UL_TBF_EXT, /* ms */ + _NUM_RLC_PAR +}; + +enum gprs_cs { + GPRS_CS1, + GPRS_CS2, + GPRS_CS3, + GPRS_CS4, + GPRS_MCS1, + GPRS_MCS2, + GPRS_MCS3, + GPRS_MCS4, + GPRS_MCS5, + GPRS_MCS6, + GPRS_MCS7, + GPRS_MCS8, + GPRS_MCS9, + _NUM_GRPS_CS +}; + +struct gprs_rlc_cfg { + uint16_t parameter[_NUM_RLC_PAR]; + struct { + uint16_t repeat_time; /* ms */ + uint8_t repeat_count; + } paging; + uint32_t cs_mask; /* bitmask of gprs_cs */ + uint8_t initial_cs; + uint8_t initial_mcs; +}; + + +enum neigh_list_manual_mode { + NL_MODE_AUTOMATIC = 0, + NL_MODE_MANUAL = 1, + NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */ +}; + +enum bts_loc_fix { + BTS_LOC_FIX_INVALID = 0, + BTS_LOC_FIX_2D = 1, + BTS_LOC_FIX_3D = 2, +}; + +extern const struct value_string bts_loc_fix_names[]; + +struct bts_location { + struct llist_head list; + time_t tstamp; + enum bts_loc_fix valid; + double lat; + double lon; + double height; +}; + +/* One BTS */ +struct gsm_bts { + /* list header in net->bts_list */ + struct llist_head list; + + /* Geographical location of the BTS */ + struct llist_head loc_list; + + /* number of ths BTS in network */ + uint8_t nr; + /* human readable name / description */ + char *description; + /* Cell Identity */ + uint16_t cell_identity; + /* location area code of this BTS */ + uint16_t location_area_code; + /* Base Station Identification Code (BSIC), lower 3 bits is BCC, + * which is used as TSC for the CCCH */ + uint8_t bsic; + /* type of BTS */ + enum gsm_bts_type type; + enum gsm_bts_type_variant variant; + struct gsm_bts_model *model; + enum gsm_band band; + char version[MAX_VERSION_LENGTH]; + char sub_model[MAX_VERSION_LENGTH]; + + /* features of a given BTS set/reported via OML */ + struct bitvec features; + uint8_t _features_data[MAX_BTS_FEATURES/8]; + + /* Connected PCU version (if any) */ + char pcu_version[MAX_VERSION_LENGTH]; + + /* maximum Tx power that the MS is permitted to use in this cell */ + int ms_max_power; + + /* how do we talk OML with this TRX? */ + struct gsm_e1_subslot oml_e1_link; + uint8_t oml_tei; + struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; + + /* Abis network management O&M handle */ + struct abis_nm_h *nmh; + + struct gsm_abis_mo mo; + + /* number of this BTS on given E1 link */ + uint8_t bts_nr; + + /* DTX features of this BTS */ + enum gsm48_dtx_mode dtxu; + bool dtxd; + + /* paging state and control */ + struct gsm_bts_paging_state paging; + + /* CCCH is on C0 */ + struct gsm_bts_trx *c0; + + struct { + struct gsm_abis_mo mo; + } site_mgr; + + /* bitmask of all SI that are present/valid in si_buf */ + uint32_t si_valid; + /* 3GPP TS 44.018 Table 10.5.2.33b.1 INDEX and COUNT for SI2quater */ + uint8_t si2q_index; /* distinguish individual SI2quater messages */ + uint8_t si2q_count; /* si2q_index for the last (highest indexed) individual SI2quater message */ + /* buffers where we put the pre-computed SI */ + sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; + /* offsets used while generating SI2quater */ + size_t e_offset; + size_t u_offset; + + /* ip.accesss Unit ID's have Site/BTS/TRX layout */ + union { + struct { + uint16_t site_id; + uint16_t bts_id; + uint32_t flags; + uint32_t rsl_ip; + } ip_access; + struct { + struct { + struct gsm_abis_mo mo; + } cclk; + struct { + struct gsm_abis_mo mo; + } rack; + struct gsm_envabtse envabtse[4]; + } bs11; + struct { + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } cf; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } is; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } con; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + } dp; + struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + } tf; + uint32_t use_superchannel:1; + } rbs2000; + struct { + uint8_t bts_type; + unsigned int configured:1, + skip_reset:1, + no_loc_rel_cnf:1, + bts_reset_timer_cnf, + did_reset:1, + wait_reset:1; + struct osmo_timer_list reset_timer; + } nokia; + }; + + /* Not entirely sure how ip.access specific this is */ + struct { + uint8_t supports_egprs_11bit_rach; + enum bts_gprs_mode mode; + struct { + struct gsm_abis_mo mo; + uint16_t nsei; + uint8_t timer[7]; + } nse; + struct { + struct gsm_abis_mo mo; + uint16_t bvci; + uint8_t timer[11]; + struct gprs_rlc_cfg rlc_cfg; + } cell; + struct gsm_bts_gprs_nsvc nsvc[2]; + uint8_t rac; + uint8_t net_ctrl_ord; + bool ctrl_ack_type_use_block; + } gprs; + + /* RACH NM values */ + int rach_b_thresh; + int rach_ldavg_slots; + + /* transceivers */ + int num_trx; + struct llist_head trx_list; + + /* SI related items */ + int force_combined_si; + int bcch_change_mark; + +#ifdef ROLE_BSC + /* Abis NM queue */ + struct llist_head abis_queue; + int abis_nm_pend; + + struct gsm_network *network; + + /* should the channel allocator allocate channels from high TRX to TRX0, + * rather than starting from TRX0 and go upwards? */ + int chan_alloc_reverse; + + enum neigh_list_manual_mode neigh_list_manual_mode; + /* parameters from which we build SYSTEM INFORMATION */ + struct { + struct gsm48_rach_control rach_control; + uint8_t ncc_permitted; + struct gsm48_cell_sel_par cell_sel_par; + struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */ + struct gsm48_cell_options cell_options; + struct gsm48_control_channel_descr chan_desc; + struct bitvec neigh_list; + struct bitvec cell_alloc; + struct bitvec si5_neigh_list; + struct osmo_earfcn_si2q si2quater_neigh_list; + size_t uarfcn_length; /* index for uarfcn and scramble lists */ + struct { + /* bitmask large enough for all possible ARFCN's */ + uint8_t neigh_list[1024/8]; + uint8_t cell_alloc[1024/8]; + /* If the user wants a different neighbor list in SI5 than in SI2 */ + uint8_t si5_neigh_list[1024/8]; + uint8_t meas_bw_list[MAX_EARFCN_LIST]; + uint16_t earfcn_list[MAX_EARFCN_LIST]; + uint16_t uarfcn_list[MAX_EARFCN_LIST]; + uint16_t scramble_list[MAX_EARFCN_LIST]; + } data; + } si_common; + bool early_classmark_allowed; + /* for testing only: Have an infinitely long radio link timeout */ + bool infinite_radio_link_timeout; + + /* do we use static (user-defined) system information messages? (bitmask) */ + uint32_t si_mode_static; + + /* exclude the BTS from the global RF Lock handling */ + int excl_from_rf_lock; + + /* supported codecs beside FR */ + struct bts_codec_conf codec; + + /* BTS dependencies bit field */ + uint32_t depends_on[256/(8*4)]; + + /* full and half rate multirate config */ + struct amr_multirate_conf mr_full; + struct amr_multirate_conf mr_half; + + /* PCU socket state */ + char *pcu_sock_path; + struct pcu_sock_state *pcu_state; + +#endif /* ROLE_BSC */ + void *role; +}; + + +struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); +struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); + +struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); +struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); + +enum gsm_bts_type str2btstype(const char *arg); +const char *btstype2str(enum gsm_bts_type type); + +enum bts_attribute str2btsattr(const char *s); +const char *btsatttr2str(enum bts_attribute v); + +enum gsm_bts_type_variant str2btsvariant(const char *arg); +const char *btsvariant2str(enum gsm_bts_type_variant v); + +extern const struct value_string gsm_chreq_descs[]; +const struct value_string gsm_pchant_names[13]; +const struct value_string gsm_pchant_descs[13]; +const char *gsm_pchan_name(enum gsm_phys_chan_config c); +enum gsm_phys_chan_config gsm_pchan_parse(const char *name); +const char *gsm_lchant_name(enum gsm_chan_t c); +const char *gsm_chreq_name(enum gsm_chreq_reason_t c); +char *gsm_trx_name(const struct gsm_bts_trx *trx); +char *gsm_ts_name(const struct gsm_bts_trx_ts *ts); +char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts); +char *gsm_lchan_name_compute(const struct gsm_lchan *lchan); +const char *gsm_lchans_name(enum gsm_lchan_state s); + +static inline char *gsm_lchan_name(const struct gsm_lchan *lchan) +{ + return lchan->name; +} + +static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat) +{ + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); + return bitvec_set_bit_pos(&bts->features, feat, 1); +} + +static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat) +{ + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); + return bitvec_get_bit_pos(&bts->features, feat); +} + +void gsm_abis_mo_reset(struct gsm_abis_mo *mo); + +struct gsm_abis_mo * +gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); + +struct gsm_nm_state * +gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); +void * +gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); + +/* reset the state of all MO in the BTS */ +void gsm_bts_mo_reset(struct gsm_bts *bts); + +uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, + uint8_t ts_nr, uint8_t lchan_nr); +uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan); +uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, + enum gsm_phys_chan_config as_pchan); + +/* return the gsm_lchan for the CBCH (if it exists at all) */ +struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts); + +/* + * help with parsing regexps + */ +int gsm_parse_reg(void *ctx, regex_t *reg, char **str, + int argc, const char **argv) __attribute__ ((warn_unused_result)); + +static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts) +{ + if (ts->tsc != -1) + return ts->tsc; + else + return ts->trx->bts->bsic & 7; +} + +struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, + int *rc); + +enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts); +uint8_t ts_subslots(struct gsm_bts_trx_ts *ts); +bool ts_is_tch(struct gsm_bts_trx_ts *ts); + +#endif diff --git a/src/common/Makefile.am b/src/common/Makefile.am index d104c48..67f3e80 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c index 706892d..c2d196b 100644 --- a/src/common/gsm_data_shared.c +++ b/src/common/gsm_data_shared.c @@ -1 +1,853 @@ -#include "../../../openbsc/openbsc/src/libcommon/gsm_data_shared.c" +/* (C) 2008-2010 by Harald Welte + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include + +void gsm_abis_mo_reset(struct gsm_abis_mo *mo) +{ + mo->nm_state.operational = NM_OPSTATE_NULL; + mo->nm_state.availability = NM_AVSTATE_POWER_OFF; +} + +static void gsm_mo_init(struct gsm_abis_mo *mo, struct gsm_bts *bts, + uint8_t obj_class, uint8_t p1, uint8_t p2, uint8_t p3) +{ + mo->bts = bts; + mo->obj_class = obj_class; + mo->obj_inst.bts_nr = p1; + mo->obj_inst.trx_nr = p2; + mo->obj_inst.ts_nr = p3; + gsm_abis_mo_reset(mo); +} + +const struct value_string bts_attribute_names[] = { + OSMO_VALUE_STRING(BTS_TYPE_VARIANT), + OSMO_VALUE_STRING(BTS_SUB_MODEL), + OSMO_VALUE_STRING(TRX_PHY_VERSION), + { 0, NULL } +}; + +enum bts_attribute str2btsattr(const char *s) +{ + return get_string_value(bts_attribute_names, s); +} + +const char *btsatttr2str(enum bts_attribute v) +{ + return get_value_string(bts_attribute_names, v); +} + +const struct value_string osmo_bts_variant_names[_NUM_BTS_VARIANT + 1] = { + { BTS_UNKNOWN, "unknown" }, + { BTS_OSMO_LITECELL15, "osmo-bts-lc15" }, + { BTS_OSMO_OCTPHY, "osmo-bts-octphy" }, + { BTS_OSMO_SYSMO, "osmo-bts-sysmo" }, + { BTS_OSMO_TRX, "omso-bts-trx" }, + { 0, NULL } +}; + +enum gsm_bts_type_variant str2btsvariant(const char *arg) +{ + return get_string_value(osmo_bts_variant_names, arg); +} + +const char *btsvariant2str(enum gsm_bts_type_variant v) +{ + return get_value_string(osmo_bts_variant_names, v); +} + +const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE + 1] = { + { GSM_BTS_TYPE_UNKNOWN, "unknown" }, + { GSM_BTS_TYPE_BS11, "bs11" }, + { GSM_BTS_TYPE_NANOBTS, "nanobts" }, + { GSM_BTS_TYPE_RBS2000, "rbs2000" }, + { GSM_BTS_TYPE_NOKIA_SITE, "nokia_site" }, + { GSM_BTS_TYPE_OSMOBTS, "sysmobts" }, + { 0, NULL } +}; + +enum gsm_bts_type str2btstype(const char *arg) +{ + return get_string_value(bts_type_names, arg); +} + +const char *btstype2str(enum gsm_bts_type type) +{ + return get_value_string(bts_type_names, type); +} + +const struct value_string gsm_bts_features_descs[] = { + { BTS_FEAT_HSCSD, "HSCSD" }, + { BTS_FEAT_GPRS, "GPRS" }, + { BTS_FEAT_EGPRS, "EGPRS" }, + { BTS_FEAT_ECSD, "ECSD" }, + { BTS_FEAT_HOPPING, "Frequency Hopping" }, + { BTS_FEAT_MULTI_TSC, "Multi-TSC" }, + { BTS_FEAT_OML_ALERTS, "OML Alerts" }, + { BTS_FEAT_AGCH_PCH_PROP, "AGCH/PCH proportional allocation" }, + { BTS_FEAT_CBCH, "CBCH" }, + { 0, NULL } +}; + +const struct value_string gsm_chreq_descs[] = { + { GSM_CHREQ_REASON_EMERG, "emergency call" }, + { GSM_CHREQ_REASON_PAG, "answer to paging" }, + { GSM_CHREQ_REASON_CALL, "call re-establishment" }, + { GSM_CHREQ_REASON_LOCATION_UPD,"Location updating" }, + { GSM_CHREQ_REASON_PDCH, "one phase packet access" }, + { GSM_CHREQ_REASON_OTHER, "other" }, + { 0, NULL } +}; + +const struct value_string gsm_pchant_names[13] = { + { GSM_PCHAN_NONE, "NONE" }, + { GSM_PCHAN_CCCH, "CCCH" }, + { GSM_PCHAN_CCCH_SDCCH4,"CCCH+SDCCH4" }, + { GSM_PCHAN_TCH_F, "TCH/F" }, + { GSM_PCHAN_TCH_H, "TCH/H" }, + { GSM_PCHAN_SDCCH8_SACCH8C, "SDCCH8" }, + { GSM_PCHAN_PDCH, "PDCH" }, + { GSM_PCHAN_TCH_F_PDCH, "TCH/F_PDCH" }, + { GSM_PCHAN_UNKNOWN, "UNKNOWN" }, + { GSM_PCHAN_CCCH_SDCCH4_CBCH, "CCCH+SDCCH4+CBCH" }, + { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "SDCCH8+CBCH" }, + { GSM_PCHAN_TCH_F_TCH_H_PDCH, "TCH/F_TCH/H_PDCH" }, + { 0, NULL } +}; + +const struct value_string gsm_pchant_descs[13] = { + { GSM_PCHAN_NONE, "Physical Channel not configured" }, + { GSM_PCHAN_CCCH, "FCCH + SCH + BCCH + CCCH (Comb. IV)" }, + { GSM_PCHAN_CCCH_SDCCH4, + "FCCH + SCH + BCCH + CCCH + 4 SDCCH + 2 SACCH (Comb. V)" }, + { GSM_PCHAN_TCH_F, "TCH/F + FACCH/F + SACCH (Comb. I)" }, + { GSM_PCHAN_TCH_H, "2 TCH/H + 2 FACCH/H + 2 SACCH (Comb. II)" }, + { GSM_PCHAN_SDCCH8_SACCH8C, "8 SDCCH + 4 SACCH (Comb. VII)" }, + { GSM_PCHAN_PDCH, "Packet Data Channel for GPRS/EDGE" }, + { GSM_PCHAN_TCH_F_PDCH, "Dynamic TCH/F or GPRS PDCH" }, + { GSM_PCHAN_UNKNOWN, "Unknown / Unsupported channel combination" }, + { GSM_PCHAN_CCCH_SDCCH4_CBCH, "FCCH + SCH + BCCH + CCCH + CBCH + 3 SDCCH + 2 SACCH (Comb. V)" }, + { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "7 SDCCH + 4 SACCH + CBCH (Comb. VII)" }, + { GSM_PCHAN_TCH_F_TCH_H_PDCH, "Dynamic TCH/F or TCH/H or GPRS PDCH" }, + { 0, NULL } +}; + +const char *gsm_pchan_name(enum gsm_phys_chan_config c) +{ + return get_value_string(gsm_pchant_names, c); +} + +enum gsm_phys_chan_config gsm_pchan_parse(const char *name) +{ + return get_string_value(gsm_pchant_names, name); +} + +/* TODO: move to libosmocore, next to gsm_chan_t_names? */ +const char *gsm_lchant_name(enum gsm_chan_t c) +{ + return get_value_string(gsm_chan_t_names, c); +} + +static const struct value_string lchan_s_names[] = { + { LCHAN_S_NONE, "NONE" }, + { LCHAN_S_ACT_REQ, "ACTIVATION REQUESTED" }, + { LCHAN_S_ACTIVE, "ACTIVE" }, + { LCHAN_S_INACTIVE, "INACTIVE" }, + { LCHAN_S_REL_REQ, "RELEASE REQUESTED" }, + { LCHAN_S_REL_ERR, "RELEASE DUE ERROR" }, + { LCHAN_S_BROKEN, "BROKEN UNUSABLE" }, + { 0, NULL } +}; + +const char *gsm_lchans_name(enum gsm_lchan_state s) +{ + return get_value_string(lchan_s_names, s); +} + +static const struct value_string chreq_names[] = { + { GSM_CHREQ_REASON_EMERG, "EMERGENCY" }, + { GSM_CHREQ_REASON_PAG, "PAGING" }, + { GSM_CHREQ_REASON_CALL, "CALL" }, + { GSM_CHREQ_REASON_LOCATION_UPD,"LOCATION_UPDATE" }, + { GSM_CHREQ_REASON_OTHER, "OTHER" }, + { 0, NULL } +}; + +const char *gsm_chreq_name(enum gsm_chreq_reason_t c) +{ + return get_value_string(chreq_names, c); +} + +struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num) +{ + struct gsm_bts *bts; + + if (num >= net->num_bts) + return NULL; + + llist_for_each_entry(bts, &net->bts_list, list) { + if (bts->nr == num) + return bts; + } + + return NULL; +} + +struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx = talloc_zero(bts, struct gsm_bts_trx); + int k; + + if (!trx) + return NULL; + + trx->bts = bts; + trx->nr = bts->num_trx++; + trx->mo.nm_state.administrative = NM_STATE_UNLOCKED; + + gsm_mo_init(&trx->mo, bts, NM_OC_RADIO_CARRIER, + bts->nr, trx->nr, 0xff); + gsm_mo_init(&trx->bb_transc.mo, bts, NM_OC_BASEB_TRANSC, + bts->nr, trx->nr, 0xff); + + for (k = 0; k < TRX_NR_TS; k++) { + struct gsm_bts_trx_ts *ts = &trx->ts[k]; + int l; + + ts->trx = trx; + ts->nr = k; + ts->pchan = GSM_PCHAN_NONE; + ts->dyn.pchan_is = GSM_PCHAN_NONE; + ts->dyn.pchan_want = GSM_PCHAN_NONE; + ts->tsc = -1; + + gsm_mo_init(&ts->mo, bts, NM_OC_CHANNEL, + bts->nr, trx->nr, ts->nr); + + ts->hopping.arfcns.data_len = sizeof(ts->hopping.arfcns_data); + ts->hopping.arfcns.data = ts->hopping.arfcns_data; + ts->hopping.ma.data_len = sizeof(ts->hopping.ma_data); + ts->hopping.ma.data = ts->hopping.ma_data; + + for (l = 0; l < TS_MAX_LCHAN; l++) { + struct gsm_lchan *lchan; + char *name; + lchan = &ts->lchan[l]; + + lchan->ts = ts; + lchan->nr = l; + lchan->type = GSM_LCHAN_NONE; + + name = gsm_lchan_name_compute(lchan); + lchan->name = talloc_strdup(trx, name); +#ifndef ROLE_BSC + INIT_LLIST_HEAD(&lchan->sapi_cmds); +#endif + } + } + + if (trx->nr != 0) + trx->nominal_power = bts->c0->nominal_power; + + llist_add_tail(&trx->list, &bts->trx_list); + + return trx; +} + + +static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 }; +static const uint8_t bts_cell_timer_default[] = + { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }; +static const struct gprs_rlc_cfg rlc_cfg_default = { + .parameter = { + [RLC_T3142] = 20, + [RLC_T3169] = 5, + [RLC_T3191] = 5, + [RLC_T3193] = 160, /* 10ms */ + [RLC_T3195] = 5, + [RLC_N3101] = 10, + [RLC_N3103] = 4, + [RLC_N3105] = 8, + [CV_COUNTDOWN] = 15, + [T_DL_TBF_EXT] = 250 * 10, /* ms */ + [T_UL_TBF_EXT] = 250 * 10, /* ms */ + }, + .paging = { + .repeat_time = 5 * 50, /* ms */ + .repeat_count = 3, + }, + .cs_mask = 0x1fff, + .initial_cs = 2, + .initial_mcs = 6, +}; + +struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) +{ + struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); + int i; + + if (!bts) + return NULL; + + bts->nr = bts_num; + bts->num_trx = 0; + INIT_LLIST_HEAD(&bts->trx_list); + bts->ms_max_power = 15; /* dBm */ + + gsm_mo_init(&bts->mo, bts, NM_OC_BTS, + bts->nr, 0xff, 0xff); + gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER, + 0xff, 0xff, 0xff); + + for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { + bts->gprs.nsvc[i].bts = bts; + bts->gprs.nsvc[i].id = i; + gsm_mo_init(&bts->gprs.nsvc[i].mo, bts, NM_OC_GPRS_NSVC, + bts->nr, i, 0xff); + } + memcpy(&bts->gprs.nse.timer, bts_nse_timer_default, + sizeof(bts->gprs.nse.timer)); + gsm_mo_init(&bts->gprs.nse.mo, bts, NM_OC_GPRS_NSE, + bts->nr, 0xff, 0xff); + memcpy(&bts->gprs.cell.timer, bts_cell_timer_default, + sizeof(bts->gprs.cell.timer)); + gsm_mo_init(&bts->gprs.cell.mo, bts, NM_OC_GPRS_CELL, + bts->nr, 0xff, 0xff); + memcpy(&bts->gprs.cell.rlc_cfg, &rlc_cfg_default, + sizeof(bts->gprs.cell.rlc_cfg)); + + /* create our primary TRX */ + bts->c0 = gsm_bts_trx_alloc(bts); + if (!bts->c0) { + talloc_free(bts); + return NULL; + } + bts->c0->ts[0].pchan = GSM_PCHAN_CCCH_SDCCH4; + + bts->rach_b_thresh = -1; + bts->rach_ldavg_slots = -1; + bts->paging.free_chans_need = -1; + bts->features.data = &bts->_features_data[0]; + bts->features.data_len = sizeof(bts->_features_data); + + /* si handling */ + bts->bcch_change_mark = 1; + + return bts; +} + +/* reset the state of all MO in the BTS */ +void gsm_bts_mo_reset(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx; + unsigned int i; + + gsm_abis_mo_reset(&bts->mo); + gsm_abis_mo_reset(&bts->site_mgr.mo); + for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) + gsm_abis_mo_reset(&bts->gprs.nsvc[i].mo); + gsm_abis_mo_reset(&bts->gprs.nse.mo); + gsm_abis_mo_reset(&bts->gprs.cell.mo); + + llist_for_each_entry(trx, &bts->trx_list, list) { + gsm_abis_mo_reset(&trx->mo); + gsm_abis_mo_reset(&trx->bb_transc.mo); + + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + gsm_abis_mo_reset(&ts->mo); + } + } +} + +struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num) +{ + struct gsm_bts_trx *trx; + + if (num >= bts->num_trx) + return NULL; + + llist_for_each_entry(trx, &bts->trx_list, list) { + if (trx->nr == num) + return trx; + } + + return NULL; +} + +static char ts2str[255]; + +char *gsm_trx_name(const struct gsm_bts_trx *trx) +{ + if (!trx) + snprintf(ts2str, sizeof(ts2str), "(trx=NULL)"); + else + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d)", + trx->bts->nr, trx->nr); + + return ts2str; +} + + +char *gsm_ts_name(const struct gsm_bts_trx_ts *ts) +{ + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d)", + ts->trx->bts->nr, ts->trx->nr, ts->nr); + + return ts2str; +} + +/*! Log timeslot number with full pchan information */ +char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts) +{ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + if (ts->dyn.pchan_is == ts->dyn.pchan_want) + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + gsm_pchan_name(ts->dyn.pchan_is)); + else + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s" + " switching %s -> %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + gsm_pchan_name(ts->dyn.pchan_is), + gsm_pchan_name(ts->dyn.pchan_want)); + break; + case GSM_PCHAN_TCH_F_PDCH: + if ((ts->flags & TS_F_PDCH_PENDING_MASK) == 0) + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" + : "TCH/F"); + else + snprintf(ts2str, sizeof(ts2str), + "(bts=%d,trx=%d,ts=%d,pchan=%s" + " switching %s -> %s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" + : "TCH/F", + (ts->flags & TS_F_PDCH_ACT_PENDING)? "PDCH" + : "TCH/F"); + break; + default: + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,pchan=%s)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan)); + break; + } + + return ts2str; +} + +char *gsm_lchan_name_compute(const struct gsm_lchan *lchan) +{ + struct gsm_bts_trx_ts *ts = lchan->ts; + + snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,ss=%d)", + ts->trx->bts->nr, ts->trx->nr, ts->nr, lchan->nr); + + return ts2str; +} + +/* obtain the MO structure for a given object instance */ +struct gsm_abis_mo * +gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst) +{ + struct gsm_bts_trx *trx; + struct gsm_abis_mo *mo = NULL; + + switch (obj_class) { + case NM_OC_BTS: + mo = &bts->mo; + break; + case NM_OC_RADIO_CARRIER: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->mo; + break; + case NM_OC_BASEB_TRANSC: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->bb_transc.mo; + break; + case NM_OC_CHANNEL: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + if (obj_inst->ts_nr >= TRX_NR_TS) + return NULL; + mo = &trx->ts[obj_inst->ts_nr].mo; + break; + case NM_OC_SITE_MANAGER: + mo = &bts->site_mgr.mo; + break; + case NM_OC_BS11: + switch (obj_inst->bts_nr) { + case BS11_OBJ_CCLK: + mo = &bts->bs11.cclk.mo; + break; + case BS11_OBJ_BBSIG: + if (obj_inst->ts_nr > bts->num_trx) + return NULL; + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->bs11.bbsig.mo; + break; + case BS11_OBJ_PA: + if (obj_inst->ts_nr > bts->num_trx) + return NULL; + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + mo = &trx->bs11.pa.mo; + break; + default: + return NULL; + } + break; + case NM_OC_BS11_RACK: + mo = &bts->bs11.rack.mo; + break; + case NM_OC_BS11_ENVABTSE: + if (obj_inst->trx_nr >= ARRAY_SIZE(bts->bs11.envabtse)) + return NULL; + mo = &bts->bs11.envabtse[obj_inst->trx_nr].mo; + break; + case NM_OC_GPRS_NSE: + mo = &bts->gprs.nse.mo; + break; + case NM_OC_GPRS_CELL: + mo = &bts->gprs.cell.mo; + break; + case NM_OC_GPRS_NSVC: + if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) + return NULL; + mo = &bts->gprs.nsvc[obj_inst->trx_nr].mo; + break; + } + return mo; +} + +/* obtain the gsm_nm_state data structure for a given object instance */ +struct gsm_nm_state * +gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst) +{ + struct gsm_abis_mo *mo; + + mo = gsm_objclass2mo(bts, obj_class, obj_inst); + if (!mo) + return NULL; + + return &mo->nm_state; +} + +/* obtain the in-memory data structure of a given object instance */ +void * +gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst) +{ + struct gsm_bts_trx *trx; + void *obj = NULL; + + switch (obj_class) { + case NM_OC_BTS: + obj = bts; + break; + case NM_OC_RADIO_CARRIER: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + obj = trx; + break; + case NM_OC_BASEB_TRANSC: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + obj = &trx->bb_transc; + break; + case NM_OC_CHANNEL: + if (obj_inst->trx_nr >= bts->num_trx) { + return NULL; + } + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + if (obj_inst->ts_nr >= TRX_NR_TS) + return NULL; + obj = &trx->ts[obj_inst->ts_nr]; + break; + case NM_OC_SITE_MANAGER: + obj = &bts->site_mgr; + break; + case NM_OC_GPRS_NSE: + obj = &bts->gprs.nse; + break; + case NM_OC_GPRS_CELL: + obj = &bts->gprs.cell; + break; + case NM_OC_GPRS_NSVC: + if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) + return NULL; + obj = &bts->gprs.nsvc[obj_inst->trx_nr]; + break; + } + return obj; +} + +/* See Table 10.5.25 of GSM04.08 */ +uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, + uint8_t ts_nr, uint8_t lchan_nr) +{ + uint8_t cbits, chan_nr; + + switch (pchan) { + case GSM_PCHAN_TCH_F: + case GSM_PCHAN_TCH_F_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = 0x01; + break; + case GSM_PCHAN_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = RSL_CHAN_OSMO_PDCH >> 3; + break; + case GSM_PCHAN_TCH_H: + OSMO_ASSERT(lchan_nr < 2); + cbits = 0x02; + cbits += lchan_nr; + break; + case GSM_PCHAN_CCCH_SDCCH4: + case GSM_PCHAN_CCCH_SDCCH4_CBCH: + /* + * As a special hack for BCCH, lchan_nr == 4 may be passed + * here. This should never be sent in an RSL message. + * See osmo-bts-xxx/oml.c:opstart_compl(). + */ + if (lchan_nr == CCCH_LCHAN) + chan_nr = 0; + else + OSMO_ASSERT(lchan_nr < 4); + cbits = 0x04; + cbits += lchan_nr; + break; + case GSM_PCHAN_SDCCH8_SACCH8C: + case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: + OSMO_ASSERT(lchan_nr < 8); + cbits = 0x08; + cbits += lchan_nr; + break; + default: + case GSM_PCHAN_CCCH: +#ifdef ROLE_BSC + OSMO_ASSERT(lchan_nr == 0); +#else + /* + * FIXME: On octphy and litecell, we hit above assertion (see + * Max's comment at https://gerrit.osmocom.org/589 ); disabled + * for BTS until this is clarified; remove the #ifdef when it + * is fixed. + */ +#warning "fix caller that passes lchan_nr != 0" +#endif + cbits = 0x10; + break; + } + + chan_nr = (cbits << 3) | (ts_nr & 0x7); + + return chan_nr; +} + +uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan) +{ + enum gsm_phys_chan_config pchan = lchan->ts->pchan; + if (pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) + return gsm_lchan_as_pchan2chan_nr(lchan, + lchan->ts->dyn.pchan_is); + return gsm_pchan2chan_nr(lchan->ts->pchan, lchan->ts->nr, lchan->nr); +} + +uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, + enum gsm_phys_chan_config as_pchan) +{ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH + && as_pchan == GSM_PCHAN_PDCH) + return RSL_CHAN_OSMO_PDCH | (lchan->ts->nr & ~RSL_CHAN_NR_MASK); + return gsm_pchan2chan_nr(as_pchan, lchan->ts->nr, lchan->nr); +} + +/* return the gsm_lchan for the CBCH (if it exists at all) */ +struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts) +{ + struct gsm_lchan *lchan = NULL; + struct gsm_bts_trx *trx = bts->c0; + + if (trx->ts[0].pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH) + lchan = &trx->ts[0].lchan[2]; + else { + int i; + for (i = 0; i < 8; i++) { + if (trx->ts[i].pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH) { + lchan = &trx->ts[i].lchan[2]; + break; + } + } + } + + return lchan; +} + +/* determine logical channel based on TRX and channel number IE */ +struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, + int *rc) +{ + uint8_t ts_nr = chan_nr & 0x07; + uint8_t cbits = chan_nr >> 3; + uint8_t lch_idx; + struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; + bool ok = true; + + if (rc) + *rc = -EINVAL; + + if (cbits == 0x01) { + lch_idx = 0; /* TCH/F */ + if (ts->pchan != GSM_PCHAN_TCH_F && + ts->pchan != GSM_PCHAN_PDCH && + ts->pchan != GSM_PCHAN_TCH_F_PDCH + && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH + && (ts->dyn.pchan_is == GSM_PCHAN_TCH_F + || ts->dyn.pchan_want == GSM_PCHAN_TCH_F))) + ok = false; + } else if ((cbits & 0x1e) == 0x02) { + lch_idx = cbits & 0x1; /* TCH/H */ + if (ts->pchan != GSM_PCHAN_TCH_H + && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH + && (ts->dyn.pchan_is == GSM_PCHAN_TCH_H + || ts->dyn.pchan_want == GSM_PCHAN_TCH_H))) + ok = false; + } else if ((cbits & 0x1c) == 0x04) { + lch_idx = cbits & 0x3; /* SDCCH/4 */ + if (ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && + ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) + ok = false; + } else if ((cbits & 0x18) == 0x08) { + lch_idx = cbits & 0x7; /* SDCCH/8 */ + if (ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C && + ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C_CBCH) + ok = false; + } else if (cbits == 0x10 || cbits == 0x11 || cbits == 0x12) { + lch_idx = 0; + if (ts->pchan != GSM_PCHAN_CCCH && + ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && + ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) + ok = false; + /* FIXME: we should not return first sdcch4 !!! */ + } else if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH) { + lch_idx = 0; + if (ts->pchan != GSM_PCHAN_TCH_F_TCH_H_PDCH) + ok = false; + } else + return NULL; + + if (rc && ok) + *rc = 0; + + return &ts->lchan[lch_idx]; +} + +static const uint8_t subslots_per_pchan[] = { + [GSM_PCHAN_NONE] = 0, + [GSM_PCHAN_CCCH] = 0, + [GSM_PCHAN_PDCH] = 0, + [GSM_PCHAN_CCCH_SDCCH4] = 4, + [GSM_PCHAN_TCH_F] = 1, + [GSM_PCHAN_TCH_H] = 2, + [GSM_PCHAN_SDCCH8_SACCH8C] = 8, + [GSM_PCHAN_CCCH_SDCCH4_CBCH] = 4, + [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = 8, + /* + * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be + * part of this, those TS are handled according to their dynamic state. + */ +}; + +/*! Return the actual pchan type, also heeding dynamic TS. */ +enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts) +{ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + return ts->dyn.pchan_is; + case GSM_PCHAN_TCH_F_PDCH: + if (ts->flags & TS_F_PDCH_ACTIVE) + return GSM_PCHAN_PDCH; + else + return GSM_PCHAN_TCH_F; + default: + return ts->pchan; + } +} + +/*! According to ts->pchan and possibly ts->dyn_pchan, return the number of + * logical channels available in the timeslot. */ +uint8_t ts_subslots(struct gsm_bts_trx_ts *ts) +{ + return subslots_per_pchan[ts_pchan(ts)]; +} + +static bool pchan_is_tch(enum gsm_phys_chan_config pchan) +{ + switch (pchan) { + case GSM_PCHAN_TCH_F: + case GSM_PCHAN_TCH_H: + return true; + default: + return false; + } +} + +bool ts_is_tch(struct gsm_bts_trx_ts *ts) +{ + return pchan_is_tch(ts_pchan(ts)); +} diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 78a770a..fdb794d 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = subdir-objects -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(LITECELL15_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(LITECELL15_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) $(LIBSYSTEMD_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-octphy/Makefile.am b/src/osmo-bts-octphy/Makefile.am index ac6a83e..9ca9e44 100644 --- a/src/osmo-bts-octphy/Makefile.am +++ b/src/osmo-bts-octphy/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(OCTSDR2G_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OCTSDR2G_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 7b27e70..c48b77c 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-trx/Makefile.am b/src/osmo-bts-trx/Makefile.am index 0a97251..5fe7705 100644 --- a/src/osmo-bts-trx/Makefile.am +++ b/src/osmo-bts-trx/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCODING_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am index d1f05af..6038426 100644 --- a/src/osmo-bts-virtual/Makefile.am +++ b/src/osmo-bts-virtual/Makefile.am @@ -1,5 +1,5 @@ AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -Iinclude +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -Iinclude COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h diff --git a/tests/agch/Makefile.am b/tests/agch/Makefile.am index 46b55e9..1357ea2 100644 --- a/tests/agch/Makefile.am +++ b/tests/agch/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = agch_test diff --git a/tests/cipher/Makefile.am b/tests/cipher/Makefile.am index d76dcd5..a671550 100644 --- a/tests/cipher/Makefile.am +++ b/tests/cipher/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = cipher_test diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 597ab2d..8bff297 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = handover_test diff --git a/tests/meas/Makefile.am b/tests/meas/Makefile.am index 8dd0582..895d474 100644 --- a/tests/meas/Makefile.am +++ b/tests/meas/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = meas_test diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index d5acb18..6575fe8 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) noinst_PROGRAMS = misc_test diff --git a/tests/paging/Makefile.am b/tests/paging/Makefile.am index be9de74..98c6673 100644 --- a/tests/paging/Makefile.am +++ b/tests/paging/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = paging_test diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 2f267f3..654ab5d 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) diff --git a/tests/tx_power/Makefile.am b/tests/tx_power/Makefile.am index 3d4377a..349958c 100644 --- a/tests/tx_power/Makefile.am +++ b/tests/tx_power/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = tx_power_test -- To view, visit https://gerrit.osmocom.org/4161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 9 10:24:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 10:24:57 +0000 Subject: osmo-bts[master]: l1sap: Improve log msg when frame diff >1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4165 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f7b3ffbf7ce3a8d8d6872e4281ef228f4c5527f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 10:29:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 10:29:37 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: logging: document alarms target In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4155 to look at the new patch set (#2). logging: document alarms target Add subsection describing "log alarms" target. Change-Id: I95ce5f3db38616608590e02ee79eb3a7e6e4ea14 Fixes: OS#1913 --- M common/chapters/logging.adoc 1 file changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/55/4155/2 diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index 94fa898..85975bb 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -127,6 +127,23 @@ one only for logging, while the other is used for interacting with the system. Another option would be to use different log target. +==== Logging to the ring buffer + +To avoid having separate VTY session just for logging output while still having immediate access to them, +one can use `alarms` target. It lets you store the log messages inside the ring buffer of a given size which +is available with `show alarms` command. + +It's configured as follows: +---- +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log alarms 98 +OsmoBSC(config-log)# +---- + +In the example above 98 is the desired size of the ring buffer (number of messages). Once it's filled, +the incoming log messages will push out the oldest messages available in the buffer. + ==== Logging to a file As opposed to Logging to the VTY, logging to files is persistent and -- To view, visit https://gerrit.osmocom.org/4155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I95ce5f3db38616608590e02ee79eb3a7e6e4ea14 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 9 11:46:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 11:46:09 +0000 Subject: [PATCH] osmo-bsc[master]: Migrate from OpenSSL to osmo_get_rand_id() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3819 to look at the new patch set (#2). Migrate from OpenSSL to osmo_get_rand_id() This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. Change-Id: Ia57bf1300525cf3c247284fe966b1c415c2d53e2 Related: OS#1694 --- M configure.ac M debian/control M src/osmo-bsc_nat/Makefile.am M src/osmo-bsc_nat/bsc_nat.c M tests/channel/Makefile.am 5 files changed, 7 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/19/3819/2 diff --git a/configure.ac b/configure.ac index 930d1d3..906a5ff 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,6 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? -PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) diff --git a/debian/control b/debian/control index 7b25ecc..f74d892 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,6 @@ libtool, pkg-config, python-minimal, - libssl-dev, libsctp-dev, libtalloc-dev, libasn1c-dev, diff --git a/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am index 1eec7aa..a095a4f 100644 --- a/src/osmo-bsc_nat/Makefile.am +++ b/src/osmo-bsc_nat/Makefile.am @@ -14,7 +14,6 @@ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMONETIF_CFLAGS) \ $(LIBOSMOLEGACYMGCP_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -55,7 +54,6 @@ $(LIBOSMONETIF_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOLEGACYMGCP_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBRARY_GSM) \ -lrt \ $(NULL) diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c index 1548ea3..5569d2f 100644 --- a/src/osmo-bsc_nat/bsc_nat.c +++ b/src/osmo-bsc_nat/bsc_nat.c @@ -74,8 +74,6 @@ #include -#include - #include "../../bscconfig.h" #define SCCP_CLOSE_TIME 20 @@ -208,7 +206,7 @@ 0x01, IPAC_IDTAG_UNITNAME, 0x01, IPAC_IDTAG_SERNR, }; - + int rc; uint8_t *mrand; uint8_t id_req[sizeof(s_id_req) + (2+16)]; uint8_t *buf = &id_req[sizeof(s_id_req)]; @@ -221,19 +219,17 @@ buf = v_put(buf, 0x23); mrand = bsc->last_rand; - if (RAND_bytes(mrand, 16) != 1) - goto failed_random; + rc = osmo_get_rand_id(mrand, 16); + if (rc < 0) { + /* the timeout will trigger and close this connection */ + LOGP(DNAT, LOGL_ERROR, "osmo_get_rand_id() failed: %s\n", strerror(-rc)); + return; + } memcpy(buf, mrand, 16); buf += 16; bsc_send_data(bsc, id_req, sizeof(id_req), IPAC_PROTO_IPACCESS); - return; - -failed_random: - /* the timeout will trigger and close this connection */ - LOGP(DNAT, LOGL_ERROR, "Failed to read from urandom.\n"); - return; } static struct msgb *nat_create_rlsd(struct nat_sccp_connection *conn) diff --git a/tests/channel/Makefile.am b/tests/channel/Makefile.am index 395daf7..12f18f8 100644 --- a/tests/channel/Makefile.am +++ b/tests/channel/Makefile.am @@ -29,5 +29,4 @@ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/3819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia57bf1300525cf3c247284fe966b1c415c2d53e2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 9 12:16:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 12:16:27 +0000 Subject: [PATCH] osmo-sgsn[master]: Migrate from OpenSSL to osmo_get_rand_id() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3821 to look at the new patch set (#3). Migrate from OpenSSL to osmo_get_rand_id() This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. Related: OS#1694 Change-Id: I2b687b7f07ef05bbd861b8479cad5a958a3dde92 --- M configure.ac M debian/control M src/gprs/Makefile.am M src/gprs/gb_proxy.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_sgsn.c M tests/gbproxy/Makefile.am M tests/gbproxy/gbproxy_test.c M tests/sgsn/Makefile.am M tests/sgsn/sgsn_test.c M tests/sndcp_xid/Makefile.am M tests/xid/Makefile.am 13 files changed, 58 insertions(+), 66 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/21/3821/3 diff --git a/configure.ac b/configure.ac index c8e23e5..7921085 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,6 @@ PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? -PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], diff --git a/debian/control b/debian/control index ce2167a..330945f 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,6 @@ automake, libtool, pkg-config, - libssl-dev, libtalloc-dev, libc-ares-dev, libgtp-dev, diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index 654604b..0a88c01 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -15,7 +15,6 @@ $(LIBOSMOGB_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(LIBCARES_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBGTP_CFLAGS) \ $(NULL) if BUILD_IU @@ -63,7 +62,6 @@ $(NULL) osmo_gbproxy_LDADD = \ $(OSMO_LIBS) \ - $(LIBCRYPTO_LIBS) \ -lrt \ $(NULL) @@ -99,7 +97,6 @@ $(OSMO_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index 17a0109..09e291b 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -50,8 +50,6 @@ #include #include -#include - extern void *tall_bsc_ctx; static const struct rate_ctr_desc global_ctr_description[] = { @@ -232,12 +230,13 @@ uint32_t sgsn_ptmsi) { uint32_t bss_ptmsi; - int max_retries = 23; + int max_retries = 23, rc = 0; if (!peer->cfg->patch_ptmsi) { bss_ptmsi = sgsn_ptmsi; } else { do { - if (RAND_bytes((uint8_t *) &bss_ptmsi, sizeof(bss_ptmsi)) != 1) { + rc = osmo_get_rand_id((uint8_t *) &bss_ptmsi, sizeof(bss_ptmsi)); + if (rc < 0) { bss_ptmsi = GSM_RESERVED_TMSI; break; } @@ -250,7 +249,7 @@ } if (bss_ptmsi == GSM_RESERVED_TMSI) - LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a BSS P-TMSI\n"); + LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a BSS P-TMSI: %d (%s)\n", rc, strerror(-rc)); return bss_ptmsi; } @@ -260,7 +259,7 @@ uint32_t bss_tlli) { uint32_t sgsn_tlli; - int max_retries = 23; + int max_retries = 23, rc = 0; if (!peer->cfg->patch_ptmsi) { sgsn_tlli = bss_tlli; } else if (link_info->sgsn_tlli.ptmsi != GSM_RESERVED_TMSI && @@ -274,7 +273,8 @@ } else { do { /* create random TLLI, 0b01111xxx... */ - if (RAND_bytes((uint8_t *) &sgsn_tlli, sizeof(sgsn_tlli)) != 1) { + rc = osmo_get_rand_id((uint8_t *) &sgsn_tlli, sizeof(sgsn_tlli)); + if (rc < 0) { sgsn_tlli = 0; break; } @@ -287,7 +287,7 @@ } if (!sgsn_tlli) - LOGP(DGPRS, LOGL_ERROR, "Failed to allocate an SGSN TLLI\n"); + LOGP(DGPRS, LOGL_ERROR, "Failed to allocate an SGSN TLLI: %d (%s)\n", rc, strerror(-rc)); return sgsn_tlli; } diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 7e109b4..0ebe65a 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -31,8 +31,6 @@ #include #include -#include - #include "bscconfig.h" #include @@ -585,6 +583,7 @@ struct gsm48_hdr *gh; struct gsm48_auth_ciph_req *acreq; uint8_t *m_rand, *m_cksn, rbyte; + int rc; LOGMMCTXP(LOGL_INFO, mm, "<- GPRS AUTH AND CIPHERING REQ (rand = %s", osmo_hexdump(vec->rand, sizeof(vec->rand))); @@ -608,12 +607,13 @@ /* ? 10.5.5.7: */ acreq->force_stby = force_standby; /* 3GPP TS 24.008 ? 10.5.5.19: */ - if (RAND_bytes(&rbyte, 1) != 1) { - LOGP(DMM, LOGL_NOTICE, "RAND_bytes failed for A&C ref, falling " - "back to rand()\n"); - acreq->ac_ref_nr = rand(); - } else - acreq->ac_ref_nr = rbyte; + rc = osmo_get_rand_id(&rbyte, 1); + if (rc < 0) { + LOGP(DMM, LOGL_ERROR, "osmo_get_rand_id() failed for A&C ref: %s\n", strerror(-rc)); + return rc; + } + + acreq->ac_ref_nr = rbyte; mm->ac_ref_nr_used = acreq->ac_ref_nr; /* Only if authentication is requested we need to set RAND + CKSN */ @@ -2078,6 +2078,7 @@ { struct sgsn_mm_ctx *mm = _mm; struct gsm_auth_tuple *at; + int rc; mm->num_T_exp++; @@ -2122,8 +2123,11 @@ } at = &mm->auth_triplet; - gsm48_tx_gmm_auth_ciph_req(mm, &at->vec, at->key_seq, false); - osmo_timer_schedule(&mm->timer, sgsn->cfg.timers.T3360, 0); + rc = gsm48_tx_gmm_auth_ciph_req(mm, &at->vec, at->key_seq, false); + if (rc < 0) + LOGMMCTXP(LOGL_ERROR, mm, "failed sending Auth. & Ciph. Reuqest: %s \n", strerror(-rc)); + else + osmo_timer_schedule(&mm->timer, sgsn->cfg.timers.T3360, 0); break; case 3370: /* waiting for IDENTITY RESPONSE */ if (mm->num_T_exp >= 5) { diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 22743fe..1a7cf3d 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -23,8 +23,6 @@ #include #include -#include - #include #include #include @@ -1065,14 +1063,15 @@ struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_XID"); struct gprs_llc_lle *lle = &llme->lle[1]; uint8_t xid_bytes[1024]; - int xid_bytes_len; + int xid_bytes_len, rc; uint8_t *xid; LOGP(DLLC, LOGL_NOTICE, "LLGM Reset\n"); - if (RAND_bytes((uint8_t *) &llme->iov_ui, 4) != 1) { - LOGP(DLLC, LOGL_NOTICE, "RAND_bytes failed for LLC XID reset, " - "falling back to rand()\n"); - llme->iov_ui = rand(); + + rc = osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4); + if (rc < 0) { + LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset: %s\n", strerror(-rc)); + return rc; } /* Generate XID message */ @@ -1098,14 +1097,15 @@ { struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_XID"); uint8_t xid_bytes[1024]; - int xid_bytes_len; + int xid_bytes_len, rc; uint8_t *xid; LOGP(DLLC, LOGL_NOTICE, "LLGM Reset\n"); - if (RAND_bytes((uint8_t *) &llme->iov_ui, 4) != 1) { - LOGP(DLLC, LOGL_NOTICE, "RAND_bytes failed for LLC XID reset, " - "falling back to rand()\n"); - llme->iov_ui = rand(); + + rc = osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4); + if (rc < 0) { + LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset: %s\n", strerror(-rc)); + return rc; } /* Generate XID message */ diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 4cd3df1..abe4fab 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -46,8 +46,6 @@ #include -#include - #include "../../bscconfig.h" #if BUILD_IU @@ -641,10 +639,11 @@ { struct sgsn_mm_ctx *mm; uint32_t ptmsi = 0xdeadbeef; - int max_retries = 100; + int max_retries = 100, rc = 0; restart: - if (RAND_bytes((uint8_t *) &ptmsi, sizeof(ptmsi)) != 1) + rc = osmo_get_rand_id((uint8_t *) &ptmsi, sizeof(ptmsi)); + if (rc < 0) goto failed; /* Enforce that the 2 MSB are set without loosing the distance between @@ -682,7 +681,7 @@ return ptmsi; failed: - LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a P-TMSI\n"); + LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a P-TMSI: %d (%s)\n", rc, strerror(-rc)); return GSM_RESERVED_TMSI; } diff --git a/tests/gbproxy/Makefile.am b/tests/gbproxy/Makefile.am index 3291839..ef38fb6 100644 --- a/tests/gbproxy/Makefile.am +++ b/tests/gbproxy/Makefile.am @@ -28,7 +28,7 @@ $(NULL) gbproxy_test_LDFLAGS = \ - -Wl,--wrap=RAND_bytes \ + -Wl,--wrap=osmo_get_rand_id \ $(NULL) gbproxy_test_LDADD = \ @@ -46,6 +46,5 @@ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBRARY_DL) \ - $(LIBCRYPTO_LIBS) \ -lrt \ $(NULL) diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c index e8a4ef9..28afb31 100644 --- a/tests/gbproxy/gbproxy_test.c +++ b/tests/gbproxy/gbproxy_test.c @@ -37,8 +37,6 @@ #include #include -#include - #define REMOTE_BSS_ADDR 0x01020304 #define REMOTE_SGSN_ADDR 0x05060708 @@ -55,24 +53,24 @@ struct llist_head *received_messages = NULL; -/* override, requires '-Wl,--wrap=RAND_bytes' */ -int __real_RAND_bytes(unsigned char *buf, int num); -int mock_RAND_bytes(unsigned char *buf, int num); -int (*RAND_bytes_cb)(unsigned char *, int) = - &mock_RAND_bytes; +/* override, requires '-Wl,--wrap=osmo_get_rand_id' */ +int __real_osmo_get_rand_id(uint8_t *data, size_t len); +int mock_osmo_get_rand_id(uint8_t *data, size_t len); +int (*osmo_get_rand_id_cb)(uint8_t *, size_t) = + &mock_osmo_get_rand_id; -int __wrap_RAND_bytes(unsigned char *buf, int num) +int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num) { - return (*RAND_bytes_cb)(buf, num); + return (*osmo_get_rand_id_cb)(buf, num); } static int rand_seq_num = 0; -int mock_RAND_bytes(unsigned char *buf, int num) +int mock_osmo_get_rand_id(uint8_t *buf, size_t num) { uint32_t val; OSMO_ASSERT(num == sizeof(val)); - OSMO_ASSERT(__real_RAND_bytes(buf, num) == 1); + OSMO_ASSERT(__real_osmo_get_rand_id(buf, num) == 1); val = 0x00dead00 + rand_seq_num; diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index 36026dd..802811d 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -32,7 +32,7 @@ $(NULL) sgsn_test_LDFLAGS = \ - -Wl,--wrap=RAND_bytes \ + -Wl,--wrap=osmo_get_rand_id \ -Wl,--wrap=sgsn_update_subscriber_data \ -Wl,--wrap=gprs_subscr_request_update_location \ -Wl,--wrap=gprs_subscr_request_auth_info \ @@ -67,7 +67,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index a486794..219587a 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -100,21 +100,21 @@ return 0; } -/* override, requires '-Wl,--wrap=RAND_bytes' */ -int __real_RAND_bytes(unsigned char *buf, int num); -int mock_RAND_bytes(unsigned char *buf, int num); -int (*RAND_bytes_cb)(unsigned char *, int) = - &mock_RAND_bytes; +/* override, requires '-Wl,--wrap=osmo_get_rand_id' */ +int __real_osmo_get_rand_id(uint8_t *data, size_t len); +int mock_osmo_get_rand_id(uint8_t *data, size_t len); +int (*osmo_get_rand_id_cb)(uint8_t *, size_t) = + &mock_osmo_get_rand_id; -int __wrap_RAND_bytes(unsigned char *buf, int num) +int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num) { - return (*RAND_bytes_cb)(buf, num); + return (*osmo_get_rand_id_cb)(buf, num); } /* make results of A&C ref predictable */ -int mock_RAND_bytes(unsigned char *buf, int num) +int mock_osmo_get_rand_id(uint8_t *buf, size_t num) { if (num > 1) - return __real_RAND_bytes(buf, num); + return __real_osmo_get_rand_id(buf, num); buf[0] = 0; return 1; } diff --git a/tests/sndcp_xid/Makefile.am b/tests/sndcp_xid/Makefile.am index d09c41b..fbcb36c 100644 --- a/tests/sndcp_xid/Makefile.am +++ b/tests/sndcp_xid/Makefile.am @@ -14,7 +14,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt -lm diff --git a/tests/xid/Makefile.am b/tests/xid/Makefile.am index 6c3689f..92876ec 100644 --- a/tests/xid/Makefile.am +++ b/tests/xid/Makefile.am @@ -30,7 +30,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ -- To view, visit https://gerrit.osmocom.org/3821 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2b687b7f07ef05bbd861b8479cad5a958a3dde92 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 9 12:25:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 12:25:14 +0000 Subject: [PATCH] osmo-msc[master]: Migrate from OpenSSL to osmo_get_rand_id() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3820 to look at the new patch set (#2). Migrate from OpenSSL to osmo_get_rand_id() This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. Related: OS#1694 Change-Id: I71cd631704a4dc155c6c752fee2a42cd6e2fa336 --- M configure.ac M debian/control M src/libmsc/Makefile.am M src/libmsc/auth.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libvlr/Makefile.am M src/libvlr/vlr.c M src/osmo-msc/Makefile.am M tests/db/Makefile.am M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sms_queue/Makefile.am 13 files changed, 11 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/3820/2 diff --git a/configure.ac b/configure.ac index 8f468d5..dcca5ee 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,6 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? -PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) # Enable/disable smpp support in the msc? diff --git a/debian/control b/debian/control index ce51a7d..42543d9 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,6 @@ pkg-config, libdbi-dev, libtalloc-dev, - libssl-dev, libc-ares-dev, libgtp-dev, libasn1c-dev, diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index c9b8bb4..3b388dc 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -10,7 +10,6 @@ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(COVERAGE_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ diff --git a/src/libmsc/auth.c b/src/libmsc/auth.c index 7b5367b..7c78c6e 100644 --- a/src/libmsc/auth.c +++ b/src/libmsc/auth.c @@ -28,8 +28,6 @@ #include #include -#include - #include const struct value_string auth_action_names[] = { diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 4e4477b..36f7526 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -42,8 +42,6 @@ #include #include -#include - static char *db_basename = NULL; static char *db_dirname = NULL; static dbi_conn conn; diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 8a5265b..fd2052a 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -31,7 +31,6 @@ #include #include #include -#include #include "bscconfig.h" diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am index 17ad411..c5ab4a6 100644 --- a/src/libvlr/Makefile.am +++ b/src/libvlr/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ - $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) + $(COVERAGE_CFLAGS) noinst_HEADERS = \ vlr_access_req_fsm.h \ diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index adfe258..83c2c51 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -31,8 +31,6 @@ #include #include -#include - #include #include #include @@ -275,12 +273,13 @@ { struct vlr_instance *vlr = vsub->vlr; uint32_t tmsi; - int tried; + int tried, rc; for (tried = 0; tried < 100; tried++) { - if (RAND_bytes((uint8_t *) &tmsi, sizeof(tmsi)) != 1) { - LOGP(DVLR, LOGL_ERROR, "RAND_bytes failed\n"); - return -1; + rc = osmo_get_rand_id((uint8_t *) &tmsi, sizeof(tmsi)); + if (rc < 0) { + LOGP(DDB, LOGL_ERROR, "osmo_get_rand_id() failed: %s\n", strerror(-rc)); + return rc; } /* throw the dice again, if the TSMI doesn't fit */ if (tmsi == GSM_RESERVED_TMSI) diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index 85a5a5a..0e46c75 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -13,7 +13,6 @@ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ @@ -43,7 +42,6 @@ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBSMPP34_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ -ldbi \ diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index bcb66ec..720e005 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -42,6 +42,5 @@ $(LIBOSMOGSM_LIBS) \ $(LIBSMPP34_LIBS) \ $(LIBOSMOVTY_LIBS) \ - $(LIBCRYPTO_LIBS) \ -ldbi \ $(NULL) diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index aa2b3fe..636b311 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -9,7 +9,6 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ @@ -30,7 +29,7 @@ -Wl,--wrap=ranap_iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ - -Wl,--wrap=RAND_bytes \ + -Wl,--wrap=osmo_get_rand_id \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libvlr/libvlr.a \ @@ -38,7 +37,6 @@ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index f9dc278..3ec54d4 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -250,11 +250,11 @@ } unsigned char next_rand_byte = 0; -/* override, requires '-Wl,--wrap=RAND_bytes' */ -int __real_RAND_bytes(unsigned char *buf, int num); -int __wrap_RAND_bytes(unsigned char *buf, int num) +/* override, requires '-Wl,--wrap=osmo_get_rand_id' */ +int __real_osmo_get_rand_id(uint8_t *buf, size_t num); +int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num) { - int i; + size_t i; for (i = 0; i < num; i++) buf[i] = next_rand_byte++; return 1; diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index 1f8ee7b..c19993b 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -8,7 +8,6 @@ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ @@ -38,7 +37,6 @@ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I71cd631704a4dc155c6c752fee2a42cd6e2fa336 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 9 12:36:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 12:36:58 +0000 Subject: [PATCH] libosmocore[master]: Fix build on older systems Message-ID: Review at https://gerrit.osmocom.org/4166 Fix build on older systems Make sure GRND_NONBLOCK is always defined, even when using syscall directly. Change-Id: I1bcac37ee1847596b49122f9307bd2689ba71b1b Related: OS#1694 --- M src/gsm/gsm_utils.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/4166/1 diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index f572c64..e3f792e 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -101,6 +101,9 @@ #include #elif HAVE_DECL_SYS_GETRANDOM #include +#ifndef GRND_NONBLOCK +#define GRND_NONBLOCK 0x0001 +#endif #endif /* ETSI GSM 03.38 6.2.1 and 6.2.1.1 default alphabet -- To view, visit https://gerrit.osmocom.org/4166 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1bcac37ee1847596b49122f9307bd2689ba71b1b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 9 12:59:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 12:59:05 +0000 Subject: [PATCH] osmo-sgsn[master]: Migrate from OpenSSL to osmo_get_rand_id() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3821 to look at the new patch set (#4). Migrate from OpenSSL to osmo_get_rand_id() This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. Related: OS#1694 Change-Id: I2b687b7f07ef05bbd861b8479cad5a958a3dde92 --- M configure.ac M debian/control M src/gprs/Makefile.am M src/gprs/gb_proxy.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_sgsn.c M tests/gbproxy/Makefile.am M tests/gbproxy/gbproxy_test.c M tests/sgsn/Makefile.am M tests/sgsn/sgsn_test.c M tests/sndcp_xid/Makefile.am M tests/xid/Makefile.am 13 files changed, 58 insertions(+), 66 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/21/3821/4 diff --git a/configure.ac b/configure.ac index c8e23e5..7921085 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,6 @@ PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? -PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], diff --git a/debian/control b/debian/control index ce2167a..330945f 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,6 @@ automake, libtool, pkg-config, - libssl-dev, libtalloc-dev, libc-ares-dev, libgtp-dev, diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index 654604b..0a88c01 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -15,7 +15,6 @@ $(LIBOSMOGB_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(LIBCARES_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBGTP_CFLAGS) \ $(NULL) if BUILD_IU @@ -63,7 +62,6 @@ $(NULL) osmo_gbproxy_LDADD = \ $(OSMO_LIBS) \ - $(LIBCRYPTO_LIBS) \ -lrt \ $(NULL) @@ -99,7 +97,6 @@ $(OSMO_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index 17a0109..09e291b 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -50,8 +50,6 @@ #include #include -#include - extern void *tall_bsc_ctx; static const struct rate_ctr_desc global_ctr_description[] = { @@ -232,12 +230,13 @@ uint32_t sgsn_ptmsi) { uint32_t bss_ptmsi; - int max_retries = 23; + int max_retries = 23, rc = 0; if (!peer->cfg->patch_ptmsi) { bss_ptmsi = sgsn_ptmsi; } else { do { - if (RAND_bytes((uint8_t *) &bss_ptmsi, sizeof(bss_ptmsi)) != 1) { + rc = osmo_get_rand_id((uint8_t *) &bss_ptmsi, sizeof(bss_ptmsi)); + if (rc < 0) { bss_ptmsi = GSM_RESERVED_TMSI; break; } @@ -250,7 +249,7 @@ } if (bss_ptmsi == GSM_RESERVED_TMSI) - LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a BSS P-TMSI\n"); + LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a BSS P-TMSI: %d (%s)\n", rc, strerror(-rc)); return bss_ptmsi; } @@ -260,7 +259,7 @@ uint32_t bss_tlli) { uint32_t sgsn_tlli; - int max_retries = 23; + int max_retries = 23, rc = 0; if (!peer->cfg->patch_ptmsi) { sgsn_tlli = bss_tlli; } else if (link_info->sgsn_tlli.ptmsi != GSM_RESERVED_TMSI && @@ -274,7 +273,8 @@ } else { do { /* create random TLLI, 0b01111xxx... */ - if (RAND_bytes((uint8_t *) &sgsn_tlli, sizeof(sgsn_tlli)) != 1) { + rc = osmo_get_rand_id((uint8_t *) &sgsn_tlli, sizeof(sgsn_tlli)); + if (rc < 0) { sgsn_tlli = 0; break; } @@ -287,7 +287,7 @@ } if (!sgsn_tlli) - LOGP(DGPRS, LOGL_ERROR, "Failed to allocate an SGSN TLLI\n"); + LOGP(DGPRS, LOGL_ERROR, "Failed to allocate an SGSN TLLI: %d (%s)\n", rc, strerror(-rc)); return sgsn_tlli; } diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 7e109b4..0ebe65a 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -31,8 +31,6 @@ #include #include -#include - #include "bscconfig.h" #include @@ -585,6 +583,7 @@ struct gsm48_hdr *gh; struct gsm48_auth_ciph_req *acreq; uint8_t *m_rand, *m_cksn, rbyte; + int rc; LOGMMCTXP(LOGL_INFO, mm, "<- GPRS AUTH AND CIPHERING REQ (rand = %s", osmo_hexdump(vec->rand, sizeof(vec->rand))); @@ -608,12 +607,13 @@ /* ? 10.5.5.7: */ acreq->force_stby = force_standby; /* 3GPP TS 24.008 ? 10.5.5.19: */ - if (RAND_bytes(&rbyte, 1) != 1) { - LOGP(DMM, LOGL_NOTICE, "RAND_bytes failed for A&C ref, falling " - "back to rand()\n"); - acreq->ac_ref_nr = rand(); - } else - acreq->ac_ref_nr = rbyte; + rc = osmo_get_rand_id(&rbyte, 1); + if (rc < 0) { + LOGP(DMM, LOGL_ERROR, "osmo_get_rand_id() failed for A&C ref: %s\n", strerror(-rc)); + return rc; + } + + acreq->ac_ref_nr = rbyte; mm->ac_ref_nr_used = acreq->ac_ref_nr; /* Only if authentication is requested we need to set RAND + CKSN */ @@ -2078,6 +2078,7 @@ { struct sgsn_mm_ctx *mm = _mm; struct gsm_auth_tuple *at; + int rc; mm->num_T_exp++; @@ -2122,8 +2123,11 @@ } at = &mm->auth_triplet; - gsm48_tx_gmm_auth_ciph_req(mm, &at->vec, at->key_seq, false); - osmo_timer_schedule(&mm->timer, sgsn->cfg.timers.T3360, 0); + rc = gsm48_tx_gmm_auth_ciph_req(mm, &at->vec, at->key_seq, false); + if (rc < 0) + LOGMMCTXP(LOGL_ERROR, mm, "failed sending Auth. & Ciph. Reuqest: %s \n", strerror(-rc)); + else + osmo_timer_schedule(&mm->timer, sgsn->cfg.timers.T3360, 0); break; case 3370: /* waiting for IDENTITY RESPONSE */ if (mm->num_T_exp >= 5) { diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 22743fe..1a7cf3d 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -23,8 +23,6 @@ #include #include -#include - #include #include #include @@ -1065,14 +1063,15 @@ struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_XID"); struct gprs_llc_lle *lle = &llme->lle[1]; uint8_t xid_bytes[1024]; - int xid_bytes_len; + int xid_bytes_len, rc; uint8_t *xid; LOGP(DLLC, LOGL_NOTICE, "LLGM Reset\n"); - if (RAND_bytes((uint8_t *) &llme->iov_ui, 4) != 1) { - LOGP(DLLC, LOGL_NOTICE, "RAND_bytes failed for LLC XID reset, " - "falling back to rand()\n"); - llme->iov_ui = rand(); + + rc = osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4); + if (rc < 0) { + LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset: %s\n", strerror(-rc)); + return rc; } /* Generate XID message */ @@ -1098,14 +1097,15 @@ { struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_XID"); uint8_t xid_bytes[1024]; - int xid_bytes_len; + int xid_bytes_len, rc; uint8_t *xid; LOGP(DLLC, LOGL_NOTICE, "LLGM Reset\n"); - if (RAND_bytes((uint8_t *) &llme->iov_ui, 4) != 1) { - LOGP(DLLC, LOGL_NOTICE, "RAND_bytes failed for LLC XID reset, " - "falling back to rand()\n"); - llme->iov_ui = rand(); + + rc = osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4); + if (rc < 0) { + LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset: %s\n", strerror(-rc)); + return rc; } /* Generate XID message */ diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 4cd3df1..abe4fab 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -46,8 +46,6 @@ #include -#include - #include "../../bscconfig.h" #if BUILD_IU @@ -641,10 +639,11 @@ { struct sgsn_mm_ctx *mm; uint32_t ptmsi = 0xdeadbeef; - int max_retries = 100; + int max_retries = 100, rc = 0; restart: - if (RAND_bytes((uint8_t *) &ptmsi, sizeof(ptmsi)) != 1) + rc = osmo_get_rand_id((uint8_t *) &ptmsi, sizeof(ptmsi)); + if (rc < 0) goto failed; /* Enforce that the 2 MSB are set without loosing the distance between @@ -682,7 +681,7 @@ return ptmsi; failed: - LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a P-TMSI\n"); + LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a P-TMSI: %d (%s)\n", rc, strerror(-rc)); return GSM_RESERVED_TMSI; } diff --git a/tests/gbproxy/Makefile.am b/tests/gbproxy/Makefile.am index 3291839..ef38fb6 100644 --- a/tests/gbproxy/Makefile.am +++ b/tests/gbproxy/Makefile.am @@ -28,7 +28,7 @@ $(NULL) gbproxy_test_LDFLAGS = \ - -Wl,--wrap=RAND_bytes \ + -Wl,--wrap=osmo_get_rand_id \ $(NULL) gbproxy_test_LDADD = \ @@ -46,6 +46,5 @@ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBRARY_DL) \ - $(LIBCRYPTO_LIBS) \ -lrt \ $(NULL) diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c index e8a4ef9..207139e 100644 --- a/tests/gbproxy/gbproxy_test.c +++ b/tests/gbproxy/gbproxy_test.c @@ -37,8 +37,6 @@ #include #include -#include - #define REMOTE_BSS_ADDR 0x01020304 #define REMOTE_SGSN_ADDR 0x05060708 @@ -55,24 +53,24 @@ struct llist_head *received_messages = NULL; -/* override, requires '-Wl,--wrap=RAND_bytes' */ -int __real_RAND_bytes(unsigned char *buf, int num); -int mock_RAND_bytes(unsigned char *buf, int num); -int (*RAND_bytes_cb)(unsigned char *, int) = - &mock_RAND_bytes; +/* override, requires '-Wl,--wrap=osmo_get_rand_id' */ +int __real_osmo_get_rand_id(uint8_t *data, size_t len); +int mock_osmo_get_rand_id(uint8_t *data, size_t len); +int (*osmo_get_rand_id_cb)(uint8_t *, size_t) = + &mock_osmo_get_rand_id; -int __wrap_RAND_bytes(unsigned char *buf, int num) +int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num) { - return (*RAND_bytes_cb)(buf, num); + return (*osmo_get_rand_id_cb)(buf, num); } static int rand_seq_num = 0; -int mock_RAND_bytes(unsigned char *buf, int num) +int mock_osmo_get_rand_id(uint8_t *buf, size_t num) { uint32_t val; OSMO_ASSERT(num == sizeof(val)); - OSMO_ASSERT(__real_RAND_bytes(buf, num) == 1); + OSMO_ASSERT(__real_osmo_get_rand_id(buf, num) == 0); val = 0x00dead00 + rand_seq_num; diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index 36026dd..802811d 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -32,7 +32,7 @@ $(NULL) sgsn_test_LDFLAGS = \ - -Wl,--wrap=RAND_bytes \ + -Wl,--wrap=osmo_get_rand_id \ -Wl,--wrap=sgsn_update_subscriber_data \ -Wl,--wrap=gprs_subscr_request_update_location \ -Wl,--wrap=gprs_subscr_request_auth_info \ @@ -67,7 +67,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index a486794..219587a 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -100,21 +100,21 @@ return 0; } -/* override, requires '-Wl,--wrap=RAND_bytes' */ -int __real_RAND_bytes(unsigned char *buf, int num); -int mock_RAND_bytes(unsigned char *buf, int num); -int (*RAND_bytes_cb)(unsigned char *, int) = - &mock_RAND_bytes; +/* override, requires '-Wl,--wrap=osmo_get_rand_id' */ +int __real_osmo_get_rand_id(uint8_t *data, size_t len); +int mock_osmo_get_rand_id(uint8_t *data, size_t len); +int (*osmo_get_rand_id_cb)(uint8_t *, size_t) = + &mock_osmo_get_rand_id; -int __wrap_RAND_bytes(unsigned char *buf, int num) +int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num) { - return (*RAND_bytes_cb)(buf, num); + return (*osmo_get_rand_id_cb)(buf, num); } /* make results of A&C ref predictable */ -int mock_RAND_bytes(unsigned char *buf, int num) +int mock_osmo_get_rand_id(uint8_t *buf, size_t num) { if (num > 1) - return __real_RAND_bytes(buf, num); + return __real_osmo_get_rand_id(buf, num); buf[0] = 0; return 1; } diff --git a/tests/sndcp_xid/Makefile.am b/tests/sndcp_xid/Makefile.am index d09c41b..fbcb36c 100644 --- a/tests/sndcp_xid/Makefile.am +++ b/tests/sndcp_xid/Makefile.am @@ -14,7 +14,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt -lm diff --git a/tests/xid/Makefile.am b/tests/xid/Makefile.am index 6c3689f..92876ec 100644 --- a/tests/xid/Makefile.am +++ b/tests/xid/Makefile.am @@ -30,7 +30,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ -- To view, visit https://gerrit.osmocom.org/3821 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2b687b7f07ef05bbd861b8479cad5a958a3dde92 Gerrit-PatchSet: 4 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 9 13:35:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 13:35:06 +0000 Subject: [PATCH] osmo-bsc[master]: SI2q: fix generation for multiple UARFCNs In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4160 to look at the new patch set (#2). SI2q: fix generation for multiple UARFCNs * fix insert routine to keep the list sorted by UARFCN * fix rest octets generator to properly account for offset * adjust test results accordingly Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794 Related: OS#2357 --- M src/libbsc/rest_octets.c M src/libbsc/system_information.c M tests/gsm0408/gsm0408_test.ok 3 files changed, 25 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/60/4160/2 diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index b1516ec..a22b8e6 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -303,7 +303,7 @@ static inline void append_uarfcns(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) { const uint16_t *u = bts->si_common.data.uarfcn_list; - int i, rem = budget - 7, st = 0; /* account for constant bits right away */ + int i, rem = budget - 7, st = bts->u_offset; /* account for constant bits right away */ uint16_t cu = u[bts->u_offset]; /* caller ensures that length is positive */ OSMO_ASSERT(budget <= SI2Q_MAX_LEN); diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index 761e848..91e993d 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -280,7 +280,7 @@ int bts_uarfcn_add(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble, bool diversity) { - size_t len = bts->si_common.uarfcn_length, i, k = 0; + size_t len = bts->si_common.uarfcn_length, i; uint8_t si2q; int pos = uarfcn_sc_pos(bts, arfcn, scramble); uint16_t scr = diversity ? encode_fdd(scramble, true) : encode_fdd(scramble, false), @@ -297,20 +297,17 @@ pos = uarfcn_sc_pos(bts, arfcn, SC_BOUND); i = (pos < 0) ? len : pos; - for (k = 0; i < len; i++) - if (scr > scl[i]) - k = i + 1; - - /* we keep lists sorted by scramble code of a given UARFCN: - insert into appropriate position and move the tail */ - if (len - k) { - memmove(ual + k + 1, ual + k, (len - k) * 2); - memmove(scl + k + 1, scl + k, (len - k) * 2); + /* move the tail to make space for inserting if necessary */ + if (i < len) { + memmove(ual + i + 1, ual + i, (len - i) * 2); + memmove(scl + i + 1, scl + i, (len - i) * 2); } - ual[k] = arfcn; - scl[k] = scr; + /* insert into appropriate position */ + ual[i] = arfcn; + scl[i] = scr; bts->si_common.uarfcn_length++; + /* try to generate SI2q */ si2q = si2q_num(bts); if (si2q <= SI2Q_MAX_NUM) { @@ -318,6 +315,7 @@ return 0; } + /* rollback after unsuccessful generation */ bts_uarfcn_del(bts, arfcn, scramble); return -ENOSPC; } diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index d23cebb..d200539 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -62,9 +62,9 @@ generating SI2quater for 0 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7f 52 e8 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7f 52 e8 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b Testing SYSINFO_TYPE_2quater EARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... generated invalid SI2quater [00/00]: [23] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -96,17 +96,17 @@ generating SI2quater for 0 EARFCNs and 2 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 14 1a 1f 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 18 58 12 f0 83 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 1c 7b d0 f7 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 20 58 2e f0 f2 03 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 24 b3 e4 e9 68 03 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 28 58 2e 22 f2 4e 83 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 2c 7a 34 0e 4e e9 83 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 34 1a 64 26 5d f2 05 03 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 34 7a 34 0e 4e e9 85 03 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 38 58 12 22 fd ce 8e 05 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 3c 70 39 02 ce f7 85 0e 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 40 58 1d 22 fa ce 88 85 7b 0b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 44 7a 34 05 e4 72 05 08 d5 0b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 9 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 4c 7a 34 0e 64 77 85 43 55 c8 0b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 10 UARFCNs... @@ -117,19 +117,17 @@ generating SI2quater for 0 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 12 7e e0 a9 44 05 3e 0b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 12 7e e0 0b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 ea 08 81 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 54 ba 82 20 03 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 08 81 52 e8 10 3f f4 a9 75 04 a4 0b 2b 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 28 81 df 7f fa 32 d4 a2 02 9f 03 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 54 ba 84 52 67 03 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 10 81 ce a9 74 08 1f fa 54 ba 82 52 03 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 30 81 d3 7f fd b2 86 54 a2 02 9f 03 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 54 ba 86 20 73 8c 81 Testing SYSINFO_TYPE_2quater combined EARFCN & UARFCN generation: generating SI2quater for 17 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 0c 1a 10 99 66 0f 04 83 c1 1c bb 2b 03 2b 2b -- To view, visit https://gerrit.osmocom.org/4160 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 9 13:51:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 13:51:26 +0000 Subject: [PATCH] osmo-sgsn[master]: Migrate from OpenSSL to osmo_get_rand_id() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3821 to look at the new patch set (#5). Migrate from OpenSSL to osmo_get_rand_id() This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. Related: OS#1694 Change-Id: I2b687b7f07ef05bbd861b8479cad5a958a3dde92 --- M configure.ac M debian/control M src/gprs/Makefile.am M src/gprs/gb_proxy.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_sgsn.c M tests/gbproxy/Makefile.am M tests/gbproxy/gbproxy_test.c M tests/sgsn/Makefile.am M tests/sgsn/sgsn_test.c M tests/sndcp_xid/Makefile.am M tests/xid/Makefile.am 13 files changed, 57 insertions(+), 66 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/21/3821/5 diff --git a/configure.ac b/configure.ac index c8e23e5..7921085 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,6 @@ PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? -PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], diff --git a/debian/control b/debian/control index ce2167a..330945f 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,6 @@ automake, libtool, pkg-config, - libssl-dev, libtalloc-dev, libc-ares-dev, libgtp-dev, diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index 654604b..0a88c01 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -15,7 +15,6 @@ $(LIBOSMOGB_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(LIBCARES_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBGTP_CFLAGS) \ $(NULL) if BUILD_IU @@ -63,7 +62,6 @@ $(NULL) osmo_gbproxy_LDADD = \ $(OSMO_LIBS) \ - $(LIBCRYPTO_LIBS) \ -lrt \ $(NULL) @@ -99,7 +97,6 @@ $(OSMO_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index 17a0109..09e291b 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -50,8 +50,6 @@ #include #include -#include - extern void *tall_bsc_ctx; static const struct rate_ctr_desc global_ctr_description[] = { @@ -232,12 +230,13 @@ uint32_t sgsn_ptmsi) { uint32_t bss_ptmsi; - int max_retries = 23; + int max_retries = 23, rc = 0; if (!peer->cfg->patch_ptmsi) { bss_ptmsi = sgsn_ptmsi; } else { do { - if (RAND_bytes((uint8_t *) &bss_ptmsi, sizeof(bss_ptmsi)) != 1) { + rc = osmo_get_rand_id((uint8_t *) &bss_ptmsi, sizeof(bss_ptmsi)); + if (rc < 0) { bss_ptmsi = GSM_RESERVED_TMSI; break; } @@ -250,7 +249,7 @@ } if (bss_ptmsi == GSM_RESERVED_TMSI) - LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a BSS P-TMSI\n"); + LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a BSS P-TMSI: %d (%s)\n", rc, strerror(-rc)); return bss_ptmsi; } @@ -260,7 +259,7 @@ uint32_t bss_tlli) { uint32_t sgsn_tlli; - int max_retries = 23; + int max_retries = 23, rc = 0; if (!peer->cfg->patch_ptmsi) { sgsn_tlli = bss_tlli; } else if (link_info->sgsn_tlli.ptmsi != GSM_RESERVED_TMSI && @@ -274,7 +273,8 @@ } else { do { /* create random TLLI, 0b01111xxx... */ - if (RAND_bytes((uint8_t *) &sgsn_tlli, sizeof(sgsn_tlli)) != 1) { + rc = osmo_get_rand_id((uint8_t *) &sgsn_tlli, sizeof(sgsn_tlli)); + if (rc < 0) { sgsn_tlli = 0; break; } @@ -287,7 +287,7 @@ } if (!sgsn_tlli) - LOGP(DGPRS, LOGL_ERROR, "Failed to allocate an SGSN TLLI\n"); + LOGP(DGPRS, LOGL_ERROR, "Failed to allocate an SGSN TLLI: %d (%s)\n", rc, strerror(-rc)); return sgsn_tlli; } diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 7e109b4..0ebe65a 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -31,8 +31,6 @@ #include #include -#include - #include "bscconfig.h" #include @@ -585,6 +583,7 @@ struct gsm48_hdr *gh; struct gsm48_auth_ciph_req *acreq; uint8_t *m_rand, *m_cksn, rbyte; + int rc; LOGMMCTXP(LOGL_INFO, mm, "<- GPRS AUTH AND CIPHERING REQ (rand = %s", osmo_hexdump(vec->rand, sizeof(vec->rand))); @@ -608,12 +607,13 @@ /* ? 10.5.5.7: */ acreq->force_stby = force_standby; /* 3GPP TS 24.008 ? 10.5.5.19: */ - if (RAND_bytes(&rbyte, 1) != 1) { - LOGP(DMM, LOGL_NOTICE, "RAND_bytes failed for A&C ref, falling " - "back to rand()\n"); - acreq->ac_ref_nr = rand(); - } else - acreq->ac_ref_nr = rbyte; + rc = osmo_get_rand_id(&rbyte, 1); + if (rc < 0) { + LOGP(DMM, LOGL_ERROR, "osmo_get_rand_id() failed for A&C ref: %s\n", strerror(-rc)); + return rc; + } + + acreq->ac_ref_nr = rbyte; mm->ac_ref_nr_used = acreq->ac_ref_nr; /* Only if authentication is requested we need to set RAND + CKSN */ @@ -2078,6 +2078,7 @@ { struct sgsn_mm_ctx *mm = _mm; struct gsm_auth_tuple *at; + int rc; mm->num_T_exp++; @@ -2122,8 +2123,11 @@ } at = &mm->auth_triplet; - gsm48_tx_gmm_auth_ciph_req(mm, &at->vec, at->key_seq, false); - osmo_timer_schedule(&mm->timer, sgsn->cfg.timers.T3360, 0); + rc = gsm48_tx_gmm_auth_ciph_req(mm, &at->vec, at->key_seq, false); + if (rc < 0) + LOGMMCTXP(LOGL_ERROR, mm, "failed sending Auth. & Ciph. Reuqest: %s \n", strerror(-rc)); + else + osmo_timer_schedule(&mm->timer, sgsn->cfg.timers.T3360, 0); break; case 3370: /* waiting for IDENTITY RESPONSE */ if (mm->num_T_exp >= 5) { diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 22743fe..1a7cf3d 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -23,8 +23,6 @@ #include #include -#include - #include #include #include @@ -1065,14 +1063,15 @@ struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_XID"); struct gprs_llc_lle *lle = &llme->lle[1]; uint8_t xid_bytes[1024]; - int xid_bytes_len; + int xid_bytes_len, rc; uint8_t *xid; LOGP(DLLC, LOGL_NOTICE, "LLGM Reset\n"); - if (RAND_bytes((uint8_t *) &llme->iov_ui, 4) != 1) { - LOGP(DLLC, LOGL_NOTICE, "RAND_bytes failed for LLC XID reset, " - "falling back to rand()\n"); - llme->iov_ui = rand(); + + rc = osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4); + if (rc < 0) { + LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset: %s\n", strerror(-rc)); + return rc; } /* Generate XID message */ @@ -1098,14 +1097,15 @@ { struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_XID"); uint8_t xid_bytes[1024]; - int xid_bytes_len; + int xid_bytes_len, rc; uint8_t *xid; LOGP(DLLC, LOGL_NOTICE, "LLGM Reset\n"); - if (RAND_bytes((uint8_t *) &llme->iov_ui, 4) != 1) { - LOGP(DLLC, LOGL_NOTICE, "RAND_bytes failed for LLC XID reset, " - "falling back to rand()\n"); - llme->iov_ui = rand(); + + rc = osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4); + if (rc < 0) { + LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset: %s\n", strerror(-rc)); + return rc; } /* Generate XID message */ diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 4cd3df1..abe4fab 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -46,8 +46,6 @@ #include -#include - #include "../../bscconfig.h" #if BUILD_IU @@ -641,10 +639,11 @@ { struct sgsn_mm_ctx *mm; uint32_t ptmsi = 0xdeadbeef; - int max_retries = 100; + int max_retries = 100, rc = 0; restart: - if (RAND_bytes((uint8_t *) &ptmsi, sizeof(ptmsi)) != 1) + rc = osmo_get_rand_id((uint8_t *) &ptmsi, sizeof(ptmsi)); + if (rc < 0) goto failed; /* Enforce that the 2 MSB are set without loosing the distance between @@ -682,7 +681,7 @@ return ptmsi; failed: - LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a P-TMSI\n"); + LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a P-TMSI: %d (%s)\n", rc, strerror(-rc)); return GSM_RESERVED_TMSI; } diff --git a/tests/gbproxy/Makefile.am b/tests/gbproxy/Makefile.am index 3291839..ef38fb6 100644 --- a/tests/gbproxy/Makefile.am +++ b/tests/gbproxy/Makefile.am @@ -28,7 +28,7 @@ $(NULL) gbproxy_test_LDFLAGS = \ - -Wl,--wrap=RAND_bytes \ + -Wl,--wrap=osmo_get_rand_id \ $(NULL) gbproxy_test_LDADD = \ @@ -46,6 +46,5 @@ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBRARY_DL) \ - $(LIBCRYPTO_LIBS) \ -lrt \ $(NULL) diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c index e8a4ef9..3ebdccb 100644 --- a/tests/gbproxy/gbproxy_test.c +++ b/tests/gbproxy/gbproxy_test.c @@ -37,8 +37,6 @@ #include #include -#include - #define REMOTE_BSS_ADDR 0x01020304 #define REMOTE_SGSN_ADDR 0x05060708 @@ -55,24 +53,23 @@ struct llist_head *received_messages = NULL; -/* override, requires '-Wl,--wrap=RAND_bytes' */ -int __real_RAND_bytes(unsigned char *buf, int num); -int mock_RAND_bytes(unsigned char *buf, int num); -int (*RAND_bytes_cb)(unsigned char *, int) = - &mock_RAND_bytes; +/* override, requires '-Wl,--wrap=osmo_get_rand_id' */ +int __real_osmo_get_rand_id(uint8_t *data, size_t len); +int mock_osmo_get_rand_id(uint8_t *data, size_t len); +int (*osmo_get_rand_id_cb)(uint8_t *, size_t) = + &mock_osmo_get_rand_id; -int __wrap_RAND_bytes(unsigned char *buf, int num) +int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num) { - return (*RAND_bytes_cb)(buf, num); + return (*osmo_get_rand_id_cb)(buf, num); } static int rand_seq_num = 0; -int mock_RAND_bytes(unsigned char *buf, int num) +int mock_osmo_get_rand_id(uint8_t *buf, size_t num) { uint32_t val; OSMO_ASSERT(num == sizeof(val)); - OSMO_ASSERT(__real_RAND_bytes(buf, num) == 1); val = 0x00dead00 + rand_seq_num; diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index 36026dd..802811d 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -32,7 +32,7 @@ $(NULL) sgsn_test_LDFLAGS = \ - -Wl,--wrap=RAND_bytes \ + -Wl,--wrap=osmo_get_rand_id \ -Wl,--wrap=sgsn_update_subscriber_data \ -Wl,--wrap=gprs_subscr_request_update_location \ -Wl,--wrap=gprs_subscr_request_auth_info \ @@ -67,7 +67,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index a486794..219587a 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -100,21 +100,21 @@ return 0; } -/* override, requires '-Wl,--wrap=RAND_bytes' */ -int __real_RAND_bytes(unsigned char *buf, int num); -int mock_RAND_bytes(unsigned char *buf, int num); -int (*RAND_bytes_cb)(unsigned char *, int) = - &mock_RAND_bytes; +/* override, requires '-Wl,--wrap=osmo_get_rand_id' */ +int __real_osmo_get_rand_id(uint8_t *data, size_t len); +int mock_osmo_get_rand_id(uint8_t *data, size_t len); +int (*osmo_get_rand_id_cb)(uint8_t *, size_t) = + &mock_osmo_get_rand_id; -int __wrap_RAND_bytes(unsigned char *buf, int num) +int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num) { - return (*RAND_bytes_cb)(buf, num); + return (*osmo_get_rand_id_cb)(buf, num); } /* make results of A&C ref predictable */ -int mock_RAND_bytes(unsigned char *buf, int num) +int mock_osmo_get_rand_id(uint8_t *buf, size_t num) { if (num > 1) - return __real_RAND_bytes(buf, num); + return __real_osmo_get_rand_id(buf, num); buf[0] = 0; return 1; } diff --git a/tests/sndcp_xid/Makefile.am b/tests/sndcp_xid/Makefile.am index d09c41b..fbcb36c 100644 --- a/tests/sndcp_xid/Makefile.am +++ b/tests/sndcp_xid/Makefile.am @@ -14,7 +14,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt -lm diff --git a/tests/xid/Makefile.am b/tests/xid/Makefile.am index 6c3689f..92876ec 100644 --- a/tests/xid/Makefile.am +++ b/tests/xid/Makefile.am @@ -30,7 +30,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ -- To view, visit https://gerrit.osmocom.org/3821 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2b687b7f07ef05bbd861b8479cad5a958a3dde92 Gerrit-PatchSet: 5 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 9 14:28:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 14:28:17 +0000 Subject: [PATCH] osmo-sgsn[master]: Move P-TMSI alloc/update into separate function Message-ID: Review at https://gerrit.osmocom.org/4167 Move P-TMSI alloc/update into separate function Remove code duplication by allocating and assigning P-TMSI in a static function. Change-Id: Ie5466326a851867d55da389bf18b240acd3f0fc5 --- M src/gprs/gprs_gmm.c 1 file changed, 16 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/67/4167/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 7e109b4..dff84a9 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1235,6 +1235,19 @@ return gsm48_gmm_authorize(ctx); } +/* Allocate a new P-TMSI and change context state */ +static inline void ptmsi_update(struct sgsn_mm_ctx *ctx) +{ + uint32_t ptmsi; + /* Don't change the P-TMSI if a P-TMSI re-assignment is under way */ + if (ctx->gmm_state != GMM_COMMON_PROC_INIT) { + ptmsi = sgsn_alloc_ptmsi(); + ctx->p_tmsi_old = ctx->p_tmsi; + ctx->p_tmsi = ptmsi; + } + ctx->gmm_state = GMM_COMMON_PROC_INIT; +} + /* Section 9.4.1 Attach request */ static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg, struct gprs_llc_llme *llme) @@ -1391,12 +1404,7 @@ } #ifdef PTMSI_ALLOC /* Allocate a new P-TMSI (+ P-TMSI signature) and update TLLI */ - /* Don't change the P-TMSI if a P-TMSI re-assignment is under way */ - if (ctx->gmm_state != GMM_COMMON_PROC_INIT) { - ctx->p_tmsi_old = ctx->p_tmsi; - ctx->p_tmsi = sgsn_alloc_ptmsi(); - } - ctx->gmm_state = GMM_COMMON_PROC_INIT; + ptmsi_update(ctx); #endif if (ctx->ran_type == MM_CTX_T_GERAN_Gb) { @@ -1711,16 +1719,11 @@ rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_RA_UPDATE]); #ifdef PTMSI_ALLOC - /* Don't change the P-TMSI if a P-TMSI re-assignment is under way */ - if (mmctx->gmm_state != GMM_COMMON_PROC_INIT) { - mmctx->p_tmsi_old = mmctx->p_tmsi; - mmctx->p_tmsi = sgsn_alloc_ptmsi(); - } + ptmsi_update(mmctx); + /* Start T3350 and re-transmit up to 5 times until ATTACH COMPLETE */ mmctx->t3350_mode = GMM_T3350_MODE_RAU; mmctx_timer_start(mmctx, 3350, sgsn->cfg.timers.T3350); - - mmctx->gmm_state = GMM_COMMON_PROC_INIT; #else /* Make sure we are NORMAL (i.e. not SUSPENDED anymore) */ mmctx->gmm_state = GMM_REGISTERED_NORMAL; -- To view, visit https://gerrit.osmocom.org/4167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie5466326a851867d55da389bf18b240acd3f0fc5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 9 14:28:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 14:28:17 +0000 Subject: [PATCH] osmo-sgsn[master]: Check for correct P-TMSI allocation Message-ID: Review at https://gerrit.osmocom.org/4168 Check for correct P-TMSI allocation Do not assign new P-TMSI if allocation failed. Change-Id: Ifa71bbc8df726c74aceaf9ae3eb49e124a53910a --- M src/gprs/gprs_gmm.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/68/4168/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index dff84a9..d11ecce 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1242,8 +1242,11 @@ /* Don't change the P-TMSI if a P-TMSI re-assignment is under way */ if (ctx->gmm_state != GMM_COMMON_PROC_INIT) { ptmsi = sgsn_alloc_ptmsi(); - ctx->p_tmsi_old = ctx->p_tmsi; - ctx->p_tmsi = ptmsi; + if (ptmsi != GSM_RESERVED_TMSI) { + ctx->p_tmsi_old = ctx->p_tmsi; + ctx->p_tmsi = ptmsi; + } else + LOGMMCTXP(LOGL_ERROR, ctx, "P-TMSI allocation failure: using old one.\n"); } ctx->gmm_state = GMM_COMMON_PROC_INIT; } -- To view, visit https://gerrit.osmocom.org/4168 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa71bbc8df726c74aceaf9ae3eb49e124a53910a Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 9 14:29:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 14:29:31 +0000 Subject: osmo-sgsn[master]: Check for correct P-TMSI allocation In-Reply-To: References: Message-ID: Patch Set 1: I'm actually not sure: shall we do anything else if P-TMSI allocation failed, or we can simply skip it and continue with the old one? -- To view, visit https://gerrit.osmocom.org/4168 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa71bbc8df726c74aceaf9ae3eb49e124a53910a Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 14:31:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Oct 2017 14:31:03 +0000 Subject: [MERGED] libosmocore[master]: utils: add osmo_is_hexstr(), add unit test In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: utils: add osmo_is_hexstr(), add unit test ...................................................................... utils: add osmo_is_hexstr(), add unit test Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a --- M include/osmocom/core/utils.h M src/utils.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 4 files changed, 132 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 855e653..5f41213 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include @@ -89,4 +91,7 @@ size_t osmo_strlcpy(char *dst, const char *src, size_t siz); +bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, + bool require_even); + /*! @} */ diff --git a/src/utils.c b/src/utils.c index 1c176f8..b4345c7 100644 --- a/src/utils.c +++ b/src/utils.c @@ -375,4 +375,37 @@ return ret; } +/*! Validate that a given string is a hex string within given size limits. + * Note that each hex digit amounts to a nibble, so if checking for a hex + * string to result in N bytes, pass amount of digits as 2*N. + * \param str A nul-terminated string to validate, or NULL. + * \param min_digits least permitted amount of digits. + * \param max_digits most permitted amount of digits. + * \param require_even if true, require an even amount of digits. + * \returns true when the hex_str contains only hexadecimal digits (no + * whitespace) and matches the requested length; also true + * when min_digits <= 0 and str is NULL. + */ +bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, + bool require_even) +{ + int len; + /* Use unsigned char * to avoid a compiler warning of + * "error: array subscript has type 'char' [-Werror=char-subscripts]" */ + const unsigned char *pos = (const unsigned char*)str; + if (!pos) + return min_digits < 1; + for (len = 0; *pos && len < max_digits; len++, pos++) + if (!isxdigit(*pos)) + return false; + if (len < min_digits) + return false; + /* With not too many digits, we should have reached *str == nul */ + if (*pos) + return false; + if (require_even && (len & 1)) + return false; + return true; +} + /*! @} */ diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index cad162d..4a4b121 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -219,6 +219,68 @@ OSMO_ASSERT(!TLVP_PRESENT(&tvp, 0x25)); } +static struct { + const char *str; + int min_digits; + int max_digits; + bool require_even; + bool expect_ok; +} test_hexstrs[] = { + { NULL, 0, 10, false, true }, + { NULL, 1, 10, false, false }, + { "", 0, 10, false, true }, + { "", 1, 10, false, false }, + { " ", 0, 10, false, false }, + { "1", 0, 10, false, true }, + { "1", 1, 10, false, true }, + { "1", 1, 10, true, false }, + { "1", 2, 10, false, false }, + { "123", 1, 10, false, true }, + { "123", 1, 10, true, false }, + { "123", 4, 10, false, false }, + { "1234", 4, 10, true, true }, + { "12345", 4, 10, true, false }, + { "123456", 4, 10, true, true }, + { "1234567", 4, 10, true, false }, + { "12345678", 4, 10, true, true }, + { "123456789", 4, 10, true, false }, + { "123456789a", 4, 10, true, true }, + { "123456789ab", 4, 10, true, false }, + { "123456789abc", 4, 10, true, false }, + { "123456789ab", 4, 10, false, false }, + { "123456789abc", 4, 10, false, false }, + { "0123456789abcdefABCDEF", 0, 100, false, true }, + { "0123456789 abcdef ABCDEF", 0, 100, false, false }, + { "foobar", 0, 100, false, false }, + { "BeadedBeeAced1EbbedDefacedFacade", 32, 32, true, true }, + { "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 32, 32, false, true }, + { "DeafBeddedBabeAcceededFadedDecaff", 32, 32, false, false }, +}; + +bool test_is_hexstr() +{ + int i; + bool pass = true; + bool ok = true; + printf("\n----- %s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(test_hexstrs); i++) { + ok = osmo_is_hexstr(test_hexstrs[i].str, + test_hexstrs[i].min_digits, + test_hexstrs[i].max_digits, + test_hexstrs[i].require_even); + pass = pass && (ok == test_hexstrs[i].expect_ok); + printf("%2d: %s str='%s' min=%d max=%d even=%d expect=%s\n", + i, test_hexstrs[i].expect_ok == ok ? "pass" : "FAIL", + test_hexstrs[i].str, + test_hexstrs[i].min_digits, + test_hexstrs[i].max_digits, + test_hexstrs[i].require_even, + test_hexstrs[i].expect_ok ? "valid" : "invalid"); + } + return pass; +} + int main(int argc, char **argv) { static const struct log_info log_info = {}; @@ -227,5 +289,6 @@ hexdump_test(); hexparse_test(); test_idtag_parsing(); + test_is_hexstr(); return 0; } diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index e9be018..45156f7 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -26,3 +26,34 @@ rc = -1 Hexparse with invalid char rc = -1 + +----- test_is_hexstr + 0: pass str='(null)' min=0 max=10 even=0 expect=valid + 1: pass str='(null)' min=1 max=10 even=0 expect=invalid + 2: pass str='' min=0 max=10 even=0 expect=valid + 3: pass str='' min=1 max=10 even=0 expect=invalid + 4: pass str=' ' min=0 max=10 even=0 expect=invalid + 5: pass str='1' min=0 max=10 even=0 expect=valid + 6: pass str='1' min=1 max=10 even=0 expect=valid + 7: pass str='1' min=1 max=10 even=1 expect=invalid + 8: pass str='1' min=2 max=10 even=0 expect=invalid + 9: pass str='123' min=1 max=10 even=0 expect=valid +10: pass str='123' min=1 max=10 even=1 expect=invalid +11: pass str='123' min=4 max=10 even=0 expect=invalid +12: pass str='1234' min=4 max=10 even=1 expect=valid +13: pass str='12345' min=4 max=10 even=1 expect=invalid +14: pass str='123456' min=4 max=10 even=1 expect=valid +15: pass str='1234567' min=4 max=10 even=1 expect=invalid +16: pass str='12345678' min=4 max=10 even=1 expect=valid +17: pass str='123456789' min=4 max=10 even=1 expect=invalid +18: pass str='123456789a' min=4 max=10 even=1 expect=valid +19: pass str='123456789ab' min=4 max=10 even=1 expect=invalid +20: pass str='123456789abc' min=4 max=10 even=1 expect=invalid +21: pass str='123456789ab' min=4 max=10 even=0 expect=invalid +22: pass str='123456789abc' min=4 max=10 even=0 expect=invalid +23: pass str='0123456789abcdefABCDEF' min=0 max=100 even=0 expect=valid +24: pass str='0123456789 abcdef ABCDEF' min=0 max=100 even=0 expect=invalid +25: pass str='foobar' min=0 max=100 even=0 expect=invalid +26: pass str='BeadedBeeAced1EbbedDefacedFacade' min=32 max=32 even=1 expect=valid +27: pass str='C01ffedC1cadaeAc1d1f1edAcac1aB0a' min=32 max=32 even=0 expect=valid +28: pass str='DeafBeddedBabeAcceededFadedDecaff' min=32 max=32 even=0 expect=invalid -- To view, visit https://gerrit.osmocom.org/4159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 9 14:31:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Oct 2017 14:31:03 +0000 Subject: [MERGED] libosmocore[master]: auth: add OSMO_MILENAGE_IND_BITLEN_MAX In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: auth: add OSMO_MILENAGE_IND_BITLEN_MAX ...................................................................... auth: add OSMO_MILENAGE_IND_BITLEN_MAX Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: Ic39f3404d1a49ffd06070aa9897b36f219eacf4d --- M include/osmocom/crypt/auth.h M src/gsm/auth_milenage.c 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 7064c99..1b017c0 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -10,6 +10,7 @@ #include #define OSMO_A5_MAX_KEY_LEN_BYTES (128/8) +#define OSMO_MILENAGE_IND_BITLEN_MAX 28 /*! Authentication Type (GSM/UMTS) */ enum osmo_sub_auth_type { diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index e1a1dfb..2ddf712 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -112,7 +112,7 @@ * { .ind_bitlen = 0, .ind = 0, .sqn = (desired_sqn - 1) } */ - if (aud->u.umts.ind_bitlen > 28) + if (aud->u.umts.ind_bitlen > OSMO_MILENAGE_IND_BITLEN_MAX) return -2; seq_1 = 1LL << aud->u.umts.ind_bitlen; -- To view, visit https://gerrit.osmocom.org/4158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic39f3404d1a49ffd06070aa9897b36f219eacf4d Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 9 14:31:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Oct 2017 14:31:03 +0000 Subject: [MERGED] libosmocore[master]: auth: add value_strings for osmo_sub_auth_type, comment on o... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: auth: add value_strings for osmo_sub_auth_type, comment on osmo_auth_alg_name() ...................................................................... auth: add value_strings for osmo_sub_auth_type, comment on osmo_auth_alg_name() Add osmo_sub_auth_type_names[] and osmo_sub_auth_type_name(). Also add a hint to enum osmo_auth_algo's API doc that osmo_auth_alg_name() already exists (it is defined further below). Change-Id: I652a929bcd11c694d86812fb03d0a1cbd985efda --- M include/osmocom/crypt/auth.h M src/gsm/auth_core.c M src/gsm/libosmogsm.map 3 files changed, 15 insertions(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 2f2a8d3..7064c99 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -7,6 +7,7 @@ #include #include +#include #define OSMO_A5_MAX_KEY_LEN_BYTES (128/8) @@ -17,7 +18,12 @@ OSMO_AUTH_TYPE_UMTS = 0x02, }; -/*! Authentication Algorithm */ +extern const struct value_string osmo_sub_auth_type_names[]; +static inline const char *osmo_sub_auth_type_name(enum osmo_sub_auth_type val) +{ return get_value_string(osmo_sub_auth_type_names, val); } + +/*! Authentication Algorithm. + * See also osmo_auth_alg_name() and osmo_auth_alg_parse(). */ enum osmo_auth_algo { OSMO_AUTH_ALG_NONE, OSMO_AUTH_ALG_COMP128v1, diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index 4156695..738e860 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -221,4 +221,11 @@ return get_string_value(auth_alg_vals, name); } +const struct value_string osmo_sub_auth_type_names[] = { + { OSMO_AUTH_TYPE_NONE, "None" }, + { OSMO_AUTH_TYPE_GSM, "GSM" }, + { OSMO_AUTH_TYPE_UMTS, "UMTS" }, + { 0, NULL } +}; + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 5598859..a72db52 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -339,6 +339,7 @@ osmo_auth_load; osmo_auth_register; osmo_auth_supported; +osmo_sub_auth_type_names; osmo_rsl2sitype; osmo_sitype2rsl; -- To view, visit https://gerrit.osmocom.org/4157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I652a929bcd11c694d86812fb03d0a1cbd985efda Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 9 15:30:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 15:30:58 +0000 Subject: [PATCH] osmo-bsc[master]: OML: consider RSL link state Message-ID: Review at https://gerrit.osmocom.org/4169 OML: consider RSL link state For "sh bts 0" command, when showing OML link state, take into consideration RSL link state as well: if OML is up but RSL is missing show it as degraded. Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Related: OS#2486 --- M src/libbsc/bsc_vty.c 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/69/4169/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index f1c78c8..f035989 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -237,6 +237,8 @@ struct pchan_load pl; unsigned long long sec; struct timespec tp; + struct gsm_bts_trx *trx; + bool rsl_ok = true; int rc; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " @@ -310,7 +312,11 @@ if (is_ipaccess_bts(bts)) { vty_out(vty, " OML Link state: "); if (bts->oml_link) { - vty_out(vty, "connected"); + llist_for_each_entry(trx, &bts->trx_list, list) { + if (!trx->rsl_link) + rsl_ok = false; + } + vty_out(vty, rsl_ok ? "connected" : "degraded"); if (bts->uptime) { rc = clock_gettime(CLOCK_MONOTONIC, &tp); if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ -- To view, visit https://gerrit.osmocom.org/4169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 9 15:52:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 15:52:05 +0000 Subject: [PATCH] osmo-bsc[master]: OML: consider RSL link state In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4169 to look at the new patch set (#2). OML: consider RSL link state OML link state is available via vty ("sh bts 0" command) and ctrl ("oml-connection-state" RO variable). When showing OML link state, take into consideration RSL link state as well: if OML is up but RSL is missing show it as degraded. Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Related: OS#2486 --- M include/osmocom/bsc/gsm_data.h M src/libbsc/bsc_ctrl_commands.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c 4 files changed, 21 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/69/4169/2 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 6814662..22ef911 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -654,6 +654,8 @@ extern const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1]; extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1]; +bool all_trx_rsl_connected(const struct gsm_bts *bts); + /* control interface handling */ int bsc_base_ctrl_cmds_install(void); diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c index 7c2bfb5..cedc327 100644 --- a/src/libbsc/bsc_ctrl_commands.c +++ b/src/libbsc/bsc_ctrl_commands.c @@ -233,7 +233,11 @@ { struct gsm_bts *bts = cmd->node; - cmd->reply = bts->oml_link ? "connected" : "disconnected"; + if (bts->oml_link) + cmd->reply = all_trx_rsl_connected(bts) ? "connected" : "degraded"; + else + cmd->reply = "disconnected"; + return CTRL_CMD_REPLY; } diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index f3e13e2..c08b513 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -38,6 +38,7 @@ #include #include #include +#include /* global pointer to the gsm network data structure */ extern struct gsm_network *bsc_gsmnet; @@ -97,6 +98,18 @@ return 0; } +bool all_trx_rsl_connected(const struct gsm_bts *bts) +{ + const struct gsm_bts_trx *trx; + + llist_for_each_entry(trx, &bts->trx_list, list) { + if (!trx->rsl_link) + return false; + } + + return true; +} + static int rsl_si(struct gsm_bts_trx *trx, enum osmo_sysinfo_type i, int si_len) { struct gsm_bts *bts = trx->bts; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index f1c78c8..8c3c8d0 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -310,7 +310,7 @@ if (is_ipaccess_bts(bts)) { vty_out(vty, " OML Link state: "); if (bts->oml_link) { - vty_out(vty, "connected"); + vty_out(vty, all_trx_rsl_connected(bts) ? "connected" : "degraded"); if (bts->uptime) { rc = clock_gettime(CLOCK_MONOTONIC, &tp); if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ -- To view, visit https://gerrit.osmocom.org/4169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 9 16:30:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Oct 2017 16:30:42 +0000 Subject: libosmocore[master]: Fix build on older systems In-Reply-To: References: Message-ID: Patch Set 1: I just hit this issue: /home/sysmocom/git/libosmocore/src/gsm/gsm_utils.c: In function 'osmo_get_rand_id': /home/sysmocom/git/libosmocore/src/gsm/gsm_utils.c:418:9: note: #pragma message: Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25 #pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") ^~~~~~~ /home/sysmocom/git/libosmocore/src/gsm/gsm_utils.c:420:40: error: 'GRND_NONBLOCK' undeclared (first use in this function) rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK); ^~~~~~~~~~~~~ /home/sysmocom/git/libosmocore/src/gsm/gsm_utils.c:420:40: note: each undeclared identifier is reported only once for each function it appears in Makefile:568: recipe for target 'gsm_utils.lo' failed -- To view, visit https://gerrit.osmocom.org/4166 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bcac37ee1847596b49122f9307bd2689ba71b1b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 16:31:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Oct 2017 16:31:04 +0000 Subject: libosmocore[master]: Fix build on older systems In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4166 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bcac37ee1847596b49122f9307bd2689ba71b1b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 9 16:42:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 9 Oct 2017 16:42:29 +0000 Subject: [PATCH] osmo-bsc[master]: OML: consider RSL link state In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4169 to look at the new patch set (#3). OML: consider RSL link state OML link state is available via vty ("sh bts 0" command) and ctrl ("oml-connection-state" RO variable). When showing OML link state, take into consideration RSL link state as well: if OML is up but RSL is missing show it as degraded. That's implemented via BTS model-specific functions (currently Sysmo- and Nano- BTS only) Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Related: OS#2486 --- M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h M src/libbsc/abis_nm.c M src/libbsc/bsc_ctrl_commands.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/bts_ipaccess_nanobts.c 7 files changed, 39 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/69/4169/3 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 6814662..429526d 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -654,6 +654,9 @@ extern const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1]; extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1]; +char *get_oml_status(const struct gsm_bts *bts); +char *get_model_oml_status(const struct gsm_bts *bts); + /* control interface handling */ int bsc_base_ctrl_cmds_install(void); diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index f41bac4..240be1c 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -546,6 +546,7 @@ bool started; int (*start)(struct gsm_network *net); int (*oml_rcvmsg)(struct msgb *msg); + char * (*oml_status)(const struct gsm_bts *bts); void (*e1line_bind_ops)(struct e1inp_line *line); diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index 9567cfa..f0dfe9e 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -683,6 +683,34 @@ return 0; } +static inline bool all_trx_rsl_connected(const struct gsm_bts *bts) +{ + const struct gsm_bts_trx *trx; + + llist_for_each_entry(trx, &bts->trx_list, list) { + if (!trx->rsl_link) + return false; + } + + return true; +} + +char *get_oml_status(const struct gsm_bts *bts) +{ + if (bts->oml_link) + return all_trx_rsl_connected(bts) ? "connected" : "degraded"; + + return "disconnected"; +} + +char *get_model_oml_status(const struct gsm_bts *bts) +{ + if (bts->model->oml_status) + return bts->model->oml_status(bts); + + return "unknown"; +} + void abis_nm_queue_send_next(struct gsm_bts *bts) { int wait = 0; diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c index 7c2bfb5..d925e67 100644 --- a/src/libbsc/bsc_ctrl_commands.c +++ b/src/libbsc/bsc_ctrl_commands.c @@ -231,9 +231,10 @@ static int get_bts_oml_conn(struct ctrl_cmd *cmd, void *data) { - struct gsm_bts *bts = cmd->node; + const struct gsm_bts *bts = cmd->node; - cmd->reply = bts->oml_link ? "connected" : "disconnected"; + cmd->reply = get_model_oml_status(bts); + return CTRL_CMD_REPLY; } diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index f3e13e2..f5f265f 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -38,6 +38,7 @@ #include #include #include +#include /* global pointer to the gsm network data structure */ extern struct gsm_network *bsc_gsmnet; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index f1c78c8..43cb282 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -308,9 +308,8 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: "); + vty_out(vty, " OML Link state: %s", get_model_oml_status(bts)); if (bts->oml_link) { - vty_out(vty, "connected"); if (bts->uptime) { rc = clock_gettime(CLOCK_MONOTONIC, &tp); if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ @@ -320,8 +319,7 @@ sec % 60, VTY_NEWLINE); } } - } else - vty_out(vty, "disconnected.%s", VTY_NEWLINE); + } } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c index 87ec7b2..dbb0e4f 100644 --- a/src/libbsc/bts_ipaccess_nanobts.c +++ b/src/libbsc/bts_ipaccess_nanobts.c @@ -52,6 +52,7 @@ .name = "nanobts", .start = bts_model_nanobts_start, .oml_rcvmsg = &abis_nm_rcvmsg, + .oml_status = &get_oml_status, .e1line_bind_ops = bts_model_nanobts_e1line_bind_ops, .nm_att_tlvdef = { .def = { -- To view, visit https://gerrit.osmocom.org/4169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:31:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:31:56 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: prepend DB_STMT_ to enum stmt_idx entries Message-ID: Review at https://gerrit.osmocom.org/4170 cosmetic: prepend DB_STMT_ to enum stmt_idx entries There are upcoming additions, and some seem too general without a proper common prefix in the identifiers, like 'CREATE'. Change-Id: I51b677db31a1ebbbc45dc7925074de7493fbde1f --- M src/db.c M src/db.h M src/db_auc.c M src/db_hlr.c 4 files changed, 30 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/70/4170/1 diff --git a/src/db.c b/src/db.c index aaf6fe2..6566527 100644 --- a/src/db.c +++ b/src/db.c @@ -26,15 +26,15 @@ #include "db.h" static const char *stmt_sql[] = { - [SEL_BY_IMSI] = "SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?", - [UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", - [UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", - [AUC_BY_IMSI] = "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, ind_bitlen FROM subscriber LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id WHERE imsi = ?", - [AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", - [UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", - [UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", - [SET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=1 WHERE imsi = ?", - [UNSET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=0 WHERE imsi = ?", + [DB_STMT_SEL_BY_IMSI] = "SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?", + [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", + [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", + [DB_STMT_AUC_BY_IMSI] = "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, ind_bitlen FROM subscriber LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id WHERE imsi = ?", + [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", + [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", + [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", + [DB_STMT_SET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=1 WHERE imsi = ?", + [DB_STMT_UNSET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=0 WHERE imsi = ?", }; static void sql3_error_log_cb(void *arg, int err_code, const char *msg) diff --git a/src/db.h b/src/db.h index a60cf62..d424b38 100644 --- a/src/db.h +++ b/src/db.h @@ -4,22 +4,22 @@ #include enum stmt_idx { - SEL_BY_IMSI = 0, - UPD_VLR_BY_ID = 1, - UPD_SGSN_BY_ID = 2, - AUC_BY_IMSI = 3, - AUC_UPD_SQN = 4, - UPD_PURGE_CS_BY_IMSI = 5, - UPD_PURGE_PS_BY_IMSI = 6, - SET_NAM_PS_BY_IMSI = 7, - UNSET_NAM_PS_BY_IMSI = 8, - _NUM_STMT + DB_STMT_SEL_BY_IMSI, + DB_STMT_UPD_VLR_BY_ID, + DB_STMT_UPD_SGSN_BY_ID, + DB_STMT_AUC_BY_IMSI, + DB_STMT_AUC_UPD_SQN, + DB_STMT_UPD_PURGE_CS_BY_IMSI, + DB_STMT_UPD_PURGE_PS_BY_IMSI, + DB_STMT_SET_NAM_PS_BY_IMSI, + DB_STMT_UNSET_NAM_PS_BY_IMSI, + _NUM_DB_STMT }; struct db_context { char *fname; sqlite3 *db; - sqlite3_stmt *stmt[_NUM_STMT]; + sqlite3_stmt *stmt[_NUM_DB_STMT]; }; bool db_remove_reset(sqlite3_stmt *stmt); diff --git a/src/db_auc.c b/src/db_auc.c index f532b83..07039d4 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -36,7 +36,7 @@ int db_update_sqn(struct db_context *dbc, uint64_t id, uint64_t new_sqn) { - sqlite3_stmt *stmt = dbc->stmt[AUC_UPD_SQN]; + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_UPD_SQN]; int rc; /* bind new SQN and subscriber ID */ @@ -79,7 +79,7 @@ struct osmo_sub_auth_data *aud3g, uint64_t *subscr_id) { - sqlite3_stmt *stmt = dbc->stmt[AUC_BY_IMSI]; + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_BY_IMSI]; int ret = 0; int rc; diff --git a/src/db_hlr.c b/src/db_hlr.c index f6ae18f..9c74a24 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -40,7 +40,7 @@ int db_subscr_get(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr) { - sqlite3_stmt *stmt = dbc->stmt[SEL_BY_IMSI]; + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; int rc; if (!db_bind_imsi(stmt, imsi)) @@ -83,7 +83,7 @@ int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable) { sqlite3_stmt *stmt = - dbc->stmt[enable ? SET_NAM_PS_BY_IMSI : UNSET_NAM_PS_BY_IMSI]; + dbc->stmt[enable ? DB_STMT_SET_NAM_PS_BY_IMSI : DB_STMT_UNSET_NAM_PS_BY_IMSI]; int rc; if (!db_bind_imsi(stmt, imsi)) @@ -111,15 +111,15 @@ const struct hlr_subscriber *subscr, const char *vlr_or_sgsn_number, bool lu_is_ps) { - sqlite3_stmt *stmt = dbc->stmt[UPD_VLR_BY_ID]; + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; const char *txt; int rc, ret = 0; if (lu_is_ps) { - stmt = dbc->stmt[UPD_SGSN_BY_ID]; + stmt = dbc->stmt[DB_STMT_UPD_SGSN_BY_ID]; txt = subscr->sgsn_number; } else { - stmt = dbc->stmt[UPD_VLR_BY_ID]; + stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; txt = subscr->vlr_number; } @@ -150,13 +150,13 @@ int db_subscr_purge(struct db_context *dbc, const char *imsi, bool is_ps) { - sqlite3_stmt *stmt = dbc->stmt[UPD_VLR_BY_ID]; + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; int rc, ret = 1; if (is_ps) - stmt = dbc->stmt[UPD_PURGE_PS_BY_IMSI]; + stmt = dbc->stmt[DB_STMT_UPD_PURGE_PS_BY_IMSI]; else - stmt = dbc->stmt[UPD_PURGE_CS_BY_IMSI]; + stmt = dbc->stmt[DB_STMT_UPD_PURGE_CS_BY_IMSI]; if (!db_bind_imsi(stmt, imsi)) return -EINVAL; -- To view, visit https://gerrit.osmocom.org/4170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I51b677db31a1ebbbc45dc7925074de7493fbde1f Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:31:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:31:57 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: rename db_subscr_get() to db_subscr_get_by_imsi() Message-ID: Review at https://gerrit.osmocom.org/4171 cosmetic: rename db_subscr_get() to db_subscr_get_by_imsi() There will be more additions, _by_msisdn() and _by_id(), to serve the upcoming VTY commands, to allow flexibly selecting subscribers as in the old OsmoNITB. Change-Id: I32fa676ccc5c10eba834c4390c8a42476b9c1961 --- M src/ctrl.c M src/db.h M src/db_hlr.c M src/luop.c 4 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/71/4171/1 diff --git a/src/ctrl.c b/src/ctrl.c index 81de961..b034cd7 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -38,7 +38,7 @@ struct lu_operation *luop = NULL; struct osmo_gsup_conn *co; - if (db_subscr_get(ctx->dbc, cmd->value, NULL) < 0) { + if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, NULL) < 0) { cmd->reply = "Subscriber Unknown in HLR"; return CTRL_CMD_ERROR; } diff --git a/src/db.h b/src/db.h index d424b38..0064a4d 100644 --- a/src/db.h +++ b/src/db.h @@ -71,8 +71,8 @@ bool ms_purged_ps; }; -int db_subscr_get(struct db_context *dbc, const char *imsi, - struct hlr_subscriber *subscr); +int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, + struct hlr_subscriber *subscr); int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable); int db_subscr_lu(struct db_context *dbc, const struct hlr_subscriber *subscr, diff --git a/src/db_hlr.c b/src/db_hlr.c index 9c74a24..fa962f3 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -37,8 +37,8 @@ x[sizeof(x)-1] = '\0'; \ } while (0) -int db_subscr_get(struct db_context *dbc, const char *imsi, - struct hlr_subscriber *subscr) +int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, + struct hlr_subscriber *subscr) { sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; int rc; diff --git a/src/luop.c b/src/luop.c index 937c02c..1b17fe3 100644 --- a/src/luop.c +++ b/src/luop.c @@ -95,7 +95,7 @@ { struct hlr_subscriber *subscr = &luop->subscr; - if (db_subscr_get(dbc, imsi, subscr) < 0) + if (db_subscr_get_by_imsi(dbc, imsi, subscr) < 0) return false; return true; -- To view, visit https://gerrit.osmocom.org/4171 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32fa676ccc5c10eba834c4390c8a42476b9c1961 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:31:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:31:57 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: refactor db_bind_imsi() as db_bind_text() Message-ID: Review at https://gerrit.osmocom.org/4172 cosmetic: refactor db_bind_imsi() as db_bind_text() There are more uses for a generalized db_bind_text(), and in an upcoming patch there will be similar functions like db_bind_int(). Also, add argument param_name, optionally indicating a named SQL parameter to bind to, which will be used in subsequent patches. So far, all callers pass NULL to yield previous db_bind_imsi() behavior of binding to the first param. Change-Id: I87bc46a23a724677e8319d6a4b032976b7ba9394 --- M src/db.c M src/db.h M src/db_hlr.c 3 files changed, 18 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/72/4172/1 diff --git a/src/db.c b/src/db.c index 6566527..4bba2f0 100644 --- a/src/db.c +++ b/src/db.c @@ -77,16 +77,25 @@ return true; } -/* bind IMSI and do proper cleanup in case of failure */ -bool db_bind_imsi(sqlite3_stmt *stmt, const char *imsi) +/** bind text arg and do proper cleanup in case of failure. If param_name is + * NULL, bind to the first parameter (useful for SQL statements that have only + * one parameter). */ +bool db_bind_text(sqlite3_stmt *stmt, const char *param_name, const char *text) { - int rc = sqlite3_bind_text(stmt, 1, imsi, -1, SQLITE_STATIC); + int rc; + int idx = param_name ? sqlite3_bind_parameter_index(stmt, param_name) : 1; + if (idx < 1) { + LOGP(DDB, LOGL_ERROR, "Error composing SQL, cannot bind parameter '%s'\n", + param_name); + return false; + } + rc = sqlite3_bind_text(stmt, idx, text, -1, SQLITE_STATIC); if (rc != SQLITE_OK) { - LOGP(DDB, LOGL_ERROR, "Error binding IMSI %s: %d\n", imsi, rc); + LOGP(DDB, LOGL_ERROR, "Error binding text to SQL parameter %s: %d\n", + param_name ? param_name : "#1", rc); db_remove_reset(stmt); return false; } - return true; } diff --git a/src/db.h b/src/db.h index 0064a4d..6d6723a 100644 --- a/src/db.h +++ b/src/db.h @@ -23,7 +23,7 @@ }; bool db_remove_reset(sqlite3_stmt *stmt); -bool db_bind_imsi(sqlite3_stmt *stmt, const char *imsi); +bool db_bind_text(sqlite3_stmt *stmt, const char *param_name, const char *text); void db_close(struct db_context *dbc); struct db_context *db_open(void *ctx, const char *fname); diff --git a/src/db_hlr.c b/src/db_hlr.c index fa962f3..3bf3912 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -43,7 +43,7 @@ sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; int rc; - if (!db_bind_imsi(stmt, imsi)) + if (!db_bind_text(stmt, NULL, imsi)) return -EINVAL; /* execute the statement */ @@ -86,7 +86,7 @@ dbc->stmt[enable ? DB_STMT_SET_NAM_PS_BY_IMSI : DB_STMT_UNSET_NAM_PS_BY_IMSI]; int rc; - if (!db_bind_imsi(stmt, imsi)) + if (!db_bind_text(stmt, NULL, imsi)) return -EINVAL; rc = sqlite3_step(stmt); /* execute the statement */ @@ -158,7 +158,7 @@ else stmt = dbc->stmt[DB_STMT_UPD_PURGE_CS_BY_IMSI]; - if (!db_bind_imsi(stmt, imsi)) + if (!db_bind_text(stmt, NULL, imsi)) return -EINVAL; /* execute the statement */ -- To view, visit https://gerrit.osmocom.org/4172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I87bc46a23a724677e8319d6a4b032976b7ba9394 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:31:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:31:58 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: multi-line DB_STMT_AUC_BY_IMSI Message-ID: Review at https://gerrit.osmocom.org/4173 cosmetic: multi-line DB_STMT_AUC_BY_IMSI In multiple lines, the statement becomes more readable. I'd like to get this change out of the way before upcoming SQL statement edits and additions. Change-Id: Icf09f4bbb298a516aa52c81e3ca67d9d91d8c7c2 --- M src/db.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/73/4173/1 diff --git a/src/db.c b/src/db.c index 4bba2f0..2c10ba0 100644 --- a/src/db.c +++ b/src/db.c @@ -29,7 +29,12 @@ [DB_STMT_SEL_BY_IMSI] = "SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?", [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", - [DB_STMT_AUC_BY_IMSI] = "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, ind_bitlen FROM subscriber LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id WHERE imsi = ?", + [DB_STMT_AUC_BY_IMSI] = + "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, ind_bitlen" + " FROM subscriber" + " LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id" + " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" + " WHERE imsi = ?", [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", -- To view, visit https://gerrit.osmocom.org/4173 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf09f4bbb298a516aa52c81e3ca67d9d91d8c7c2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:31:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:31:58 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: log IMSI='', log "no such subscriber" Message-ID: Review at https://gerrit.osmocom.org/4174 cosmetic: log IMSI='', log "no such subscriber" In LOGHLR and LOGAUC, log IMSI='' instead of just : In the log, it is not always obvious to the reader that the printed number refers to an IMSI (vs. an MSISDN or in the future an IMEI). In db_get_auth_data(), log "No such subscriber" instead of just "Unknown", to clarify what exactly is meant. Change-Id: I2ec8ab5e67d4e95083f6e39232fc91ebaa080cb8 --- M src/db_auc.c M src/db_hlr.c 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/74/4174/1 diff --git a/src/db_auc.c b/src/db_auc.c index 07039d4..7aad06d 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -30,7 +30,7 @@ #include "auc.h" #include "rand.h" -#define LOGAUC(imsi, level, fmt, args ...) LOGP(DAUC, level, "%s: " fmt, imsi, ## args) +#define LOGAUC(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) /* update the SQN for a given subscriber ID */ int db_update_sqn(struct db_context *dbc, uint64_t id, @@ -98,7 +98,7 @@ /* execute the statement */ rc = sqlite3_step(stmt); if (rc == SQLITE_DONE) { - LOGAUC(imsi, LOGL_INFO, "Unknown\n"); + LOGAUC(imsi, LOGL_INFO, "No such subscriber\n"); ret = 0; goto out; } else if (rc != SQLITE_ROW) { diff --git a/src/db_hlr.c b/src/db_hlr.c index 3bf3912..4bccca4 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -28,7 +28,7 @@ #include "logging.h" #include "db.h" -#define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "%s: " fmt, imsi, ## args) +#define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) #define SL3_TXT(x, stmt, idx) do { \ const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ -- To view, visit https://gerrit.osmocom.org/4174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2ec8ab5e67d4e95083f6e39232fc91ebaa080cb8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:31:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:31:58 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: don't log about missing SQLite log cb Message-ID: Review at https://gerrit.osmocom.org/4175 cosmetic: don't log about missing SQLite log cb SQLite3 seems to be commonly compiled without log callback support. It is then misleading to see a seeming error message about this on each osmo-hlr startup. Avoid the impression that we would miss out on important logging: simply ignore any errors upon registering the log callback. We do receive logging on each DB error. Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 --- M src/db.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/75/4175/1 diff --git a/src/db.c b/src/db.c index 2c10ba0..3e64e7d 100644 --- a/src/db.c +++ b/src/db.c @@ -139,9 +139,9 @@ if (rc != SQLITE_OK) LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 error log callback\n"); - rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); - if (rc != SQLITE_OK) - LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 SQL statement log callback\n"); + /* SQLite may be compiled without log callback support, don't complain + * about errors here. */ + sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); rc = sqlite3_open(dbc->fname, &dbc->db); if (rc != SQLITE_OK) { -- To view, visit https://gerrit.osmocom.org/4175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:31:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:31:58 +0000 Subject: [PATCH] osmo-hlr[master]: add db_bind_int() and db_bind_int64() Message-ID: Review at https://gerrit.osmocom.org/4176 add db_bind_int() and db_bind_int64() Will be used in upcoming patches, e.g. change-IDs - I6e70e15228f5bb10bee6758ae5dc9687d65839bd - I83a47289a48ac37da0f712845d422e897a5e8171 Change-Id: I705a15eef242c98feb6e95a883916f6cf8173d70 --- M src/db.c M src/db.h 2 files changed, 46 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/76/4176/1 diff --git a/src/db.c b/src/db.c index 3e64e7d..2f28afb 100644 --- a/src/db.c +++ b/src/db.c @@ -104,6 +104,50 @@ return true; } +/** bind int arg and do proper cleanup in case of failure. If param_name is + * NULL, bind to the first parameter (useful for SQL statements that have only + * one parameter). */ +bool db_bind_int(sqlite3_stmt *stmt, const char *param_name, int nr) +{ + int rc; + int idx = param_name ? sqlite3_bind_parameter_index(stmt, param_name) : 1; + if (idx < 1) { + LOGP(DDB, LOGL_ERROR, "Error composing SQL, cannot bind parameter '%s'\n", + param_name); + return false; + } + rc = sqlite3_bind_int(stmt, idx, nr); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "Error binding int64 to SQL parameter %s: %d\n", + param_name ? param_name : "#1", rc); + db_remove_reset(stmt); + return false; + } + return true; +} + +/** bind int64 arg and do proper cleanup in case of failure. If param_name is + * NULL, bind to the first parameter (useful for SQL statements that have only + * one parameter). */ +bool db_bind_int64(sqlite3_stmt *stmt, const char *param_name, int64_t nr) +{ + int rc; + int idx = param_name ? sqlite3_bind_parameter_index(stmt, param_name) : 1; + if (idx < 1) { + LOGP(DDB, LOGL_ERROR, "Error composing SQL, cannot bind parameter '%s'\n", + param_name); + return false; + } + rc = sqlite3_bind_int64(stmt, idx, nr); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "Error binding int64 to SQL parameter %s: %d\n", + param_name ? param_name : "#1", rc); + db_remove_reset(stmt); + return false; + } + return true; +} + void db_close(struct db_context *dbc) { unsigned int i; diff --git a/src/db.h b/src/db.h index 6d6723a..533c4d2 100644 --- a/src/db.h +++ b/src/db.h @@ -24,6 +24,8 @@ bool db_remove_reset(sqlite3_stmt *stmt); bool db_bind_text(sqlite3_stmt *stmt, const char *param_name, const char *text); +bool db_bind_int(sqlite3_stmt *stmt, const char *param_name, int nr); +bool db_bind_int64(sqlite3_stmt *stmt, const char *param_name, int64_t nr); void db_close(struct db_context *dbc); struct db_context *db_open(void *ctx, const char *fname); -- To view, visit https://gerrit.osmocom.org/4176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I705a15eef242c98feb6e95a883916f6cf8173d70 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:31:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:31:59 +0000 Subject: [PATCH] osmo-hlr[master]: add db_subscr_create(), db_subscr_delete(), db_subscr_update... Message-ID: Review at https://gerrit.osmocom.org/4177 add db_subscr_create(), db_subscr_delete(), db_subscr_update_msisdn_by_imsi() These will be needed by VTY commands to create, delete and modify subscribers. Auth data editing will follow in another patch. The FIXME "also remove authentication data from auc_2g and auc_3g" will get fixed in change-id Icb11b5e059fb920447a9aa414db1819a0c020529. Change-Id: I725273d36234331093e7fff7d5f12f6be6ab2623 --- M src/db.c M src/db.h M src/db_hlr.c 3 files changed, 128 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/77/4177/1 diff --git a/src/db.c b/src/db.c index 2f28afb..57362ac 100644 --- a/src/db.c +++ b/src/db.c @@ -40,6 +40,9 @@ [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", [DB_STMT_SET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=1 WHERE imsi = ?", [DB_STMT_UNSET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=0 WHERE imsi = ?", + [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", + [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id", + [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi", }; static void sql3_error_log_cb(void *arg, int err_code, const char *msg) diff --git a/src/db.h b/src/db.h index 533c4d2..d7a8303 100644 --- a/src/db.h +++ b/src/db.h @@ -13,6 +13,9 @@ DB_STMT_UPD_PURGE_PS_BY_IMSI, DB_STMT_SET_NAM_PS_BY_IMSI, DB_STMT_UNSET_NAM_PS_BY_IMSI, + DB_STMT_SUBSCR_CREATE, + DB_STMT_DEL_BY_ID, + DB_STMT_SET_MSISDN_BY_IMSI, _NUM_DB_STMT }; @@ -73,6 +76,12 @@ bool ms_purged_ps; }; +int db_subscr_create(struct db_context *dbc, const char *imsi); +int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id); + +int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, + const char *msisdn); + int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr); int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable); diff --git a/src/db_hlr.c b/src/db_hlr.c index 4bccca4..8d2fc1c 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -19,9 +19,11 @@ #include #include +#include #include #include +#include #include @@ -37,6 +39,120 @@ x[sizeof(x)-1] = '\0'; \ } while (0) +int db_subscr_create(struct db_context *dbc, const char *imsi) +{ + sqlite3_stmt *stmt; + int rc; + + if (!osmo_imsi_str_valid(imsi)) { + LOGP(DAUC, LOGL_ERROR, "Cannot create subscriber: invalid IMSI: '%s'\n", + imsi); + return -EINVAL; + } + + stmt = dbc->stmt[DB_STMT_SUBSCR_CREATE]; + + if (!db_bind_text(stmt, "$imsi", imsi)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); + db_remove_reset(stmt); + if (rc != SQLITE_DONE) { + LOGHLR(imsi, LOGL_ERROR, "Cannot create subscriber: SQL error: (%d) %s\n", + rc, sqlite3_errmsg(dbc->db)); + return -EIO; + } + + return 0; +} + +int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id) +{ + int rc; + int ret = 0; + + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_DEL_BY_ID]; + + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGP(DAUC, LOGL_ERROR, + "Cannot delete subscriber ID=%"PRId64": SQL error: (%d) %s\n", + subscr_id, rc, sqlite3_errmsg(dbc->db)); + db_remove_reset(stmt); + return -EIO; + } + + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot delete: no such subscriber: ID=%"PRId64"\n", + subscr_id); + ret = -ENOENT; + } else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Delete subscriber ID=%"PRId64 + ": SQL modified %d rows (expected 1)\n", subscr_id, rc); + ret = -EIO; + } + + /* FIXME: also remove authentication data from auc_2g and auc_3g */ + + db_remove_reset(stmt); + return ret; +} + +int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, + const char *msisdn) +{ + int rc; + int ret = 0; + + if (!osmo_msisdn_str_valid(msisdn)) { + LOGHLR(imsi, LOGL_ERROR, + "Cannot update subscriber: invalid MSISDN: '%s'\n", + msisdn); + return -EINVAL; + } + + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SET_MSISDN_BY_IMSI]; + + if (!db_bind_text(stmt, "$imsi", imsi)) + return -EIO; + if (!db_bind_text(stmt, "$msisdn", msisdn)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGHLR(imsi, LOGL_ERROR, + "Cannot update subscriber's MSISDN: SQL error: (%d) %s\n", + rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; + } + + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot update MSISDN: no such subscriber: IMSI='%s'\n", + imsi); + ret = -ENOENT; + goto out; + } else if (rc != 1) { + LOGHLR(imsi, LOGL_ERROR, "Update MSISDN: SQL modified %d rows (expected 1)\n", rc); + ret = -EIO; + } + +out: + db_remove_reset(stmt); + return ret; + +} + int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr) { -- To view, visit https://gerrit.osmocom.org/4177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I725273d36234331093e7fff7d5f12f6be6ab2623 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:31:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:31:59 +0000 Subject: [PATCH] osmo-hlr[master]: add initial db_test: creating and deleting subscribers Message-ID: Review at https://gerrit.osmocom.org/4178 add initial db_test: creating and deleting subscribers Change-Id: I2a0d277f55162bf5ceb0fc7d50390f2994daed71 --- M configure.ac M tests/Makefile.am A tests/db/Makefile.am A tests/db/db_test.c A tests/db/db_test.err A tests/db/db_test.ok M tests/testsuite.at 7 files changed, 663 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/78/4178/1 diff --git a/configure.ac b/configure.ac index 167d7f3..1db32d4 100644 --- a/configure.ac +++ b/configure.ac @@ -70,4 +70,5 @@ tests/auc/Makefile tests/auc/gen_ts_55_205_test_sets/Makefile tests/gsup_server/Makefile + tests/db/Makefile ) diff --git a/tests/Makefile.am b/tests/Makefile.am index d979fb6..0b625f5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,7 @@ SUBDIRS = \ auc \ gsup_server \ + db \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am new file mode 100644 index 0000000..a1f35a7 --- /dev/null +++ b/tests/db/Makefile.am @@ -0,0 +1,53 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/src \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(SQLITE3_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(NULL) + +EXTRA_DIST = \ + db_test.ok \ + db_test.err \ + $(NULL) + +check_PROGRAMS = db_test + +db_test_SOURCES = \ + db_test.c \ + $(NULL) + +db_test_LDADD = \ + $(top_srcdir)/src/db.c \ + $(top_srcdir)/src/db_hlr.c \ + $(top_srcdir)/src/db_auc.c \ + $(top_srcdir)/src/logging.c \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(SQLITE3_LIBS) \ + $(NULL) + +.PHONY: db_test.db update_exp manual manual-nonverbose manual-gdb +db_test.db: + rm -f db_test.db + sqlite3 $(builddir)/db_test.db < $(top_srcdir)/sql/hlr.sql + +update_exp: db_test.db + cd $(builddir); ./db_test >"$(srcdir)/db_test.ok" 2>"$(srcdir)/db_test.err" + +manual: db_test.db + cd $(builddir); ./db_test -v + +manual-nonverbose: db_test.db + cd $(builddir); ./db_test + +manual-gdb: db_test.db + cd $(builddir); gdb -ex run --args ./db_test -v diff --git a/tests/db/db_test.c b/tests/db/db_test.c new file mode 100644 index 0000000..e8cfe75 --- /dev/null +++ b/tests/db/db_test.c @@ -0,0 +1,347 @@ +/* (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "db.h" +#include "logging.h" + +#define comment_start() fprintf(stderr, "\n===== %s\n", __func__); +#define comment(fmt, args...) fprintf(stderr, "\n--- " fmt "\n\n", ## args); +#define comment_end() fprintf(stderr, "===== %s: SUCCESS\n\n", __func__); + +/* Perform a function call and verbosely assert that its return value is as expected. + * The return code is then available in g_rc. */ +#define ASSERT_RC(call, expect_rc) \ + do { \ + fprintf(stderr, #call " --> " #expect_rc "\n"); \ + g_rc = call; \ + if (g_rc != (expect_rc)) \ + fprintf(stderr, " MISMATCH: got rc = %d, expected: " \ + #expect_rc " = %d\n", g_rc, expect_rc); \ + OSMO_ASSERT(g_rc == (expect_rc)); \ + fprintf(stderr, "\n"); \ + } while (0) + +/* Do db_subscr_get_by_xxxx and verbosely assert that its return value is as expected. + * Print the subscriber struct to stderr to be validated by db_test.err. + * The result is then available in g_subscr. */ +#define ASSERT_SEL(by, val, expect_rc) \ + do { \ + int rc; \ + g_subscr = (struct hlr_subscriber){}; \ + fprintf(stderr, "db_subscr_get_by_" #by "(dbc, " #val ", &g_subscr) --> " \ + #expect_rc "\n"); \ + rc = db_subscr_get_by_##by(dbc, val, &g_subscr); \ + if (rc != (expect_rc)) \ + fprintf(stderr, " MISMATCH: got rc = %d, expected: " \ + #expect_rc " = %d\n", rc, expect_rc); \ + OSMO_ASSERT(rc == (expect_rc)); \ + if (!rc) \ + dump_subscr(&g_subscr); \ + fprintf(stderr, "\n"); \ + } while (0) + +static struct db_context *dbc = NULL; +static void *ctx = NULL; +static struct hlr_subscriber g_subscr; +static int g_rc; + +#define Pfv(name, fmt, val) \ + fprintf(stderr, " ." #name " = " fmt ",\n", val) +#define Pfo(name, fmt, obj) \ + Pfv(name, fmt, obj->name) + +/* Print a subscriber struct to stderr to be validated by db_test.err. */ +void dump_subscr(struct hlr_subscriber *subscr) +{ +#define Ps(name) \ + if (*subscr->name) \ + Pfo(name, "'%s'", subscr) +#define Pd(name) \ + Pfv(name, "%"PRId64, (int64_t)subscr->name) +#define Pd_nonzero(name) \ + if (subscr->name) \ + Pd(name) +#define Pb(if_val, name) \ + if (subscr->name == (if_val)) \ + Pfv(name, "%s", subscr->name ? "true" : "false") + + fprintf(stderr, "struct hlr_subscriber {\n"); + Pd(id); + Ps(imsi); + Ps(msisdn); + Ps(vlr_number); + Ps(sgsn_number); + Ps(sgsn_address); + Ps(sgsn_address); + Pd_nonzero(periodic_lu_timer); + Pd_nonzero(periodic_rau_tau_timer); + Pb(false, nam_cs); + Pb(false, nam_ps); + if (subscr->lmsi) + Pfo(lmsi, "0x%x", subscr); + Pb(true, ms_purged_cs); + Pb(true, ms_purged_ps); + fprintf(stderr, "}\n"); +#undef Ps +#undef Pd +#undef Pd_nonzero +#undef Pb +} + +void dump_aud(const char *label, struct osmo_sub_auth_data *aud) +{ + if (aud->type == OSMO_AUTH_TYPE_NONE) { + fprintf(stderr, "%s: none\n", label); + return; + } + + fprintf(stderr, "%s: struct osmo_sub_auth_data {\n", label); +#define Pf(name, fmt) \ + Pfo(name, fmt, aud) +#define Phex(name) \ + Pfv(name, "'%s'", osmo_hexdump_nospc(aud->name, sizeof(aud->name))) + + Pfv(type, "%s", osmo_sub_auth_type_name(aud->type)); + Pfv(algo, "%s", osmo_auth_alg_name(aud->algo)); + switch (aud->type) { + case OSMO_AUTH_TYPE_GSM: + Phex(u.gsm.ki); + break; + case OSMO_AUTH_TYPE_UMTS: + Phex(u.umts.opc); + Pf(u.umts.opc_is_op, "%u"); + Phex(u.umts.k); + Phex(u.umts.amf); + if (aud->u.umts.sqn) { + Pf(u.umts.sqn, "%"PRIu64); + Pf(u.umts.sqn, "0x%"PRIx64); + } + if (aud->u.umts.ind_bitlen) + Pf(u.umts.ind_bitlen, "%u"); + break; + default: + OSMO_ASSERT(false); + } + + fprintf(stderr, "}\n"); + +#undef Pf +#undef Phex +} + +static const char *imsi0 = "123456789000000"; +static const char *imsi1 = "123456789000001"; +static const char *imsi2 = "123456789000002"; +static const char *short_imsi = "123456"; +static const char *unknown_imsi = "999999999"; + +static void test_subscr_create_update_sel_delete() +{ + int64_t id0, id1, id2, id_short; + comment_start(); + + comment("Create with valid / invalid IMSI"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + id0 = g_subscr.id; + ASSERT_RC(db_subscr_create(dbc, imsi1), 0); + ASSERT_SEL(imsi, imsi1, 0); + id1 = g_subscr.id; + ASSERT_RC(db_subscr_create(dbc, imsi2), 0); + ASSERT_SEL(imsi, imsi2, 0); + id2 = g_subscr.id; + ASSERT_RC(db_subscr_create(dbc, imsi0), -EIO); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_create(dbc, imsi1), -EIO); + ASSERT_RC(db_subscr_create(dbc, imsi1), -EIO); + ASSERT_SEL(imsi, imsi1, 0); + ASSERT_RC(db_subscr_create(dbc, imsi2), -EIO); + ASSERT_RC(db_subscr_create(dbc, imsi2), -EIO); + ASSERT_SEL(imsi, imsi2, 0); + + ASSERT_RC(db_subscr_create(dbc, "123456789 000003"), -EINVAL); + ASSERT_SEL(imsi, "123456789000003", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, "123456789000002123456"), -EINVAL); + ASSERT_SEL(imsi, "123456789000002123456", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, "foobar123"), -EINVAL); + ASSERT_SEL(imsi, "foobar123", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, "123"), -EINVAL); + ASSERT_SEL(imsi, "123", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, short_imsi), 0); + ASSERT_SEL(imsi, short_imsi, 0); + id_short = g_subscr.id; + + + comment("Set valid / invalid MSISDN"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321"), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "54321012345678912345678"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "543 21"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "foobar123"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "5"), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "543210123456789"), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "5432101234567891"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Set MSISDN on non-existent / invalid IMSI"); + + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99"), -ENOENT); + + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99"), -ENOENT); + + comment("Delete non-existent / invalid IDs"); + + ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); + ASSERT_RC(db_subscr_delete_by_id(dbc, -10), -ENOENT); + + comment("Delete subscribers"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id0), 0); + ASSERT_SEL(imsi, imsi0, -ENOEXEC); + ASSERT_RC(db_subscr_delete_by_id(dbc, id0), -ENOENT); + + ASSERT_SEL(imsi, imsi1, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id1), 0); + ASSERT_SEL(imsi, imsi1, -ENOEXEC); + + ASSERT_SEL(imsi, imsi2, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id2), 0); + ASSERT_SEL(imsi, imsi2, -ENOEXEC); + + ASSERT_SEL(imsi, short_imsi, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id_short), 0); + ASSERT_SEL(imsi, short_imsi, -ENOEXEC); + + comment_end(); +} + +static struct { + bool verbose; +} cmdline_opts = { + .verbose = false, +}; + +static void print_help(const char *program) +{ + printf("Usage:\n" + " %s [-v] [N [N...]]\n" + "Options:\n" + " -h --help show this text.\n" + " -v --verbose print source file and line numbers\n", + program + ); +} + +static void handle_options(int argc, char **argv) +{ + while (1) { + int option_index = 0, c; + static struct option long_options[] = { + {"help", 0, 0, 'h'}, + {"verbose", 1, 0, 'v'}, + {0, 0, 0, 0} + }; + + c = getopt_long(argc, argv, "hv", + long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_help(argv[0]); + exit(0); + case 'v': + cmdline_opts.verbose = true; + break; + default: + /* catch unknown options *as well as* missing arguments. */ + fprintf(stderr, "Error in command line options. Exiting.\n"); + exit(-1); + break; + } + } + + if (optind < argc) { + fprintf(stderr, "too many args\n"); + exit(-1); + } +} + +int main(int argc, char **argv) +{ + printf("db_test.c\n"); + + ctx = talloc_named_const(NULL, 1, "db_test"); + + handle_options(argc, argv); + + osmo_init_logging(&hlr_log_info); + log_set_print_filename(osmo_stderr_target, cmdline_opts.verbose); + log_set_print_timestamp(osmo_stderr_target, 0); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_category(osmo_stderr_target, 1); + + /* omit the SQLite version and compilation flags from test output */ + log_set_log_level(osmo_stderr_target, LOGL_ERROR); + dbc = db_open(ctx, "db_test.db"); + log_set_log_level(osmo_stderr_target, 0); + OSMO_ASSERT(dbc); + + test_subscr_create_update_sel_delete(); + + printf("Done\n"); + return 0; +} + +/* stubs */ +int auc_compute_vectors(struct osmo_auth_vector *vec, unsigned int num_vec, + struct osmo_sub_auth_data *aud2g, + struct osmo_sub_auth_data *aud3g, + const uint8_t *rand_auts, const uint8_t *auts) +{ OSMO_ASSERT(false); return -1; } diff --git a/tests/db/db_test.err b/tests/db/db_test.err new file mode 100644 index 0000000..ac0e2f1 --- /dev/null +++ b/tests/db/db_test.err @@ -0,0 +1,251 @@ + +===== test_subscr_create_update_sel_delete + +--- Create with valid / invalid IMSI + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_create(dbc, imsi1) --> 0 + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 2, + .imsi = '123456789000001', +} + +db_subscr_create(dbc, imsi2) --> 0 + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 3, + .imsi = '123456789000002', +} + +db_subscr_create(dbc, imsi0) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000000': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_create(dbc, imsi1) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_create(dbc, imsi1) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 2, + .imsi = '123456789000001', +} + +db_subscr_create(dbc, imsi2) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_create(dbc, imsi2) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 3, + .imsi = '123456789000002', +} + +db_subscr_create(dbc, "123456789 000003") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: '123456789 000003' + +db_subscr_get_by_imsi(dbc, "123456789000003", &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000003': Error executing SQL: 101 + +db_subscr_create(dbc, "123456789000002123456") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: '123456789000002123456' + +db_subscr_get_by_imsi(dbc, "123456789000002123456", &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000002123456': Error executing SQL: 101 + +db_subscr_create(dbc, "foobar123") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: 'foobar123' + +db_subscr_get_by_imsi(dbc, "foobar123", &g_subscr) --> -ENOEXEC +DAUC IMSI='foobar123': Error executing SQL: 101 + +db_subscr_create(dbc, "123") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: '123' + +db_subscr_get_by_imsi(dbc, "123", &g_subscr) --> -ENOEXEC +DAUC IMSI='123': Error executing SQL: 101 + +db_subscr_create(dbc, short_imsi) --> 0 + +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 4, + .imsi = '123456', +} + + +--- Set valid / invalid MSISDN + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321") --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321012345678912345678") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '54321012345678912345678' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543 21") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '543 21' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "foobar123") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: 'foobar123' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5") --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '5', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543210123456789") --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5432101234567891") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '5432101234567891' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Set MSISDN on non-existent / invalid IMSI + +db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99") --> -ENOENT +DAUC Cannot update MSISDN: no such subscriber: IMSI='999999999' + +db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99") --> -ENOENT +DAUC Cannot update MSISDN: no such subscriber: IMSI='foobar' + + +--- Delete non-existent / invalid IDs + +db_subscr_delete_by_id(dbc, 999) --> -ENOENT +DAUC Cannot delete: no such subscriber: ID=999 + +db_subscr_delete_by_id(dbc, -10) --> -ENOENT +DAUC Cannot delete: no such subscriber: ID=-10 + + +--- Delete subscribers + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_delete_by_id(dbc, id0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000000': Error executing SQL: 101 + +db_subscr_delete_by_id(dbc, id0) --> -ENOENT +DAUC Cannot delete: no such subscriber: ID=1 + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 2, + .imsi = '123456789000001', +} + +db_subscr_delete_by_id(dbc, id1) --> 0 + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000001': Error executing SQL: 101 + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 3, + .imsi = '123456789000002', +} + +db_subscr_delete_by_id(dbc, id2) --> 0 + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000002': Error executing SQL: 101 + +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 4, + .imsi = '123456', +} + +db_subscr_delete_by_id(dbc, id_short) --> 0 + +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456': Error executing SQL: 101 + +===== test_subscr_create_update_sel_delete: SUCCESS + diff --git a/tests/db/db_test.ok b/tests/db/db_test.ok new file mode 100644 index 0000000..26cefd1 --- /dev/null +++ b/tests/db/db_test.ok @@ -0,0 +1,2 @@ +db_test.c +Done diff --git a/tests/testsuite.at b/tests/testsuite.at index a969082..74179e7 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -21,3 +21,11 @@ cat $abs_srcdir/gsup_server/gsup_server_test.err > experr AT_CHECK([$abs_top_builddir/tests/gsup_server/gsup_server_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([db]) +AT_KEYWORDS([db]) +cat $abs_srcdir/db/db_test.ok > expout +cat $abs_srcdir/db/db_test.err > experr +sqlite3 db_test.db < $abs_top_srcdir/sql/hlr.sql +AT_CHECK([$abs_top_builddir/tests/db/db_test], [], [expout], [experr]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2a0d277f55162bf5ceb0fc7d50390f2994daed71 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:31:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:31:59 +0000 Subject: [PATCH] osmo-hlr[master]: less noise: simplify db_remove_reset() Message-ID: Review at https://gerrit.osmocom.org/4179 less noise: simplify db_remove_reset() db_remove_reset() needs to be called after each stmt run, whether it succeeded or not. In case sqlite3_clear_bindings() would fail to unbind a stmt, we would anyway be beyond recovery. There seem to be no plausible situations where such failure would occur, unless there have been no bindings in the first place. In case there was an SQL stmt failure, sqlite3_reset() will re-barf the same error message, we will always have logged it earlier already in the proper context. We are never evaluating the return value, nor would we know how to recover from non-success. The conclusions: - db_remove_reset() does not need to log any errors. - db_remove_reset() does not need to return success. Change-Id: I21678463e59f607f5f5c5732963e274392f0fffd --- M src/db.c M src/db.h M tests/db/db_test.err 3 files changed, 4 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/4179/1 diff --git a/src/db.c b/src/db.c index 57362ac..6104fe6 100644 --- a/src/db.c +++ b/src/db.c @@ -69,20 +69,10 @@ } /* remove bindings and reset statement to be re-executed */ -bool db_remove_reset(sqlite3_stmt *stmt) +void db_remove_reset(sqlite3_stmt *stmt) { - int rc = sqlite3_clear_bindings(stmt); - if (rc != SQLITE_OK) { - LOGP(DDB, LOGL_ERROR, "Error clerearing bindings: %d\n", rc); - return false; - } - - rc = sqlite3_reset(stmt); - if (rc != SQLITE_OK) { - LOGP(DDB, LOGL_ERROR, "Error in sqlite3_reset: %d\n", rc); - return false; - } - return true; + sqlite3_clear_bindings(stmt); + sqlite3_reset(stmt); } /** bind text arg and do proper cleanup in case of failure. If param_name is diff --git a/src/db.h b/src/db.h index d7a8303..ee2d801 100644 --- a/src/db.h +++ b/src/db.h @@ -25,7 +25,7 @@ sqlite3_stmt *stmt[_NUM_DB_STMT]; }; -bool db_remove_reset(sqlite3_stmt *stmt); +void db_remove_reset(sqlite3_stmt *stmt); bool db_bind_text(sqlite3_stmt *stmt, const char *param_name, const char *text); bool db_bind_int(sqlite3_stmt *stmt, const char *param_name, int nr); bool db_bind_int64(sqlite3_stmt *stmt, const char *param_name, int64_t nr); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index ac0e2f1..1b08cec 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -29,7 +29,6 @@ db_subscr_create(dbc, imsi0) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000000': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 @@ -40,12 +39,10 @@ db_subscr_create(dbc, imsi1) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_create(dbc, imsi1) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 @@ -56,12 +53,10 @@ db_subscr_create(dbc, imsi2) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_create(dbc, imsi2) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 -- To view, visit https://gerrit.osmocom.org/4179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I21678463e59f607f5f5c5732963e274392f0fffd Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:31:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:31:59 +0000 Subject: [PATCH] osmo-hlr[master]: db: use int64_t as subscriber id Message-ID: Review at https://gerrit.osmocom.org/4180 db: use int64_t as subscriber id The SQLite db does not support uint64_t, and we are always binding the uint64_t id actually as signed int64_t. Hence be consistent and actually handle it as int64_t in the code as well. This means that if we ever see a negative subscriber ID in the SQL database (however unlikely), we will also see it negative in our log output. The SQN handled in osmo_auth* is actually of unsigned type, and, unless we store the SQN as 64bit hex string, we are forced to feed this unsigned value as signed int64_t to the SQLite API. The upcoming db regression test for SQN in change-id I0d870d405e2e0a830360d9ad19f0a3f9e09d8cf2 verifies that the SQN uint64_t translates to signed int64_t and back as expected. Change-Id: I83a47289a48ac37da0f712845d422e897a5e8171 --- M src/db.h M src/db_auc.c 2 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/80/4180/1 diff --git a/src/db.h b/src/db.h index ee2d801..761d88e 100644 --- a/src/db.h +++ b/src/db.h @@ -38,9 +38,9 @@ int db_get_auth_data(struct db_context *dbc, const char *imsi, struct osmo_sub_auth_data *aud2g, struct osmo_sub_auth_data *aud3g, - uint64_t *suscr_id); + int64_t *subscr_id); -int db_update_sqn(struct db_context *dbc, uint64_t id, +int db_update_sqn(struct db_context *dbc, int64_t id, uint64_t new_sqn); int db_get_auc(struct db_context *dbc, const char *imsi, @@ -57,7 +57,7 @@ struct hlr_subscriber { struct llist_head list; - uint64_t id; + int64_t id; char imsi[GSM23003_IMSI_MAX_DIGITS+1]; char msisdn[GT_MAX_DIGITS+1]; /* imeisv? */ diff --git a/src/db_auc.c b/src/db_auc.c index 7aad06d..71c7262 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -33,7 +33,7 @@ #define LOGAUC(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) /* update the SQN for a given subscriber ID */ -int db_update_sqn(struct db_context *dbc, uint64_t id, +int db_update_sqn(struct db_context *dbc, int64_t id, uint64_t new_sqn) { sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_UPD_SQN]; @@ -77,7 +77,7 @@ int db_get_auth_data(struct db_context *dbc, const char *imsi, struct osmo_sub_auth_data *aud2g, struct osmo_sub_auth_data *aud3g, - uint64_t *subscr_id) + int64_t *subscr_id) { sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_BY_IMSI]; int ret = 0; @@ -192,7 +192,7 @@ const uint8_t *auts) { struct osmo_sub_auth_data aud2g, aud3g; - uint64_t subscr_id; + int64_t subscr_id; int ret = 0; int rc; -- To view, visit https://gerrit.osmocom.org/4180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83a47289a48ac37da0f712845d422e897a5e8171 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:32:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:32:00 +0000 Subject: [PATCH] osmo-hlr[master]: add db_subscr_get_by_msisdn() and db_subscr_get_by_id() Message-ID: Review at https://gerrit.osmocom.org/4181 add db_subscr_get_by_msisdn() and db_subscr_get_by_id() Factor out the selected SQL columns as SEL_COLUMNS macro, so that each of the new DB_STMTs will select identical columns: the old DB_STMT_SEL_BY_IMSI as well as the new DB_STMT_SEL_BY_MSISDN and DB_STMT_SEL_BY_ID. Add the new functions db_subscr_get_by_msisdn() and db_subscr_get_by_id() and factor out common parts with db_subscr_get_by_imsi() to static db_sel(). Change-Id: I6d0ddd1b7e3f6b180b4b1b2663c5725d2a4a9428 --- M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 5 files changed, 185 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/81/4181/1 diff --git a/src/db.c b/src/db.c index 6104fe6..269ea56 100644 --- a/src/db.c +++ b/src/db.c @@ -25,8 +25,25 @@ #include "logging.h" #include "db.h" +#define SEL_COLUMNS \ + "id," \ + "imsi," \ + "msisdn," \ + "vlr_number," \ + "sgsn_number," \ + "sgsn_address," \ + "periodic_lu_tmr," \ + "periodic_rau_tau_tmr," \ + "nam_cs," \ + "nam_ps," \ + "lmsi," \ + "ms_purged_cs," \ + "ms_purged_ps" + static const char *stmt_sql[] = { - [DB_STMT_SEL_BY_IMSI] = "SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?", + [DB_STMT_SEL_BY_IMSI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE imsi = ?", + [DB_STMT_SEL_BY_MSISDN] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE msisdn = ?", + [DB_STMT_SEL_BY_ID] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE id = ?", [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", [DB_STMT_AUC_BY_IMSI] = diff --git a/src/db.h b/src/db.h index 761d88e..5ec7b72 100644 --- a/src/db.h +++ b/src/db.h @@ -5,6 +5,8 @@ enum stmt_idx { DB_STMT_SEL_BY_IMSI, + DB_STMT_SEL_BY_MSISDN, + DB_STMT_SEL_BY_ID, DB_STMT_UPD_VLR_BY_ID, DB_STMT_UPD_SGSN_BY_ID, DB_STMT_AUC_BY_IMSI, @@ -84,6 +86,10 @@ int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr); +int db_subscr_get_by_msisdn(struct db_context *dbc, const char *msisdn, + struct hlr_subscriber *subscr); +int db_subscr_get_by_id(struct db_context *dbc, int64_t id, + struct hlr_subscriber *subscr); int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable); int db_subscr_lu(struct db_context *dbc, const struct hlr_subscriber *subscr, diff --git a/src/db_hlr.c b/src/db_hlr.c index 8d2fc1c..eac52e0 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -153,27 +153,26 @@ } -int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, - struct hlr_subscriber *subscr) +/* Common code for db_subscr_get_by_*() functions. */ +static int db_sel(struct db_context *dbc, sqlite3_stmt *stmt, struct hlr_subscriber *subscr, + const char **err) { - sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; int rc; - - if (!db_bind_text(stmt, NULL, imsi)) - return -EINVAL; + int ret = 0; /* execute the statement */ rc = sqlite3_step(stmt); + if (rc == SQLITE_DONE) { + ret = -ENOENT; + goto out; + } if (rc != SQLITE_ROW) { - LOGHLR(imsi, LOGL_ERROR, "Error executing SQL: %d\n", rc); - db_remove_reset(stmt); - return -ENOEXEC; + ret = -EIO; + goto out; } - if (!subscr) { - db_remove_reset(stmt); - return 0; - } + if (!subscr) + goto out; /* obtain the various columns */ subscr->id = sqlite3_column_int64(stmt, 0); @@ -191,9 +190,72 @@ subscr->ms_purged_cs = sqlite3_column_int(stmt, 11); subscr->ms_purged_ps = sqlite3_column_int(stmt, 12); +out: db_remove_reset(stmt); - return 0; + switch (ret) { + case 0: + *err = NULL; + break; + case -ENOENT: + *err = "No such subscriber"; + break; + default: + *err = sqlite3_errmsg(dbc->db); + break; + } + return ret; +} + +int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, + struct hlr_subscriber *subscr) +{ + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; + const char *err; + int rc; + + if (!db_bind_text(stmt, NULL, imsi)) + return -EIO; + + rc = db_sel(dbc, stmt, subscr, &err); + if (rc) + LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: IMSI='%s': %s\n", + imsi, err); + return rc; +} + +int db_subscr_get_by_msisdn(struct db_context *dbc, const char *msisdn, + struct hlr_subscriber *subscr) +{ + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_MSISDN]; + const char *err; + int rc; + + if (!db_bind_text(stmt, NULL, msisdn)) + return -EIO; + + rc = db_sel(dbc, stmt, subscr, &err); + if (rc) + LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: MSISDN='%s': %s\n", + msisdn, err); + return rc; +} + +int db_subscr_get_by_id(struct db_context *dbc, int64_t id, + struct hlr_subscriber *subscr) +{ + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_ID]; + const char *err; + int rc; + + if (!db_bind_int64(stmt, NULL, id)) + return -EIO; + + rc = db_sel(dbc, stmt, subscr, &err); + if (rc) + LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: ID=%"PRId64": %s\n", + id, err); + return rc; } int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable) diff --git a/tests/db/db_test.c b/tests/db/db_test.c index e8cfe75..57b7b05 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -70,6 +70,7 @@ static void *ctx = NULL; static struct hlr_subscriber g_subscr; static int g_rc; +static int64_t g_id; #define Pfv(name, fmt, val) \ fprintf(stderr, " ." #name " = " fmt ",\n", val) @@ -187,16 +188,16 @@ ASSERT_SEL(imsi, imsi2, 0); ASSERT_RC(db_subscr_create(dbc, "123456789 000003"), -EINVAL); - ASSERT_SEL(imsi, "123456789000003", -ENOEXEC); + ASSERT_SEL(imsi, "123456789000003", -ENOENT); ASSERT_RC(db_subscr_create(dbc, "123456789000002123456"), -EINVAL); - ASSERT_SEL(imsi, "123456789000002123456", -ENOEXEC); + ASSERT_SEL(imsi, "123456789000002123456", -ENOENT); ASSERT_RC(db_subscr_create(dbc, "foobar123"), -EINVAL); - ASSERT_SEL(imsi, "foobar123", -ENOEXEC); + ASSERT_SEL(imsi, "foobar123", -ENOENT); ASSERT_RC(db_subscr_create(dbc, "123"), -EINVAL); - ASSERT_SEL(imsi, "123", -ENOEXEC); + ASSERT_SEL(imsi, "123", -ENOENT); ASSERT_RC(db_subscr_create(dbc, short_imsi), 0); ASSERT_SEL(imsi, short_imsi, 0); @@ -208,30 +209,41 @@ ASSERT_SEL(imsi, imsi0, 0); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321"), 0); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "54321", 0); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321012345678912345678"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "54321", 0); + ASSERT_SEL(msisdn, "54321012345678912345678", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543 21"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "543 21", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "foobar123"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "foobar123", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5"), 0); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "5", 0); + ASSERT_SEL(msisdn, "54321", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543210123456789"), 0); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "543210123456789", 0); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5432101234567891"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "5432101234567891", -ENOENT); comment("Set MSISDN on non-existent / invalid IMSI"); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99"), -ENOENT); + ASSERT_SEL(msisdn, "99", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99"), -ENOENT); + ASSERT_SEL(msisdn, "99", -ENOENT); comment("Delete non-existent / invalid IDs"); @@ -242,20 +254,20 @@ ASSERT_SEL(imsi, imsi0, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id0), 0); - ASSERT_SEL(imsi, imsi0, -ENOEXEC); + ASSERT_SEL(imsi, imsi0, -ENOENT); ASSERT_RC(db_subscr_delete_by_id(dbc, id0), -ENOENT); ASSERT_SEL(imsi, imsi1, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id1), 0); - ASSERT_SEL(imsi, imsi1, -ENOEXEC); + ASSERT_SEL(imsi, imsi1, -ENOENT); ASSERT_SEL(imsi, imsi2, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id2), 0); - ASSERT_SEL(imsi, imsi2, -ENOEXEC); + ASSERT_SEL(imsi, imsi2, -ENOENT); ASSERT_SEL(imsi, short_imsi, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id_short), 0); - ASSERT_SEL(imsi, short_imsi, -ENOEXEC); + ASSERT_SEL(imsi, short_imsi, -ENOENT); comment_end(); } diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 1b08cec..17323b5 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -68,26 +68,26 @@ db_subscr_create(dbc, "123456789 000003") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123456789 000003' -db_subscr_get_by_imsi(dbc, "123456789000003", &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000003': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "123456789000003", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000003': No such subscriber db_subscr_create(dbc, "123456789000002123456") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123456789000002123456' -db_subscr_get_by_imsi(dbc, "123456789000002123456", &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000002123456': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "123456789000002123456", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000002123456': No such subscriber db_subscr_create(dbc, "foobar123") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: 'foobar123' -db_subscr_get_by_imsi(dbc, "foobar123", &g_subscr) --> -ENOEXEC -DAUC IMSI='foobar123': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "foobar123", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='foobar123': No such subscriber db_subscr_create(dbc, "123") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123' -db_subscr_get_by_imsi(dbc, "123", &g_subscr) --> -ENOEXEC -DAUC IMSI='123': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "123", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123': No such subscriber db_subscr_create(dbc, short_imsi) --> 0 @@ -115,6 +115,13 @@ .msisdn = '54321', } +db_subscr_get_by_msisdn(dbc, "54321", &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321012345678912345678") --> -EINVAL DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '54321012345678912345678' @@ -124,6 +131,16 @@ .imsi = '123456789000000', .msisdn = '54321', } + +db_subscr_get_by_msisdn(dbc, "54321", &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_get_by_msisdn(dbc, "54321012345678912345678", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='54321012345678912345678': No such subscriber db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543 21") --> -EINVAL DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '543 21' @@ -135,6 +152,9 @@ .msisdn = '54321', } +db_subscr_get_by_msisdn(dbc, "543 21", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='543 21': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "foobar123") --> -EINVAL DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: 'foobar123' @@ -145,6 +165,9 @@ .msisdn = '54321', } +db_subscr_get_by_msisdn(dbc, "foobar123", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='foobar123': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5") --> 0 db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 @@ -154,9 +177,26 @@ .msisdn = '5', } +db_subscr_get_by_msisdn(dbc, "5", &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '5', +} + +db_subscr_get_by_msisdn(dbc, "54321", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='54321': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543210123456789") --> 0 db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_get_by_msisdn(dbc, "543210123456789", &g_subscr) --> 0 struct hlr_subscriber { .id = 1, .imsi = '123456789000000', @@ -173,14 +213,23 @@ .msisdn = '543210123456789', } +db_subscr_get_by_msisdn(dbc, "5432101234567891", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='5432101234567891': No such subscriber + --- Set MSISDN on non-existent / invalid IMSI db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99") --> -ENOENT DAUC Cannot update MSISDN: no such subscriber: IMSI='999999999' +db_subscr_get_by_msisdn(dbc, "99", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='99': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99") --> -ENOENT DAUC Cannot update MSISDN: no such subscriber: IMSI='foobar' + +db_subscr_get_by_msisdn(dbc, "99", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='99': No such subscriber --- Delete non-existent / invalid IDs @@ -203,8 +252,8 @@ db_subscr_delete_by_id(dbc, id0) --> 0 -db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000000': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber db_subscr_delete_by_id(dbc, id0) --> -ENOENT DAUC Cannot delete: no such subscriber: ID=1 @@ -217,8 +266,8 @@ db_subscr_delete_by_id(dbc, id1) --> 0 -db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000001': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000001': No such subscriber db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 struct hlr_subscriber { @@ -228,8 +277,8 @@ db_subscr_delete_by_id(dbc, id2) --> 0 -db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000002': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000002': No such subscriber db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> 0 struct hlr_subscriber { @@ -239,8 +288,8 @@ db_subscr_delete_by_id(dbc, id_short) --> 0 -db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456': No such subscriber ===== test_subscr_create_update_sel_delete: SUCCESS -- To view, visit https://gerrit.osmocom.org/4181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6d0ddd1b7e3f6b180b4b1b2663c5725d2a4a9428 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:32:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:32:00 +0000 Subject: [PATCH] osmo-hlr[master]: refactor db_subscr_ps() to db_subscr_nam() Message-ID: Review at https://gerrit.osmocom.org/4182 refactor db_subscr_ps() to db_subscr_nam() Allow to set nam_ps and nam_cs from this same function, by adding the is_ps arg. Combine both NAM_PS stmts to DB_STMT_UPD_NAM_PS_BY_IMSI, add another such stmt for CS. Use named parameters instead of parameter indexes. Improve error return values as well as error logging to clearly indicate whether the operation could not find the requested IMSI, or other errors occured. Adjust the single caller. This prepares for upcoming VTY and possibly CTRL commands, and the error handling introduced here has been or will be adopted by other functions in previous or subsequent patches. Change-Id: I6e70e15228f5bb10bee6758ae5dc9687d65839bd --- M src/ctrl.c M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 6 files changed, 230 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/82/4182/1 diff --git a/src/ctrl.c b/src/ctrl.c index b034cd7..8682e14 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -43,7 +43,7 @@ return CTRL_CMD_ERROR; } - if (db_subscr_ps(ctx->dbc, cmd->value, enable) < 0) { + if (db_subscr_nam(ctx->dbc, cmd->value, enable, true) < 0) { cmd->reply = "Error updating DB"; return CTRL_CMD_ERROR; } diff --git a/src/db.c b/src/db.c index 269ea56..38d9760 100644 --- a/src/db.c +++ b/src/db.c @@ -55,8 +55,8 @@ [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", - [DB_STMT_SET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=1 WHERE imsi = ?", - [DB_STMT_UNSET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=0 WHERE imsi = ?", + [DB_STMT_UPD_NAM_CS_BY_IMSI] = "UPDATE subscriber SET nam_cs = $val WHERE imsi = $imsi", + [DB_STMT_UPD_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps = $val WHERE imsi = $imsi", [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id", [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi", diff --git a/src/db.h b/src/db.h index 5ec7b72..5e234ff 100644 --- a/src/db.h +++ b/src/db.h @@ -13,8 +13,8 @@ DB_STMT_AUC_UPD_SQN, DB_STMT_UPD_PURGE_CS_BY_IMSI, DB_STMT_UPD_PURGE_PS_BY_IMSI, - DB_STMT_SET_NAM_PS_BY_IMSI, - DB_STMT_UNSET_NAM_PS_BY_IMSI, + DB_STMT_UPD_NAM_PS_BY_IMSI, + DB_STMT_UPD_NAM_CS_BY_IMSI, DB_STMT_SUBSCR_CREATE, DB_STMT_DEL_BY_ID, DB_STMT_SET_MSISDN_BY_IMSI, @@ -90,7 +90,7 @@ struct hlr_subscriber *subscr); int db_subscr_get_by_id(struct db_context *dbc, int64_t id, struct hlr_subscriber *subscr); -int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable); +int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps); int db_subscr_lu(struct db_context *dbc, const struct hlr_subscriber *subscr, const char *vlr_or_sgsn_number, diff --git a/src/db_hlr.c b/src/db_hlr.c index eac52e0..e56d2ed 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -258,31 +258,58 @@ return rc; } -int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable) +/* Enable or disable PS or CS for a subscriber. + * For the subscriber with the given imsi, set nam_ps (when is_ps == true) or + * nam_cs (when is_ps == false) to nam_val in the database. + * Returns 0 on success, -ENOENT when the given IMSI does not exist, -EINVAL if + * the SQL statement could not be composed, -ENOEXEC if running the SQL + * statement failed, -EIO if the amount of rows modified is unexpected. + */ +int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps) { - sqlite3_stmt *stmt = - dbc->stmt[enable ? DB_STMT_SET_NAM_PS_BY_IMSI : DB_STMT_UNSET_NAM_PS_BY_IMSI]; + sqlite3_stmt *stmt; int rc; + int ret = 0; - if (!db_bind_text(stmt, NULL, imsi)) - return -EINVAL; + stmt = dbc->stmt[is_ps ? DB_STMT_UPD_NAM_PS_BY_IMSI + : DB_STMT_UPD_NAM_CS_BY_IMSI]; - rc = sqlite3_step(stmt); /* execute the statement */ + if (!db_bind_text(stmt, "$imsi", imsi)) + return -EIO; + if (!db_bind_int(stmt, "$val", nam_val ? 1 : 0)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGHLR(imsi, LOGL_ERROR, "Error executing SQL: %d\n", rc); - db_remove_reset(stmt); - return -ENOEXEC; + LOGHLR(imsi, LOGL_ERROR, "%s %s: SQL error: %s\n", + nam_val ? "enable" : "disable", + is_ps ? "PS" : "CS", + sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } - rc = sqlite3_changes(dbc->db); /* verify execution result */ - if (rc != 1) { - LOGHLR(imsi, LOGL_ERROR, "SQL modified %d rows (expected 1)\n", + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot %s %s: no such subscriber: IMSI='%s'\n", + nam_val ? "enable" : "disable", + is_ps ? "PS" : "CS", + imsi); + ret = -ENOENT; + goto out; + } else if (rc != 1) { + LOGHLR(imsi, LOGL_ERROR, "%s %s: SQL modified %d rows (expected 1)\n", + nam_val ? "enable" : "disable", + is_ps ? "PS" : "CS", rc); - rc = -EINVAL; + ret = -EIO; } +out: db_remove_reset(stmt); - return rc; + return ret; } int db_subscr_lu(struct db_context *dbc, diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 57b7b05..c0ccb63 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -245,6 +245,45 @@ ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99"), -ENOENT); ASSERT_SEL(msisdn, "99", -ENOENT); + comment("Set / unset nam_cs and nam_ps"); + + /* nam_val, is_ps */ + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Set / unset nam_cs and nam_ps *again*"); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Set nam_cs and nam_ps on non-existent / invalid IMSI"); + + ASSERT_RC(db_subscr_nam(dbc, unknown_imsi, false, true), -ENOENT); + ASSERT_RC(db_subscr_nam(dbc, unknown_imsi, false, false), -ENOENT); + ASSERT_SEL(imsi, unknown_imsi, -ENOENT); + + ASSERT_RC(db_subscr_nam(dbc, "foobar", false, true), -ENOENT); + ASSERT_RC(db_subscr_nam(dbc, "foobar", false, false), -ENOENT); + comment("Delete non-existent / invalid IDs"); ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 17323b5..f7c03d9 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -232,6 +232,150 @@ DAUC Cannot read subscriber from db: MSISDN='99': No such subscriber +--- Set / unset nam_cs and nam_ps + +db_subscr_nam(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Set / unset nam_cs and nam_ps *again* + +db_subscr_nam(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, +} + +db_subscr_nam(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, +} + +db_subscr_nam(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_nam(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Set nam_cs and nam_ps on non-existent / invalid IMSI + +db_subscr_nam(dbc, unknown_imsi, false, true) --> -ENOENT +DAUC Cannot disable PS: no such subscriber: IMSI='999999999' + +db_subscr_nam(dbc, unknown_imsi, false, false) --> -ENOENT +DAUC Cannot disable CS: no such subscriber: IMSI='999999999' + +db_subscr_get_by_imsi(dbc, unknown_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='999999999': No such subscriber + +db_subscr_nam(dbc, "foobar", false, true) --> -ENOENT +DAUC Cannot disable PS: no such subscriber: IMSI='foobar' + +db_subscr_nam(dbc, "foobar", false, false) --> -ENOENT +DAUC Cannot disable CS: no such subscriber: IMSI='foobar' + + --- Delete non-existent / invalid IDs db_subscr_delete_by_id(dbc, 999) --> -ENOENT -- To view, visit https://gerrit.osmocom.org/4182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e70e15228f5bb10bee6758ae5dc9687d65839bd Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:32:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:32:00 +0000 Subject: [PATCH] osmo-hlr[master]: refactor db_subscr_lu() Message-ID: Review at https://gerrit.osmocom.org/4183 refactor db_subscr_lu() Use named parameters in the SQL statement. Use db_bind_* functions to drop some code dup. Use explicit subscriber id arg instead of subscriber struct. Match return values and error logging to other db functions. Change-Id: I35665e84ddbe54a6f218b24033df969ad2e669a0 --- M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 5 files changed, 206 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/83/4183/1 diff --git a/src/db.c b/src/db.c index 38d9760..6e2cb9f 100644 --- a/src/db.c +++ b/src/db.c @@ -44,8 +44,8 @@ [DB_STMT_SEL_BY_IMSI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE imsi = ?", [DB_STMT_SEL_BY_MSISDN] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE msisdn = ?", [DB_STMT_SEL_BY_ID] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE id = ?", - [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", - [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", + [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = $number WHERE id = $subscriber_id", + [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = $number WHERE id = $subscriber_id", [DB_STMT_AUC_BY_IMSI] = "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, ind_bitlen" " FROM subscriber" diff --git a/src/db.h b/src/db.h index 5e234ff..9d4274d 100644 --- a/src/db.h +++ b/src/db.h @@ -91,10 +91,8 @@ int db_subscr_get_by_id(struct db_context *dbc, int64_t id, struct hlr_subscriber *subscr); int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps); -int db_subscr_lu(struct db_context *dbc, - const struct hlr_subscriber *subscr, - const char *vlr_or_sgsn_number, - bool lu_is_ps); +int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, + const char *vlr_or_sgsn_number, bool is_ps); int db_subscr_purge(struct db_context *dbc, const char *imsi, bool is_ps); diff --git a/src/db_hlr.c b/src/db_hlr.c index e56d2ed..5212218 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -312,44 +312,46 @@ return ret; } -int db_subscr_lu(struct db_context *dbc, - const struct hlr_subscriber *subscr, - const char *vlr_or_sgsn_number, bool lu_is_ps) +int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, + const char *vlr_or_sgsn_number, bool is_ps) { - sqlite3_stmt *stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; - const char *txt; + sqlite3_stmt *stmt; int rc, ret = 0; - if (lu_is_ps) { - stmt = dbc->stmt[DB_STMT_UPD_SGSN_BY_ID]; - txt = subscr->sgsn_number; - } else { - stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; - txt = subscr->vlr_number; - } + stmt = dbc->stmt[is_ps ? DB_STMT_UPD_SGSN_BY_ID + : DB_STMT_UPD_VLR_BY_ID]; - rc = sqlite3_bind_int64(stmt, 1, subscr->id); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding ID: %d\n", rc); - return -EINVAL; - } + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; - rc = sqlite3_bind_text(stmt, 2, txt, -1, SQLITE_STATIC); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding VLR/SGSN Number: %d\n", rc); - ret = -EBADMSG; - goto out; - } + if (!db_bind_text(stmt, "$number", vlr_or_sgsn_number)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGP(DAUC, LOGL_ERROR, "Error updating SQN: %d\n", rc); - ret = -ENOEXEC; + LOGP(DAUC, LOGL_ERROR, "Update %s number for subscriber ID=%"PRId64": SQL Error: %s\n", + is_ps? "SGSN" : "VLR", subscr_id, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } + + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot update %s number for subscriber ID=%"PRId64 + ": no such subscriber\n", + is_ps? "SGSN" : "VLR", subscr_id); + ret = -ENOENT; + } else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Update %s number for subscriber ID=%"PRId64 + ": SQL modified %d rows (expected 1)\n", + is_ps? "SGSN" : "VLR", subscr_id, rc); + ret = -EIO; + } + out: db_remove_reset(stmt); - return ret; } diff --git a/tests/db/db_test.c b/tests/db/db_test.c index c0ccb63..deda82e 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -284,6 +284,43 @@ ASSERT_RC(db_subscr_nam(dbc, "foobar", false, true), -ENOENT); ASSERT_RC(db_subscr_nam(dbc, "foobar", false, false), -ENOENT); + comment("Record LU for PS and CS (SGSN and VLR names)"); + + ASSERT_RC(db_subscr_lu(dbc, id0, "5952", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "712", false), 0); + ASSERT_SEL(id, id0, 0); + + comment("Record LU for PS and CS (SGSN and VLR names) *again*"); + + ASSERT_RC(db_subscr_lu(dbc, id0, "111", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "111", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "222", false), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "222", false), 0); + ASSERT_SEL(id, id0, 0); + + comment("Unset LU info for PS and CS (SGSN and VLR names)"); + ASSERT_RC(db_subscr_lu(dbc, id0, "", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "", false), 0); + ASSERT_SEL(id, id0, 0); + + ASSERT_RC(db_subscr_lu(dbc, id0, "111", true), 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "222", false), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, NULL, true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, NULL, false), 0); + ASSERT_SEL(id, id0, 0); + + comment("Record LU for non-existent ID"); + ASSERT_RC(db_subscr_lu(dbc, 99999, "5952", true), -ENOENT); + ASSERT_RC(db_subscr_lu(dbc, 99999, "712", false), -ENOENT); + ASSERT_SEL(id, 99999, -ENOENT); + comment("Delete non-existent / invalid IDs"); ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index f7c03d9..6e6a0ac 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -376,6 +376,143 @@ DAUC Cannot disable CS: no such subscriber: IMSI='foobar' +--- Record LU for PS and CS (SGSN and VLR names) + +db_subscr_lu(dbc, id0, "5952", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .sgsn_number = '5952', +} + +db_subscr_lu(dbc, id0, "712", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '712', + .sgsn_number = '5952', +} + + +--- Record LU for PS and CS (SGSN and VLR names) *again* + +db_subscr_lu(dbc, id0, "111", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '712', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, "111", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '712', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, "222", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, "222", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', + .sgsn_number = '111', +} + + +--- Unset LU info for PS and CS (SGSN and VLR names) + +db_subscr_lu(dbc, id0, "", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', +} + +db_subscr_lu(dbc, id0, "", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_lu(dbc, id0, "111", true) --> 0 + +db_subscr_lu(dbc, id0, "222", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, NULL, true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', +} + +db_subscr_lu(dbc, id0, NULL, false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Record LU for non-existent ID + +db_subscr_lu(dbc, 99999, "5952", true) --> -ENOENT +DAUC Cannot update SGSN number for subscriber ID=99999: no such subscriber + +db_subscr_lu(dbc, 99999, "712", false) --> -ENOENT +DAUC Cannot update VLR number for subscriber ID=99999: no such subscriber + +db_subscr_get_by_id(dbc, 99999, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: ID=99999: No such subscriber + + --- Delete non-existent / invalid IDs db_subscr_delete_by_id(dbc, 999) --> -ENOENT -- To view, visit https://gerrit.osmocom.org/4183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I35665e84ddbe54a6f218b24033df969ad2e669a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:32:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:32:00 +0000 Subject: [PATCH] osmo-hlr[master]: refactor db_subscr_purge Message-ID: Review at https://gerrit.osmocom.org/4184 refactor db_subscr_purge Use named parameters in the SQL statements. Use db_bind_* functions to drop some code dup. Adopt error handling (rc and logging) to match the other db functions: return -ENOENT for unknown subscriber, -EIO for SQL failures. Change-Id: Iad49d29b90a708c6cf55bfb3bcc02d9e29001a15 --- M src/db.c M src/db.h M src/db_hlr.c M src/hlr.c M tests/db/db_test.c M tests/db/db_test.err 6 files changed, 214 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/84/4184/1 diff --git a/src/db.c b/src/db.c index 6e2cb9f..1bf856a 100644 --- a/src/db.c +++ b/src/db.c @@ -53,8 +53,8 @@ " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" " WHERE imsi = ?", [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", - [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", - [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", + [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs = $val WHERE imsi = $imsi", + [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps = $val WHERE imsi = $imsi", [DB_STMT_UPD_NAM_CS_BY_IMSI] = "UPDATE subscriber SET nam_cs = $val WHERE imsi = $imsi", [DB_STMT_UPD_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps = $val WHERE imsi = $imsi", [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", diff --git a/src/db.h b/src/db.h index 9d4274d..2e6cc9b 100644 --- a/src/db.h +++ b/src/db.h @@ -94,5 +94,5 @@ int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, const char *vlr_or_sgsn_number, bool is_ps); -int db_subscr_purge(struct db_context *dbc, - const char *imsi, bool is_ps); +int db_subscr_purge(struct db_context *dbc, const char *by_imsi, + bool purge_val, bool is_ps); diff --git a/src/db_hlr.c b/src/db_hlr.c index 5212218..194cd35 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -355,27 +355,49 @@ return ret; } -int db_subscr_purge(struct db_context *dbc, const char *imsi, bool is_ps) +int db_subscr_purge(struct db_context *dbc, const char *by_imsi, + bool purge_val, bool is_ps) { - sqlite3_stmt *stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; - int rc, ret = 1; + sqlite3_stmt *stmt; + int rc, ret = 0; - if (is_ps) - stmt = dbc->stmt[DB_STMT_UPD_PURGE_PS_BY_IMSI]; - else - stmt = dbc->stmt[DB_STMT_UPD_PURGE_CS_BY_IMSI]; + stmt = dbc->stmt[is_ps ? DB_STMT_UPD_PURGE_PS_BY_IMSI + : DB_STMT_UPD_PURGE_CS_BY_IMSI]; - if (!db_bind_text(stmt, NULL, imsi)) - return -EINVAL; + if (!db_bind_text(stmt, "$imsi", by_imsi)) + return -EIO; + if (!db_bind_int(stmt, "$val", purge_val ? 1 : 0)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGP(DAUC, LOGL_ERROR, "Error setting Purged: %d\n", rc); - ret = -ENOEXEC; + LOGP(DAUC, LOGL_ERROR, "%s %s: SQL error: %s\n", + purge_val ? "purge" : "un-purge", + is_ps ? "PS" : "CS", + sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } - /* FIXME: return 0 in case IMSI not known */ + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot %s %s: no such subscriber: IMSI='%s'\n", + purge_val ? "purge" : "un-purge", + is_ps ? "PS" : "CS", + by_imsi); + ret = -ENOENT; + goto out; + } else if (rc != 1) { + LOGHLR(by_imsi, LOGL_ERROR, "%s %s: SQL modified %d rows (expected 1)\n", + purge_val ? "purge" : "un-purge", + is_ps ? "PS" : "CS", + rc); + ret = -EIO; + } + +out: db_remove_reset(stmt); return ret; diff --git a/src/hlr.c b/src/hlr.c index 9e8b699..b32f709 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -221,7 +221,7 @@ * we have on record. Only update if yes */ /* Perform the actual update of the DB */ - rc = db_subscr_purge(g_hlr->dbc, gsup->imsi, is_ps); + rc = db_subscr_purge(g_hlr->dbc, gsup->imsi, true, is_ps); if (rc == 1) gsup_reply.message_type = OSMO_GSUP_MSGT_PURGE_MS_RESULT; diff --git a/tests/db/db_test.c b/tests/db/db_test.c index deda82e..493c235 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -321,6 +321,44 @@ ASSERT_RC(db_subscr_lu(dbc, 99999, "712", false), -ENOENT); ASSERT_SEL(id, 99999, -ENOENT); + comment("Purge and un-purge PS and CS"); + + /* purge_val, is_ps */ + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Purge PS and CS *again*"); + + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Purge on non-existent / invalid IMSI"); + + ASSERT_RC(db_subscr_purge(dbc, unknown_imsi, true, true), -ENOENT); + ASSERT_SEL(imsi, unknown_imsi, -ENOENT); + ASSERT_RC(db_subscr_purge(dbc, unknown_imsi, true, false), -ENOENT); + ASSERT_SEL(imsi, unknown_imsi, -ENOENT); + comment("Delete non-existent / invalid IDs"); ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 6e6a0ac..59b9ba1 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -513,6 +513,143 @@ DAUC Cannot read subscriber from db: ID=99999: No such subscriber +--- Purge and un-purge PS and CS + +db_subscr_purge(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_cs = true, + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Purge PS and CS *again* + +db_subscr_purge(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_purge(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_purge(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_cs = true, +} + +db_subscr_purge(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_cs = true, +} + +db_subscr_purge(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_purge(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Purge on non-existent / invalid IMSI + +db_subscr_purge(dbc, unknown_imsi, true, true) --> -ENOENT +DAUC Cannot purge PS: no such subscriber: IMSI='999999999' + +db_subscr_get_by_imsi(dbc, unknown_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='999999999': No such subscriber + +db_subscr_purge(dbc, unknown_imsi, true, false) --> -ENOENT +DAUC Cannot purge CS: no such subscriber: IMSI='999999999' + +db_subscr_get_by_imsi(dbc, unknown_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='999999999': No such subscriber + + --- Delete non-existent / invalid IDs db_subscr_delete_by_id(dbc, 999) --> -ENOENT -- To view, visit https://gerrit.osmocom.org/4184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad49d29b90a708c6cf55bfb3bcc02d9e29001a15 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:32:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:32:00 +0000 Subject: [PATCH] osmo-hlr[master]: add db_subscr_update_aud_by_id(), complete db_subscr_delete_... Message-ID: Review at https://gerrit.osmocom.org/4185 add db_subscr_update_aud_by_id(), complete db_subscr_delete_by_id() Add ability to add and remove auc_2g and auc_3g table rows with db_subscr_update_aud_by_id(). In db_subscr_delete_by_id(), make sure that when deleting a subscriber, also all auth data associated with that user ID is removed as well. A newly created subscriber must not obtain the same auth tokens just by getting the same id. Change-Id: Icb11b5e059fb920447a9aa414db1819a0c020529 --- M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 5 files changed, 1,004 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/85/4185/1 diff --git a/src/db.c b/src/db.c index 1bf856a..a04bbd7 100644 --- a/src/db.c +++ b/src/db.c @@ -60,6 +60,14 @@ [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id", [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi", + [DB_STMT_AUC_2G_INSERT] = + "INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki)" + " VALUES($subscriber_id, $algo_id_2g, $ki)", + [DB_STMT_AUC_2G_DELETE] = "DELETE FROM auc_2g WHERE subscriber_id = $subscriber_id", + [DB_STMT_AUC_3G_INSERT] = + "INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, op, opc, ind_bitlen)" + " VALUES($subscriber_id, $algo_id_3g, $k, $op, $opc, $ind_bitlen)", + [DB_STMT_AUC_3G_DELETE] = "DELETE FROM auc_3g WHERE subscriber_id = $subscriber_id", }; static void sql3_error_log_cb(void *arg, int err_code, const char *msg) diff --git a/src/db.h b/src/db.h index 2e6cc9b..f6aaa58 100644 --- a/src/db.h +++ b/src/db.h @@ -18,6 +18,10 @@ DB_STMT_SUBSCR_CREATE, DB_STMT_DEL_BY_ID, DB_STMT_SET_MSISDN_BY_IMSI, + DB_STMT_AUC_2G_INSERT, + DB_STMT_AUC_2G_DELETE, + DB_STMT_AUC_3G_INSERT, + DB_STMT_AUC_3G_DELETE, _NUM_DB_STMT }; @@ -78,11 +82,36 @@ bool ms_purged_ps; }; +/* Like struct osmo_sub_auth_data, but the keys are in hexdump representation. + * This is useful because SQLite requires them in hexdump format, and callers + * like the VTY and CTRL interface also have them available as hexdump to begin + * with. In the binary format, a VTY command would first need to hexparse, + * after which the db function would again hexdump, copying to separate + * buffers. The roundtrip can be saved by providing char* to begin with. */ +struct sub_auth_data_str { + enum osmo_sub_auth_type type; + enum osmo_auth_algo algo; + union { + struct { + const char *opc; + const char *k; + uint64_t sqn; + int opc_is_op; + unsigned int ind_bitlen; + } umts; + struct { + const char *ki; + } gsm; + } u; +}; + int db_subscr_create(struct db_context *dbc, const char *imsi); int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id); int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, const char *msisdn); +int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id, + const struct sub_auth_data_str *aud); int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr); diff --git a/src/db_hlr.c b/src/db_hlr.c index 194cd35..612de86 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -70,6 +70,7 @@ int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id) { int rc; + struct sub_auth_data_str aud; int ret = 0; sqlite3_stmt *stmt = dbc->stmt[DB_STMT_DEL_BY_ID]; @@ -98,10 +99,27 @@ ": SQL modified %d rows (expected 1)\n", subscr_id, rc); ret = -EIO; } - - /* FIXME: also remove authentication data from auc_2g and auc_3g */ - db_remove_reset(stmt); + + /* make sure to remove authentication data for this subscriber id, for + * both 2G and 3G. */ + + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_GSM, + .algo = OSMO_AUTH_ALG_NONE, + }; + rc = db_subscr_update_aud_by_id(dbc, subscr_id, &aud); + if (ret == -ENOENT && !rc) + ret = 0; + + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_NONE, + }; + rc = db_subscr_update_aud_by_id(dbc, subscr_id, &aud); + if (ret == -ENOENT && !rc) + ret = 0; + return ret; } @@ -153,6 +171,192 @@ } +/* Insert or update 2G or 3G authentication tokens in the database. + * If aud->type is OSMO_AUTH_TYPE_GSM, the auc_2g table entry for the + * subscriber will be added or modified; if aud->algo is OSMO_AUTH_ALG_NONE, + * however, the auc_2g entry for the subscriber is deleted. If aud->type is + * OSMO_AUTH_TYPE_UMTS, the auc_3g table is updated; again, if aud->algo is + * OSMO_AUTH_ALG_NONE, the auc_3g entry is deleted. + * Returns 0 if successful, -EINVAL for unknown aud->type, -ENOENT for unknown + * subscr_id, -EIO for SQL errors. + */ +int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id, + const struct sub_auth_data_str *aud) +{ + sqlite3_stmt *stmt_del; + sqlite3_stmt *stmt_ins; + sqlite3_stmt *stmt; + const char *label; + int rc; + int ret = 0; + + switch (aud->type) { + case OSMO_AUTH_TYPE_GSM: + label = "auc_2g"; + stmt_del = dbc->stmt[DB_STMT_AUC_2G_DELETE]; + stmt_ins = dbc->stmt[DB_STMT_AUC_2G_INSERT]; + + switch (aud->algo) { + case OSMO_AUTH_ALG_NONE: + case OSMO_AUTH_ALG_COMP128v1: + case OSMO_AUTH_ALG_COMP128v2: + case OSMO_AUTH_ALG_COMP128v3: + case OSMO_AUTH_ALG_XOR: + break; + case OSMO_AUTH_ALG_MILENAGE: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " auth algo not suited for 2G: %s\n", + osmo_auth_alg_name(aud->algo)); + return -EINVAL; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Unknown auth algo: %d\n", aud->algo); + return -EINVAL; + } + + if (aud->algo == OSMO_AUTH_ALG_NONE) + break; + if (!osmo_is_hexstr(aud->u.gsm.ki, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid KI: '%s'\n", aud->u.gsm.ki); + return -EINVAL; + } + break; + + case OSMO_AUTH_TYPE_UMTS: + label = "auc_3g"; + stmt_del = dbc->stmt[DB_STMT_AUC_3G_DELETE]; + stmt_ins = dbc->stmt[DB_STMT_AUC_3G_INSERT]; + switch (aud->algo) { + case OSMO_AUTH_ALG_NONE: + case OSMO_AUTH_ALG_MILENAGE: + break; + case OSMO_AUTH_ALG_COMP128v1: + case OSMO_AUTH_ALG_COMP128v2: + case OSMO_AUTH_ALG_COMP128v3: + case OSMO_AUTH_ALG_XOR: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " auth algo not suited for 3G: %s\n", + osmo_auth_alg_name(aud->algo)); + return -EINVAL; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Unknown auth algo: %d\n", aud->algo); + return -EINVAL; + } + + if (aud->algo == OSMO_AUTH_ALG_NONE) + break; + if (!osmo_is_hexstr(aud->u.umts.k, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid K: '%s'\n", aud->u.umts.k); + return -EINVAL; + } + if (!osmo_is_hexstr(aud->u.umts.opc, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid OP/OPC: '%s'\n", aud->u.umts.opc); + return -EINVAL; + } + if (aud->u.umts.ind_bitlen > OSMO_MILENAGE_IND_BITLEN_MAX) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid ind_bitlen: %d\n", aud->u.umts.ind_bitlen); + return -EINVAL; + } + break; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " unknown auth type: %d\n", aud->type); + return -EINVAL; + } + + stmt = stmt_del; + + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGP(DAUC, LOGL_ERROR, + "Cannot delete %s row: SQL error: (%d) %s\n", + label, rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; + } + + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) + /* Leave "no such entry" logging to the caller -- during + * db_subscr_delete_by_id(), we call this to make sure it is + * empty, and no entry is not an error then.*/ + ret = -ENOENT; + else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Delete subscriber ID=%"PRId64 + " from %s: SQL modified %d rows (expected 1)\n", + subscr_id, label, rc); + ret = -EIO; + } + + db_remove_reset(stmt); + + /* Error situation? Return now. */ + if (ret && ret != -ENOENT) + return ret; + + /* Just delete requested? */ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return ret; + + /* Don't return -ENOENT if inserting new data. */ + ret = 0; + + /* Insert new row */ + stmt = stmt_ins; + + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; + + switch (aud->type) { + case OSMO_AUTH_TYPE_GSM: + if (!db_bind_int(stmt, "$algo_id_2g", aud->algo)) + return -EIO; + if (!db_bind_text(stmt, "$ki", aud->u.gsm.ki)) + return -EIO; + break; + case OSMO_AUTH_TYPE_UMTS: + if (!db_bind_int(stmt, "$algo_id_3g", aud->algo)) + return -EIO; + if (!db_bind_text(stmt, "$k", aud->u.umts.k)) + return -EIO; + if (!db_bind_text(stmt, "$op", + aud->u.umts.opc_is_op ? aud->u.umts.opc : NULL)) + return -EIO; + if (!db_bind_text(stmt, "$opc", + aud->u.umts.opc_is_op ? NULL : aud->u.umts.opc)) + return -EIO; + if (!db_bind_int(stmt, "$ind_bitlen", aud->u.umts.ind_bitlen)) + return -EIO; + break; + default: + OSMO_ASSERT(false); + } + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGP(DAUC, LOGL_ERROR, + "Cannot insert %s row: SQL error: (%d) %s\n", + label, rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; + } + +out: + db_remove_reset(stmt); + return ret; +} + /* Common code for db_subscr_get_by_*() functions. */ static int db_sel(struct db_context *dbc, sqlite3_stmt *stmt, struct hlr_subscriber *subscr, const char **err) diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 493c235..863ec5c 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -66,9 +66,32 @@ fprintf(stderr, "\n"); \ } while (0) +/* Do db_get_auth_data() and verbosely assert that its return value is as expected. + * Print the subscriber struct to stderr to be validated by db_test.err. + * The results are then available in g_aud2g and g_aud3g. */ +#define ASSERT_SEL_AUD(imsi, expect_rc, expect_id) \ + do { \ + g_aud2g = (struct osmo_sub_auth_data){}; \ + g_aud3g = (struct osmo_sub_auth_data){}; \ + g_id = 0; \ + ASSERT_RC(db_get_auth_data(dbc, imsi, &g_aud2g, &g_aud3g, &g_id), expect_rc); \ + if (g_rc == 1) { \ + dump_aud("2G", &g_aud2g); \ + dump_aud("3G", &g_aud3g); \ + }\ + if (g_id != expect_id) {\ + fprintf(stderr, "MISMATCH: got subscriber id %"PRId64 \ + ", expected %"PRId64"\n", g_id, (int64_t)(expect_id)); \ + OSMO_ASSERT(g_id == expect_id); \ + } \ + fprintf(stderr, "\n"); \ + } while (0) + static struct db_context *dbc = NULL; static void *ctx = NULL; static struct hlr_subscriber g_subscr; +static struct osmo_sub_auth_data g_aud2g; +static struct osmo_sub_auth_data g_aud3g; static int g_rc; static int64_t g_id; @@ -386,6 +409,262 @@ comment_end(); } +static const struct sub_auth_data_str *mk_aud_2g(enum osmo_auth_algo algo, + const char *ki) +{ + static struct sub_auth_data_str aud; + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_GSM, + .algo = algo, + .u.gsm.ki = ki, + }; + return &aud; +} + +static const struct sub_auth_data_str *mk_aud_3g(enum osmo_auth_algo algo, + const char *opc, bool opc_is_op, + const char *k, unsigned int ind_bitlen) +{ + static struct sub_auth_data_str aud; + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_UMTS, + .algo = algo, + .u.umts.k = k, + .u.umts.opc = opc, + .u.umts.opc_is_op = opc_is_op ? 1 : 0, + .u.umts.ind_bitlen = ind_bitlen, + }; + return &aud; +} + +static void test_subscr_aud() +{ + int64_t id; + + comment_start(); + + comment("Get auth data for non-existent subscriber"); + ASSERT_SEL_AUD(unknown_imsi, 0, 0); + + comment("Create subscriber"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + + id = g_subscr.id; + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 2G only"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + /* same again */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Remove 2G auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + /* Removing nothing results in -ENOENT */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)), + -ENOENT); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 3G only"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", true, + "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + /* same again */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", true, + "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, + "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", false, + "DeafBeddedBabeAcceededFadedDecaf", + OSMO_MILENAGE_IND_BITLEN_MAX)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "CededEffacedAceFacedBadFadedBeef", false, + "BeefedCafeFaceAcedAddedDecadeFee", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Remove 3G auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + /* Removing nothing results in -ENOENT */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)), + -ENOENT); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "CededEffacedAceFacedBadFadedBeef", false, + "BeefedCafeFaceAcedAddedDecadeFee", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, + "asdfasdfasd", false, + "asdfasdfasdf", 99999)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 2G and 3G"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", false, + "DeafBeddedBabeAcceededFadedDecaf", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + + comment("Set invalid auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(99999, "f000000000000f00000000000f000000")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "0f000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", + OSMO_MILENAGE_IND_BITLEN_MAX + 1)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "X000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "f000000000000 f00000000000 f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Delete subscriber"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); + ASSERT_SEL(imsi, imsi0, -ENOENT); + + comment("Re-add subscriber and verify auth data didn't come back"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + + /* For this test to work, we want to get the same subscriber ID back, + * and make sure there are no auth data leftovers for this ID. */ + OSMO_ASSERT(id == g_subscr.id); + ASSERT_SEL_AUD(imsi0, -1, id); + + ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); + ASSERT_SEL(imsi, imsi0, -ENOENT); + + comment_end(); +} + static struct { bool verbose; } cmdline_opts = { @@ -460,6 +739,7 @@ OSMO_ASSERT(dbc); test_subscr_create_update_sel_delete(); + test_subscr_aud(); printf("Done\n"); return 0; diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 59b9ba1..5d3ab5f 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -711,3 +711,483 @@ ===== test_subscr_create_update_sel_delete: SUCCESS + +===== test_subscr_aud + +--- Get auth data for non-existent subscriber + +db_get_auth_data(dbc, unknown_imsi, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='999999999': No such subscriber + + + +--- Create subscriber + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 2G only + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v1, + .u.gsm.ki = '0123456789abcdef0123456789abcdef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v1, + .u.gsm.ki = '0123456789abcdef0123456789abcdef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v2, + .u.gsm.ki = 'beadedbeeaced1ebbeddefacedfacade', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'deafbeddedbabeacceededfadeddecaf', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = XOR, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: none + + +--- Remove 2G auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> -ENOENT + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = XOR, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 3G only + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'deaf0ff1ced0d0dabbedd1ced1cef00d', + .u.umts.opc_is_op = 1, + .u.umts.k = 'f1bbed0afd0ef0bd0ffed0ddf1fe0b0e', + .u.umts.amf = '0000', +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", OSMO_MILENAGE_IND_BITLEN_MAX)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 28, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'cededeffacedacefacedbadfadedbeef', + .u.umts.opc_is_op = 0, + .u.umts.k = 'beefedcafefaceacedaddeddecadefee', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Remove 3G auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)) --> -ENOENT + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'cededeffacedacefacedbadfadedbeef', + .u.umts.opc_is_op = 0, + .u.umts.k = 'beefedcafefaceacedaddeddecadefee', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, "asdfasdfasd", false, "asdfasdfasdf", 99999)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 2G and 3G + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Set invalid auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(99999, "f000000000000f00000000000f000000")) --> -EINVAL +DAUC Cannot update auth tokens: Unknown auth algo: 99999 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")) --> -EINVAL +DAUC Cannot update auth tokens: Invalid KI: 'f000000000000f00000000000f000000f00000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")) --> -EINVAL +DAUC Cannot update auth tokens: Invalid KI: 'f00' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")) --> -EINVAL +DAUC Cannot update auth tokens: auth algo not suited for 2G: MILENAGE + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "0f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid OP/OPC: '0f000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid K: '000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", OSMO_MILENAGE_IND_BITLEN_MAX + 1)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid ind_bitlen: 29 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "X000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid OP/OPC: 'X000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000 f00000000000 f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid K: 'f000000000000 f00000000000 f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Delete subscriber + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_delete_by_id(dbc, id) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber + + +--- Re-add subscriber and verify auth data didn't come back + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_delete_by_id(dbc, id) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber + +===== test_subscr_aud: SUCCESS + -- To view, visit https://gerrit.osmocom.org/4185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb11b5e059fb920447a9aa414db1819a0c020529 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:32:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:32:01 +0000 Subject: [PATCH] osmo-hlr[master]: refactor db_get_auth_data return val Message-ID: Review at https://gerrit.osmocom.org/4186 refactor db_get_auth_data return val Adopt the error handling of the other db functions: return -ENOENT on unknown subscriber and -EIO on SQL failure. Return 0 for no error, instead of the number of rows modified. Adjust the single caller: db_get_auc() (and db_test.c). Change-Id: I006f471962bdad95d00a3a4c41a28ebbc9740884 --- M src/db_auc.c M tests/db/db_test.c M tests/db/db_test.err 3 files changed, 67 insertions(+), 66 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/86/4186/1 diff --git a/src/db_auc.c b/src/db_auc.c index 71c7262..10c1816 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -91,7 +92,7 @@ SQLITE_STATIC); if (rc != SQLITE_OK) { LOGAUC(imsi, LOGL_ERROR, "Error binding IMSI: %d\n", rc); - ret = -1; + ret = -EIO; goto out; } @@ -99,11 +100,11 @@ rc = sqlite3_step(stmt); if (rc == SQLITE_DONE) { LOGAUC(imsi, LOGL_INFO, "No such subscriber\n"); - ret = 0; + ret = -ENOENT; goto out; } else if (rc != SQLITE_ROW) { LOGAUC(imsi, LOGL_ERROR, "Error executing SQL: %d\n", rc); - ret = -1; + ret = -EIO; goto out; } @@ -139,6 +140,7 @@ k = sqlite3_column_text(stmt, 4); if (!k) { LOGAUC(imsi, LOGL_ERROR, "Error reading K: %d\n", rc); + ret = -EIO; goto out; } osmo_hexparse((void*)k, (void*)&aud3g->u.umts.k, sizeof(aud3g->u.umts.k)); @@ -148,6 +150,7 @@ opc = sqlite3_column_text(stmt, 6); if (!opc) { LOGAUC(imsi, LOGL_ERROR, "Error reading OPC: %d\n", rc); + ret = -EIO; goto out; } osmo_hexparse((void*)opc, (void*)&aud3g->u.umts.opc, @@ -166,9 +169,7 @@ LOGAUC(imsi, LOGL_DEBUG, "No 3G Auth Data\n"); if (aud2g->type == 0 && aud3g->type == 0) - ret = -1; - else - ret = 1; + ret = -ENOENT; out: /* remove bindings and reset statement to be re-executed */ @@ -197,7 +198,7 @@ int rc; rc = db_get_auth_data(dbc, imsi, &aud2g, &aud3g, &subscr_id); - if (rc <= 0) + if (rc) return rc; aud3g.u.umts.ind = auc_3g_ind; diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 863ec5c..a820297 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -75,7 +75,7 @@ g_aud3g = (struct osmo_sub_auth_data){}; \ g_id = 0; \ ASSERT_RC(db_get_auth_data(dbc, imsi, &g_aud2g, &g_aud3g, &g_id), expect_rc); \ - if (g_rc == 1) { \ + if (!g_rc) { \ dump_aud("2G", &g_aud2g); \ dump_aud("3G", &g_aud3g); \ }\ @@ -444,7 +444,7 @@ comment_start(); comment("Get auth data for non-existent subscriber"); - ASSERT_SEL_AUD(unknown_imsi, 0, 0); + ASSERT_SEL_AUD(unknown_imsi, -ENOENT, 0); comment("Create subscriber"); @@ -452,7 +452,7 @@ ASSERT_SEL(imsi, imsi0, 0); id = g_subscr.id; - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); comment("Set auth data, 2G only"); @@ -460,35 +460,35 @@ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); /* same again */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Remove 2G auth data"); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); /* Removing nothing results in -ENOENT */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, @@ -498,12 +498,12 @@ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); comment("Set auth data, 3G only"); @@ -513,7 +513,7 @@ "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); /* same again */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, @@ -521,14 +521,14 @@ "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, @@ -536,21 +536,21 @@ "DeafBeddedBabeAcceededFadedDecaf", OSMO_MILENAGE_IND_BITLEN_MAX)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Remove 3G auth data"); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); /* Removing nothing results in -ENOENT */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, @@ -562,14 +562,14 @@ "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, "asdfasdfasd", false, "asdfasdfasdf", 99999)), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); comment("Set auth data, 2G and 3G"); @@ -582,7 +582,7 @@ "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Set invalid auth data"); @@ -590,36 +590,36 @@ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(99999, "f000000000000f00000000000f000000")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "0f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "000000000000f00000000000f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, @@ -627,21 +627,21 @@ "f000000000000f00000000000f000000", OSMO_MILENAGE_IND_BITLEN_MAX + 1)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "X000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000 f00000000000 f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Delete subscriber"); @@ -657,7 +657,7 @@ /* For this test to work, we want to get the same subscriber ID back, * and make sure there are no auth data leftovers for this ID. */ OSMO_ASSERT(id == g_subscr.id); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); ASSERT_SEL(imsi, imsi0, -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 5d3ab5f..4813ea6 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -716,7 +716,7 @@ --- Get auth data for non-existent subscriber -db_get_auth_data(dbc, unknown_imsi, &g_aud2g, &g_aud3g, &g_id) --> 0 +db_get_auth_data(dbc, unknown_imsi, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='999999999': No such subscriber @@ -731,7 +731,7 @@ .imsi = '123456789000000', } -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -741,7 +741,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -753,7 +753,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -765,7 +765,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -777,7 +777,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -789,7 +789,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -804,7 +804,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -813,7 +813,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -825,7 +825,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -835,7 +835,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -851,7 +851,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -867,7 +867,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -882,7 +882,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", OSMO_MILENAGE_IND_BITLEN_MAX)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -898,7 +898,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -917,7 +917,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -926,7 +926,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -942,7 +942,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, "asdfasdfasd", false, "asdfasdfasdf", 99999)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -954,7 +954,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -977,7 +977,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(99999, "f000000000000f00000000000f000000")) --> -EINVAL DAUC Cannot update auth tokens: Unknown auth algo: 99999 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -997,7 +997,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")) --> -EINVAL DAUC Cannot update auth tokens: Invalid KI: 'f000000000000f00000000000f000000f00000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1017,7 +1017,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")) --> -EINVAL DAUC Cannot update auth tokens: Invalid KI: 'f00' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1037,7 +1037,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")) --> -EINVAL DAUC Cannot update auth tokens: auth algo not suited for 2G: MILENAGE -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1057,7 +1057,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "0f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid OP/OPC: '0f000000000000f00000000000f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1077,7 +1077,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "000000000000f00000000000f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid K: '000000000000f00000000000f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1097,7 +1097,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", OSMO_MILENAGE_IND_BITLEN_MAX + 1)) --> -EINVAL DAUC Cannot update auth tokens: Invalid ind_bitlen: 29 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1117,7 +1117,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "X000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid OP/OPC: 'X000000000000f00000000000f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1137,7 +1137,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000 f00000000000 f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid K: 'f000000000000 f00000000000 f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1179,7 +1179,7 @@ .imsi = '123456789000000', } -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data -- To view, visit https://gerrit.osmocom.org/4186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I006f471962bdad95d00a3a4c41a28ebbc9740884 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:32:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:32:01 +0000 Subject: [PATCH] osmo-hlr[master]: code undup: use db_remove_reset() in db_auc.c Message-ID: Review at https://gerrit.osmocom.org/4187 code undup: use db_remove_reset() in db_auc.c Change-Id: I32d728e2b8a9771421c097647aa0e060e29a601f --- M src/db_auc.c 1 file changed, 2 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/87/4187/1 diff --git a/src/db_auc.c b/src/db_auc.c index 10c1816..d469920 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -60,16 +60,7 @@ return -2; } - /* remove bindings and reset statement to be re-executed */ - rc = sqlite3_clear_bindings(stmt); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error clerearing bindings: %d\n", rc); - } - rc = sqlite3_reset(stmt); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error in sqlite3_reset: %d\n", rc); - } - + db_remove_reset(stmt); return 0; } @@ -172,16 +163,7 @@ ret = -ENOENT; out: - /* remove bindings and reset statement to be re-executed */ - rc = sqlite3_clear_bindings(stmt); - if (rc != SQLITE_OK) { - LOGAUC(imsi, LOGL_ERROR, "Error in sqlite3_clear_bindings(): %d\n", rc); - } - rc = sqlite3_reset(stmt); - if (rc != SQLITE_OK) { - LOGAUC(imsi, LOGL_ERROR, "Error in sqlite3_reset(): %d\n", rc); - } - + db_remove_reset(stmt); return ret; } -- To view, visit https://gerrit.osmocom.org/4187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32d728e2b8a9771421c097647aa0e060e29a601f Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:32:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:32:02 +0000 Subject: [PATCH] osmo-hlr[master]: fix db_update_sqn(): reset stmt in all error cases Message-ID: Review at https://gerrit.osmocom.org/4188 fix db_update_sqn(): reset stmt in all error cases Use the common db_bind_int64() so that the stmt bindings are cleared for any errors and to get error logging for free. On error with sqlite3_step(), log the SQL error message, and make sure the stmt is cleared of bindings and reset. After sqlite3_step(), verify that exactly one row was modifed, log and return errors otherwise. After this patch, the DB interaction closely matches the other (refactored) DB functions. Change-Id: I0d870d405e2e0a830360d9ad19f0a3f9e09d8cf2 --- M src/db.c M src/db_auc.c M tests/db/db_test.c M tests/db/db_test.err 4 files changed, 317 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/88/4188/1 diff --git a/src/db.c b/src/db.c index a04bbd7..c1953f2 100644 --- a/src/db.c +++ b/src/db.c @@ -52,7 +52,7 @@ " LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id" " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" " WHERE imsi = ?", - [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", + [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = $sqn WHERE subscriber_id = $subscriber_id", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs = $val WHERE imsi = $imsi", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps = $val WHERE imsi = $imsi", [DB_STMT_UPD_NAM_CS_BY_IMSI] = "UPDATE subscriber SET nam_cs = $val WHERE imsi = $imsi", diff --git a/src/db_auc.c b/src/db_auc.c index d469920..eae5070 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -34,34 +34,43 @@ #define LOGAUC(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) /* update the SQN for a given subscriber ID */ -int db_update_sqn(struct db_context *dbc, int64_t id, - uint64_t new_sqn) +int db_update_sqn(struct db_context *dbc, int64_t subscr_id, uint64_t new_sqn) { sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_UPD_SQN]; int rc; + int ret = 0; - /* bind new SQN and subscriber ID */ - rc = sqlite3_bind_int64(stmt, 1, new_sqn); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding SQN: %d\n", rc); - return -1; - } + if (!db_bind_int64(stmt, "$sqn", new_sqn)) + return -EIO; - rc = sqlite3_bind_int64(stmt, 2, id); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding Subscrber ID: %d\n", rc); - return -1; - } + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGP(DAUC, LOGL_ERROR, "Error updating SQN: %d\n", rc); - return -2; + LOGP(DAUC, LOGL_ERROR, "Cannot update SQN for subscriber ID=%"PRId64 + ": SQL error: (%d) %s\n", + subscr_id, rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot update SQN for subscriber ID=%"PRId64 + ": no auc_3g entry for such subscriber\n", subscr_id); + ret = -ENOENT; + } else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Update SQN for subscriber ID=%"PRId64 + ": SQL modified %d rows (expected 1)\n", subscr_id, rc); + ret = -EIO; + } + +out: db_remove_reset(stmt); - return 0; + return ret; } /* obtain the authentication data for a given imsi diff --git a/tests/db/db_test.c b/tests/db/db_test.c index a820297..83064b1 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -665,6 +665,79 @@ comment_end(); } +static void test_subscr_sqn() +{ + int64_t id; + + comment_start(); + + comment("Set SQN for unknown subscriber"); + + ASSERT_RC(db_update_sqn(dbc, 99, 999), -ENOENT); + ASSERT_SEL(id, 99, -ENOENT); + + ASSERT_RC(db_update_sqn(dbc, 9999, 99), -ENOENT); + ASSERT_SEL(id, 9999, -ENOENT); + + comment("Create subscriber"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + + id = g_subscr.id; + ASSERT_SEL_AUD(imsi0, -ENOENT, id); + + comment("Set SQN, but no 3G auth data present"); + + ASSERT_RC(db_update_sqn(dbc, id, 123), -ENOENT); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); + + ASSERT_RC(db_update_sqn(dbc, id, 543), -ENOENT); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); + + comment("Set auth 3G data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", true, + "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + comment("Set SQN"); + + ASSERT_RC(db_update_sqn(dbc, id, 23315), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, 23315), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, 423), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + comment("Set SQN: thru uint64_t range, using the int64_t SQLite bind"); + + ASSERT_RC(db_update_sqn(dbc, id, 0), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, INT64_MAX), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, INT64_MIN), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, UINT64_MAX), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + comment("Delete subscriber"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); + ASSERT_SEL(imsi, imsi0, -ENOENT); + + comment_end(); +} + static struct { bool verbose; } cmdline_opts = { @@ -740,6 +813,7 @@ test_subscr_create_update_sel_delete(); test_subscr_aud(); + test_subscr_sqn(); printf("Done\n"); return 0; diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 4813ea6..0b09583 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -1191,3 +1191,220 @@ ===== test_subscr_aud: SUCCESS + +===== test_subscr_sqn + +--- Set SQN for unknown subscriber + +db_update_sqn(dbc, 99, 999) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=99: no auc_3g entry for such subscriber + +db_subscr_get_by_id(dbc, 99, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: ID=99: No such subscriber + +db_update_sqn(dbc, 9999, 99) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=9999: no auc_3g entry for such subscriber + +db_subscr_get_by_id(dbc, 9999, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: ID=9999: No such subscriber + + +--- Create subscriber + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set SQN, but no 3G auth data present + +db_update_sqn(dbc, id, 123) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=1: no auc_3g entry for such subscriber + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_update_sqn(dbc, id, 543) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=1: no auc_3g entry for such subscriber + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth 3G data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Set SQN + +db_update_sqn(dbc, id, 23315) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 23315, + .u.umts.sqn = 0x5b13, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, 23315) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 23315, + .u.umts.sqn = 0x5b13, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, 423) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 423, + .u.umts.sqn = 0x1a7, + .u.umts.ind_bitlen = 5, +} + + +--- Set SQN: thru uint64_t range, using the int64_t SQLite bind + +db_update_sqn(dbc, id, 0) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, INT64_MAX) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 9223372036854775807, + .u.umts.sqn = 0x7fffffffffffffff, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, INT64_MIN) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 9223372036854775808, + .u.umts.sqn = 0x8000000000000000, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, UINT64_MAX) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 18446744073709551615, + .u.umts.sqn = 0xffffffffffffffff, + .u.umts.ind_bitlen = 5, +} + + +--- Delete subscriber + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_delete_by_id(dbc, id) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber + +===== test_subscr_sqn: SUCCESS + -- To view, visit https://gerrit.osmocom.org/4188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0d870d405e2e0a830360d9ad19f0a3f9e09d8cf2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:32:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:32:02 +0000 Subject: [PATCH] osmo-hlr[master]: code dup: use db_bind_text() in db_get_auth_data() Message-ID: Review at https://gerrit.osmocom.org/4189 code dup: use db_bind_text() in db_get_auth_data() To make the db_bind_text() error reporting mention "imsi", change the DB_STMT_AUC_BY_IMSI to use a named parameter. Change-Id: I49bd5eb78170cf4cdf8abb386c766d20d9f1cf73 --- M src/db.c M src/db_auc.c 2 files changed, 3 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/89/4189/1 diff --git a/src/db.c b/src/db.c index c1953f2..25e16f9 100644 --- a/src/db.c +++ b/src/db.c @@ -51,7 +51,7 @@ " FROM subscriber" " LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id" " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" - " WHERE imsi = ?", + " WHERE imsi = $imsi", [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = $sqn WHERE subscriber_id = $subscriber_id", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs = $val WHERE imsi = $imsi", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps = $val WHERE imsi = $imsi", diff --git a/src/db_auc.c b/src/db_auc.c index eae5070..7bbc93f 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -87,14 +87,8 @@ memset(aud2g, 0, sizeof(*aud2g)); memset(aud3g, 0, sizeof(*aud3g)); - /* bind the IMSI value */ - rc = sqlite3_bind_text(stmt, 1, imsi, -1, - SQLITE_STATIC); - if (rc != SQLITE_OK) { - LOGAUC(imsi, LOGL_ERROR, "Error binding IMSI: %d\n", rc); - ret = -EIO; - goto out; - } + if (!db_bind_text(stmt, "$imsi", imsi)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); -- To view, visit https://gerrit.osmocom.org/4189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I49bd5eb78170cf4cdf8abb386c766d20d9f1cf73 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:33:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:33:02 +0000 Subject: [PATCH] osmo-hlr[master]: code undup: use db_bind_text() in db_get_auth_data() In-Reply-To: References: Message-ID: code undup: use db_bind_text() in db_get_auth_data() To make the db_bind_text() error reporting mention "imsi", change the DB_STMT_AUC_BY_IMSI to use a named parameter. Change-Id: I49bd5eb78170cf4cdf8abb386c766d20d9f1cf73 --- M src/db.c M src/db_auc.c 2 files changed, 3 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/89/4189/2 diff --git a/src/db.c b/src/db.c index c1953f2..25e16f9 100644 --- a/src/db.c +++ b/src/db.c @@ -51,7 +51,7 @@ " FROM subscriber" " LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id" " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" - " WHERE imsi = ?", + " WHERE imsi = $imsi", [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = $sqn WHERE subscriber_id = $subscriber_id", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs = $val WHERE imsi = $imsi", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps = $val WHERE imsi = $imsi", diff --git a/src/db_auc.c b/src/db_auc.c index eae5070..7bbc93f 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -87,14 +87,8 @@ memset(aud2g, 0, sizeof(*aud2g)); memset(aud3g, 0, sizeof(*aud3g)); - /* bind the IMSI value */ - rc = sqlite3_bind_text(stmt, 1, imsi, -1, - SQLITE_STATIC); - if (rc != SQLITE_OK) { - LOGAUC(imsi, LOGL_ERROR, "Error binding IMSI: %d\n", rc); - ret = -EIO; - goto out; - } + if (!db_bind_text(stmt, "$imsi", imsi)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); -- To view, visit https://gerrit.osmocom.org/4189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I49bd5eb78170cf4cdf8abb386c766d20d9f1cf73 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:35:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 01:35:46 +0000 Subject: [PATCH] osmo-hlr[master]: add db_subscr_update_aud_by_id(), complete db_subscr_delete_... In-Reply-To: References: Message-ID: add db_subscr_update_aud_by_id(), complete db_subscr_delete_by_id() Add ability to add and remove auc_2g and auc_3g table rows with db_subscr_update_aud_by_id(). In db_subscr_delete_by_id(), make sure that when deleting a subscriber, also all auth data associated with that user ID is removed as well. A newly created subscriber must not obtain the same auth tokens just by getting the same id. Depends: libosmocore Idf75946eb0a84e145adad13fc7c78bb7a267aa0a Change-Id: Icb11b5e059fb920447a9aa414db1819a0c020529 --- M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 5 files changed, 1,004 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/85/4185/2 diff --git a/src/db.c b/src/db.c index 1bf856a..a04bbd7 100644 --- a/src/db.c +++ b/src/db.c @@ -60,6 +60,14 @@ [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id", [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi", + [DB_STMT_AUC_2G_INSERT] = + "INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki)" + " VALUES($subscriber_id, $algo_id_2g, $ki)", + [DB_STMT_AUC_2G_DELETE] = "DELETE FROM auc_2g WHERE subscriber_id = $subscriber_id", + [DB_STMT_AUC_3G_INSERT] = + "INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, op, opc, ind_bitlen)" + " VALUES($subscriber_id, $algo_id_3g, $k, $op, $opc, $ind_bitlen)", + [DB_STMT_AUC_3G_DELETE] = "DELETE FROM auc_3g WHERE subscriber_id = $subscriber_id", }; static void sql3_error_log_cb(void *arg, int err_code, const char *msg) diff --git a/src/db.h b/src/db.h index 2e6cc9b..f6aaa58 100644 --- a/src/db.h +++ b/src/db.h @@ -18,6 +18,10 @@ DB_STMT_SUBSCR_CREATE, DB_STMT_DEL_BY_ID, DB_STMT_SET_MSISDN_BY_IMSI, + DB_STMT_AUC_2G_INSERT, + DB_STMT_AUC_2G_DELETE, + DB_STMT_AUC_3G_INSERT, + DB_STMT_AUC_3G_DELETE, _NUM_DB_STMT }; @@ -78,11 +82,36 @@ bool ms_purged_ps; }; +/* Like struct osmo_sub_auth_data, but the keys are in hexdump representation. + * This is useful because SQLite requires them in hexdump format, and callers + * like the VTY and CTRL interface also have them available as hexdump to begin + * with. In the binary format, a VTY command would first need to hexparse, + * after which the db function would again hexdump, copying to separate + * buffers. The roundtrip can be saved by providing char* to begin with. */ +struct sub_auth_data_str { + enum osmo_sub_auth_type type; + enum osmo_auth_algo algo; + union { + struct { + const char *opc; + const char *k; + uint64_t sqn; + int opc_is_op; + unsigned int ind_bitlen; + } umts; + struct { + const char *ki; + } gsm; + } u; +}; + int db_subscr_create(struct db_context *dbc, const char *imsi); int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id); int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, const char *msisdn); +int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id, + const struct sub_auth_data_str *aud); int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr); diff --git a/src/db_hlr.c b/src/db_hlr.c index 194cd35..612de86 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -70,6 +70,7 @@ int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id) { int rc; + struct sub_auth_data_str aud; int ret = 0; sqlite3_stmt *stmt = dbc->stmt[DB_STMT_DEL_BY_ID]; @@ -98,10 +99,27 @@ ": SQL modified %d rows (expected 1)\n", subscr_id, rc); ret = -EIO; } - - /* FIXME: also remove authentication data from auc_2g and auc_3g */ - db_remove_reset(stmt); + + /* make sure to remove authentication data for this subscriber id, for + * both 2G and 3G. */ + + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_GSM, + .algo = OSMO_AUTH_ALG_NONE, + }; + rc = db_subscr_update_aud_by_id(dbc, subscr_id, &aud); + if (ret == -ENOENT && !rc) + ret = 0; + + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_NONE, + }; + rc = db_subscr_update_aud_by_id(dbc, subscr_id, &aud); + if (ret == -ENOENT && !rc) + ret = 0; + return ret; } @@ -153,6 +171,192 @@ } +/* Insert or update 2G or 3G authentication tokens in the database. + * If aud->type is OSMO_AUTH_TYPE_GSM, the auc_2g table entry for the + * subscriber will be added or modified; if aud->algo is OSMO_AUTH_ALG_NONE, + * however, the auc_2g entry for the subscriber is deleted. If aud->type is + * OSMO_AUTH_TYPE_UMTS, the auc_3g table is updated; again, if aud->algo is + * OSMO_AUTH_ALG_NONE, the auc_3g entry is deleted. + * Returns 0 if successful, -EINVAL for unknown aud->type, -ENOENT for unknown + * subscr_id, -EIO for SQL errors. + */ +int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id, + const struct sub_auth_data_str *aud) +{ + sqlite3_stmt *stmt_del; + sqlite3_stmt *stmt_ins; + sqlite3_stmt *stmt; + const char *label; + int rc; + int ret = 0; + + switch (aud->type) { + case OSMO_AUTH_TYPE_GSM: + label = "auc_2g"; + stmt_del = dbc->stmt[DB_STMT_AUC_2G_DELETE]; + stmt_ins = dbc->stmt[DB_STMT_AUC_2G_INSERT]; + + switch (aud->algo) { + case OSMO_AUTH_ALG_NONE: + case OSMO_AUTH_ALG_COMP128v1: + case OSMO_AUTH_ALG_COMP128v2: + case OSMO_AUTH_ALG_COMP128v3: + case OSMO_AUTH_ALG_XOR: + break; + case OSMO_AUTH_ALG_MILENAGE: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " auth algo not suited for 2G: %s\n", + osmo_auth_alg_name(aud->algo)); + return -EINVAL; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Unknown auth algo: %d\n", aud->algo); + return -EINVAL; + } + + if (aud->algo == OSMO_AUTH_ALG_NONE) + break; + if (!osmo_is_hexstr(aud->u.gsm.ki, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid KI: '%s'\n", aud->u.gsm.ki); + return -EINVAL; + } + break; + + case OSMO_AUTH_TYPE_UMTS: + label = "auc_3g"; + stmt_del = dbc->stmt[DB_STMT_AUC_3G_DELETE]; + stmt_ins = dbc->stmt[DB_STMT_AUC_3G_INSERT]; + switch (aud->algo) { + case OSMO_AUTH_ALG_NONE: + case OSMO_AUTH_ALG_MILENAGE: + break; + case OSMO_AUTH_ALG_COMP128v1: + case OSMO_AUTH_ALG_COMP128v2: + case OSMO_AUTH_ALG_COMP128v3: + case OSMO_AUTH_ALG_XOR: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " auth algo not suited for 3G: %s\n", + osmo_auth_alg_name(aud->algo)); + return -EINVAL; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Unknown auth algo: %d\n", aud->algo); + return -EINVAL; + } + + if (aud->algo == OSMO_AUTH_ALG_NONE) + break; + if (!osmo_is_hexstr(aud->u.umts.k, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid K: '%s'\n", aud->u.umts.k); + return -EINVAL; + } + if (!osmo_is_hexstr(aud->u.umts.opc, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid OP/OPC: '%s'\n", aud->u.umts.opc); + return -EINVAL; + } + if (aud->u.umts.ind_bitlen > OSMO_MILENAGE_IND_BITLEN_MAX) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid ind_bitlen: %d\n", aud->u.umts.ind_bitlen); + return -EINVAL; + } + break; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " unknown auth type: %d\n", aud->type); + return -EINVAL; + } + + stmt = stmt_del; + + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGP(DAUC, LOGL_ERROR, + "Cannot delete %s row: SQL error: (%d) %s\n", + label, rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; + } + + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) + /* Leave "no such entry" logging to the caller -- during + * db_subscr_delete_by_id(), we call this to make sure it is + * empty, and no entry is not an error then.*/ + ret = -ENOENT; + else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Delete subscriber ID=%"PRId64 + " from %s: SQL modified %d rows (expected 1)\n", + subscr_id, label, rc); + ret = -EIO; + } + + db_remove_reset(stmt); + + /* Error situation? Return now. */ + if (ret && ret != -ENOENT) + return ret; + + /* Just delete requested? */ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return ret; + + /* Don't return -ENOENT if inserting new data. */ + ret = 0; + + /* Insert new row */ + stmt = stmt_ins; + + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; + + switch (aud->type) { + case OSMO_AUTH_TYPE_GSM: + if (!db_bind_int(stmt, "$algo_id_2g", aud->algo)) + return -EIO; + if (!db_bind_text(stmt, "$ki", aud->u.gsm.ki)) + return -EIO; + break; + case OSMO_AUTH_TYPE_UMTS: + if (!db_bind_int(stmt, "$algo_id_3g", aud->algo)) + return -EIO; + if (!db_bind_text(stmt, "$k", aud->u.umts.k)) + return -EIO; + if (!db_bind_text(stmt, "$op", + aud->u.umts.opc_is_op ? aud->u.umts.opc : NULL)) + return -EIO; + if (!db_bind_text(stmt, "$opc", + aud->u.umts.opc_is_op ? NULL : aud->u.umts.opc)) + return -EIO; + if (!db_bind_int(stmt, "$ind_bitlen", aud->u.umts.ind_bitlen)) + return -EIO; + break; + default: + OSMO_ASSERT(false); + } + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGP(DAUC, LOGL_ERROR, + "Cannot insert %s row: SQL error: (%d) %s\n", + label, rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; + } + +out: + db_remove_reset(stmt); + return ret; +} + /* Common code for db_subscr_get_by_*() functions. */ static int db_sel(struct db_context *dbc, sqlite3_stmt *stmt, struct hlr_subscriber *subscr, const char **err) diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 493c235..863ec5c 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -66,9 +66,32 @@ fprintf(stderr, "\n"); \ } while (0) +/* Do db_get_auth_data() and verbosely assert that its return value is as expected. + * Print the subscriber struct to stderr to be validated by db_test.err. + * The results are then available in g_aud2g and g_aud3g. */ +#define ASSERT_SEL_AUD(imsi, expect_rc, expect_id) \ + do { \ + g_aud2g = (struct osmo_sub_auth_data){}; \ + g_aud3g = (struct osmo_sub_auth_data){}; \ + g_id = 0; \ + ASSERT_RC(db_get_auth_data(dbc, imsi, &g_aud2g, &g_aud3g, &g_id), expect_rc); \ + if (g_rc == 1) { \ + dump_aud("2G", &g_aud2g); \ + dump_aud("3G", &g_aud3g); \ + }\ + if (g_id != expect_id) {\ + fprintf(stderr, "MISMATCH: got subscriber id %"PRId64 \ + ", expected %"PRId64"\n", g_id, (int64_t)(expect_id)); \ + OSMO_ASSERT(g_id == expect_id); \ + } \ + fprintf(stderr, "\n"); \ + } while (0) + static struct db_context *dbc = NULL; static void *ctx = NULL; static struct hlr_subscriber g_subscr; +static struct osmo_sub_auth_data g_aud2g; +static struct osmo_sub_auth_data g_aud3g; static int g_rc; static int64_t g_id; @@ -386,6 +409,262 @@ comment_end(); } +static const struct sub_auth_data_str *mk_aud_2g(enum osmo_auth_algo algo, + const char *ki) +{ + static struct sub_auth_data_str aud; + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_GSM, + .algo = algo, + .u.gsm.ki = ki, + }; + return &aud; +} + +static const struct sub_auth_data_str *mk_aud_3g(enum osmo_auth_algo algo, + const char *opc, bool opc_is_op, + const char *k, unsigned int ind_bitlen) +{ + static struct sub_auth_data_str aud; + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_UMTS, + .algo = algo, + .u.umts.k = k, + .u.umts.opc = opc, + .u.umts.opc_is_op = opc_is_op ? 1 : 0, + .u.umts.ind_bitlen = ind_bitlen, + }; + return &aud; +} + +static void test_subscr_aud() +{ + int64_t id; + + comment_start(); + + comment("Get auth data for non-existent subscriber"); + ASSERT_SEL_AUD(unknown_imsi, 0, 0); + + comment("Create subscriber"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + + id = g_subscr.id; + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 2G only"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + /* same again */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Remove 2G auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + /* Removing nothing results in -ENOENT */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)), + -ENOENT); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 3G only"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", true, + "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + /* same again */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", true, + "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, + "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", false, + "DeafBeddedBabeAcceededFadedDecaf", + OSMO_MILENAGE_IND_BITLEN_MAX)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "CededEffacedAceFacedBadFadedBeef", false, + "BeefedCafeFaceAcedAddedDecadeFee", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Remove 3G auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + /* Removing nothing results in -ENOENT */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)), + -ENOENT); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "CededEffacedAceFacedBadFadedBeef", false, + "BeefedCafeFaceAcedAddedDecadeFee", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, + "asdfasdfasd", false, + "asdfasdfasdf", 99999)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 2G and 3G"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", false, + "DeafBeddedBabeAcceededFadedDecaf", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + + comment("Set invalid auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(99999, "f000000000000f00000000000f000000")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "0f000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", + OSMO_MILENAGE_IND_BITLEN_MAX + 1)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "X000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "f000000000000 f00000000000 f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Delete subscriber"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); + ASSERT_SEL(imsi, imsi0, -ENOENT); + + comment("Re-add subscriber and verify auth data didn't come back"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + + /* For this test to work, we want to get the same subscriber ID back, + * and make sure there are no auth data leftovers for this ID. */ + OSMO_ASSERT(id == g_subscr.id); + ASSERT_SEL_AUD(imsi0, -1, id); + + ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); + ASSERT_SEL(imsi, imsi0, -ENOENT); + + comment_end(); +} + static struct { bool verbose; } cmdline_opts = { @@ -460,6 +739,7 @@ OSMO_ASSERT(dbc); test_subscr_create_update_sel_delete(); + test_subscr_aud(); printf("Done\n"); return 0; diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 59b9ba1..5d3ab5f 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -711,3 +711,483 @@ ===== test_subscr_create_update_sel_delete: SUCCESS + +===== test_subscr_aud + +--- Get auth data for non-existent subscriber + +db_get_auth_data(dbc, unknown_imsi, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='999999999': No such subscriber + + + +--- Create subscriber + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 2G only + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v1, + .u.gsm.ki = '0123456789abcdef0123456789abcdef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v1, + .u.gsm.ki = '0123456789abcdef0123456789abcdef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v2, + .u.gsm.ki = 'beadedbeeaced1ebbeddefacedfacade', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'deafbeddedbabeacceededfadeddecaf', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = XOR, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: none + + +--- Remove 2G auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> -ENOENT + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = XOR, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 3G only + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'deaf0ff1ced0d0dabbedd1ced1cef00d', + .u.umts.opc_is_op = 1, + .u.umts.k = 'f1bbed0afd0ef0bd0ffed0ddf1fe0b0e', + .u.umts.amf = '0000', +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", OSMO_MILENAGE_IND_BITLEN_MAX)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 28, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'cededeffacedacefacedbadfadedbeef', + .u.umts.opc_is_op = 0, + .u.umts.k = 'beefedcafefaceacedaddeddecadefee', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Remove 3G auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)) --> -ENOENT + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'cededeffacedacefacedbadfadedbeef', + .u.umts.opc_is_op = 0, + .u.umts.k = 'beefedcafefaceacedaddeddecadefee', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, "asdfasdfasd", false, "asdfasdfasdf", 99999)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 2G and 3G + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Set invalid auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(99999, "f000000000000f00000000000f000000")) --> -EINVAL +DAUC Cannot update auth tokens: Unknown auth algo: 99999 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")) --> -EINVAL +DAUC Cannot update auth tokens: Invalid KI: 'f000000000000f00000000000f000000f00000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")) --> -EINVAL +DAUC Cannot update auth tokens: Invalid KI: 'f00' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")) --> -EINVAL +DAUC Cannot update auth tokens: auth algo not suited for 2G: MILENAGE + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "0f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid OP/OPC: '0f000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid K: '000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", OSMO_MILENAGE_IND_BITLEN_MAX + 1)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid ind_bitlen: 29 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "X000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid OP/OPC: 'X000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000 f00000000000 f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid K: 'f000000000000 f00000000000 f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Delete subscriber + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_delete_by_id(dbc, id) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber + + +--- Re-add subscriber and verify auth data didn't come back + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_delete_by_id(dbc, id) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber + +===== test_subscr_aud: SUCCESS + -- To view, visit https://gerrit.osmocom.org/4185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icb11b5e059fb920447a9aa414db1819a0c020529 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:46:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 01:46:14 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Add IPv6 support via tun device and "-t v6 --createif" In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4047 to look at the new patch set (#5). sgsnemu: Add IPv6 support via tun device and "-t v6 --createif" The idea is to only implement the GTP-C plane and configure the right link-local source address on the tun-device and let the regular (Linux) kernel take care of sending router solicitations and accepting/processing the related router advertisement. This avoids a lot of complexity in sgsnemu. For this to work, you must have /proc/sys/net/ipv6/conf/$tun/accept_ra set to either 1 (works only if no IPv6 forwarding/routing configured on your sgsnemu-running system) or 2 (works even if forwarding/routing is configured). Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Closes: OS#2518 --- M sgsnemu/sgsnemu.c 1 file changed, 61 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/47/4047/5 diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index c181603..fa295da 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1,6 +1,7 @@ /* * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -30,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -930,8 +932,18 @@ /* PDP Type */ if (!strcmp(args_info.pdp_type_arg, "v6")) options.pdp_type = PDP_EUA_TYPE_v6; - else + else if (!strcmp(args_info.pdp_type_arg, "v4")) options.pdp_type = PDP_EUA_TYPE_v4; + else { + SYS_ERR(DSGSN, LOGL_ERROR, 0, "Unsupported/unknown PDP Type '%s'\n", + args_info.pdp_type_arg); + return -1; + } + + if (options.pingcount && options.pdp_type != PDP_EUA_TYPE_v4) { + SYS_ERR(DSGSN, LOGL_ERROR, 0, "built-in ping only works with IPv4, use tun-device"); + return -1; + } return 0; @@ -1287,19 +1299,46 @@ return 0; } +/* Link-Local address prefix fe80::/64 */ +static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; + /* Callback for receiving messages from tun */ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; struct in46_addr src; struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; - src.len = 4; - src.v4.s_addr = iph->saddr; + if (iph->version == 4) { + if (len < sizeof(*iph) || len < 4*iph->ihl) { + printf("Dropping packet with too short IP header\n"); + return 0; + } + src.len = 4; + src.v4.s_addr = iph->saddr; + } else if (iph->version == 6) { + /* We only have a single entry in the hash table, and it consists of the link-local + * address "fe80::prefix". So we need to make sure to convert non-link-local source + * addresses to that format before looking up the hash table via ippool_getip() */ + src.len = 16; + if (!memcmp(ip6h->ip6_src.s6_addr, ll_prefix, sizeof(ll_prefix))) { + /* is a link-local address, we can do the hash lookup 1:1 */ + src.v6 = ip6h->ip6_src; + } else { + /* it is not a link-local address, so we must convert from the /64 prefix + * to the link-local format that's used in the hash table */ + memcpy(&src.v6.s6_addr[0], ll_prefix, sizeof(ll_prefix)); + memcpy(&src.v6.s6_addr[sizeof(ll_prefix)], ip6h->ip6_src.s6_addr, 16-sizeof(ll_prefix)); + } + } else { + printf("Dropping packet with invalid IP version %u\n", iph->version); + return 0; + } if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", - inet_ntoa(src.v4)); + in46a_ntoa(&src)); return 0; } @@ -1350,17 +1389,27 @@ } printf("Received create PDP context response. IP address: %s\n", - inet_ntoa(addr.v4)); + in46a_ntoa(&addr)); + + switch (addr.len) { + case 16: /* IPv6 */ + /* we have to enable the kernel to perform stateless autoconfiguration, + * i.e. send a router solicitation using the lover 64bits of the allocated + * EUA as interface identifier, as per 3GPP TS 29.061 Section 11.2.1.3.2 */ + memcpy(addr.v6.s6_addr, ll_prefix, sizeof(ll_prefix)); + printf("Derived IPv6 link-local address: %s\n", in46a_ntoa(&addr)); + break; + case 4: /* IPv4 */ + break; + } if ((options.createif) && (!options.net.s_addr)) { - struct in_addr m; -#ifdef HAVE_INET_ATON - inet_aton("255.255.255.255", &m); -#else - m.s_addr = -1; -#endif + size_t prefixlen = 32; + if (addr.len == 16) + prefixlen = 64; /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &addr.v4, &addr.v4, &m); + /* FIXME: use tun_addattr() not tun_setaddr() */ + tun_setaddr(tun, &addr, &addr, prefixlen); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; -- To view, visit https://gerrit.osmocom.org/4047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Gerrit-PatchSet: 5 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:46:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 01:46:14 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Add '--tun-device' option to specify TUN device name Message-ID: Review at https://gerrit.osmocom.org/4190 sgsnemu: Add '--tun-device' option to specify TUN device name This way, multiple sgsnemu instances can be runnig in parallel, each of them creating a different tun device for their respective PDP context Change-Id: Id12fbadf924a60db255b6d51b9f647aa51dd2e16 --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h M sgsnemu/sgsnemu.c 4 files changed, 90 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/90/4190/1 diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 60c0a25..441322b 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -70,6 +70,7 @@ " --defaultroute Create default route (default=off)", " --ipup=STRING Script to run after link-up", " --ipdown=STRING Script to run after link-down", + " --tun-device=STRING Name of the local network interface", " --pinghost=STRING Ping remote host", " --pingrate=INT Number of ping req per second (default=`1')", " --pingsize=INT Number of ping data bytes (default=`56')", @@ -94,6 +95,9 @@ struct cmdline_parser_params *params, const char *additional_error); +static int +cmdline_parser_required2(struct gengetopt_args_info *args_info, + const char *prog_name, const char *additional_error); struct line_list { char *string_arg; struct line_list *next; @@ -156,6 +160,7 @@ args_info->defaultroute_given = 0; args_info->ipup_given = 0; args_info->ipdown_given = 0; + args_info->tun_device_given = 0; args_info->pinghost_given = 0; args_info->pingrate_given = 0; args_info->pingsize_given = 0; @@ -233,6 +238,8 @@ args_info->ipup_orig = NULL; args_info->ipdown_arg = NULL; args_info->ipdown_orig = NULL; + args_info->tun_device_arg = NULL; + args_info->tun_device_orig = NULL; args_info->pinghost_arg = NULL; args_info->pinghost_orig = NULL; args_info->pingrate_arg = 1; @@ -288,13 +295,14 @@ args_info->defaultroute_help = gengetopt_args_info_help[33]; args_info->ipup_help = gengetopt_args_info_help[34]; args_info->ipdown_help = gengetopt_args_info_help[35]; - args_info->pinghost_help = gengetopt_args_info_help[36]; - args_info->pingrate_help = gengetopt_args_info_help[37]; - args_info->pingsize_help = gengetopt_args_info_help[38]; - args_info->pingcount_help = gengetopt_args_info_help[39]; - args_info->pingquiet_help = gengetopt_args_info_help[40]; - args_info->no_tx_gpdu_seq_help = gengetopt_args_info_help[41]; - args_info->pdp_type_help = gengetopt_args_info_help[42]; + args_info->tun_device_help = gengetopt_args_info_help[36]; + args_info->pinghost_help = gengetopt_args_info_help[37]; + args_info->pingrate_help = gengetopt_args_info_help[38]; + args_info->pingsize_help = gengetopt_args_info_help[39]; + args_info->pingcount_help = gengetopt_args_info_help[40]; + args_info->pingquiet_help = gengetopt_args_info_help[41]; + args_info->no_tx_gpdu_seq_help = gengetopt_args_info_help[42]; + args_info->pdp_type_help = gengetopt_args_info_help[43]; } @@ -419,6 +427,8 @@ free_string_field(&(args_info->ipup_orig)); free_string_field(&(args_info->ipdown_arg)); free_string_field(&(args_info->ipdown_orig)); + free_string_field(&(args_info->tun_device_arg)); + free_string_field(&(args_info->tun_device_orig)); free_string_field(&(args_info->pinghost_arg)); free_string_field(&(args_info->pinghost_orig)); free_string_field(&(args_info->pingrate_orig)); @@ -529,6 +539,9 @@ write_into_file(outfile, "ipup", args_info->ipup_orig, 0); if (args_info->ipdown_given) write_into_file(outfile, "ipdown", args_info->ipdown_orig, 0); + if (args_info->tun_device_given) + write_into_file(outfile, "tun-device", + args_info->tun_device_orig, 0); if (args_info->pinghost_given) write_into_file(outfile, "pinghost", args_info->pinghost_orig, 0); @@ -640,9 +653,37 @@ cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name) { - FIX_UNUSED(args_info); - FIX_UNUSED(prog_name); - return EXIT_SUCCESS; + int result = EXIT_SUCCESS; + + if (cmdline_parser_required2(args_info, prog_name, 0) > 0) + result = EXIT_FAILURE; + + if (result == EXIT_FAILURE) { + cmdline_parser_free(args_info); + exit(EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser_required2(struct gengetopt_args_info *args_info, + const char *prog_name, const char *additional_error) +{ + int error_occurred = 0; + FIX_UNUSED(additional_error); + + /* checks for required options */ + + /* checks for dependences among options */ + if (args_info->tun_device_given && !args_info->createif_given) { + fprintf(stderr, + "%s: '--tun-device' option depends on option 'createif'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + + return error_occurred; } static char *package_name = 0; @@ -837,6 +878,7 @@ {"defaultroute", 0, NULL, 0}, {"ipup", 1, NULL, 0}, {"ipdown", 1, NULL, 0}, + {"tun-device", 1, NULL, 0}, {"pinghost", 1, NULL, 0}, {"pingrate", 1, NULL, 0}, {"pingsize", 1, NULL, 0}, @@ -1355,6 +1397,22 @@ goto failure; } + /* Name of the local network interface. */ + else if (strcmp + (long_options[option_index].name, + "tun-device") == 0) { + + if (update_arg + ((void *)&(args_info->tun_device_arg), + &(args_info->tun_device_orig), + &(args_info->tun_device_given), + &(local_args_info.tun_device_given), + optarg, 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "tun-device", '-', + additional_error)) + goto failure; + + } /* Ping remote host. */ else if (strcmp (long_options[option_index].name, @@ -1460,6 +1518,12 @@ } /* switch */ } /* while */ + if (check_required) { + error_occurred += + cmdline_parser_required2(args_info, argv[0], + additional_error); + } + cmdline_parser_release(&local_args_info); if (error_occurred) diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index d8b3c26..7592eb5 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -54,6 +54,7 @@ option "defaultroute" - "Create default route" flag off option "ipup" - "Script to run after link-up" string no option "ipdown" - "Script to run after link-down" string no +option "tun-device" - "Name of the local network interface" string dependon="createif" no option "pinghost" - "Ping remote host" string no option "pingrate" - "Number of ping req per second" int default="1" no diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 1accfd0..9dc210e 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -236,6 +236,12 @@ /**< @brief Script to run after link-down original value given at command line. */ const char *ipdown_help; /**< @brief Script to run after link-down help description. */ + char *tun_device_arg; + /**< @brief Name of the local network interface. */ + char *tun_device_orig; + /**< @brief Name of the local network interface original value given at command line. */ + const char *tun_device_help; + /**< @brief Name of the local network interface help description. */ char *pinghost_arg; /**< @brief Ping remote host. */ char *pinghost_orig; @@ -347,6 +353,8 @@ /**< @brief Whether ipup was given. */ unsigned int ipdown_given; /**< @brief Whether ipdown was given. */ + unsigned int tun_device_given; + /**< @brief Whether tun-device was given. */ unsigned int pinghost_given; /**< @brief Whether pinghost was given. */ unsigned int pingrate_given; diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index fa295da..c83aebd 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -84,6 +84,7 @@ struct { int debug; /* Print debug messages */ int createif; /* Create local network interface */ + char *tun_dev_name; struct in_addr netaddr, destaddr, net; /* Network interface */ size_t prefixlen; char *ipup, *ipdown; /* Filename of scripts */ @@ -289,6 +290,8 @@ printf("contexts: %d\n", args_info.contexts_arg); printf("timelimit: %d\n", args_info.timelimit_arg); printf("createif: %d\n", args_info.createif_flag); + if (args_info.tun_device_arg) + printf("tun-device: %d\n", args_info.tun_device_arg); if (args_info.ipup_arg) printf("ipup: %s\n", args_info.ipup_arg); if (args_info.ipdown_arg) @@ -345,6 +348,8 @@ printf("contexts: %d\n", args_info.contexts_arg); printf("timelimit: %d\n", args_info.timelimit_arg); printf("createif: %d\n", args_info.createif_flag); + if (args_info.tun_device_arg) + printf("tun-device: %d\n", args_info.tun_device_arg); if (args_info.ipup_arg) printf("ipup: %s\n", args_info.ipup_arg); if (args_info.ipdown_arg) @@ -863,6 +868,7 @@ /* createif */ options.createif = args_info.createif_flag; + options.tun_dev_name = args_info.tun_device_arg; /* net */ /* Store net as in_addr net and mask */ @@ -1525,7 +1531,7 @@ if (options.createif) { printf("Setting up interface\n"); /* Create a tunnel interface */ - if (tun_new((struct tun_t **)&tun, NULL)) { + if (tun_new((struct tun_t **)&tun, options.tun_dev_name)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Failed to create tun"); exit(1); -- To view, visit https://gerrit.osmocom.org/4190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id12fbadf924a60db255b6d51b9f647aa51dd2e16 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:46:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 01:46:14 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Print warnings on broken IPv6 configuration (acept_ra) Message-ID: Review at https://gerrit.osmocom.org/4191 sgsnemu: Print warnings on broken IPv6 configuration (acept_ra) When sgsnemu is used for an IPv6 pdp context, we rely on the router discovery procedure and SLAAC to set the correct IPv6 address/prefix on the tun device. This requires the system to be configure to accept router-advertisements on the tun device. Let's print a warning if accept_ra for the specific tun device is set to a wrong value. We're leaving it up to the user to either set a system-wide /proc/sys/net/ipv6/conf/default/accept_ra or to configure this in an ip-up script used together with sgsnemu. Change-Id: I563092ca35bc74f035a5023e11256779aac46e11 --- M sgsnemu/sgsnemu.c 1 file changed, 57 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/91/4191/1 diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index c83aebd..a85c9cf 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -968,6 +968,42 @@ return 0; } +/* read a single value from a /procc file, up to 255 bytes, callee-allocated */ +static char *proc_read(const char *path) +{ + char *ret = NULL; + FILE *f; + + f = fopen(path, "r"); + if (!f) + return NULL; + + ret = malloc(256); + if (!ret) + goto out; + + if (!fgets(ret, 256, f)) { + free(ret); + ret = NULL; + goto out; + } + return ret; + +out: + fclose(f); + return ret; +} + +/* Read value of a /proc/sys/net/ipv6/conf file for given device. + * Memory is dynamically allocated, caller must free it later. */ +static char *proc_ipv6_conf_read(const char *dev, const char *file) +{ + const char *fmt = "/proc/sys/net/ipv6/conf/%s/%s"; + char path[strlen(fmt) + strlen(dev) + strlen(file)]; + snprintf(path, sizeof(path), fmt, dev, file); + return proc_read(path); +} + char *print_ipprot(int t) { switch (t) { @@ -1425,6 +1461,27 @@ tun_runscript(tun, options.ipup); } + /* now that ip-up has been executed, check if we are configured to + * accept router advertisements */ + if (options.createif && options.pdp_type == PDP_EUA_TYPE_v6) { + char *accept_ra, *forwarding; + + accept_ra = proc_ipv6_conf_read(tun->devname, "accept_ra"); + forwarding = proc_ipv6_conf_read(tun->devname, "forwarding"); + if (!accept_ra || !forwarding) + printf("Could not open proc file for %s ?!?\n", tun->devname); + else { + if (!strcmp(accept_ra, "0") || + (!strcmp(forwarding, "1") && !strcmp(accept_ra, "1"))) { + printf("%s is %s, i.e. your tun device is not configured to accept " + "router advertisements; SLAAC will not suceed, please " + "fix your setup!\n"); + } + free(accept_ra); + free(forwarding); + } + } + ipset((struct iphash_t *)pdp->peer, &addr); state = 2; /* Connected */ -- To view, visit https://gerrit.osmocom.org/4191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I563092ca35bc74f035a5023e11256779aac46e11 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:48:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 01:48:01 +0000 Subject: osmo-ggsn[master]: sgsnemu: Add IPv6 support via tun device and "-t v6 --createif" In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 > There's no such path on my system but there is /proc/sys/net/ipv6/conf/*/accept_ra. fixed. > Also, if it's known not to work for certain settings, than we can > check accept_ra for a given interface and fail with error message > if it's incompatible with "-t v6 --createif" setting. That would > save some troubleshooting time in future. I'll address this in https://gerrit.osmocom.org/#/c/4191 -- To view, visit https://gerrit.osmocom.org/4047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Gerrit-PatchSet: 5 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 01:49:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 01:49:02 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Add IPv6 support via tun device and "-t v6 --createif" In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Add IPv6 support via tun device and "-t v6 --createif" ...................................................................... sgsnemu: Add IPv6 support via tun device and "-t v6 --createif" The idea is to only implement the GTP-C plane and configure the right link-local source address on the tun-device and let the regular (Linux) kernel take care of sending router solicitations and accepting/processing the related router advertisement. This avoids a lot of complexity in sgsnemu. For this to work, you must have /proc/sys/net/ipv6/conf/$tun/accept_ra set to either 1 (works only if no IPv6 forwarding/routing configured on your sgsnemu-running system) or 2 (works even if forwarding/routing is configured). Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Closes: OS#2518 --- M sgsnemu/sgsnemu.c 1 file changed, 61 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index c181603..fa295da 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1,6 +1,7 @@ /* * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -30,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -930,8 +932,18 @@ /* PDP Type */ if (!strcmp(args_info.pdp_type_arg, "v6")) options.pdp_type = PDP_EUA_TYPE_v6; - else + else if (!strcmp(args_info.pdp_type_arg, "v4")) options.pdp_type = PDP_EUA_TYPE_v4; + else { + SYS_ERR(DSGSN, LOGL_ERROR, 0, "Unsupported/unknown PDP Type '%s'\n", + args_info.pdp_type_arg); + return -1; + } + + if (options.pingcount && options.pdp_type != PDP_EUA_TYPE_v4) { + SYS_ERR(DSGSN, LOGL_ERROR, 0, "built-in ping only works with IPv4, use tun-device"); + return -1; + } return 0; @@ -1287,19 +1299,46 @@ return 0; } +/* Link-Local address prefix fe80::/64 */ +static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; + /* Callback for receiving messages from tun */ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; struct in46_addr src; struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; - src.len = 4; - src.v4.s_addr = iph->saddr; + if (iph->version == 4) { + if (len < sizeof(*iph) || len < 4*iph->ihl) { + printf("Dropping packet with too short IP header\n"); + return 0; + } + src.len = 4; + src.v4.s_addr = iph->saddr; + } else if (iph->version == 6) { + /* We only have a single entry in the hash table, and it consists of the link-local + * address "fe80::prefix". So we need to make sure to convert non-link-local source + * addresses to that format before looking up the hash table via ippool_getip() */ + src.len = 16; + if (!memcmp(ip6h->ip6_src.s6_addr, ll_prefix, sizeof(ll_prefix))) { + /* is a link-local address, we can do the hash lookup 1:1 */ + src.v6 = ip6h->ip6_src; + } else { + /* it is not a link-local address, so we must convert from the /64 prefix + * to the link-local format that's used in the hash table */ + memcpy(&src.v6.s6_addr[0], ll_prefix, sizeof(ll_prefix)); + memcpy(&src.v6.s6_addr[sizeof(ll_prefix)], ip6h->ip6_src.s6_addr, 16-sizeof(ll_prefix)); + } + } else { + printf("Dropping packet with invalid IP version %u\n", iph->version); + return 0; + } if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", - inet_ntoa(src.v4)); + in46a_ntoa(&src)); return 0; } @@ -1350,17 +1389,27 @@ } printf("Received create PDP context response. IP address: %s\n", - inet_ntoa(addr.v4)); + in46a_ntoa(&addr)); + + switch (addr.len) { + case 16: /* IPv6 */ + /* we have to enable the kernel to perform stateless autoconfiguration, + * i.e. send a router solicitation using the lover 64bits of the allocated + * EUA as interface identifier, as per 3GPP TS 29.061 Section 11.2.1.3.2 */ + memcpy(addr.v6.s6_addr, ll_prefix, sizeof(ll_prefix)); + printf("Derived IPv6 link-local address: %s\n", in46a_ntoa(&addr)); + break; + case 4: /* IPv4 */ + break; + } if ((options.createif) && (!options.net.s_addr)) { - struct in_addr m; -#ifdef HAVE_INET_ATON - inet_aton("255.255.255.255", &m); -#else - m.s_addr = -1; -#endif + size_t prefixlen = 32; + if (addr.len == 16) + prefixlen = 64; /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &addr.v4, &addr.v4, &m); + /* FIXME: use tun_addattr() not tun_setaddr() */ + tun_setaddr(tun, &addr, &addr, prefixlen); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; -- To view, visit https://gerrit.osmocom.org/4047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Gerrit-PatchSet: 5 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:02:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:02:51 +0000 Subject: osmo-gsm-manuals[master]: logging: document alarms target In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I95ce5f3db38616608590e02ee79eb3a7e6e4ea14 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:02:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:02:57 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: logging: document alarms target In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: logging: document alarms target ...................................................................... logging: document alarms target Add subsection describing "log alarms" target. Change-Id: I95ce5f3db38616608590e02ee79eb3a7e6e4ea14 Fixes: OS#1913 --- M common/chapters/logging.adoc 1 file changed, 17 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index 94fa898..85975bb 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -127,6 +127,23 @@ one only for logging, while the other is used for interacting with the system. Another option would be to use different log target. +==== Logging to the ring buffer + +To avoid having separate VTY session just for logging output while still having immediate access to them, +one can use `alarms` target. It lets you store the log messages inside the ring buffer of a given size which +is available with `show alarms` command. + +It's configured as follows: +---- +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log alarms 98 +OsmoBSC(config-log)# +---- + +In the example above 98 is the desired size of the ring buffer (number of messages). Once it's filled, +the incoming log messages will push out the oldest messages available in the buffer. + ==== Logging to a file As opposed to Logging to the VTY, logging to files is persistent and -- To view, visit https://gerrit.osmocom.org/4155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95ce5f3db38616608590e02ee79eb3a7e6e4ea14 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:03:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:03:55 +0000 Subject: libosmocore[master]: Fix build on older systems In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4166 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bcac37ee1847596b49122f9307bd2689ba71b1b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:03:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:03:59 +0000 Subject: [MERGED] libosmocore[master]: Fix build on older systems In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix build on older systems ...................................................................... Fix build on older systems Make sure GRND_NONBLOCK is always defined, even when using syscall directly. Change-Id: I1bcac37ee1847596b49122f9307bd2689ba71b1b Related: OS#1694 --- M src/gsm/gsm_utils.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index f572c64..e3f792e 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -101,6 +101,9 @@ #include #elif HAVE_DECL_SYS_GETRANDOM #include +#ifndef GRND_NONBLOCK +#define GRND_NONBLOCK 0x0001 +#endif #endif /* ETSI GSM 03.38 6.2.1 and 6.2.1.1 default alphabet -- To view, visit https://gerrit.osmocom.org/4166 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1bcac37ee1847596b49122f9307bd2689ba71b1b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:05:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:05:44 +0000 Subject: osmo-bsc[master]: OML: consider RSL link state In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:06:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:06:07 +0000 Subject: osmo-bts[master]: l1sap: Improve log msg when frame diff >1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4165 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f7b3ffbf7ce3a8d8d6872e4281ef228f4c5527f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:06:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:06:47 +0000 Subject: osmo-sgsn[master]: Check for correct P-TMSI allocation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4168 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa71bbc8df726c74aceaf9ae3eb49e124a53910a Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:07:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:07:43 +0000 Subject: osmo-sgsn[master]: Move P-TMSI alloc/update into separate function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie5466326a851867d55da389bf18b240acd3f0fc5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:09:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:09:36 +0000 Subject: osmo-bsc[master]: Migrate from OpenSSL to osmo_get_rand_id() In-Reply-To: References: Message-ID: Patch Set 2: the question from the release management point of view is: How do you make sure that the libosmocore version has this new function? Should we postpone merging this until a new libosmocore has been tagged, and then require that minimum version from configure.ac here? same for all three patches in this topic. -- To view, visit https://gerrit.osmocom.org/3819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia57bf1300525cf3c247284fe966b1c415c2d53e2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:10:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:10:45 +0000 Subject: osmo-bsc[master]: SI2q: fix generation for multiple UARFCNs In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4160 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:11:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:11:48 +0000 Subject: libosmocore[master]: gsm: make osmo_imsi_str_valid() NULL-safe In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:12:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:12:06 +0000 Subject: osmo-gsm-tester[master]: default-suites: Enable voice suite In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4152 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I89174514b2af8909fd252ba4f694818b7353db8c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:12:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:12:46 +0000 Subject: osmo-gsm-tester[master]: modem: Implement voice calls in modem and add voice suite In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib402effc830db293f27a877658894e454a93a606 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:13:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:13:00 +0000 Subject: osmo-gsm-tester[master]: debug: Add voicecall related method to interactive shell In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2df68bf4fba0fb542eebdeb515a3dac6d5e575e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:45:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:45:20 +0000 Subject: [PATCH] osmo-ci[master]: nightly-pacakges: don't copy over gsm_data_shared.[ch] anymore Message-ID: Review at https://gerrit.osmocom.org/4192 nightly-pacakges: don't copy over gsm_data_shared.[ch] anymore This is no longer needed by upstream osmo-bts since Change-Id I9f004fb5c4c1db29d4792dfd281d388c7063da13 Change-Id: Ie53482a1538d1559e764da86dbbb78031c9c386b --- M scripts/osmocom-nightly-packages.sh 1 file changed, 0 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/92/4192/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 69f020c..dd84b4f 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -62,14 +62,6 @@ build osmo-stp build osmo-trx build osmo-sip-connector - -cp openbsc/openbsc/include/openbsc/gsm_data_shared.h osmo-bts/include/openbsc/ -cp openbsc/openbsc/src/libcommon/gsm_data_shared.c osmo-bts/src/common/gsm_data_shared.c -cd osmo-bts -git add include/openbsc/gsm_data_shared.h -git add src/common/gsm_data_shared.c -git commit -m "Copy OpenBSC files needed for the build" -cd ../ build osmo-bts build osmo-pcu build osmo-hlr -- To view, visit https://gerrit.osmocom.org/4192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie53482a1538d1559e764da86dbbb78031c9c386b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:47:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:47:12 +0000 Subject: osmo-ci[master]: nightly-pacakges: don't copy over gsm_data_shared.[ch] anymore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie53482a1538d1559e764da86dbbb78031c9c386b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 03:47:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 03:47:15 +0000 Subject: [MERGED] osmo-ci[master]: nightly-pacakges: don't copy over gsm_data_shared.[ch] anymore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: nightly-pacakges: don't copy over gsm_data_shared.[ch] anymore ...................................................................... nightly-pacakges: don't copy over gsm_data_shared.[ch] anymore This is no longer needed by upstream osmo-bts since Change-Id I9f004fb5c4c1db29d4792dfd281d388c7063da13 Change-Id: Ie53482a1538d1559e764da86dbbb78031c9c386b --- M scripts/osmocom-nightly-packages.sh 1 file changed, 0 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 69f020c..dd84b4f 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -62,14 +62,6 @@ build osmo-stp build osmo-trx build osmo-sip-connector - -cp openbsc/openbsc/include/openbsc/gsm_data_shared.h osmo-bts/include/openbsc/ -cp openbsc/openbsc/src/libcommon/gsm_data_shared.c osmo-bts/src/common/gsm_data_shared.c -cd osmo-bts -git add include/openbsc/gsm_data_shared.h -git add src/common/gsm_data_shared.c -git commit -m "Copy OpenBSC files needed for the build" -cd ../ build osmo-bts build osmo-pcu build osmo-hlr -- To view, visit https://gerrit.osmocom.org/4192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie53482a1538d1559e764da86dbbb78031c9c386b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 10 04:53:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 04:53:43 +0000 Subject: osmo-hlr[master]: cosmetic: rename db_subscr_get() to db_subscr_get_by_imsi() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4171 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I32fa676ccc5c10eba834c4390c8a42476b9c1961 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 04:53:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 04:53:48 +0000 Subject: osmo-hlr[master]: cosmetic: prepend DB_STMT_ to enum stmt_idx entries In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51b677db31a1ebbbc45dc7925074de7493fbde1f Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 04:54:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 04:54:34 +0000 Subject: osmo-hlr[master]: cosmetic: refactor db_bind_imsi() as db_bind_text() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I87bc46a23a724677e8319d6a4b032976b7ba9394 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 04:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 04:54:46 +0000 Subject: osmo-hlr[master]: cosmetic: multi-line DB_STMT_AUC_BY_IMSI In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4173 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf09f4bbb298a516aa52c81e3ca67d9d91d8c7c2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 04:55:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 04:55:10 +0000 Subject: osmo-hlr[master]: cosmetic: log IMSI='', log "no such subscriber" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ec8ab5e67d4e95083f6e39232fc91ebaa080cb8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 04:56:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 04:56:59 +0000 Subject: osmo-hlr[master]: cosmetic: don't log about missing SQLite log cb In-Reply-To: References: Message-ID: Patch Set 1: it could still be a debug/info message and the text could mention "sqlite compiled without support for it?" or the like. I still think that the user should shomehow be able to know if the log callback was successfully registred or not. Maybe there's even a way to query sqlite if it has thta capability and hence registration should succeed? -- To view, visit https://gerrit.osmocom.org/4175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 04:57:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 04:57:22 +0000 Subject: osmo-hlr[master]: add db_bind_int() and db_bind_int64() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I705a15eef242c98feb6e95a883916f6cf8173d70 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 04:57:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 04:57:55 +0000 Subject: osmo-hlr[master]: add db_subscr_create(), db_subscr_delete(), db_subscr_update... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I725273d36234331093e7fff7d5f12f6be6ab2623 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 04:58:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 04:58:17 +0000 Subject: osmo-hlr[master]: add initial db_test: creating and deleting subscribers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2a0d277f55162bf5ceb0fc7d50390f2994daed71 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 04:59:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 04:59:43 +0000 Subject: osmo-hlr[master]: less noise: simplify db_remove_reset() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21678463e59f607f5f5c5732963e274392f0fffd Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 05:00:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 05:00:34 +0000 Subject: osmo-hlr[master]: db: use int64_t as subscriber id In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I83a47289a48ac37da0f712845d422e897a5e8171 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 05:01:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 05:01:29 +0000 Subject: osmo-hlr[master]: add db_subscr_get_by_msisdn() and db_subscr_get_by_id() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6d0ddd1b7e3f6b180b4b1b2663c5725d2a4a9428 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 05:02:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 05:02:19 +0000 Subject: osmo-hlr[master]: refactor db_subscr_ps() to db_subscr_nam() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e70e15228f5bb10bee6758ae5dc9687d65839bd Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 05:02:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 05:02:43 +0000 Subject: osmo-hlr[master]: refactor db_subscr_lu() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35665e84ddbe54a6f218b24033df969ad2e669a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 05:03:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 05:03:19 +0000 Subject: osmo-hlr[master]: refactor db_subscr_purge In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iad49d29b90a708c6cf55bfb3bcc02d9e29001a15 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 05:04:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 05:04:34 +0000 Subject: osmo-hlr[master]: add db_subscr_update_aud_by_id(), complete db_subscr_delete_... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb11b5e059fb920447a9aa414db1819a0c020529 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 05:05:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 05:05:04 +0000 Subject: osmo-hlr[master]: refactor db_get_auth_data return val In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I006f471962bdad95d00a3a4c41a28ebbc9740884 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 05:05:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 05:05:21 +0000 Subject: osmo-hlr[master]: code undup: use db_remove_reset() in db_auc.c In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I32d728e2b8a9771421c097647aa0e060e29a601f Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 05:05:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 05:05:41 +0000 Subject: osmo-hlr[master]: fix db_update_sqn(): reset stmt in all error cases In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d870d405e2e0a830360d9ad19f0a3f9e09d8cf2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 05:05:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 05:05:58 +0000 Subject: osmo-hlr[master]: code undup: use db_bind_text() in db_get_auth_data() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I49bd5eb78170cf4cdf8abb386c766d20d9f1cf73 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 08:17:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 08:17:43 +0000 Subject: [MERGED] osmo-sgsn[master]: Move P-TMSI alloc/update into separate function In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Move P-TMSI alloc/update into separate function ...................................................................... Move P-TMSI alloc/update into separate function Remove code duplication by allocating and assigning P-TMSI in a static function. Change-Id: Ie5466326a851867d55da389bf18b240acd3f0fc5 --- M src/gprs/gprs_gmm.c 1 file changed, 16 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 7e109b4..dff84a9 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1235,6 +1235,19 @@ return gsm48_gmm_authorize(ctx); } +/* Allocate a new P-TMSI and change context state */ +static inline void ptmsi_update(struct sgsn_mm_ctx *ctx) +{ + uint32_t ptmsi; + /* Don't change the P-TMSI if a P-TMSI re-assignment is under way */ + if (ctx->gmm_state != GMM_COMMON_PROC_INIT) { + ptmsi = sgsn_alloc_ptmsi(); + ctx->p_tmsi_old = ctx->p_tmsi; + ctx->p_tmsi = ptmsi; + } + ctx->gmm_state = GMM_COMMON_PROC_INIT; +} + /* Section 9.4.1 Attach request */ static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg, struct gprs_llc_llme *llme) @@ -1391,12 +1404,7 @@ } #ifdef PTMSI_ALLOC /* Allocate a new P-TMSI (+ P-TMSI signature) and update TLLI */ - /* Don't change the P-TMSI if a P-TMSI re-assignment is under way */ - if (ctx->gmm_state != GMM_COMMON_PROC_INIT) { - ctx->p_tmsi_old = ctx->p_tmsi; - ctx->p_tmsi = sgsn_alloc_ptmsi(); - } - ctx->gmm_state = GMM_COMMON_PROC_INIT; + ptmsi_update(ctx); #endif if (ctx->ran_type == MM_CTX_T_GERAN_Gb) { @@ -1711,16 +1719,11 @@ rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_RA_UPDATE]); #ifdef PTMSI_ALLOC - /* Don't change the P-TMSI if a P-TMSI re-assignment is under way */ - if (mmctx->gmm_state != GMM_COMMON_PROC_INIT) { - mmctx->p_tmsi_old = mmctx->p_tmsi; - mmctx->p_tmsi = sgsn_alloc_ptmsi(); - } + ptmsi_update(mmctx); + /* Start T3350 and re-transmit up to 5 times until ATTACH COMPLETE */ mmctx->t3350_mode = GMM_T3350_MODE_RAU; mmctx_timer_start(mmctx, 3350, sgsn->cfg.timers.T3350); - - mmctx->gmm_state = GMM_COMMON_PROC_INIT; #else /* Make sure we are NORMAL (i.e. not SUSPENDED anymore) */ mmctx->gmm_state = GMM_REGISTERED_NORMAL; -- To view, visit https://gerrit.osmocom.org/4167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie5466326a851867d55da389bf18b240acd3f0fc5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 08:17:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 08:17:49 +0000 Subject: [MERGED] osmo-sgsn[master]: Check for correct P-TMSI allocation In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Check for correct P-TMSI allocation ...................................................................... Check for correct P-TMSI allocation Do not assign new P-TMSI if allocation failed. Change-Id: Ifa71bbc8df726c74aceaf9ae3eb49e124a53910a --- M src/gprs/gprs_gmm.c 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index dff84a9..d11ecce 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1242,8 +1242,11 @@ /* Don't change the P-TMSI if a P-TMSI re-assignment is under way */ if (ctx->gmm_state != GMM_COMMON_PROC_INIT) { ptmsi = sgsn_alloc_ptmsi(); - ctx->p_tmsi_old = ctx->p_tmsi; - ctx->p_tmsi = ptmsi; + if (ptmsi != GSM_RESERVED_TMSI) { + ctx->p_tmsi_old = ctx->p_tmsi; + ctx->p_tmsi = ptmsi; + } else + LOGMMCTXP(LOGL_ERROR, ctx, "P-TMSI allocation failure: using old one.\n"); } ctx->gmm_state = GMM_COMMON_PROC_INIT; } -- To view, visit https://gerrit.osmocom.org/4168 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifa71bbc8df726c74aceaf9ae3eb49e124a53910a Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 08:17:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 08:17:58 +0000 Subject: [MERGED] osmo-bsc[master]: OML: consider RSL link state In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: OML: consider RSL link state ...................................................................... OML: consider RSL link state OML link state is available via vty ("sh bts 0" command) and ctrl ("oml-connection-state" RO variable). When showing OML link state, take into consideration RSL link state as well: if OML is up but RSL is missing show it as degraded. That's implemented via BTS model-specific functions (currently Sysmo- and Nano- BTS only) Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Related: OS#2486 --- M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h M src/libbsc/abis_nm.c M src/libbsc/bsc_ctrl_commands.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/bts_ipaccess_nanobts.c 7 files changed, 39 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 6814662..429526d 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -654,6 +654,9 @@ extern const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1]; extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1]; +char *get_oml_status(const struct gsm_bts *bts); +char *get_model_oml_status(const struct gsm_bts *bts); + /* control interface handling */ int bsc_base_ctrl_cmds_install(void); diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index f41bac4..240be1c 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -546,6 +546,7 @@ bool started; int (*start)(struct gsm_network *net); int (*oml_rcvmsg)(struct msgb *msg); + char * (*oml_status)(const struct gsm_bts *bts); void (*e1line_bind_ops)(struct e1inp_line *line); diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index 9567cfa..f0dfe9e 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -683,6 +683,34 @@ return 0; } +static inline bool all_trx_rsl_connected(const struct gsm_bts *bts) +{ + const struct gsm_bts_trx *trx; + + llist_for_each_entry(trx, &bts->trx_list, list) { + if (!trx->rsl_link) + return false; + } + + return true; +} + +char *get_oml_status(const struct gsm_bts *bts) +{ + if (bts->oml_link) + return all_trx_rsl_connected(bts) ? "connected" : "degraded"; + + return "disconnected"; +} + +char *get_model_oml_status(const struct gsm_bts *bts) +{ + if (bts->model->oml_status) + return bts->model->oml_status(bts); + + return "unknown"; +} + void abis_nm_queue_send_next(struct gsm_bts *bts) { int wait = 0; diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c index 7c2bfb5..d925e67 100644 --- a/src/libbsc/bsc_ctrl_commands.c +++ b/src/libbsc/bsc_ctrl_commands.c @@ -231,9 +231,10 @@ static int get_bts_oml_conn(struct ctrl_cmd *cmd, void *data) { - struct gsm_bts *bts = cmd->node; + const struct gsm_bts *bts = cmd->node; - cmd->reply = bts->oml_link ? "connected" : "disconnected"; + cmd->reply = get_model_oml_status(bts); + return CTRL_CMD_REPLY; } diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index f3e13e2..f5f265f 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -38,6 +38,7 @@ #include #include #include +#include /* global pointer to the gsm network data structure */ extern struct gsm_network *bsc_gsmnet; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index f1c78c8..43cb282 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -308,9 +308,8 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: "); + vty_out(vty, " OML Link state: %s", get_model_oml_status(bts)); if (bts->oml_link) { - vty_out(vty, "connected"); if (bts->uptime) { rc = clock_gettime(CLOCK_MONOTONIC, &tp); if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ @@ -320,8 +319,7 @@ sec % 60, VTY_NEWLINE); } } - } else - vty_out(vty, "disconnected.%s", VTY_NEWLINE); + } } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c index 87ec7b2..dbb0e4f 100644 --- a/src/libbsc/bts_ipaccess_nanobts.c +++ b/src/libbsc/bts_ipaccess_nanobts.c @@ -52,6 +52,7 @@ .name = "nanobts", .start = bts_model_nanobts_start, .oml_rcvmsg = &abis_nm_rcvmsg, + .oml_status = &get_oml_status, .e1line_bind_ops = bts_model_nanobts_e1line_bind_ops, .nm_att_tlvdef = { .def = { -- To view, visit https://gerrit.osmocom.org/4169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 08:21:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 10 Oct 2017 08:21:00 +0000 Subject: [MERGED] osmo-bts[master]: l1sap: Improve log msg when frame diff >1 In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: l1sap: Improve log msg when frame diff >1 ...................................................................... l1sap: Improve log msg when frame diff >1 Print the two fn values to understand better the wrong behaviour. Change-Id: I4f7b3ffbf7ce3a8d8d6872e4281ef228f4c5527f --- M src/common/l1sap.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 1b3a3ad..763b355 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -456,7 +456,8 @@ frames_expired = info_time_ind->fn - btsb->gsm_time.fn; if (frames_expired > 1) { LOGP(DL1P, LOGL_ERROR, - "Invalid condition detected: Frame difference is > 1!\n"); + "Invalid condition detected: Frame difference is %"PRIu32"-%"PRIu32" > 1!\n", + info_time_ind->fn, btsb->gsm_time.fn); } /* Update our data structures with the current GSM time */ -- To view, visit https://gerrit.osmocom.org/4165 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f7b3ffbf7ce3a8d8d6872e4281ef228f4c5527f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 10 09:27:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 10 Oct 2017 09:27:39 +0000 Subject: [PATCH] osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4147 to look at the new patch set (#2). client: add ip address parsing to the client Some MGCP messages (CRCX, MDCX) return IP-Addresses. Make use of this information. Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 33 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/47/4147/2 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 9368a76..eec010d 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -2,6 +2,7 @@ #include #include +#include #include @@ -36,6 +37,7 @@ char *body; struct mgcp_response_head head; uint16_t audio_port; + char audio_ip[INET_ADDRSTRLEN]; }; enum mgcp_verb { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 175f81a..49a8c78 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -174,7 +174,7 @@ } /* Parse a line like "m=audio 16002 RTP/AVP 98" */ -static int mgcp_parse_audio(struct mgcp_response *r, const char *line) +static int mgcp_parse_audio_port(struct mgcp_response *r, const char *line) { if (sscanf(line, "m=audio %hu", &r->audio_port) != 1) @@ -184,7 +184,25 @@ response_parse_failure: LOGP(DLMGCP, LOGL_ERROR, - "Failed to parse MGCP response header\n"); + "Failed to parse MGCP response header (audio port)\n"); + return -EINVAL; +} + +/* Parse a line like "c=IN IP4 10.11.12.13" */ +static int mgcp_parse_audio_ip(struct mgcp_response *r, const char *line) +{ + if (strlen(line) < 16) + goto response_parse_failure; + + if (memcmp("c=IN IP4 ", line, 9) != 0) + goto response_parse_failure; + + strcpy(r->audio_ip, line + 9); + return 0; + +response_parse_failure: + LOGP(DLMGCP, LOGL_ERROR, + "Failed to parse MGCP response header (audio ip)\n"); return -EINVAL; } @@ -213,7 +231,12 @@ switch (line[0]) { case 'm': - rc = mgcp_parse_audio(r, line); + rc = mgcp_parse_audio_port(r, line); + if (rc) + return rc; + break; + case 'c': + rc = mgcp_parse_audio_ip(r, line); if (rc) return rc; break; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 1ed6a9a..1bce71a 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -102,11 +102,13 @@ " head.response_code = %d\n" " head.trans_id = %u\n" " head.comment = %s\n" - " audio_port = %u\n", + " audio_port = %u\n" + " audio_ip = %s\n", response->head.response_code, response->head.trans_id, response->head.comment, - response->audio_port + response->audio_port, + response->audio_ip ); } diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index 7c4819d..3e84e89 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,6 +28,7 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + audio_ip = 10.9.1.120 Generated CRCX message: CRCX 1 23 at mgw MGCP 1.0 -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 10 10:30:36 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 10:30:36 +0000 Subject: [PATCH] libosmocore[master]: Check for getrandom syscall directly Message-ID: Review at https://gerrit.osmocom.org/4193 Check for getrandom syscall directly The ./configure check for SYS_getrandom fails on some systems for unknown reason. Let's drop it and check for SYS_getrandom availability directly. Change-Id: I028724d41b3f5495a1a8adb51a5341de31ed0d82 --- M configure.ac M src/gsm/gsm_utils.c 2 files changed, 2 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/4193/1 diff --git a/configure.ac b/configure.ac index d9390cf..33c151e 100644 --- a/configure.ac +++ b/configure.ac @@ -73,9 +73,6 @@ AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") -# check for syscal fallback on glibc < 2.25 - can be removed once glibc version requirement is bumped -AC_CHECK_DECLS([SYS_getrandom], [], [], [[#include ]]) - # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index e3f792e..0c07a57 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -99,7 +99,7 @@ /* FIXME: this can be removed once we bump glibc requirements to 2.25: */ #if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) #include -#elif HAVE_DECL_SYS_GETRANDOM +#else #include #ifndef GRND_NONBLOCK #define GRND_NONBLOCK 0x0001 @@ -417,7 +417,7 @@ #if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) rc = getrandom(out, len, GRND_NONBLOCK); -#elif HAVE_DECL_SYS_GETRANDOM +#elif defined SYS_getrandom #pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") /* FIXME: this can be removed once we bump glibc requirements to 2.25: */ rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK); -- To view, visit https://gerrit.osmocom.org/4193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I028724d41b3f5495a1a8adb51a5341de31ed0d82 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 10:52:36 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 10:52:36 +0000 Subject: [PATCH] libosmocore[master]: Check for getrandom syscall directly In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4193 to look at the new patch set (#2). Check for getrandom syscall directly The ./configure check for SYS_getrandom fails on some systems for unknown reason. Let's drop it and check for SYS_getrandom availability directly. Change-Id: I028724d41b3f5495a1a8adb51a5341de31ed0d82 --- M configure.ac M src/gsm/gsm_utils.c 2 files changed, 2 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/4193/2 diff --git a/configure.ac b/configure.ac index d9390cf..33c151e 100644 --- a/configure.ac +++ b/configure.ac @@ -73,9 +73,6 @@ AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") -# check for syscal fallback on glibc < 2.25 - can be removed once glibc version requirement is bumped -AC_CHECK_DECLS([SYS_getrandom], [], [], [[#include ]]) - # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index e3f792e..64321ce 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -99,7 +99,7 @@ /* FIXME: this can be removed once we bump glibc requirements to 2.25: */ #if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) #include -#elif HAVE_DECL_SYS_GETRANDOM +#elif (!EMBEDDED) #include #ifndef GRND_NONBLOCK #define GRND_NONBLOCK 0x0001 @@ -417,7 +417,7 @@ #if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) rc = getrandom(out, len, GRND_NONBLOCK); -#elif HAVE_DECL_SYS_GETRANDOM +#elif defined SYS_getrandom #pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") /* FIXME: this can be removed once we bump glibc requirements to 2.25: */ rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK); -- To view, visit https://gerrit.osmocom.org/4193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I028724d41b3f5495a1a8adb51a5341de31ed0d82 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 10 11:04:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 11:04:13 +0000 Subject: libosmocore[master]: Check for getrandom syscall directly In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 Hmm, the error is still there, weird. -- To view, visit https://gerrit.osmocom.org/4193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I028724d41b3f5495a1a8adb51a5341de31ed0d82 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 11:28:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 11:28:03 +0000 Subject: [PATCH] osmo-bts[master]: jenkins: remove openbsc dependency Message-ID: Review at https://gerrit.osmocom.org/4194 jenkins: remove openbsc dependency The dependency on OpenBSC has been removed in ec33b0397f5d71248c5834513d4be7b9b0e46366 so we can drop it from jenkins scripts too. Change-Id: Ie28d444f2154f5b4bbbd9a1cb45b74ebca890cb1 --- M contrib/jenkins_common.sh 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/4194/1 diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index c1891b2..d4c3b1a 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -35,11 +35,9 @@ cd $deps osmo-deps.sh libosmocore - osmo-deps.sh openbsc - conf_flags="--with-openbsc=$deps/openbsc/openbsc/include" cd $base shift - conf_flags="$conf_flags $*" + conf_flags="$*" autoreconf --install --force ./configure $conf_flags $MAKE $PARALLEL_MAKE -- To view, visit https://gerrit.osmocom.org/4194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie28d444f2154f5b4bbbd9a1cb45b74ebca890cb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 11:34:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 11:34:34 +0000 Subject: [PATCH] osmo-bsc[master]: Remove pkg-config file Message-ID: Review at https://gerrit.osmocom.org/4195 Remove pkg-config file It wasn't used anyway because OsmoBTS relied on OpenBSC only. As of ec33b0397f5d71248c5834513d4be7b9b0e46366 in OsmoBTS it does not need any shared includes anymore. Change-Id: Ia689c7f2163dd23e429ee9d17177345b5c9470c7 --- M Makefile.am M configure.ac D osmo-bsc.pc.in 3 files changed, 0 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/95/4195/1 diff --git a/Makefile.am b/Makefile.am index 0f0141b..690deae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,9 +16,6 @@ contrib \ $(NULL) -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = osmo-bsc.pc - BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 930d1d3..4edbb83 100644 --- a/configure.ac +++ b/configure.ac @@ -125,7 +125,6 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - osmo-bsc.pc include/Makefile include/osmocom/Makefile include/osmocom/bsc/Makefile diff --git a/osmo-bsc.pc.in b/osmo-bsc.pc.in deleted file mode 100644 index f9b0d24..0000000 --- a/osmo-bsc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/ - -Name: OsmoBSC -Description: OsmoBSC base station controller -Requires: -Version: @VERSION@ -Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/4195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia689c7f2163dd23e429ee9d17177345b5c9470c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 12:11:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 12:11:33 +0000 Subject: [PATCH] osmo-bts[master]: Fix multiple SI2q reception Message-ID: Review at https://gerrit.osmocom.org/4196 Fix multiple SI2q reception Previously the received SI was copied to si_buf unconditionally which means that the first SI2q message is always overwritten be the last one. Fix it moving check for SI2q ahead of generic code and moving generic copy into else branch of SI2q check. Change-Id: Ib8031d2f0e00368283a40b4aadb3eea616038d04 Related: OS#2357 --- M src/common/rsl.c 1 file changed, 18 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/4196/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index 28dc2d0..1ebc8b2 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -292,23 +292,9 @@ len, sizeof(sysinfo_buf_t), get_value_string(osmo_sitype_strs, osmo_si)); len = sizeof(sysinfo_buf_t); } - bts->si_valid |= (1 << osmo_si); - memset(bts->si_buf[osmo_si], 0x2b, sizeof(sysinfo_buf_t)); - memcpy(bts->si_buf[osmo_si], - TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO), len); + LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s, %u bytes)\n", get_value_string(osmo_sitype_strs, osmo_si), len); - - if (SYSINFO_TYPE_3 == osmo_si && trx->nr == 0 && - num_agch(trx, "RSL") != 1) { - lchan_deactivate(&trx->bts->c0->ts[0].lchan[CCCH_LCHAN]); - /* will be reactivated by sapi_deactivate_cb() */ - trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = - LCHAN_REL_ACT_REACT; - } - - if (SYSINFO_TYPE_13 == osmo_si) - pcu_tx_si13(trx->bts, true); if (SYSINFO_TYPE_2quater == osmo_si) { si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); @@ -338,7 +324,24 @@ memset(GSM_BTS_SI2Q(bts, bts->si2q_index), GSM_MACBLOCK_PADDING, sizeof(sysinfo_buf_t)); memcpy(GSM_BTS_SI2Q(bts, bts->si2q_index), TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO), len); + } else { + memset(bts->si_buf[osmo_si], GSM_MACBLOCK_PADDING, sizeof(sysinfo_buf_t)); + memcpy(bts->si_buf[osmo_si], TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO), len); } + + bts->si_valid |= (1 << osmo_si); + + if (SYSINFO_TYPE_3 == osmo_si && trx->nr == 0 && + num_agch(trx, "RSL") != 1) { + lchan_deactivate(&trx->bts->c0->ts[0].lchan[CCCH_LCHAN]); + /* will be reactivated by sapi_deactivate_cb() */ + trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = + LCHAN_REL_ACT_REACT; + } + + if (SYSINFO_TYPE_13 == osmo_si) + pcu_tx_si13(trx->bts, true); + } else if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); if (len > sizeof(sysinfo_buf_t)) -- To view, visit https://gerrit.osmocom.org/4196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8031d2f0e00368283a40b4aadb3eea616038d04 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 12:29:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 12:29:21 +0000 Subject: osmo-bts[master]: Fix multiple SI2q reception In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8031d2f0e00368283a40b4aadb3eea616038d04 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 12:29:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 12:29:31 +0000 Subject: osmo-bsc[master]: SI2q: fix generation for multiple UARFCNs In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4160 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 12:29:39 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 12:29:39 +0000 Subject: [MERGED] osmo-bts[master]: Fix multiple SI2q reception In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix multiple SI2q reception ...................................................................... Fix multiple SI2q reception Previously the received SI was copied to si_buf unconditionally which means that the first SI2q message is always overwritten be the last one. Fix it moving check for SI2q ahead of generic code and moving generic copy into else branch of SI2q check. Change-Id: Ib8031d2f0e00368283a40b4aadb3eea616038d04 Related: OS#2357 --- M src/common/rsl.c 1 file changed, 18 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/rsl.c b/src/common/rsl.c index 28dc2d0..1ebc8b2 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -292,23 +292,9 @@ len, sizeof(sysinfo_buf_t), get_value_string(osmo_sitype_strs, osmo_si)); len = sizeof(sysinfo_buf_t); } - bts->si_valid |= (1 << osmo_si); - memset(bts->si_buf[osmo_si], 0x2b, sizeof(sysinfo_buf_t)); - memcpy(bts->si_buf[osmo_si], - TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO), len); + LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s, %u bytes)\n", get_value_string(osmo_sitype_strs, osmo_si), len); - - if (SYSINFO_TYPE_3 == osmo_si && trx->nr == 0 && - num_agch(trx, "RSL") != 1) { - lchan_deactivate(&trx->bts->c0->ts[0].lchan[CCCH_LCHAN]); - /* will be reactivated by sapi_deactivate_cb() */ - trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = - LCHAN_REL_ACT_REACT; - } - - if (SYSINFO_TYPE_13 == osmo_si) - pcu_tx_si13(trx->bts, true); if (SYSINFO_TYPE_2quater == osmo_si) { si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); @@ -338,7 +324,24 @@ memset(GSM_BTS_SI2Q(bts, bts->si2q_index), GSM_MACBLOCK_PADDING, sizeof(sysinfo_buf_t)); memcpy(GSM_BTS_SI2Q(bts, bts->si2q_index), TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO), len); + } else { + memset(bts->si_buf[osmo_si], GSM_MACBLOCK_PADDING, sizeof(sysinfo_buf_t)); + memcpy(bts->si_buf[osmo_si], TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO), len); } + + bts->si_valid |= (1 << osmo_si); + + if (SYSINFO_TYPE_3 == osmo_si && trx->nr == 0 && + num_agch(trx, "RSL") != 1) { + lchan_deactivate(&trx->bts->c0->ts[0].lchan[CCCH_LCHAN]); + /* will be reactivated by sapi_deactivate_cb() */ + trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = + LCHAN_REL_ACT_REACT; + } + + if (SYSINFO_TYPE_13 == osmo_si) + pcu_tx_si13(trx->bts, true); + } else if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); if (len > sizeof(sysinfo_buf_t)) -- To view, visit https://gerrit.osmocom.org/4196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8031d2f0e00368283a40b4aadb3eea616038d04 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 12:29:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 12:29:49 +0000 Subject: [MERGED] osmo-bsc[master]: SI2q: fix generation for multiple UARFCNs In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: SI2q: fix generation for multiple UARFCNs ...................................................................... SI2q: fix generation for multiple UARFCNs * fix insert routine to keep the list sorted by UARFCN * fix rest octets generator to properly account for offset * adjust test results accordingly Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794 Related: OS#2357 --- M src/libbsc/rest_octets.c M src/libbsc/system_information.c M tests/gsm0408/gsm0408_test.ok 3 files changed, 25 insertions(+), 29 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index b1516ec..a22b8e6 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -303,7 +303,7 @@ static inline void append_uarfcns(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) { const uint16_t *u = bts->si_common.data.uarfcn_list; - int i, rem = budget - 7, st = 0; /* account for constant bits right away */ + int i, rem = budget - 7, st = bts->u_offset; /* account for constant bits right away */ uint16_t cu = u[bts->u_offset]; /* caller ensures that length is positive */ OSMO_ASSERT(budget <= SI2Q_MAX_LEN); diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index 761e848..91e993d 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -280,7 +280,7 @@ int bts_uarfcn_add(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble, bool diversity) { - size_t len = bts->si_common.uarfcn_length, i, k = 0; + size_t len = bts->si_common.uarfcn_length, i; uint8_t si2q; int pos = uarfcn_sc_pos(bts, arfcn, scramble); uint16_t scr = diversity ? encode_fdd(scramble, true) : encode_fdd(scramble, false), @@ -297,20 +297,17 @@ pos = uarfcn_sc_pos(bts, arfcn, SC_BOUND); i = (pos < 0) ? len : pos; - for (k = 0; i < len; i++) - if (scr > scl[i]) - k = i + 1; - - /* we keep lists sorted by scramble code of a given UARFCN: - insert into appropriate position and move the tail */ - if (len - k) { - memmove(ual + k + 1, ual + k, (len - k) * 2); - memmove(scl + k + 1, scl + k, (len - k) * 2); + /* move the tail to make space for inserting if necessary */ + if (i < len) { + memmove(ual + i + 1, ual + i, (len - i) * 2); + memmove(scl + i + 1, scl + i, (len - i) * 2); } - ual[k] = arfcn; - scl[k] = scr; + /* insert into appropriate position */ + ual[i] = arfcn; + scl[i] = scr; bts->si_common.uarfcn_length++; + /* try to generate SI2q */ si2q = si2q_num(bts); if (si2q <= SI2Q_MAX_NUM) { @@ -318,6 +315,7 @@ return 0; } + /* rollback after unsuccessful generation */ bts_uarfcn_del(bts, arfcn, scramble); return -ENOSPC; } diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index d23cebb..d200539 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -62,9 +62,9 @@ generating SI2quater for 0 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7f 52 e8 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7f 52 e8 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b Testing SYSINFO_TYPE_2quater EARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... generated invalid SI2quater [00/00]: [23] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -96,17 +96,17 @@ generating SI2quater for 0 EARFCNs and 2 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 14 1a 1f 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 18 58 12 f0 83 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 1c 7b d0 f7 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 20 58 2e f0 f2 03 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 24 b3 e4 e9 68 03 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 28 58 2e 22 f2 4e 83 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 2c 7a 34 0e 4e e9 83 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 34 1a 64 26 5d f2 05 03 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 34 7a 34 0e 4e e9 85 03 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 38 58 12 22 fd ce 8e 05 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 3c 70 39 02 ce f7 85 0e 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 40 58 1d 22 fa ce 88 85 7b 0b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 44 7a 34 05 e4 72 05 08 d5 0b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 9 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 0f 7c 4c 7a 34 0e 64 77 85 43 55 c8 0b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 10 UARFCNs... @@ -117,19 +117,17 @@ generating SI2quater for 0 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 2 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 0a 7f 52 88 0a 7c 0b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 3 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 12 7e e0 a9 44 05 3e 0b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 12 7e e0 0b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 4 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 03 2b 2b 2b 2b 2b 2b generating SI2quater for 0 EARFCNs and 5 UARFCNs... -generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 ea 08 81 52 e8 18 3f f4 90 54 a2 02 9f 03 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 54 ba 82 20 03 2b 2b generating SI2quater for 0 EARFCNs and 6 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 08 81 52 e8 10 3f f4 a9 75 04 a4 0b 2b 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 28 81 df 7f fa 32 d4 a2 02 9f 03 2b 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 54 ba 84 52 67 03 2b generating SI2quater for 0 EARFCNs and 7 UARFCNs... -generated valid SI2quater [00/01]: [23] 59 06 07 40 20 25 52 ea 10 81 ce a9 74 08 1f fa 54 ba 82 52 03 2b 2b -generated valid SI2quater [01/01]: [23] 59 06 07 42 20 25 52 e8 30 81 d3 7f fd b2 86 54 a2 02 9f 03 2b 2b 2b +generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7d 52 e8 18 3f f4 90 54 ba 86 20 73 8c 81 Testing SYSINFO_TYPE_2quater combined EARFCN & UARFCN generation: generating SI2quater for 17 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/04]: [23] 59 06 07 40 80 25 0f 70 0c 1a 10 99 66 0f 04 83 c1 1c bb 2b 03 2b 2b -- To view, visit https://gerrit.osmocom.org/4160 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 12:29:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 12:29:51 +0000 Subject: osmo-bsc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia689c7f2163dd23e429ee9d17177345b5c9470c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 12:30:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 12:30:04 +0000 Subject: [MERGED] osmo-bsc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove pkg-config file ...................................................................... Remove pkg-config file It wasn't used anyway because OsmoBTS relied on OpenBSC only. As of ec33b0397f5d71248c5834513d4be7b9b0e46366 in OsmoBTS it does not need any shared includes anymore. Change-Id: Ia689c7f2163dd23e429ee9d17177345b5c9470c7 --- M Makefile.am M configure.ac D osmo-bsc.pc.in 3 files changed, 0 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 0f0141b..690deae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,9 +16,6 @@ contrib \ $(NULL) -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = osmo-bsc.pc - BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 930d1d3..4edbb83 100644 --- a/configure.ac +++ b/configure.ac @@ -125,7 +125,6 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - osmo-bsc.pc include/Makefile include/osmocom/Makefile include/osmocom/bsc/Makefile diff --git a/osmo-bsc.pc.in b/osmo-bsc.pc.in deleted file mode 100644 index f9b0d24..0000000 --- a/osmo-bsc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/ - -Name: OsmoBSC -Description: OsmoBSC base station controller -Requires: -Version: @VERSION@ -Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/4195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia689c7f2163dd23e429ee9d17177345b5c9470c7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 12:30:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 12:30:05 +0000 Subject: osmo-bts[master]: jenkins: remove openbsc dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie28d444f2154f5b4bbbd9a1cb45b74ebca890cb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 12:30:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 12:30:16 +0000 Subject: [MERGED] osmo-bts[master]: jenkins: remove openbsc dependency In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: jenkins: remove openbsc dependency ...................................................................... jenkins: remove openbsc dependency The dependency on OpenBSC has been removed in ec33b0397f5d71248c5834513d4be7b9b0e46366 so we can drop it from jenkins scripts too. Change-Id: Ie28d444f2154f5b4bbbd9a1cb45b74ebca890cb1 --- M contrib/jenkins_common.sh 1 file changed, 1 insertion(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index c1891b2..d4c3b1a 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -35,11 +35,9 @@ cd $deps osmo-deps.sh libosmocore - osmo-deps.sh openbsc - conf_flags="--with-openbsc=$deps/openbsc/openbsc/include" cd $base shift - conf_flags="$conf_flags $*" + conf_flags="$*" autoreconf --install --force ./configure $conf_flags $MAKE $PARALLEL_MAKE -- To view, visit https://gerrit.osmocom.org/4194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie28d444f2154f5b4bbbd9a1cb45b74ebca890cb1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 12:35:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 12:35:25 +0000 Subject: osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/4147/2/include/osmocom/mgcp_client/mgcp_client.h File include/osmocom/mgcp_client/mgcp_client.h: Line 40: char audio_ip[INET_ADDRSTRLEN]; nice touch, I didn't know this define even existed. I would have dynamically allocated it, but your solution is of course preferred! -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 10 12:43:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 10 Oct 2017 12:43:41 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: -Code-Review > > > I got an error about missing QEMU when running make check > without > > > our LC15 toolchain built from Yocto framework. > > > > I suspect you're still doing a cross-compile, i.e. the > > './configure' was executed with the environment for your > > cross-toolchain? > > > > > Any suggestion? > > > > If you do a native compile on your PC, rendering an x86/x68_64 > > executable for osmo-pcu, make check should work for master. This > > is what all of us execute on our various development machines > (all > > flavors of Linux from Gentoo to Arch to Debian to Ubuntu), and > > which is also what our jenkins.osmoocom.org is testing > continuously > > e.g. for verifying patch submissions. > > > > In case of doubt, feel free to open a redmine issue attaching > your > > config.log and "make check" output. Thanks! > > I found out an issue with patch set #2 using two successive > bitvec_set_bit(dest, H ,2) calls making bit index increased by 4 > bits which is not correct. In my original comments I had suggested to use two consecutive "bitvec_set_bit(dest, H)" in order to append two "H" bits, not to duplicate the "bitvec_write_field(dest, &wp, 3, 2);", which will in fact append four bits (two times '2' bits), both of them '1' as 3 = 11b. > I have also noticed that my MS is able to send packet control ack > as 4 successive PRACH bursts without this patch using a clean Yocto > image built with up-to-date libraries. This is good to hear, but it could simply be coincidence. Whether or not H=1 or H=0 depends on the bit offset into the MAC block (due to the 0x2B padding). I still think your patch has found an important bug in the encoding that should be fixed. Did you validate the rest octet contents of the old code with an independent decoder like a TEMS Pocket phone or the like? Did you confirm the current osmo-pcu code is performing correct encoding irrespective of the offset of the rest octets (depends on variable-length data ahead of the rest octets)? > Therefore, I would prefer to drop this patch. I would prefer to keep it, with the "bitvec_set_bit(dest, H)" as suggested earlier. It should fix an encoding bug, let's not abandon it unless we know for sure the old code is correct. Thanks again! -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 13:22:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 13:22:58 +0000 Subject: [PATCH] osmo-bsc[master]: ctrl: add oml-uptime command Message-ID: Review at https://gerrit.osmocom.org/4197 ctrl: add oml-uptime command Expose OML link uptime available via vts's "sh bts 0" command with the new "bts.0.oml-uptime" ctrl command. To avoid code duplication, move uptime computation into separate function and use it for both. Change-Id: Iec405aa949d6a38a9c8e64cd7ee4b49fd416835d Related: OS#2486 --- M include/osmocom/bsc/gsm_data.h M src/libbsc/bsc_ctrl_commands.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c 4 files changed, 43 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/97/4197/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 429526d..51b2c98 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -657,6 +657,8 @@ char *get_oml_status(const struct gsm_bts *bts); char *get_model_oml_status(const struct gsm_bts *bts); +unsigned long long bts_uptime(const struct gsm_bts *bts); + /* control interface handling */ int bsc_base_ctrl_cmds_install(void); diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c index d925e67..2d6fcb6 100644 --- a/src/libbsc/bsc_ctrl_commands.c +++ b/src/libbsc/bsc_ctrl_commands.c @@ -240,6 +240,21 @@ CTRL_CMD_DEFINE_RO(bts_oml_conn, "oml-connection-state"); +static int get_bts_oml_up(struct ctrl_cmd *cmd, void *data) +{ + const struct gsm_bts *bts = cmd->node; + + cmd->reply = talloc_asprintf(cmd, "%llu", bts_uptime(bts)); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(bts_oml_up, "oml-uptime"); + static int verify_bts_gprs_mode(struct ctrl_cmd *cmd, const char *value, void *_data) { int valid; @@ -450,6 +465,7 @@ rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_si); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_chan_load); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_oml_conn); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_oml_up); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_gprs_mode); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rf_state); diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index f5f265f..674813c 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -37,6 +37,8 @@ #include #include #include + +#include #include #include @@ -98,6 +100,24 @@ return 0; } +unsigned long long bts_uptime(const struct gsm_bts *bts) +{ + struct timespec tp; + + if (!bts->uptime || !bts->oml_link) { + LOGP(DNM, LOGL_ERROR, "BTS %u OML link uptime unavailable\n", bts->nr); + return 0; + } + + if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0) { + LOGP(DNM, LOGL_ERROR, "BTS %u uptime computation failure: %s\n", bts->nr, strerror(errno)); + return 0; + } + + /* monotonic clock helps to ensure that the conversion is valid */ + return difftime(tp.tv_sec, bts->uptime); +} + static int rsl_si(struct gsm_bts_trx *trx, enum osmo_sysinfo_type i, int si_len) { struct gsm_bts *bts = trx->bts; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 43cb282..ca29b4c 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -236,8 +236,6 @@ { struct pchan_load pl; unsigned long long sec; - struct timespec tp; - int rc; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", @@ -309,17 +307,11 @@ bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { vty_out(vty, " OML Link state: %s", get_model_oml_status(bts)); - if (bts->oml_link) { - if (bts->uptime) { - rc = clock_gettime(CLOCK_MONOTONIC, &tp); - if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ - sec = (unsigned long long)difftime(tp.tv_sec, bts->uptime); - vty_out(vty, " %llu days %llu hours %llu min. %llu sec.%s", - OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), - sec % 60, VTY_NEWLINE); - } - } - } + sec = bts_uptime(bts); + if (sec) + vty_out(vty, " %llu days %llu hours %llu min. %llu sec.%s", + OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), sec % 60, + VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); -- To view, visit https://gerrit.osmocom.org/4197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iec405aa949d6a38a9c8e64cd7ee4b49fd416835d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:11:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 14:11:01 +0000 Subject: [PATCH] osmo-mgw[master]: build: make sure copied mgcp_common.h is removed on 'make cl... Message-ID: Review at https://gerrit.osmocom.org/4198 build: make sure copied mgcp_common.h is removed on 'make clean' I thought the BUILT_SOURCES also enters the files to CLEANFILES, but 'make clean' leaves the copied header behind for me. Add to CLEANFILES to get it removed. Change-Id: I5a56f83289e32a09643047f0e779c9de3e4b39a6 --- M include/osmocom/mgcp_client/Makefile.am 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/98/4198/1 diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am index 0eaafcc..d303ddf 100644 --- a/include/osmocom/mgcp_client/Makefile.am +++ b/include/osmocom/mgcp_client/Makefile.am @@ -9,3 +9,5 @@ mgcp_common.h: $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h echo -e "/*\n\n DO NOT EDIT THIS FILE!\n THIS IS OVERWRITTEN DURING BUILD\n This is an automatic copy of \n\n */" > mgcp_common.h cat $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h >> mgcp_common.h + +CLEANFILES = mgcp_common.h -- To view, visit https://gerrit.osmocom.org/4198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a56f83289e32a09643047f0e779c9de3e4b39a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:28:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 14:28:18 +0000 Subject: [PATCH] osmo-bsc[master]: SI1q: fix EARFCN appender Message-ID: Review at https://gerrit.osmocom.org/4199 SI1q: fix EARFCN appender Previously if we ran out of space while adding EARFCN, we simply return which might result in malformed SI2q. Fix it by proper rollback of entire EARFCN. While at it, let's be paranoid and introduce extra checks against integer overflow in budget calculations. Change-Id: I4b2aa3825e9affb6dfeadecdf24dd1a43a92b7b7 Related: OS#2357 --- M src/libbsc/rest_octets.c M tests/gsm0408/gsm0408_test.ok 2 files changed, 33 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/99/4199/1 diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index a22b8e6..abd621c 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -59,15 +59,16 @@ } /* Append Repeated E-UTRAN Neighbour Cell to bitvec: see 3GPP TS 44.018 Table 10.5.2.33b.1 */ -static inline void append_eutran_neib_cell(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) +static inline bool append_eutran_neib_cell(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) { const struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; unsigned i, skip = 0; size_t offset = bts->e_offset; - uint8_t rem = budget - 6, earfcn_budget; /* account for mandatory stop bit and THRESH_E-UTRAN_high */ + int16_t rem = budget - 6; /* account for mandatory stop bit and THRESH_E-UTRAN_high */ + uint8_t earfcn_budget; if (budget <= 6) - return; + return false; OSMO_ASSERT(budget <= SI2Q_MAX_LEN); @@ -87,6 +88,9 @@ else rem--; + if (rem < 0) + return false; + /* now we can proceed with actually adding EARFCNs within adjusted budget limit */ for (i = 0; i < e->length; i++) { if (e->arfcn[i] != OSMO_EARFCN_INVALID) { @@ -104,6 +108,10 @@ else { bts->e_offset++; rem -= earfcn_budget; + + if (rem < 0) + return false; + bitvec_set_bit(bv, 1); /* EARFCN: */ bitvec_set_uint(bv, e->arfcn[i], 16); @@ -146,10 +154,14 @@ bitvec_set_uint(bv, e->qrxlm, 5); } else bitvec_set_bit(bv, 0); + + return true; } static inline void append_earfcn(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) { + bool appended; + unsigned int old = bv->cur_bit; /* save current position to make rollback possible */ int rem = budget - 25; if (rem <= 0) return; @@ -203,8 +215,11 @@ /* Repeated E-UTRAN Neighbour Cells */ bitvec_set_bit(bv, 1); - /* N. B: 25 bits are set in append_earfcn() - keep it in sync with budget adjustment below: */ - append_eutran_neib_cell(bv, bts, rem); + appended = append_eutran_neib_cell(bv, bts, rem); + if (!appended) { /* appending is impossible within current budget: rollback */ + bv->cur_bit = old; + return; + } /* stop bit - end of Repeated E-UTRAN Neighbour Cells sequence: */ bitvec_set_bit(bv, 0); diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index d200539..889f001 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -174,15 +174,21 @@ generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 00 44 b3 07 82 41 -generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 0b 2b 2b 2b 2b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 9 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 10 99 66 0f 04 -generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 0b 2b 2b 2b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 10 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 04 12 c8 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 2b 2b 2b 2b generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -- To view, visit https://gerrit.osmocom.org/4199 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b2aa3825e9affb6dfeadecdf24dd1a43a92b7b7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:38:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 14:38:10 +0000 Subject: [MERGED] libosmocore[master]: gsm: make osmo_imsi_str_valid() NULL-safe In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gsm: make osmo_imsi_str_valid() NULL-safe ...................................................................... gsm: make osmo_imsi_str_valid() NULL-safe No callers that would pass NULL exist, but let's check against NULL from the start. Fixup for recent change I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522. Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e --- M src/gsm/gsm23003.c M tests/gsm23003/gsm23003_test.c M tests/gsm23003/gsm23003_test.ok 3 files changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c index 004e20f..3c09aca 100644 --- a/src/gsm/gsm23003.c +++ b/src/gsm/gsm23003.c @@ -33,6 +33,8 @@ /* Use unsigned char * to avoid a compiler warning of * "error: array subscript has type 'char' [-Werror=char-subscripts]" */ const unsigned char *pos = (const unsigned char *)str; + if (!pos) + return min_digits < 1; for (len = 0; *pos && len < max_digits; len++, pos++) if (!isdigit(*pos)) return false; diff --git a/tests/gsm23003/gsm23003_test.c b/tests/gsm23003/gsm23003_test.c index 682f162..a408b73 100644 --- a/tests/gsm23003/gsm23003_test.c +++ b/tests/gsm23003/gsm23003_test.c @@ -50,6 +50,7 @@ { "1234567\n123456", false }, { "123456\t123456", false }, { "123456\r123456", false }, + { NULL, false }, }; bool test_valid_imsi() @@ -92,6 +93,7 @@ { "1234567\n123456", false }, { "123456\t123456", false }, { "123456\r123456", false }, + { NULL, false }, }; bool test_valid_msisdn() diff --git a/tests/gsm23003/gsm23003_test.ok b/tests/gsm23003/gsm23003_test.ok index 777451a..7d7ffd1 100644 --- a/tests/gsm23003/gsm23003_test.ok +++ b/tests/gsm23003/gsm23003_test.ok @@ -19,6 +19,7 @@ 123456' 17: expect=false result=false imsi='123456 123456' 18: expect=false result=false imsi='123456 123456' +19: expect=false result=false imsi='(null)' ----- test_valid_msisdn 0: expect=false result=false msisdn='' 1: expect=false result=false msisdn=' ' @@ -40,3 +41,4 @@ 123456' 17: expect=false result=false msisdn='123456 123456' 18: expect=false result=false msisdn='123456 123456' +19: expect=false result=false msisdn='(null)' -- To view, visit https://gerrit.osmocom.org/4156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:40:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 14:40:12 +0000 Subject: [MERGED] osmo-hlr[master]: cosmetic: rename db_subscr_get() to db_subscr_get_by_imsi() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: rename db_subscr_get() to db_subscr_get_by_imsi() ...................................................................... cosmetic: rename db_subscr_get() to db_subscr_get_by_imsi() There will be more additions, _by_msisdn() and _by_id(), to serve the upcoming VTY commands, to allow flexibly selecting subscribers as in the old OsmoNITB. Change-Id: I32fa676ccc5c10eba834c4390c8a42476b9c1961 --- M src/ctrl.c M src/db.h M src/db_hlr.c M src/luop.c 4 files changed, 6 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl.c b/src/ctrl.c index 81de961..b034cd7 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -38,7 +38,7 @@ struct lu_operation *luop = NULL; struct osmo_gsup_conn *co; - if (db_subscr_get(ctx->dbc, cmd->value, NULL) < 0) { + if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, NULL) < 0) { cmd->reply = "Subscriber Unknown in HLR"; return CTRL_CMD_ERROR; } diff --git a/src/db.h b/src/db.h index d424b38..0064a4d 100644 --- a/src/db.h +++ b/src/db.h @@ -71,8 +71,8 @@ bool ms_purged_ps; }; -int db_subscr_get(struct db_context *dbc, const char *imsi, - struct hlr_subscriber *subscr); +int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, + struct hlr_subscriber *subscr); int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable); int db_subscr_lu(struct db_context *dbc, const struct hlr_subscriber *subscr, diff --git a/src/db_hlr.c b/src/db_hlr.c index 9c74a24..fa962f3 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -37,8 +37,8 @@ x[sizeof(x)-1] = '\0'; \ } while (0) -int db_subscr_get(struct db_context *dbc, const char *imsi, - struct hlr_subscriber *subscr) +int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, + struct hlr_subscriber *subscr) { sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; int rc; diff --git a/src/luop.c b/src/luop.c index 937c02c..1b17fe3 100644 --- a/src/luop.c +++ b/src/luop.c @@ -95,7 +95,7 @@ { struct hlr_subscriber *subscr = &luop->subscr; - if (db_subscr_get(dbc, imsi, subscr) < 0) + if (db_subscr_get_by_imsi(dbc, imsi, subscr) < 0) return false; return true; -- To view, visit https://gerrit.osmocom.org/4171 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I32fa676ccc5c10eba834c4390c8a42476b9c1961 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:40:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 14:40:12 +0000 Subject: [MERGED] osmo-hlr[master]: cosmetic: refactor db_bind_imsi() as db_bind_text() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: refactor db_bind_imsi() as db_bind_text() ...................................................................... cosmetic: refactor db_bind_imsi() as db_bind_text() There are more uses for a generalized db_bind_text(), and in an upcoming patch there will be similar functions like db_bind_int(). Also, add argument param_name, optionally indicating a named SQL parameter to bind to, which will be used in subsequent patches. So far, all callers pass NULL to yield previous db_bind_imsi() behavior of binding to the first param. Change-Id: I87bc46a23a724677e8319d6a4b032976b7ba9394 --- M src/db.c M src/db.h M src/db_hlr.c 3 files changed, 18 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index 6566527..4bba2f0 100644 --- a/src/db.c +++ b/src/db.c @@ -77,16 +77,25 @@ return true; } -/* bind IMSI and do proper cleanup in case of failure */ -bool db_bind_imsi(sqlite3_stmt *stmt, const char *imsi) +/** bind text arg and do proper cleanup in case of failure. If param_name is + * NULL, bind to the first parameter (useful for SQL statements that have only + * one parameter). */ +bool db_bind_text(sqlite3_stmt *stmt, const char *param_name, const char *text) { - int rc = sqlite3_bind_text(stmt, 1, imsi, -1, SQLITE_STATIC); + int rc; + int idx = param_name ? sqlite3_bind_parameter_index(stmt, param_name) : 1; + if (idx < 1) { + LOGP(DDB, LOGL_ERROR, "Error composing SQL, cannot bind parameter '%s'\n", + param_name); + return false; + } + rc = sqlite3_bind_text(stmt, idx, text, -1, SQLITE_STATIC); if (rc != SQLITE_OK) { - LOGP(DDB, LOGL_ERROR, "Error binding IMSI %s: %d\n", imsi, rc); + LOGP(DDB, LOGL_ERROR, "Error binding text to SQL parameter %s: %d\n", + param_name ? param_name : "#1", rc); db_remove_reset(stmt); return false; } - return true; } diff --git a/src/db.h b/src/db.h index 0064a4d..6d6723a 100644 --- a/src/db.h +++ b/src/db.h @@ -23,7 +23,7 @@ }; bool db_remove_reset(sqlite3_stmt *stmt); -bool db_bind_imsi(sqlite3_stmt *stmt, const char *imsi); +bool db_bind_text(sqlite3_stmt *stmt, const char *param_name, const char *text); void db_close(struct db_context *dbc); struct db_context *db_open(void *ctx, const char *fname); diff --git a/src/db_hlr.c b/src/db_hlr.c index fa962f3..3bf3912 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -43,7 +43,7 @@ sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; int rc; - if (!db_bind_imsi(stmt, imsi)) + if (!db_bind_text(stmt, NULL, imsi)) return -EINVAL; /* execute the statement */ @@ -86,7 +86,7 @@ dbc->stmt[enable ? DB_STMT_SET_NAM_PS_BY_IMSI : DB_STMT_UNSET_NAM_PS_BY_IMSI]; int rc; - if (!db_bind_imsi(stmt, imsi)) + if (!db_bind_text(stmt, NULL, imsi)) return -EINVAL; rc = sqlite3_step(stmt); /* execute the statement */ @@ -158,7 +158,7 @@ else stmt = dbc->stmt[DB_STMT_UPD_PURGE_CS_BY_IMSI]; - if (!db_bind_imsi(stmt, imsi)) + if (!db_bind_text(stmt, NULL, imsi)) return -EINVAL; /* execute the statement */ -- To view, visit https://gerrit.osmocom.org/4172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I87bc46a23a724677e8319d6a4b032976b7ba9394 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:40:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 14:40:12 +0000 Subject: [MERGED] osmo-hlr[master]: cosmetic: multi-line DB_STMT_AUC_BY_IMSI In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: multi-line DB_STMT_AUC_BY_IMSI ...................................................................... cosmetic: multi-line DB_STMT_AUC_BY_IMSI In multiple lines, the statement becomes more readable. I'd like to get this change out of the way before upcoming SQL statement edits and additions. Change-Id: Icf09f4bbb298a516aa52c81e3ca67d9d91d8c7c2 --- M src/db.c 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index 4bba2f0..2c10ba0 100644 --- a/src/db.c +++ b/src/db.c @@ -29,7 +29,12 @@ [DB_STMT_SEL_BY_IMSI] = "SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?", [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", - [DB_STMT_AUC_BY_IMSI] = "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, ind_bitlen FROM subscriber LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id WHERE imsi = ?", + [DB_STMT_AUC_BY_IMSI] = + "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, ind_bitlen" + " FROM subscriber" + " LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id" + " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" + " WHERE imsi = ?", [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", -- To view, visit https://gerrit.osmocom.org/4173 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icf09f4bbb298a516aa52c81e3ca67d9d91d8c7c2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:40:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 14:40:12 +0000 Subject: [MERGED] osmo-hlr[master]: cosmetic: log IMSI='', log "no such subscriber" In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: log IMSI='', log "no such subscriber" ...................................................................... cosmetic: log IMSI='', log "no such subscriber" In LOGHLR and LOGAUC, log IMSI='' instead of just : In the log, it is not always obvious to the reader that the printed number refers to an IMSI (vs. an MSISDN or in the future an IMEI). In db_get_auth_data(), log "No such subscriber" instead of just "Unknown", to clarify what exactly is meant. Change-Id: I2ec8ab5e67d4e95083f6e39232fc91ebaa080cb8 --- M src/db_auc.c M src/db_hlr.c 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db_auc.c b/src/db_auc.c index 07039d4..7aad06d 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -30,7 +30,7 @@ #include "auc.h" #include "rand.h" -#define LOGAUC(imsi, level, fmt, args ...) LOGP(DAUC, level, "%s: " fmt, imsi, ## args) +#define LOGAUC(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) /* update the SQN for a given subscriber ID */ int db_update_sqn(struct db_context *dbc, uint64_t id, @@ -98,7 +98,7 @@ /* execute the statement */ rc = sqlite3_step(stmt); if (rc == SQLITE_DONE) { - LOGAUC(imsi, LOGL_INFO, "Unknown\n"); + LOGAUC(imsi, LOGL_INFO, "No such subscriber\n"); ret = 0; goto out; } else if (rc != SQLITE_ROW) { diff --git a/src/db_hlr.c b/src/db_hlr.c index 3bf3912..4bccca4 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -28,7 +28,7 @@ #include "logging.h" #include "db.h" -#define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "%s: " fmt, imsi, ## args) +#define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) #define SL3_TXT(x, stmt, idx) do { \ const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ -- To view, visit https://gerrit.osmocom.org/4174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2ec8ab5e67d4e95083f6e39232fc91ebaa080cb8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:40:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 14:40:13 +0000 Subject: [MERGED] osmo-hlr[master]: cosmetic: prepend DB_STMT_ to enum stmt_idx entries In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: prepend DB_STMT_ to enum stmt_idx entries ...................................................................... cosmetic: prepend DB_STMT_ to enum stmt_idx entries There are upcoming additions, and some seem too general without a proper common prefix in the identifiers, like 'CREATE'. Change-Id: I51b677db31a1ebbbc45dc7925074de7493fbde1f --- M src/db.c M src/db.h M src/db_auc.c M src/db_hlr.c 4 files changed, 30 insertions(+), 30 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index aaf6fe2..6566527 100644 --- a/src/db.c +++ b/src/db.c @@ -26,15 +26,15 @@ #include "db.h" static const char *stmt_sql[] = { - [SEL_BY_IMSI] = "SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?", - [UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", - [UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", - [AUC_BY_IMSI] = "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, ind_bitlen FROM subscriber LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id WHERE imsi = ?", - [AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", - [UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", - [UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", - [SET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=1 WHERE imsi = ?", - [UNSET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=0 WHERE imsi = ?", + [DB_STMT_SEL_BY_IMSI] = "SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?", + [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", + [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", + [DB_STMT_AUC_BY_IMSI] = "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, ind_bitlen FROM subscriber LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id WHERE imsi = ?", + [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", + [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", + [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", + [DB_STMT_SET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=1 WHERE imsi = ?", + [DB_STMT_UNSET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=0 WHERE imsi = ?", }; static void sql3_error_log_cb(void *arg, int err_code, const char *msg) diff --git a/src/db.h b/src/db.h index a60cf62..d424b38 100644 --- a/src/db.h +++ b/src/db.h @@ -4,22 +4,22 @@ #include enum stmt_idx { - SEL_BY_IMSI = 0, - UPD_VLR_BY_ID = 1, - UPD_SGSN_BY_ID = 2, - AUC_BY_IMSI = 3, - AUC_UPD_SQN = 4, - UPD_PURGE_CS_BY_IMSI = 5, - UPD_PURGE_PS_BY_IMSI = 6, - SET_NAM_PS_BY_IMSI = 7, - UNSET_NAM_PS_BY_IMSI = 8, - _NUM_STMT + DB_STMT_SEL_BY_IMSI, + DB_STMT_UPD_VLR_BY_ID, + DB_STMT_UPD_SGSN_BY_ID, + DB_STMT_AUC_BY_IMSI, + DB_STMT_AUC_UPD_SQN, + DB_STMT_UPD_PURGE_CS_BY_IMSI, + DB_STMT_UPD_PURGE_PS_BY_IMSI, + DB_STMT_SET_NAM_PS_BY_IMSI, + DB_STMT_UNSET_NAM_PS_BY_IMSI, + _NUM_DB_STMT }; struct db_context { char *fname; sqlite3 *db; - sqlite3_stmt *stmt[_NUM_STMT]; + sqlite3_stmt *stmt[_NUM_DB_STMT]; }; bool db_remove_reset(sqlite3_stmt *stmt); diff --git a/src/db_auc.c b/src/db_auc.c index f532b83..07039d4 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -36,7 +36,7 @@ int db_update_sqn(struct db_context *dbc, uint64_t id, uint64_t new_sqn) { - sqlite3_stmt *stmt = dbc->stmt[AUC_UPD_SQN]; + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_UPD_SQN]; int rc; /* bind new SQN and subscriber ID */ @@ -79,7 +79,7 @@ struct osmo_sub_auth_data *aud3g, uint64_t *subscr_id) { - sqlite3_stmt *stmt = dbc->stmt[AUC_BY_IMSI]; + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_BY_IMSI]; int ret = 0; int rc; diff --git a/src/db_hlr.c b/src/db_hlr.c index f6ae18f..9c74a24 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -40,7 +40,7 @@ int db_subscr_get(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr) { - sqlite3_stmt *stmt = dbc->stmt[SEL_BY_IMSI]; + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; int rc; if (!db_bind_imsi(stmt, imsi)) @@ -83,7 +83,7 @@ int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable) { sqlite3_stmt *stmt = - dbc->stmt[enable ? SET_NAM_PS_BY_IMSI : UNSET_NAM_PS_BY_IMSI]; + dbc->stmt[enable ? DB_STMT_SET_NAM_PS_BY_IMSI : DB_STMT_UNSET_NAM_PS_BY_IMSI]; int rc; if (!db_bind_imsi(stmt, imsi)) @@ -111,15 +111,15 @@ const struct hlr_subscriber *subscr, const char *vlr_or_sgsn_number, bool lu_is_ps) { - sqlite3_stmt *stmt = dbc->stmt[UPD_VLR_BY_ID]; + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; const char *txt; int rc, ret = 0; if (lu_is_ps) { - stmt = dbc->stmt[UPD_SGSN_BY_ID]; + stmt = dbc->stmt[DB_STMT_UPD_SGSN_BY_ID]; txt = subscr->sgsn_number; } else { - stmt = dbc->stmt[UPD_VLR_BY_ID]; + stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; txt = subscr->vlr_number; } @@ -150,13 +150,13 @@ int db_subscr_purge(struct db_context *dbc, const char *imsi, bool is_ps) { - sqlite3_stmt *stmt = dbc->stmt[UPD_VLR_BY_ID]; + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; int rc, ret = 1; if (is_ps) - stmt = dbc->stmt[UPD_PURGE_PS_BY_IMSI]; + stmt = dbc->stmt[DB_STMT_UPD_PURGE_PS_BY_IMSI]; else - stmt = dbc->stmt[UPD_PURGE_CS_BY_IMSI]; + stmt = dbc->stmt[DB_STMT_UPD_PURGE_CS_BY_IMSI]; if (!db_bind_imsi(stmt, imsi)) return -EINVAL; -- To view, visit https://gerrit.osmocom.org/4170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I51b677db31a1ebbbc45dc7925074de7493fbde1f Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:45:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 14:45:53 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: don't log about missing SQLite log cb In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4175 to look at the new patch set (#2). cosmetic: don't log about missing SQLite log cb SQLite3 seems to be commonly compiled without log callback support. It is then misleading to see a seeming error message about this on each osmo-hlr startup. Avoid the impression that we would miss out on important logging: simply ignore any errors upon registering the log callback. We do receive logging on each DB error. Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 --- M src/db.c 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/75/4175/2 diff --git a/src/db.c b/src/db.c index 2c10ba0..4aadeb7 100644 --- a/src/db.c +++ b/src/db.c @@ -121,6 +121,7 @@ struct db_context *dbc = talloc_zero(ctx, struct db_context); unsigned int i; int rc; + bool has_sqlite_config_sqllog = false; LOGP(DDB, LOGL_NOTICE, "using database: %s\n", fname); LOGP(DDB, LOGL_INFO, "Compiled against SQLite3 lib version %s\n", SQLITE_VERSION); @@ -133,15 +134,21 @@ if (!o) break; LOGP(DDB, LOGL_DEBUG, "SQlite3 compiled with '%s'\n", o); + if (!strcmp(o, "ENABLE_SQLLOG")) + has_sqlite_config_sqllog = true; } rc = sqlite3_config(SQLITE_CONFIG_LOG, sql3_error_log_cb, NULL); if (rc != SQLITE_OK) LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 error log callback\n"); - rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); - if (rc != SQLITE_OK) - LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 SQL statement log callback\n"); + if (has_sqlite_config_sqllog) { + rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); + if (rc != SQLITE_OK) + LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 SQL log callback\n"); + } else + LOGP(DDB, LOGL_DEBUG, "Not setting SQL log callback:" + " SQLite3 compiled without support for it\n"); rc = sqlite3_open(dbc->fname, &dbc->db); if (rc != SQLITE_OK) { -- To view, visit https://gerrit.osmocom.org/4175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:50:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 14:50:10 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: don't log about missing SQLite log cb In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4175 to look at the new patch set (#3). cosmetic: don't log about missing SQLite log cb SQLite3 seems to be commonly compiled without log callback support. It is then misleading to see a seeming error message about this on each osmo-hlr startup. Avoid the impression that we would miss out on important logging: query sqlit3_compileoption_get() whether SQLITE_CONFIG_SQLLOG is enabled. Try to register the callback only if present, if not, say so on DEBUG log. See https://sqlite.org/compile.html "SQLITE_ENABLE_SQLLOG" Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 --- M src/db.c 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/75/4175/3 diff --git a/src/db.c b/src/db.c index 2c10ba0..4aadeb7 100644 --- a/src/db.c +++ b/src/db.c @@ -121,6 +121,7 @@ struct db_context *dbc = talloc_zero(ctx, struct db_context); unsigned int i; int rc; + bool has_sqlite_config_sqllog = false; LOGP(DDB, LOGL_NOTICE, "using database: %s\n", fname); LOGP(DDB, LOGL_INFO, "Compiled against SQLite3 lib version %s\n", SQLITE_VERSION); @@ -133,15 +134,21 @@ if (!o) break; LOGP(DDB, LOGL_DEBUG, "SQlite3 compiled with '%s'\n", o); + if (!strcmp(o, "ENABLE_SQLLOG")) + has_sqlite_config_sqllog = true; } rc = sqlite3_config(SQLITE_CONFIG_LOG, sql3_error_log_cb, NULL); if (rc != SQLITE_OK) LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 error log callback\n"); - rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); - if (rc != SQLITE_OK) - LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 SQL statement log callback\n"); + if (has_sqlite_config_sqllog) { + rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); + if (rc != SQLITE_OK) + LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 SQL log callback\n"); + } else + LOGP(DDB, LOGL_DEBUG, "Not setting SQL log callback:" + " SQLite3 compiled without support for it\n"); rc = sqlite3_open(dbc->fname, &dbc->db); if (rc != SQLITE_OK) { -- To view, visit https://gerrit.osmocom.org/4175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:52:34 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 10 Oct 2017 14:52:34 +0000 Subject: [PATCH] osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4146 to look at the new patch set (#2). client: add unified function to generate MGCP messages currently the only way to generate MGCP messages is to use mgcp_msg_crcx(), mgcp_msg_mdcx() and mgcp_msg_dlcx(). All three function take a fixed set of parameters via their parameter list. There is no way to add or leave away optional parameters. add function mgcp_msg_gen(), this function takes a unified message struct. The struct features a presence bitmask which allows to enable and disable parameters as needed. It is also possible to add new parameters in the future without breaking the API. Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 223 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/4146/2 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index efc1f76..1e92da7 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include @@ -37,6 +38,36 @@ uint16_t audio_port; }; +enum mgcp_verb { + MGCP_VERB_CRCX, + MGCP_VERB_MDCX, + MGCP_VERB_DLCX, + MGCP_VERB_AUEP, + MGCP_VERB_RSIP, +}; + +#define MGCP_MSG_PRESENCE_ENDPOINT 0x0001 +#define MGCP_MSG_PRESENCE_CALL_ID 0x0002 +#define MGCP_MSG_PRESENCE_CONN_ID 0x0004 +#define MGCP_MSG_PRESENCE_AUDIO_IP 0x0008 +#define MGCP_MSG_PRESENCE_AUDIO_PORT 0x0010 +#define MGCP_MSG_PRESENCE_CONN_MODE 0x0020 + +/* See also RFC3435 section 3.2.1.3 */ +#define MGCP_ENDPOINT_MAXLEN (255*2+1+1) + +struct mgcp_msg { + enum mgcp_verb verb; + /* See MGCP_MSG_PRESENCE_* constands above */ + uint32_t presence; + char endpoint[MGCP_ENDPOINT_MAXLEN]; + unsigned int call_id; + uint32_t conn_id; + uint16_t audio_port; + char audio_ip[INET_ADDRSTRLEN]; + enum mgcp_connection_mode conn_mode; +}; + void mgcp_client_conf_init(struct mgcp_client_conf *conf); void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf); int mgcp_client_config_write(struct vty *vty, const char *indent); @@ -63,17 +94,22 @@ enum mgcp_connection_mode; +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, enum mgcp_connection_mode mode); +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, const char *rtp_conn_addr, uint16_t rtp_port, enum mgcp_connection_mode mode); +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg); + extern const struct value_string mgcp_client_connection_mode_strs[]; static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 1cd37be..2bb669e 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -614,6 +615,104 @@ "C: %x\r\n", trans_id, rtp_endpoint, call_id); } +#define MGCP_CRCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CALL_ID | \ + MGCP_MSG_PRESENCE_CONN_ID | \ + MGCP_MSG_PRESENCE_CONN_MODE) +#define MGCP_MDCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CONN_ID) +#define MGCP_DLCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_RSIP_MANDATORY 0 /* none */ + +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg) +{ + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); + uint32_t mandatory_mask; + struct msgb *msg = msgb_alloc_headroom(4096, 128, "MGCP tx"); + int rc = 0; + + /* Add command verb */ + switch (mgcp_msg->verb) { + case MGCP_VERB_CRCX: + mandatory_mask = MGCP_CRCX_MANDATORY; + rc += msgb_printf(msg, "CRCX %u", trans_id); + break; + case MGCP_VERB_MDCX: + mandatory_mask = MGCP_MDCX_MANDATORY; + rc += msgb_printf(msg, "MDCX %u", trans_id); + break; + case MGCP_VERB_DLCX: + mandatory_mask = MGCP_DLCX_MANDATORY; + rc += msgb_printf(msg, "DLCX %u", trans_id); + break; + case MGCP_VERB_AUEP: + mandatory_mask = MGCP_AUEP_MANDATORY; + rc += msgb_printf(msg, "AUEP %u", trans_id); + break; + case MGCP_VERB_RSIP: + mandatory_mask = MGCP_RSIP_MANDATORY; + rc += msgb_printf(msg, "RSIP %u", trans_id); + break; + default: + LOGP(DLMGCP, LOGL_ERROR, + "Invalid command verb, can not generate MGCP message"); + return NULL; + } + + /* Check if mandatory fields are missing */ + if (!((mgcp_msg->presence & mandatory_mask) == mandatory_mask)) { + LOGP(DLMGCP, LOGL_ERROR, + "One or more missing mandatory fields, can not generate MGCP message"); + return NULL; + } + + /* Add endpoint name */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_ENDPOINT) + rc += msgb_printf(msg, " %s", mgcp_msg->endpoint); + + /* Add protocol version */ + msgb_printf(msg, " MGCP 1.0\r\n"); + + /* Add call id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CALL_ID) + rc += msgb_printf(msg, "C: %x\r\n", mgcp_msg->call_id); + + /* Add connection id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID) + rc += msgb_printf(msg, "I: %u\r\n", mgcp_msg->conn_id); + + /* Add local connection options */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID + && mgcp_msg->verb == MGCP_VERB_CRCX) + rc += msgb_printf(msg, "L: p:20, a:AMR, nt:IN\r\n"); + + /* Add mode */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_MODE) + rc += + msgb_printf(msg, "M: %s\r\n", + mgcp_client_cmode_name(mgcp_msg->conn_mode)); + + /* Add RTP address and port (SDP) */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_IP + && mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT) { + rc += msgb_printf(msg, "\r\n"); + rc += msgb_printf(msg, "c=IN IP4 %s\r\n", mgcp_msg->audio_ip); + rc += + msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", + mgcp_msg->audio_port); + } + + if (rc != 0) { + LOGP(DLMGCP, LOGL_ERROR, + "message buffer to small, can not generate MGCP message"); + msgb_free(msg); + msg = NULL; + } + + return msg; +} + struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index f2f0e0f..750aa0e 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -149,6 +149,65 @@ "a=ptime:20\r\n"); } +void test_mgcp_msg(void) +{ + struct msgb *msg; + + struct mgcp_msg mgcp_msg; + + if (mgcp) + talloc_free(mgcp); + mgcp = mgcp_client_init(ctx, &conf); + + /* Pre-fill the message struct with some arbitary values */ + strcpy(mgcp_msg.audio_ip, "192.168.100.23"); + strcpy(mgcp_msg.endpoint, "23 at mgw"); + mgcp_msg.call_id = 47; + mgcp_msg.conn_id = 11; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + + printf("\n"); + + printf("Generated CRCX message:\n"); + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated MDCX message:\n"); + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated DLCX message:\n"); + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated AUEP message:\n"); + mgcp_msg.verb = MGCP_VERB_AUEP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated RSIP message:\n"); + mgcp_msg.verb = MGCP_VERB_RSIP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + msgb_free(msg); +} + static const struct log_info_cat log_categories[] = { }; @@ -167,6 +226,7 @@ mgcp_client_conf_init(&conf); test_crcx(); + test_mgcp_msg(); printf("Done\n"); fprintf(stderr, "Done\n"); diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index d35f2d6..7c4819d 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,4 +28,32 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + +Generated CRCX message: +CRCX 1 23 at mgw MGCP 1.0 +C: 2f +I: 11 +L: p:20, a:AMR, nt:IN +M: sendrecv + +Generated MDCX message: +MDCX 2 23 at mgw MGCP 1.0 +C: 2f +I: 11 +M: sendrecv + +c=IN IP4 192.168.100.23 +m=audio 1234 RTP/AVP 255 + +Generated DLCX message: +DLCX 3 23 at mgw MGCP 1.0 +C: 2f +I: 11 + +Generated AUEP message: +AUEP 4 23 at mgw MGCP 1.0 + +Generated RSIP message: +RSIP 5 23 at mgw MGCP 1.0 + Done -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:52:34 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 10 Oct 2017 14:52:34 +0000 Subject: [PATCH] osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4147 to look at the new patch set (#3). client: add ip address parsing to the client Some MGCP messages (CRCX, MDCX) return IP-Addresses. Make use of this information. Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 32 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/47/4147/3 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 1e92da7..ab273eb 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -36,6 +36,7 @@ char *body; struct mgcp_response_head head; uint16_t audio_port; + char audio_ip[INET_ADDRSTRLEN]; }; enum mgcp_verb { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 2bb669e..3bff1f0 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -174,7 +174,7 @@ } /* Parse a line like "m=audio 16002 RTP/AVP 98" */ -static int mgcp_parse_audio(struct mgcp_response *r, const char *line) +static int mgcp_parse_audio_port(struct mgcp_response *r, const char *line) { if (sscanf(line, "m=audio %hu", &r->audio_port) != 1) @@ -184,7 +184,25 @@ response_parse_failure: LOGP(DLMGCP, LOGL_ERROR, - "Failed to parse MGCP response header\n"); + "Failed to parse MGCP response header (audio port)\n"); + return -EINVAL; +} + +/* Parse a line like "c=IN IP4 10.11.12.13" */ +static int mgcp_parse_audio_ip(struct mgcp_response *r, const char *line) +{ + if (strlen(line) < 16) + goto response_parse_failure; + + if (memcmp("c=IN IP4 ", line, 9) != 0) + goto response_parse_failure; + + strcpy(r->audio_ip, line + 9); + return 0; + +response_parse_failure: + LOGP(DLMGCP, LOGL_ERROR, + "Failed to parse MGCP response header (audio ip)\n"); return -EINVAL; } @@ -213,7 +231,12 @@ switch (line[0]) { case 'm': - rc = mgcp_parse_audio(r, line); + rc = mgcp_parse_audio_port(r, line); + if (rc) + return rc; + break; + case 'c': + rc = mgcp_parse_audio_ip(r, line); if (rc) return rc; break; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 750aa0e..6671a3c 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -99,11 +99,13 @@ " head.response_code = %d\n" " head.trans_id = %u\n" " head.comment = %s\n" - " audio_port = %u\n", + " audio_port = %u\n" + " audio_ip = %s\n", response->head.response_code, response->head.trans_id, response->head.comment, - response->audio_port + response->audio_port, + response->audio_ip ); } diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index 7c4819d..3e84e89 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,6 +28,7 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + audio_ip = 10.9.1.120 Generated CRCX message: CRCX 1 23 at mgw MGCP 1.0 -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:56:22 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 10 Oct 2017 14:56:22 +0000 Subject: [PATCH] libosmocore[master]: add function msgb_printf() to print formatted text into msg buf Message-ID: Review at https://gerrit.osmocom.org/4200 add function msgb_printf() to print formatted text into msg buf In ASCII string based protocols it a printf() version that prints directly to the message buffer may be useful. Add function msgb_printf(), make sure that msg buffer bounderies are not exceeded. If the end of the tail buffer is hit, return with an error code. Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 --- M include/osmocom/core/msgb.h M src/msgb.c M tests/msgb/msgb_test.c M tests/msgb/msgb_test.ok 4 files changed, 59 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/4200/1 diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 91b7ec7..9c3ccf0 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -498,5 +498,6 @@ void *msgb_talloc_ctx_init(void *root_ctx, unsigned int pool_size); void msgb_set_talloc_ctx(void *ctx) OSMO_DEPRECATED("Use msgb_talloc_ctx_init() instead"); +int msgb_printf(struct msgb *msgb, const char *format, ...); /*! @} */ diff --git a/src/msgb.c b/src/msgb.c index 2e9f4a2..34d03a6 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -55,6 +55,9 @@ #include #include #include +#include +#include + #include //#include @@ -376,4 +379,32 @@ return buf; } + +/*! Print a string to the end of message buffer + * \param[in] msg message buffer + * \returns 0 on success, -EINVAL on error */ +int msgb_printf(struct msgb *msgb, const char *format, ...) +{ + va_list args; + int str_len; + int rc = 0; + + OSMO_ASSERT(msgb); + OSMO_ASSERT(format); + + va_start(args, format); + + str_len = + vsnprintf((char *)msgb->tail, msgb_tailroom(msgb), format, args); + + if (str_len > msgb_tailroom(msgb)) { + msgb_put(msgb, msgb_tailroom(msgb)); + rc = -EINVAL; + } else + msgb_put(msgb, str_len); + + va_end(args); + return rc; +} + /*! @} */ diff --git a/tests/msgb/msgb_test.c b/tests/msgb/msgb_test.c index ac10382..18f1742 100644 --- a/tests/msgb/msgb_test.c +++ b/tests/msgb/msgb_test.c @@ -277,6 +277,29 @@ osmo_set_panic_handler(NULL); } +static void test_msgb_printf() +{ + struct msgb *msg = msgb_alloc(80, "data"); + int rc; + int total_len; + + rc = msgb_printf(msg, "|this is a test %i, %s, %16x|", 4711, "testme", + 0x4711); + total_len = strlen((char *)msg->data); + printf("rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, msg->data); + OSMO_ASSERT(rc == 0); + + rc = msgb_printf(msg, "|some more text|"); + total_len = strlen((char *)msg->data); + printf("rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, msg->data); + OSMO_ASSERT(rc == 0); + + rc = msgb_printf(msg, "|more %i %x %s|", 23, 0xfee, "text"); + total_len = strlen((char *)msg->data); + printf("rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, msg->data); + OSMO_ASSERT(rc == -EINVAL); +} + static struct log_info info = {}; int main(int argc, char **argv) @@ -287,6 +310,7 @@ test_msgb_api_errors(); test_msgb_copy(); test_msgb_resize_area(); + test_msgb_printf(); printf("Success.\n"); diff --git a/tests/msgb/msgb_test.ok b/tests/msgb/msgb_test.ok index 6603fe7..aae5a63 100644 --- a/tests/msgb/msgb_test.ok +++ b/tests/msgb/msgb_test.ok @@ -32,4 +32,7 @@ Original: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Extended: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Shrinked: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f +rc=0, total_len=47, msg->data=|this is a test 4711, testme, 4711| +rc=0, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text| +rc=-22, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 23 fee tex Success. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:58:04 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 10 Oct 2017 14:58:04 +0000 Subject: [PATCH] osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4146 to look at the new patch set (#3). client: add unified function to generate MGCP messages currently the only way to generate MGCP messages is to use mgcp_msg_crcx(), mgcp_msg_mdcx() and mgcp_msg_dlcx(). All three function take a fixed set of parameters via their parameter list. There is no way to add or leave away optional parameters. add function mgcp_msg_gen(), this function takes a unified message struct. The struct features a presence bitmask which allows to enable and disable parameters as needed. It is also possible to add new parameters in the future without breaking the API. This commit depends on libosmocore Change: Change-Id I15e1af68616309555d0ed9ac5da027c9833d42e3 Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 223 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/4146/3 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index efc1f76..1e92da7 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include @@ -37,6 +38,36 @@ uint16_t audio_port; }; +enum mgcp_verb { + MGCP_VERB_CRCX, + MGCP_VERB_MDCX, + MGCP_VERB_DLCX, + MGCP_VERB_AUEP, + MGCP_VERB_RSIP, +}; + +#define MGCP_MSG_PRESENCE_ENDPOINT 0x0001 +#define MGCP_MSG_PRESENCE_CALL_ID 0x0002 +#define MGCP_MSG_PRESENCE_CONN_ID 0x0004 +#define MGCP_MSG_PRESENCE_AUDIO_IP 0x0008 +#define MGCP_MSG_PRESENCE_AUDIO_PORT 0x0010 +#define MGCP_MSG_PRESENCE_CONN_MODE 0x0020 + +/* See also RFC3435 section 3.2.1.3 */ +#define MGCP_ENDPOINT_MAXLEN (255*2+1+1) + +struct mgcp_msg { + enum mgcp_verb verb; + /* See MGCP_MSG_PRESENCE_* constands above */ + uint32_t presence; + char endpoint[MGCP_ENDPOINT_MAXLEN]; + unsigned int call_id; + uint32_t conn_id; + uint16_t audio_port; + char audio_ip[INET_ADDRSTRLEN]; + enum mgcp_connection_mode conn_mode; +}; + void mgcp_client_conf_init(struct mgcp_client_conf *conf); void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf); int mgcp_client_config_write(struct vty *vty, const char *indent); @@ -63,17 +94,22 @@ enum mgcp_connection_mode; +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, enum mgcp_connection_mode mode); +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, const char *rtp_conn_addr, uint16_t rtp_port, enum mgcp_connection_mode mode); +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg); + extern const struct value_string mgcp_client_connection_mode_strs[]; static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 1cd37be..2bb669e 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -614,6 +615,104 @@ "C: %x\r\n", trans_id, rtp_endpoint, call_id); } +#define MGCP_CRCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CALL_ID | \ + MGCP_MSG_PRESENCE_CONN_ID | \ + MGCP_MSG_PRESENCE_CONN_MODE) +#define MGCP_MDCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CONN_ID) +#define MGCP_DLCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_RSIP_MANDATORY 0 /* none */ + +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg) +{ + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); + uint32_t mandatory_mask; + struct msgb *msg = msgb_alloc_headroom(4096, 128, "MGCP tx"); + int rc = 0; + + /* Add command verb */ + switch (mgcp_msg->verb) { + case MGCP_VERB_CRCX: + mandatory_mask = MGCP_CRCX_MANDATORY; + rc += msgb_printf(msg, "CRCX %u", trans_id); + break; + case MGCP_VERB_MDCX: + mandatory_mask = MGCP_MDCX_MANDATORY; + rc += msgb_printf(msg, "MDCX %u", trans_id); + break; + case MGCP_VERB_DLCX: + mandatory_mask = MGCP_DLCX_MANDATORY; + rc += msgb_printf(msg, "DLCX %u", trans_id); + break; + case MGCP_VERB_AUEP: + mandatory_mask = MGCP_AUEP_MANDATORY; + rc += msgb_printf(msg, "AUEP %u", trans_id); + break; + case MGCP_VERB_RSIP: + mandatory_mask = MGCP_RSIP_MANDATORY; + rc += msgb_printf(msg, "RSIP %u", trans_id); + break; + default: + LOGP(DLMGCP, LOGL_ERROR, + "Invalid command verb, can not generate MGCP message"); + return NULL; + } + + /* Check if mandatory fields are missing */ + if (!((mgcp_msg->presence & mandatory_mask) == mandatory_mask)) { + LOGP(DLMGCP, LOGL_ERROR, + "One or more missing mandatory fields, can not generate MGCP message"); + return NULL; + } + + /* Add endpoint name */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_ENDPOINT) + rc += msgb_printf(msg, " %s", mgcp_msg->endpoint); + + /* Add protocol version */ + msgb_printf(msg, " MGCP 1.0\r\n"); + + /* Add call id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CALL_ID) + rc += msgb_printf(msg, "C: %x\r\n", mgcp_msg->call_id); + + /* Add connection id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID) + rc += msgb_printf(msg, "I: %u\r\n", mgcp_msg->conn_id); + + /* Add local connection options */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID + && mgcp_msg->verb == MGCP_VERB_CRCX) + rc += msgb_printf(msg, "L: p:20, a:AMR, nt:IN\r\n"); + + /* Add mode */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_MODE) + rc += + msgb_printf(msg, "M: %s\r\n", + mgcp_client_cmode_name(mgcp_msg->conn_mode)); + + /* Add RTP address and port (SDP) */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_IP + && mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT) { + rc += msgb_printf(msg, "\r\n"); + rc += msgb_printf(msg, "c=IN IP4 %s\r\n", mgcp_msg->audio_ip); + rc += + msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", + mgcp_msg->audio_port); + } + + if (rc != 0) { + LOGP(DLMGCP, LOGL_ERROR, + "message buffer to small, can not generate MGCP message"); + msgb_free(msg); + msg = NULL; + } + + return msg; +} + struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index f2f0e0f..750aa0e 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -149,6 +149,65 @@ "a=ptime:20\r\n"); } +void test_mgcp_msg(void) +{ + struct msgb *msg; + + struct mgcp_msg mgcp_msg; + + if (mgcp) + talloc_free(mgcp); + mgcp = mgcp_client_init(ctx, &conf); + + /* Pre-fill the message struct with some arbitary values */ + strcpy(mgcp_msg.audio_ip, "192.168.100.23"); + strcpy(mgcp_msg.endpoint, "23 at mgw"); + mgcp_msg.call_id = 47; + mgcp_msg.conn_id = 11; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + + printf("\n"); + + printf("Generated CRCX message:\n"); + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated MDCX message:\n"); + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated DLCX message:\n"); + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated AUEP message:\n"); + mgcp_msg.verb = MGCP_VERB_AUEP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated RSIP message:\n"); + mgcp_msg.verb = MGCP_VERB_RSIP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + msgb_free(msg); +} + static const struct log_info_cat log_categories[] = { }; @@ -167,6 +226,7 @@ mgcp_client_conf_init(&conf); test_crcx(); + test_mgcp_msg(); printf("Done\n"); fprintf(stderr, "Done\n"); diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index d35f2d6..7c4819d 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,4 +28,32 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + +Generated CRCX message: +CRCX 1 23 at mgw MGCP 1.0 +C: 2f +I: 11 +L: p:20, a:AMR, nt:IN +M: sendrecv + +Generated MDCX message: +MDCX 2 23 at mgw MGCP 1.0 +C: 2f +I: 11 +M: sendrecv + +c=IN IP4 192.168.100.23 +m=audio 1234 RTP/AVP 255 + +Generated DLCX message: +DLCX 3 23 at mgw MGCP 1.0 +C: 2f +I: 11 + +Generated AUEP message: +AUEP 4 23 at mgw MGCP 1.0 + +Generated RSIP message: +RSIP 5 23 at mgw MGCP 1.0 + Done -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 14:58:04 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 10 Oct 2017 14:58:04 +0000 Subject: [PATCH] osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4147 to look at the new patch set (#4). client: add ip address parsing to the client Some MGCP messages (CRCX, MDCX) return IP-Addresses. Make use of this information. Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 32 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/47/4147/4 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 1e92da7..ab273eb 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -36,6 +36,7 @@ char *body; struct mgcp_response_head head; uint16_t audio_port; + char audio_ip[INET_ADDRSTRLEN]; }; enum mgcp_verb { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 2bb669e..3bff1f0 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -174,7 +174,7 @@ } /* Parse a line like "m=audio 16002 RTP/AVP 98" */ -static int mgcp_parse_audio(struct mgcp_response *r, const char *line) +static int mgcp_parse_audio_port(struct mgcp_response *r, const char *line) { if (sscanf(line, "m=audio %hu", &r->audio_port) != 1) @@ -184,7 +184,25 @@ response_parse_failure: LOGP(DLMGCP, LOGL_ERROR, - "Failed to parse MGCP response header\n"); + "Failed to parse MGCP response header (audio port)\n"); + return -EINVAL; +} + +/* Parse a line like "c=IN IP4 10.11.12.13" */ +static int mgcp_parse_audio_ip(struct mgcp_response *r, const char *line) +{ + if (strlen(line) < 16) + goto response_parse_failure; + + if (memcmp("c=IN IP4 ", line, 9) != 0) + goto response_parse_failure; + + strcpy(r->audio_ip, line + 9); + return 0; + +response_parse_failure: + LOGP(DLMGCP, LOGL_ERROR, + "Failed to parse MGCP response header (audio ip)\n"); return -EINVAL; } @@ -213,7 +231,12 @@ switch (line[0]) { case 'm': - rc = mgcp_parse_audio(r, line); + rc = mgcp_parse_audio_port(r, line); + if (rc) + return rc; + break; + case 'c': + rc = mgcp_parse_audio_ip(r, line); if (rc) return rc; break; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 750aa0e..6671a3c 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -99,11 +99,13 @@ " head.response_code = %d\n" " head.trans_id = %u\n" " head.comment = %s\n" - " audio_port = %u\n", + " audio_port = %u\n" + " audio_ip = %s\n", response->head.response_code, response->head.trans_id, response->head.comment, - response->audio_port + response->audio_port, + response->audio_ip ); } diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index 7c4819d..3e84e89 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,6 +28,7 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + audio_ip = 10.9.1.120 Generated CRCX message: CRCX 1 23 at mgw MGCP 1.0 -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 10 16:44:55 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 16:44:55 +0000 Subject: libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) I think error check is missing. https://gerrit.osmocom.org/#/c/4200/1/src/msgb.c File src/msgb.c: Line 399: So, what happens if vsnprintf() returns negative value? -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 10 16:58:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 16:58:11 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: use defines for constants In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3920 to look at the new patch set (#6). Simplify TS alloc: use defines for constants * define and use constant for occupied TFI instead copying the same magic number all over the place * use libosmocore's define for bit pretty-printer Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Related: OS#2282 --- M configure.ac M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp 5 files changed, 10 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/20/3920/6 diff --git a/configure.ac b/configure.ac index 0a3557d..91e245f 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl Checks for typedefs, structures and compiler characteristics dnl checks for libraries -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.9) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.4) PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.3) PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.5.1.4) diff --git a/src/bts.cpp b/src/bts.cpp index b768569..6debb68 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -458,7 +458,7 @@ for (trx = trx_from; trx <= trx_to; trx++) { bool trx_has_pdch = false; - free_tfis = 0xffffffff; + free_tfis = NO_FREE_TFI; for (ts = 0; ts < 8; ts++) { pdch = &m_bts.trx[trx].pdch[ts]; diff --git a/src/bts.h b/src/bts.h index d65cd2f..26aaa21 100644 --- a/src/bts.h +++ b/src/bts.h @@ -44,6 +44,7 @@ #define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +#define NO_FREE_TFI 0xffffffffUL /* see bts->gsmtap_categ_mask */ enum pcu_gsmtap_category { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..3b596f4 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -128,7 +128,7 @@ int8_t tfi; tfi_map = pdch->assigned_tfi(dir); - if (tfi_map == 0xffffffffUL) + if (tfi_map == NO_FREE_TFI) return -1; /* look for USF, don't use USF=7 */ @@ -209,7 +209,7 @@ pdch->num_tbfs(GPRS_RLCMAC_UL_TBF) + compute_usage_by_reservation(pdch, dir); - if (pdch->assigned_tfi(reverse(dir)) == 0xffffffff) + if (pdch->assigned_tfi(reverse(dir)) == NO_FREE_TFI) /* No TFI in the opposite direction, avoid it */ usage += 32; @@ -340,10 +340,10 @@ if (!pdch->is_enabled()) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == NO_FREE_TFI) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == NO_FREE_TFI) continue; return trx_no; diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..9bff38a 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -613,17 +613,17 @@ continue; if (ul_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != NO_FREE_TFI) continue; if (dl_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != NO_FREE_TFI) continue; busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n", + printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n", tfi, ms_class, get_dir_char(0x01, ul_slots, dl_slots, busy_slots), get_dir_char(0x02, ul_slots, dl_slots, busy_slots), -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 17:58:36 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 17:58:36 +0000 Subject: [PATCH] osmo-pcu[master]: Add multislot classes from latest spec In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4072 to look at the new patch set (#2). Add multislot classes from latest spec The table B.1 is copy-pasted from 3GPP TS 45.002 and reformatted via Emacs macros into C struct to avoid typos. Also make sure to check index properly when accessing multislot class. Note: classes 35-45 which need TA offset are not properly supported yet - this can be extended once we have such devices to test it. Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 26 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/4072/2 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 2b08cf6..9284406 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -32,12 +32,15 @@ /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 -/* 3GPP TS 05.02 Annex B.1 */ +/* 3GPP TS 45.002 Annex B Table B.1 */ #define MS_NA 255 /* N/A */ #define MS_A 254 /* 1 with hopping, 0 without */ #define MS_B 253 /* 1 with hopping, 0 without (change Rx to Tx)*/ #define MS_C 252 /* 1 with hopping, 0 without (change Tx to Rx)*/ +/* FIXME: use actual TA offset for computation - make sure to adjust "1 + MS_TO" accordingly + see also "Offset required" bit in 3GPP TS 24.008 ?10.5.1.7 */ +#define MS_TO 0 /* 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value) */ struct gprs_ms_multislot_class { uint8_t rx, tx, sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -45,7 +48,7 @@ uint8_t type; /* Type of Mobile */ }; -static const struct gprs_ms_multislot_class gprs_ms_multislot_class[32] = { +static const struct gprs_ms_multislot_class gprs_ms_multislot_class[] = { /* M-S Class | Max # of slots | Min # of slots | Type */ /* | Rx Tx Sum | Tta Ttb Tra Trb | */ /* N/A */ { MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, @@ -78,8 +81,22 @@ /* 27 */ { 8, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, /* 28 */ { 8, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, /* 29 */ { 8, 8, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, -/* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, + /* 30 */ { 5, 1, 6, 2, 1, 1, 1, 1 }, + /* 31 */ { 5, 2, 6, 2, 1, 1, 1, 1 }, + /* 32 */ { 5, 3, 6, 2, 1, 1, 1, 1 }, + /* 33 */ { 5, 4, 6, 2, 1, 1, 1, 1 }, + /* 34 */ { 5, 5, 6, 2, 1, 1, 1, 1 }, + /* 35 */ { 5, 1, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 36 */ { 5, 2, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 37 */ { 5, 3, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 38 */ { 5, 4, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 39 */ { 5, 5, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 40 */ { 6, 1, 7, 1, 1, 1, MS_TO, 1 }, + /* 41 */ { 6, 2, 7, 1, 1, 1, MS_TO, 1 }, + /* 42 */ { 6, 3, 7, 1, 1, 1, MS_TO, 1 }, + /* 43 */ { 6, 4, 7, 1, 1, 1, MS_TO, 1 }, + /* 44 */ { 6, 5, 7, 1, 1, 1, MS_TO, 1 }, + /* 45 */ { 6, 6, 7, 1, 1, 1, MS_TO, 1 }, }; static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) @@ -510,13 +527,12 @@ enum {MASK_TT, MASK_TR}; unsigned mask_sel; - if (ms->ms_class() >= 32) { - LOGP(DRLCMAC, LOGL_ERROR, "Multislot class %d out of range.\n", - ms->ms_class()); - return -EINVAL; - } - if (ms->ms_class()) { + if (ms->ms_class() >= ARRAY_SIZE(gprs_ms_multislot_class)) { + LOGP(DRLCMAC, LOGL_ERROR, "Multislot class %u out of range [1, %u].\n", + ms->ms_class(), ARRAY_SIZE(gprs_ms_multislot_class)); + return -EINVAL; + } ms_class = &gprs_ms_multislot_class[ms->ms_class()]; LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for " "class %d\n", ms->ms_class()); -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 10 17:58:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 17:58:37 +0000 Subject: [PATCH] osmo-pcu[master]: cosmetic: reformat multislot classes table Message-ID: Review at https://gerrit.osmocom.org/4201 cosmetic: reformat multislot classes table Add header similar to the one used in the standard, reformat to facilitate further extention. Change-Id: I786df6b154c0668d2cefa0ea84d7dea336b0da1d Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 32 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/01/4201/1 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..2b08cf6 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -46,37 +46,38 @@ }; static const struct gprs_ms_multislot_class gprs_ms_multislot_class[32] = { -/* M-S Class Rx Tx Sum Tta Ttb Tra Trb Type */ -/* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, -/* 1 */ { 1, 1, 2, 3, 2, 4, 2, 1 }, -/* 2 */ { 2, 1, 3, 3, 2, 3, 1, 1 }, -/* 3 */ { 2, 2, 3, 3, 2, 3, 1, 1 }, -/* 4 */ { 3, 1, 4, 3, 1, 3, 1, 1 }, -/* 5 */ { 2, 2, 4, 3, 1, 3, 1, 1 }, -/* 6 */ { 3, 2, 4, 3, 1, 3, 1, 1 }, -/* 7 */ { 3, 3, 4, 3, 1, 3, 1, 1 }, -/* 8 */ { 4, 1, 5, 3, 1, 2, 1, 1 }, -/* 9 */ { 3, 2, 5, 3, 1, 2, 1, 1 }, -/* 10 */ { 4, 2, 5, 3, 1, 2, 1, 1 }, -/* 11 */ { 4, 3, 5, 3, 1, 2, 1, 1 }, -/* 12 */ { 4, 4, 5, 2, 1, 2, 1, 1 }, -/* 13 */ { 3, 3, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, -/* 14 */ { 4, 4, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, -/* 15 */ { 5, 5, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, -/* 16 */ { 6, 6, MS_NA, MS_NA, MS_A, 2, MS_A, 2 }, -/* 17 */ { 7, 7, MS_NA, MS_NA, MS_A, 1, 0, 2 }, -/* 18 */ { 8, 8, MS_NA, MS_NA, 0, 0, 0, 2 }, -/* 19 */ { 6, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 20 */ { 6, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 21 */ { 6, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 22 */ { 6, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 23 */ { 6, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 24 */ { 8, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 25 */ { 8, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 26 */ { 8, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 27 */ { 8, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 28 */ { 8, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 29 */ { 8, 8, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* M-S Class | Max # of slots | Min # of slots | Type */ + /* | Rx Tx Sum | Tta Ttb Tra Trb | */ + /* N/A */ { MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, + /* 1 */ { 1, 1, 2, 3, 2, 4, 2, 1 }, + /* 2 */ { 2, 1, 3, 3, 2, 3, 1, 1 }, + /* 3 */ { 2, 2, 3, 3, 2, 3, 1, 1 }, + /* 4 */ { 3, 1, 4, 3, 1, 3, 1, 1 }, + /* 5 */ { 2, 2, 4, 3, 1, 3, 1, 1 }, + /* 6 */ { 3, 2, 4, 3, 1, 3, 1, 1 }, + /* 7 */ { 3, 3, 4, 3, 1, 3, 1, 1 }, + /* 8 */ { 4, 1, 5, 3, 1, 2, 1, 1 }, + /* 9 */ { 3, 2, 5, 3, 1, 2, 1, 1 }, + /* 10 */ { 4, 2, 5, 3, 1, 2, 1, 1 }, + /* 11 */ { 4, 3, 5, 3, 1, 2, 1, 1 }, + /* 12 */ { 4, 4, 5, 2, 1, 2, 1, 1 }, + /* 13 */ { 3, 3, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, + /* 14 */ { 4, 4, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, + /* 15 */ { 5, 5, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, + /* 16 */ { 6, 6, MS_NA, MS_NA, MS_A, 2, MS_A, 2 }, + /* 17 */ { 7, 7, MS_NA, MS_NA, MS_A, 1, 0, 2 }, + /* 18 */ { 8, 8, MS_NA, MS_NA, 0, 0, 0, 2 }, + /* 19 */ { 6, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 20 */ { 6, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 21 */ { 6, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 22 */ { 6, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 23 */ { 6, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 24 */ { 8, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 25 */ { 8, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 26 */ { 8, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 27 */ { 8, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 28 */ { 8, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 29 */ { 8, 8, MS_NA, 2, MS_B, 2, MS_C, 1 }, /* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, /* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, }; -- To view, visit https://gerrit.osmocom.org/4201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I786df6b154c0668d2cefa0ea84d7dea336b0da1d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 10 18:02:55 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 10 Oct 2017 18:02:55 +0000 Subject: osmo-pcu[master]: Add multislot classes from latest spec In-Reply-To: References: Message-ID: Patch Set 2: > What is the minimal dependency to get this in? Which patch removes the <= 32 assumption? It's part of this patch. I can split it too if necessary. > tests/alloc/AllocTest.cpp requires updates to use/test the new classes as well. I'll check and update in next revision. > Any idea why we padded the structs before? No idea. It's added in one commit and I do not see anything in the code relying on it. -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 10 21:22:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 21:22:06 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: don't log about missing SQLite log cb In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4175 to look at the new patch set (#4). cosmetic: don't log about missing SQLite log cb SQLite3 seems to be commonly compiled without log callback support. It is then misleading to see a seeming error message about this on each osmo-hlr startup. Avoid the impression that we would miss out on important logging: query sqlit3_compileoption_get() whether SQLITE_CONFIG_SQLLOG is enabled. Try to register the callback only if present, if not, say so on DEBUG log. See https://sqlite.org/compile.html "SQLITE_ENABLE_SQLLOG" Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 --- M src/db.c 1 file changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/75/4175/4 diff --git a/src/db.c b/src/db.c index 2c10ba0..f7cbc94 100644 --- a/src/db.c +++ b/src/db.c @@ -21,6 +21,7 @@ #include #include +#include #include "logging.h" #include "db.h" @@ -121,6 +122,7 @@ struct db_context *dbc = talloc_zero(ctx, struct db_context); unsigned int i; int rc; + bool has_sqlite_config_sqllog = false; LOGP(DDB, LOGL_NOTICE, "using database: %s\n", fname); LOGP(DDB, LOGL_INFO, "Compiled against SQLite3 lib version %s\n", SQLITE_VERSION); @@ -133,15 +135,21 @@ if (!o) break; LOGP(DDB, LOGL_DEBUG, "SQlite3 compiled with '%s'\n", o); + if (!strcmp(o, "ENABLE_SQLLOG")) + has_sqlite_config_sqllog = true; } rc = sqlite3_config(SQLITE_CONFIG_LOG, sql3_error_log_cb, NULL); if (rc != SQLITE_OK) LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 error log callback\n"); - rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); - if (rc != SQLITE_OK) - LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 SQL statement log callback\n"); + if (has_sqlite_config_sqllog) { + rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); + if (rc != SQLITE_OK) + LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 SQL log callback\n"); + } else + LOGP(DDB, LOGL_DEBUG, "Not setting SQL log callback:" + " SQLite3 compiled without support for it\n"); rc = sqlite3_open(dbc->fname, &dbc->db); if (rc != SQLITE_OK) { -- To view, visit https://gerrit.osmocom.org/4175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 10 23:56:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 23:56:41 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: log: "SQLite" with capital L Message-ID: Review at https://gerrit.osmocom.org/4202 cosmetic: log: "SQLite" with capital L Change-Id: I43a6ea646f14cfea3a7cd4eb88237ada6d47f5f1 --- M src/db.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/02/4202/1 diff --git a/src/db.c b/src/db.c index 2c10ba0..0ece61b 100644 --- a/src/db.c +++ b/src/db.c @@ -132,16 +132,16 @@ const char *o = sqlite3_compileoption_get(i); if (!o) break; - LOGP(DDB, LOGL_DEBUG, "SQlite3 compiled with '%s'\n", o); + LOGP(DDB, LOGL_DEBUG, "SQLite3 compiled with '%s'\n", o); } rc = sqlite3_config(SQLITE_CONFIG_LOG, sql3_error_log_cb, NULL); if (rc != SQLITE_OK) - LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 error log callback\n"); + LOGP(DDB, LOGL_NOTICE, "Unable to set SQLite3 error log callback\n"); rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); if (rc != SQLITE_OK) - LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 SQL statement log callback\n"); + LOGP(DDB, LOGL_NOTICE, "Unable to set SQLite3 SQL statement log callback\n"); rc = sqlite3_open(dbc->fname, &dbc->db); if (rc != SQLITE_OK) { @@ -153,7 +153,7 @@ /* enable extended result codes */ rc = sqlite3_extended_result_codes(dbc->db, 1); if (rc != SQLITE_OK) - LOGP(DDB, LOGL_ERROR, "Unable to enable SQlite3 extended result codes\n"); + LOGP(DDB, LOGL_ERROR, "Unable to enable SQLite3 extended result codes\n"); char *err_msg; rc = sqlite3_exec(dbc->db, "PRAGMA journal_mode=WAL; PRAGMA synchonous = NORMAL;", 0, 0, &err_msg); -- To view, visit https://gerrit.osmocom.org/4202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43a6ea646f14cfea3a7cd4eb88237ada6d47f5f1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 23:56:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 23:56:42 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: db_hlr: SL3_TXT: clarify indenting Message-ID: Review at https://gerrit.osmocom.org/4203 cosmetic: db_hlr: SL3_TXT: clarify indenting Before, it looked like the nul term was within the if () body (despite no body being present). While at it, also remove one of the two tabs of indenting and put the opening 'do {' on its own line. Change-Id: I8d03433b6fba90f4e46814bc54636bc3a444cc46 --- M src/db_hlr.c 1 file changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/03/4203/1 diff --git a/src/db_hlr.c b/src/db_hlr.c index 4bccca4..5db2c9e 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -30,12 +30,13 @@ #define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) -#define SL3_TXT(x, stmt, idx) do { \ - const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ - if (_txt) \ - strncpy(x, _txt, sizeof(x)); \ - x[sizeof(x)-1] = '\0'; \ - } while (0) +#define SL3_TXT(x, stmt, idx) \ + do { \ + const char *_txt = (const char *) sqlite3_column_text(stmt, idx);\ + if (_txt) \ + strncpy(x, _txt, sizeof(x)); \ + x[sizeof(x)-1] = '\0'; \ + } while (0) int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr) -- To view, visit https://gerrit.osmocom.org/4203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8d03433b6fba90f4e46814bc54636bc3a444cc46 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 23:56:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 23:56:43 +0000 Subject: [PATCH] osmo-hlr[master]: ctrl_test_runner.py: use proper constant as test db path Message-ID: Review at https://gerrit.osmocom.org/4204 ctrl_test_runner.py: use proper constant as test db path Change-Id: I9533a9ff8c0f8d24c678583a9197143a187908f3 --- M tests/ctrl_test_runner.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/04/4204/1 diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py index 7c14f50..1c5ec2a 100644 --- a/tests/ctrl_test_runner.py +++ b/tests/ctrl_test_runner.py @@ -178,7 +178,7 @@ def tearDown(self): super(TestCtrlHLR, self).tearDown() - os.unlink("hlr_ctrl_test.db") + os.unlink(self.HLR_DB) def ctrl_command(self): return ["./src/osmo-hlr", "-c", "doc/examples/osmo-hlr.cfg", '-l', 'hlr_ctrl_test.db'] -- To view, visit https://gerrit.osmocom.org/4204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9533a9ff8c0f8d24c678583a9197143a187908f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 23:56:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 23:56:43 +0000 Subject: [PATCH] osmo-hlr[master]: gitignore: tests/package.m4 Message-ID: Review at https://gerrit.osmocom.org/4205 gitignore: tests/package.m4 Change-Id: Ida4a61d4786d7db63dc59a641f44afb2ec2edd97 --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/05/4205/1 diff --git a/.gitignore b/.gitignore index 2e78dfa..72f11a1 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ libtool ltmain.sh m4 +*.m4 missing .deps -- To view, visit https://gerrit.osmocom.org/4205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida4a61d4786d7db63dc59a641f44afb2ec2edd97 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 23:57:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 23:57:18 +0000 Subject: [ABANDON] libosmocore[master]: VTY: allow comments in the same line as vty commands In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: VTY: allow comments in the same line as vty commands ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Iccd9cc8604494379910c534b35ce7e74e329d863 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 23:57:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 23:57:39 +0000 Subject: [ABANDON] openbsc[master]: vty tests: drop testBSCreload In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: vty tests: drop testBSCreload ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ib042cd24857cc58a4297d666a8a525e05bd4c917 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 10 23:58:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 10 Oct 2017 23:58:52 +0000 Subject: [ABANDON] osmo-gsm-tester[master]: config: Fix crash in overlay() In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: config: Fix crash in overlay() ...................................................................... Abandoned abandoning it so that Pau can resurrect it with said pespin/oct branch. I just want to get it out of my queue now, resurrect it later or give yours a distinct change-id -- To view, visit https://gerrit.osmocom.org/3970 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I01f50c84f40018269815b03faac63c2f746e1462 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 11 00:03:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 00:03:38 +0000 Subject: [ABANDON] osmo-hlr[master]: comment: ctrl: explain why status-ps is a SET cmd In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: comment: ctrl: explain why status-ps is a SET cmd ...................................................................... Abandoned shall be fixed by new ctrl commands instead -- To view, visit https://gerrit.osmocom.org/4062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I1ccf6affaf3c5f2096fd3eb36454b18c3670a1b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 00:04:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 00:04:01 +0000 Subject: osmo-gsm-manuals[master]: OsmoGSMTester: document logrotate maxsize In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib3e7143eb5d90eea4860a0a334da25efe926a231 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 00:04:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 00:04:02 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoGSMTester: document logrotate maxsize In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OsmoGSMTester: document logrotate maxsize ...................................................................... OsmoGSMTester: document logrotate maxsize Change-Id: Ib3e7143eb5d90eea4860a0a334da25efe926a231 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index 4d2b677..6eef2fa 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -484,6 +484,14 @@ gpasswd -a jenkins usrp ---- +==== Log Rotation + +To avoid clogging up /var/log, it makes sense to choose a sane maximum log size: + +---- +echo maxsize 10M > /etc/logrotate.d/maxsize +---- + ==== Install Scripts IMPORTANT: When using the jenkins build slave as configured above, *there is no -- To view, visit https://gerrit.osmocom.org/4065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib3e7143eb5d90eea4860a0a334da25efe926a231 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 00:04:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 00:04:26 +0000 Subject: [MERGED] osmo-mgw[master]: mgcp_test: tweak test failure output In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: mgcp_test: tweak test failure output ...................................................................... mgcp_test: tweak test failure output Change-Id: Ibfc80f06b2811cc32fe38518b11efd6764b347ee --- M tests/legacy_mgcp/mgcp_test.c M tests/mgcp/mgcp_test.c 2 files changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/legacy_mgcp/mgcp_test.c b/tests/legacy_mgcp/mgcp_test.c index 904ecce..1400893 100644 --- a/tests/legacy_mgcp/mgcp_test.c +++ b/tests/legacy_mgcp/mgcp_test.c @@ -541,7 +541,8 @@ if (msg) printf("%s failed '%s'\n", t->name, (char *) msg->data); } else if (strcmp((char *) msg->data, t->exp_resp) != 0) - printf("%s failed '%s'\n", t->name, (char *) msg->data); + printf("%s failed.\nExpected:\n%s\nGot:\n%s\n", + t->name, t->exp_resp, (char *) msg->data); msgb_free(msg); if (dummy_packets) diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index e783dac..5b292a5 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -599,7 +599,8 @@ OSMO_ASSERT(false); } } else if (strcmp((char *)msg->data, t->exp_resp) != 0) { - printf("%s failed '%s'\n", t->name, (char *)msg->data); + printf("%s failed.\nExpected:\n%s\nGot:\n%s\n", + t->name, t->exp_resp, (char *) msg->data); OSMO_ASSERT(false); } msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/4007 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibfc80f06b2811cc32fe38518b11efd6764b347ee Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 00:05:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 00:05:22 +0000 Subject: osmo-gsm-manuals[master]: fix make deps: don't use the FORCE In-Reply-To: References: Message-ID: Patch Set 2: still aware of this, will check as soon as I'm back in osmo-gsm-manuals land after osmo-hlr VTY is "done". -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 00:46:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 00:46:37 +0000 Subject: [PATCH] osmo-ci[master]: coverity: Don't start with a new clone, but simply fetch/che... Message-ID: Review at https://gerrit.osmocom.org/4206 coverity: Don't start with a new clone, but simply fetch/checkout If a given git clone already exists, simply do a fetch + checkout -f, rather than cloning a decade worth of history from scratch. Change-Id: Icecb2d00a75bc303d84efafee5c1f2d52ba1b6b3 --- M coverity/prepare_source_Osmcocom.sh 1 file changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/06/4206/1 diff --git a/coverity/prepare_source_Osmcocom.sh b/coverity/prepare_source_Osmcocom.sh index 386e16e..527bbc9 100755 --- a/coverity/prepare_source_Osmcocom.sh +++ b/coverity/prepare_source_Osmcocom.sh @@ -1,7 +1,8 @@ #!/bin/sh -mkdir -p source-Osmocom +BASEDIR=source-Osmocom -cd source-Osmocom +[ -d $BASEDIR ] || mkdir -p $BASEDIR +cd $BASEDIR for proj in \ asn1c \ @@ -23,7 +24,11 @@ osmo-hlr \ ; do - git clone git://git.osmocom.org/$proj + if [ -d $proj ]; then + (cd $proj && git fetch && git checkout -f -B master origin/master) + else + git clone git://git.osmocom.org/$proj + fi done git clone git://git.sysmocom.de/sysmo-bts/layer1-api -- To view, visit https://gerrit.osmocom.org/4206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icecb2d00a75bc303d84efafee5c1f2d52ba1b6b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 11 00:46:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 00:46:40 +0000 Subject: [PATCH] osmo-ci[master]: coverity: Reduce codeduplication in build_Osmocom.sh Message-ID: Review at https://gerrit.osmocom.org/4207 coverity: Reduce codeduplication in build_Osmocom.sh We don't need a separate build_foo function if it is identical in its body except for the 'foo' (project name). Let's clean this up. Change-Id: I27e9fc94142b42a7b7c2f9eca89056e1f90f1f0e --- M coverity/build_Osmocom.sh 1 file changed, 18 insertions(+), 94 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/07/4207/1 diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index bccd7ea..910f810 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -22,16 +22,16 @@ make install } +build_default() { + pushd $1 + do_build + popd +} + build_layer1api() { pushd layer1-api install -d "$prefix/include/sysmocom/femtobts/" cp include/*.h "$prefix/include/sysmocom/femtobts/" - popd -} - -build_asn1c() { - pushd asn1c - do_build popd } @@ -42,50 +42,11 @@ popd } -build_osmoiuh() { - pushd osmo-iuh - do_build - popd -} - -build_libosmocore() { - pushd libosmocore - - do_build - popd -} - -build_libosmoabis() { - pushd libosmo-abis - - do_build - popd -} - -build_libosmosccp() { - pushd libosmo-sccp - - do_build - popd -} - -build_osmoggsn() { - pushd osmo-ggsn - do_build - popd -} - build_openbsc() { pushd openbsc/openbsc #IU git checkout sysmocom/iu do_build --enable-osmo-bsc --enable-nat --enable-smpp --enable-mgcp-transcoding #IU --enable-iu - popd -} - -build_osmohlr() { - pushd osmo-hlr - do_build popd } @@ -107,66 +68,29 @@ popd } -build_libosmodsp() { - pushd libosmo-dsp - do_build - popd -} - -build_libosmonetif() { - pushd libosmo-netif - do_build - popd -} - -build_osmogmr() { - pushd osmo-gmr - do_build - popd -} - -build_libsmpp34() { - pushd libsmpp34 - do_build - popd -} - -build_osmosipconnector() { - pushd osmo-sip-connector - do_build - popd -} - -build_osmotrx() { - pushd osmo-trx - do_build - popd -} - cd "$src_dir" rm -rf "$prefix" build_layer1api -build_asn1c -build_libosmocore +build_default asn1c +build_default libosmocore build_libasn1c -build_libosmoabis -build_libosmonetif -build_libosmosccp -build_libsmpp34 -build_osmoggsn -#IU build_osmoiuh +build_default libosmo-abis +build_default libosmo-netif +build_default libosmo-sccp +build_default libsmpp34 +build_default osmo-ggsn +#IU build_default osmo-iuh build_osmopcu build_osmobts build_openbsc -build_osmohlr # GMR -build_libosmodsp -build_osmogmr +build_default libosmo-dsp +build_default osmo-gmr # MNCC to SIP -build_osmosipconnector +build_default osmo-sip-connector -build_osmotrx +build_default osmo-trx -- To view, visit https://gerrit.osmocom.org/4207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27e9fc94142b42a7b7c2f9eca89056e1f90f1f0e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 11 00:46:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 00:46:41 +0000 Subject: [PATCH] osmo-ci[master]: coverity: Add support for $PARALLEL_MAKE environment variable Message-ID: Review at https://gerrit.osmocom.org/4208 coverity: Add support for $PARALLEL_MAKE environment variable Change-Id: I95b0e5f104155ac7c5ae993b7f3c0c0721d0157b --- M coverity/build_Osmocom.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/08/4208/1 diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 910f810..1a4b5a5 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -18,7 +18,7 @@ autoreconf --install --force ./configure --prefix="$prefix" $* - make + make $PARALLEL_MAKE make install } -- To view, visit https://gerrit.osmocom.org/4208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95b0e5f104155ac7c5ae993b7f3c0c0721d0157b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 11 00:46:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 00:46:41 +0000 Subject: [PATCH] osmo-ci[master]: coverity: osmo-bts now builds without openbsc Message-ID: Review at https://gerrit.osmocom.org/4209 coverity: osmo-bts now builds without openbsc Change-Id: I09565441c0d9eb907edba82b26df38d08a5d868d --- M coverity/build_Osmocom.sh 1 file changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/09/4209/1 diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 1a4b5a5..9e5607d 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -51,13 +51,9 @@ } build_osmobts() { - #IU pushd openbsc/openbsc - #IU git checkout master - #IU git pull --rebase - #IU popd pushd osmo-bts - do_build --enable-sysmocom-bts --with-openbsc="$src_dir/openbsc/openbsc/include" + do_build --enable-sysmocom-bts popd } -- To view, visit https://gerrit.osmocom.org/4209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09565441c0d9eb907edba82b26df38d08a5d868d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 11 00:46:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 00:46:41 +0000 Subject: [PATCH] osmo-ci[master]: coverity: clone + build osmo-{mgw, bsc, msc, hlr} Message-ID: Review at https://gerrit.osmocom.org/4210 coverity: clone + build osmo-{mgw,bsc,msc,hlr} Related: OS#2564 Change-Id: I6f046943f045a97c2bae4e99485a474c11d90a90 --- M coverity/build_Osmocom.sh M coverity/prepare_source_Osmcocom.sh 2 files changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/10/4210/1 diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 9e5607d..3cb0c84 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -81,6 +81,11 @@ build_osmopcu build_osmobts build_openbsc +build_default osmo-mgw +build_default osmo-bsc +build_default osmo-msc +build_default osmo-hlr +build_default osmo-sgsn # GMR build_default libosmo-dsp diff --git a/coverity/prepare_source_Osmcocom.sh b/coverity/prepare_source_Osmcocom.sh index 527bbc9..05e50e4 100755 --- a/coverity/prepare_source_Osmcocom.sh +++ b/coverity/prepare_source_Osmcocom.sh @@ -14,7 +14,11 @@ libosmo-sccp \ libsmpp34 \ openbsc \ + osmo-bsc \ + osmo-msc \ + osmo-mgw \ osmo-ggsn \ + osmo-sgsn \ osmo-bts \ osmo-gmr \ osmo-iuh \ -- To view, visit https://gerrit.osmocom.org/4210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6f046943f045a97c2bae4e99485a474c11d90a90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 11 00:46:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 00:46:41 +0000 Subject: [PATCH] osmo-ci[master]: coverity: build with --enable-trx Message-ID: Review at https://gerrit.osmocom.org/4211 coverity: build with --enable-trx Change-Id: I0684bc04b82ad57a1513bbd4627144d6c254b965 --- M coverity/build_Osmocom.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/11/4211/1 diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 3cb0c84..81a346d 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -53,7 +53,7 @@ build_osmobts() { pushd osmo-bts - do_build --enable-sysmocom-bts + do_build --enable-sysmocom-bts --enable-trx popd } -- To view, visit https://gerrit.osmocom.org/4211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0684bc04b82ad57a1513bbd4627144d6c254b965 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:20:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:20:38 +0000 Subject: osmo-hlr[master]: cosmetic: don't log about missing SQLite log cb In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:23:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:23:08 +0000 Subject: osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:24:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:24:01 +0000 Subject: osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:26:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:26:39 +0000 Subject: osmo-hlr[master]: cosmetic: db_hlr: SL3_TXT: clarify indenting In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d03433b6fba90f4e46814bc54636bc3a444cc46 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:26:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:26:45 +0000 Subject: osmo-hlr[master]: cosmetic: log: "SQLite" with capital L In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43a6ea646f14cfea3a7cd4eb88237ada6d47f5f1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:26:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:26:56 +0000 Subject: osmo-hlr[master]: ctrl_test_runner.py: use proper constant as test db path In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9533a9ff8c0f8d24c678583a9197143a187908f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:27:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:27:07 +0000 Subject: osmo-hlr[master]: gitignore: tests/package.m4 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida4a61d4786d7db63dc59a641f44afb2ec2edd97 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:28:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:28:08 +0000 Subject: osmo-bsc[master]: ctrl: add oml-uptime command In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iec405aa949d6a38a9c8e64cd7ee4b49fd416835d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:28:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:28:10 +0000 Subject: [MERGED] osmo-bsc[master]: ctrl: add oml-uptime command In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ctrl: add oml-uptime command ...................................................................... ctrl: add oml-uptime command Expose OML link uptime available via vts's "sh bts 0" command with the new "bts.0.oml-uptime" ctrl command. To avoid code duplication, move uptime computation into separate function and use it for both. Change-Id: Iec405aa949d6a38a9c8e64cd7ee4b49fd416835d Related: OS#2486 --- M include/osmocom/bsc/gsm_data.h M src/libbsc/bsc_ctrl_commands.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c 4 files changed, 43 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 429526d..51b2c98 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -657,6 +657,8 @@ char *get_oml_status(const struct gsm_bts *bts); char *get_model_oml_status(const struct gsm_bts *bts); +unsigned long long bts_uptime(const struct gsm_bts *bts); + /* control interface handling */ int bsc_base_ctrl_cmds_install(void); diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c index d925e67..2d6fcb6 100644 --- a/src/libbsc/bsc_ctrl_commands.c +++ b/src/libbsc/bsc_ctrl_commands.c @@ -240,6 +240,21 @@ CTRL_CMD_DEFINE_RO(bts_oml_conn, "oml-connection-state"); +static int get_bts_oml_up(struct ctrl_cmd *cmd, void *data) +{ + const struct gsm_bts *bts = cmd->node; + + cmd->reply = talloc_asprintf(cmd, "%llu", bts_uptime(bts)); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(bts_oml_up, "oml-uptime"); + static int verify_bts_gprs_mode(struct ctrl_cmd *cmd, const char *value, void *_data) { int valid; @@ -450,6 +465,7 @@ rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_si); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_chan_load); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_oml_conn); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_oml_up); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_gprs_mode); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rf_state); diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index f5f265f..674813c 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -37,6 +37,8 @@ #include #include #include + +#include #include #include @@ -98,6 +100,24 @@ return 0; } +unsigned long long bts_uptime(const struct gsm_bts *bts) +{ + struct timespec tp; + + if (!bts->uptime || !bts->oml_link) { + LOGP(DNM, LOGL_ERROR, "BTS %u OML link uptime unavailable\n", bts->nr); + return 0; + } + + if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0) { + LOGP(DNM, LOGL_ERROR, "BTS %u uptime computation failure: %s\n", bts->nr, strerror(errno)); + return 0; + } + + /* monotonic clock helps to ensure that the conversion is valid */ + return difftime(tp.tv_sec, bts->uptime); +} + static int rsl_si(struct gsm_bts_trx *trx, enum osmo_sysinfo_type i, int si_len) { struct gsm_bts *bts = trx->bts; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 43cb282..ca29b4c 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -236,8 +236,6 @@ { struct pchan_load pl; unsigned long long sec; - struct timespec tp; - int rc; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", @@ -309,17 +307,11 @@ bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { vty_out(vty, " OML Link state: %s", get_model_oml_status(bts)); - if (bts->oml_link) { - if (bts->uptime) { - rc = clock_gettime(CLOCK_MONOTONIC, &tp); - if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ - sec = (unsigned long long)difftime(tp.tv_sec, bts->uptime); - vty_out(vty, " %llu days %llu hours %llu min. %llu sec.%s", - OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), - sec % 60, VTY_NEWLINE); - } - } - } + sec = bts_uptime(bts); + if (sec) + vty_out(vty, " %llu days %llu hours %llu min. %llu sec.%s", + OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), sec % 60, + VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); -- To view, visit https://gerrit.osmocom.org/4197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iec405aa949d6a38a9c8e64cd7ee4b49fd416835d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:28:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:28:47 +0000 Subject: osmo-bsc[master]: SI1q: fix EARFCN appender In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4199 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b2aa3825e9affb6dfeadecdf24dd1a43a92b7b7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:28:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:28:51 +0000 Subject: [MERGED] osmo-bsc[master]: SI1q: fix EARFCN appender In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SI1q: fix EARFCN appender ...................................................................... SI1q: fix EARFCN appender Previously if we ran out of space while adding EARFCN, we simply return which might result in malformed SI2q. Fix it by proper rollback of entire EARFCN. While at it, let's be paranoid and introduce extra checks against integer overflow in budget calculations. Change-Id: I4b2aa3825e9affb6dfeadecdf24dd1a43a92b7b7 Related: OS#2357 --- M src/libbsc/rest_octets.c M tests/gsm0408/gsm0408_test.ok 2 files changed, 33 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index a22b8e6..abd621c 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -59,15 +59,16 @@ } /* Append Repeated E-UTRAN Neighbour Cell to bitvec: see 3GPP TS 44.018 Table 10.5.2.33b.1 */ -static inline void append_eutran_neib_cell(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) +static inline bool append_eutran_neib_cell(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) { const struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; unsigned i, skip = 0; size_t offset = bts->e_offset; - uint8_t rem = budget - 6, earfcn_budget; /* account for mandatory stop bit and THRESH_E-UTRAN_high */ + int16_t rem = budget - 6; /* account for mandatory stop bit and THRESH_E-UTRAN_high */ + uint8_t earfcn_budget; if (budget <= 6) - return; + return false; OSMO_ASSERT(budget <= SI2Q_MAX_LEN); @@ -87,6 +88,9 @@ else rem--; + if (rem < 0) + return false; + /* now we can proceed with actually adding EARFCNs within adjusted budget limit */ for (i = 0; i < e->length; i++) { if (e->arfcn[i] != OSMO_EARFCN_INVALID) { @@ -104,6 +108,10 @@ else { bts->e_offset++; rem -= earfcn_budget; + + if (rem < 0) + return false; + bitvec_set_bit(bv, 1); /* EARFCN: */ bitvec_set_uint(bv, e->arfcn[i], 16); @@ -146,10 +154,14 @@ bitvec_set_uint(bv, e->qrxlm, 5); } else bitvec_set_bit(bv, 0); + + return true; } static inline void append_earfcn(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) { + bool appended; + unsigned int old = bv->cur_bit; /* save current position to make rollback possible */ int rem = budget - 25; if (rem <= 0) return; @@ -203,8 +215,11 @@ /* Repeated E-UTRAN Neighbour Cells */ bitvec_set_bit(bv, 1); - /* N. B: 25 bits are set in append_earfcn() - keep it in sync with budget adjustment below: */ - append_eutran_neib_cell(bv, bts, rem); + appended = append_eutran_neib_cell(bv, bts, rem); + if (!appended) { /* appending is impossible within current budget: rollback */ + bv->cur_bit = old; + return; + } /* stop bit - end of Repeated E-UTRAN Neighbour Cells sequence: */ bitvec_set_bit(bv, 0); diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index d200539..889f001 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -174,15 +174,21 @@ generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 8 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 00 44 b3 07 82 41 -generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 45 19 a0 0d 7d 7e a6 19 e7 0b 2b 2b 2b 2b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 9 UARFCNs... -generated valid SI2quater [00/02]: [23] 59 06 07 40 40 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 10 99 66 0f 04 -generated valid SI2quater [01/02]: [23] 59 06 07 42 40 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b -generated valid SI2quater [02/02]: [23] 59 06 07 44 40 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 4d 19 a0 26 fd 66 a6 03 e7 fa 0b 2b 2b 2b 2b +generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b +generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b +generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b +generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b +generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b generating SI2quater for 17 EARFCNs and 10 UARFCNs... -generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 04 12 c8 2b +generated valid SI2quater [00/05]: [23] 59 06 07 40 a0 25 0f 70 55 47 89 1e fd 7c b0 00 e7 9b b0 2b 2b 2b 2b generated valid SI2quater [01/05]: [23] 59 06 07 42 a0 04 86 59 83 c1 20 f0 48 3c 26 c1 e0 f5 cb b2 b0 2b 2b generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b -- To view, visit https://gerrit.osmocom.org/4199 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4b2aa3825e9affb6dfeadecdf24dd1a43a92b7b7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:38:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:38:14 +0000 Subject: osmo-ci[master]: coverity: Don't start with a new clone, but simply fetch/che... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/4206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icecb2d00a75bc303d84efafee5c1f2d52ba1b6b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:38:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:38:23 +0000 Subject: osmo-ci[master]: coverity: Reduce codeduplication in build_Osmocom.sh In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I27e9fc94142b42a7b7c2f9eca89056e1f90f1f0e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:38:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:38:36 +0000 Subject: osmo-ci[master]: coverity: Add support for $PARALLEL_MAKE environment variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I95b0e5f104155ac7c5ae993b7f3c0c0721d0157b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:38:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:38:53 +0000 Subject: osmo-ci[master]: coverity: osmo-bts now builds without openbsc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09565441c0d9eb907edba82b26df38d08a5d868d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:39:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:39:04 +0000 Subject: osmo-ci[master]: coverity: clone + build osmo-{mgw,bsc,msc,hlr} In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6f046943f045a97c2bae4e99485a474c11d90a90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:39:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:39:10 +0000 Subject: osmo-ci[master]: coverity: Don't start with a new clone, but simply fetch/che... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icecb2d00a75bc303d84efafee5c1f2d52ba1b6b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:39:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:39:14 +0000 Subject: [MERGED] osmo-ci[master]: coverity: Don't start with a new clone, but simply fetch/che... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: coverity: Don't start with a new clone, but simply fetch/checkout ...................................................................... coverity: Don't start with a new clone, but simply fetch/checkout If a given git clone already exists, simply do a fetch + checkout -f, rather than cloning a decade worth of history from scratch. Change-Id: Icecb2d00a75bc303d84efafee5c1f2d52ba1b6b3 --- M coverity/prepare_source_Osmcocom.sh 1 file changed, 8 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/coverity/prepare_source_Osmcocom.sh b/coverity/prepare_source_Osmcocom.sh index 386e16e..527bbc9 100755 --- a/coverity/prepare_source_Osmcocom.sh +++ b/coverity/prepare_source_Osmcocom.sh @@ -1,7 +1,8 @@ #!/bin/sh -mkdir -p source-Osmocom +BASEDIR=source-Osmocom -cd source-Osmocom +[ -d $BASEDIR ] || mkdir -p $BASEDIR +cd $BASEDIR for proj in \ asn1c \ @@ -23,7 +24,11 @@ osmo-hlr \ ; do - git clone git://git.osmocom.org/$proj + if [ -d $proj ]; then + (cd $proj && git fetch && git checkout -f -B master origin/master) + else + git clone git://git.osmocom.org/$proj + fi done git clone git://git.sysmocom.de/sysmo-bts/layer1-api -- To view, visit https://gerrit.osmocom.org/4206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icecb2d00a75bc303d84efafee5c1f2d52ba1b6b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:39:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:39:14 +0000 Subject: [MERGED] osmo-ci[master]: coverity: clone + build osmo-{mgw, bsc, msc, hlr} In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: coverity: clone + build osmo-{mgw,bsc,msc,hlr} ...................................................................... coverity: clone + build osmo-{mgw,bsc,msc,hlr} Related: OS#2564 Change-Id: I6f046943f045a97c2bae4e99485a474c11d90a90 --- M coverity/build_Osmocom.sh M coverity/prepare_source_Osmcocom.sh 2 files changed, 9 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 9e5607d..3cb0c84 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -81,6 +81,11 @@ build_osmopcu build_osmobts build_openbsc +build_default osmo-mgw +build_default osmo-bsc +build_default osmo-msc +build_default osmo-hlr +build_default osmo-sgsn # GMR build_default libosmo-dsp diff --git a/coverity/prepare_source_Osmcocom.sh b/coverity/prepare_source_Osmcocom.sh index 527bbc9..05e50e4 100755 --- a/coverity/prepare_source_Osmcocom.sh +++ b/coverity/prepare_source_Osmcocom.sh @@ -14,7 +14,11 @@ libosmo-sccp \ libsmpp34 \ openbsc \ + osmo-bsc \ + osmo-msc \ + osmo-mgw \ osmo-ggsn \ + osmo-sgsn \ osmo-bts \ osmo-gmr \ osmo-iuh \ -- To view, visit https://gerrit.osmocom.org/4210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6f046943f045a97c2bae4e99485a474c11d90a90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:39:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:39:15 +0000 Subject: [MERGED] osmo-ci[master]: coverity: osmo-bts now builds without openbsc In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: coverity: osmo-bts now builds without openbsc ...................................................................... coverity: osmo-bts now builds without openbsc Change-Id: I09565441c0d9eb907edba82b26df38d08a5d868d --- M coverity/build_Osmocom.sh 1 file changed, 1 insertion(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 1a4b5a5..9e5607d 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -51,13 +51,9 @@ } build_osmobts() { - #IU pushd openbsc/openbsc - #IU git checkout master - #IU git pull --rebase - #IU popd pushd osmo-bts - do_build --enable-sysmocom-bts --with-openbsc="$src_dir/openbsc/openbsc/include" + do_build --enable-sysmocom-bts popd } -- To view, visit https://gerrit.osmocom.org/4209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I09565441c0d9eb907edba82b26df38d08a5d868d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:39:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:39:15 +0000 Subject: [MERGED] osmo-ci[master]: coverity: Add support for $PARALLEL_MAKE environment variable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: coverity: Add support for $PARALLEL_MAKE environment variable ...................................................................... coverity: Add support for $PARALLEL_MAKE environment variable Change-Id: I95b0e5f104155ac7c5ae993b7f3c0c0721d0157b --- M coverity/build_Osmocom.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 910f810..1a4b5a5 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -18,7 +18,7 @@ autoreconf --install --force ./configure --prefix="$prefix" $* - make + make $PARALLEL_MAKE make install } -- To view, visit https://gerrit.osmocom.org/4208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95b0e5f104155ac7c5ae993b7f3c0c0721d0157b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 11 01:39:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 01:39:15 +0000 Subject: [MERGED] osmo-ci[master]: coverity: Reduce codeduplication in build_Osmocom.sh In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: coverity: Reduce codeduplication in build_Osmocom.sh ...................................................................... coverity: Reduce codeduplication in build_Osmocom.sh We don't need a separate build_foo function if it is identical in its body except for the 'foo' (project name). Let's clean this up. Change-Id: I27e9fc94142b42a7b7c2f9eca89056e1f90f1f0e --- M coverity/build_Osmocom.sh 1 file changed, 18 insertions(+), 94 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index bccd7ea..910f810 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -22,16 +22,16 @@ make install } +build_default() { + pushd $1 + do_build + popd +} + build_layer1api() { pushd layer1-api install -d "$prefix/include/sysmocom/femtobts/" cp include/*.h "$prefix/include/sysmocom/femtobts/" - popd -} - -build_asn1c() { - pushd asn1c - do_build popd } @@ -42,50 +42,11 @@ popd } -build_osmoiuh() { - pushd osmo-iuh - do_build - popd -} - -build_libosmocore() { - pushd libosmocore - - do_build - popd -} - -build_libosmoabis() { - pushd libosmo-abis - - do_build - popd -} - -build_libosmosccp() { - pushd libosmo-sccp - - do_build - popd -} - -build_osmoggsn() { - pushd osmo-ggsn - do_build - popd -} - build_openbsc() { pushd openbsc/openbsc #IU git checkout sysmocom/iu do_build --enable-osmo-bsc --enable-nat --enable-smpp --enable-mgcp-transcoding #IU --enable-iu - popd -} - -build_osmohlr() { - pushd osmo-hlr - do_build popd } @@ -107,66 +68,29 @@ popd } -build_libosmodsp() { - pushd libosmo-dsp - do_build - popd -} - -build_libosmonetif() { - pushd libosmo-netif - do_build - popd -} - -build_osmogmr() { - pushd osmo-gmr - do_build - popd -} - -build_libsmpp34() { - pushd libsmpp34 - do_build - popd -} - -build_osmosipconnector() { - pushd osmo-sip-connector - do_build - popd -} - -build_osmotrx() { - pushd osmo-trx - do_build - popd -} - cd "$src_dir" rm -rf "$prefix" build_layer1api -build_asn1c -build_libosmocore +build_default asn1c +build_default libosmocore build_libasn1c -build_libosmoabis -build_libosmonetif -build_libosmosccp -build_libsmpp34 -build_osmoggsn -#IU build_osmoiuh +build_default libosmo-abis +build_default libosmo-netif +build_default libosmo-sccp +build_default libsmpp34 +build_default osmo-ggsn +#IU build_default osmo-iuh build_osmopcu build_osmobts build_openbsc -build_osmohlr # GMR -build_libosmodsp -build_osmogmr +build_default libosmo-dsp +build_default osmo-gmr # MNCC to SIP -build_osmosipconnector +build_default osmo-sip-connector -build_osmotrx +build_default osmo-trx -- To view, visit https://gerrit.osmocom.org/4207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I27e9fc94142b42a7b7c2f9eca89056e1f90f1f0e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 11 04:59:46 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 11 Oct 2017 04:59:46 +0000 Subject: [PATCH] osmo-mgw[master]: debian/rules: show testsuite.log files when tests are failing Message-ID: Review at https://gerrit.osmocom.org/4212 debian/rules: show testsuite.log files when tests are failing Change-Id: I11aca905350b2e3464fb526ec4d3ae6ffcf55114 --- M debian/rules 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/12/4212/1 diff --git a/debian/rules b/debian/rules index d089345..ae85e13 100755 --- a/debian/rules +++ b/debian/rules @@ -26,6 +26,9 @@ #override_dh_install: # dh_install --list-missing -X.la -X.pyc -X.pyo +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) + override_dh_autoreconf: echo $(VERSION) > .tarball-version dh_autoreconf -- To view, visit https://gerrit.osmocom.org/4212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I11aca905350b2e3464fb526ec4d3ae6ffcf55114 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Oct 11 05:07:04 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 11 Oct 2017 05:07:04 +0000 Subject: [PATCH] libosmo-abis[master]: unixsocket: fix a potential string overflow Message-ID: Review at https://gerrit.osmocom.org/4213 unixsocket: fix a potential string overflow Change-Id: I8e3ec741247d728232f8c07c94eb63f068597d80 Found-by: coverity --- M src/input/unixsocket.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/13/4213/1 diff --git a/src/input/unixsocket.c b/src/input/unixsocket.c index 63bd796..06841d3 100644 --- a/src/input/unixsocket.c +++ b/src/input/unixsocket.c @@ -232,7 +232,7 @@ int i; if (line->sock_path) - strcpy(sock_path, line->sock_path); + strncpy(sock_path, line->sock_path, PATH_MAX - 1); else sprintf(sock_path, "%s%d", UNIXSOCKET_SOCK_PATH_DEFAULT, line->num); -- To view, visit https://gerrit.osmocom.org/4213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e3ec741247d728232f8c07c94eb63f068597d80 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Oct 11 05:07:05 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 11 Oct 2017 05:07:05 +0000 Subject: [PATCH] libosmo-abis[master]: debian/rules: show testsuite.log when tests are failing Message-ID: Review at https://gerrit.osmocom.org/4214 debian/rules: show testsuite.log when tests are failing Change-Id: Ic3322e3931612f2153797331b02f2789490e5e2b --- M debian/rules 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/14/4214/1 diff --git a/debian/rules b/debian/rules index cec3c9f..10ba659 100755 --- a/debian/rules +++ b/debian/rules @@ -21,3 +21,6 @@ override_dh_clean: dh_clean rm -f tests/package.m4 tests/testsuite .version .tarball-version + +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3322e3931612f2153797331b02f2789490e5e2b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Oct 11 05:08:10 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 11 Oct 2017 05:08:10 +0000 Subject: [PATCH] libosmo-netif[master]: debian/rules: show testsuite.log when tests are failing Message-ID: Review at https://gerrit.osmocom.org/4215 debian/rules: show testsuite.log when tests are failing Change-Id: I3af7b50e3d3e0ba3eddace0e6d4e58c6cb98b9aa --- M debian/rules 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/15/4215/1 diff --git a/debian/rules b/debian/rules index ce5c618..f0e00c5 100755 --- a/debian/rules +++ b/debian/rules @@ -26,3 +26,6 @@ override_dh_clean: dh_clean rm -f tests/package.m4 tests/testsuite .version .tarball-version + +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3af7b50e3d3e0ba3eddace0e6d4e58c6cb98b9aa Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Oct 11 05:09:43 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 11 Oct 2017 05:09:43 +0000 Subject: [PATCH] libsmpp34[master]: debian/rules: show testsuite.log when tests are failing Message-ID: Review at https://gerrit.osmocom.org/4216 debian/rules: show testsuite.log when tests are failing Change-Id: If2d8576c5b15fe86419d1c21741f82d4d705bd60 --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/16/4216/1 diff --git a/debian/rules b/debian/rules index bedd9e0..4f472a7 100755 --- a/debian/rules +++ b/debian/rules @@ -17,3 +17,7 @@ override_dh_autoreconf: echo $(VERSION) > .tarball-version dh_autoreconf + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2d8576c5b15fe86419d1c21741f82d4d705bd60 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Oct 11 05:10:20 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 11 Oct 2017 05:10:20 +0000 Subject: [PATCH] osmo-bsc[master]: debian/rules: show testsuite.log when tests are failing Message-ID: Review at https://gerrit.osmocom.org/4217 debian/rules: show testsuite.log when tests are failing Change-Id: I373b26c9d5eb32b1155e6405c6305ac870061887 --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/17/4217/1 diff --git a/debian/rules b/debian/rules index 7fe538a..fa93cf5 100755 --- a/debian/rules +++ b/debian/rules @@ -54,3 +54,7 @@ # See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: dh_strip --dbg-package=osmo-bsc-dbg + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I373b26c9d5eb32b1155e6405c6305ac870061887 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Oct 11 05:10:58 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 11 Oct 2017 05:10:58 +0000 Subject: [PATCH] osmo-hlr[master]: debian/rules: show testsuite.log when tests are failing Message-ID: Review at https://gerrit.osmocom.org/4218 debian/rules: show testsuite.log when tests are failing Change-Id: If0b10c02f87ed81878593198e21da1fc9f8d4bbc --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/18/4218/1 diff --git a/debian/rules b/debian/rules index d0ad702..1d8d8ab 100755 --- a/debian/rules +++ b/debian/rules @@ -11,3 +11,7 @@ override_dh_strip: dh_strip --dbg-package=osmo-hlr-dbg + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0b10c02f87ed81878593198e21da1fc9f8d4bbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Oct 11 05:12:07 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 11 Oct 2017 05:12:07 +0000 Subject: [PATCH] osmo-iuh[master]: debian/rules: show testsuite.log when tests are failing Message-ID: Review at https://gerrit.osmocom.org/4219 debian/rules: show testsuite.log when tests are failing Change-Id: Ice1c9f51225cef335626d5689ffb306395d7e2b6 --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/19/4219/1 diff --git a/debian/rules b/debian/rules index 03432e6..3e2c91f 100755 --- a/debian/rules +++ b/debian/rules @@ -16,3 +16,7 @@ override_dh_strip: dh_strip --dbg-package=libosmo-ranap-dbg dh_strip --dbg-package=osmo-hnbgw + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ice1c9f51225cef335626d5689ffb306395d7e2b6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Oct 11 05:12:55 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 11 Oct 2017 05:12:55 +0000 Subject: [PATCH] osmo-msc[master]: debian/rules: show testsuite.log when tests are failing Message-ID: Review at https://gerrit.osmocom.org/4220 debian/rules: show testsuite.log when tests are failing Change-Id: I588ed7c7766a2e71284c9c7a3f3ce5a48561fe7f --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/4220/1 diff --git a/debian/rules b/debian/rules index 3500fbb..277d7a4 100755 --- a/debian/rules +++ b/debian/rules @@ -57,3 +57,7 @@ # See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: dh_strip --dbg-package=osmo-msc-dbg + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I588ed7c7766a2e71284c9c7a3f3ce5a48561fe7f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Oct 11 05:13:22 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 11 Oct 2017 05:13:22 +0000 Subject: [PATCH] osmo-sgsn[master]: debian/rules: show testsuite.log when tests are failing Message-ID: Review at https://gerrit.osmocom.org/4221 debian/rules: show testsuite.log when tests are failing Change-Id: I4cc6589d4ce95538baf3f30079a3af53cc218268 --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/21/4221/1 diff --git a/debian/rules b/debian/rules index 4fe1f46..dbe582b 100755 --- a/debian/rules +++ b/debian/rules @@ -59,3 +59,7 @@ dh_strip --dbg-package=osmo-sgsn-dbg dh_strip --dbg-package=osmo-gtphub-dbg dh_strip --dbg-package=osmo-gbproxy-dbg + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4cc6589d4ce95538baf3f30079a3af53cc218268 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:11:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:11:51 +0000 Subject: libosmo-abis[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic3322e3931612f2153797331b02f2789490e5e2b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:12:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:12:17 +0000 Subject: libosmo-abis[master]: unixsocket: fix a potential string overflow In-Reply-To: References: Message-ID: Patch Set 1: we typically state the coverity CID that a patch fixes -- To view, visit https://gerrit.osmocom.org/4213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e3ec741247d728232f8c07c94eb63f068597d80 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:13:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:13:10 +0000 Subject: libosmo-abis[master]: unixsocket: fix a potential string overflow In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4213/1/src/input/unixsocket.c File src/input/unixsocket.c: Line 235: strncpy(sock_path, line->sock_path, PATH_MAX - 1); strncpy is not zero-terminating the buffer if it truncates. Pleaes consider osmo_strlcpy instead -- To view, visit https://gerrit.osmocom.org/4213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e3ec741247d728232f8c07c94eb63f068597d80 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:13:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:13:21 +0000 Subject: osmo-msc[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I588ed7c7766a2e71284c9c7a3f3ce5a48561fe7f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:13:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:13:26 +0000 Subject: [MERGED] osmo-msc[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian/rules: show testsuite.log when tests are failing ...................................................................... debian/rules: show testsuite.log when tests are failing Change-Id: I588ed7c7766a2e71284c9c7a3f3ce5a48561fe7f --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index 3500fbb..277d7a4 100755 --- a/debian/rules +++ b/debian/rules @@ -57,3 +57,7 @@ # See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: dh_strip --dbg-package=osmo-msc-dbg + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I588ed7c7766a2e71284c9c7a3f3ce5a48561fe7f Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:13:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:13:32 +0000 Subject: osmo-sgsn[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4cc6589d4ce95538baf3f30079a3af53cc218268 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:13:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:13:35 +0000 Subject: [MERGED] osmo-sgsn[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian/rules: show testsuite.log when tests are failing ...................................................................... debian/rules: show testsuite.log when tests are failing Change-Id: I4cc6589d4ce95538baf3f30079a3af53cc218268 --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index 4fe1f46..dbe582b 100755 --- a/debian/rules +++ b/debian/rules @@ -59,3 +59,7 @@ dh_strip --dbg-package=osmo-sgsn-dbg dh_strip --dbg-package=osmo-gtphub-dbg dh_strip --dbg-package=osmo-gbproxy-dbg + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4cc6589d4ce95538baf3f30079a3af53cc218268 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:13:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:13:59 +0000 Subject: osmo-iuh[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ice1c9f51225cef335626d5689ffb306395d7e2b6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:14:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:14:02 +0000 Subject: [MERGED] osmo-iuh[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian/rules: show testsuite.log when tests are failing ...................................................................... debian/rules: show testsuite.log when tests are failing Change-Id: Ice1c9f51225cef335626d5689ffb306395d7e2b6 --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index 03432e6..3e2c91f 100755 --- a/debian/rules +++ b/debian/rules @@ -16,3 +16,7 @@ override_dh_strip: dh_strip --dbg-package=libosmo-ranap-dbg dh_strip --dbg-package=osmo-hnbgw + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ice1c9f51225cef335626d5689ffb306395d7e2b6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:14:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:14:09 +0000 Subject: osmo-bsc[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I373b26c9d5eb32b1155e6405c6305ac870061887 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:14:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:14:12 +0000 Subject: [MERGED] osmo-bsc[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian/rules: show testsuite.log when tests are failing ...................................................................... debian/rules: show testsuite.log when tests are failing Change-Id: I373b26c9d5eb32b1155e6405c6305ac870061887 --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index 7fe538a..fa93cf5 100755 --- a/debian/rules +++ b/debian/rules @@ -54,3 +54,7 @@ # See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: dh_strip --dbg-package=osmo-bsc-dbg + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I373b26c9d5eb32b1155e6405c6305ac870061887 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:14:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:14:18 +0000 Subject: osmo-hlr[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0b10c02f87ed81878593198e21da1fc9f8d4bbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:14:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:14:21 +0000 Subject: [MERGED] osmo-hlr[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian/rules: show testsuite.log when tests are failing ...................................................................... debian/rules: show testsuite.log when tests are failing Change-Id: If0b10c02f87ed81878593198e21da1fc9f8d4bbc --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index d0ad702..1d8d8ab 100755 --- a/debian/rules +++ b/debian/rules @@ -11,3 +11,7 @@ override_dh_strip: dh_strip --dbg-package=osmo-hlr-dbg + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If0b10c02f87ed81878593198e21da1fc9f8d4bbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:14:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:14:27 +0000 Subject: libsmpp34[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If2d8576c5b15fe86419d1c21741f82d4d705bd60 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:14:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:14:29 +0000 Subject: [MERGED] libsmpp34[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian/rules: show testsuite.log when tests are failing ...................................................................... debian/rules: show testsuite.log when tests are failing Change-Id: If2d8576c5b15fe86419d1c21741f82d4d705bd60 --- M debian/rules 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index bedd9e0..4f472a7 100755 --- a/debian/rules +++ b/debian/rules @@ -17,3 +17,7 @@ override_dh_autoreconf: echo $(VERSION) > .tarball-version dh_autoreconf + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If2d8576c5b15fe86419d1c21741f82d4d705bd60 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:14:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:14:39 +0000 Subject: libosmo-netif[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3af7b50e3d3e0ba3eddace0e6d4e58c6cb98b9aa Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:14:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:14:43 +0000 Subject: [MERGED] libosmo-netif[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian/rules: show testsuite.log when tests are failing ...................................................................... debian/rules: show testsuite.log when tests are failing Change-Id: I3af7b50e3d3e0ba3eddace0e6d4e58c6cb98b9aa --- M debian/rules 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index ce5c618..f0e00c5 100755 --- a/debian/rules +++ b/debian/rules @@ -26,3 +26,6 @@ override_dh_clean: dh_clean rm -f tests/package.m4 tests/testsuite .version .tarball-version + +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3af7b50e3d3e0ba3eddace0e6d4e58c6cb98b9aa Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:14:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:14:48 +0000 Subject: osmo-mgw[master]: debian/rules: show testsuite.log files when tests are failing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11aca905350b2e3464fb526ec4d3ae6ffcf55114 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:14:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:14:50 +0000 Subject: [MERGED] osmo-mgw[master]: debian/rules: show testsuite.log files when tests are failing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian/rules: show testsuite.log files when tests are failing ...................................................................... debian/rules: show testsuite.log files when tests are failing Change-Id: I11aca905350b2e3464fb526ec4d3ae6ffcf55114 --- M debian/rules 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index d089345..ae85e13 100755 --- a/debian/rules +++ b/debian/rules @@ -26,6 +26,9 @@ #override_dh_install: # dh_install --list-missing -X.la -X.pyc -X.pyo +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) + override_dh_autoreconf: echo $(VERSION) > .tarball-version dh_autoreconf -- To view, visit https://gerrit.osmocom.org/4212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I11aca905350b2e3464fb526ec4d3ae6ffcf55114 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:15:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:15:36 +0000 Subject: osmo-mgw[master]: build: make sure copied mgcp_common.h is removed on 'make cl... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5a56f83289e32a09643047f0e779c9de3e4b39a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:15:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:15:38 +0000 Subject: [MERGED] osmo-mgw[master]: build: make sure copied mgcp_common.h is removed on 'make cl... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: build: make sure copied mgcp_common.h is removed on 'make clean' ...................................................................... build: make sure copied mgcp_common.h is removed on 'make clean' I thought the BUILT_SOURCES also enters the files to CLEANFILES, but 'make clean' leaves the copied header behind for me. Add to CLEANFILES to get it removed. Change-Id: I5a56f83289e32a09643047f0e779c9de3e4b39a6 --- M include/osmocom/mgcp_client/Makefile.am 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am index 0eaafcc..d303ddf 100644 --- a/include/osmocom/mgcp_client/Makefile.am +++ b/include/osmocom/mgcp_client/Makefile.am @@ -9,3 +9,5 @@ mgcp_common.h: $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h echo -e "/*\n\n DO NOT EDIT THIS FILE!\n THIS IS OVERWRITTEN DURING BUILD\n This is an automatic copy of \n\n */" > mgcp_common.h cat $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h >> mgcp_common.h + +CLEANFILES = mgcp_common.h -- To view, visit https://gerrit.osmocom.org/4198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5a56f83289e32a09643047f0e779c9de3e4b39a6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:17:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:17:30 +0000 Subject: osmo-pcu[master]: cosmetic: reformat multislot classes table In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I786df6b154c0668d2cefa0ea84d7dea336b0da1d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:18:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:18:11 +0000 Subject: osmo-pcu[master]: Add multislot classes from latest spec In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 08:45:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 08:45:05 +0000 Subject: [MERGED] libosmo-abis[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian/rules: show testsuite.log when tests are failing ...................................................................... debian/rules: show testsuite.log when tests are failing Change-Id: Ic3322e3931612f2153797331b02f2789490e5e2b --- M debian/rules 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index cec3c9f..10ba659 100755 --- a/debian/rules +++ b/debian/rules @@ -21,3 +21,6 @@ override_dh_clean: dh_clean rm -f tests/package.m4 tests/testsuite .version .tarball-version + +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3322e3931612f2153797331b02f2789490e5e2b Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 11:34:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 11:34:50 +0000 Subject: [MERGED] osmo-pcu[master]: cosmetic: reformat multislot classes table In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: cosmetic: reformat multislot classes table ...................................................................... cosmetic: reformat multislot classes table Add header similar to the one used in the standard, reformat to facilitate further extention. Change-Id: I786df6b154c0668d2cefa0ea84d7dea336b0da1d Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 32 insertions(+), 31 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..2b08cf6 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -46,37 +46,38 @@ }; static const struct gprs_ms_multislot_class gprs_ms_multislot_class[32] = { -/* M-S Class Rx Tx Sum Tta Ttb Tra Trb Type */ -/* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, -/* 1 */ { 1, 1, 2, 3, 2, 4, 2, 1 }, -/* 2 */ { 2, 1, 3, 3, 2, 3, 1, 1 }, -/* 3 */ { 2, 2, 3, 3, 2, 3, 1, 1 }, -/* 4 */ { 3, 1, 4, 3, 1, 3, 1, 1 }, -/* 5 */ { 2, 2, 4, 3, 1, 3, 1, 1 }, -/* 6 */ { 3, 2, 4, 3, 1, 3, 1, 1 }, -/* 7 */ { 3, 3, 4, 3, 1, 3, 1, 1 }, -/* 8 */ { 4, 1, 5, 3, 1, 2, 1, 1 }, -/* 9 */ { 3, 2, 5, 3, 1, 2, 1, 1 }, -/* 10 */ { 4, 2, 5, 3, 1, 2, 1, 1 }, -/* 11 */ { 4, 3, 5, 3, 1, 2, 1, 1 }, -/* 12 */ { 4, 4, 5, 2, 1, 2, 1, 1 }, -/* 13 */ { 3, 3, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, -/* 14 */ { 4, 4, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, -/* 15 */ { 5, 5, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, -/* 16 */ { 6, 6, MS_NA, MS_NA, MS_A, 2, MS_A, 2 }, -/* 17 */ { 7, 7, MS_NA, MS_NA, MS_A, 1, 0, 2 }, -/* 18 */ { 8, 8, MS_NA, MS_NA, 0, 0, 0, 2 }, -/* 19 */ { 6, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 20 */ { 6, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 21 */ { 6, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 22 */ { 6, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 23 */ { 6, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 24 */ { 8, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 25 */ { 8, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 26 */ { 8, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 27 */ { 8, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 28 */ { 8, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 29 */ { 8, 8, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* M-S Class | Max # of slots | Min # of slots | Type */ + /* | Rx Tx Sum | Tta Ttb Tra Trb | */ + /* N/A */ { MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, + /* 1 */ { 1, 1, 2, 3, 2, 4, 2, 1 }, + /* 2 */ { 2, 1, 3, 3, 2, 3, 1, 1 }, + /* 3 */ { 2, 2, 3, 3, 2, 3, 1, 1 }, + /* 4 */ { 3, 1, 4, 3, 1, 3, 1, 1 }, + /* 5 */ { 2, 2, 4, 3, 1, 3, 1, 1 }, + /* 6 */ { 3, 2, 4, 3, 1, 3, 1, 1 }, + /* 7 */ { 3, 3, 4, 3, 1, 3, 1, 1 }, + /* 8 */ { 4, 1, 5, 3, 1, 2, 1, 1 }, + /* 9 */ { 3, 2, 5, 3, 1, 2, 1, 1 }, + /* 10 */ { 4, 2, 5, 3, 1, 2, 1, 1 }, + /* 11 */ { 4, 3, 5, 3, 1, 2, 1, 1 }, + /* 12 */ { 4, 4, 5, 2, 1, 2, 1, 1 }, + /* 13 */ { 3, 3, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, + /* 14 */ { 4, 4, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, + /* 15 */ { 5, 5, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, + /* 16 */ { 6, 6, MS_NA, MS_NA, MS_A, 2, MS_A, 2 }, + /* 17 */ { 7, 7, MS_NA, MS_NA, MS_A, 1, 0, 2 }, + /* 18 */ { 8, 8, MS_NA, MS_NA, 0, 0, 0, 2 }, + /* 19 */ { 6, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 20 */ { 6, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 21 */ { 6, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 22 */ { 6, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 23 */ { 6, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 24 */ { 8, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 25 */ { 8, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 26 */ { 8, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 27 */ { 8, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 28 */ { 8, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 29 */ { 8, 8, MS_NA, 2, MS_B, 2, MS_C, 1 }, /* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, /* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, }; -- To view, visit https://gerrit.osmocom.org/4201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I786df6b154c0668d2cefa0ea84d7dea336b0da1d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 11 11:35:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 11:35:58 +0000 Subject: osmo-ci[master]: coverity: build with --enable-trx In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0684bc04b82ad57a1513bbd4627144d6c254b965 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 11:41:54 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Oct 2017 11:41:54 +0000 Subject: [PATCH] osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4146 to look at the new patch set (#4). client: add unified function to generate MGCP messages currently the only way to generate MGCP messages is to use mgcp_msg_crcx(), mgcp_msg_mdcx() and mgcp_msg_dlcx(). All three function take a fixed set of parameters via their parameter list. There is no way to add or leave away optional parameters. add function mgcp_msg_gen(), this function takes a unified message struct. The struct features a presence bitmask which allows to enable and disable parameters as needed. It is also possible to add new parameters in the future without breaking the API. This commit depends on libosmocore Change: Change-Id I15e1af68616309555d0ed9ac5da027c9833d42e3 Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 224 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/4146/4 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index efc1f76..1e92da7 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include @@ -37,6 +38,36 @@ uint16_t audio_port; }; +enum mgcp_verb { + MGCP_VERB_CRCX, + MGCP_VERB_MDCX, + MGCP_VERB_DLCX, + MGCP_VERB_AUEP, + MGCP_VERB_RSIP, +}; + +#define MGCP_MSG_PRESENCE_ENDPOINT 0x0001 +#define MGCP_MSG_PRESENCE_CALL_ID 0x0002 +#define MGCP_MSG_PRESENCE_CONN_ID 0x0004 +#define MGCP_MSG_PRESENCE_AUDIO_IP 0x0008 +#define MGCP_MSG_PRESENCE_AUDIO_PORT 0x0010 +#define MGCP_MSG_PRESENCE_CONN_MODE 0x0020 + +/* See also RFC3435 section 3.2.1.3 */ +#define MGCP_ENDPOINT_MAXLEN (255*2+1+1) + +struct mgcp_msg { + enum mgcp_verb verb; + /* See MGCP_MSG_PRESENCE_* constands above */ + uint32_t presence; + char endpoint[MGCP_ENDPOINT_MAXLEN]; + unsigned int call_id; + uint32_t conn_id; + uint16_t audio_port; + char audio_ip[INET_ADDRSTRLEN]; + enum mgcp_connection_mode conn_mode; +}; + void mgcp_client_conf_init(struct mgcp_client_conf *conf); void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf); int mgcp_client_config_write(struct vty *vty, const char *indent); @@ -63,17 +94,22 @@ enum mgcp_connection_mode; +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, enum mgcp_connection_mode mode); +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, const char *rtp_conn_addr, uint16_t rtp_port, enum mgcp_connection_mode mode); +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg); + extern const struct value_string mgcp_client_connection_mode_strs[]; static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 1cd37be..2bb669e 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -614,6 +615,104 @@ "C: %x\r\n", trans_id, rtp_endpoint, call_id); } +#define MGCP_CRCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CALL_ID | \ + MGCP_MSG_PRESENCE_CONN_ID | \ + MGCP_MSG_PRESENCE_CONN_MODE) +#define MGCP_MDCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CONN_ID) +#define MGCP_DLCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_RSIP_MANDATORY 0 /* none */ + +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg) +{ + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); + uint32_t mandatory_mask; + struct msgb *msg = msgb_alloc_headroom(4096, 128, "MGCP tx"); + int rc = 0; + + /* Add command verb */ + switch (mgcp_msg->verb) { + case MGCP_VERB_CRCX: + mandatory_mask = MGCP_CRCX_MANDATORY; + rc += msgb_printf(msg, "CRCX %u", trans_id); + break; + case MGCP_VERB_MDCX: + mandatory_mask = MGCP_MDCX_MANDATORY; + rc += msgb_printf(msg, "MDCX %u", trans_id); + break; + case MGCP_VERB_DLCX: + mandatory_mask = MGCP_DLCX_MANDATORY; + rc += msgb_printf(msg, "DLCX %u", trans_id); + break; + case MGCP_VERB_AUEP: + mandatory_mask = MGCP_AUEP_MANDATORY; + rc += msgb_printf(msg, "AUEP %u", trans_id); + break; + case MGCP_VERB_RSIP: + mandatory_mask = MGCP_RSIP_MANDATORY; + rc += msgb_printf(msg, "RSIP %u", trans_id); + break; + default: + LOGP(DLMGCP, LOGL_ERROR, + "Invalid command verb, can not generate MGCP message"); + return NULL; + } + + /* Check if mandatory fields are missing */ + if (!((mgcp_msg->presence & mandatory_mask) == mandatory_mask)) { + LOGP(DLMGCP, LOGL_ERROR, + "One or more missing mandatory fields, can not generate MGCP message"); + return NULL; + } + + /* Add endpoint name */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_ENDPOINT) + rc += msgb_printf(msg, " %s", mgcp_msg->endpoint); + + /* Add protocol version */ + msgb_printf(msg, " MGCP 1.0\r\n"); + + /* Add call id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CALL_ID) + rc += msgb_printf(msg, "C: %x\r\n", mgcp_msg->call_id); + + /* Add connection id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID) + rc += msgb_printf(msg, "I: %u\r\n", mgcp_msg->conn_id); + + /* Add local connection options */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID + && mgcp_msg->verb == MGCP_VERB_CRCX) + rc += msgb_printf(msg, "L: p:20, a:AMR, nt:IN\r\n"); + + /* Add mode */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_MODE) + rc += + msgb_printf(msg, "M: %s\r\n", + mgcp_client_cmode_name(mgcp_msg->conn_mode)); + + /* Add RTP address and port (SDP) */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_IP + && mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT) { + rc += msgb_printf(msg, "\r\n"); + rc += msgb_printf(msg, "c=IN IP4 %s\r\n", mgcp_msg->audio_ip); + rc += + msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", + mgcp_msg->audio_port); + } + + if (rc != 0) { + LOGP(DLMGCP, LOGL_ERROR, + "message buffer to small, can not generate MGCP message"); + msgb_free(msg); + msg = NULL; + } + + return msg; +} + struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index f2f0e0f..a5114bd 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -149,6 +149,66 @@ "a=ptime:20\r\n"); } +void test_mgcp_msg(void) +{ + struct msgb *msg; + + struct mgcp_msg mgcp_msg; + + if (mgcp) + talloc_free(mgcp); + mgcp = mgcp_client_init(ctx, &conf); + + /* Pre-fill the message struct with some arbitary values */ + strcpy(mgcp_msg.audio_ip, "192.168.100.23"); + strcpy(mgcp_msg.endpoint, "23 at mgw"); + mgcp_msg.audio_port = 1234; + mgcp_msg.call_id = 47; + mgcp_msg.conn_id = 11; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + + printf("\n"); + + printf("Generated CRCX message:\n"); + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated MDCX message:\n"); + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated DLCX message:\n"); + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated AUEP message:\n"); + mgcp_msg.verb = MGCP_VERB_AUEP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated RSIP message:\n"); + mgcp_msg.verb = MGCP_VERB_RSIP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + msgb_free(msg); +} + static const struct log_info_cat log_categories[] = { }; @@ -167,6 +227,7 @@ mgcp_client_conf_init(&conf); test_crcx(); + test_mgcp_msg(); printf("Done\n"); fprintf(stderr, "Done\n"); diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index d35f2d6..7c4819d 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,4 +28,32 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + +Generated CRCX message: +CRCX 1 23 at mgw MGCP 1.0 +C: 2f +I: 11 +L: p:20, a:AMR, nt:IN +M: sendrecv + +Generated MDCX message: +MDCX 2 23 at mgw MGCP 1.0 +C: 2f +I: 11 +M: sendrecv + +c=IN IP4 192.168.100.23 +m=audio 1234 RTP/AVP 255 + +Generated DLCX message: +DLCX 3 23 at mgw MGCP 1.0 +C: 2f +I: 11 + +Generated AUEP message: +AUEP 4 23 at mgw MGCP 1.0 + +Generated RSIP message: +RSIP 5 23 at mgw MGCP 1.0 + Done -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 11:41:54 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Oct 2017 11:41:54 +0000 Subject: [PATCH] osmo-mgw[master]: sdp: refactoring sdp parser/generator In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4006 to look at the new patch set (#6). sdp: refactoring sdp parser/generator move SDP generator function write_response_sdp() from mgcp_protocol.c to mgcp_sdp.c move prototypes for mgcp_parse_sdp_data() and mgcp_set_audio_info() to mgcp_sdp.h change parameter list of mgcp_parse_sdp_data() so that it takes the rtp conn directly, rather than struct mgcp_rtp_end. fix sourcecode formatting in mgcp_sdp.c add doxygen comments to all public functions Change-Id: I9f88c93872ff913bc211f560b26901267f577324 --- M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_sdp.h M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c 5 files changed, 211 insertions(+), 142 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/06/4006/6 diff --git a/include/osmocom/mgcp/Makefile.am b/include/osmocom/mgcp/Makefile.am index 646b887..cd8f599 100644 --- a/include/osmocom/mgcp/Makefile.am +++ b/include/osmocom/mgcp/Makefile.am @@ -4,4 +4,5 @@ mgcp_conn.h \ mgcp_stat.h \ mgcp_ep.h \ + mgcp_sdp.h \ $(NULL) diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 3a22d51..777d787 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -317,9 +317,6 @@ #define DEFAULT_RTP_AUDIO_DEFAULT_CHANNELS 1 #define PTYPE_UNDEFINED (-1) -int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_rtp_end *rtp, struct mgcp_parse_data *p); -int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, - int payload_type, const char *audio_name); /*! get the ip-address where the mgw application is bound on. * \param[in] endp mgcp endpoint, that holds a copy of the VTY parameters diff --git a/include/osmocom/mgcp/mgcp_sdp.h b/include/osmocom/mgcp/mgcp_sdp.h new file mode 100644 index 0000000..0eb376d --- /dev/null +++ b/include/osmocom/mgcp/mgcp_sdp.h @@ -0,0 +1,33 @@ +/* + * SDP generation and parsing + * + * (C) 2009-2015 by Holger Hans Peter Freyther + * (C) 2009-2014 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, + struct mgcp_parse_data *p); + +int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, + int payload_type, const char *audio_name); + +int mgcp_write_response_sdp(struct mgcp_endpoint *endp, + struct mgcp_conn_rtp *conn, char *sdp_record, + size_t size, const char *addr); diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index ac25894..5d4dd47 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -38,6 +38,7 @@ #include #include #include +#include struct mgcp_request { char *name; @@ -190,80 +191,6 @@ return create_resp(endp, code, " FAIL", msg, trans, NULL, NULL); } -static int write_response_sdp(struct mgcp_endpoint *endp, - struct mgcp_conn_rtp *conn, - char *sdp_record, size_t size, const char *addr) -{ - const char *fmtp_extra; - const char *audio_name; - int payload_type; - int len; - int nchars; - - if (!conn) - return -1; - - endp->cfg->get_net_downlink_format_cb(endp, &payload_type, - &audio_name, &fmtp_extra, conn); - - len = snprintf(sdp_record, size, - "v=0\r\n" - "o=- %u 23 IN IP4 %s\r\n" - "s=-\r\n" - "c=IN IP4 %s\r\n" - "t=0 0\r\n", conn->conn->id, addr, addr); - - if (len < 0 || len >= size) - goto buffer_too_small; - - if (payload_type >= 0) { - nchars = snprintf(sdp_record + len, size - len, - "m=audio %d RTP/AVP %d\r\n", - conn->end.local_port, payload_type); - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - - if (audio_name && endp->tcfg->audio_send_name) { - nchars = snprintf(sdp_record + len, size - len, - "a=rtpmap:%d %s\r\n", - payload_type, audio_name); - - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - - if (fmtp_extra) { - nchars = snprintf(sdp_record + len, size - len, - "%s\r\n", fmtp_extra); - - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - } - if (conn->end.packet_duration_ms > 0 && endp->tcfg->audio_send_ptime) { - nchars = snprintf(sdp_record + len, size - len, - "a=ptime:%u\r\n", - conn->end.packet_duration_ms); - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - - return len; - -buffer_too_small: - LOGP(DLMGCP, LOGL_ERROR, "SDP buffer too small: %zu (needed %d)\n", - size, len); - return -1; -} - /* Format MGCP response string (with SDP attached) */ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, @@ -291,8 +218,8 @@ if (len < 0) return NULL; - nchars = write_response_sdp(endp, conn, sdp_record + len, - sizeof(sdp_record) - len - 1, addr); + nchars = mgcp_write_response_sdp(endp, conn, sdp_record + len, + sizeof(sdp_record) - len - 1, addr); if (nchars < 0) return NULL; @@ -688,7 +615,7 @@ /* set up RTP media parameters */ if (have_sdp) - mgcp_parse_sdp_data(endp, &conn->end, p); + mgcp_parse_sdp_data(endp, conn, p); else if (endp->local_options.codec) mgcp_set_audio_info(p->cfg, &conn->end.codec, PTYPE_UNDEFINED, endp->local_options.codec); @@ -835,7 +762,7 @@ conn->conn->mode = conn->conn->mode_orig; if (have_sdp) - mgcp_parse_sdp_data(endp, &conn->end, p); + mgcp_parse_sdp_data(endp, conn, p); set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, local_options); diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index 7568351..048a533 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -38,6 +38,12 @@ int channels; }; +/*! set codec configuration depending on payload type and codec name. + * \endp[in] ctx talloc context + * \endp[out] codec configuration (caller provided memory) + * \endp[in] payload_type codec type id (e.g. 3 for GSM, -1 when undefined) + * \endp[in] audio_name audio codec name (e.g. "GSM/8000/1") + * \returns 0 on success, -1 on failure */ int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, int payload_type, const char *audio_name) { @@ -55,15 +61,23 @@ if (!audio_name) { switch (payload_type) { - case 0: audio_name = "PCMU/8000/1"; break; - case 3: audio_name = "GSM/8000/1"; break; - case 8: audio_name = "PCMA/8000/1"; break; - case 18: audio_name = "G729/8000/1"; break; + case 0: + audio_name = "PCMU/8000/1"; + break; + case 3: + audio_name = "GSM/8000/1"; + break; + case 8: + audio_name = "PCMA/8000/1"; + break; + case 18: + audio_name = "G729/8000/1"; + break; default: - /* Payload type is unknown, don't change rate and - * channels. */ - /* TODO: return value? */ - return 0; + /* Payload type is unknown, don't change rate and + * channels. */ + /* TODO: return value? */ + return 0; } } @@ -107,7 +121,7 @@ return 0; } -void codecs_initialize(void *ctx, struct sdp_rtp_map *codecs, int used) +static void codecs_initialize(void *ctx, struct sdp_rtp_map *codecs, int used) { int i; @@ -137,7 +151,8 @@ } } -void codecs_update(void *ctx, struct sdp_rtp_map *codecs, int used, int payload, char *audio_name) +static void codecs_update(void *ctx, struct sdp_rtp_map *codecs, int used, + int payload, char *audio_name) { int i; @@ -148,8 +163,9 @@ if (codecs[i].payload_type != payload) continue; if (sscanf(audio_name, "%63[^/]/%d/%d", - audio_codec, &rate, &channels) < 1) { - LOGP(DLMGCP, LOGL_ERROR, "Failed to parse '%s'\n", audio_name); + audio_codec, &rate, &channels) < 1) { + LOGP(DLMGCP, LOGL_ERROR, "Failed to parse '%s'\n", + audio_name); continue; } @@ -160,29 +176,36 @@ return; } - LOGP(DLMGCP, LOGL_ERROR, "Unconfigured PT(%d) with %s\n", payload, audio_name); + LOGP(DLMGCP, LOGL_ERROR, "Unconfigured PT(%d) with %s\n", payload, + audio_name); } -int is_codec_compatible(struct mgcp_endpoint *endp, struct sdp_rtp_map *codec) +/* Check if the codec matches what is set up in the trunk config */ +static int is_codec_compatible(struct mgcp_endpoint *endp, + struct sdp_rtp_map *codec) { - char *bts_codec; + char *codec_str; char audio_codec[64]; if (!codec->codec_name) return 0; - /* - * GSM, GSM/8000 and GSM/8000/1 should all be compatible.. let's go - * by name first. - */ - bts_codec = endp->tcfg->audio_name; - if (sscanf(bts_codec, "%63[^/]/%*d/%*d", audio_codec) < 1) + /* GSM, GSM/8000 and GSM/8000/1 should all be compatible... + * let's go by name first. */ + codec_str = endp->tcfg->audio_name; + if (sscanf(codec_str, "%63[^/]/%*d/%*d", audio_codec) < 1) return 0; return strcasecmp(audio_codec, codec->codec_name) == 0; } -int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_rtp_end *rtp, struct mgcp_parse_data *p) +/*! analyze SDP input string. + * \endp[in] endp trunk endpoint + * \endp[in] conn associated rtp connection + * \endp[in] caller provided memory to store the parsing results + * \returns 0 on success, -1 on failure */ +int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, + struct mgcp_parse_data *p) { struct sdp_rtp_map codecs[10]; int codecs_used = 0; @@ -191,7 +214,19 @@ int i; int codecs_assigned = 0; void *tmp_ctx = talloc_new(NULL); + struct mgcp_rtp_end *rtp; + int payload; + int ptime, ptime2 = 0; + char audio_name[64]; + int port, rc; + char ipv4[16]; + + OSMO_ASSERT(endp); + OSMO_ASSERT(conn); + OSMO_ASSERT(p); + + rtp = &conn->end; memset(&codecs, 0, sizeof(codecs)); for_each_line(line, p->save) { @@ -202,41 +237,36 @@ case 'v': /* skip these SDP attributes */ break; - case 'a': { - int payload; - int ptime, ptime2 = 0; - char audio_name[64]; - - + case 'a': if (sscanf(line, "a=rtpmap:%d %63s", &payload, audio_name) == 2) { - codecs_update(tmp_ctx, codecs, codecs_used, payload, audio_name); - } else if (sscanf(line, "a=ptime:%d-%d", - &ptime, &ptime2) >= 1) { + codecs_update(tmp_ctx, codecs, + codecs_used, payload, audio_name); + } else + if (sscanf + (line, "a=ptime:%d-%d", &ptime, &ptime2) >= 1) { if (ptime2 > 0 && ptime2 != ptime) rtp->packet_duration_ms = 0; else rtp->packet_duration_ms = ptime; - } else if (sscanf(line, "a=maxptime:%d", &ptime2) == 1) { + } else if (sscanf(line, "a=maxptime:%d", &ptime2) + == 1) { maxptime = ptime2; } break; - } - case 'm': { - int port, rc; - - rc = sscanf(line, "m=audio %d RTP/AVP %d %d %d %d %d %d %d %d %d %d", - &port, - &codecs[0].payload_type, - &codecs[1].payload_type, - &codecs[2].payload_type, - &codecs[3].payload_type, - &codecs[4].payload_type, - &codecs[5].payload_type, - &codecs[6].payload_type, - &codecs[7].payload_type, - &codecs[8].payload_type, - &codecs[9].payload_type); + case 'm': + rc = sscanf(line, + "m=audio %d RTP/AVP %d %d %d %d %d %d %d %d %d %d", + &port, &codecs[0].payload_type, + &codecs[1].payload_type, + &codecs[2].payload_type, + &codecs[3].payload_type, + &codecs[4].payload_type, + &codecs[5].payload_type, + &codecs[6].payload_type, + &codecs[7].payload_type, + &codecs[8].payload_type, + &codecs[9].payload_type); if (rc >= 2) { rtp->rtp_port = htons(port); rtp->rtcp_port = htons(port + 1); @@ -244,20 +274,18 @@ codecs_initialize(tmp_ctx, codecs, codecs_used); } break; - } - case 'c': { - char ipv4[16]; + case 'c': if (sscanf(line, "c=IN IP4 %15s", ipv4) == 1) { inet_aton(ipv4, &rtp->addr); } break; - } default: if (p->endp) LOGP(DLMGCP, LOGL_NOTICE, "Unhandled SDP option: '%c'/%d on 0x%x\n", - line[0], line[0], ENDPOINT_NUMBER(p->endp)); + line[0], line[0], + ENDPOINT_NUMBER(p->endp)); else LOGP(DLMGCP, LOGL_NOTICE, "Unhandled SDP option: '%c'/%d\n", @@ -269,25 +297,24 @@ /* Now select the primary and alt_codec */ for (i = 0; i < codecs_used && codecs_assigned < 2; ++i) { struct mgcp_rtp_codec *codec = codecs_assigned == 0 ? - &rtp->codec : &rtp->alt_codec; + &rtp->codec : &rtp->alt_codec; if (endp->tcfg->no_audio_transcoding && - !is_codec_compatible(endp, &codecs[i])) { + !is_codec_compatible(endp, &codecs[i])) { LOGP(DLMGCP, LOGL_NOTICE, "Skipping codec %s\n", - codecs[i].codec_name); + codecs[i].codec_name); continue; } mgcp_set_audio_info(p->cfg, codec, - codecs[i].payload_type, - codecs[i].map_line); + codecs[i].payload_type, codecs[i].map_line); codecs_assigned += 1; } if (codecs_assigned > 0) { /* TODO/XXX: Store this per codec and derive it on use */ if (maxptime >= 0 && maxptime * rtp->codec.frame_duration_den > - rtp->codec.frame_duration_num * 1500) { + rtp->codec.frame_duration_num * 1500) { /* more than 1 frame */ rtp->packet_duration_ms = 0; } @@ -296,11 +323,95 @@ "Got media info via SDP: port %d, payload %d (%s), " "duration %d, addr %s\n", ntohs(rtp->rtp_port), rtp->codec.payload_type, - rtp->codec.subtype_name ? rtp->codec.subtype_name : "unknown", - rtp->packet_duration_ms, inet_ntoa(rtp->addr)); + rtp->codec.subtype_name ? rtp-> + codec.subtype_name : "unknown", rtp->packet_duration_ms, + inet_ntoa(rtp->addr)); } talloc_free(tmp_ctx); return codecs_assigned > 0; } +/*! generate SDP response string. + * \endp[in] endp trunk endpoint + * \endp[in] conn associated rtp connection + * \endp[out] sdp_record resulting SDP string + * \endp[in] size buffer size of sdp_record + * \endp[in] addr IPV4 address string (e.g. 192.168.100.1) + * \returns 0 on success, -1 on failure */ +int mgcp_write_response_sdp(struct mgcp_endpoint *endp, + struct mgcp_conn_rtp *conn, char *sdp_record, + size_t size, const char *addr) +{ + const char *fmtp_extra; + const char *audio_name; + int payload_type; + int len; + int nchars; + + OSMO_ASSERT(endp); + OSMO_ASSERT(conn); + OSMO_ASSERT(sdp_record); + OSMO_ASSERT(size > 0); + OSMO_ASSERT(addr); + + endp->cfg->get_net_downlink_format_cb(endp, &payload_type, + &audio_name, &fmtp_extra, conn); + + len = snprintf(sdp_record, size, + "v=0\r\n" + "o=- %u 23 IN IP4 %s\r\n" + "s=-\r\n" + "c=IN IP4 %s\r\n" + "t=0 0\r\n", conn->conn->id, addr, addr); + + if (len < 0 || len >= size) + goto buffer_too_small; + + if (payload_type >= 0) { + nchars = snprintf(sdp_record + len, size - len, + "m=audio %d RTP/AVP %d\r\n", + conn->end.local_port, payload_type); + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + + if (audio_name && endp->tcfg->audio_send_name) { + nchars = snprintf(sdp_record + len, size - len, + "a=rtpmap:%d %s\r\n", + payload_type, audio_name); + + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + } + + if (fmtp_extra) { + nchars = snprintf(sdp_record + len, size - len, + "%s\r\n", fmtp_extra); + + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + } + } + if (conn->end.packet_duration_ms > 0 && endp->tcfg->audio_send_ptime) { + nchars = snprintf(sdp_record + len, size - len, + "a=ptime:%u\r\n", + conn->end.packet_duration_ms); + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + } + + return len; + +buffer_too_small: + LOGP(DLMGCP, LOGL_ERROR, "SDP buffer too small: %zu (needed %d)\n", + size, len); + return -1; +} -- To view, visit https://gerrit.osmocom.org/4006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324 Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 11 12:04:31 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Oct 2017 12:04:31 +0000 Subject: [PATCH] libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4200 to look at the new patch set (#2). add function msgb_printf() to print formatted text into msg buf In ASCII string based protocols it a printf() version that prints directly to the message buffer may be useful. Add function msgb_printf(), make sure that msg buffer bounderies are not exceeded. If the end of the tail buffer is hit, return with an error code. Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 --- M include/osmocom/core/msgb.h M src/msgb.c M tests/msgb/msgb_test.c M tests/msgb/msgb_test.ok 4 files changed, 58 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/4200/2 diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 91b7ec7..9c3ccf0 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -498,5 +498,6 @@ void *msgb_talloc_ctx_init(void *root_ctx, unsigned int pool_size); void msgb_set_talloc_ctx(void *ctx) OSMO_DEPRECATED("Use msgb_talloc_ctx_init() instead"); +int msgb_printf(struct msgb *msgb, const char *format, ...); /*! @} */ diff --git a/src/msgb.c b/src/msgb.c index 2e9f4a2..3973e06 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -55,6 +55,9 @@ #include #include #include +#include +#include + #include //#include @@ -376,4 +379,31 @@ return buf; } + +/*! Print a string to the end of message buffer + * \param[in] msg message buffer + * \returns 0 on success, -EINVAL on error */ +int msgb_printf(struct msgb *msgb, const char *format, ...) +{ + va_list args; + int str_len; + int rc = 0; + + OSMO_ASSERT(msgb); + OSMO_ASSERT(format); + + va_start(args, format); + + str_len = + vsnprintf((char *)msgb->tail, msgb_tailroom(msgb), format, args); + + if (str_len > msgb_tailroom(msgb) || str_len < 0) + rc = -EINVAL; + else + msgb_put(msgb, str_len); + + va_end(args); + return rc; +} + /*! @} */ diff --git a/tests/msgb/msgb_test.c b/tests/msgb/msgb_test.c index ac10382..18f1742 100644 --- a/tests/msgb/msgb_test.c +++ b/tests/msgb/msgb_test.c @@ -277,6 +277,29 @@ osmo_set_panic_handler(NULL); } +static void test_msgb_printf() +{ + struct msgb *msg = msgb_alloc(80, "data"); + int rc; + int total_len; + + rc = msgb_printf(msg, "|this is a test %i, %s, %16x|", 4711, "testme", + 0x4711); + total_len = strlen((char *)msg->data); + printf("rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, msg->data); + OSMO_ASSERT(rc == 0); + + rc = msgb_printf(msg, "|some more text|"); + total_len = strlen((char *)msg->data); + printf("rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, msg->data); + OSMO_ASSERT(rc == 0); + + rc = msgb_printf(msg, "|more %i %x %s|", 23, 0xfee, "text"); + total_len = strlen((char *)msg->data); + printf("rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, msg->data); + OSMO_ASSERT(rc == -EINVAL); +} + static struct log_info info = {}; int main(int argc, char **argv) @@ -287,6 +310,7 @@ test_msgb_api_errors(); test_msgb_copy(); test_msgb_resize_area(); + test_msgb_printf(); printf("Success.\n"); diff --git a/tests/msgb/msgb_test.ok b/tests/msgb/msgb_test.ok index 6603fe7..aae5a63 100644 --- a/tests/msgb/msgb_test.ok +++ b/tests/msgb/msgb_test.ok @@ -32,4 +32,7 @@ Original: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Extended: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Shrinked: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f +rc=0, total_len=47, msg->data=|this is a test 4711, testme, 4711| +rc=0, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text| +rc=-22, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 23 fee tex Success. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 11 12:31:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 12:31:40 +0000 Subject: libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (2 comments) Please clarify further. https://gerrit.osmocom.org/#/c/4200/2/tests/msgb/msgb_test.c File tests/msgb/msgb_test.c: Line 296: Please add more test-cases: for example "msgb_printf(msg, "", 23, 0xfee, "text");" and "msgb_printf(msg, "%d %s %c", "lol", 0xfeed, "text", "oops");" do not look very legit. How does msgb_printf() behaves in this case? Not exactly those 2 examples but something which highlights corner-cases. https://gerrit.osmocom.org/#/c/4200/2/tests/msgb/msgb_test.ok File tests/msgb/msgb_test.ok: Line 37: rc=-22, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 23 fee tex So despite the error, msgb have changed? If that's the desired behavior than it should be clearly documented. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 11 15:18:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 15:18:40 +0000 Subject: [PATCH] osmo-bts[master]: Move power loop to generic tests Message-ID: Review at https://gerrit.osmocom.org/4222 Move power loop to generic tests There's nothing sysmobts specific in this test so let's move them into separate directory and run unconditionally. The test itself is unaltered except for intro text. Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397 Related: OS#2223 --- M .gitignore M configure.ac M tests/Makefile.am A tests/power/Makefile.am A tests/power/power_test.c A tests/power/power_test.ok M tests/sysmobts/sysmobts_test.c M tests/sysmobts/sysmobts_test.ok M tests/testsuite.at 9 files changed, 114 insertions(+), 63 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/22/4222/1 diff --git a/.gitignore b/.gitignore index a8c0ece..2e8c884 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,4 @@ debian/osmo-bts-trx-dbg/ debian/osmo-bts-trx/ debian/tmp/ +/tests/power/power_test diff --git a/configure.ac b/configure.ac index a41f7ec..bda30b5 100644 --- a/configure.ac +++ b/configure.ac @@ -178,5 +178,6 @@ tests/misc/Makefile tests/handover/Makefile tests/tx_power/Makefile + tests/power/Makefile tests/meas/Makefile Makefile) diff --git a/tests/Makefile.am b/tests/Makefile.am index d2b4181..18b8ce6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = paging cipher agch misc handover tx_power meas +SUBDIRS = paging cipher agch misc handover tx_power power meas if ENABLE_SYSMOBTS SUBDIRS += sysmobts diff --git a/tests/power/Makefile.am b/tests/power/Makefile.am new file mode 100644 index 0000000..3cb8d15 --- /dev/null +++ b/tests/power/Makefile.am @@ -0,0 +1,9 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) + +noinst_PROGRAMS = power_test +EXTRA_DIST = power_test.ok + +power_test_SOURCES = power_test.c $(srcdir)/../stubs.c +power_test_LDADD = $(top_builddir)/src/common/libbts.a $(LIBOSMOABIS_LIBS) $(LDADD) diff --git a/tests/power/power_test.c b/tests/power/power_test.c new file mode 100644 index 0000000..c1d6a5a --- /dev/null +++ b/tests/power/power_test.c @@ -0,0 +1,93 @@ +/* + * (C) 2013,2014 by Holger Hans Peter Freyther + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#include + +static void test_power_loop(void) +{ + struct gsm_bts bts; + struct gsm_bts_role_bts btsb; + struct gsm_bts_trx trx; + struct gsm_bts_trx_ts ts; + struct gsm_lchan *lchan; + int ret; + + memset(&bts, 0, sizeof(bts)); + memset(&btsb, 0, sizeof(btsb)); + memset(&trx, 0, sizeof(trx)); + memset(&ts, 0, sizeof(ts)); + + lchan = &ts.lchan[0]; + lchan->ts = &ts; + ts.trx = &trx; + trx.bts = &bts; + bts.role = &btsb; + bts.band = GSM_BAND_1800; + trx.ms_power_control = 1; + btsb.ul_power_target = -75; + + /* Simply clamping */ + lchan->state = LCHAN_S_NONE; + lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); + OSMO_ASSERT(ret == 0); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); + + + /* + * Now 15 dB too little and we should power it up. Could be a + * power level of 7 or 8 for 15 dBm + */ + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -90); + OSMO_ASSERT(ret == 1); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 7); + + /* It should be clamped to level 0 and 30 dBm */ + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -100); + OSMO_ASSERT(ret == 1); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); + + /* Fix it and jump down */ + lchan->ms_power_ctrl.fixed = 1; + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); + OSMO_ASSERT(ret == 0); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); + + /* And leave it again */ + lchan->ms_power_ctrl.fixed = 0; + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -40); + OSMO_ASSERT(ret == 1); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); +} + +int main(int argc, char **argv) +{ + printf("Testing power loop...\n"); + + test_power_loop(); + + printf("Power loop test OK\n"); + + return 0; +} diff --git a/tests/power/power_test.ok b/tests/power/power_test.ok new file mode 100644 index 0000000..6bf508b --- /dev/null +++ b/tests/power/power_test.ok @@ -0,0 +1,2 @@ +Testing power loop... +Power loop test OK diff --git a/tests/sysmobts/sysmobts_test.c b/tests/sysmobts/sysmobts_test.c index 6ae7623..32d6e95 100644 --- a/tests/sysmobts/sysmobts_test.c +++ b/tests/sysmobts/sysmobts_test.c @@ -182,72 +182,12 @@ * this happens asynchronously on the other side of the l1sap queue */ } -static void test_sysmobts_loop(void) -{ - struct gsm_bts bts; - struct gsm_bts_role_bts btsb; - struct gsm_bts_trx trx; - struct gsm_bts_trx_ts ts; - struct gsm_lchan *lchan; - int ret; - - memset(&bts, 0, sizeof(bts)); - memset(&btsb, 0, sizeof(btsb)); - memset(&trx, 0, sizeof(trx)); - memset(&ts, 0, sizeof(ts)); - - lchan = &ts.lchan[0]; - lchan->ts = &ts; - ts.trx = &trx; - trx.bts = &bts; - bts.role = &btsb; - bts.band = GSM_BAND_1800; - trx.ms_power_control = 1; - btsb.ul_power_target = -75; - - printf("Testing sysmobts power control\n"); - - /* Simply clamping */ - lchan->state = LCHAN_S_NONE; - lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); - - - /* - * Now 15 dB too little and we should power it up. Could be a - * power level of 7 or 8 for 15 dBm - */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -90); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 7); - - /* It should be clamped to level 0 and 30 dBm */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -100); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); - - /* Fix it and jump down */ - lchan->ms_power_ctrl.fixed = 1; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); - - /* And leave it again */ - lchan->ms_power_ctrl.fixed = 0; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -40); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); -} - int main(int argc, char **argv) { printf("Testing sysmobts routines\n"); test_sysmobts_auto_band(); test_sysmobts_cipher(); - test_sysmobts_loop(); + return 0; } diff --git a/tests/sysmobts/sysmobts_test.ok b/tests/sysmobts/sysmobts_test.ok index 07d79fd..1f53417 100644 --- a/tests/sysmobts/sysmobts_test.ok +++ b/tests/sysmobts/sysmobts_test.ok @@ -17,4 +17,3 @@ PCS to PCS band(1) arfcn(512) want(3) got(3) PCS to PCS band(8) arfcn(128) want(0) got(0) PCS to PCS band(2) arfcn(438) want(-1) got(-1) -Testing sysmobts power control diff --git a/tests/testsuite.at b/tests/testsuite.at index 0efd333..2d1cefd 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -31,6 +31,12 @@ AT_CHECK([$abs_top_builddir/tests/handover/handover_test], [], [expout], [ignore]) AT_CLEANUP +AT_SETUP([power]) +AT_KEYWORDS([power]) +cat $abs_srcdir/power/power_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/power/power_test], [], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([tx_power]) AT_KEYWORDS([tx_power]) cat $abs_srcdir/tx_power/tx_power_test.ok > expout -- To view, visit https://gerrit.osmocom.org/4222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 11 15:18:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 15:18:46 +0000 Subject: [PATCH] osmo-bts[master]: Make power test more verbose Message-ID: Review at https://gerrit.osmocom.org/4223 Make power test more verbose Power control loop test outputs next to nothing which is not very helpful. Make it more verbose. While at it, also move duplicated code into static function to make test cases less cluttered. Change-Id: I0a5e65e23e62442ef8758ecbcf8e7820b4f15d7b Related: OS#2223 --- M tests/power/power_test.c M tests/power/power_test.ok 2 files changed, 20 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/23/4223/1 diff --git a/tests/power/power_test.c b/tests/power/power_test.c index c1d6a5a..3099217 100644 --- a/tests/power/power_test.c +++ b/tests/power/power_test.c @@ -23,6 +23,15 @@ #include +static inline void apply_power_test(struct gsm_lchan *lchan, int rxlev, int exp_ret, uint8_t exp_current) +{ + int ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, rxlev); + + printf("power control [%d]: MS current power %u\n", ret, lchan->ms_power_ctrl.current); + OSMO_ASSERT(ret == exp_ret); + OSMO_ASSERT(lchan->ms_power_ctrl.current == exp_current); +} + static void test_power_loop(void) { struct gsm_bts bts; @@ -46,39 +55,29 @@ trx.ms_power_control = 1; btsb.ul_power_target = -75; - /* Simply clamping */ lchan->state = LCHAN_S_NONE; lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0); OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); + /* Simply clamping */ + apply_power_test(lchan, -60, 0, 15); /* * Now 15 dB too little and we should power it up. Could be a * power level of 7 or 8 for 15 dBm */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -90); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 7); + apply_power_test(lchan, -90, 1, 7); /* It should be clamped to level 0 and 30 dBm */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -100); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); + apply_power_test(lchan, -100, 1, 0); /* Fix it and jump down */ lchan->ms_power_ctrl.fixed = 1; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); + apply_power_test(lchan, -60, 0, 0); /* And leave it again */ lchan->ms_power_ctrl.fixed = 0; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -40); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); + apply_power_test(lchan, -40, 1, 15); } int main(int argc, char **argv) diff --git a/tests/power/power_test.ok b/tests/power/power_test.ok index 6bf508b..cf0a38b 100644 --- a/tests/power/power_test.ok +++ b/tests/power/power_test.ok @@ -1,2 +1,7 @@ Testing power loop... +power control [0]: MS current power 15 +power control [1]: MS current power 7 +power control [1]: MS current power 0 +power control [0]: MS current power 0 +power control [1]: MS current power 15 Power loop test OK -- To view, visit https://gerrit.osmocom.org/4223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a5e65e23e62442ef8758ecbcf8e7820b4f15d7b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 11 15:21:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 15:21:59 +0000 Subject: [PATCH] osmo-bts[master]: Move power loop to generic tests In-Reply-To: References: Message-ID: Move power loop to generic tests There's nothing sysmobts specific in this test so let's move it into separate directory and run unconditionally. The test itself is unaltered except for intro text. Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397 Related: OS#2223 --- M .gitignore M configure.ac M tests/Makefile.am A tests/power/Makefile.am A tests/power/power_test.c A tests/power/power_test.ok M tests/sysmobts/sysmobts_test.c M tests/sysmobts/sysmobts_test.ok M tests/testsuite.at 9 files changed, 114 insertions(+), 63 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/22/4222/2 diff --git a/.gitignore b/.gitignore index a8c0ece..2e8c884 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,4 @@ debian/osmo-bts-trx-dbg/ debian/osmo-bts-trx/ debian/tmp/ +/tests/power/power_test diff --git a/configure.ac b/configure.ac index a41f7ec..bda30b5 100644 --- a/configure.ac +++ b/configure.ac @@ -178,5 +178,6 @@ tests/misc/Makefile tests/handover/Makefile tests/tx_power/Makefile + tests/power/Makefile tests/meas/Makefile Makefile) diff --git a/tests/Makefile.am b/tests/Makefile.am index d2b4181..18b8ce6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = paging cipher agch misc handover tx_power meas +SUBDIRS = paging cipher agch misc handover tx_power power meas if ENABLE_SYSMOBTS SUBDIRS += sysmobts diff --git a/tests/power/Makefile.am b/tests/power/Makefile.am new file mode 100644 index 0000000..3cb8d15 --- /dev/null +++ b/tests/power/Makefile.am @@ -0,0 +1,9 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) + +noinst_PROGRAMS = power_test +EXTRA_DIST = power_test.ok + +power_test_SOURCES = power_test.c $(srcdir)/../stubs.c +power_test_LDADD = $(top_builddir)/src/common/libbts.a $(LIBOSMOABIS_LIBS) $(LDADD) diff --git a/tests/power/power_test.c b/tests/power/power_test.c new file mode 100644 index 0000000..c1d6a5a --- /dev/null +++ b/tests/power/power_test.c @@ -0,0 +1,93 @@ +/* + * (C) 2013,2014 by Holger Hans Peter Freyther + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#include + +static void test_power_loop(void) +{ + struct gsm_bts bts; + struct gsm_bts_role_bts btsb; + struct gsm_bts_trx trx; + struct gsm_bts_trx_ts ts; + struct gsm_lchan *lchan; + int ret; + + memset(&bts, 0, sizeof(bts)); + memset(&btsb, 0, sizeof(btsb)); + memset(&trx, 0, sizeof(trx)); + memset(&ts, 0, sizeof(ts)); + + lchan = &ts.lchan[0]; + lchan->ts = &ts; + ts.trx = &trx; + trx.bts = &bts; + bts.role = &btsb; + bts.band = GSM_BAND_1800; + trx.ms_power_control = 1; + btsb.ul_power_target = -75; + + /* Simply clamping */ + lchan->state = LCHAN_S_NONE; + lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); + OSMO_ASSERT(ret == 0); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); + + + /* + * Now 15 dB too little and we should power it up. Could be a + * power level of 7 or 8 for 15 dBm + */ + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -90); + OSMO_ASSERT(ret == 1); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 7); + + /* It should be clamped to level 0 and 30 dBm */ + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -100); + OSMO_ASSERT(ret == 1); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); + + /* Fix it and jump down */ + lchan->ms_power_ctrl.fixed = 1; + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); + OSMO_ASSERT(ret == 0); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); + + /* And leave it again */ + lchan->ms_power_ctrl.fixed = 0; + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -40); + OSMO_ASSERT(ret == 1); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); +} + +int main(int argc, char **argv) +{ + printf("Testing power loop...\n"); + + test_power_loop(); + + printf("Power loop test OK\n"); + + return 0; +} diff --git a/tests/power/power_test.ok b/tests/power/power_test.ok new file mode 100644 index 0000000..6bf508b --- /dev/null +++ b/tests/power/power_test.ok @@ -0,0 +1,2 @@ +Testing power loop... +Power loop test OK diff --git a/tests/sysmobts/sysmobts_test.c b/tests/sysmobts/sysmobts_test.c index 6ae7623..32d6e95 100644 --- a/tests/sysmobts/sysmobts_test.c +++ b/tests/sysmobts/sysmobts_test.c @@ -182,72 +182,12 @@ * this happens asynchronously on the other side of the l1sap queue */ } -static void test_sysmobts_loop(void) -{ - struct gsm_bts bts; - struct gsm_bts_role_bts btsb; - struct gsm_bts_trx trx; - struct gsm_bts_trx_ts ts; - struct gsm_lchan *lchan; - int ret; - - memset(&bts, 0, sizeof(bts)); - memset(&btsb, 0, sizeof(btsb)); - memset(&trx, 0, sizeof(trx)); - memset(&ts, 0, sizeof(ts)); - - lchan = &ts.lchan[0]; - lchan->ts = &ts; - ts.trx = &trx; - trx.bts = &bts; - bts.role = &btsb; - bts.band = GSM_BAND_1800; - trx.ms_power_control = 1; - btsb.ul_power_target = -75; - - printf("Testing sysmobts power control\n"); - - /* Simply clamping */ - lchan->state = LCHAN_S_NONE; - lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); - - - /* - * Now 15 dB too little and we should power it up. Could be a - * power level of 7 or 8 for 15 dBm - */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -90); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 7); - - /* It should be clamped to level 0 and 30 dBm */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -100); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); - - /* Fix it and jump down */ - lchan->ms_power_ctrl.fixed = 1; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); - - /* And leave it again */ - lchan->ms_power_ctrl.fixed = 0; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -40); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); -} - int main(int argc, char **argv) { printf("Testing sysmobts routines\n"); test_sysmobts_auto_band(); test_sysmobts_cipher(); - test_sysmobts_loop(); + return 0; } diff --git a/tests/sysmobts/sysmobts_test.ok b/tests/sysmobts/sysmobts_test.ok index 07d79fd..1f53417 100644 --- a/tests/sysmobts/sysmobts_test.ok +++ b/tests/sysmobts/sysmobts_test.ok @@ -17,4 +17,3 @@ PCS to PCS band(1) arfcn(512) want(3) got(3) PCS to PCS band(8) arfcn(128) want(0) got(0) PCS to PCS band(2) arfcn(438) want(-1) got(-1) -Testing sysmobts power control diff --git a/tests/testsuite.at b/tests/testsuite.at index 0efd333..2d1cefd 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -31,6 +31,12 @@ AT_CHECK([$abs_top_builddir/tests/handover/handover_test], [], [expout], [ignore]) AT_CLEANUP +AT_SETUP([power]) +AT_KEYWORDS([power]) +cat $abs_srcdir/power/power_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/power/power_test], [], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([tx_power]) AT_KEYWORDS([tx_power]) cat $abs_srcdir/tx_power/tx_power_test.ok > expout -- To view, visit https://gerrit.osmocom.org/4222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 16:07:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 16:07:37 +0000 Subject: [PATCH] osmo-bts[master]: sysmo: use clock calibration source wrapper Message-ID: Review at https://gerrit.osmocom.org/4224 sysmo: use clock calibration source wrapper Make get_clk_cal() public and use it for ctrl commands handling. This ensures that the calibration is properly selected depending on the clock source. Change-Id: I1c809d48f29ef8e8c50641f882d7a954dfcf88f9 Related: OS#1944 --- M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/l1_if.h M src/osmo-bts-sysmo/sysmobts_ctrl.c 3 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/24/4224/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 8f68210..3d28644 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1238,7 +1238,7 @@ return 0; } -static int get_clk_cal(struct femtol1_hdl *hdl) +int get_clk_cal(struct femtol1_hdl *hdl) { #ifdef FEMTOBTS_API_VERSION return hdl->clk_cal; diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h index 033e7f5..1b214be 100644 --- a/src/osmo-bts-sysmo/l1_if.h +++ b/src/osmo-bts-sysmo/l1_if.h @@ -146,6 +146,7 @@ /* calibration loading */ int calib_load(struct femtol1_hdl *fl1h); +int get_clk_cal(struct femtol1_hdl *hdl); /* on-line re-calibration */ int l1if_rf_clock_info_reset(struct femtol1_hdl *fl1h); diff --git a/src/osmo-bts-sysmo/sysmobts_ctrl.c b/src/osmo-bts-sysmo/sysmobts_ctrl.c index 8eee58c..21df88e 100644 --- a/src/osmo-bts-sysmo/sysmobts_ctrl.c +++ b/src/osmo-bts-sysmo/sysmobts_ctrl.c @@ -141,7 +141,7 @@ /* Set GPS/PPS as reference */ sysp->id = SuperFemto_PrimId_RfClockSetupReq; - sysp->u.rfClockSetupReq.rfTrx.iClkCor = fl1h->clk_cal; /* !!! use get_clk_cal */ + sysp->u.rfClockSetupReq.rfTrx.iClkCor = get_clk_cal(fl1h); sysp->u.rfClockSetupReq.rfTrx.clkSrc = fl1h->clk_src; sysp->u.rfClockSetupReq.rfTrxClkCal.clkSrc = SuperFemto_ClkSrcId_GpsPps; l1if_req_compl(fl1h, msg, clock_setup_cb, NULL); -- To view, visit https://gerrit.osmocom.org/4224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c809d48f29ef8e8c50641f882d7a954dfcf88f9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 11 16:07:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 16:07:37 +0000 Subject: [PATCH] osmo-bts[master]: sysmo: don't override clock source with defaults Message-ID: Review at https://gerrit.osmocom.org/4225 sysmo: don't override clock source with defaults Previously clock source configured via vty was ignored. Check that it wasn't configured and only apply default value in that case. Change-Id: I8de74a12d2096971a8a83946dc6c7cdb9889acd7 Fixes: OS#1944 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 14 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/25/4225/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 3d28644..44ba3de 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1640,19 +1640,22 @@ clk_cal_use_eeprom(fl1h); get_hwinfo_eeprom(fl1h); #if SUPERFEMTO_API_VERSION >= SUPERFEMTO_API(2,1,0) - if (fl1h->hw_info.model_nr == 2050) { - /* On the sysmoBTS 2050, we don't have an OCXO but - * start with the TCXO and will sync it with the PPS - * of the GPS in case there is a fix. */ - fl1h->clk_src = SuperFemto_ClkSrcId_Tcxo; - LOGP(DL1C, LOGL_INFO, "Clock source defaulting to GPS 1PPS " - "on sysmoBTS 2050\n"); - } else { - /* default clock source: OCXO */ - fl1h->clk_src = SuperFemto_ClkSrcId_Ocxo; + if (fl1h->clk_src == SuperFemto_ClkSrcId_None) { + if (fl1h->hw_info.model_nr == 2050) { + /* On the sysmoBTS 2050, we don't have an OCXO but + * start with the TCXO and will sync it with the PPS + * of the GPS in case there is a fix. */ + fl1h->clk_src = SuperFemto_ClkSrcId_Tcxo; + LOGP(DL1C, LOGL_INFO, "Clock source defaulting to GPS 1PPS " + "on sysmoBTS 2050\n"); + } else { + /* default clock source: OCXO */ + fl1h->clk_src = SuperFemto_ClkSrcId_Ocxo; + } } #else - fl1h->clk_src = SF_CLKSRC_OCXO; + if (fl1h->clk_src == SF_CLKSRC_NONE) + fl1h->clk_src = SF_CLKSRC_OCXO; #endif rc = l1if_transport_open(MQ_SYS_WRITE, fl1h); -- To view, visit https://gerrit.osmocom.org/4225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8de74a12d2096971a8a83946dc6c7cdb9889acd7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 11 16:24:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 16:24:59 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: avoid direct state assignment Message-ID: Review at https://gerrit.osmocom.org/4226 cosmetic: avoid direct state assignment Use oml_mo_state_init() for Abis reset instead of explicit state assignment. Change-Id: Idcfbf36746cf988afb2e55741b4a3e1eda70194b --- M src/common/gsm_data_shared.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/26/4226/1 diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c index c2d196b..193ae97 100644 --- a/src/common/gsm_data_shared.c +++ b/src/common/gsm_data_shared.c @@ -33,11 +33,11 @@ #include #include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { - mo->nm_state.operational = NM_OPSTATE_NULL; - mo->nm_state.availability = NM_AVSTATE_POWER_OFF; + oml_mo_state_init(mo, NM_OPSTATE_NULL, NM_AVSTATE_POWER_OFF); } static void gsm_mo_init(struct gsm_abis_mo *mo, struct gsm_bts *bts, -- To view, visit https://gerrit.osmocom.org/4226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idcfbf36746cf988afb2e55741b4a3e1eda70194b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 11 16:38:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 16:38:50 +0000 Subject: osmo-bts[master]: cosmetic: avoid direct state assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idcfbf36746cf988afb2e55741b4a3e1eda70194b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 16:39:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 16:39:22 +0000 Subject: osmo-bts[master]: sysmo: don't override clock source with defaults In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8de74a12d2096971a8a83946dc6c7cdb9889acd7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 16:39:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 16:39:55 +0000 Subject: osmo-bts[master]: sysmo: use clock calibration source wrapper In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c809d48f29ef8e8c50641f882d7a954dfcf88f9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 16:40:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 16:40:59 +0000 Subject: osmo-bts[master]: Move power loop to generic tests In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4222/2/.gitignore File .gitignore: Line 75: /tests/power/power_test leading '/'? really? it's highly uncommon. does it work? -- To view, visit https://gerrit.osmocom.org/4222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 11 16:42:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Oct 2017 16:42:45 +0000 Subject: osmo-bts[master]: Make power test more verbose In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a5e65e23e62442ef8758ecbcf8e7820b4f15d7b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 16:47:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 16:47:11 +0000 Subject: osmo-bts[master]: Move power loop to generic tests In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) The .gitignore entry was added automatically via Emacs' magit. I can adjust it manually if necessary although it works as it is. https://gerrit.osmocom.org/#/c/4222/2/.gitignore File .gitignore: Line 75: /tests/power/power_test > leading '/'? really? it's highly uncommon. does it work? Yes, works like a charm. -- To view, visit https://gerrit.osmocom.org/4222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 11 16:54:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 16:54:16 +0000 Subject: [MERGED] osmo-bts[master]: sysmo: use clock calibration source wrapper In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: sysmo: use clock calibration source wrapper ...................................................................... sysmo: use clock calibration source wrapper Make get_clk_cal() public and use it for ctrl commands handling. This ensures that the calibration is properly selected depending on the clock source. Change-Id: I1c809d48f29ef8e8c50641f882d7a954dfcf88f9 Related: OS#1944 --- M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/l1_if.h M src/osmo-bts-sysmo/sysmobts_ctrl.c 3 files changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 8f68210..3d28644 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1238,7 +1238,7 @@ return 0; } -static int get_clk_cal(struct femtol1_hdl *hdl) +int get_clk_cal(struct femtol1_hdl *hdl) { #ifdef FEMTOBTS_API_VERSION return hdl->clk_cal; diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h index 033e7f5..1b214be 100644 --- a/src/osmo-bts-sysmo/l1_if.h +++ b/src/osmo-bts-sysmo/l1_if.h @@ -146,6 +146,7 @@ /* calibration loading */ int calib_load(struct femtol1_hdl *fl1h); +int get_clk_cal(struct femtol1_hdl *hdl); /* on-line re-calibration */ int l1if_rf_clock_info_reset(struct femtol1_hdl *fl1h); diff --git a/src/osmo-bts-sysmo/sysmobts_ctrl.c b/src/osmo-bts-sysmo/sysmobts_ctrl.c index 8eee58c..21df88e 100644 --- a/src/osmo-bts-sysmo/sysmobts_ctrl.c +++ b/src/osmo-bts-sysmo/sysmobts_ctrl.c @@ -141,7 +141,7 @@ /* Set GPS/PPS as reference */ sysp->id = SuperFemto_PrimId_RfClockSetupReq; - sysp->u.rfClockSetupReq.rfTrx.iClkCor = fl1h->clk_cal; /* !!! use get_clk_cal */ + sysp->u.rfClockSetupReq.rfTrx.iClkCor = get_clk_cal(fl1h); sysp->u.rfClockSetupReq.rfTrx.clkSrc = fl1h->clk_src; sysp->u.rfClockSetupReq.rfTrxClkCal.clkSrc = SuperFemto_ClkSrcId_GpsPps; l1if_req_compl(fl1h, msg, clock_setup_cb, NULL); -- To view, visit https://gerrit.osmocom.org/4224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1c809d48f29ef8e8c50641f882d7a954dfcf88f9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 11 16:54:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 11 Oct 2017 16:54:16 +0000 Subject: [MERGED] osmo-bts[master]: sysmo: don't override clock source with defaults In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: sysmo: don't override clock source with defaults ...................................................................... sysmo: don't override clock source with defaults Previously clock source configured via vty was ignored. Check that it wasn't configured and only apply default value in that case. Change-Id: I8de74a12d2096971a8a83946dc6c7cdb9889acd7 Fixes: OS#1944 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 14 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 3d28644..44ba3de 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1640,19 +1640,22 @@ clk_cal_use_eeprom(fl1h); get_hwinfo_eeprom(fl1h); #if SUPERFEMTO_API_VERSION >= SUPERFEMTO_API(2,1,0) - if (fl1h->hw_info.model_nr == 2050) { - /* On the sysmoBTS 2050, we don't have an OCXO but - * start with the TCXO and will sync it with the PPS - * of the GPS in case there is a fix. */ - fl1h->clk_src = SuperFemto_ClkSrcId_Tcxo; - LOGP(DL1C, LOGL_INFO, "Clock source defaulting to GPS 1PPS " - "on sysmoBTS 2050\n"); - } else { - /* default clock source: OCXO */ - fl1h->clk_src = SuperFemto_ClkSrcId_Ocxo; + if (fl1h->clk_src == SuperFemto_ClkSrcId_None) { + if (fl1h->hw_info.model_nr == 2050) { + /* On the sysmoBTS 2050, we don't have an OCXO but + * start with the TCXO and will sync it with the PPS + * of the GPS in case there is a fix. */ + fl1h->clk_src = SuperFemto_ClkSrcId_Tcxo; + LOGP(DL1C, LOGL_INFO, "Clock source defaulting to GPS 1PPS " + "on sysmoBTS 2050\n"); + } else { + /* default clock source: OCXO */ + fl1h->clk_src = SuperFemto_ClkSrcId_Ocxo; + } } #else - fl1h->clk_src = SF_CLKSRC_OCXO; + if (fl1h->clk_src == SF_CLKSRC_NONE) + fl1h->clk_src = SF_CLKSRC_OCXO; #endif rc = l1if_transport_open(MQ_SYS_WRITE, fl1h); -- To view, visit https://gerrit.osmocom.org/4225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8de74a12d2096971a8a83946dc6c7cdb9889acd7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 11 17:00:16 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Oct 2017 17:00:16 +0000 Subject: [PATCH] osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4146 to look at the new patch set (#5). client: add unified function to generate MGCP messages currently the only way to generate MGCP messages is to use mgcp_msg_crcx(), mgcp_msg_mdcx() and mgcp_msg_dlcx(). All three function take a fixed set of parameters via their parameter list. There is no way to add or leave away optional parameters. add function mgcp_msg_gen(), this function takes a unified message struct. The struct features a presence bitmask which allows to enable and disable parameters as needed. It is also possible to add new parameters in the future without breaking the API. This commit depends on libosmocore Change: Change-Id I15e1af68616309555d0ed9ac5da027c9833d42e3 Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 229 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/4146/5 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index efc1f76..c9e77de 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include @@ -37,6 +38,36 @@ uint16_t audio_port; }; +enum mgcp_verb { + MGCP_VERB_CRCX, + MGCP_VERB_MDCX, + MGCP_VERB_DLCX, + MGCP_VERB_AUEP, + MGCP_VERB_RSIP, +}; + +#define MGCP_MSG_PRESENCE_ENDPOINT 0x0001 +#define MGCP_MSG_PRESENCE_CALL_ID 0x0002 +#define MGCP_MSG_PRESENCE_CONN_ID 0x0004 +#define MGCP_MSG_PRESENCE_AUDIO_IP 0x0008 +#define MGCP_MSG_PRESENCE_AUDIO_PORT 0x0010 +#define MGCP_MSG_PRESENCE_CONN_MODE 0x0020 + +/* See also RFC3435 section 3.2.1.3 */ +#define MGCP_ENDPOINT_MAXLEN (255*2+1+1) + +struct mgcp_msg { + enum mgcp_verb verb; + /* See MGCP_MSG_PRESENCE_* constands above */ + uint32_t presence; + char endpoint[MGCP_ENDPOINT_MAXLEN]; + unsigned int call_id; + uint32_t conn_id; + uint16_t audio_port; + char *audio_ip; + enum mgcp_connection_mode conn_mode; +}; + void mgcp_client_conf_init(struct mgcp_client_conf *conf); void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf); int mgcp_client_config_write(struct vty *vty, const char *indent); @@ -63,17 +94,22 @@ enum mgcp_connection_mode; +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, enum mgcp_connection_mode mode); +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, const char *rtp_conn_addr, uint16_t rtp_port, enum mgcp_connection_mode mode); +OSMO_DEPRECATED("Use mgcp_msg_gen() instead") struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg); + extern const struct value_string mgcp_client_connection_mode_strs[]; static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 1cd37be..0d5dbcd 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -614,6 +615,107 @@ "C: %x\r\n", trans_id, rtp_endpoint, call_id); } +#define MGCP_CRCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CALL_ID | \ + MGCP_MSG_PRESENCE_CONN_ID | \ + MGCP_MSG_PRESENCE_CONN_MODE) +#define MGCP_MDCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CONN_ID) +#define MGCP_DLCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_RSIP_MANDATORY 0 /* none */ + +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg) +{ + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); + uint32_t mandatory_mask; + struct msgb *msg = msgb_alloc_headroom(4096, 128, "MGCP tx"); + int rc = 0; + + msg->l2h = msg->data; + msg->cb[MSGB_CB_MGCP_TRANS_ID] = trans_id; + + /* Add command verb */ + switch (mgcp_msg->verb) { + case MGCP_VERB_CRCX: + mandatory_mask = MGCP_CRCX_MANDATORY; + rc += msgb_printf(msg, "CRCX %u", trans_id); + break; + case MGCP_VERB_MDCX: + mandatory_mask = MGCP_MDCX_MANDATORY; + rc += msgb_printf(msg, "MDCX %u", trans_id); + break; + case MGCP_VERB_DLCX: + mandatory_mask = MGCP_DLCX_MANDATORY; + rc += msgb_printf(msg, "DLCX %u", trans_id); + break; + case MGCP_VERB_AUEP: + mandatory_mask = MGCP_AUEP_MANDATORY; + rc += msgb_printf(msg, "AUEP %u", trans_id); + break; + case MGCP_VERB_RSIP: + mandatory_mask = MGCP_RSIP_MANDATORY; + rc += msgb_printf(msg, "RSIP %u", trans_id); + break; + default: + LOGP(DLMGCP, LOGL_ERROR, + "Invalid command verb, can not generate MGCP message"); + return NULL; + } + + /* Check if mandatory fields are missing */ + if (!((mgcp_msg->presence & mandatory_mask) == mandatory_mask)) { + LOGP(DLMGCP, LOGL_ERROR, + "One or more missing mandatory fields, can not generate MGCP message"); + return NULL; + } + + /* Add endpoint name */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_ENDPOINT) + rc += msgb_printf(msg, " %s", mgcp_msg->endpoint); + + /* Add protocol version */ + msgb_printf(msg, " MGCP 1.0\r\n"); + + /* Add call id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CALL_ID) + rc += msgb_printf(msg, "C: %x\r\n", mgcp_msg->call_id); + + /* Add connection id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID) + rc += msgb_printf(msg, "I: %u\r\n", mgcp_msg->conn_id); + + /* Add local connection options */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID + && mgcp_msg->verb == MGCP_VERB_CRCX) + rc += msgb_printf(msg, "L: p:20, a:AMR, nt:IN\r\n"); + + /* Add mode */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_MODE) + rc += + msgb_printf(msg, "M: %s\r\n", + mgcp_client_cmode_name(mgcp_msg->conn_mode)); + + /* Add RTP address and port (SDP) */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_IP + && mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT) { + rc += msgb_printf(msg, "\r\n"); + rc += msgb_printf(msg, "c=IN IP4 %s\r\n", mgcp_msg->audio_ip); + rc += + msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", + mgcp_msg->audio_port); + } + + if (rc != 0) { + LOGP(DLMGCP, LOGL_ERROR, + "message buffer to small, can not generate MGCP message"); + msgb_free(msg); + msg = NULL; + } + + return msg; +} + struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index f2f0e0f..7c97354 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -149,6 +149,68 @@ "a=ptime:20\r\n"); } +void test_mgcp_msg(void) +{ + struct msgb *msg; + + struct mgcp_msg mgcp_msg; + char *ip_buf[INET_ADDRSTRLEN]; + + if (mgcp) + talloc_free(mgcp); + mgcp = mgcp_client_init(ctx, &conf); + + /* Pre-fill the message struct with some arbitary values */ + strcpy(ip_buf, "192.168.100.23"); + mgcp_msg.audio_ip = ip_buf; + strcpy(mgcp_msg.endpoint, "23 at mgw"); + mgcp_msg.audio_port = 1234; + mgcp_msg.call_id = 47; + mgcp_msg.conn_id = 11; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + + printf("\n"); + + printf("Generated CRCX message:\n"); + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated MDCX message:\n"); + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated DLCX message:\n"); + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated AUEP message:\n"); + mgcp_msg.verb = MGCP_VERB_AUEP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated RSIP message:\n"); + mgcp_msg.verb = MGCP_VERB_RSIP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + msgb_free(msg); +} + static const struct log_info_cat log_categories[] = { }; @@ -167,6 +229,7 @@ mgcp_client_conf_init(&conf); test_crcx(); + test_mgcp_msg(); printf("Done\n"); fprintf(stderr, "Done\n"); diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index d35f2d6..7c4819d 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,4 +28,32 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + +Generated CRCX message: +CRCX 1 23 at mgw MGCP 1.0 +C: 2f +I: 11 +L: p:20, a:AMR, nt:IN +M: sendrecv + +Generated MDCX message: +MDCX 2 23 at mgw MGCP 1.0 +C: 2f +I: 11 +M: sendrecv + +c=IN IP4 192.168.100.23 +m=audio 1234 RTP/AVP 255 + +Generated DLCX message: +DLCX 3 23 at mgw MGCP 1.0 +C: 2f +I: 11 + +Generated AUEP message: +AUEP 4 23 at mgw MGCP 1.0 + +Generated RSIP message: +RSIP 5 23 at mgw MGCP 1.0 + Done -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 17:00:16 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Oct 2017 17:00:16 +0000 Subject: [PATCH] osmo-mgw[master]: protocol: allow wildcarded DLCX Message-ID: Review at https://gerrit.osmocom.org/4227 protocol: allow wildcarded DLCX In many cases it is simpler to instruct the mgcp-gw to drop all connections at once instead of removing each connection individually. drop all connections and release the endpoint in when no connection id is supplied with the DLCX command. Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/27/4227/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 5d4dd47..3ce324a 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -907,14 +907,24 @@ } } - /* find the connection */ + /* Analyze connection ID */ if (mgcp_parse_ci(&conn_id, ci)) { - LOGP(DLMGCP, LOGL_ERROR, - "DLCX: endpoint:%x insufficient parameters, missing ci (connectionIdentifier)\n", + LOGP(DLMGCP, LOGL_NOTICE, + "DLCX: endpoint:%x missing ci (connectionIdentifier), will remove all connections at once\n", ENDPOINT_NUMBER(endp)); - return create_err_response(endp, 400, "DLCX", p->trans); + + /* Appereantly no connection id had been supplied, this + * means that the client wishes to toss all connections + * at once. */ + mgcp_release_endp(endp); + + /* Note: In this case we do not return any statistics, + * as we assume that the client is not interested in + * this case. */ + return create_ok_response(endp, 200, "DLCX", p->trans); } + /* Find the connection */ conn = mgcp_conn_get_rtp(endp, conn_id); if (!conn) goto error3; -- To view, visit https://gerrit.osmocom.org/4227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 11 18:37:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Oct 2017 18:37:42 +0000 Subject: [PATCH] osmo-ggsn[master]: create_context_ind(): Fix crash on apn not found Message-ID: Review at https://gerrit.osmocom.org/4228 create_context_ind(): Fix crash on apn not found Program terminated with signal SIGSEGV, Segmentation fault. 0 create_context_ind (pdp=0xb6b391b0 ) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:453 453 if (!apn->started) (gdb) bt 0 create_context_ind (pdp=0xb6b391b0 ) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:453 1 0xb6b225e0 in gtp_create_pdp_ind (gsn=gsn at entry=0x74f28, version=version at entry=1, peer=0x0, peer at entry=0xbee6ead4, fd=-1092167056, fd at entry=8, pack=pack at entry=0xbee6eae4, len=len at entry=179) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/gtp/gtp.c:1591 2 0xb6b245e4 in gtp_decaps1c (gsn=0x74f28) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/gtp/gtp.c:2986 3 0x41d770c0 in osmo_select_main () from /usr/lib/libosmocore.so.8 4 0x000121b8 in main (argc=4, argv=0xbee70e54) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:897 Fixes: dd266066c7cc96c797034da352cc9d72177c5780, b16c46b4c36383368eb1581e40d0a8ca751ddc53 Change-Id: Ie4ec74e87aaf1d067dd1717d986673be56c4d6ed --- M ggsn/ggsn.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/28/4228/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 5852ef6..6c5c1a8 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -449,14 +449,14 @@ /* First find an exact APN name match */ apn = ggsn_find_apn(ggsn, name_buf); /* ignore if the APN has not been started */ - if (!apn->started) + if (apn && !apn->started) apn = NULL; /* then try default (if any) */ if (!apn) apn = ggsn->cfg.default_apn; /* ignore if the APN has not been started */ - if (!apn->started) + if (apn && !apn->started) apn = NULL; if (!apn) { -- To view, visit https://gerrit.osmocom.org/4228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie4ec74e87aaf1d067dd1717d986673be56c4d6ed Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:11:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:11:08 +0000 Subject: osmo-gsm-tester[master]: modem: Implement voice calls in modem and add voice suite In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (12 comments) yay, I'm really glad that we finally feature a voice test! And I didn't even raise a finger for it :) I have a few questions and some hints to tighten, but I'll leave it up to you, it's already good enough to be merged. https://gerrit.osmocom.org/#/c/4150/1/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 583: self.log('Dial returned already existing call!') is it an error when the call object is already known? The log has an exclamation mark but isn't self.err(). Preferably not send mixed signals, and possibly return False or raise if it is an error... Line 586: def call_answer(self, call_id): (could add a timeout arg to forward to wait() ... not necessarily in this patch) Line 594: call_dbus_obj = systembus_get(call_id) validation that call_dbus_obj exists? what happens if there is no such call? Line 601: call_dbus_obj = systembus_get(call_id) what happens if there is no such call? Say I had a loop that polls call_state() and at some point the call has ceased to exist, is the only way to notice then to catch an exception? Line 602: props = call_dbus_obj.GetProperties() and will it be a NoneTypeException here? Line 612: self.dbg('Call already exists!') (same as above; exclamation mark looks like a bad situation, yet this is just a dbg() log) Line 619: self.dbg('Trying to remove non-existing call!') why all the shouting? :) It may be a personal preference of mine, but I'm kind of against exclamations in logs, prefer calm remarks on what the situation is. If they deserve serious attention, they should be raised exceptions. https://gerrit.osmocom.org/#/c/4150/1/src/osmo_gsm_tester/schema.py File src/osmo_gsm_tester/schema.py: Line 85: if val in ('sms', 'gprs', 'voice', 'ussd'): nice :) https://gerrit.osmocom.org/#/c/4150/1/suites/voice/mo_mt_call.py File suites/voice/mo_mt_call.py: Line 35: wait(msc.subscriber_attached, ms_mo, ms_mt) (btw, unrelated to this particular patch, the above is a common prelude to pretty much any test that doesn't test registration or startup itself ... I think at some point we should think about having a suite start up a core net in an initial setup script, and each subsequent test just using those binaries without having to restart them, as in https://osmocom.org/issues/2208 ; and/or, if we positively need to restart everything all the time, have a simple one-liner to startup everything instead of code dupping in each test) Line 38: wait(lambda: mo_call_id in ms_mo.call_id_list()) should this wait maybe be part of call_dial()? Line 40: mt_call_id = ms_mt.call_id_list()[0] I guess the above two lines deserve to be in a mt_call_id = ms_mt.call_wait_incoming() ...there is no way to know the incoming call_id in advance, right? Can we wait for a call from a specific caller ID? Ah, and before we start, above call_dial(), we should assert that there is no call left over from before that could mess up the wait here: assert not ms_mt.call_id_list() Line 53: wait(lambda: len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0) and since we're waiting for an empty list here, we should also, before we start calling above, do assert not ms_mo.call_id_list() -- To view, visit https://gerrit.osmocom.org/4150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib402effc830db293f27a877658894e454a93a606 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:24:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:24:54 +0000 Subject: osmo-gsm-tester[master]: debug: Add voicecall related method to interactive shell In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (9 comments) some more nitpicks... https://gerrit.osmocom.org/#/c/4151/1/suites/aoip_debug/interactive.py File suites/aoip_debug/interactive.py: Line 26: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-answer , call-hangup ') that prompt line is getting awfully long. We may need to a) split it up or b) move to a 'help' command Line 52: elif cmd.startswith('call-list'): evangelism: before, commands could be abbreviated to their least unique length (and so far it was unique from the first character). these added commands change that premise... cleaner would be to add a mechanism that finds an unambiguous match above. But then again... nevermind... Line 58: print('call_list: %r' % ms.call_id_list()) nitpick: command is 'call-list', py function is call_id_list(), yet this prints 'call_list' :) Line 65: print('dial %s->%s, %s' % (params[1],params[2],str(mo.call_dial(params[2])))) 'dialing'? Might be better to first print 'dialing' and then start dialing? With this code here, first dial and only print the result when the function has returned. Line 69: continue would make more readable: ms_msisdn, call_id = params Line 72: print('answer %s' % params[2]) 'answering'? Line 77: continue would make more readable: ms_msisdn, call_id = params Line 80: print('hang up %s' % params[2]) 'hanging up' ? https://gerrit.osmocom.org/#/c/4151/1/suites/debug/interactive.py File suites/debug/interactive.py: Line 45: elif cmd.startswith('call-list'): oh damn, are we really duplicating all this? we should fix that... -- To view, visit https://gerrit.osmocom.org/4151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2df68bf4fba0fb542eebdeb515a3dac6d5e575e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:25:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:25:29 +0000 Subject: [MERGED] osmo-hlr[master]: gitignore: tests/package.m4 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gitignore: tests/package.m4 ...................................................................... gitignore: tests/package.m4 Change-Id: Ida4a61d4786d7db63dc59a641f44afb2ec2edd97 --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 2e78dfa..72f11a1 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ libtool ltmain.sh m4 +*.m4 missing .deps -- To view, visit https://gerrit.osmocom.org/4205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida4a61d4786d7db63dc59a641f44afb2ec2edd97 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:25:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:25:29 +0000 Subject: [MERGED] osmo-hlr[master]: ctrl_test_runner.py: use proper constant as test db path In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: ctrl_test_runner.py: use proper constant as test db path ...................................................................... ctrl_test_runner.py: use proper constant as test db path Change-Id: I9533a9ff8c0f8d24c678583a9197143a187908f3 --- M tests/ctrl_test_runner.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py index 7c14f50..1c5ec2a 100644 --- a/tests/ctrl_test_runner.py +++ b/tests/ctrl_test_runner.py @@ -178,7 +178,7 @@ def tearDown(self): super(TestCtrlHLR, self).tearDown() - os.unlink("hlr_ctrl_test.db") + os.unlink(self.HLR_DB) def ctrl_command(self): return ["./src/osmo-hlr", "-c", "doc/examples/osmo-hlr.cfg", '-l', 'hlr_ctrl_test.db'] -- To view, visit https://gerrit.osmocom.org/4204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9533a9ff8c0f8d24c678583a9197143a187908f3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:25:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:25:30 +0000 Subject: [MERGED] osmo-hlr[master]: cosmetic: log: "SQLite" with capital L In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: log: "SQLite" with capital L ...................................................................... cosmetic: log: "SQLite" with capital L Change-Id: I43a6ea646f14cfea3a7cd4eb88237ada6d47f5f1 --- M src/db.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index 2c10ba0..0ece61b 100644 --- a/src/db.c +++ b/src/db.c @@ -132,16 +132,16 @@ const char *o = sqlite3_compileoption_get(i); if (!o) break; - LOGP(DDB, LOGL_DEBUG, "SQlite3 compiled with '%s'\n", o); + LOGP(DDB, LOGL_DEBUG, "SQLite3 compiled with '%s'\n", o); } rc = sqlite3_config(SQLITE_CONFIG_LOG, sql3_error_log_cb, NULL); if (rc != SQLITE_OK) - LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 error log callback\n"); + LOGP(DDB, LOGL_NOTICE, "Unable to set SQLite3 error log callback\n"); rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); if (rc != SQLITE_OK) - LOGP(DDB, LOGL_NOTICE, "Unable to set SQlite3 SQL statement log callback\n"); + LOGP(DDB, LOGL_NOTICE, "Unable to set SQLite3 SQL statement log callback\n"); rc = sqlite3_open(dbc->fname, &dbc->db); if (rc != SQLITE_OK) { @@ -153,7 +153,7 @@ /* enable extended result codes */ rc = sqlite3_extended_result_codes(dbc->db, 1); if (rc != SQLITE_OK) - LOGP(DDB, LOGL_ERROR, "Unable to enable SQlite3 extended result codes\n"); + LOGP(DDB, LOGL_ERROR, "Unable to enable SQLite3 extended result codes\n"); char *err_msg; rc = sqlite3_exec(dbc->db, "PRAGMA journal_mode=WAL; PRAGMA synchonous = NORMAL;", 0, 0, &err_msg); -- To view, visit https://gerrit.osmocom.org/4202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43a6ea646f14cfea3a7cd4eb88237ada6d47f5f1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:25:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:25:30 +0000 Subject: [MERGED] osmo-hlr[master]: cosmetic: db_hlr: SL3_TXT: clarify indenting In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: db_hlr: SL3_TXT: clarify indenting ...................................................................... cosmetic: db_hlr: SL3_TXT: clarify indenting Before, it looked like the nul term was within the if () body (despite no body being present). While at it, also remove one of the two tabs of indenting and put the opening 'do {' on its own line. Change-Id: I8d03433b6fba90f4e46814bc54636bc3a444cc46 --- M src/db_hlr.c 1 file changed, 7 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db_hlr.c b/src/db_hlr.c index 4bccca4..5db2c9e 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -30,12 +30,13 @@ #define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) -#define SL3_TXT(x, stmt, idx) do { \ - const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ - if (_txt) \ - strncpy(x, _txt, sizeof(x)); \ - x[sizeof(x)-1] = '\0'; \ - } while (0) +#define SL3_TXT(x, stmt, idx) \ + do { \ + const char *_txt = (const char *) sqlite3_column_text(stmt, idx);\ + if (_txt) \ + strncpy(x, _txt, sizeof(x)); \ + x[sizeof(x)-1] = '\0'; \ + } while (0) int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr) -- To view, visit https://gerrit.osmocom.org/4203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8d03433b6fba90f4e46814bc54636bc3a444cc46 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:30:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:30:44 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: don't log about missing SQLite log cb In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4175 to look at the new patch set (#6). cosmetic: don't log about missing SQLite log cb SQLite3 seems to be commonly compiled without log callback support. It is then misleading to see a seeming error message about this on each osmo-hlr startup. Avoid the impression that we would miss out on important logging: query sqlit3_compileoption_get() whether SQLITE_CONFIG_SQLLOG is enabled. Try to register the callback only if present, if not, say so on DEBUG log. See https://sqlite.org/compile.html "SQLITE_ENABLE_SQLLOG" Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 --- M src/db.c 1 file changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/75/4175/6 diff --git a/src/db.c b/src/db.c index 0ece61b..cc45db3 100644 --- a/src/db.c +++ b/src/db.c @@ -21,6 +21,7 @@ #include #include +#include #include "logging.h" #include "db.h" @@ -121,6 +122,7 @@ struct db_context *dbc = talloc_zero(ctx, struct db_context); unsigned int i; int rc; + bool has_sqlite_config_sqllog = false; LOGP(DDB, LOGL_NOTICE, "using database: %s\n", fname); LOGP(DDB, LOGL_INFO, "Compiled against SQLite3 lib version %s\n", SQLITE_VERSION); @@ -133,15 +135,21 @@ if (!o) break; LOGP(DDB, LOGL_DEBUG, "SQLite3 compiled with '%s'\n", o); + if (!strcmp(o, "ENABLE_SQLLOG")) + has_sqlite_config_sqllog = true; } rc = sqlite3_config(SQLITE_CONFIG_LOG, sql3_error_log_cb, NULL); if (rc != SQLITE_OK) LOGP(DDB, LOGL_NOTICE, "Unable to set SQLite3 error log callback\n"); - rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); - if (rc != SQLITE_OK) - LOGP(DDB, LOGL_NOTICE, "Unable to set SQLite3 SQL statement log callback\n"); + if (has_sqlite_config_sqllog) { + rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); + if (rc != SQLITE_OK) + LOGP(DDB, LOGL_NOTICE, "Unable to set SQLite3 SQL log callback\n"); + } else + LOGP(DDB, LOGL_DEBUG, "Not setting SQL log callback:" + " SQLite3 compiled without support for it\n"); rc = sqlite3_open(dbc->fname, &dbc->db); if (rc != SQLITE_OK) { -- To view, visit https://gerrit.osmocom.org/4175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 Gerrit-PatchSet: 6 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:30:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:30:45 +0000 Subject: [PATCH] osmo-hlr[master]: db_test: fix typo: drop double-print of sgsn_address Message-ID: Review at https://gerrit.osmocom.org/4229 db_test: fix typo: drop double-print of sgsn_address Change-Id: Ia85a3a3b10ceed4bbcd10867d147355c99ccb715 --- M tests/db/db_test.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/29/4229/1 diff --git a/tests/db/db_test.c b/tests/db/db_test.c index e8cfe75..9bd082e 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -98,7 +98,6 @@ Ps(vlr_number); Ps(sgsn_number); Ps(sgsn_address); - Ps(sgsn_address); Pd_nonzero(periodic_lu_timer); Pd_nonzero(periodic_rau_tau_timer); Pb(false, nam_cs); -- To view, visit https://gerrit.osmocom.org/4229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia85a3a3b10ceed4bbcd10867d147355c99ccb715 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:30:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:30:46 +0000 Subject: [PATCH] osmo-hlr[master]: fix db_subscr_get_by_*(): clear output data; test in db_test.c Message-ID: Review at https://gerrit.osmocom.org/4230 fix db_subscr_get_by_*(): clear output data; test in db_test.c db_subscr_get_by_*() failed to clear the out-param struct, meaning that data could remain in a struct even though it is not present in the database. Always zero out the struct before writing to it. Adjust the db_test to catch this error by writing "-invalid-data-" to each struct before running db get functions. Change-Id: I038bd437452c87841d709fcdd5ac30ab1356b2db --- M src/db_hlr.c M tests/db/db_test.c 2 files changed, 18 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/30/4230/1 diff --git a/src/db_hlr.c b/src/db_hlr.c index 71f682d..cf6e4f8 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -379,6 +379,8 @@ if (!subscr) goto out; + *subscr = (struct hlr_subscriber){}; + /* obtain the various columns */ subscr->id = sqlite3_column_int64(stmt, 0); SL3_TXT(subscr->imsi, stmt, 1); diff --git a/tests/db/db_test.c b/tests/db/db_test.c index db3318c..d49983e 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -34,6 +34,19 @@ #define comment(fmt, args...) fprintf(stderr, "\n--- " fmt "\n\n", ## args); #define comment_end() fprintf(stderr, "===== %s: SUCCESS\n\n", __func__); +#define fill_invalid(x) _fill_invalid(&x, sizeof(x)) +static void _fill_invalid(void *dest, size_t size) +{ + uint8_t *pos = dest; + size_t remain = size; + int wrote = 0; + do { + remain -= wrote; + pos += wrote; + wrote = snprintf((void*)pos, remain, "-invalid-data"); + } while (wrote <= remain); +} + /* Perform a function call and verbosely assert that its return value is as expected. * The return code is then available in g_rc. */ #define ASSERT_RC(call, expect_rc) \ @@ -53,7 +66,7 @@ #define ASSERT_SEL(by, val, expect_rc) \ do { \ int rc; \ - g_subscr = (struct hlr_subscriber){}; \ + fill_invalid(g_subscr); \ fprintf(stderr, "db_subscr_get_by_" #by "(dbc, " #val ", &g_subscr) --> " \ #expect_rc "\n"); \ rc = db_subscr_get_by_##by(dbc, val, &g_subscr); \ @@ -71,8 +84,8 @@ * The results are then available in g_aud2g and g_aud3g. */ #define ASSERT_SEL_AUD(imsi, expect_rc, expect_id) \ do { \ - g_aud2g = (struct osmo_sub_auth_data){}; \ - g_aud3g = (struct osmo_sub_auth_data){}; \ + fill_invalid(g_aud2g); \ + fill_invalid(g_aud3g); \ g_id = 0; \ ASSERT_RC(db_get_auth_data(dbc, imsi, &g_aud2g, &g_aud3g, &g_id), expect_rc); \ if (!g_rc) { \ -- To view, visit https://gerrit.osmocom.org/4230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I038bd437452c87841d709fcdd5ac30ab1356b2db Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:31:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:31:20 +0000 Subject: osmo-hlr[master]: cosmetic: don't log about missing SQLite log cb In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 re-add +2, lost due to rebase cosmetics -- To view, visit https://gerrit.osmocom.org/4175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 Gerrit-PatchSet: 6 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: fix db_subscr_get_by_*(): clear output data; test in db_test.c In-Reply-To: References: Message-ID: fix db_subscr_get_by_*(): clear output data; test in db_test.c db_subscr_get_by_*() failed to clear the out-param struct, meaning that data could remain in a struct even though it is not present in the database. Always zero out the struct before writing to it. Adjust the db_test to catch this error by writing "-invalid-data-" to each struct before running db get functions. Change-Id: I038bd437452c87841d709fcdd5ac30ab1356b2db --- M src/db_hlr.c M tests/db/db_test.c 2 files changed, 18 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/30/4230/2 diff --git a/src/db_hlr.c b/src/db_hlr.c index 71f682d..cf6e4f8 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -379,6 +379,8 @@ if (!subscr) goto out; + *subscr = (struct hlr_subscriber){}; + /* obtain the various columns */ subscr->id = sqlite3_column_int64(stmt, 0); SL3_TXT(subscr->imsi, stmt, 1); diff --git a/tests/db/db_test.c b/tests/db/db_test.c index db3318c..d49983e 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -34,6 +34,19 @@ #define comment(fmt, args...) fprintf(stderr, "\n--- " fmt "\n\n", ## args); #define comment_end() fprintf(stderr, "===== %s: SUCCESS\n\n", __func__); +#define fill_invalid(x) _fill_invalid(&x, sizeof(x)) +static void _fill_invalid(void *dest, size_t size) +{ + uint8_t *pos = dest; + size_t remain = size; + int wrote = 0; + do { + remain -= wrote; + pos += wrote; + wrote = snprintf((void*)pos, remain, "-invalid-data"); + } while (wrote <= remain); +} + /* Perform a function call and verbosely assert that its return value is as expected. * The return code is then available in g_rc. */ #define ASSERT_RC(call, expect_rc) \ @@ -53,7 +66,7 @@ #define ASSERT_SEL(by, val, expect_rc) \ do { \ int rc; \ - g_subscr = (struct hlr_subscriber){}; \ + fill_invalid(g_subscr); \ fprintf(stderr, "db_subscr_get_by_" #by "(dbc, " #val ", &g_subscr) --> " \ #expect_rc "\n"); \ rc = db_subscr_get_by_##by(dbc, val, &g_subscr); \ @@ -71,8 +84,8 @@ * The results are then available in g_aud2g and g_aud3g. */ #define ASSERT_SEL_AUD(imsi, expect_rc, expect_id) \ do { \ - g_aud2g = (struct osmo_sub_auth_data){}; \ - g_aud3g = (struct osmo_sub_auth_data){}; \ + fill_invalid(g_aud2g); \ + fill_invalid(g_aud3g); \ g_id = 0; \ ASSERT_RC(db_get_auth_data(dbc, imsi, &g_aud2g, &g_aud3g, &g_id), expect_rc); \ if (!g_rc) { \ -- To view, visit https://gerrit.osmocom.org/4230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I038bd437452c87841d709fcdd5ac30ab1356b2db Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: add initial db_test: creating and deleting subscribers In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4178 to look at the new patch set (#3). add initial db_test: creating and deleting subscribers Change-Id: I2a0d277f55162bf5ceb0fc7d50390f2994daed71 --- M configure.ac M tests/Makefile.am A tests/db/Makefile.am A tests/db/db_test.c A tests/db/db_test.err A tests/db/db_test.ok M tests/testsuite.at 7 files changed, 662 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/78/4178/3 diff --git a/configure.ac b/configure.ac index 167d7f3..1db32d4 100644 --- a/configure.ac +++ b/configure.ac @@ -70,4 +70,5 @@ tests/auc/Makefile tests/auc/gen_ts_55_205_test_sets/Makefile tests/gsup_server/Makefile + tests/db/Makefile ) diff --git a/tests/Makefile.am b/tests/Makefile.am index d979fb6..0b625f5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,7 @@ SUBDIRS = \ auc \ gsup_server \ + db \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am new file mode 100644 index 0000000..a1f35a7 --- /dev/null +++ b/tests/db/Makefile.am @@ -0,0 +1,53 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/src \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(SQLITE3_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(NULL) + +EXTRA_DIST = \ + db_test.ok \ + db_test.err \ + $(NULL) + +check_PROGRAMS = db_test + +db_test_SOURCES = \ + db_test.c \ + $(NULL) + +db_test_LDADD = \ + $(top_srcdir)/src/db.c \ + $(top_srcdir)/src/db_hlr.c \ + $(top_srcdir)/src/db_auc.c \ + $(top_srcdir)/src/logging.c \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(SQLITE3_LIBS) \ + $(NULL) + +.PHONY: db_test.db update_exp manual manual-nonverbose manual-gdb +db_test.db: + rm -f db_test.db + sqlite3 $(builddir)/db_test.db < $(top_srcdir)/sql/hlr.sql + +update_exp: db_test.db + cd $(builddir); ./db_test >"$(srcdir)/db_test.ok" 2>"$(srcdir)/db_test.err" + +manual: db_test.db + cd $(builddir); ./db_test -v + +manual-nonverbose: db_test.db + cd $(builddir); ./db_test + +manual-gdb: db_test.db + cd $(builddir); gdb -ex run --args ./db_test -v diff --git a/tests/db/db_test.c b/tests/db/db_test.c new file mode 100644 index 0000000..9bd082e --- /dev/null +++ b/tests/db/db_test.c @@ -0,0 +1,346 @@ +/* (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "db.h" +#include "logging.h" + +#define comment_start() fprintf(stderr, "\n===== %s\n", __func__); +#define comment(fmt, args...) fprintf(stderr, "\n--- " fmt "\n\n", ## args); +#define comment_end() fprintf(stderr, "===== %s: SUCCESS\n\n", __func__); + +/* Perform a function call and verbosely assert that its return value is as expected. + * The return code is then available in g_rc. */ +#define ASSERT_RC(call, expect_rc) \ + do { \ + fprintf(stderr, #call " --> " #expect_rc "\n"); \ + g_rc = call; \ + if (g_rc != (expect_rc)) \ + fprintf(stderr, " MISMATCH: got rc = %d, expected: " \ + #expect_rc " = %d\n", g_rc, expect_rc); \ + OSMO_ASSERT(g_rc == (expect_rc)); \ + fprintf(stderr, "\n"); \ + } while (0) + +/* Do db_subscr_get_by_xxxx and verbosely assert that its return value is as expected. + * Print the subscriber struct to stderr to be validated by db_test.err. + * The result is then available in g_subscr. */ +#define ASSERT_SEL(by, val, expect_rc) \ + do { \ + int rc; \ + g_subscr = (struct hlr_subscriber){}; \ + fprintf(stderr, "db_subscr_get_by_" #by "(dbc, " #val ", &g_subscr) --> " \ + #expect_rc "\n"); \ + rc = db_subscr_get_by_##by(dbc, val, &g_subscr); \ + if (rc != (expect_rc)) \ + fprintf(stderr, " MISMATCH: got rc = %d, expected: " \ + #expect_rc " = %d\n", rc, expect_rc); \ + OSMO_ASSERT(rc == (expect_rc)); \ + if (!rc) \ + dump_subscr(&g_subscr); \ + fprintf(stderr, "\n"); \ + } while (0) + +static struct db_context *dbc = NULL; +static void *ctx = NULL; +static struct hlr_subscriber g_subscr; +static int g_rc; + +#define Pfv(name, fmt, val) \ + fprintf(stderr, " ." #name " = " fmt ",\n", val) +#define Pfo(name, fmt, obj) \ + Pfv(name, fmt, obj->name) + +/* Print a subscriber struct to stderr to be validated by db_test.err. */ +void dump_subscr(struct hlr_subscriber *subscr) +{ +#define Ps(name) \ + if (*subscr->name) \ + Pfo(name, "'%s'", subscr) +#define Pd(name) \ + Pfv(name, "%"PRId64, (int64_t)subscr->name) +#define Pd_nonzero(name) \ + if (subscr->name) \ + Pd(name) +#define Pb(if_val, name) \ + if (subscr->name == (if_val)) \ + Pfv(name, "%s", subscr->name ? "true" : "false") + + fprintf(stderr, "struct hlr_subscriber {\n"); + Pd(id); + Ps(imsi); + Ps(msisdn); + Ps(vlr_number); + Ps(sgsn_number); + Ps(sgsn_address); + Pd_nonzero(periodic_lu_timer); + Pd_nonzero(periodic_rau_tau_timer); + Pb(false, nam_cs); + Pb(false, nam_ps); + if (subscr->lmsi) + Pfo(lmsi, "0x%x", subscr); + Pb(true, ms_purged_cs); + Pb(true, ms_purged_ps); + fprintf(stderr, "}\n"); +#undef Ps +#undef Pd +#undef Pd_nonzero +#undef Pb +} + +void dump_aud(const char *label, struct osmo_sub_auth_data *aud) +{ + if (aud->type == OSMO_AUTH_TYPE_NONE) { + fprintf(stderr, "%s: none\n", label); + return; + } + + fprintf(stderr, "%s: struct osmo_sub_auth_data {\n", label); +#define Pf(name, fmt) \ + Pfo(name, fmt, aud) +#define Phex(name) \ + Pfv(name, "'%s'", osmo_hexdump_nospc(aud->name, sizeof(aud->name))) + + Pfv(type, "%s", osmo_sub_auth_type_name(aud->type)); + Pfv(algo, "%s", osmo_auth_alg_name(aud->algo)); + switch (aud->type) { + case OSMO_AUTH_TYPE_GSM: + Phex(u.gsm.ki); + break; + case OSMO_AUTH_TYPE_UMTS: + Phex(u.umts.opc); + Pf(u.umts.opc_is_op, "%u"); + Phex(u.umts.k); + Phex(u.umts.amf); + if (aud->u.umts.sqn) { + Pf(u.umts.sqn, "%"PRIu64); + Pf(u.umts.sqn, "0x%"PRIx64); + } + if (aud->u.umts.ind_bitlen) + Pf(u.umts.ind_bitlen, "%u"); + break; + default: + OSMO_ASSERT(false); + } + + fprintf(stderr, "}\n"); + +#undef Pf +#undef Phex +} + +static const char *imsi0 = "123456789000000"; +static const char *imsi1 = "123456789000001"; +static const char *imsi2 = "123456789000002"; +static const char *short_imsi = "123456"; +static const char *unknown_imsi = "999999999"; + +static void test_subscr_create_update_sel_delete() +{ + int64_t id0, id1, id2, id_short; + comment_start(); + + comment("Create with valid / invalid IMSI"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + id0 = g_subscr.id; + ASSERT_RC(db_subscr_create(dbc, imsi1), 0); + ASSERT_SEL(imsi, imsi1, 0); + id1 = g_subscr.id; + ASSERT_RC(db_subscr_create(dbc, imsi2), 0); + ASSERT_SEL(imsi, imsi2, 0); + id2 = g_subscr.id; + ASSERT_RC(db_subscr_create(dbc, imsi0), -EIO); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_create(dbc, imsi1), -EIO); + ASSERT_RC(db_subscr_create(dbc, imsi1), -EIO); + ASSERT_SEL(imsi, imsi1, 0); + ASSERT_RC(db_subscr_create(dbc, imsi2), -EIO); + ASSERT_RC(db_subscr_create(dbc, imsi2), -EIO); + ASSERT_SEL(imsi, imsi2, 0); + + ASSERT_RC(db_subscr_create(dbc, "123456789 000003"), -EINVAL); + ASSERT_SEL(imsi, "123456789000003", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, "123456789000002123456"), -EINVAL); + ASSERT_SEL(imsi, "123456789000002123456", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, "foobar123"), -EINVAL); + ASSERT_SEL(imsi, "foobar123", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, "123"), -EINVAL); + ASSERT_SEL(imsi, "123", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, short_imsi), 0); + ASSERT_SEL(imsi, short_imsi, 0); + id_short = g_subscr.id; + + + comment("Set valid / invalid MSISDN"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321"), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "54321012345678912345678"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "543 21"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "foobar123"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "5"), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "543210123456789"), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "5432101234567891"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Set MSISDN on non-existent / invalid IMSI"); + + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99"), -ENOENT); + + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99"), -ENOENT); + + comment("Delete non-existent / invalid IDs"); + + ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); + ASSERT_RC(db_subscr_delete_by_id(dbc, -10), -ENOENT); + + comment("Delete subscribers"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id0), 0); + ASSERT_SEL(imsi, imsi0, -ENOEXEC); + ASSERT_RC(db_subscr_delete_by_id(dbc, id0), -ENOENT); + + ASSERT_SEL(imsi, imsi1, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id1), 0); + ASSERT_SEL(imsi, imsi1, -ENOEXEC); + + ASSERT_SEL(imsi, imsi2, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id2), 0); + ASSERT_SEL(imsi, imsi2, -ENOEXEC); + + ASSERT_SEL(imsi, short_imsi, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id_short), 0); + ASSERT_SEL(imsi, short_imsi, -ENOEXEC); + + comment_end(); +} + +static struct { + bool verbose; +} cmdline_opts = { + .verbose = false, +}; + +static void print_help(const char *program) +{ + printf("Usage:\n" + " %s [-v] [N [N...]]\n" + "Options:\n" + " -h --help show this text.\n" + " -v --verbose print source file and line numbers\n", + program + ); +} + +static void handle_options(int argc, char **argv) +{ + while (1) { + int option_index = 0, c; + static struct option long_options[] = { + {"help", 0, 0, 'h'}, + {"verbose", 1, 0, 'v'}, + {0, 0, 0, 0} + }; + + c = getopt_long(argc, argv, "hv", + long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_help(argv[0]); + exit(0); + case 'v': + cmdline_opts.verbose = true; + break; + default: + /* catch unknown options *as well as* missing arguments. */ + fprintf(stderr, "Error in command line options. Exiting.\n"); + exit(-1); + break; + } + } + + if (optind < argc) { + fprintf(stderr, "too many args\n"); + exit(-1); + } +} + +int main(int argc, char **argv) +{ + printf("db_test.c\n"); + + ctx = talloc_named_const(NULL, 1, "db_test"); + + handle_options(argc, argv); + + osmo_init_logging(&hlr_log_info); + log_set_print_filename(osmo_stderr_target, cmdline_opts.verbose); + log_set_print_timestamp(osmo_stderr_target, 0); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_category(osmo_stderr_target, 1); + + /* omit the SQLite version and compilation flags from test output */ + log_set_log_level(osmo_stderr_target, LOGL_ERROR); + dbc = db_open(ctx, "db_test.db"); + log_set_log_level(osmo_stderr_target, 0); + OSMO_ASSERT(dbc); + + test_subscr_create_update_sel_delete(); + + printf("Done\n"); + return 0; +} + +/* stubs */ +int auc_compute_vectors(struct osmo_auth_vector *vec, unsigned int num_vec, + struct osmo_sub_auth_data *aud2g, + struct osmo_sub_auth_data *aud3g, + const uint8_t *rand_auts, const uint8_t *auts) +{ OSMO_ASSERT(false); return -1; } diff --git a/tests/db/db_test.err b/tests/db/db_test.err new file mode 100644 index 0000000..ac0e2f1 --- /dev/null +++ b/tests/db/db_test.err @@ -0,0 +1,251 @@ + +===== test_subscr_create_update_sel_delete + +--- Create with valid / invalid IMSI + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_create(dbc, imsi1) --> 0 + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 2, + .imsi = '123456789000001', +} + +db_subscr_create(dbc, imsi2) --> 0 + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 3, + .imsi = '123456789000002', +} + +db_subscr_create(dbc, imsi0) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000000': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_create(dbc, imsi1) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_create(dbc, imsi1) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 2, + .imsi = '123456789000001', +} + +db_subscr_create(dbc, imsi2) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_create(dbc, imsi2) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 3, + .imsi = '123456789000002', +} + +db_subscr_create(dbc, "123456789 000003") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: '123456789 000003' + +db_subscr_get_by_imsi(dbc, "123456789000003", &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000003': Error executing SQL: 101 + +db_subscr_create(dbc, "123456789000002123456") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: '123456789000002123456' + +db_subscr_get_by_imsi(dbc, "123456789000002123456", &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000002123456': Error executing SQL: 101 + +db_subscr_create(dbc, "foobar123") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: 'foobar123' + +db_subscr_get_by_imsi(dbc, "foobar123", &g_subscr) --> -ENOEXEC +DAUC IMSI='foobar123': Error executing SQL: 101 + +db_subscr_create(dbc, "123") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: '123' + +db_subscr_get_by_imsi(dbc, "123", &g_subscr) --> -ENOEXEC +DAUC IMSI='123': Error executing SQL: 101 + +db_subscr_create(dbc, short_imsi) --> 0 + +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 4, + .imsi = '123456', +} + + +--- Set valid / invalid MSISDN + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321") --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321012345678912345678") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '54321012345678912345678' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543 21") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '543 21' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "foobar123") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: 'foobar123' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5") --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '5', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543210123456789") --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5432101234567891") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '5432101234567891' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Set MSISDN on non-existent / invalid IMSI + +db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99") --> -ENOENT +DAUC Cannot update MSISDN: no such subscriber: IMSI='999999999' + +db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99") --> -ENOENT +DAUC Cannot update MSISDN: no such subscriber: IMSI='foobar' + + +--- Delete non-existent / invalid IDs + +db_subscr_delete_by_id(dbc, 999) --> -ENOENT +DAUC Cannot delete: no such subscriber: ID=999 + +db_subscr_delete_by_id(dbc, -10) --> -ENOENT +DAUC Cannot delete: no such subscriber: ID=-10 + + +--- Delete subscribers + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_delete_by_id(dbc, id0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000000': Error executing SQL: 101 + +db_subscr_delete_by_id(dbc, id0) --> -ENOENT +DAUC Cannot delete: no such subscriber: ID=1 + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 2, + .imsi = '123456789000001', +} + +db_subscr_delete_by_id(dbc, id1) --> 0 + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000001': Error executing SQL: 101 + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 3, + .imsi = '123456789000002', +} + +db_subscr_delete_by_id(dbc, id2) --> 0 + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000002': Error executing SQL: 101 + +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 4, + .imsi = '123456', +} + +db_subscr_delete_by_id(dbc, id_short) --> 0 + +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456': Error executing SQL: 101 + +===== test_subscr_create_update_sel_delete: SUCCESS + diff --git a/tests/db/db_test.ok b/tests/db/db_test.ok new file mode 100644 index 0000000..26cefd1 --- /dev/null +++ b/tests/db/db_test.ok @@ -0,0 +1,2 @@ +db_test.c +Done diff --git a/tests/testsuite.at b/tests/testsuite.at index a969082..74179e7 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -21,3 +21,11 @@ cat $abs_srcdir/gsup_server/gsup_server_test.err > experr AT_CHECK([$abs_top_builddir/tests/gsup_server/gsup_server_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([db]) +AT_KEYWORDS([db]) +cat $abs_srcdir/db/db_test.ok > expout +cat $abs_srcdir/db/db_test.err > experr +sqlite3 db_test.db < $abs_top_srcdir/sql/hlr.sql +AT_CHECK([$abs_top_builddir/tests/db/db_test], [], [expout], [experr]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2a0d277f55162bf5ceb0fc7d50390f2994daed71 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: less noise: simplify db_remove_reset() In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4179 to look at the new patch set (#3). less noise: simplify db_remove_reset() db_remove_reset() needs to be called after each stmt run, whether it succeeded or not. In case sqlite3_clear_bindings() would fail to unbind a stmt, we would anyway be beyond recovery. There seem to be no plausible situations where such failure would occur, unless there have been no bindings in the first place. In case there was an SQL stmt failure, sqlite3_reset() will re-barf the same error message, we will always have logged it earlier already in the proper context. We are never evaluating the return value, nor would we know how to recover from non-success. The conclusions: - db_remove_reset() does not need to log any errors. - db_remove_reset() does not need to return success. Change-Id: I21678463e59f607f5f5c5732963e274392f0fffd --- M src/db.c M src/db.h M tests/db/db_test.err 3 files changed, 4 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/4179/3 diff --git a/src/db.c b/src/db.c index 7c25e63..179eba8 100644 --- a/src/db.c +++ b/src/db.c @@ -70,20 +70,10 @@ } /* remove bindings and reset statement to be re-executed */ -bool db_remove_reset(sqlite3_stmt *stmt) +void db_remove_reset(sqlite3_stmt *stmt) { - int rc = sqlite3_clear_bindings(stmt); - if (rc != SQLITE_OK) { - LOGP(DDB, LOGL_ERROR, "Error clerearing bindings: %d\n", rc); - return false; - } - - rc = sqlite3_reset(stmt); - if (rc != SQLITE_OK) { - LOGP(DDB, LOGL_ERROR, "Error in sqlite3_reset: %d\n", rc); - return false; - } - return true; + sqlite3_clear_bindings(stmt); + sqlite3_reset(stmt); } /** bind text arg and do proper cleanup in case of failure. If param_name is diff --git a/src/db.h b/src/db.h index d7a8303..ee2d801 100644 --- a/src/db.h +++ b/src/db.h @@ -25,7 +25,7 @@ sqlite3_stmt *stmt[_NUM_DB_STMT]; }; -bool db_remove_reset(sqlite3_stmt *stmt); +void db_remove_reset(sqlite3_stmt *stmt); bool db_bind_text(sqlite3_stmt *stmt, const char *param_name, const char *text); bool db_bind_int(sqlite3_stmt *stmt, const char *param_name, int nr); bool db_bind_int64(sqlite3_stmt *stmt, const char *param_name, int64_t nr); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index ac0e2f1..1b08cec 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -29,7 +29,6 @@ db_subscr_create(dbc, imsi0) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000000': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 @@ -40,12 +39,10 @@ db_subscr_create(dbc, imsi1) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_create(dbc, imsi1) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 @@ -56,12 +53,10 @@ db_subscr_create(dbc, imsi2) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_create(dbc, imsi2) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 -- To view, visit https://gerrit.osmocom.org/4179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I21678463e59f607f5f5c5732963e274392f0fffd Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: db: use int64_t as subscriber id In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4180 to look at the new patch set (#3). db: use int64_t as subscriber id The SQLite db does not support uint64_t, and we are always binding the uint64_t id actually as signed int64_t. Hence be consistent and actually handle it as int64_t in the code as well. This means that if we ever see a negative subscriber ID in the SQL database (however unlikely), we will also see it negative in our log output. The SQN handled in osmo_auth* is actually of unsigned type, and, unless we store the SQN as 64bit hex string, we are forced to feed this unsigned value as signed int64_t to the SQLite API. The upcoming db regression test for SQN in change-id I0d870d405e2e0a830360d9ad19f0a3f9e09d8cf2 verifies that the SQN uint64_t translates to signed int64_t and back as expected. Change-Id: I83a47289a48ac37da0f712845d422e897a5e8171 --- M src/db.h M src/db_auc.c 2 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/80/4180/3 diff --git a/src/db.h b/src/db.h index ee2d801..761d88e 100644 --- a/src/db.h +++ b/src/db.h @@ -38,9 +38,9 @@ int db_get_auth_data(struct db_context *dbc, const char *imsi, struct osmo_sub_auth_data *aud2g, struct osmo_sub_auth_data *aud3g, - uint64_t *suscr_id); + int64_t *subscr_id); -int db_update_sqn(struct db_context *dbc, uint64_t id, +int db_update_sqn(struct db_context *dbc, int64_t id, uint64_t new_sqn); int db_get_auc(struct db_context *dbc, const char *imsi, @@ -57,7 +57,7 @@ struct hlr_subscriber { struct llist_head list; - uint64_t id; + int64_t id; char imsi[GSM23003_IMSI_MAX_DIGITS+1]; char msisdn[GT_MAX_DIGITS+1]; /* imeisv? */ diff --git a/src/db_auc.c b/src/db_auc.c index 7aad06d..71c7262 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -33,7 +33,7 @@ #define LOGAUC(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) /* update the SQN for a given subscriber ID */ -int db_update_sqn(struct db_context *dbc, uint64_t id, +int db_update_sqn(struct db_context *dbc, int64_t id, uint64_t new_sqn) { sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_UPD_SQN]; @@ -77,7 +77,7 @@ int db_get_auth_data(struct db_context *dbc, const char *imsi, struct osmo_sub_auth_data *aud2g, struct osmo_sub_auth_data *aud3g, - uint64_t *subscr_id) + int64_t *subscr_id) { sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_BY_IMSI]; int ret = 0; @@ -192,7 +192,7 @@ const uint8_t *auts) { struct osmo_sub_auth_data aud2g, aud3g; - uint64_t subscr_id; + int64_t subscr_id; int ret = 0; int rc; -- To view, visit https://gerrit.osmocom.org/4180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I83a47289a48ac37da0f712845d422e897a5e8171 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: add db_subscr_get_by_msisdn() and db_subscr_get_by_id() In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4181 to look at the new patch set (#3). add db_subscr_get_by_msisdn() and db_subscr_get_by_id() Factor out the selected SQL columns as SEL_COLUMNS macro, so that each of the new DB_STMTs will select identical columns: the old DB_STMT_SEL_BY_IMSI as well as the new DB_STMT_SEL_BY_MSISDN and DB_STMT_SEL_BY_ID. Add the new functions db_subscr_get_by_msisdn() and db_subscr_get_by_id() and factor out common parts with db_subscr_get_by_imsi() to static db_sel(). Change-Id: I6d0ddd1b7e3f6b180b4b1b2663c5725d2a4a9428 --- M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 5 files changed, 185 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/81/4181/3 diff --git a/src/db.c b/src/db.c index 179eba8..5a38d55 100644 --- a/src/db.c +++ b/src/db.c @@ -26,8 +26,25 @@ #include "logging.h" #include "db.h" +#define SEL_COLUMNS \ + "id," \ + "imsi," \ + "msisdn," \ + "vlr_number," \ + "sgsn_number," \ + "sgsn_address," \ + "periodic_lu_tmr," \ + "periodic_rau_tau_tmr," \ + "nam_cs," \ + "nam_ps," \ + "lmsi," \ + "ms_purged_cs," \ + "ms_purged_ps" + static const char *stmt_sql[] = { - [DB_STMT_SEL_BY_IMSI] = "SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?", + [DB_STMT_SEL_BY_IMSI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE imsi = ?", + [DB_STMT_SEL_BY_MSISDN] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE msisdn = ?", + [DB_STMT_SEL_BY_ID] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE id = ?", [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", [DB_STMT_AUC_BY_IMSI] = diff --git a/src/db.h b/src/db.h index 761d88e..5ec7b72 100644 --- a/src/db.h +++ b/src/db.h @@ -5,6 +5,8 @@ enum stmt_idx { DB_STMT_SEL_BY_IMSI, + DB_STMT_SEL_BY_MSISDN, + DB_STMT_SEL_BY_ID, DB_STMT_UPD_VLR_BY_ID, DB_STMT_UPD_SGSN_BY_ID, DB_STMT_AUC_BY_IMSI, @@ -84,6 +86,10 @@ int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr); +int db_subscr_get_by_msisdn(struct db_context *dbc, const char *msisdn, + struct hlr_subscriber *subscr); +int db_subscr_get_by_id(struct db_context *dbc, int64_t id, + struct hlr_subscriber *subscr); int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable); int db_subscr_lu(struct db_context *dbc, const struct hlr_subscriber *subscr, diff --git a/src/db_hlr.c b/src/db_hlr.c index b232dfd..8df4bcb 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -154,27 +154,26 @@ } -int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, - struct hlr_subscriber *subscr) +/* Common code for db_subscr_get_by_*() functions. */ +static int db_sel(struct db_context *dbc, sqlite3_stmt *stmt, struct hlr_subscriber *subscr, + const char **err) { - sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; int rc; - - if (!db_bind_text(stmt, NULL, imsi)) - return -EINVAL; + int ret = 0; /* execute the statement */ rc = sqlite3_step(stmt); + if (rc == SQLITE_DONE) { + ret = -ENOENT; + goto out; + } if (rc != SQLITE_ROW) { - LOGHLR(imsi, LOGL_ERROR, "Error executing SQL: %d\n", rc); - db_remove_reset(stmt); - return -ENOEXEC; + ret = -EIO; + goto out; } - if (!subscr) { - db_remove_reset(stmt); - return 0; - } + if (!subscr) + goto out; /* obtain the various columns */ subscr->id = sqlite3_column_int64(stmt, 0); @@ -192,9 +191,72 @@ subscr->ms_purged_cs = sqlite3_column_int(stmt, 11); subscr->ms_purged_ps = sqlite3_column_int(stmt, 12); +out: db_remove_reset(stmt); - return 0; + switch (ret) { + case 0: + *err = NULL; + break; + case -ENOENT: + *err = "No such subscriber"; + break; + default: + *err = sqlite3_errmsg(dbc->db); + break; + } + return ret; +} + +int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, + struct hlr_subscriber *subscr) +{ + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; + const char *err; + int rc; + + if (!db_bind_text(stmt, NULL, imsi)) + return -EIO; + + rc = db_sel(dbc, stmt, subscr, &err); + if (rc) + LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: IMSI='%s': %s\n", + imsi, err); + return rc; +} + +int db_subscr_get_by_msisdn(struct db_context *dbc, const char *msisdn, + struct hlr_subscriber *subscr) +{ + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_MSISDN]; + const char *err; + int rc; + + if (!db_bind_text(stmt, NULL, msisdn)) + return -EIO; + + rc = db_sel(dbc, stmt, subscr, &err); + if (rc) + LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: MSISDN='%s': %s\n", + msisdn, err); + return rc; +} + +int db_subscr_get_by_id(struct db_context *dbc, int64_t id, + struct hlr_subscriber *subscr) +{ + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_ID]; + const char *err; + int rc; + + if (!db_bind_int64(stmt, NULL, id)) + return -EIO; + + rc = db_sel(dbc, stmt, subscr, &err); + if (rc) + LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: ID=%"PRId64": %s\n", + id, err); + return rc; } int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable) diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 9bd082e..250b363 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -70,6 +70,7 @@ static void *ctx = NULL; static struct hlr_subscriber g_subscr; static int g_rc; +static int64_t g_id; #define Pfv(name, fmt, val) \ fprintf(stderr, " ." #name " = " fmt ",\n", val) @@ -186,16 +187,16 @@ ASSERT_SEL(imsi, imsi2, 0); ASSERT_RC(db_subscr_create(dbc, "123456789 000003"), -EINVAL); - ASSERT_SEL(imsi, "123456789000003", -ENOEXEC); + ASSERT_SEL(imsi, "123456789000003", -ENOENT); ASSERT_RC(db_subscr_create(dbc, "123456789000002123456"), -EINVAL); - ASSERT_SEL(imsi, "123456789000002123456", -ENOEXEC); + ASSERT_SEL(imsi, "123456789000002123456", -ENOENT); ASSERT_RC(db_subscr_create(dbc, "foobar123"), -EINVAL); - ASSERT_SEL(imsi, "foobar123", -ENOEXEC); + ASSERT_SEL(imsi, "foobar123", -ENOENT); ASSERT_RC(db_subscr_create(dbc, "123"), -EINVAL); - ASSERT_SEL(imsi, "123", -ENOEXEC); + ASSERT_SEL(imsi, "123", -ENOENT); ASSERT_RC(db_subscr_create(dbc, short_imsi), 0); ASSERT_SEL(imsi, short_imsi, 0); @@ -207,30 +208,41 @@ ASSERT_SEL(imsi, imsi0, 0); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321"), 0); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "54321", 0); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321012345678912345678"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "54321", 0); + ASSERT_SEL(msisdn, "54321012345678912345678", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543 21"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "543 21", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "foobar123"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "foobar123", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5"), 0); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "5", 0); + ASSERT_SEL(msisdn, "54321", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543210123456789"), 0); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "543210123456789", 0); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5432101234567891"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "5432101234567891", -ENOENT); comment("Set MSISDN on non-existent / invalid IMSI"); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99"), -ENOENT); + ASSERT_SEL(msisdn, "99", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99"), -ENOENT); + ASSERT_SEL(msisdn, "99", -ENOENT); comment("Delete non-existent / invalid IDs"); @@ -241,20 +253,20 @@ ASSERT_SEL(imsi, imsi0, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id0), 0); - ASSERT_SEL(imsi, imsi0, -ENOEXEC); + ASSERT_SEL(imsi, imsi0, -ENOENT); ASSERT_RC(db_subscr_delete_by_id(dbc, id0), -ENOENT); ASSERT_SEL(imsi, imsi1, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id1), 0); - ASSERT_SEL(imsi, imsi1, -ENOEXEC); + ASSERT_SEL(imsi, imsi1, -ENOENT); ASSERT_SEL(imsi, imsi2, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id2), 0); - ASSERT_SEL(imsi, imsi2, -ENOEXEC); + ASSERT_SEL(imsi, imsi2, -ENOENT); ASSERT_SEL(imsi, short_imsi, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id_short), 0); - ASSERT_SEL(imsi, short_imsi, -ENOEXEC); + ASSERT_SEL(imsi, short_imsi, -ENOENT); comment_end(); } diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 1b08cec..17323b5 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -68,26 +68,26 @@ db_subscr_create(dbc, "123456789 000003") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123456789 000003' -db_subscr_get_by_imsi(dbc, "123456789000003", &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000003': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "123456789000003", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000003': No such subscriber db_subscr_create(dbc, "123456789000002123456") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123456789000002123456' -db_subscr_get_by_imsi(dbc, "123456789000002123456", &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000002123456': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "123456789000002123456", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000002123456': No such subscriber db_subscr_create(dbc, "foobar123") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: 'foobar123' -db_subscr_get_by_imsi(dbc, "foobar123", &g_subscr) --> -ENOEXEC -DAUC IMSI='foobar123': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "foobar123", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='foobar123': No such subscriber db_subscr_create(dbc, "123") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123' -db_subscr_get_by_imsi(dbc, "123", &g_subscr) --> -ENOEXEC -DAUC IMSI='123': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "123", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123': No such subscriber db_subscr_create(dbc, short_imsi) --> 0 @@ -115,6 +115,13 @@ .msisdn = '54321', } +db_subscr_get_by_msisdn(dbc, "54321", &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321012345678912345678") --> -EINVAL DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '54321012345678912345678' @@ -124,6 +131,16 @@ .imsi = '123456789000000', .msisdn = '54321', } + +db_subscr_get_by_msisdn(dbc, "54321", &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_get_by_msisdn(dbc, "54321012345678912345678", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='54321012345678912345678': No such subscriber db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543 21") --> -EINVAL DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '543 21' @@ -135,6 +152,9 @@ .msisdn = '54321', } +db_subscr_get_by_msisdn(dbc, "543 21", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='543 21': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "foobar123") --> -EINVAL DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: 'foobar123' @@ -145,6 +165,9 @@ .msisdn = '54321', } +db_subscr_get_by_msisdn(dbc, "foobar123", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='foobar123': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5") --> 0 db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 @@ -154,9 +177,26 @@ .msisdn = '5', } +db_subscr_get_by_msisdn(dbc, "5", &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '5', +} + +db_subscr_get_by_msisdn(dbc, "54321", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='54321': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543210123456789") --> 0 db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_get_by_msisdn(dbc, "543210123456789", &g_subscr) --> 0 struct hlr_subscriber { .id = 1, .imsi = '123456789000000', @@ -173,14 +213,23 @@ .msisdn = '543210123456789', } +db_subscr_get_by_msisdn(dbc, "5432101234567891", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='5432101234567891': No such subscriber + --- Set MSISDN on non-existent / invalid IMSI db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99") --> -ENOENT DAUC Cannot update MSISDN: no such subscriber: IMSI='999999999' +db_subscr_get_by_msisdn(dbc, "99", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='99': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99") --> -ENOENT DAUC Cannot update MSISDN: no such subscriber: IMSI='foobar' + +db_subscr_get_by_msisdn(dbc, "99", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='99': No such subscriber --- Delete non-existent / invalid IDs @@ -203,8 +252,8 @@ db_subscr_delete_by_id(dbc, id0) --> 0 -db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000000': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber db_subscr_delete_by_id(dbc, id0) --> -ENOENT DAUC Cannot delete: no such subscriber: ID=1 @@ -217,8 +266,8 @@ db_subscr_delete_by_id(dbc, id1) --> 0 -db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000001': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000001': No such subscriber db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 struct hlr_subscriber { @@ -228,8 +277,8 @@ db_subscr_delete_by_id(dbc, id2) --> 0 -db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000002': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000002': No such subscriber db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> 0 struct hlr_subscriber { @@ -239,8 +288,8 @@ db_subscr_delete_by_id(dbc, id_short) --> 0 -db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456': No such subscriber ===== test_subscr_create_update_sel_delete: SUCCESS -- To view, visit https://gerrit.osmocom.org/4181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6d0ddd1b7e3f6b180b4b1b2663c5725d2a4a9428 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: refactor db_subscr_ps() to db_subscr_nam() In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4182 to look at the new patch set (#3). refactor db_subscr_ps() to db_subscr_nam() Allow to set nam_ps and nam_cs from this same function, by adding the is_ps arg. Combine both NAM_PS stmts to DB_STMT_UPD_NAM_PS_BY_IMSI, add another such stmt for CS. Use named parameters instead of parameter indexes. Improve error return values as well as error logging to clearly indicate whether the operation could not find the requested IMSI, or other errors occured. Adjust the single caller. This prepares for upcoming VTY and possibly CTRL commands, and the error handling introduced here has been or will be adopted by other functions in previous or subsequent patches. Change-Id: I6e70e15228f5bb10bee6758ae5dc9687d65839bd --- M src/ctrl.c M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 6 files changed, 230 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/82/4182/3 diff --git a/src/ctrl.c b/src/ctrl.c index b034cd7..8682e14 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -43,7 +43,7 @@ return CTRL_CMD_ERROR; } - if (db_subscr_ps(ctx->dbc, cmd->value, enable) < 0) { + if (db_subscr_nam(ctx->dbc, cmd->value, enable, true) < 0) { cmd->reply = "Error updating DB"; return CTRL_CMD_ERROR; } diff --git a/src/db.c b/src/db.c index 5a38d55..8286ba8 100644 --- a/src/db.c +++ b/src/db.c @@ -56,8 +56,8 @@ [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", - [DB_STMT_SET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=1 WHERE imsi = ?", - [DB_STMT_UNSET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=0 WHERE imsi = ?", + [DB_STMT_UPD_NAM_CS_BY_IMSI] = "UPDATE subscriber SET nam_cs = $val WHERE imsi = $imsi", + [DB_STMT_UPD_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps = $val WHERE imsi = $imsi", [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id", [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi", diff --git a/src/db.h b/src/db.h index 5ec7b72..5e234ff 100644 --- a/src/db.h +++ b/src/db.h @@ -13,8 +13,8 @@ DB_STMT_AUC_UPD_SQN, DB_STMT_UPD_PURGE_CS_BY_IMSI, DB_STMT_UPD_PURGE_PS_BY_IMSI, - DB_STMT_SET_NAM_PS_BY_IMSI, - DB_STMT_UNSET_NAM_PS_BY_IMSI, + DB_STMT_UPD_NAM_PS_BY_IMSI, + DB_STMT_UPD_NAM_CS_BY_IMSI, DB_STMT_SUBSCR_CREATE, DB_STMT_DEL_BY_ID, DB_STMT_SET_MSISDN_BY_IMSI, @@ -90,7 +90,7 @@ struct hlr_subscriber *subscr); int db_subscr_get_by_id(struct db_context *dbc, int64_t id, struct hlr_subscriber *subscr); -int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable); +int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps); int db_subscr_lu(struct db_context *dbc, const struct hlr_subscriber *subscr, const char *vlr_or_sgsn_number, diff --git a/src/db_hlr.c b/src/db_hlr.c index 8df4bcb..9bdb372 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -259,31 +259,58 @@ return rc; } -int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable) +/* Enable or disable PS or CS for a subscriber. + * For the subscriber with the given imsi, set nam_ps (when is_ps == true) or + * nam_cs (when is_ps == false) to nam_val in the database. + * Returns 0 on success, -ENOENT when the given IMSI does not exist, -EINVAL if + * the SQL statement could not be composed, -ENOEXEC if running the SQL + * statement failed, -EIO if the amount of rows modified is unexpected. + */ +int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps) { - sqlite3_stmt *stmt = - dbc->stmt[enable ? DB_STMT_SET_NAM_PS_BY_IMSI : DB_STMT_UNSET_NAM_PS_BY_IMSI]; + sqlite3_stmt *stmt; int rc; + int ret = 0; - if (!db_bind_text(stmt, NULL, imsi)) - return -EINVAL; + stmt = dbc->stmt[is_ps ? DB_STMT_UPD_NAM_PS_BY_IMSI + : DB_STMT_UPD_NAM_CS_BY_IMSI]; - rc = sqlite3_step(stmt); /* execute the statement */ + if (!db_bind_text(stmt, "$imsi", imsi)) + return -EIO; + if (!db_bind_int(stmt, "$val", nam_val ? 1 : 0)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGHLR(imsi, LOGL_ERROR, "Error executing SQL: %d\n", rc); - db_remove_reset(stmt); - return -ENOEXEC; + LOGHLR(imsi, LOGL_ERROR, "%s %s: SQL error: %s\n", + nam_val ? "enable" : "disable", + is_ps ? "PS" : "CS", + sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } - rc = sqlite3_changes(dbc->db); /* verify execution result */ - if (rc != 1) { - LOGHLR(imsi, LOGL_ERROR, "SQL modified %d rows (expected 1)\n", + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot %s %s: no such subscriber: IMSI='%s'\n", + nam_val ? "enable" : "disable", + is_ps ? "PS" : "CS", + imsi); + ret = -ENOENT; + goto out; + } else if (rc != 1) { + LOGHLR(imsi, LOGL_ERROR, "%s %s: SQL modified %d rows (expected 1)\n", + nam_val ? "enable" : "disable", + is_ps ? "PS" : "CS", rc); - rc = -EINVAL; + ret = -EIO; } +out: db_remove_reset(stmt); - return rc; + return ret; } int db_subscr_lu(struct db_context *dbc, diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 250b363..30de51d 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -244,6 +244,45 @@ ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99"), -ENOENT); ASSERT_SEL(msisdn, "99", -ENOENT); + comment("Set / unset nam_cs and nam_ps"); + + /* nam_val, is_ps */ + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Set / unset nam_cs and nam_ps *again*"); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Set nam_cs and nam_ps on non-existent / invalid IMSI"); + + ASSERT_RC(db_subscr_nam(dbc, unknown_imsi, false, true), -ENOENT); + ASSERT_RC(db_subscr_nam(dbc, unknown_imsi, false, false), -ENOENT); + ASSERT_SEL(imsi, unknown_imsi, -ENOENT); + + ASSERT_RC(db_subscr_nam(dbc, "foobar", false, true), -ENOENT); + ASSERT_RC(db_subscr_nam(dbc, "foobar", false, false), -ENOENT); + comment("Delete non-existent / invalid IDs"); ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 17323b5..f7c03d9 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -232,6 +232,150 @@ DAUC Cannot read subscriber from db: MSISDN='99': No such subscriber +--- Set / unset nam_cs and nam_ps + +db_subscr_nam(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Set / unset nam_cs and nam_ps *again* + +db_subscr_nam(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, +} + +db_subscr_nam(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, +} + +db_subscr_nam(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_nam(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Set nam_cs and nam_ps on non-existent / invalid IMSI + +db_subscr_nam(dbc, unknown_imsi, false, true) --> -ENOENT +DAUC Cannot disable PS: no such subscriber: IMSI='999999999' + +db_subscr_nam(dbc, unknown_imsi, false, false) --> -ENOENT +DAUC Cannot disable CS: no such subscriber: IMSI='999999999' + +db_subscr_get_by_imsi(dbc, unknown_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='999999999': No such subscriber + +db_subscr_nam(dbc, "foobar", false, true) --> -ENOENT +DAUC Cannot disable PS: no such subscriber: IMSI='foobar' + +db_subscr_nam(dbc, "foobar", false, false) --> -ENOENT +DAUC Cannot disable CS: no such subscriber: IMSI='foobar' + + --- Delete non-existent / invalid IDs db_subscr_delete_by_id(dbc, 999) --> -ENOENT -- To view, visit https://gerrit.osmocom.org/4182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e70e15228f5bb10bee6758ae5dc9687d65839bd Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: refactor db_subscr_lu() In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4183 to look at the new patch set (#3). refactor db_subscr_lu() Use named parameters in the SQL statement. Use db_bind_* functions to drop some code dup. Use explicit subscriber id arg instead of subscriber struct. Match return values and error logging to other db functions. Change-Id: I35665e84ddbe54a6f218b24033df969ad2e669a0 --- M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 5 files changed, 206 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/83/4183/3 diff --git a/src/db.c b/src/db.c index 8286ba8..eb29434 100644 --- a/src/db.c +++ b/src/db.c @@ -45,8 +45,8 @@ [DB_STMT_SEL_BY_IMSI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE imsi = ?", [DB_STMT_SEL_BY_MSISDN] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE msisdn = ?", [DB_STMT_SEL_BY_ID] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE id = ?", - [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", - [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", + [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = $number WHERE id = $subscriber_id", + [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = $number WHERE id = $subscriber_id", [DB_STMT_AUC_BY_IMSI] = "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, ind_bitlen" " FROM subscriber" diff --git a/src/db.h b/src/db.h index 5e234ff..9d4274d 100644 --- a/src/db.h +++ b/src/db.h @@ -91,10 +91,8 @@ int db_subscr_get_by_id(struct db_context *dbc, int64_t id, struct hlr_subscriber *subscr); int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps); -int db_subscr_lu(struct db_context *dbc, - const struct hlr_subscriber *subscr, - const char *vlr_or_sgsn_number, - bool lu_is_ps); +int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, + const char *vlr_or_sgsn_number, bool is_ps); int db_subscr_purge(struct db_context *dbc, const char *imsi, bool is_ps); diff --git a/src/db_hlr.c b/src/db_hlr.c index 9bdb372..ac3c730 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -313,44 +313,46 @@ return ret; } -int db_subscr_lu(struct db_context *dbc, - const struct hlr_subscriber *subscr, - const char *vlr_or_sgsn_number, bool lu_is_ps) +int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, + const char *vlr_or_sgsn_number, bool is_ps) { - sqlite3_stmt *stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; - const char *txt; + sqlite3_stmt *stmt; int rc, ret = 0; - if (lu_is_ps) { - stmt = dbc->stmt[DB_STMT_UPD_SGSN_BY_ID]; - txt = subscr->sgsn_number; - } else { - stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; - txt = subscr->vlr_number; - } + stmt = dbc->stmt[is_ps ? DB_STMT_UPD_SGSN_BY_ID + : DB_STMT_UPD_VLR_BY_ID]; - rc = sqlite3_bind_int64(stmt, 1, subscr->id); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding ID: %d\n", rc); - return -EINVAL; - } + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; - rc = sqlite3_bind_text(stmt, 2, txt, -1, SQLITE_STATIC); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding VLR/SGSN Number: %d\n", rc); - ret = -EBADMSG; - goto out; - } + if (!db_bind_text(stmt, "$number", vlr_or_sgsn_number)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGP(DAUC, LOGL_ERROR, "Error updating SQN: %d\n", rc); - ret = -ENOEXEC; + LOGP(DAUC, LOGL_ERROR, "Update %s number for subscriber ID=%"PRId64": SQL Error: %s\n", + is_ps? "SGSN" : "VLR", subscr_id, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } + + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot update %s number for subscriber ID=%"PRId64 + ": no such subscriber\n", + is_ps? "SGSN" : "VLR", subscr_id); + ret = -ENOENT; + } else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Update %s number for subscriber ID=%"PRId64 + ": SQL modified %d rows (expected 1)\n", + is_ps? "SGSN" : "VLR", subscr_id, rc); + ret = -EIO; + } + out: db_remove_reset(stmt); - return ret; } diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 30de51d..5acd1e8 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -283,6 +283,43 @@ ASSERT_RC(db_subscr_nam(dbc, "foobar", false, true), -ENOENT); ASSERT_RC(db_subscr_nam(dbc, "foobar", false, false), -ENOENT); + comment("Record LU for PS and CS (SGSN and VLR names)"); + + ASSERT_RC(db_subscr_lu(dbc, id0, "5952", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "712", false), 0); + ASSERT_SEL(id, id0, 0); + + comment("Record LU for PS and CS (SGSN and VLR names) *again*"); + + ASSERT_RC(db_subscr_lu(dbc, id0, "111", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "111", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "222", false), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "222", false), 0); + ASSERT_SEL(id, id0, 0); + + comment("Unset LU info for PS and CS (SGSN and VLR names)"); + ASSERT_RC(db_subscr_lu(dbc, id0, "", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "", false), 0); + ASSERT_SEL(id, id0, 0); + + ASSERT_RC(db_subscr_lu(dbc, id0, "111", true), 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "222", false), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, NULL, true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, NULL, false), 0); + ASSERT_SEL(id, id0, 0); + + comment("Record LU for non-existent ID"); + ASSERT_RC(db_subscr_lu(dbc, 99999, "5952", true), -ENOENT); + ASSERT_RC(db_subscr_lu(dbc, 99999, "712", false), -ENOENT); + ASSERT_SEL(id, 99999, -ENOENT); + comment("Delete non-existent / invalid IDs"); ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index f7c03d9..6e6a0ac 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -376,6 +376,143 @@ DAUC Cannot disable CS: no such subscriber: IMSI='foobar' +--- Record LU for PS and CS (SGSN and VLR names) + +db_subscr_lu(dbc, id0, "5952", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .sgsn_number = '5952', +} + +db_subscr_lu(dbc, id0, "712", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '712', + .sgsn_number = '5952', +} + + +--- Record LU for PS and CS (SGSN and VLR names) *again* + +db_subscr_lu(dbc, id0, "111", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '712', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, "111", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '712', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, "222", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, "222", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', + .sgsn_number = '111', +} + + +--- Unset LU info for PS and CS (SGSN and VLR names) + +db_subscr_lu(dbc, id0, "", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', +} + +db_subscr_lu(dbc, id0, "", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_lu(dbc, id0, "111", true) --> 0 + +db_subscr_lu(dbc, id0, "222", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, NULL, true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', +} + +db_subscr_lu(dbc, id0, NULL, false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Record LU for non-existent ID + +db_subscr_lu(dbc, 99999, "5952", true) --> -ENOENT +DAUC Cannot update SGSN number for subscriber ID=99999: no such subscriber + +db_subscr_lu(dbc, 99999, "712", false) --> -ENOENT +DAUC Cannot update VLR number for subscriber ID=99999: no such subscriber + +db_subscr_get_by_id(dbc, 99999, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: ID=99999: No such subscriber + + --- Delete non-existent / invalid IDs db_subscr_delete_by_id(dbc, 999) --> -ENOENT -- To view, visit https://gerrit.osmocom.org/4183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I35665e84ddbe54a6f218b24033df969ad2e669a0 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: refactor db_subscr_purge In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4184 to look at the new patch set (#3). refactor db_subscr_purge Use named parameters in the SQL statements. Use db_bind_* functions to drop some code dup. Adopt error handling (rc and logging) to match the other db functions: return -ENOENT for unknown subscriber, -EIO for SQL failures. Change-Id: Iad49d29b90a708c6cf55bfb3bcc02d9e29001a15 --- M src/db.c M src/db.h M src/db_hlr.c M src/hlr.c M tests/db/db_test.c M tests/db/db_test.err 6 files changed, 214 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/84/4184/3 diff --git a/src/db.c b/src/db.c index eb29434..2b2c2c4 100644 --- a/src/db.c +++ b/src/db.c @@ -54,8 +54,8 @@ " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" " WHERE imsi = ?", [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", - [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", - [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", + [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs = $val WHERE imsi = $imsi", + [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps = $val WHERE imsi = $imsi", [DB_STMT_UPD_NAM_CS_BY_IMSI] = "UPDATE subscriber SET nam_cs = $val WHERE imsi = $imsi", [DB_STMT_UPD_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps = $val WHERE imsi = $imsi", [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", diff --git a/src/db.h b/src/db.h index 9d4274d..2e6cc9b 100644 --- a/src/db.h +++ b/src/db.h @@ -94,5 +94,5 @@ int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, const char *vlr_or_sgsn_number, bool is_ps); -int db_subscr_purge(struct db_context *dbc, - const char *imsi, bool is_ps); +int db_subscr_purge(struct db_context *dbc, const char *by_imsi, + bool purge_val, bool is_ps); diff --git a/src/db_hlr.c b/src/db_hlr.c index ac3c730..b6d224b 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -356,27 +356,49 @@ return ret; } -int db_subscr_purge(struct db_context *dbc, const char *imsi, bool is_ps) +int db_subscr_purge(struct db_context *dbc, const char *by_imsi, + bool purge_val, bool is_ps) { - sqlite3_stmt *stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; - int rc, ret = 1; + sqlite3_stmt *stmt; + int rc, ret = 0; - if (is_ps) - stmt = dbc->stmt[DB_STMT_UPD_PURGE_PS_BY_IMSI]; - else - stmt = dbc->stmt[DB_STMT_UPD_PURGE_CS_BY_IMSI]; + stmt = dbc->stmt[is_ps ? DB_STMT_UPD_PURGE_PS_BY_IMSI + : DB_STMT_UPD_PURGE_CS_BY_IMSI]; - if (!db_bind_text(stmt, NULL, imsi)) - return -EINVAL; + if (!db_bind_text(stmt, "$imsi", by_imsi)) + return -EIO; + if (!db_bind_int(stmt, "$val", purge_val ? 1 : 0)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGP(DAUC, LOGL_ERROR, "Error setting Purged: %d\n", rc); - ret = -ENOEXEC; + LOGP(DAUC, LOGL_ERROR, "%s %s: SQL error: %s\n", + purge_val ? "purge" : "un-purge", + is_ps ? "PS" : "CS", + sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } - /* FIXME: return 0 in case IMSI not known */ + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot %s %s: no such subscriber: IMSI='%s'\n", + purge_val ? "purge" : "un-purge", + is_ps ? "PS" : "CS", + by_imsi); + ret = -ENOENT; + goto out; + } else if (rc != 1) { + LOGHLR(by_imsi, LOGL_ERROR, "%s %s: SQL modified %d rows (expected 1)\n", + purge_val ? "purge" : "un-purge", + is_ps ? "PS" : "CS", + rc); + ret = -EIO; + } + +out: db_remove_reset(stmt); return ret; diff --git a/src/hlr.c b/src/hlr.c index 9e8b699..b32f709 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -221,7 +221,7 @@ * we have on record. Only update if yes */ /* Perform the actual update of the DB */ - rc = db_subscr_purge(g_hlr->dbc, gsup->imsi, is_ps); + rc = db_subscr_purge(g_hlr->dbc, gsup->imsi, true, is_ps); if (rc == 1) gsup_reply.message_type = OSMO_GSUP_MSGT_PURGE_MS_RESULT; diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 5acd1e8..20553ef 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -320,6 +320,44 @@ ASSERT_RC(db_subscr_lu(dbc, 99999, "712", false), -ENOENT); ASSERT_SEL(id, 99999, -ENOENT); + comment("Purge and un-purge PS and CS"); + + /* purge_val, is_ps */ + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Purge PS and CS *again*"); + + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Purge on non-existent / invalid IMSI"); + + ASSERT_RC(db_subscr_purge(dbc, unknown_imsi, true, true), -ENOENT); + ASSERT_SEL(imsi, unknown_imsi, -ENOENT); + ASSERT_RC(db_subscr_purge(dbc, unknown_imsi, true, false), -ENOENT); + ASSERT_SEL(imsi, unknown_imsi, -ENOENT); + comment("Delete non-existent / invalid IDs"); ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 6e6a0ac..59b9ba1 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -513,6 +513,143 @@ DAUC Cannot read subscriber from db: ID=99999: No such subscriber +--- Purge and un-purge PS and CS + +db_subscr_purge(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_cs = true, + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Purge PS and CS *again* + +db_subscr_purge(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_purge(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_purge(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_cs = true, +} + +db_subscr_purge(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_cs = true, +} + +db_subscr_purge(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_purge(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Purge on non-existent / invalid IMSI + +db_subscr_purge(dbc, unknown_imsi, true, true) --> -ENOENT +DAUC Cannot purge PS: no such subscriber: IMSI='999999999' + +db_subscr_get_by_imsi(dbc, unknown_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='999999999': No such subscriber + +db_subscr_purge(dbc, unknown_imsi, true, false) --> -ENOENT +DAUC Cannot purge CS: no such subscriber: IMSI='999999999' + +db_subscr_get_by_imsi(dbc, unknown_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='999999999': No such subscriber + + --- Delete non-existent / invalid IDs db_subscr_delete_by_id(dbc, 999) --> -ENOENT -- To view, visit https://gerrit.osmocom.org/4184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iad49d29b90a708c6cf55bfb3bcc02d9e29001a15 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: add db_subscr_update_aud_by_id(), complete db_subscr_delete_... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4185 to look at the new patch set (#4). add db_subscr_update_aud_by_id(), complete db_subscr_delete_by_id() Add ability to add and remove auc_2g and auc_3g table rows with db_subscr_update_aud_by_id(). In db_subscr_delete_by_id(), make sure that when deleting a subscriber, also all auth data associated with that user ID is removed as well. A newly created subscriber must not obtain the same auth tokens just by getting the same id. Depends: libosmocore Idf75946eb0a84e145adad13fc7c78bb7a267aa0a Change-Id: Icb11b5e059fb920447a9aa414db1819a0c020529 --- M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 5 files changed, 1,004 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/85/4185/4 diff --git a/src/db.c b/src/db.c index 2b2c2c4..4136e39 100644 --- a/src/db.c +++ b/src/db.c @@ -61,6 +61,14 @@ [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id", [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi", + [DB_STMT_AUC_2G_INSERT] = + "INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki)" + " VALUES($subscriber_id, $algo_id_2g, $ki)", + [DB_STMT_AUC_2G_DELETE] = "DELETE FROM auc_2g WHERE subscriber_id = $subscriber_id", + [DB_STMT_AUC_3G_INSERT] = + "INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, op, opc, ind_bitlen)" + " VALUES($subscriber_id, $algo_id_3g, $k, $op, $opc, $ind_bitlen)", + [DB_STMT_AUC_3G_DELETE] = "DELETE FROM auc_3g WHERE subscriber_id = $subscriber_id", }; static void sql3_error_log_cb(void *arg, int err_code, const char *msg) diff --git a/src/db.h b/src/db.h index 2e6cc9b..f6aaa58 100644 --- a/src/db.h +++ b/src/db.h @@ -18,6 +18,10 @@ DB_STMT_SUBSCR_CREATE, DB_STMT_DEL_BY_ID, DB_STMT_SET_MSISDN_BY_IMSI, + DB_STMT_AUC_2G_INSERT, + DB_STMT_AUC_2G_DELETE, + DB_STMT_AUC_3G_INSERT, + DB_STMT_AUC_3G_DELETE, _NUM_DB_STMT }; @@ -78,11 +82,36 @@ bool ms_purged_ps; }; +/* Like struct osmo_sub_auth_data, but the keys are in hexdump representation. + * This is useful because SQLite requires them in hexdump format, and callers + * like the VTY and CTRL interface also have them available as hexdump to begin + * with. In the binary format, a VTY command would first need to hexparse, + * after which the db function would again hexdump, copying to separate + * buffers. The roundtrip can be saved by providing char* to begin with. */ +struct sub_auth_data_str { + enum osmo_sub_auth_type type; + enum osmo_auth_algo algo; + union { + struct { + const char *opc; + const char *k; + uint64_t sqn; + int opc_is_op; + unsigned int ind_bitlen; + } umts; + struct { + const char *ki; + } gsm; + } u; +}; + int db_subscr_create(struct db_context *dbc, const char *imsi); int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id); int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, const char *msisdn); +int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id, + const struct sub_auth_data_str *aud); int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr); diff --git a/src/db_hlr.c b/src/db_hlr.c index b6d224b..71f682d 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -71,6 +71,7 @@ int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id) { int rc; + struct sub_auth_data_str aud; int ret = 0; sqlite3_stmt *stmt = dbc->stmt[DB_STMT_DEL_BY_ID]; @@ -99,10 +100,27 @@ ": SQL modified %d rows (expected 1)\n", subscr_id, rc); ret = -EIO; } - - /* FIXME: also remove authentication data from auc_2g and auc_3g */ - db_remove_reset(stmt); + + /* make sure to remove authentication data for this subscriber id, for + * both 2G and 3G. */ + + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_GSM, + .algo = OSMO_AUTH_ALG_NONE, + }; + rc = db_subscr_update_aud_by_id(dbc, subscr_id, &aud); + if (ret == -ENOENT && !rc) + ret = 0; + + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_NONE, + }; + rc = db_subscr_update_aud_by_id(dbc, subscr_id, &aud); + if (ret == -ENOENT && !rc) + ret = 0; + return ret; } @@ -154,6 +172,192 @@ } +/* Insert or update 2G or 3G authentication tokens in the database. + * If aud->type is OSMO_AUTH_TYPE_GSM, the auc_2g table entry for the + * subscriber will be added or modified; if aud->algo is OSMO_AUTH_ALG_NONE, + * however, the auc_2g entry for the subscriber is deleted. If aud->type is + * OSMO_AUTH_TYPE_UMTS, the auc_3g table is updated; again, if aud->algo is + * OSMO_AUTH_ALG_NONE, the auc_3g entry is deleted. + * Returns 0 if successful, -EINVAL for unknown aud->type, -ENOENT for unknown + * subscr_id, -EIO for SQL errors. + */ +int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id, + const struct sub_auth_data_str *aud) +{ + sqlite3_stmt *stmt_del; + sqlite3_stmt *stmt_ins; + sqlite3_stmt *stmt; + const char *label; + int rc; + int ret = 0; + + switch (aud->type) { + case OSMO_AUTH_TYPE_GSM: + label = "auc_2g"; + stmt_del = dbc->stmt[DB_STMT_AUC_2G_DELETE]; + stmt_ins = dbc->stmt[DB_STMT_AUC_2G_INSERT]; + + switch (aud->algo) { + case OSMO_AUTH_ALG_NONE: + case OSMO_AUTH_ALG_COMP128v1: + case OSMO_AUTH_ALG_COMP128v2: + case OSMO_AUTH_ALG_COMP128v3: + case OSMO_AUTH_ALG_XOR: + break; + case OSMO_AUTH_ALG_MILENAGE: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " auth algo not suited for 2G: %s\n", + osmo_auth_alg_name(aud->algo)); + return -EINVAL; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Unknown auth algo: %d\n", aud->algo); + return -EINVAL; + } + + if (aud->algo == OSMO_AUTH_ALG_NONE) + break; + if (!osmo_is_hexstr(aud->u.gsm.ki, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid KI: '%s'\n", aud->u.gsm.ki); + return -EINVAL; + } + break; + + case OSMO_AUTH_TYPE_UMTS: + label = "auc_3g"; + stmt_del = dbc->stmt[DB_STMT_AUC_3G_DELETE]; + stmt_ins = dbc->stmt[DB_STMT_AUC_3G_INSERT]; + switch (aud->algo) { + case OSMO_AUTH_ALG_NONE: + case OSMO_AUTH_ALG_MILENAGE: + break; + case OSMO_AUTH_ALG_COMP128v1: + case OSMO_AUTH_ALG_COMP128v2: + case OSMO_AUTH_ALG_COMP128v3: + case OSMO_AUTH_ALG_XOR: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " auth algo not suited for 3G: %s\n", + osmo_auth_alg_name(aud->algo)); + return -EINVAL; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Unknown auth algo: %d\n", aud->algo); + return -EINVAL; + } + + if (aud->algo == OSMO_AUTH_ALG_NONE) + break; + if (!osmo_is_hexstr(aud->u.umts.k, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid K: '%s'\n", aud->u.umts.k); + return -EINVAL; + } + if (!osmo_is_hexstr(aud->u.umts.opc, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid OP/OPC: '%s'\n", aud->u.umts.opc); + return -EINVAL; + } + if (aud->u.umts.ind_bitlen > OSMO_MILENAGE_IND_BITLEN_MAX) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid ind_bitlen: %d\n", aud->u.umts.ind_bitlen); + return -EINVAL; + } + break; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " unknown auth type: %d\n", aud->type); + return -EINVAL; + } + + stmt = stmt_del; + + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGP(DAUC, LOGL_ERROR, + "Cannot delete %s row: SQL error: (%d) %s\n", + label, rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; + } + + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) + /* Leave "no such entry" logging to the caller -- during + * db_subscr_delete_by_id(), we call this to make sure it is + * empty, and no entry is not an error then.*/ + ret = -ENOENT; + else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Delete subscriber ID=%"PRId64 + " from %s: SQL modified %d rows (expected 1)\n", + subscr_id, label, rc); + ret = -EIO; + } + + db_remove_reset(stmt); + + /* Error situation? Return now. */ + if (ret && ret != -ENOENT) + return ret; + + /* Just delete requested? */ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return ret; + + /* Don't return -ENOENT if inserting new data. */ + ret = 0; + + /* Insert new row */ + stmt = stmt_ins; + + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; + + switch (aud->type) { + case OSMO_AUTH_TYPE_GSM: + if (!db_bind_int(stmt, "$algo_id_2g", aud->algo)) + return -EIO; + if (!db_bind_text(stmt, "$ki", aud->u.gsm.ki)) + return -EIO; + break; + case OSMO_AUTH_TYPE_UMTS: + if (!db_bind_int(stmt, "$algo_id_3g", aud->algo)) + return -EIO; + if (!db_bind_text(stmt, "$k", aud->u.umts.k)) + return -EIO; + if (!db_bind_text(stmt, "$op", + aud->u.umts.opc_is_op ? aud->u.umts.opc : NULL)) + return -EIO; + if (!db_bind_text(stmt, "$opc", + aud->u.umts.opc_is_op ? NULL : aud->u.umts.opc)) + return -EIO; + if (!db_bind_int(stmt, "$ind_bitlen", aud->u.umts.ind_bitlen)) + return -EIO; + break; + default: + OSMO_ASSERT(false); + } + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGP(DAUC, LOGL_ERROR, + "Cannot insert %s row: SQL error: (%d) %s\n", + label, rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; + } + +out: + db_remove_reset(stmt); + return ret; +} + /* Common code for db_subscr_get_by_*() functions. */ static int db_sel(struct db_context *dbc, sqlite3_stmt *stmt, struct hlr_subscriber *subscr, const char **err) diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 20553ef..0442dbe 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -66,9 +66,32 @@ fprintf(stderr, "\n"); \ } while (0) +/* Do db_get_auth_data() and verbosely assert that its return value is as expected. + * Print the subscriber struct to stderr to be validated by db_test.err. + * The results are then available in g_aud2g and g_aud3g. */ +#define ASSERT_SEL_AUD(imsi, expect_rc, expect_id) \ + do { \ + g_aud2g = (struct osmo_sub_auth_data){}; \ + g_aud3g = (struct osmo_sub_auth_data){}; \ + g_id = 0; \ + ASSERT_RC(db_get_auth_data(dbc, imsi, &g_aud2g, &g_aud3g, &g_id), expect_rc); \ + if (g_rc == 1) { \ + dump_aud("2G", &g_aud2g); \ + dump_aud("3G", &g_aud3g); \ + }\ + if (g_id != expect_id) {\ + fprintf(stderr, "MISMATCH: got subscriber id %"PRId64 \ + ", expected %"PRId64"\n", g_id, (int64_t)(expect_id)); \ + OSMO_ASSERT(g_id == expect_id); \ + } \ + fprintf(stderr, "\n"); \ + } while (0) + static struct db_context *dbc = NULL; static void *ctx = NULL; static struct hlr_subscriber g_subscr; +static struct osmo_sub_auth_data g_aud2g; +static struct osmo_sub_auth_data g_aud3g; static int g_rc; static int64_t g_id; @@ -385,6 +408,262 @@ comment_end(); } +static const struct sub_auth_data_str *mk_aud_2g(enum osmo_auth_algo algo, + const char *ki) +{ + static struct sub_auth_data_str aud; + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_GSM, + .algo = algo, + .u.gsm.ki = ki, + }; + return &aud; +} + +static const struct sub_auth_data_str *mk_aud_3g(enum osmo_auth_algo algo, + const char *opc, bool opc_is_op, + const char *k, unsigned int ind_bitlen) +{ + static struct sub_auth_data_str aud; + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_UMTS, + .algo = algo, + .u.umts.k = k, + .u.umts.opc = opc, + .u.umts.opc_is_op = opc_is_op ? 1 : 0, + .u.umts.ind_bitlen = ind_bitlen, + }; + return &aud; +} + +static void test_subscr_aud() +{ + int64_t id; + + comment_start(); + + comment("Get auth data for non-existent subscriber"); + ASSERT_SEL_AUD(unknown_imsi, 0, 0); + + comment("Create subscriber"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + + id = g_subscr.id; + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 2G only"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + /* same again */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Remove 2G auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + /* Removing nothing results in -ENOENT */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)), + -ENOENT); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 3G only"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", true, + "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + /* same again */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", true, + "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, + "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", false, + "DeafBeddedBabeAcceededFadedDecaf", + OSMO_MILENAGE_IND_BITLEN_MAX)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "CededEffacedAceFacedBadFadedBeef", false, + "BeefedCafeFaceAcedAddedDecadeFee", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Remove 3G auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + /* Removing nothing results in -ENOENT */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)), + -ENOENT); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "CededEffacedAceFacedBadFadedBeef", false, + "BeefedCafeFaceAcedAddedDecadeFee", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, + "asdfasdfasd", false, + "asdfasdfasdf", 99999)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 2G and 3G"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", false, + "DeafBeddedBabeAcceededFadedDecaf", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + + comment("Set invalid auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(99999, "f000000000000f00000000000f000000")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "0f000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", + OSMO_MILENAGE_IND_BITLEN_MAX + 1)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "X000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "f000000000000 f00000000000 f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Delete subscriber"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); + ASSERT_SEL(imsi, imsi0, -ENOENT); + + comment("Re-add subscriber and verify auth data didn't come back"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + + /* For this test to work, we want to get the same subscriber ID back, + * and make sure there are no auth data leftovers for this ID. */ + OSMO_ASSERT(id == g_subscr.id); + ASSERT_SEL_AUD(imsi0, -1, id); + + ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); + ASSERT_SEL(imsi, imsi0, -ENOENT); + + comment_end(); +} + static struct { bool verbose; } cmdline_opts = { @@ -459,6 +738,7 @@ OSMO_ASSERT(dbc); test_subscr_create_update_sel_delete(); + test_subscr_aud(); printf("Done\n"); return 0; diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 59b9ba1..5d3ab5f 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -711,3 +711,483 @@ ===== test_subscr_create_update_sel_delete: SUCCESS + +===== test_subscr_aud + +--- Get auth data for non-existent subscriber + +db_get_auth_data(dbc, unknown_imsi, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='999999999': No such subscriber + + + +--- Create subscriber + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 2G only + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v1, + .u.gsm.ki = '0123456789abcdef0123456789abcdef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v1, + .u.gsm.ki = '0123456789abcdef0123456789abcdef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v2, + .u.gsm.ki = 'beadedbeeaced1ebbeddefacedfacade', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'deafbeddedbabeacceededfadeddecaf', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = XOR, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: none + + +--- Remove 2G auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> -ENOENT + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = XOR, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 3G only + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'deaf0ff1ced0d0dabbedd1ced1cef00d', + .u.umts.opc_is_op = 1, + .u.umts.k = 'f1bbed0afd0ef0bd0ffed0ddf1fe0b0e', + .u.umts.amf = '0000', +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", OSMO_MILENAGE_IND_BITLEN_MAX)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 28, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'cededeffacedacefacedbadfadedbeef', + .u.umts.opc_is_op = 0, + .u.umts.k = 'beefedcafefaceacedaddeddecadefee', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Remove 3G auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)) --> -ENOENT + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'cededeffacedacefacedbadfadedbeef', + .u.umts.opc_is_op = 0, + .u.umts.k = 'beefedcafefaceacedaddeddecadefee', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, "asdfasdfasd", false, "asdfasdfasdf", 99999)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 2G and 3G + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Set invalid auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(99999, "f000000000000f00000000000f000000")) --> -EINVAL +DAUC Cannot update auth tokens: Unknown auth algo: 99999 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")) --> -EINVAL +DAUC Cannot update auth tokens: Invalid KI: 'f000000000000f00000000000f000000f00000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")) --> -EINVAL +DAUC Cannot update auth tokens: Invalid KI: 'f00' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")) --> -EINVAL +DAUC Cannot update auth tokens: auth algo not suited for 2G: MILENAGE + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "0f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid OP/OPC: '0f000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid K: '000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", OSMO_MILENAGE_IND_BITLEN_MAX + 1)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid ind_bitlen: 29 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "X000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid OP/OPC: 'X000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000 f00000000000 f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid K: 'f000000000000 f00000000000 f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Delete subscriber + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_delete_by_id(dbc, id) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber + + +--- Re-add subscriber and verify auth data didn't come back + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_delete_by_id(dbc, id) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber + +===== test_subscr_aud: SUCCESS + -- To view, visit https://gerrit.osmocom.org/4185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icb11b5e059fb920447a9aa414db1819a0c020529 Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: refactor db_get_auth_data return val In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4186 to look at the new patch set (#3). refactor db_get_auth_data return val Adopt the error handling of the other db functions: return -ENOENT on unknown subscriber and -EIO on SQL failure. Return 0 for no error, instead of the number of rows modified. Adjust the single caller: db_get_auc() (and db_test.c). Change-Id: I006f471962bdad95d00a3a4c41a28ebbc9740884 --- M src/db_auc.c M tests/db/db_test.c M tests/db/db_test.err 3 files changed, 67 insertions(+), 66 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/86/4186/3 diff --git a/src/db_auc.c b/src/db_auc.c index 71c7262..10c1816 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -91,7 +92,7 @@ SQLITE_STATIC); if (rc != SQLITE_OK) { LOGAUC(imsi, LOGL_ERROR, "Error binding IMSI: %d\n", rc); - ret = -1; + ret = -EIO; goto out; } @@ -99,11 +100,11 @@ rc = sqlite3_step(stmt); if (rc == SQLITE_DONE) { LOGAUC(imsi, LOGL_INFO, "No such subscriber\n"); - ret = 0; + ret = -ENOENT; goto out; } else if (rc != SQLITE_ROW) { LOGAUC(imsi, LOGL_ERROR, "Error executing SQL: %d\n", rc); - ret = -1; + ret = -EIO; goto out; } @@ -139,6 +140,7 @@ k = sqlite3_column_text(stmt, 4); if (!k) { LOGAUC(imsi, LOGL_ERROR, "Error reading K: %d\n", rc); + ret = -EIO; goto out; } osmo_hexparse((void*)k, (void*)&aud3g->u.umts.k, sizeof(aud3g->u.umts.k)); @@ -148,6 +150,7 @@ opc = sqlite3_column_text(stmt, 6); if (!opc) { LOGAUC(imsi, LOGL_ERROR, "Error reading OPC: %d\n", rc); + ret = -EIO; goto out; } osmo_hexparse((void*)opc, (void*)&aud3g->u.umts.opc, @@ -166,9 +169,7 @@ LOGAUC(imsi, LOGL_DEBUG, "No 3G Auth Data\n"); if (aud2g->type == 0 && aud3g->type == 0) - ret = -1; - else - ret = 1; + ret = -ENOENT; out: /* remove bindings and reset statement to be re-executed */ @@ -197,7 +198,7 @@ int rc; rc = db_get_auth_data(dbc, imsi, &aud2g, &aud3g, &subscr_id); - if (rc <= 0) + if (rc) return rc; aud3g.u.umts.ind = auc_3g_ind; diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 0442dbe..1bdabdb 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -75,7 +75,7 @@ g_aud3g = (struct osmo_sub_auth_data){}; \ g_id = 0; \ ASSERT_RC(db_get_auth_data(dbc, imsi, &g_aud2g, &g_aud3g, &g_id), expect_rc); \ - if (g_rc == 1) { \ + if (!g_rc) { \ dump_aud("2G", &g_aud2g); \ dump_aud("3G", &g_aud3g); \ }\ @@ -443,7 +443,7 @@ comment_start(); comment("Get auth data for non-existent subscriber"); - ASSERT_SEL_AUD(unknown_imsi, 0, 0); + ASSERT_SEL_AUD(unknown_imsi, -ENOENT, 0); comment("Create subscriber"); @@ -451,7 +451,7 @@ ASSERT_SEL(imsi, imsi0, 0); id = g_subscr.id; - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); comment("Set auth data, 2G only"); @@ -459,35 +459,35 @@ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); /* same again */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Remove 2G auth data"); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); /* Removing nothing results in -ENOENT */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, @@ -497,12 +497,12 @@ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); comment("Set auth data, 3G only"); @@ -512,7 +512,7 @@ "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); /* same again */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, @@ -520,14 +520,14 @@ "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, @@ -535,21 +535,21 @@ "DeafBeddedBabeAcceededFadedDecaf", OSMO_MILENAGE_IND_BITLEN_MAX)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Remove 3G auth data"); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); /* Removing nothing results in -ENOENT */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, @@ -561,14 +561,14 @@ "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, "asdfasdfasd", false, "asdfasdfasdf", 99999)), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); comment("Set auth data, 2G and 3G"); @@ -581,7 +581,7 @@ "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Set invalid auth data"); @@ -589,36 +589,36 @@ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(99999, "f000000000000f00000000000f000000")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "0f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "000000000000f00000000000f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, @@ -626,21 +626,21 @@ "f000000000000f00000000000f000000", OSMO_MILENAGE_IND_BITLEN_MAX + 1)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "X000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000 f00000000000 f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Delete subscriber"); @@ -656,7 +656,7 @@ /* For this test to work, we want to get the same subscriber ID back, * and make sure there are no auth data leftovers for this ID. */ OSMO_ASSERT(id == g_subscr.id); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); ASSERT_SEL(imsi, imsi0, -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 5d3ab5f..4813ea6 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -716,7 +716,7 @@ --- Get auth data for non-existent subscriber -db_get_auth_data(dbc, unknown_imsi, &g_aud2g, &g_aud3g, &g_id) --> 0 +db_get_auth_data(dbc, unknown_imsi, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='999999999': No such subscriber @@ -731,7 +731,7 @@ .imsi = '123456789000000', } -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -741,7 +741,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -753,7 +753,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -765,7 +765,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -777,7 +777,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -789,7 +789,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -804,7 +804,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -813,7 +813,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -825,7 +825,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -835,7 +835,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -851,7 +851,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -867,7 +867,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -882,7 +882,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", OSMO_MILENAGE_IND_BITLEN_MAX)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -898,7 +898,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -917,7 +917,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -926,7 +926,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -942,7 +942,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, "asdfasdfasd", false, "asdfasdfasdf", 99999)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -954,7 +954,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -977,7 +977,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(99999, "f000000000000f00000000000f000000")) --> -EINVAL DAUC Cannot update auth tokens: Unknown auth algo: 99999 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -997,7 +997,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")) --> -EINVAL DAUC Cannot update auth tokens: Invalid KI: 'f000000000000f00000000000f000000f00000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1017,7 +1017,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")) --> -EINVAL DAUC Cannot update auth tokens: Invalid KI: 'f00' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1037,7 +1037,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")) --> -EINVAL DAUC Cannot update auth tokens: auth algo not suited for 2G: MILENAGE -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1057,7 +1057,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "0f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid OP/OPC: '0f000000000000f00000000000f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1077,7 +1077,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "000000000000f00000000000f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid K: '000000000000f00000000000f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1097,7 +1097,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", OSMO_MILENAGE_IND_BITLEN_MAX + 1)) --> -EINVAL DAUC Cannot update auth tokens: Invalid ind_bitlen: 29 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1117,7 +1117,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "X000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid OP/OPC: 'X000000000000f00000000000f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1137,7 +1137,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000 f00000000000 f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid K: 'f000000000000 f00000000000 f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1179,7 +1179,7 @@ .imsi = '123456789000000', } -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data -- To view, visit https://gerrit.osmocom.org/4186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I006f471962bdad95d00a3a4c41a28ebbc9740884 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: code undup: use db_remove_reset() in db_auc.c In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4187 to look at the new patch set (#3). code undup: use db_remove_reset() in db_auc.c Change-Id: I32d728e2b8a9771421c097647aa0e060e29a601f --- M src/db_auc.c 1 file changed, 2 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/87/4187/3 diff --git a/src/db_auc.c b/src/db_auc.c index 10c1816..d469920 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -60,16 +60,7 @@ return -2; } - /* remove bindings and reset statement to be re-executed */ - rc = sqlite3_clear_bindings(stmt); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error clerearing bindings: %d\n", rc); - } - rc = sqlite3_reset(stmt); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error in sqlite3_reset: %d\n", rc); - } - + db_remove_reset(stmt); return 0; } @@ -172,16 +163,7 @@ ret = -ENOENT; out: - /* remove bindings and reset statement to be re-executed */ - rc = sqlite3_clear_bindings(stmt); - if (rc != SQLITE_OK) { - LOGAUC(imsi, LOGL_ERROR, "Error in sqlite3_clear_bindings(): %d\n", rc); - } - rc = sqlite3_reset(stmt); - if (rc != SQLITE_OK) { - LOGAUC(imsi, LOGL_ERROR, "Error in sqlite3_reset(): %d\n", rc); - } - + db_remove_reset(stmt); return ret; } -- To view, visit https://gerrit.osmocom.org/4187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I32d728e2b8a9771421c097647aa0e060e29a601f Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: fix db_update_sqn(): reset stmt in all error cases In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4188 to look at the new patch set (#3). fix db_update_sqn(): reset stmt in all error cases Use the common db_bind_int64() so that the stmt bindings are cleared for any errors and to get error logging for free. On error with sqlite3_step(), log the SQL error message, and make sure the stmt is cleared of bindings and reset. After sqlite3_step(), verify that exactly one row was modifed, log and return errors otherwise. After this patch, the DB interaction closely matches the other (refactored) DB functions. Change-Id: I0d870d405e2e0a830360d9ad19f0a3f9e09d8cf2 --- M src/db.c M src/db_auc.c M tests/db/db_test.c M tests/db/db_test.err 4 files changed, 317 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/88/4188/3 diff --git a/src/db.c b/src/db.c index 4136e39..f1c14c9 100644 --- a/src/db.c +++ b/src/db.c @@ -53,7 +53,7 @@ " LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id" " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" " WHERE imsi = ?", - [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", + [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = $sqn WHERE subscriber_id = $subscriber_id", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs = $val WHERE imsi = $imsi", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps = $val WHERE imsi = $imsi", [DB_STMT_UPD_NAM_CS_BY_IMSI] = "UPDATE subscriber SET nam_cs = $val WHERE imsi = $imsi", diff --git a/src/db_auc.c b/src/db_auc.c index d469920..eae5070 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -34,34 +34,43 @@ #define LOGAUC(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) /* update the SQN for a given subscriber ID */ -int db_update_sqn(struct db_context *dbc, int64_t id, - uint64_t new_sqn) +int db_update_sqn(struct db_context *dbc, int64_t subscr_id, uint64_t new_sqn) { sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_UPD_SQN]; int rc; + int ret = 0; - /* bind new SQN and subscriber ID */ - rc = sqlite3_bind_int64(stmt, 1, new_sqn); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding SQN: %d\n", rc); - return -1; - } + if (!db_bind_int64(stmt, "$sqn", new_sqn)) + return -EIO; - rc = sqlite3_bind_int64(stmt, 2, id); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding Subscrber ID: %d\n", rc); - return -1; - } + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGP(DAUC, LOGL_ERROR, "Error updating SQN: %d\n", rc); - return -2; + LOGP(DAUC, LOGL_ERROR, "Cannot update SQN for subscriber ID=%"PRId64 + ": SQL error: (%d) %s\n", + subscr_id, rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot update SQN for subscriber ID=%"PRId64 + ": no auc_3g entry for such subscriber\n", subscr_id); + ret = -ENOENT; + } else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Update SQN for subscriber ID=%"PRId64 + ": SQL modified %d rows (expected 1)\n", subscr_id, rc); + ret = -EIO; + } + +out: db_remove_reset(stmt); - return 0; + return ret; } /* obtain the authentication data for a given imsi diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 1bdabdb..db3318c 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -664,6 +664,79 @@ comment_end(); } +static void test_subscr_sqn() +{ + int64_t id; + + comment_start(); + + comment("Set SQN for unknown subscriber"); + + ASSERT_RC(db_update_sqn(dbc, 99, 999), -ENOENT); + ASSERT_SEL(id, 99, -ENOENT); + + ASSERT_RC(db_update_sqn(dbc, 9999, 99), -ENOENT); + ASSERT_SEL(id, 9999, -ENOENT); + + comment("Create subscriber"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + + id = g_subscr.id; + ASSERT_SEL_AUD(imsi0, -ENOENT, id); + + comment("Set SQN, but no 3G auth data present"); + + ASSERT_RC(db_update_sqn(dbc, id, 123), -ENOENT); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); + + ASSERT_RC(db_update_sqn(dbc, id, 543), -ENOENT); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); + + comment("Set auth 3G data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", true, + "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + comment("Set SQN"); + + ASSERT_RC(db_update_sqn(dbc, id, 23315), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, 23315), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, 423), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + comment("Set SQN: thru uint64_t range, using the int64_t SQLite bind"); + + ASSERT_RC(db_update_sqn(dbc, id, 0), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, INT64_MAX), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, INT64_MIN), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, UINT64_MAX), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + comment("Delete subscriber"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); + ASSERT_SEL(imsi, imsi0, -ENOENT); + + comment_end(); +} + static struct { bool verbose; } cmdline_opts = { @@ -739,6 +812,7 @@ test_subscr_create_update_sel_delete(); test_subscr_aud(); + test_subscr_sqn(); printf("Done\n"); return 0; diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 4813ea6..0b09583 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -1191,3 +1191,220 @@ ===== test_subscr_aud: SUCCESS + +===== test_subscr_sqn + +--- Set SQN for unknown subscriber + +db_update_sqn(dbc, 99, 999) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=99: no auc_3g entry for such subscriber + +db_subscr_get_by_id(dbc, 99, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: ID=99: No such subscriber + +db_update_sqn(dbc, 9999, 99) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=9999: no auc_3g entry for such subscriber + +db_subscr_get_by_id(dbc, 9999, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: ID=9999: No such subscriber + + +--- Create subscriber + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set SQN, but no 3G auth data present + +db_update_sqn(dbc, id, 123) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=1: no auc_3g entry for such subscriber + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_update_sqn(dbc, id, 543) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=1: no auc_3g entry for such subscriber + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth 3G data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Set SQN + +db_update_sqn(dbc, id, 23315) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 23315, + .u.umts.sqn = 0x5b13, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, 23315) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 23315, + .u.umts.sqn = 0x5b13, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, 423) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 423, + .u.umts.sqn = 0x1a7, + .u.umts.ind_bitlen = 5, +} + + +--- Set SQN: thru uint64_t range, using the int64_t SQLite bind + +db_update_sqn(dbc, id, 0) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, INT64_MAX) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 9223372036854775807, + .u.umts.sqn = 0x7fffffffffffffff, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, INT64_MIN) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 9223372036854775808, + .u.umts.sqn = 0x8000000000000000, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, UINT64_MAX) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 18446744073709551615, + .u.umts.sqn = 0xffffffffffffffff, + .u.umts.ind_bitlen = 5, +} + + +--- Delete subscriber + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_delete_by_id(dbc, id) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber + +===== test_subscr_sqn: SUCCESS + -- To view, visit https://gerrit.osmocom.org/4188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0d870d405e2e0a830360d9ad19f0a3f9e09d8cf2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:29 +0000 Subject: [PATCH] osmo-hlr[master]: code undup: use db_bind_text() in db_get_auth_data() In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4189 to look at the new patch set (#4). code undup: use db_bind_text() in db_get_auth_data() To make the db_bind_text() error reporting mention "imsi", change the DB_STMT_AUC_BY_IMSI to use a named parameter. Change-Id: I49bd5eb78170cf4cdf8abb386c766d20d9f1cf73 --- M src/db.c M src/db_auc.c 2 files changed, 3 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/89/4189/4 diff --git a/src/db.c b/src/db.c index f1c14c9..fbf5c76 100644 --- a/src/db.c +++ b/src/db.c @@ -52,7 +52,7 @@ " FROM subscriber" " LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id" " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" - " WHERE imsi = ?", + " WHERE imsi = $imsi", [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = $sqn WHERE subscriber_id = $subscriber_id", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs = $val WHERE imsi = $imsi", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps = $val WHERE imsi = $imsi", diff --git a/src/db_auc.c b/src/db_auc.c index eae5070..7bbc93f 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -87,14 +87,8 @@ memset(aud2g, 0, sizeof(*aud2g)); memset(aud3g, 0, sizeof(*aud3g)); - /* bind the IMSI value */ - rc = sqlite3_bind_text(stmt, 1, imsi, -1, - SQLITE_STATIC); - if (rc != SQLITE_OK) { - LOGAUC(imsi, LOGL_ERROR, "Error binding IMSI: %d\n", rc); - ret = -EIO; - goto out; - } + if (!db_bind_text(stmt, "$imsi", imsi)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); -- To view, visit https://gerrit.osmocom.org/4189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I49bd5eb78170cf4cdf8abb386c766d20d9f1cf73 Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:32:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:32:49 +0000 Subject: [ABANDON] osmo-hlr[master]: db_test: fix typo: drop double-print of sgsn_address In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: db_test: fix typo: drop double-print of sgsn_address ...................................................................... Abandoned squashed into initial db_test patch -- To view, visit https://gerrit.osmocom.org/4229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ia85a3a3b10ceed4bbcd10867d147355c99ccb715 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 20:33:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 20:33:22 +0000 Subject: osmo-hlr[master]: add initial db_test: creating and deleting subscribers In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 re-add previous +2, lost from trivial fix (drop duplicate print of sgsn_address) -- To view, visit https://gerrit.osmocom.org/4178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2a0d277f55162bf5ceb0fc7d50390f2994daed71 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:34 +0000 Subject: [MERGED] osmo-hlr[master]: code undup: use db_bind_text() in db_get_auth_data() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: code undup: use db_bind_text() in db_get_auth_data() ...................................................................... code undup: use db_bind_text() in db_get_auth_data() To make the db_bind_text() error reporting mention "imsi", change the DB_STMT_AUC_BY_IMSI to use a named parameter. Change-Id: I49bd5eb78170cf4cdf8abb386c766d20d9f1cf73 --- M src/db.c M src/db_auc.c 2 files changed, 3 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index f1c14c9..fbf5c76 100644 --- a/src/db.c +++ b/src/db.c @@ -52,7 +52,7 @@ " FROM subscriber" " LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id" " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" - " WHERE imsi = ?", + " WHERE imsi = $imsi", [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = $sqn WHERE subscriber_id = $subscriber_id", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs = $val WHERE imsi = $imsi", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps = $val WHERE imsi = $imsi", diff --git a/src/db_auc.c b/src/db_auc.c index eae5070..7bbc93f 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -87,14 +87,8 @@ memset(aud2g, 0, sizeof(*aud2g)); memset(aud3g, 0, sizeof(*aud3g)); - /* bind the IMSI value */ - rc = sqlite3_bind_text(stmt, 1, imsi, -1, - SQLITE_STATIC); - if (rc != SQLITE_OK) { - LOGAUC(imsi, LOGL_ERROR, "Error binding IMSI: %d\n", rc); - ret = -EIO; - goto out; - } + if (!db_bind_text(stmt, "$imsi", imsi)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); -- To view, visit https://gerrit.osmocom.org/4189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I49bd5eb78170cf4cdf8abb386c766d20d9f1cf73 Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:34 +0000 Subject: [MERGED] osmo-hlr[master]: fix db_update_sqn(): reset stmt in all error cases In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix db_update_sqn(): reset stmt in all error cases ...................................................................... fix db_update_sqn(): reset stmt in all error cases Use the common db_bind_int64() so that the stmt bindings are cleared for any errors and to get error logging for free. On error with sqlite3_step(), log the SQL error message, and make sure the stmt is cleared of bindings and reset. After sqlite3_step(), verify that exactly one row was modifed, log and return errors otherwise. After this patch, the DB interaction closely matches the other (refactored) DB functions. Change-Id: I0d870d405e2e0a830360d9ad19f0a3f9e09d8cf2 --- M src/db.c M src/db_auc.c M tests/db/db_test.c M tests/db/db_test.err 4 files changed, 317 insertions(+), 17 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index 4136e39..f1c14c9 100644 --- a/src/db.c +++ b/src/db.c @@ -53,7 +53,7 @@ " LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id" " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" " WHERE imsi = ?", - [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", + [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = $sqn WHERE subscriber_id = $subscriber_id", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs = $val WHERE imsi = $imsi", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps = $val WHERE imsi = $imsi", [DB_STMT_UPD_NAM_CS_BY_IMSI] = "UPDATE subscriber SET nam_cs = $val WHERE imsi = $imsi", diff --git a/src/db_auc.c b/src/db_auc.c index d469920..eae5070 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -34,34 +34,43 @@ #define LOGAUC(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) /* update the SQN for a given subscriber ID */ -int db_update_sqn(struct db_context *dbc, int64_t id, - uint64_t new_sqn) +int db_update_sqn(struct db_context *dbc, int64_t subscr_id, uint64_t new_sqn) { sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_UPD_SQN]; int rc; + int ret = 0; - /* bind new SQN and subscriber ID */ - rc = sqlite3_bind_int64(stmt, 1, new_sqn); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding SQN: %d\n", rc); - return -1; - } + if (!db_bind_int64(stmt, "$sqn", new_sqn)) + return -EIO; - rc = sqlite3_bind_int64(stmt, 2, id); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding Subscrber ID: %d\n", rc); - return -1; - } + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGP(DAUC, LOGL_ERROR, "Error updating SQN: %d\n", rc); - return -2; + LOGP(DAUC, LOGL_ERROR, "Cannot update SQN for subscriber ID=%"PRId64 + ": SQL error: (%d) %s\n", + subscr_id, rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot update SQN for subscriber ID=%"PRId64 + ": no auc_3g entry for such subscriber\n", subscr_id); + ret = -ENOENT; + } else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Update SQN for subscriber ID=%"PRId64 + ": SQL modified %d rows (expected 1)\n", subscr_id, rc); + ret = -EIO; + } + +out: db_remove_reset(stmt); - return 0; + return ret; } /* obtain the authentication data for a given imsi diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 1bdabdb..db3318c 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -664,6 +664,79 @@ comment_end(); } +static void test_subscr_sqn() +{ + int64_t id; + + comment_start(); + + comment("Set SQN for unknown subscriber"); + + ASSERT_RC(db_update_sqn(dbc, 99, 999), -ENOENT); + ASSERT_SEL(id, 99, -ENOENT); + + ASSERT_RC(db_update_sqn(dbc, 9999, 99), -ENOENT); + ASSERT_SEL(id, 9999, -ENOENT); + + comment("Create subscriber"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + + id = g_subscr.id; + ASSERT_SEL_AUD(imsi0, -ENOENT, id); + + comment("Set SQN, but no 3G auth data present"); + + ASSERT_RC(db_update_sqn(dbc, id, 123), -ENOENT); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); + + ASSERT_RC(db_update_sqn(dbc, id, 543), -ENOENT); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); + + comment("Set auth 3G data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", true, + "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + comment("Set SQN"); + + ASSERT_RC(db_update_sqn(dbc, id, 23315), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, 23315), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, 423), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + comment("Set SQN: thru uint64_t range, using the int64_t SQLite bind"); + + ASSERT_RC(db_update_sqn(dbc, id, 0), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, INT64_MAX), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, INT64_MIN), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + ASSERT_RC(db_update_sqn(dbc, id, UINT64_MAX), 0); + ASSERT_SEL_AUD(imsi0, 0, id); + + comment("Delete subscriber"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); + ASSERT_SEL(imsi, imsi0, -ENOENT); + + comment_end(); +} + static struct { bool verbose; } cmdline_opts = { @@ -739,6 +812,7 @@ test_subscr_create_update_sel_delete(); test_subscr_aud(); + test_subscr_sqn(); printf("Done\n"); return 0; diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 4813ea6..0b09583 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -1191,3 +1191,220 @@ ===== test_subscr_aud: SUCCESS + +===== test_subscr_sqn + +--- Set SQN for unknown subscriber + +db_update_sqn(dbc, 99, 999) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=99: no auc_3g entry for such subscriber + +db_subscr_get_by_id(dbc, 99, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: ID=99: No such subscriber + +db_update_sqn(dbc, 9999, 99) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=9999: no auc_3g entry for such subscriber + +db_subscr_get_by_id(dbc, 9999, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: ID=9999: No such subscriber + + +--- Create subscriber + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set SQN, but no 3G auth data present + +db_update_sqn(dbc, id, 123) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=1: no auc_3g entry for such subscriber + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_update_sqn(dbc, id, 543) --> -ENOENT +DAUC Cannot update SQN for subscriber ID=1: no auc_3g entry for such subscriber + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth 3G data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Set SQN + +db_update_sqn(dbc, id, 23315) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 23315, + .u.umts.sqn = 0x5b13, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, 23315) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 23315, + .u.umts.sqn = 0x5b13, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, 423) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 423, + .u.umts.sqn = 0x1a7, + .u.umts.ind_bitlen = 5, +} + + +--- Set SQN: thru uint64_t range, using the int64_t SQLite bind + +db_update_sqn(dbc, id, 0) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, INT64_MAX) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 9223372036854775807, + .u.umts.sqn = 0x7fffffffffffffff, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, INT64_MIN) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 9223372036854775808, + .u.umts.sqn = 0x8000000000000000, + .u.umts.ind_bitlen = 5, +} + +db_update_sqn(dbc, id, UINT64_MAX) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.sqn = 18446744073709551615, + .u.umts.sqn = 0xffffffffffffffff, + .u.umts.ind_bitlen = 5, +} + + +--- Delete subscriber + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_delete_by_id(dbc, id) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber + +===== test_subscr_sqn: SUCCESS + -- To view, visit https://gerrit.osmocom.org/4188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0d870d405e2e0a830360d9ad19f0a3f9e09d8cf2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:34 +0000 Subject: [MERGED] osmo-hlr[master]: add db_subscr_update_aud_by_id(), complete db_subscr_delete_... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add db_subscr_update_aud_by_id(), complete db_subscr_delete_by_id() ...................................................................... add db_subscr_update_aud_by_id(), complete db_subscr_delete_by_id() Add ability to add and remove auc_2g and auc_3g table rows with db_subscr_update_aud_by_id(). In db_subscr_delete_by_id(), make sure that when deleting a subscriber, also all auth data associated with that user ID is removed as well. A newly created subscriber must not obtain the same auth tokens just by getting the same id. Depends: libosmocore Idf75946eb0a84e145adad13fc7c78bb7a267aa0a Change-Id: Icb11b5e059fb920447a9aa414db1819a0c020529 --- M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 5 files changed, 1,004 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index 2b2c2c4..4136e39 100644 --- a/src/db.c +++ b/src/db.c @@ -61,6 +61,14 @@ [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id", [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi", + [DB_STMT_AUC_2G_INSERT] = + "INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki)" + " VALUES($subscriber_id, $algo_id_2g, $ki)", + [DB_STMT_AUC_2G_DELETE] = "DELETE FROM auc_2g WHERE subscriber_id = $subscriber_id", + [DB_STMT_AUC_3G_INSERT] = + "INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, op, opc, ind_bitlen)" + " VALUES($subscriber_id, $algo_id_3g, $k, $op, $opc, $ind_bitlen)", + [DB_STMT_AUC_3G_DELETE] = "DELETE FROM auc_3g WHERE subscriber_id = $subscriber_id", }; static void sql3_error_log_cb(void *arg, int err_code, const char *msg) diff --git a/src/db.h b/src/db.h index 2e6cc9b..f6aaa58 100644 --- a/src/db.h +++ b/src/db.h @@ -18,6 +18,10 @@ DB_STMT_SUBSCR_CREATE, DB_STMT_DEL_BY_ID, DB_STMT_SET_MSISDN_BY_IMSI, + DB_STMT_AUC_2G_INSERT, + DB_STMT_AUC_2G_DELETE, + DB_STMT_AUC_3G_INSERT, + DB_STMT_AUC_3G_DELETE, _NUM_DB_STMT }; @@ -78,11 +82,36 @@ bool ms_purged_ps; }; +/* Like struct osmo_sub_auth_data, but the keys are in hexdump representation. + * This is useful because SQLite requires them in hexdump format, and callers + * like the VTY and CTRL interface also have them available as hexdump to begin + * with. In the binary format, a VTY command would first need to hexparse, + * after which the db function would again hexdump, copying to separate + * buffers. The roundtrip can be saved by providing char* to begin with. */ +struct sub_auth_data_str { + enum osmo_sub_auth_type type; + enum osmo_auth_algo algo; + union { + struct { + const char *opc; + const char *k; + uint64_t sqn; + int opc_is_op; + unsigned int ind_bitlen; + } umts; + struct { + const char *ki; + } gsm; + } u; +}; + int db_subscr_create(struct db_context *dbc, const char *imsi); int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id); int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, const char *msisdn); +int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id, + const struct sub_auth_data_str *aud); int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr); diff --git a/src/db_hlr.c b/src/db_hlr.c index b6d224b..71f682d 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -71,6 +71,7 @@ int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id) { int rc; + struct sub_auth_data_str aud; int ret = 0; sqlite3_stmt *stmt = dbc->stmt[DB_STMT_DEL_BY_ID]; @@ -99,10 +100,27 @@ ": SQL modified %d rows (expected 1)\n", subscr_id, rc); ret = -EIO; } - - /* FIXME: also remove authentication data from auc_2g and auc_3g */ - db_remove_reset(stmt); + + /* make sure to remove authentication data for this subscriber id, for + * both 2G and 3G. */ + + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_GSM, + .algo = OSMO_AUTH_ALG_NONE, + }; + rc = db_subscr_update_aud_by_id(dbc, subscr_id, &aud); + if (ret == -ENOENT && !rc) + ret = 0; + + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_NONE, + }; + rc = db_subscr_update_aud_by_id(dbc, subscr_id, &aud); + if (ret == -ENOENT && !rc) + ret = 0; + return ret; } @@ -154,6 +172,192 @@ } +/* Insert or update 2G or 3G authentication tokens in the database. + * If aud->type is OSMO_AUTH_TYPE_GSM, the auc_2g table entry for the + * subscriber will be added or modified; if aud->algo is OSMO_AUTH_ALG_NONE, + * however, the auc_2g entry for the subscriber is deleted. If aud->type is + * OSMO_AUTH_TYPE_UMTS, the auc_3g table is updated; again, if aud->algo is + * OSMO_AUTH_ALG_NONE, the auc_3g entry is deleted. + * Returns 0 if successful, -EINVAL for unknown aud->type, -ENOENT for unknown + * subscr_id, -EIO for SQL errors. + */ +int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id, + const struct sub_auth_data_str *aud) +{ + sqlite3_stmt *stmt_del; + sqlite3_stmt *stmt_ins; + sqlite3_stmt *stmt; + const char *label; + int rc; + int ret = 0; + + switch (aud->type) { + case OSMO_AUTH_TYPE_GSM: + label = "auc_2g"; + stmt_del = dbc->stmt[DB_STMT_AUC_2G_DELETE]; + stmt_ins = dbc->stmt[DB_STMT_AUC_2G_INSERT]; + + switch (aud->algo) { + case OSMO_AUTH_ALG_NONE: + case OSMO_AUTH_ALG_COMP128v1: + case OSMO_AUTH_ALG_COMP128v2: + case OSMO_AUTH_ALG_COMP128v3: + case OSMO_AUTH_ALG_XOR: + break; + case OSMO_AUTH_ALG_MILENAGE: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " auth algo not suited for 2G: %s\n", + osmo_auth_alg_name(aud->algo)); + return -EINVAL; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Unknown auth algo: %d\n", aud->algo); + return -EINVAL; + } + + if (aud->algo == OSMO_AUTH_ALG_NONE) + break; + if (!osmo_is_hexstr(aud->u.gsm.ki, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid KI: '%s'\n", aud->u.gsm.ki); + return -EINVAL; + } + break; + + case OSMO_AUTH_TYPE_UMTS: + label = "auc_3g"; + stmt_del = dbc->stmt[DB_STMT_AUC_3G_DELETE]; + stmt_ins = dbc->stmt[DB_STMT_AUC_3G_INSERT]; + switch (aud->algo) { + case OSMO_AUTH_ALG_NONE: + case OSMO_AUTH_ALG_MILENAGE: + break; + case OSMO_AUTH_ALG_COMP128v1: + case OSMO_AUTH_ALG_COMP128v2: + case OSMO_AUTH_ALG_COMP128v3: + case OSMO_AUTH_ALG_XOR: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " auth algo not suited for 3G: %s\n", + osmo_auth_alg_name(aud->algo)); + return -EINVAL; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Unknown auth algo: %d\n", aud->algo); + return -EINVAL; + } + + if (aud->algo == OSMO_AUTH_ALG_NONE) + break; + if (!osmo_is_hexstr(aud->u.umts.k, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid K: '%s'\n", aud->u.umts.k); + return -EINVAL; + } + if (!osmo_is_hexstr(aud->u.umts.opc, 32, 32, true)) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid OP/OPC: '%s'\n", aud->u.umts.opc); + return -EINVAL; + } + if (aud->u.umts.ind_bitlen > OSMO_MILENAGE_IND_BITLEN_MAX) { + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " Invalid ind_bitlen: %d\n", aud->u.umts.ind_bitlen); + return -EINVAL; + } + break; + default: + LOGP(DAUC, LOGL_ERROR, "Cannot update auth tokens:" + " unknown auth type: %d\n", aud->type); + return -EINVAL; + } + + stmt = stmt_del; + + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGP(DAUC, LOGL_ERROR, + "Cannot delete %s row: SQL error: (%d) %s\n", + label, rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; + } + + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) + /* Leave "no such entry" logging to the caller -- during + * db_subscr_delete_by_id(), we call this to make sure it is + * empty, and no entry is not an error then.*/ + ret = -ENOENT; + else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Delete subscriber ID=%"PRId64 + " from %s: SQL modified %d rows (expected 1)\n", + subscr_id, label, rc); + ret = -EIO; + } + + db_remove_reset(stmt); + + /* Error situation? Return now. */ + if (ret && ret != -ENOENT) + return ret; + + /* Just delete requested? */ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return ret; + + /* Don't return -ENOENT if inserting new data. */ + ret = 0; + + /* Insert new row */ + stmt = stmt_ins; + + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; + + switch (aud->type) { + case OSMO_AUTH_TYPE_GSM: + if (!db_bind_int(stmt, "$algo_id_2g", aud->algo)) + return -EIO; + if (!db_bind_text(stmt, "$ki", aud->u.gsm.ki)) + return -EIO; + break; + case OSMO_AUTH_TYPE_UMTS: + if (!db_bind_int(stmt, "$algo_id_3g", aud->algo)) + return -EIO; + if (!db_bind_text(stmt, "$k", aud->u.umts.k)) + return -EIO; + if (!db_bind_text(stmt, "$op", + aud->u.umts.opc_is_op ? aud->u.umts.opc : NULL)) + return -EIO; + if (!db_bind_text(stmt, "$opc", + aud->u.umts.opc_is_op ? NULL : aud->u.umts.opc)) + return -EIO; + if (!db_bind_int(stmt, "$ind_bitlen", aud->u.umts.ind_bitlen)) + return -EIO; + break; + default: + OSMO_ASSERT(false); + } + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGP(DAUC, LOGL_ERROR, + "Cannot insert %s row: SQL error: (%d) %s\n", + label, rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; + } + +out: + db_remove_reset(stmt); + return ret; +} + /* Common code for db_subscr_get_by_*() functions. */ static int db_sel(struct db_context *dbc, sqlite3_stmt *stmt, struct hlr_subscriber *subscr, const char **err) diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 20553ef..0442dbe 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -66,9 +66,32 @@ fprintf(stderr, "\n"); \ } while (0) +/* Do db_get_auth_data() and verbosely assert that its return value is as expected. + * Print the subscriber struct to stderr to be validated by db_test.err. + * The results are then available in g_aud2g and g_aud3g. */ +#define ASSERT_SEL_AUD(imsi, expect_rc, expect_id) \ + do { \ + g_aud2g = (struct osmo_sub_auth_data){}; \ + g_aud3g = (struct osmo_sub_auth_data){}; \ + g_id = 0; \ + ASSERT_RC(db_get_auth_data(dbc, imsi, &g_aud2g, &g_aud3g, &g_id), expect_rc); \ + if (g_rc == 1) { \ + dump_aud("2G", &g_aud2g); \ + dump_aud("3G", &g_aud3g); \ + }\ + if (g_id != expect_id) {\ + fprintf(stderr, "MISMATCH: got subscriber id %"PRId64 \ + ", expected %"PRId64"\n", g_id, (int64_t)(expect_id)); \ + OSMO_ASSERT(g_id == expect_id); \ + } \ + fprintf(stderr, "\n"); \ + } while (0) + static struct db_context *dbc = NULL; static void *ctx = NULL; static struct hlr_subscriber g_subscr; +static struct osmo_sub_auth_data g_aud2g; +static struct osmo_sub_auth_data g_aud3g; static int g_rc; static int64_t g_id; @@ -385,6 +408,262 @@ comment_end(); } +static const struct sub_auth_data_str *mk_aud_2g(enum osmo_auth_algo algo, + const char *ki) +{ + static struct sub_auth_data_str aud; + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_GSM, + .algo = algo, + .u.gsm.ki = ki, + }; + return &aud; +} + +static const struct sub_auth_data_str *mk_aud_3g(enum osmo_auth_algo algo, + const char *opc, bool opc_is_op, + const char *k, unsigned int ind_bitlen) +{ + static struct sub_auth_data_str aud; + aud = (struct sub_auth_data_str){ + .type = OSMO_AUTH_TYPE_UMTS, + .algo = algo, + .u.umts.k = k, + .u.umts.opc = opc, + .u.umts.opc_is_op = opc_is_op ? 1 : 0, + .u.umts.ind_bitlen = ind_bitlen, + }; + return &aud; +} + +static void test_subscr_aud() +{ + int64_t id; + + comment_start(); + + comment("Get auth data for non-existent subscriber"); + ASSERT_SEL_AUD(unknown_imsi, 0, 0); + + comment("Create subscriber"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + + id = g_subscr.id; + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 2G only"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + /* same again */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Remove 2G auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + /* Removing nothing results in -ENOENT */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)), + -ENOENT); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 3G only"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", true, + "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + /* same again */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", true, + "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, + "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", false, + "DeafBeddedBabeAcceededFadedDecaf", + OSMO_MILENAGE_IND_BITLEN_MAX)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "CededEffacedAceFacedBadFadedBeef", false, + "BeefedCafeFaceAcedAddedDecadeFee", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Remove 3G auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + /* Removing nothing results in -ENOENT */ + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)), + -ENOENT); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "CededEffacedAceFacedBadFadedBeef", false, + "BeefedCafeFaceAcedAddedDecadeFee", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_NONE, + "asdfasdfasd", false, + "asdfasdfasdf", 99999)), + 0); + ASSERT_SEL_AUD(imsi0, -1, id); + + + comment("Set auth data, 2G and 3G"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "CededEffacedAceFacedBadFadedBeef")), + 0); + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "BeefedCafeFaceAcedAddedDecadeFee", false, + "DeafBeddedBabeAcceededFadedDecaf", 5)), + 0); + ASSERT_SEL_AUD(imsi0, 1, id); + + + comment("Set invalid auth data"); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(99999, "f000000000000f00000000000f000000")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "0f000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", + OSMO_MILENAGE_IND_BITLEN_MAX + 1)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "X000000000000f00000000000f000000", false, + "f000000000000f00000000000f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, + mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, + "f000000000000f00000000000f000000", false, + "f000000000000 f00000000000 f000000", 5)), + -EINVAL); + ASSERT_SEL_AUD(imsi0, 1, id); + + comment("Delete subscriber"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); + ASSERT_SEL(imsi, imsi0, -ENOENT); + + comment("Re-add subscriber and verify auth data didn't come back"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + + /* For this test to work, we want to get the same subscriber ID back, + * and make sure there are no auth data leftovers for this ID. */ + OSMO_ASSERT(id == g_subscr.id); + ASSERT_SEL_AUD(imsi0, -1, id); + + ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); + ASSERT_SEL(imsi, imsi0, -ENOENT); + + comment_end(); +} + static struct { bool verbose; } cmdline_opts = { @@ -459,6 +738,7 @@ OSMO_ASSERT(dbc); test_subscr_create_update_sel_delete(); + test_subscr_aud(); printf("Done\n"); return 0; diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 59b9ba1..5d3ab5f 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -711,3 +711,483 @@ ===== test_subscr_create_update_sel_delete: SUCCESS + +===== test_subscr_aud + +--- Get auth data for non-existent subscriber + +db_get_auth_data(dbc, unknown_imsi, &g_aud2g, &g_aud3g, &g_id) --> 0 +DAUC IMSI='999999999': No such subscriber + + + +--- Create subscriber + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 2G only + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v1, + .u.gsm.ki = '0123456789abcdef0123456789abcdef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v1, + .u.gsm.ki = '0123456789abcdef0123456789abcdef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v2, + .u.gsm.ki = 'beadedbeeaced1ebbeddefacedfacade', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'deafbeddedbabeacceededfadeddecaf', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = XOR, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: none + + +--- Remove 2G auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> -ENOENT + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 3G Auth Data + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = XOR, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: none + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 3G only + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 1, + .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'deaf0ff1ced0d0dabbedd1ced1cef00d', + .u.umts.opc_is_op = 1, + .u.umts.k = 'f1bbed0afd0ef0bd0ffed0ddf1fe0b0e', + .u.umts.amf = '0000', +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", OSMO_MILENAGE_IND_BITLEN_MAX)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 28, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'cededeffacedacefacedbadfadedbeef', + .u.umts.opc_is_op = 0, + .u.umts.k = 'beefedcafefaceacedaddeddecadefee', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Remove 3G auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)) --> -ENOENT + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +DAUC IMSI='123456789000000': No 2G Auth Data + +2G: none +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'cededeffacedacefacedbadfadedbeef', + .u.umts.opc_is_op = 0, + .u.umts.k = 'beefedcafefaceacedaddeddecadefee', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, "asdfasdfasd", false, "asdfasdfasdf", 99999)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + + +--- Set auth data, 2G and 3G + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "CededEffacedAceFacedBadFadedBeef")) --> 0 + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", 5)) --> 0 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Set invalid auth data + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(99999, "f000000000000f00000000000f000000")) --> -EINVAL +DAUC Cannot update auth tokens: Unknown auth algo: 99999 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")) --> -EINVAL +DAUC Cannot update auth tokens: Invalid KI: 'f000000000000f00000000000f000000f00000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")) --> -EINVAL +DAUC Cannot update auth tokens: Invalid KI: 'f00' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")) --> -EINVAL +DAUC Cannot update auth tokens: auth algo not suited for 2G: MILENAGE + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "0f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid OP/OPC: '0f000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid K: '000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", OSMO_MILENAGE_IND_BITLEN_MAX + 1)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid ind_bitlen: 29 + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "X000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid OP/OPC: 'X000000000000f00000000000f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + +db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000 f00000000000 f000000", 5)) --> -EINVAL +DAUC Cannot update auth tokens: Invalid K: 'f000000000000 f00000000000 f000000' + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 + +2G: struct osmo_sub_auth_data { + .type = GSM, + .algo = COMP128v3, + .u.gsm.ki = 'cededeffacedacefacedbadfadedbeef', +} +3G: struct osmo_sub_auth_data { + .type = UMTS, + .algo = MILENAGE, + .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', + .u.umts.opc_is_op = 0, + .u.umts.k = 'deafbeddedbabeacceededfadeddecaf', + .u.umts.amf = '0000', + .u.umts.ind_bitlen = 5, +} + + +--- Delete subscriber + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_delete_by_id(dbc, id) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber + + +--- Re-add subscriber and verify auth data didn't come back + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +DAUC IMSI='123456789000000': No 2G Auth Data +DAUC IMSI='123456789000000': No 3G Auth Data + + +db_subscr_delete_by_id(dbc, id) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber + +===== test_subscr_aud: SUCCESS + -- To view, visit https://gerrit.osmocom.org/4185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icb11b5e059fb920447a9aa414db1819a0c020529 Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:34 +0000 Subject: [MERGED] osmo-hlr[master]: code undup: use db_remove_reset() in db_auc.c In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: code undup: use db_remove_reset() in db_auc.c ...................................................................... code undup: use db_remove_reset() in db_auc.c Change-Id: I32d728e2b8a9771421c097647aa0e060e29a601f --- M src/db_auc.c 1 file changed, 2 insertions(+), 20 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db_auc.c b/src/db_auc.c index 10c1816..d469920 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -60,16 +60,7 @@ return -2; } - /* remove bindings and reset statement to be re-executed */ - rc = sqlite3_clear_bindings(stmt); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error clerearing bindings: %d\n", rc); - } - rc = sqlite3_reset(stmt); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error in sqlite3_reset: %d\n", rc); - } - + db_remove_reset(stmt); return 0; } @@ -172,16 +163,7 @@ ret = -ENOENT; out: - /* remove bindings and reset statement to be re-executed */ - rc = sqlite3_clear_bindings(stmt); - if (rc != SQLITE_OK) { - LOGAUC(imsi, LOGL_ERROR, "Error in sqlite3_clear_bindings(): %d\n", rc); - } - rc = sqlite3_reset(stmt); - if (rc != SQLITE_OK) { - LOGAUC(imsi, LOGL_ERROR, "Error in sqlite3_reset(): %d\n", rc); - } - + db_remove_reset(stmt); return ret; } -- To view, visit https://gerrit.osmocom.org/4187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I32d728e2b8a9771421c097647aa0e060e29a601f Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:35 +0000 Subject: [MERGED] osmo-hlr[master]: refactor db_get_auth_data return val In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: refactor db_get_auth_data return val ...................................................................... refactor db_get_auth_data return val Adopt the error handling of the other db functions: return -ENOENT on unknown subscriber and -EIO on SQL failure. Return 0 for no error, instead of the number of rows modified. Adjust the single caller: db_get_auc() (and db_test.c). Change-Id: I006f471962bdad95d00a3a4c41a28ebbc9740884 --- M src/db_auc.c M tests/db/db_test.c M tests/db/db_test.err 3 files changed, 67 insertions(+), 66 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db_auc.c b/src/db_auc.c index 71c7262..10c1816 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -91,7 +92,7 @@ SQLITE_STATIC); if (rc != SQLITE_OK) { LOGAUC(imsi, LOGL_ERROR, "Error binding IMSI: %d\n", rc); - ret = -1; + ret = -EIO; goto out; } @@ -99,11 +100,11 @@ rc = sqlite3_step(stmt); if (rc == SQLITE_DONE) { LOGAUC(imsi, LOGL_INFO, "No such subscriber\n"); - ret = 0; + ret = -ENOENT; goto out; } else if (rc != SQLITE_ROW) { LOGAUC(imsi, LOGL_ERROR, "Error executing SQL: %d\n", rc); - ret = -1; + ret = -EIO; goto out; } @@ -139,6 +140,7 @@ k = sqlite3_column_text(stmt, 4); if (!k) { LOGAUC(imsi, LOGL_ERROR, "Error reading K: %d\n", rc); + ret = -EIO; goto out; } osmo_hexparse((void*)k, (void*)&aud3g->u.umts.k, sizeof(aud3g->u.umts.k)); @@ -148,6 +150,7 @@ opc = sqlite3_column_text(stmt, 6); if (!opc) { LOGAUC(imsi, LOGL_ERROR, "Error reading OPC: %d\n", rc); + ret = -EIO; goto out; } osmo_hexparse((void*)opc, (void*)&aud3g->u.umts.opc, @@ -166,9 +169,7 @@ LOGAUC(imsi, LOGL_DEBUG, "No 3G Auth Data\n"); if (aud2g->type == 0 && aud3g->type == 0) - ret = -1; - else - ret = 1; + ret = -ENOENT; out: /* remove bindings and reset statement to be re-executed */ @@ -197,7 +198,7 @@ int rc; rc = db_get_auth_data(dbc, imsi, &aud2g, &aud3g, &subscr_id); - if (rc <= 0) + if (rc) return rc; aud3g.u.umts.ind = auc_3g_ind; diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 0442dbe..1bdabdb 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -75,7 +75,7 @@ g_aud3g = (struct osmo_sub_auth_data){}; \ g_id = 0; \ ASSERT_RC(db_get_auth_data(dbc, imsi, &g_aud2g, &g_aud3g, &g_id), expect_rc); \ - if (g_rc == 1) { \ + if (!g_rc) { \ dump_aud("2G", &g_aud2g); \ dump_aud("3G", &g_aud3g); \ }\ @@ -443,7 +443,7 @@ comment_start(); comment("Get auth data for non-existent subscriber"); - ASSERT_SEL_AUD(unknown_imsi, 0, 0); + ASSERT_SEL_AUD(unknown_imsi, -ENOENT, 0); comment("Create subscriber"); @@ -451,7 +451,7 @@ ASSERT_SEL(imsi, imsi0, 0); id = g_subscr.id; - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); comment("Set auth data, 2G only"); @@ -459,35 +459,35 @@ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); /* same again */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Remove 2G auth data"); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); /* Removing nothing results in -ENOENT */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, @@ -497,12 +497,12 @@ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); comment("Set auth data, 3G only"); @@ -512,7 +512,7 @@ "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); /* same again */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, @@ -520,14 +520,14 @@ "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, @@ -535,21 +535,21 @@ "DeafBeddedBabeAcceededFadedDecaf", OSMO_MILENAGE_IND_BITLEN_MAX)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Remove 3G auth data"); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); /* Removing nothing results in -ENOENT */ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, @@ -561,14 +561,14 @@ "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, "asdfasdfasd", false, "asdfasdfasdf", 99999)), 0); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); comment("Set auth data, 2G and 3G"); @@ -581,7 +581,7 @@ "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", 5)), 0); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Set invalid auth data"); @@ -589,36 +589,36 @@ ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(99999, "f000000000000f00000000000f000000")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "0f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "000000000000f00000000000f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, @@ -626,21 +626,21 @@ "f000000000000f00000000000f000000", OSMO_MILENAGE_IND_BITLEN_MAX + 1)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "X000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); ASSERT_RC(db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000 f00000000000 f000000", 5)), -EINVAL); - ASSERT_SEL_AUD(imsi0, 1, id); + ASSERT_SEL_AUD(imsi0, 0, id); comment("Delete subscriber"); @@ -656,7 +656,7 @@ /* For this test to work, we want to get the same subscriber ID back, * and make sure there are no auth data leftovers for this ID. */ OSMO_ASSERT(id == g_subscr.id); - ASSERT_SEL_AUD(imsi0, -1, id); + ASSERT_SEL_AUD(imsi0, -ENOENT, id); ASSERT_RC(db_subscr_delete_by_id(dbc, id), 0); ASSERT_SEL(imsi, imsi0, -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 5d3ab5f..4813ea6 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -716,7 +716,7 @@ --- Get auth data for non-existent subscriber -db_get_auth_data(dbc, unknown_imsi, &g_aud2g, &g_aud3g, &g_id) --> 0 +db_get_auth_data(dbc, unknown_imsi, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='999999999': No such subscriber @@ -731,7 +731,7 @@ .imsi = '123456789000000', } -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -741,7 +741,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -753,7 +753,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v1, "0123456789abcdef0123456789abcdef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -765,7 +765,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v2, "BeadedBeeAced1EbbedDefacedFacade")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -777,7 +777,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_COMP128v3, "DeafBeddedBabeAcceededFadedDecaf")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -789,7 +789,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -804,7 +804,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, NULL)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -813,7 +813,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "CededEffacedAceFacedBadFadedBeef")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 3G Auth Data 2G: struct osmo_sub_auth_data { @@ -825,7 +825,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_NONE, "f000000000000f00000000000f000000")) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -835,7 +835,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -851,7 +851,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", true, "C01ffedC1cadaeAc1d1f1edAcac1aB0a", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -867,7 +867,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "Deaf0ff1ceD0d0DabbedD1ced1ceF00d", true, "F1bbed0afD0eF0bD0ffed0ddF1fe0b0e", 0)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -882,7 +882,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", OSMO_MILENAGE_IND_BITLEN_MAX)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -898,7 +898,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -917,7 +917,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, NULL, false, NULL, 0)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -926,7 +926,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "CededEffacedAceFacedBadFadedBeef", false, "BeefedCafeFaceAcedAddedDecadeFee", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 DAUC IMSI='123456789000000': No 2G Auth Data 2G: none @@ -942,7 +942,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_NONE, "asdfasdfasd", false, "asdfasdfasdf", 99999)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data @@ -954,7 +954,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "BeefedCafeFaceAcedAddedDecadeFee", false, "DeafBeddedBabeAcceededFadedDecaf", 5)) --> 0 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -977,7 +977,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(99999, "f000000000000f00000000000f000000")) --> -EINVAL DAUC Cannot update auth tokens: Unknown auth algo: 99999 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -997,7 +997,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f000000000000f00000000000f000000f00000000")) --> -EINVAL DAUC Cannot update auth tokens: Invalid KI: 'f000000000000f00000000000f000000f00000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1017,7 +1017,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_XOR, "f00")) --> -EINVAL DAUC Cannot update auth tokens: Invalid KI: 'f00' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1037,7 +1037,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_2g(OSMO_AUTH_ALG_MILENAGE, "0123456789abcdef0123456789abcdef")) --> -EINVAL DAUC Cannot update auth tokens: auth algo not suited for 2G: MILENAGE -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1057,7 +1057,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "0f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid OP/OPC: '0f000000000000f00000000000f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1077,7 +1077,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "000000000000f00000000000f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid K: '000000000000f00000000000f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1097,7 +1097,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", OSMO_MILENAGE_IND_BITLEN_MAX + 1)) --> -EINVAL DAUC Cannot update auth tokens: Invalid ind_bitlen: 29 -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1117,7 +1117,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "X000000000000f00000000000f000000", false, "f000000000000f00000000000f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid OP/OPC: 'X000000000000f00000000000f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1137,7 +1137,7 @@ db_subscr_update_aud_by_id(dbc, id, mk_aud_3g(OSMO_AUTH_ALG_MILENAGE, "f000000000000f00000000000f000000", false, "f000000000000 f00000000000 f000000", 5)) --> -EINVAL DAUC Cannot update auth tokens: Invalid K: 'f000000000000 f00000000000 f000000' -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> 0 2G: struct osmo_sub_auth_data { .type = GSM, @@ -1179,7 +1179,7 @@ .imsi = '123456789000000', } -db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -1 +db_get_auth_data(dbc, imsi0, &g_aud2g, &g_aud3g, &g_id) --> -2 DAUC IMSI='123456789000000': No 2G Auth Data DAUC IMSI='123456789000000': No 3G Auth Data -- To view, visit https://gerrit.osmocom.org/4186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I006f471962bdad95d00a3a4c41a28ebbc9740884 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:35 +0000 Subject: [MERGED] osmo-hlr[master]: refactor db_subscr_purge In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: refactor db_subscr_purge ...................................................................... refactor db_subscr_purge Use named parameters in the SQL statements. Use db_bind_* functions to drop some code dup. Adopt error handling (rc and logging) to match the other db functions: return -ENOENT for unknown subscriber, -EIO for SQL failures. Change-Id: Iad49d29b90a708c6cf55bfb3bcc02d9e29001a15 --- M src/db.c M src/db.h M src/db_hlr.c M src/hlr.c M tests/db/db_test.c M tests/db/db_test.err 6 files changed, 214 insertions(+), 17 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index eb29434..2b2c2c4 100644 --- a/src/db.c +++ b/src/db.c @@ -54,8 +54,8 @@ " LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id" " WHERE imsi = ?", [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", - [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", - [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", + [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs = $val WHERE imsi = $imsi", + [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps = $val WHERE imsi = $imsi", [DB_STMT_UPD_NAM_CS_BY_IMSI] = "UPDATE subscriber SET nam_cs = $val WHERE imsi = $imsi", [DB_STMT_UPD_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps = $val WHERE imsi = $imsi", [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", diff --git a/src/db.h b/src/db.h index 9d4274d..2e6cc9b 100644 --- a/src/db.h +++ b/src/db.h @@ -94,5 +94,5 @@ int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, const char *vlr_or_sgsn_number, bool is_ps); -int db_subscr_purge(struct db_context *dbc, - const char *imsi, bool is_ps); +int db_subscr_purge(struct db_context *dbc, const char *by_imsi, + bool purge_val, bool is_ps); diff --git a/src/db_hlr.c b/src/db_hlr.c index ac3c730..b6d224b 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -356,27 +356,49 @@ return ret; } -int db_subscr_purge(struct db_context *dbc, const char *imsi, bool is_ps) +int db_subscr_purge(struct db_context *dbc, const char *by_imsi, + bool purge_val, bool is_ps) { - sqlite3_stmt *stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; - int rc, ret = 1; + sqlite3_stmt *stmt; + int rc, ret = 0; - if (is_ps) - stmt = dbc->stmt[DB_STMT_UPD_PURGE_PS_BY_IMSI]; - else - stmt = dbc->stmt[DB_STMT_UPD_PURGE_CS_BY_IMSI]; + stmt = dbc->stmt[is_ps ? DB_STMT_UPD_PURGE_PS_BY_IMSI + : DB_STMT_UPD_PURGE_CS_BY_IMSI]; - if (!db_bind_text(stmt, NULL, imsi)) - return -EINVAL; + if (!db_bind_text(stmt, "$imsi", by_imsi)) + return -EIO; + if (!db_bind_int(stmt, "$val", purge_val ? 1 : 0)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGP(DAUC, LOGL_ERROR, "Error setting Purged: %d\n", rc); - ret = -ENOEXEC; + LOGP(DAUC, LOGL_ERROR, "%s %s: SQL error: %s\n", + purge_val ? "purge" : "un-purge", + is_ps ? "PS" : "CS", + sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } - /* FIXME: return 0 in case IMSI not known */ + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot %s %s: no such subscriber: IMSI='%s'\n", + purge_val ? "purge" : "un-purge", + is_ps ? "PS" : "CS", + by_imsi); + ret = -ENOENT; + goto out; + } else if (rc != 1) { + LOGHLR(by_imsi, LOGL_ERROR, "%s %s: SQL modified %d rows (expected 1)\n", + purge_val ? "purge" : "un-purge", + is_ps ? "PS" : "CS", + rc); + ret = -EIO; + } + +out: db_remove_reset(stmt); return ret; diff --git a/src/hlr.c b/src/hlr.c index 9e8b699..b32f709 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -221,7 +221,7 @@ * we have on record. Only update if yes */ /* Perform the actual update of the DB */ - rc = db_subscr_purge(g_hlr->dbc, gsup->imsi, is_ps); + rc = db_subscr_purge(g_hlr->dbc, gsup->imsi, true, is_ps); if (rc == 1) gsup_reply.message_type = OSMO_GSUP_MSGT_PURGE_MS_RESULT; diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 5acd1e8..20553ef 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -320,6 +320,44 @@ ASSERT_RC(db_subscr_lu(dbc, 99999, "712", false), -ENOENT); ASSERT_SEL(id, 99999, -ENOENT); + comment("Purge and un-purge PS and CS"); + + /* purge_val, is_ps */ + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Purge PS and CS *again*"); + + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_purge(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Purge on non-existent / invalid IMSI"); + + ASSERT_RC(db_subscr_purge(dbc, unknown_imsi, true, true), -ENOENT); + ASSERT_SEL(imsi, unknown_imsi, -ENOENT); + ASSERT_RC(db_subscr_purge(dbc, unknown_imsi, true, false), -ENOENT); + ASSERT_SEL(imsi, unknown_imsi, -ENOENT); + comment("Delete non-existent / invalid IDs"); ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 6e6a0ac..59b9ba1 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -513,6 +513,143 @@ DAUC Cannot read subscriber from db: ID=99999: No such subscriber +--- Purge and un-purge PS and CS + +db_subscr_purge(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_cs = true, + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Purge PS and CS *again* + +db_subscr_purge(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_ps = true, +} + +db_subscr_purge(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_purge(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_purge(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_cs = true, +} + +db_subscr_purge(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .ms_purged_cs = true, +} + +db_subscr_purge(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_purge(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Purge on non-existent / invalid IMSI + +db_subscr_purge(dbc, unknown_imsi, true, true) --> -ENOENT +DAUC Cannot purge PS: no such subscriber: IMSI='999999999' + +db_subscr_get_by_imsi(dbc, unknown_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='999999999': No such subscriber + +db_subscr_purge(dbc, unknown_imsi, true, false) --> -ENOENT +DAUC Cannot purge CS: no such subscriber: IMSI='999999999' + +db_subscr_get_by_imsi(dbc, unknown_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='999999999': No such subscriber + + --- Delete non-existent / invalid IDs db_subscr_delete_by_id(dbc, 999) --> -ENOENT -- To view, visit https://gerrit.osmocom.org/4184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iad49d29b90a708c6cf55bfb3bcc02d9e29001a15 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:35 +0000 Subject: [MERGED] osmo-hlr[master]: refactor db_subscr_ps() to db_subscr_nam() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: refactor db_subscr_ps() to db_subscr_nam() ...................................................................... refactor db_subscr_ps() to db_subscr_nam() Allow to set nam_ps and nam_cs from this same function, by adding the is_ps arg. Combine both NAM_PS stmts to DB_STMT_UPD_NAM_PS_BY_IMSI, add another such stmt for CS. Use named parameters instead of parameter indexes. Improve error return values as well as error logging to clearly indicate whether the operation could not find the requested IMSI, or other errors occured. Adjust the single caller. This prepares for upcoming VTY and possibly CTRL commands, and the error handling introduced here has been or will be adopted by other functions in previous or subsequent patches. Change-Id: I6e70e15228f5bb10bee6758ae5dc9687d65839bd --- M src/ctrl.c M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 6 files changed, 230 insertions(+), 20 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl.c b/src/ctrl.c index b034cd7..8682e14 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -43,7 +43,7 @@ return CTRL_CMD_ERROR; } - if (db_subscr_ps(ctx->dbc, cmd->value, enable) < 0) { + if (db_subscr_nam(ctx->dbc, cmd->value, enable, true) < 0) { cmd->reply = "Error updating DB"; return CTRL_CMD_ERROR; } diff --git a/src/db.c b/src/db.c index 5a38d55..8286ba8 100644 --- a/src/db.c +++ b/src/db.c @@ -56,8 +56,8 @@ [DB_STMT_AUC_UPD_SQN] = "UPDATE auc_3g SET sqn = ? WHERE subscriber_id = ?", [DB_STMT_UPD_PURGE_CS_BY_IMSI] = "UPDATE subscriber SET ms_purged_cs=1 WHERE imsi = ?", [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", - [DB_STMT_SET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=1 WHERE imsi = ?", - [DB_STMT_UNSET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=0 WHERE imsi = ?", + [DB_STMT_UPD_NAM_CS_BY_IMSI] = "UPDATE subscriber SET nam_cs = $val WHERE imsi = $imsi", + [DB_STMT_UPD_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps = $val WHERE imsi = $imsi", [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id", [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi", diff --git a/src/db.h b/src/db.h index 5ec7b72..5e234ff 100644 --- a/src/db.h +++ b/src/db.h @@ -13,8 +13,8 @@ DB_STMT_AUC_UPD_SQN, DB_STMT_UPD_PURGE_CS_BY_IMSI, DB_STMT_UPD_PURGE_PS_BY_IMSI, - DB_STMT_SET_NAM_PS_BY_IMSI, - DB_STMT_UNSET_NAM_PS_BY_IMSI, + DB_STMT_UPD_NAM_PS_BY_IMSI, + DB_STMT_UPD_NAM_CS_BY_IMSI, DB_STMT_SUBSCR_CREATE, DB_STMT_DEL_BY_ID, DB_STMT_SET_MSISDN_BY_IMSI, @@ -90,7 +90,7 @@ struct hlr_subscriber *subscr); int db_subscr_get_by_id(struct db_context *dbc, int64_t id, struct hlr_subscriber *subscr); -int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable); +int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps); int db_subscr_lu(struct db_context *dbc, const struct hlr_subscriber *subscr, const char *vlr_or_sgsn_number, diff --git a/src/db_hlr.c b/src/db_hlr.c index 8df4bcb..9bdb372 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -259,31 +259,58 @@ return rc; } -int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable) +/* Enable or disable PS or CS for a subscriber. + * For the subscriber with the given imsi, set nam_ps (when is_ps == true) or + * nam_cs (when is_ps == false) to nam_val in the database. + * Returns 0 on success, -ENOENT when the given IMSI does not exist, -EINVAL if + * the SQL statement could not be composed, -ENOEXEC if running the SQL + * statement failed, -EIO if the amount of rows modified is unexpected. + */ +int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps) { - sqlite3_stmt *stmt = - dbc->stmt[enable ? DB_STMT_SET_NAM_PS_BY_IMSI : DB_STMT_UNSET_NAM_PS_BY_IMSI]; + sqlite3_stmt *stmt; int rc; + int ret = 0; - if (!db_bind_text(stmt, NULL, imsi)) - return -EINVAL; + stmt = dbc->stmt[is_ps ? DB_STMT_UPD_NAM_PS_BY_IMSI + : DB_STMT_UPD_NAM_CS_BY_IMSI]; - rc = sqlite3_step(stmt); /* execute the statement */ + if (!db_bind_text(stmt, "$imsi", imsi)) + return -EIO; + if (!db_bind_int(stmt, "$val", nam_val ? 1 : 0)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGHLR(imsi, LOGL_ERROR, "Error executing SQL: %d\n", rc); - db_remove_reset(stmt); - return -ENOEXEC; + LOGHLR(imsi, LOGL_ERROR, "%s %s: SQL error: %s\n", + nam_val ? "enable" : "disable", + is_ps ? "PS" : "CS", + sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } - rc = sqlite3_changes(dbc->db); /* verify execution result */ - if (rc != 1) { - LOGHLR(imsi, LOGL_ERROR, "SQL modified %d rows (expected 1)\n", + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot %s %s: no such subscriber: IMSI='%s'\n", + nam_val ? "enable" : "disable", + is_ps ? "PS" : "CS", + imsi); + ret = -ENOENT; + goto out; + } else if (rc != 1) { + LOGHLR(imsi, LOGL_ERROR, "%s %s: SQL modified %d rows (expected 1)\n", + nam_val ? "enable" : "disable", + is_ps ? "PS" : "CS", rc); - rc = -EINVAL; + ret = -EIO; } +out: db_remove_reset(stmt); - return rc; + return ret; } int db_subscr_lu(struct db_context *dbc, diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 250b363..30de51d 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -244,6 +244,45 @@ ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99"), -ENOENT); ASSERT_SEL(msisdn, "99", -ENOENT); + comment("Set / unset nam_cs and nam_ps"); + + /* nam_val, is_ps */ + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Set / unset nam_cs and nam_ps *again*"); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, false, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, true), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_nam(dbc, imsi0, true, false), 0); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Set nam_cs and nam_ps on non-existent / invalid IMSI"); + + ASSERT_RC(db_subscr_nam(dbc, unknown_imsi, false, true), -ENOENT); + ASSERT_RC(db_subscr_nam(dbc, unknown_imsi, false, false), -ENOENT); + ASSERT_SEL(imsi, unknown_imsi, -ENOENT); + + ASSERT_RC(db_subscr_nam(dbc, "foobar", false, true), -ENOENT); + ASSERT_RC(db_subscr_nam(dbc, "foobar", false, false), -ENOENT); + comment("Delete non-existent / invalid IDs"); ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 17323b5..f7c03d9 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -232,6 +232,150 @@ DAUC Cannot read subscriber from db: MSISDN='99': No such subscriber +--- Set / unset nam_cs and nam_ps + +db_subscr_nam(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Set / unset nam_cs and nam_ps *again* + +db_subscr_nam(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, false, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, + .nam_ps = false, +} + +db_subscr_nam(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, +} + +db_subscr_nam(dbc, imsi0, true, true) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .nam_cs = false, +} + +db_subscr_nam(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_nam(dbc, imsi0, true, false) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Set nam_cs and nam_ps on non-existent / invalid IMSI + +db_subscr_nam(dbc, unknown_imsi, false, true) --> -ENOENT +DAUC Cannot disable PS: no such subscriber: IMSI='999999999' + +db_subscr_nam(dbc, unknown_imsi, false, false) --> -ENOENT +DAUC Cannot disable CS: no such subscriber: IMSI='999999999' + +db_subscr_get_by_imsi(dbc, unknown_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='999999999': No such subscriber + +db_subscr_nam(dbc, "foobar", false, true) --> -ENOENT +DAUC Cannot disable PS: no such subscriber: IMSI='foobar' + +db_subscr_nam(dbc, "foobar", false, false) --> -ENOENT +DAUC Cannot disable CS: no such subscriber: IMSI='foobar' + + --- Delete non-existent / invalid IDs db_subscr_delete_by_id(dbc, 999) --> -ENOENT -- To view, visit https://gerrit.osmocom.org/4182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e70e15228f5bb10bee6758ae5dc9687d65839bd Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:36 +0000 Subject: [MERGED] osmo-hlr[master]: refactor db_subscr_lu() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: refactor db_subscr_lu() ...................................................................... refactor db_subscr_lu() Use named parameters in the SQL statement. Use db_bind_* functions to drop some code dup. Use explicit subscriber id arg instead of subscriber struct. Match return values and error logging to other db functions. Change-Id: I35665e84ddbe54a6f218b24033df969ad2e669a0 --- M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 5 files changed, 206 insertions(+), 32 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index 8286ba8..eb29434 100644 --- a/src/db.c +++ b/src/db.c @@ -45,8 +45,8 @@ [DB_STMT_SEL_BY_IMSI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE imsi = ?", [DB_STMT_SEL_BY_MSISDN] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE msisdn = ?", [DB_STMT_SEL_BY_ID] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE id = ?", - [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", - [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", + [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = $number WHERE id = $subscriber_id", + [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = $number WHERE id = $subscriber_id", [DB_STMT_AUC_BY_IMSI] = "SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, ind_bitlen" " FROM subscriber" diff --git a/src/db.h b/src/db.h index 5e234ff..9d4274d 100644 --- a/src/db.h +++ b/src/db.h @@ -91,10 +91,8 @@ int db_subscr_get_by_id(struct db_context *dbc, int64_t id, struct hlr_subscriber *subscr); int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps); -int db_subscr_lu(struct db_context *dbc, - const struct hlr_subscriber *subscr, - const char *vlr_or_sgsn_number, - bool lu_is_ps); +int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, + const char *vlr_or_sgsn_number, bool is_ps); int db_subscr_purge(struct db_context *dbc, const char *imsi, bool is_ps); diff --git a/src/db_hlr.c b/src/db_hlr.c index 9bdb372..ac3c730 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -313,44 +313,46 @@ return ret; } -int db_subscr_lu(struct db_context *dbc, - const struct hlr_subscriber *subscr, - const char *vlr_or_sgsn_number, bool lu_is_ps) +int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, + const char *vlr_or_sgsn_number, bool is_ps) { - sqlite3_stmt *stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; - const char *txt; + sqlite3_stmt *stmt; int rc, ret = 0; - if (lu_is_ps) { - stmt = dbc->stmt[DB_STMT_UPD_SGSN_BY_ID]; - txt = subscr->sgsn_number; - } else { - stmt = dbc->stmt[DB_STMT_UPD_VLR_BY_ID]; - txt = subscr->vlr_number; - } + stmt = dbc->stmt[is_ps ? DB_STMT_UPD_SGSN_BY_ID + : DB_STMT_UPD_VLR_BY_ID]; - rc = sqlite3_bind_int64(stmt, 1, subscr->id); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding ID: %d\n", rc); - return -EINVAL; - } + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; - rc = sqlite3_bind_text(stmt, 2, txt, -1, SQLITE_STATIC); - if (rc != SQLITE_OK) { - LOGP(DAUC, LOGL_ERROR, "Error binding VLR/SGSN Number: %d\n", rc); - ret = -EBADMSG; - goto out; - } + if (!db_bind_text(stmt, "$number", vlr_or_sgsn_number)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { - LOGP(DAUC, LOGL_ERROR, "Error updating SQN: %d\n", rc); - ret = -ENOEXEC; + LOGP(DAUC, LOGL_ERROR, "Update %s number for subscriber ID=%"PRId64": SQL Error: %s\n", + is_ps? "SGSN" : "VLR", subscr_id, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; } + + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot update %s number for subscriber ID=%"PRId64 + ": no such subscriber\n", + is_ps? "SGSN" : "VLR", subscr_id); + ret = -ENOENT; + } else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Update %s number for subscriber ID=%"PRId64 + ": SQL modified %d rows (expected 1)\n", + is_ps? "SGSN" : "VLR", subscr_id, rc); + ret = -EIO; + } + out: db_remove_reset(stmt); - return ret; } diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 30de51d..5acd1e8 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -283,6 +283,43 @@ ASSERT_RC(db_subscr_nam(dbc, "foobar", false, true), -ENOENT); ASSERT_RC(db_subscr_nam(dbc, "foobar", false, false), -ENOENT); + comment("Record LU for PS and CS (SGSN and VLR names)"); + + ASSERT_RC(db_subscr_lu(dbc, id0, "5952", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "712", false), 0); + ASSERT_SEL(id, id0, 0); + + comment("Record LU for PS and CS (SGSN and VLR names) *again*"); + + ASSERT_RC(db_subscr_lu(dbc, id0, "111", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "111", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "222", false), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "222", false), 0); + ASSERT_SEL(id, id0, 0); + + comment("Unset LU info for PS and CS (SGSN and VLR names)"); + ASSERT_RC(db_subscr_lu(dbc, id0, "", true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "", false), 0); + ASSERT_SEL(id, id0, 0); + + ASSERT_RC(db_subscr_lu(dbc, id0, "111", true), 0); + ASSERT_RC(db_subscr_lu(dbc, id0, "222", false), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, NULL, true), 0); + ASSERT_SEL(id, id0, 0); + ASSERT_RC(db_subscr_lu(dbc, id0, NULL, false), 0); + ASSERT_SEL(id, id0, 0); + + comment("Record LU for non-existent ID"); + ASSERT_RC(db_subscr_lu(dbc, 99999, "5952", true), -ENOENT); + ASSERT_RC(db_subscr_lu(dbc, 99999, "712", false), -ENOENT); + ASSERT_SEL(id, 99999, -ENOENT); + comment("Delete non-existent / invalid IDs"); ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index f7c03d9..6e6a0ac 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -376,6 +376,143 @@ DAUC Cannot disable CS: no such subscriber: IMSI='foobar' +--- Record LU for PS and CS (SGSN and VLR names) + +db_subscr_lu(dbc, id0, "5952", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .sgsn_number = '5952', +} + +db_subscr_lu(dbc, id0, "712", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '712', + .sgsn_number = '5952', +} + + +--- Record LU for PS and CS (SGSN and VLR names) *again* + +db_subscr_lu(dbc, id0, "111", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '712', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, "111", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '712', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, "222", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, "222", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', + .sgsn_number = '111', +} + + +--- Unset LU info for PS and CS (SGSN and VLR names) + +db_subscr_lu(dbc, id0, "", true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', +} + +db_subscr_lu(dbc, id0, "", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_lu(dbc, id0, "111", true) --> 0 + +db_subscr_lu(dbc, id0, "222", false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', + .sgsn_number = '111', +} + +db_subscr_lu(dbc, id0, NULL, true) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', + .vlr_number = '222', +} + +db_subscr_lu(dbc, id0, NULL, false) --> 0 + +db_subscr_get_by_id(dbc, id0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Record LU for non-existent ID + +db_subscr_lu(dbc, 99999, "5952", true) --> -ENOENT +DAUC Cannot update SGSN number for subscriber ID=99999: no such subscriber + +db_subscr_lu(dbc, 99999, "712", false) --> -ENOENT +DAUC Cannot update VLR number for subscriber ID=99999: no such subscriber + +db_subscr_get_by_id(dbc, 99999, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: ID=99999: No such subscriber + + --- Delete non-existent / invalid IDs db_subscr_delete_by_id(dbc, 999) --> -ENOENT -- To view, visit https://gerrit.osmocom.org/4183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I35665e84ddbe54a6f218b24033df969ad2e669a0 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:36 +0000 Subject: [MERGED] osmo-hlr[master]: add db_subscr_get_by_msisdn() and db_subscr_get_by_id() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add db_subscr_get_by_msisdn() and db_subscr_get_by_id() ...................................................................... add db_subscr_get_by_msisdn() and db_subscr_get_by_id() Factor out the selected SQL columns as SEL_COLUMNS macro, so that each of the new DB_STMTs will select identical columns: the old DB_STMT_SEL_BY_IMSI as well as the new DB_STMT_SEL_BY_MSISDN and DB_STMT_SEL_BY_ID. Add the new functions db_subscr_get_by_msisdn() and db_subscr_get_by_id() and factor out common parts with db_subscr_get_by_imsi() to static db_sel(). Change-Id: I6d0ddd1b7e3f6b180b4b1b2663c5725d2a4a9428 --- M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 5 files changed, 185 insertions(+), 39 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index 179eba8..5a38d55 100644 --- a/src/db.c +++ b/src/db.c @@ -26,8 +26,25 @@ #include "logging.h" #include "db.h" +#define SEL_COLUMNS \ + "id," \ + "imsi," \ + "msisdn," \ + "vlr_number," \ + "sgsn_number," \ + "sgsn_address," \ + "periodic_lu_tmr," \ + "periodic_rau_tau_tmr," \ + "nam_cs," \ + "nam_ps," \ + "lmsi," \ + "ms_purged_cs," \ + "ms_purged_ps" + static const char *stmt_sql[] = { - [DB_STMT_SEL_BY_IMSI] = "SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?", + [DB_STMT_SEL_BY_IMSI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE imsi = ?", + [DB_STMT_SEL_BY_MSISDN] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE msisdn = ?", + [DB_STMT_SEL_BY_ID] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE id = ?", [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = ? WHERE id = ?", [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = ? WHERE id = ?", [DB_STMT_AUC_BY_IMSI] = diff --git a/src/db.h b/src/db.h index 761d88e..5ec7b72 100644 --- a/src/db.h +++ b/src/db.h @@ -5,6 +5,8 @@ enum stmt_idx { DB_STMT_SEL_BY_IMSI, + DB_STMT_SEL_BY_MSISDN, + DB_STMT_SEL_BY_ID, DB_STMT_UPD_VLR_BY_ID, DB_STMT_UPD_SGSN_BY_ID, DB_STMT_AUC_BY_IMSI, @@ -84,6 +86,10 @@ int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr); +int db_subscr_get_by_msisdn(struct db_context *dbc, const char *msisdn, + struct hlr_subscriber *subscr); +int db_subscr_get_by_id(struct db_context *dbc, int64_t id, + struct hlr_subscriber *subscr); int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable); int db_subscr_lu(struct db_context *dbc, const struct hlr_subscriber *subscr, diff --git a/src/db_hlr.c b/src/db_hlr.c index b232dfd..8df4bcb 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -154,27 +154,26 @@ } -int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, - struct hlr_subscriber *subscr) +/* Common code for db_subscr_get_by_*() functions. */ +static int db_sel(struct db_context *dbc, sqlite3_stmt *stmt, struct hlr_subscriber *subscr, + const char **err) { - sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; int rc; - - if (!db_bind_text(stmt, NULL, imsi)) - return -EINVAL; + int ret = 0; /* execute the statement */ rc = sqlite3_step(stmt); + if (rc == SQLITE_DONE) { + ret = -ENOENT; + goto out; + } if (rc != SQLITE_ROW) { - LOGHLR(imsi, LOGL_ERROR, "Error executing SQL: %d\n", rc); - db_remove_reset(stmt); - return -ENOEXEC; + ret = -EIO; + goto out; } - if (!subscr) { - db_remove_reset(stmt); - return 0; - } + if (!subscr) + goto out; /* obtain the various columns */ subscr->id = sqlite3_column_int64(stmt, 0); @@ -192,9 +191,72 @@ subscr->ms_purged_cs = sqlite3_column_int(stmt, 11); subscr->ms_purged_ps = sqlite3_column_int(stmt, 12); +out: db_remove_reset(stmt); - return 0; + switch (ret) { + case 0: + *err = NULL; + break; + case -ENOENT: + *err = "No such subscriber"; + break; + default: + *err = sqlite3_errmsg(dbc->db); + break; + } + return ret; +} + +int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, + struct hlr_subscriber *subscr) +{ + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; + const char *err; + int rc; + + if (!db_bind_text(stmt, NULL, imsi)) + return -EIO; + + rc = db_sel(dbc, stmt, subscr, &err); + if (rc) + LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: IMSI='%s': %s\n", + imsi, err); + return rc; +} + +int db_subscr_get_by_msisdn(struct db_context *dbc, const char *msisdn, + struct hlr_subscriber *subscr) +{ + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_MSISDN]; + const char *err; + int rc; + + if (!db_bind_text(stmt, NULL, msisdn)) + return -EIO; + + rc = db_sel(dbc, stmt, subscr, &err); + if (rc) + LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: MSISDN='%s': %s\n", + msisdn, err); + return rc; +} + +int db_subscr_get_by_id(struct db_context *dbc, int64_t id, + struct hlr_subscriber *subscr) +{ + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_ID]; + const char *err; + int rc; + + if (!db_bind_int64(stmt, NULL, id)) + return -EIO; + + rc = db_sel(dbc, stmt, subscr, &err); + if (rc) + LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: ID=%"PRId64": %s\n", + id, err); + return rc; } int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable) diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 9bd082e..250b363 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -70,6 +70,7 @@ static void *ctx = NULL; static struct hlr_subscriber g_subscr; static int g_rc; +static int64_t g_id; #define Pfv(name, fmt, val) \ fprintf(stderr, " ." #name " = " fmt ",\n", val) @@ -186,16 +187,16 @@ ASSERT_SEL(imsi, imsi2, 0); ASSERT_RC(db_subscr_create(dbc, "123456789 000003"), -EINVAL); - ASSERT_SEL(imsi, "123456789000003", -ENOEXEC); + ASSERT_SEL(imsi, "123456789000003", -ENOENT); ASSERT_RC(db_subscr_create(dbc, "123456789000002123456"), -EINVAL); - ASSERT_SEL(imsi, "123456789000002123456", -ENOEXEC); + ASSERT_SEL(imsi, "123456789000002123456", -ENOENT); ASSERT_RC(db_subscr_create(dbc, "foobar123"), -EINVAL); - ASSERT_SEL(imsi, "foobar123", -ENOEXEC); + ASSERT_SEL(imsi, "foobar123", -ENOENT); ASSERT_RC(db_subscr_create(dbc, "123"), -EINVAL); - ASSERT_SEL(imsi, "123", -ENOEXEC); + ASSERT_SEL(imsi, "123", -ENOENT); ASSERT_RC(db_subscr_create(dbc, short_imsi), 0); ASSERT_SEL(imsi, short_imsi, 0); @@ -207,30 +208,41 @@ ASSERT_SEL(imsi, imsi0, 0); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321"), 0); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "54321", 0); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321012345678912345678"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "54321", 0); + ASSERT_SEL(msisdn, "54321012345678912345678", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543 21"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "543 21", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "foobar123"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "foobar123", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5"), 0); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "5", 0); + ASSERT_SEL(msisdn, "54321", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543210123456789"), 0); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "543210123456789", 0); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5432101234567891"), -EINVAL); ASSERT_SEL(imsi, imsi0, 0); + ASSERT_SEL(msisdn, "5432101234567891", -ENOENT); comment("Set MSISDN on non-existent / invalid IMSI"); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99"), -ENOENT); + ASSERT_SEL(msisdn, "99", -ENOENT); ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99"), -ENOENT); + ASSERT_SEL(msisdn, "99", -ENOENT); comment("Delete non-existent / invalid IDs"); @@ -241,20 +253,20 @@ ASSERT_SEL(imsi, imsi0, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id0), 0); - ASSERT_SEL(imsi, imsi0, -ENOEXEC); + ASSERT_SEL(imsi, imsi0, -ENOENT); ASSERT_RC(db_subscr_delete_by_id(dbc, id0), -ENOENT); ASSERT_SEL(imsi, imsi1, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id1), 0); - ASSERT_SEL(imsi, imsi1, -ENOEXEC); + ASSERT_SEL(imsi, imsi1, -ENOENT); ASSERT_SEL(imsi, imsi2, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id2), 0); - ASSERT_SEL(imsi, imsi2, -ENOEXEC); + ASSERT_SEL(imsi, imsi2, -ENOENT); ASSERT_SEL(imsi, short_imsi, 0); ASSERT_RC(db_subscr_delete_by_id(dbc, id_short), 0); - ASSERT_SEL(imsi, short_imsi, -ENOEXEC); + ASSERT_SEL(imsi, short_imsi, -ENOENT); comment_end(); } diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 1b08cec..17323b5 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -68,26 +68,26 @@ db_subscr_create(dbc, "123456789 000003") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123456789 000003' -db_subscr_get_by_imsi(dbc, "123456789000003", &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000003': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "123456789000003", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000003': No such subscriber db_subscr_create(dbc, "123456789000002123456") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123456789000002123456' -db_subscr_get_by_imsi(dbc, "123456789000002123456", &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000002123456': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "123456789000002123456", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000002123456': No such subscriber db_subscr_create(dbc, "foobar123") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: 'foobar123' -db_subscr_get_by_imsi(dbc, "foobar123", &g_subscr) --> -ENOEXEC -DAUC IMSI='foobar123': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "foobar123", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='foobar123': No such subscriber db_subscr_create(dbc, "123") --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123' -db_subscr_get_by_imsi(dbc, "123", &g_subscr) --> -ENOEXEC -DAUC IMSI='123': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, "123", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123': No such subscriber db_subscr_create(dbc, short_imsi) --> 0 @@ -115,6 +115,13 @@ .msisdn = '54321', } +db_subscr_get_by_msisdn(dbc, "54321", &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321012345678912345678") --> -EINVAL DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '54321012345678912345678' @@ -124,6 +131,16 @@ .imsi = '123456789000000', .msisdn = '54321', } + +db_subscr_get_by_msisdn(dbc, "54321", &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_get_by_msisdn(dbc, "54321012345678912345678", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='54321012345678912345678': No such subscriber db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543 21") --> -EINVAL DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '543 21' @@ -135,6 +152,9 @@ .msisdn = '54321', } +db_subscr_get_by_msisdn(dbc, "543 21", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='543 21': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "foobar123") --> -EINVAL DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: 'foobar123' @@ -145,6 +165,9 @@ .msisdn = '54321', } +db_subscr_get_by_msisdn(dbc, "foobar123", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='foobar123': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5") --> 0 db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 @@ -154,9 +177,26 @@ .msisdn = '5', } +db_subscr_get_by_msisdn(dbc, "5", &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '5', +} + +db_subscr_get_by_msisdn(dbc, "54321", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='54321': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543210123456789") --> 0 db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_get_by_msisdn(dbc, "543210123456789", &g_subscr) --> 0 struct hlr_subscriber { .id = 1, .imsi = '123456789000000', @@ -173,14 +213,23 @@ .msisdn = '543210123456789', } +db_subscr_get_by_msisdn(dbc, "5432101234567891", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='5432101234567891': No such subscriber + --- Set MSISDN on non-existent / invalid IMSI db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99") --> -ENOENT DAUC Cannot update MSISDN: no such subscriber: IMSI='999999999' +db_subscr_get_by_msisdn(dbc, "99", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='99': No such subscriber + db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99") --> -ENOENT DAUC Cannot update MSISDN: no such subscriber: IMSI='foobar' + +db_subscr_get_by_msisdn(dbc, "99", &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: MSISDN='99': No such subscriber --- Delete non-existent / invalid IDs @@ -203,8 +252,8 @@ db_subscr_delete_by_id(dbc, id0) --> 0 -db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000000': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000000': No such subscriber db_subscr_delete_by_id(dbc, id0) --> -ENOENT DAUC Cannot delete: no such subscriber: ID=1 @@ -217,8 +266,8 @@ db_subscr_delete_by_id(dbc, id1) --> 0 -db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000001': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000001': No such subscriber db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 struct hlr_subscriber { @@ -228,8 +277,8 @@ db_subscr_delete_by_id(dbc, id2) --> 0 -db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456789000002': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456789000002': No such subscriber db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> 0 struct hlr_subscriber { @@ -239,8 +288,8 @@ db_subscr_delete_by_id(dbc, id_short) --> 0 -db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> -ENOEXEC -DAUC IMSI='123456': Error executing SQL: 101 +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> -ENOENT +DAUC Cannot read subscriber from db: IMSI='123456': No such subscriber ===== test_subscr_create_update_sel_delete: SUCCESS -- To view, visit https://gerrit.osmocom.org/4181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6d0ddd1b7e3f6b180b4b1b2663c5725d2a4a9428 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:36 +0000 Subject: [MERGED] osmo-hlr[master]: less noise: simplify db_remove_reset() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: less noise: simplify db_remove_reset() ...................................................................... less noise: simplify db_remove_reset() db_remove_reset() needs to be called after each stmt run, whether it succeeded or not. In case sqlite3_clear_bindings() would fail to unbind a stmt, we would anyway be beyond recovery. There seem to be no plausible situations where such failure would occur, unless there have been no bindings in the first place. In case there was an SQL stmt failure, sqlite3_reset() will re-barf the same error message, we will always have logged it earlier already in the proper context. We are never evaluating the return value, nor would we know how to recover from non-success. The conclusions: - db_remove_reset() does not need to log any errors. - db_remove_reset() does not need to return success. Change-Id: I21678463e59f607f5f5c5732963e274392f0fffd --- M src/db.c M src/db.h M tests/db/db_test.err 3 files changed, 4 insertions(+), 19 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index 7c25e63..179eba8 100644 --- a/src/db.c +++ b/src/db.c @@ -70,20 +70,10 @@ } /* remove bindings and reset statement to be re-executed */ -bool db_remove_reset(sqlite3_stmt *stmt) +void db_remove_reset(sqlite3_stmt *stmt) { - int rc = sqlite3_clear_bindings(stmt); - if (rc != SQLITE_OK) { - LOGP(DDB, LOGL_ERROR, "Error clerearing bindings: %d\n", rc); - return false; - } - - rc = sqlite3_reset(stmt); - if (rc != SQLITE_OK) { - LOGP(DDB, LOGL_ERROR, "Error in sqlite3_reset: %d\n", rc); - return false; - } - return true; + sqlite3_clear_bindings(stmt); + sqlite3_reset(stmt); } /** bind text arg and do proper cleanup in case of failure. If param_name is diff --git a/src/db.h b/src/db.h index d7a8303..ee2d801 100644 --- a/src/db.h +++ b/src/db.h @@ -25,7 +25,7 @@ sqlite3_stmt *stmt[_NUM_DB_STMT]; }; -bool db_remove_reset(sqlite3_stmt *stmt); +void db_remove_reset(sqlite3_stmt *stmt); bool db_bind_text(sqlite3_stmt *stmt, const char *param_name, const char *text); bool db_bind_int(sqlite3_stmt *stmt, const char *param_name, int nr); bool db_bind_int64(sqlite3_stmt *stmt, const char *param_name, int64_t nr); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index ac0e2f1..1b08cec 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -29,7 +29,6 @@ db_subscr_create(dbc, imsi0) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000000': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 @@ -40,12 +39,10 @@ db_subscr_create(dbc, imsi1) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_create(dbc, imsi1) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 @@ -56,12 +53,10 @@ db_subscr_create(dbc, imsi2) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_create(dbc, imsi2) --> -EIO DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi -DDB Error in sqlite3_reset: 2067 DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 -- To view, visit https://gerrit.osmocom.org/4179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I21678463e59f607f5f5c5732963e274392f0fffd Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:37 +0000 Subject: [MERGED] osmo-hlr[master]: db: use int64_t as subscriber id In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: db: use int64_t as subscriber id ...................................................................... db: use int64_t as subscriber id The SQLite db does not support uint64_t, and we are always binding the uint64_t id actually as signed int64_t. Hence be consistent and actually handle it as int64_t in the code as well. This means that if we ever see a negative subscriber ID in the SQL database (however unlikely), we will also see it negative in our log output. The SQN handled in osmo_auth* is actually of unsigned type, and, unless we store the SQN as 64bit hex string, we are forced to feed this unsigned value as signed int64_t to the SQLite API. The upcoming db regression test for SQN in change-id I0d870d405e2e0a830360d9ad19f0a3f9e09d8cf2 verifies that the SQN uint64_t translates to signed int64_t and back as expected. Change-Id: I83a47289a48ac37da0f712845d422e897a5e8171 --- M src/db.h M src/db_auc.c 2 files changed, 6 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.h b/src/db.h index ee2d801..761d88e 100644 --- a/src/db.h +++ b/src/db.h @@ -38,9 +38,9 @@ int db_get_auth_data(struct db_context *dbc, const char *imsi, struct osmo_sub_auth_data *aud2g, struct osmo_sub_auth_data *aud3g, - uint64_t *suscr_id); + int64_t *subscr_id); -int db_update_sqn(struct db_context *dbc, uint64_t id, +int db_update_sqn(struct db_context *dbc, int64_t id, uint64_t new_sqn); int db_get_auc(struct db_context *dbc, const char *imsi, @@ -57,7 +57,7 @@ struct hlr_subscriber { struct llist_head list; - uint64_t id; + int64_t id; char imsi[GSM23003_IMSI_MAX_DIGITS+1]; char msisdn[GT_MAX_DIGITS+1]; /* imeisv? */ diff --git a/src/db_auc.c b/src/db_auc.c index 7aad06d..71c7262 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -33,7 +33,7 @@ #define LOGAUC(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) /* update the SQN for a given subscriber ID */ -int db_update_sqn(struct db_context *dbc, uint64_t id, +int db_update_sqn(struct db_context *dbc, int64_t id, uint64_t new_sqn) { sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_UPD_SQN]; @@ -77,7 +77,7 @@ int db_get_auth_data(struct db_context *dbc, const char *imsi, struct osmo_sub_auth_data *aud2g, struct osmo_sub_auth_data *aud3g, - uint64_t *subscr_id) + int64_t *subscr_id) { sqlite3_stmt *stmt = dbc->stmt[DB_STMT_AUC_BY_IMSI]; int ret = 0; @@ -192,7 +192,7 @@ const uint8_t *auts) { struct osmo_sub_auth_data aud2g, aud3g; - uint64_t subscr_id; + int64_t subscr_id; int ret = 0; int rc; -- To view, visit https://gerrit.osmocom.org/4180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I83a47289a48ac37da0f712845d422e897a5e8171 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:37 +0000 Subject: [MERGED] osmo-hlr[master]: add initial db_test: creating and deleting subscribers In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add initial db_test: creating and deleting subscribers ...................................................................... add initial db_test: creating and deleting subscribers Change-Id: I2a0d277f55162bf5ceb0fc7d50390f2994daed71 --- M configure.ac M tests/Makefile.am A tests/db/Makefile.am A tests/db/db_test.c A tests/db/db_test.err A tests/db/db_test.ok M tests/testsuite.at 7 files changed, 662 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 167d7f3..1db32d4 100644 --- a/configure.ac +++ b/configure.ac @@ -70,4 +70,5 @@ tests/auc/Makefile tests/auc/gen_ts_55_205_test_sets/Makefile tests/gsup_server/Makefile + tests/db/Makefile ) diff --git a/tests/Makefile.am b/tests/Makefile.am index d979fb6..0b625f5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,7 @@ SUBDIRS = \ auc \ gsup_server \ + db \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am new file mode 100644 index 0000000..a1f35a7 --- /dev/null +++ b/tests/db/Makefile.am @@ -0,0 +1,53 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/src \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(SQLITE3_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(NULL) + +EXTRA_DIST = \ + db_test.ok \ + db_test.err \ + $(NULL) + +check_PROGRAMS = db_test + +db_test_SOURCES = \ + db_test.c \ + $(NULL) + +db_test_LDADD = \ + $(top_srcdir)/src/db.c \ + $(top_srcdir)/src/db_hlr.c \ + $(top_srcdir)/src/db_auc.c \ + $(top_srcdir)/src/logging.c \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(SQLITE3_LIBS) \ + $(NULL) + +.PHONY: db_test.db update_exp manual manual-nonverbose manual-gdb +db_test.db: + rm -f db_test.db + sqlite3 $(builddir)/db_test.db < $(top_srcdir)/sql/hlr.sql + +update_exp: db_test.db + cd $(builddir); ./db_test >"$(srcdir)/db_test.ok" 2>"$(srcdir)/db_test.err" + +manual: db_test.db + cd $(builddir); ./db_test -v + +manual-nonverbose: db_test.db + cd $(builddir); ./db_test + +manual-gdb: db_test.db + cd $(builddir); gdb -ex run --args ./db_test -v diff --git a/tests/db/db_test.c b/tests/db/db_test.c new file mode 100644 index 0000000..9bd082e --- /dev/null +++ b/tests/db/db_test.c @@ -0,0 +1,346 @@ +/* (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "db.h" +#include "logging.h" + +#define comment_start() fprintf(stderr, "\n===== %s\n", __func__); +#define comment(fmt, args...) fprintf(stderr, "\n--- " fmt "\n\n", ## args); +#define comment_end() fprintf(stderr, "===== %s: SUCCESS\n\n", __func__); + +/* Perform a function call and verbosely assert that its return value is as expected. + * The return code is then available in g_rc. */ +#define ASSERT_RC(call, expect_rc) \ + do { \ + fprintf(stderr, #call " --> " #expect_rc "\n"); \ + g_rc = call; \ + if (g_rc != (expect_rc)) \ + fprintf(stderr, " MISMATCH: got rc = %d, expected: " \ + #expect_rc " = %d\n", g_rc, expect_rc); \ + OSMO_ASSERT(g_rc == (expect_rc)); \ + fprintf(stderr, "\n"); \ + } while (0) + +/* Do db_subscr_get_by_xxxx and verbosely assert that its return value is as expected. + * Print the subscriber struct to stderr to be validated by db_test.err. + * The result is then available in g_subscr. */ +#define ASSERT_SEL(by, val, expect_rc) \ + do { \ + int rc; \ + g_subscr = (struct hlr_subscriber){}; \ + fprintf(stderr, "db_subscr_get_by_" #by "(dbc, " #val ", &g_subscr) --> " \ + #expect_rc "\n"); \ + rc = db_subscr_get_by_##by(dbc, val, &g_subscr); \ + if (rc != (expect_rc)) \ + fprintf(stderr, " MISMATCH: got rc = %d, expected: " \ + #expect_rc " = %d\n", rc, expect_rc); \ + OSMO_ASSERT(rc == (expect_rc)); \ + if (!rc) \ + dump_subscr(&g_subscr); \ + fprintf(stderr, "\n"); \ + } while (0) + +static struct db_context *dbc = NULL; +static void *ctx = NULL; +static struct hlr_subscriber g_subscr; +static int g_rc; + +#define Pfv(name, fmt, val) \ + fprintf(stderr, " ." #name " = " fmt ",\n", val) +#define Pfo(name, fmt, obj) \ + Pfv(name, fmt, obj->name) + +/* Print a subscriber struct to stderr to be validated by db_test.err. */ +void dump_subscr(struct hlr_subscriber *subscr) +{ +#define Ps(name) \ + if (*subscr->name) \ + Pfo(name, "'%s'", subscr) +#define Pd(name) \ + Pfv(name, "%"PRId64, (int64_t)subscr->name) +#define Pd_nonzero(name) \ + if (subscr->name) \ + Pd(name) +#define Pb(if_val, name) \ + if (subscr->name == (if_val)) \ + Pfv(name, "%s", subscr->name ? "true" : "false") + + fprintf(stderr, "struct hlr_subscriber {\n"); + Pd(id); + Ps(imsi); + Ps(msisdn); + Ps(vlr_number); + Ps(sgsn_number); + Ps(sgsn_address); + Pd_nonzero(periodic_lu_timer); + Pd_nonzero(periodic_rau_tau_timer); + Pb(false, nam_cs); + Pb(false, nam_ps); + if (subscr->lmsi) + Pfo(lmsi, "0x%x", subscr); + Pb(true, ms_purged_cs); + Pb(true, ms_purged_ps); + fprintf(stderr, "}\n"); +#undef Ps +#undef Pd +#undef Pd_nonzero +#undef Pb +} + +void dump_aud(const char *label, struct osmo_sub_auth_data *aud) +{ + if (aud->type == OSMO_AUTH_TYPE_NONE) { + fprintf(stderr, "%s: none\n", label); + return; + } + + fprintf(stderr, "%s: struct osmo_sub_auth_data {\n", label); +#define Pf(name, fmt) \ + Pfo(name, fmt, aud) +#define Phex(name) \ + Pfv(name, "'%s'", osmo_hexdump_nospc(aud->name, sizeof(aud->name))) + + Pfv(type, "%s", osmo_sub_auth_type_name(aud->type)); + Pfv(algo, "%s", osmo_auth_alg_name(aud->algo)); + switch (aud->type) { + case OSMO_AUTH_TYPE_GSM: + Phex(u.gsm.ki); + break; + case OSMO_AUTH_TYPE_UMTS: + Phex(u.umts.opc); + Pf(u.umts.opc_is_op, "%u"); + Phex(u.umts.k); + Phex(u.umts.amf); + if (aud->u.umts.sqn) { + Pf(u.umts.sqn, "%"PRIu64); + Pf(u.umts.sqn, "0x%"PRIx64); + } + if (aud->u.umts.ind_bitlen) + Pf(u.umts.ind_bitlen, "%u"); + break; + default: + OSMO_ASSERT(false); + } + + fprintf(stderr, "}\n"); + +#undef Pf +#undef Phex +} + +static const char *imsi0 = "123456789000000"; +static const char *imsi1 = "123456789000001"; +static const char *imsi2 = "123456789000002"; +static const char *short_imsi = "123456"; +static const char *unknown_imsi = "999999999"; + +static void test_subscr_create_update_sel_delete() +{ + int64_t id0, id1, id2, id_short; + comment_start(); + + comment("Create with valid / invalid IMSI"); + + ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_SEL(imsi, imsi0, 0); + id0 = g_subscr.id; + ASSERT_RC(db_subscr_create(dbc, imsi1), 0); + ASSERT_SEL(imsi, imsi1, 0); + id1 = g_subscr.id; + ASSERT_RC(db_subscr_create(dbc, imsi2), 0); + ASSERT_SEL(imsi, imsi2, 0); + id2 = g_subscr.id; + ASSERT_RC(db_subscr_create(dbc, imsi0), -EIO); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_create(dbc, imsi1), -EIO); + ASSERT_RC(db_subscr_create(dbc, imsi1), -EIO); + ASSERT_SEL(imsi, imsi1, 0); + ASSERT_RC(db_subscr_create(dbc, imsi2), -EIO); + ASSERT_RC(db_subscr_create(dbc, imsi2), -EIO); + ASSERT_SEL(imsi, imsi2, 0); + + ASSERT_RC(db_subscr_create(dbc, "123456789 000003"), -EINVAL); + ASSERT_SEL(imsi, "123456789000003", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, "123456789000002123456"), -EINVAL); + ASSERT_SEL(imsi, "123456789000002123456", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, "foobar123"), -EINVAL); + ASSERT_SEL(imsi, "foobar123", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, "123"), -EINVAL); + ASSERT_SEL(imsi, "123", -ENOEXEC); + + ASSERT_RC(db_subscr_create(dbc, short_imsi), 0); + ASSERT_SEL(imsi, short_imsi, 0); + id_short = g_subscr.id; + + + comment("Set valid / invalid MSISDN"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321"), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "54321012345678912345678"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "543 21"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "foobar123"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "5"), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "543210123456789"), 0); + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, imsi0, + "5432101234567891"), -EINVAL); + ASSERT_SEL(imsi, imsi0, 0); + + comment("Set MSISDN on non-existent / invalid IMSI"); + + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99"), -ENOENT); + + ASSERT_RC(db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99"), -ENOENT); + + comment("Delete non-existent / invalid IDs"); + + ASSERT_RC(db_subscr_delete_by_id(dbc, 999), -ENOENT); + ASSERT_RC(db_subscr_delete_by_id(dbc, -10), -ENOENT); + + comment("Delete subscribers"); + + ASSERT_SEL(imsi, imsi0, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id0), 0); + ASSERT_SEL(imsi, imsi0, -ENOEXEC); + ASSERT_RC(db_subscr_delete_by_id(dbc, id0), -ENOENT); + + ASSERT_SEL(imsi, imsi1, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id1), 0); + ASSERT_SEL(imsi, imsi1, -ENOEXEC); + + ASSERT_SEL(imsi, imsi2, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id2), 0); + ASSERT_SEL(imsi, imsi2, -ENOEXEC); + + ASSERT_SEL(imsi, short_imsi, 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id_short), 0); + ASSERT_SEL(imsi, short_imsi, -ENOEXEC); + + comment_end(); +} + +static struct { + bool verbose; +} cmdline_opts = { + .verbose = false, +}; + +static void print_help(const char *program) +{ + printf("Usage:\n" + " %s [-v] [N [N...]]\n" + "Options:\n" + " -h --help show this text.\n" + " -v --verbose print source file and line numbers\n", + program + ); +} + +static void handle_options(int argc, char **argv) +{ + while (1) { + int option_index = 0, c; + static struct option long_options[] = { + {"help", 0, 0, 'h'}, + {"verbose", 1, 0, 'v'}, + {0, 0, 0, 0} + }; + + c = getopt_long(argc, argv, "hv", + long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_help(argv[0]); + exit(0); + case 'v': + cmdline_opts.verbose = true; + break; + default: + /* catch unknown options *as well as* missing arguments. */ + fprintf(stderr, "Error in command line options. Exiting.\n"); + exit(-1); + break; + } + } + + if (optind < argc) { + fprintf(stderr, "too many args\n"); + exit(-1); + } +} + +int main(int argc, char **argv) +{ + printf("db_test.c\n"); + + ctx = talloc_named_const(NULL, 1, "db_test"); + + handle_options(argc, argv); + + osmo_init_logging(&hlr_log_info); + log_set_print_filename(osmo_stderr_target, cmdline_opts.verbose); + log_set_print_timestamp(osmo_stderr_target, 0); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_category(osmo_stderr_target, 1); + + /* omit the SQLite version and compilation flags from test output */ + log_set_log_level(osmo_stderr_target, LOGL_ERROR); + dbc = db_open(ctx, "db_test.db"); + log_set_log_level(osmo_stderr_target, 0); + OSMO_ASSERT(dbc); + + test_subscr_create_update_sel_delete(); + + printf("Done\n"); + return 0; +} + +/* stubs */ +int auc_compute_vectors(struct osmo_auth_vector *vec, unsigned int num_vec, + struct osmo_sub_auth_data *aud2g, + struct osmo_sub_auth_data *aud3g, + const uint8_t *rand_auts, const uint8_t *auts) +{ OSMO_ASSERT(false); return -1; } diff --git a/tests/db/db_test.err b/tests/db/db_test.err new file mode 100644 index 0000000..ac0e2f1 --- /dev/null +++ b/tests/db/db_test.err @@ -0,0 +1,251 @@ + +===== test_subscr_create_update_sel_delete + +--- Create with valid / invalid IMSI + +db_subscr_create(dbc, imsi0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_create(dbc, imsi1) --> 0 + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 2, + .imsi = '123456789000001', +} + +db_subscr_create(dbc, imsi2) --> 0 + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 3, + .imsi = '123456789000002', +} + +db_subscr_create(dbc, imsi0) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000000': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_create(dbc, imsi1) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_create(dbc, imsi1) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 2, + .imsi = '123456789000001', +} + +db_subscr_create(dbc, imsi2) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_create(dbc, imsi2) --> -EIO +DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB Error in sqlite3_reset: 2067 +DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 3, + .imsi = '123456789000002', +} + +db_subscr_create(dbc, "123456789 000003") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: '123456789 000003' + +db_subscr_get_by_imsi(dbc, "123456789000003", &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000003': Error executing SQL: 101 + +db_subscr_create(dbc, "123456789000002123456") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: '123456789000002123456' + +db_subscr_get_by_imsi(dbc, "123456789000002123456", &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000002123456': Error executing SQL: 101 + +db_subscr_create(dbc, "foobar123") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: 'foobar123' + +db_subscr_get_by_imsi(dbc, "foobar123", &g_subscr) --> -ENOEXEC +DAUC IMSI='foobar123': Error executing SQL: 101 + +db_subscr_create(dbc, "123") --> -EINVAL +DAUC Cannot create subscriber: invalid IMSI: '123' + +db_subscr_get_by_imsi(dbc, "123", &g_subscr) --> -ENOEXEC +DAUC IMSI='123': Error executing SQL: 101 + +db_subscr_create(dbc, short_imsi) --> 0 + +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 4, + .imsi = '123456', +} + + +--- Set valid / invalid MSISDN + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321") --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "54321012345678912345678") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '54321012345678912345678' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543 21") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '543 21' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "foobar123") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: 'foobar123' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '54321', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5") --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '5', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543210123456789") --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5432101234567891") --> -EINVAL +DAUC IMSI='123456789000000': Cannot update subscriber: invalid MSISDN: '5432101234567891' + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + + +--- Set MSISDN on non-existent / invalid IMSI + +db_subscr_update_msisdn_by_imsi(dbc, unknown_imsi, "99") --> -ENOENT +DAUC Cannot update MSISDN: no such subscriber: IMSI='999999999' + +db_subscr_update_msisdn_by_imsi(dbc, "foobar", "99") --> -ENOENT +DAUC Cannot update MSISDN: no such subscriber: IMSI='foobar' + + +--- Delete non-existent / invalid IDs + +db_subscr_delete_by_id(dbc, 999) --> -ENOENT +DAUC Cannot delete: no such subscriber: ID=999 + +db_subscr_delete_by_id(dbc, -10) --> -ENOENT +DAUC Cannot delete: no such subscriber: ID=-10 + + +--- Delete subscribers + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .msisdn = '543210123456789', +} + +db_subscr_delete_by_id(dbc, id0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000000': Error executing SQL: 101 + +db_subscr_delete_by_id(dbc, id0) --> -ENOENT +DAUC Cannot delete: no such subscriber: ID=1 + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 2, + .imsi = '123456789000001', +} + +db_subscr_delete_by_id(dbc, id1) --> 0 + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000001': Error executing SQL: 101 + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 3, + .imsi = '123456789000002', +} + +db_subscr_delete_by_id(dbc, id2) --> 0 + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456789000002': Error executing SQL: 101 + +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 4, + .imsi = '123456', +} + +db_subscr_delete_by_id(dbc, id_short) --> 0 + +db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> -ENOEXEC +DAUC IMSI='123456': Error executing SQL: 101 + +===== test_subscr_create_update_sel_delete: SUCCESS + diff --git a/tests/db/db_test.ok b/tests/db/db_test.ok new file mode 100644 index 0000000..26cefd1 --- /dev/null +++ b/tests/db/db_test.ok @@ -0,0 +1,2 @@ +db_test.c +Done diff --git a/tests/testsuite.at b/tests/testsuite.at index a969082..74179e7 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -21,3 +21,11 @@ cat $abs_srcdir/gsup_server/gsup_server_test.err > experr AT_CHECK([$abs_top_builddir/tests/gsup_server/gsup_server_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([db]) +AT_KEYWORDS([db]) +cat $abs_srcdir/db/db_test.ok > expout +cat $abs_srcdir/db/db_test.err > experr +sqlite3 db_test.db < $abs_top_srcdir/sql/hlr.sql +AT_CHECK([$abs_top_builddir/tests/db/db_test], [], [expout], [experr]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2a0d277f55162bf5ceb0fc7d50390f2994daed71 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:37 +0000 Subject: [MERGED] osmo-hlr[master]: add db_bind_int() and db_bind_int64() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add db_bind_int() and db_bind_int64() ...................................................................... add db_bind_int() and db_bind_int64() Will be used in upcoming patches, e.g. change-IDs - I6e70e15228f5bb10bee6758ae5dc9687d65839bd - I83a47289a48ac37da0f712845d422e897a5e8171 Change-Id: I705a15eef242c98feb6e95a883916f6cf8173d70 --- M src/db.c M src/db.h 2 files changed, 46 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index cc45db3..463eeb4 100644 --- a/src/db.c +++ b/src/db.c @@ -105,6 +105,50 @@ return true; } +/** bind int arg and do proper cleanup in case of failure. If param_name is + * NULL, bind to the first parameter (useful for SQL statements that have only + * one parameter). */ +bool db_bind_int(sqlite3_stmt *stmt, const char *param_name, int nr) +{ + int rc; + int idx = param_name ? sqlite3_bind_parameter_index(stmt, param_name) : 1; + if (idx < 1) { + LOGP(DDB, LOGL_ERROR, "Error composing SQL, cannot bind parameter '%s'\n", + param_name); + return false; + } + rc = sqlite3_bind_int(stmt, idx, nr); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "Error binding int64 to SQL parameter %s: %d\n", + param_name ? param_name : "#1", rc); + db_remove_reset(stmt); + return false; + } + return true; +} + +/** bind int64 arg and do proper cleanup in case of failure. If param_name is + * NULL, bind to the first parameter (useful for SQL statements that have only + * one parameter). */ +bool db_bind_int64(sqlite3_stmt *stmt, const char *param_name, int64_t nr) +{ + int rc; + int idx = param_name ? sqlite3_bind_parameter_index(stmt, param_name) : 1; + if (idx < 1) { + LOGP(DDB, LOGL_ERROR, "Error composing SQL, cannot bind parameter '%s'\n", + param_name); + return false; + } + rc = sqlite3_bind_int64(stmt, idx, nr); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "Error binding int64 to SQL parameter %s: %d\n", + param_name ? param_name : "#1", rc); + db_remove_reset(stmt); + return false; + } + return true; +} + void db_close(struct db_context *dbc) { unsigned int i; diff --git a/src/db.h b/src/db.h index 6d6723a..533c4d2 100644 --- a/src/db.h +++ b/src/db.h @@ -24,6 +24,8 @@ bool db_remove_reset(sqlite3_stmt *stmt); bool db_bind_text(sqlite3_stmt *stmt, const char *param_name, const char *text); +bool db_bind_int(sqlite3_stmt *stmt, const char *param_name, int nr); +bool db_bind_int64(sqlite3_stmt *stmt, const char *param_name, int64_t nr); void db_close(struct db_context *dbc); struct db_context *db_open(void *ctx, const char *fname); -- To view, visit https://gerrit.osmocom.org/4176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I705a15eef242c98feb6e95a883916f6cf8173d70 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:37 +0000 Subject: [MERGED] osmo-hlr[master]: add db_subscr_create(), db_subscr_delete(), db_subscr_update... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add db_subscr_create(), db_subscr_delete(), db_subscr_update_msisdn_by_imsi() ...................................................................... add db_subscr_create(), db_subscr_delete(), db_subscr_update_msisdn_by_imsi() These will be needed by VTY commands to create, delete and modify subscribers. Auth data editing will follow in another patch. The FIXME "also remove authentication data from auc_2g and auc_3g" will get fixed in change-id Icb11b5e059fb920447a9aa414db1819a0c020529. Change-Id: I725273d36234331093e7fff7d5f12f6be6ab2623 --- M src/db.c M src/db.h M src/db_hlr.c 3 files changed, 128 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index 463eeb4..7c25e63 100644 --- a/src/db.c +++ b/src/db.c @@ -41,6 +41,9 @@ [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?", [DB_STMT_SET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=1 WHERE imsi = ?", [DB_STMT_UNSET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=0 WHERE imsi = ?", + [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", + [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id", + [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi", }; static void sql3_error_log_cb(void *arg, int err_code, const char *msg) diff --git a/src/db.h b/src/db.h index 533c4d2..d7a8303 100644 --- a/src/db.h +++ b/src/db.h @@ -13,6 +13,9 @@ DB_STMT_UPD_PURGE_PS_BY_IMSI, DB_STMT_SET_NAM_PS_BY_IMSI, DB_STMT_UNSET_NAM_PS_BY_IMSI, + DB_STMT_SUBSCR_CREATE, + DB_STMT_DEL_BY_ID, + DB_STMT_SET_MSISDN_BY_IMSI, _NUM_DB_STMT }; @@ -73,6 +76,12 @@ bool ms_purged_ps; }; +int db_subscr_create(struct db_context *dbc, const char *imsi); +int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id); + +int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, + const char *msisdn); + int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr); int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable); diff --git a/src/db_hlr.c b/src/db_hlr.c index 5db2c9e..b232dfd 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -19,9 +19,11 @@ #include #include +#include #include #include +#include #include @@ -38,6 +40,120 @@ x[sizeof(x)-1] = '\0'; \ } while (0) +int db_subscr_create(struct db_context *dbc, const char *imsi) +{ + sqlite3_stmt *stmt; + int rc; + + if (!osmo_imsi_str_valid(imsi)) { + LOGP(DAUC, LOGL_ERROR, "Cannot create subscriber: invalid IMSI: '%s'\n", + imsi); + return -EINVAL; + } + + stmt = dbc->stmt[DB_STMT_SUBSCR_CREATE]; + + if (!db_bind_text(stmt, "$imsi", imsi)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); + db_remove_reset(stmt); + if (rc != SQLITE_DONE) { + LOGHLR(imsi, LOGL_ERROR, "Cannot create subscriber: SQL error: (%d) %s\n", + rc, sqlite3_errmsg(dbc->db)); + return -EIO; + } + + return 0; +} + +int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id) +{ + int rc; + int ret = 0; + + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_DEL_BY_ID]; + + if (!db_bind_int64(stmt, "$subscriber_id", subscr_id)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGP(DAUC, LOGL_ERROR, + "Cannot delete subscriber ID=%"PRId64": SQL error: (%d) %s\n", + subscr_id, rc, sqlite3_errmsg(dbc->db)); + db_remove_reset(stmt); + return -EIO; + } + + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot delete: no such subscriber: ID=%"PRId64"\n", + subscr_id); + ret = -ENOENT; + } else if (rc != 1) { + LOGP(DAUC, LOGL_ERROR, "Delete subscriber ID=%"PRId64 + ": SQL modified %d rows (expected 1)\n", subscr_id, rc); + ret = -EIO; + } + + /* FIXME: also remove authentication data from auc_2g and auc_3g */ + + db_remove_reset(stmt); + return ret; +} + +int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, + const char *msisdn) +{ + int rc; + int ret = 0; + + if (!osmo_msisdn_str_valid(msisdn)) { + LOGHLR(imsi, LOGL_ERROR, + "Cannot update subscriber: invalid MSISDN: '%s'\n", + msisdn); + return -EINVAL; + } + + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SET_MSISDN_BY_IMSI]; + + if (!db_bind_text(stmt, "$imsi", imsi)) + return -EIO; + if (!db_bind_text(stmt, "$msisdn", msisdn)) + return -EIO; + + /* execute the statement */ + rc = sqlite3_step(stmt); + if (rc != SQLITE_DONE) { + LOGHLR(imsi, LOGL_ERROR, + "Cannot update subscriber's MSISDN: SQL error: (%d) %s\n", + rc, sqlite3_errmsg(dbc->db)); + ret = -EIO; + goto out; + } + + /* verify execution result */ + rc = sqlite3_changes(dbc->db); + if (!rc) { + LOGP(DAUC, LOGL_ERROR, "Cannot update MSISDN: no such subscriber: IMSI='%s'\n", + imsi); + ret = -ENOENT; + goto out; + } else if (rc != 1) { + LOGHLR(imsi, LOGL_ERROR, "Update MSISDN: SQL modified %d rows (expected 1)\n", rc); + ret = -EIO; + } + +out: + db_remove_reset(stmt); + return ret; + +} + int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr) { -- To view, visit https://gerrit.osmocom.org/4177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I725273d36234331093e7fff7d5f12f6be6ab2623 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:02:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:02:38 +0000 Subject: [MERGED] osmo-hlr[master]: cosmetic: don't log about missing SQLite log cb In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: don't log about missing SQLite log cb ...................................................................... cosmetic: don't log about missing SQLite log cb SQLite3 seems to be commonly compiled without log callback support. It is then misleading to see a seeming error message about this on each osmo-hlr startup. Avoid the impression that we would miss out on important logging: query sqlit3_compileoption_get() whether SQLITE_CONFIG_SQLLOG is enabled. Try to register the callback only if present, if not, say so on DEBUG log. See https://sqlite.org/compile.html "SQLITE_ENABLE_SQLLOG" Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 --- M src/db.c 1 file changed, 11 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index 0ece61b..cc45db3 100644 --- a/src/db.c +++ b/src/db.c @@ -21,6 +21,7 @@ #include #include +#include #include "logging.h" #include "db.h" @@ -121,6 +122,7 @@ struct db_context *dbc = talloc_zero(ctx, struct db_context); unsigned int i; int rc; + bool has_sqlite_config_sqllog = false; LOGP(DDB, LOGL_NOTICE, "using database: %s\n", fname); LOGP(DDB, LOGL_INFO, "Compiled against SQLite3 lib version %s\n", SQLITE_VERSION); @@ -133,15 +135,21 @@ if (!o) break; LOGP(DDB, LOGL_DEBUG, "SQLite3 compiled with '%s'\n", o); + if (!strcmp(o, "ENABLE_SQLLOG")) + has_sqlite_config_sqllog = true; } rc = sqlite3_config(SQLITE_CONFIG_LOG, sql3_error_log_cb, NULL); if (rc != SQLITE_OK) LOGP(DDB, LOGL_NOTICE, "Unable to set SQLite3 error log callback\n"); - rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); - if (rc != SQLITE_OK) - LOGP(DDB, LOGL_NOTICE, "Unable to set SQLite3 SQL statement log callback\n"); + if (has_sqlite_config_sqllog) { + rc = sqlite3_config(SQLITE_CONFIG_SQLLOG, sql3_sql_log_cb, NULL); + if (rc != SQLITE_OK) + LOGP(DDB, LOGL_NOTICE, "Unable to set SQLite3 SQL log callback\n"); + } else + LOGP(DDB, LOGL_DEBUG, "Not setting SQL log callback:" + " SQLite3 compiled without support for it\n"); rc = sqlite3_open(dbc->fname, &dbc->db); if (rc != SQLITE_OK) { -- To view, visit https://gerrit.osmocom.org/4175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I78d75dc351eb587b0a022f82f147e9a31c0324c5 Gerrit-PatchSet: 6 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:23:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:23:39 +0000 Subject: osmo-mgw[master]: protocol: allow wildcarded DLCX In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/4227/1//COMMIT_MSG Commit Message: Line 14: id is supplied with the DLCX command. is a missing call id compliant with MGCP? https://gerrit.osmocom.org/#/c/4227/1/src/libosmo-mgcp/mgcp_protocol.c File src/libosmo-mgcp/mgcp_protocol.c: Line 911: if (mgcp_parse_ci(&conn_id, ci)) { mgcp_parse_ci() returns non-null in only this case: if (!ci) return -1; It fails to properly detect errors in the ci string, for !*ci and in case strtoull() returns errors. The way it is now, it leaves the conn_id unchanged if I pass in an empty or non-numeric string, which is certainly not what we want. If that is fixed though, this condition here should rather not be if (mgcp_parse_ci()) because a non-numeric conn id would trigger an error rc and then drop all active connections -_- I think a keyword instead of empty would be a better approach? So I think this should either be if (!ci || !*ci) { delete all conns return; } if (mgcp_parse_ci()) { error handling } or if (!strcmp(ci, "ALL")) { delete all conns return; } if (mgcp_parse_ci()) { error handling } and mgcp_parse_ci() should return errors properly. Line 916: /* Appereantly no connection id had been supplied, this 'Apparently' 'has been' -- To view, visit https://gerrit.osmocom.org/4227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 11 22:24:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 22:24:22 +0000 Subject: osmo-ggsn[master]: create_context_ind(): Fix crash on apn not found In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4ec74e87aaf1d067dd1717d986673be56c4d6ed Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 11 23:02:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 23:02:29 +0000 Subject: osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Patch Set 5: Code-Review-1 (12 comments) -1 for mem leaks and missing rc eval. The rest is up to you to reflect on. https://gerrit.osmocom.org/#/c/4146/5//COMMIT_MSG Commit Message: Line 22: Change-Id I15e1af68616309555d0ed9ac5da027c9833d42e3 (I usually do it as Depends: libosmocore I12345678abcdef ) https://gerrit.osmocom.org/#/c/4146/5/include/osmocom/mgcp_client/mgcp_client.h File include/osmocom/mgcp_client/mgcp_client.h: Line 61: /* See MGCP_MSG_PRESENCE_* constands above */ 'constants' (and maybe drop the 'above', just in case we were to move those defines around in some distant future) Line 67: char *audio_ip; reading this, there is a potential ownership problem here. Or is there? Given a struct mgcp_msg is passed around several functions, the char *audio_ip must be owned by the struct mgcp_msg. Ok, we can do it by a talloc that uses the struct mgcp_msg as talloc ctx. Above char endpoint[] solves it by providing a fixed buffer. Here we could do the same as char audio_ip[INET_ADDRSTRLEN]; This would cause more memcpy()s but less talloc()s. Please clarify what is intended... Line 97: OSMO_DEPRECATED("Use mgcp_msg_gen() instead") all instances of OSMO_DEPRECATED() I can find in current code follow after the function definition, i.e. between ')' and ';'. Am I missing something? Ah, there is one like this libosmocore/gsm/abis_nm.c. If it works above the function, I find it more readable actually; so I would favor above, unless others disagree and prefer staying consistent with the other code style we have. https://gerrit.osmocom.org/#/c/4146/5/src/libosmo-mgcp-client/mgcp_client.c File src/libosmo-mgcp-client/mgcp_client.c: Line 662: "Invalid command verb, can not generate MGCP message"); leaking msgb alloc'd above Line 669: "One or more missing mandatory fields, can not generate MGCP message"); leaking msgb Line 678: msgb_printf(msg, " MGCP 1.0\r\n"); evaluate return code Line 708: whitespace Line 709: if (rc != 0) { so IIUC msgb_printf() returns 0 on success, and you first go through all composition steps; if one of them failed anywhere, adding up the rc brings a nonzero here and we can return an error. I would have expected a if (rc) goto out_err; after each msgb_printf() step ... but now that I think of it, it's probably fine to do it this way. After all we don't need to optimize for a msgb-too-small case. https://gerrit.osmocom.org/#/c/4146/5/tests/mgcp_client/mgcp_client_test.c File tests/mgcp_client/mgcp_client_test.c: Line 164: strcpy(ip_buf, "192.168.100.23"); ok, it's safe. (for cosmetics I'd prefer if we used osmo_strlcpy() always and everywhere. as you see fit.) btw, it's also possible to init with a string constant above like char *ip_buf[INET_ADDRSTRLEN] = "yada yada"; and BTW furthermore, for a char* you can just assign a string constant in the first place: mgcp_msg.audio_ip = "yada yada"; and furthermore, why not: struct mgcp_msg mgcp_msg = { .audio_ip = "my string constant", .endpoint = "23 at mgw", ... }; Even if audio_ip is changed to a char[INET_ADDRSTRLEN] this still works, but only during this struct init. BTW ... also possible anywhere in code flow: mgcp_msg = (struct mgcp_msg){ .audio_ip = "constant", .endpoint = "constant", }; i.e. provide an inline struct initialization to assign to the struct. enough lecturing :) Line 180: printf("%s\n", msg->data); (wondering if this should have a cast to (char*) ... does it cause warnings?) Line 210: (still: a test that hits buffer size limits?) -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 11 23:15:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Oct 2017 23:15:21 +0000 Subject: osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Patch Set 6: Code-Review-1 (4 comments) -1 for space-indent, the rest is for you to reflect on. https://gerrit.osmocom.org/#/c/4147/6/include/osmocom/mgcp_client/mgcp_client.h File include/osmocom/mgcp_client/mgcp_client.h: Line 39: char audio_ip[INET_ADDRSTRLEN]; indent by tab, please https://gerrit.osmocom.org/#/c/4147/6/src/libosmo-mgcp-client/mgcp_client.c File src/libosmo-mgcp-client/mgcp_client.c: Line 191: /* Parse a line like "c=IN IP4 10.11.12.13" */ (the line 'c=IN IP4' looks like it is more general than 'parse_audio_ip' ... is it semantically really tied to audio? Maybe also RTPC?) Line 200: strcpy(r->audio_ip, line + 9); should we check against c=IN IP4 10.11.12.13 and more nonsense or c=IN IP4 not-an-ip-address-at-all ? Is disallowing IP6 a conscious choice? Also wondering ... are we losing the info whether the IP obtained in struct mgcp_response came from IP4 or IP6? Will we be able to derive this from the stored address str? Will we even care? https://gerrit.osmocom.org/#/c/4147/6/tests/mgcp_client/mgcp_client_test.ok File tests/mgcp_client/mgcp_client_test.ok: Line 31: audio_ip = 10.9.1.120 hey, that's my office computer's IP! where'd you get that from? :) -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 12 01:51:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Oct 2017 01:51:57 +0000 Subject: osmo-ggsn[master]: create_context_ind(): Fix crash on apn not found In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4ec74e87aaf1d067dd1717d986673be56c4d6ed Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 12 01:52:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Oct 2017 01:52:00 +0000 Subject: [MERGED] osmo-ggsn[master]: create_context_ind(): Fix crash on apn not found In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: create_context_ind(): Fix crash on apn not found ...................................................................... create_context_ind(): Fix crash on apn not found Program terminated with signal SIGSEGV, Segmentation fault. 0 create_context_ind (pdp=0xb6b391b0 ) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:453 453 if (!apn->started) (gdb) bt 0 create_context_ind (pdp=0xb6b391b0 ) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:453 1 0xb6b225e0 in gtp_create_pdp_ind (gsn=gsn at entry=0x74f28, version=version at entry=1, peer=0x0, peer at entry=0xbee6ead4, fd=-1092167056, fd at entry=8, pack=pack at entry=0xbee6eae4, len=len at entry=179) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/gtp/gtp.c:1591 2 0xb6b245e4 in gtp_decaps1c (gsn=0x74f28) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/gtp/gtp.c:2986 3 0x41d770c0 in osmo_select_main () from /usr/lib/libosmocore.so.8 4 0x000121b8 in main (argc=4, argv=0xbee70e54) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:897 Fixes: dd266066c7cc96c797034da352cc9d72177c5780, b16c46b4c36383368eb1581e40d0a8ca751ddc53 Change-Id: Ie4ec74e87aaf1d067dd1717d986673be56c4d6ed --- M ggsn/ggsn.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 5852ef6..6c5c1a8 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -449,14 +449,14 @@ /* First find an exact APN name match */ apn = ggsn_find_apn(ggsn, name_buf); /* ignore if the APN has not been started */ - if (!apn->started) + if (apn && !apn->started) apn = NULL; /* then try default (if any) */ if (!apn) apn = ggsn->cfg.default_apn; /* ignore if the APN has not been started */ - if (!apn->started) + if (apn && !apn->started) apn = NULL; if (!apn) { -- To view, visit https://gerrit.osmocom.org/4228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie4ec74e87aaf1d067dd1717d986673be56c4d6ed Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 12 07:31:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Oct 2017 07:31:16 +0000 Subject: osmo-mgw[master]: protocol: allow wildcarded DLCX In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4227/1//COMMIT_MSG Commit Message: Line 14: id is supplied with the DLCX command. > is a missing call id compliant with MGCP? Yes, it seems explicitly permitted to offer wild-carding. See RFC3435 Section F.7 > In the second example, the Call Agent instructs the gateway to delete > all connections related to all of the endpoints specified: > DLCX 1210 aaln/*@rgw-2567.whatever.net MGCP 1.0 > > The response indicates success: > 250 1210 OK In this case not only was there no Connection-Id to wildcard all connections on a given end-point, but they even wildcarded the endpoint name itsel, i.e. "delete all connections on any endpoint matching "aaln/*@rgw-2567.whatever.net" -- To view, visit https://gerrit.osmocom.org/4227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 12 09:37:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Oct 2017 09:37:13 +0000 Subject: osmo-gsm-tester[master]: modem: Implement voice calls in modem and add voice suite In-Reply-To: References: Message-ID: Patch Set 1: (9 comments) https://gerrit.osmocom.org/#/c/4150/1/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 583: self.log('Dial returned already existing call!') > is it an error when the call object is already known? The log has an exclam It could happen in the sense that at some point we also receive the "CallAdded" signal and we need to process and add it. But still I prefer having it added directly here before returning control to the test in order to not fail if the test request any operation with that path before we receive/process the Added signal. But indeed, I'll remove the exclamation mark. It was there from the beginning because I was testing the behavior of the interface. Line 586: def call_answer(self, call_id): > (could add a timeout arg to forward to wait() ... not necessarily in this p Good idea. I'll see if I add it with this patch or leave it for later. Line 594: call_dbus_obj = systembus_get(call_id) > validation that call_dbus_obj exists? what happens if there is no such call I guess it will throw an exception. I wouldn't invest time in this until we see this really happens and it's an issue. Line 601: call_dbus_obj = systembus_get(call_id) > what happens if there is no such call? Say I had a loop that polls call_sta I could add a "call_exists(call_id) which basically does systembus_get(call_id), catches exception and returns true/false. Line 612: self.dbg('Call already exists!') > (same as above; exclamation mark looks like a bad situation, yet this is ju Agree, I'll remove the "!". Line 619: self.dbg('Trying to remove non-existing call!') > why all the shouting? :) It may be a personal preference of mine, but I'm k Agree, that's from the time I was testing behavior of the interface https://gerrit.osmocom.org/#/c/4150/1/suites/voice/mo_mt_call.py File suites/voice/mo_mt_call.py: Line 35: wait(msc.subscriber_attached, ms_mo, ms_mt) > (btw, unrelated to this particular patch, the above is a common prelude to I think we should have some kind of test-side library of function for steps which are re-used by several tests. Then just import it in tests willing to use it. By test-side I mean it's not necessarily a "public API" from osmo-gsm-tester, but just a bunch of functions outside of "osmo_gsm_tester.test" module. Line 40: mt_call_id = ms_mt.call_id_list()[0] > I guess the above two lines deserve to be in a AFAIR the VoiceCall interface has the number of the other endpoint in its properties. we could have ms_mt.call_wait_incoming(ms_or_msisdn) and then wait and iterate over active calls and look for the one which matches the msisdn. If ms_or_msisdn is None, then we take the first one (and/or make sure there's only one active to avoid unwanted race codnitions?) Agree with the assert part. Line 53: wait(lambda: len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0) > and since we're waiting for an empty list here, we should also, before we s You cannot do that because it may take a while (delay) for the other ms to close the call, that's why basically we use wait() relying on Timeout and not assert here. -- To view, visit https://gerrit.osmocom.org/4150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib402effc830db293f27a877658894e454a93a606 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 12 09:44:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Oct 2017 09:44:54 +0000 Subject: osmo-gsm-tester[master]: debug: Add voicecall related method to interactive shell In-Reply-To: References: Message-ID: Patch Set 1: (9 comments) https://gerrit.osmocom.org/#/c/4151/1/suites/aoip_debug/interactive.py File suites/aoip_debug/interactive.py: Line 26: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-answer , call-hangup ') > that prompt line is getting awfully long. We may need to a) split it up or I'd go for b, otherwise it's annoying while using it. I think it's better to keep that for a later patch though. Line 52: elif cmd.startswith('call-list'): > evangelism: before, commands could be abbreviated to their least unique len I know, I understand, but then you cannot pass parameters and you need to keep looking for different prefix for each new command, which doesn't scale nice. Line 58: print('call_list: %r' % ms.call_id_list()) > nitpick: command is 'call-list', py function is call_id_list(), yet this pr I'll move it to call-list Line 65: print('dial %s->%s, %s' % (params[1],params[2],str(mo.call_dial(params[2])))) > 'dialing'? Might be better to first print 'dialing' and then start dialing? I'll split this into 2 prints. Line 69: continue > would make more readable: I wanted to avoid extra lines, but I can do that too yes. Line 72: print('answer %s' % params[2]) > 'answering'? Agree Line 77: continue > would make more readable: I'll do it. Line 80: print('hang up %s' % params[2]) > 'hanging up' ? Agree https://gerrit.osmocom.org/#/c/4151/1/suites/debug/interactive.py File suites/debug/interactive.py: Line 45: elif cmd.startswith('call-list'): > oh damn, are we really duplicating all this? we should fix that... At a later stage it may make sense to move it to a library, or to make it generic (running a python console directly so we have all python syntax and osmo-gsm-tester API available directly?). -- To view, visit https://gerrit.osmocom.org/4151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2df68bf4fba0fb542eebdeb515a3dac6d5e575e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 12 10:09:16 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Oct 2017 10:09:16 +0000 Subject: [PATCH] libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4200 to look at the new patch set (#3). add function msgb_printf() to print formatted text into msg buf In ASCII string based protocols it a printf() version that prints directly to the message buffer may be useful. Add function msgb_printf(), make sure that msg buffer bounderies are not exceeded. If the end of the tail buffer is hit, return with an error code. Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 --- M include/osmocom/core/msgb.h M src/msgb.c M tests/msgb/msgb_test.c M tests/msgb/msgb_test.ok 4 files changed, 136 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/4200/3 diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 91b7ec7..9c3ccf0 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -498,5 +498,6 @@ void *msgb_talloc_ctx_init(void *root_ctx, unsigned int pool_size); void msgb_set_talloc_ctx(void *ctx) OSMO_DEPRECATED("Use msgb_talloc_ctx_init() instead"); +int msgb_printf(struct msgb *msgb, const char *format, ...); /*! @} */ diff --git a/src/msgb.c b/src/msgb.c index 2e9f4a2..46287b5 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -55,6 +55,9 @@ #include #include #include +#include +#include + #include //#include @@ -376,4 +379,56 @@ return buf; } + +/*! Print a string to the end of message buffer + * \param[in] msg message buffer + * \returns 0 on success, -EINVAL on error + * + * If less then 1 character of tailroom is left over, the message buffer + * will not be changed at all. + * + * In case of error, the message buffer may be left with invalid data + * appended. However, if an error is detected the tail pointer will not + * be moved and a terminating \0 is written to the tail position, this + * will clamp off the truncated string. The message buffer is immediately + * ready for a second attempt (with less data). + * + * In case of success the resulting string is written to the memory where + * the tail pointer points to. The tail pointer is then moved to the end + * of the string so that it points exactly to the location of the string + * terminator. + * + * When msgb_printf() is called multiple times with different data, the + * result will be a single, concatenated string. + */ +int msgb_printf(struct msgb *msgb, const char *format, ...) +{ + va_list args; + int str_len; + int rc = 0; + + OSMO_ASSERT(msgb); + OSMO_ASSERT(format); + + /* Regardless of what we plan to add to the buffer, we must at least + * be able to store a string terminator (nullstring) */ + if (msgb_tailroom(msgb) < 1) + return -EINVAL; + + va_start(args, format); + + str_len = + vsnprintf((char *)msgb->tail, msgb_tailroom(msgb), format, args); + + if (str_len >= msgb_tailroom(msgb) || str_len < 0) { + *msgb->tail = '\0'; + rc = -EINVAL; + } else + msgb_put(msgb, str_len); + + va_end(args); + return rc; +} + + /*! @} */ diff --git a/tests/msgb/msgb_test.c b/tests/msgb/msgb_test.c index ac10382..edc2412 100644 --- a/tests/msgb/msgb_test.c +++ b/tests/msgb/msgb_test.c @@ -276,6 +276,78 @@ osmo_set_panic_handler(NULL); } +static void test_msgb_printf() +{ + struct msgb *msg = msgb_alloc(80, "data"); + int rc; + int total_len; + + /* Add normal text: */ + printf("Add normal text:\n"); + rc = msgb_printf(msg, "|this is a test %i, %s, %16x|", 4711, "testme", + 0x4711); + total_len = strlen((char *)msg->data); + printf("#1: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + + /* Add normal text: */ + rc = msgb_printf(msg, "|some more text|"); + total_len = strlen((char *)msg->data); + printf("#2: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + + /* Add normal text which will not fit: */ + rc = msgb_printf(msg, "|more %i %x %s|", 23, 0xfee, + "text will not fit"); + total_len = strlen((char *)msg->data); + printf("#3: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == -EINVAL); + + /* Check if we got the right amount of characters in the message buffer + * until here, so that we can be sure that the following cornercase + * tests yield plausible results */ + OSMO_ASSERT(msgb_tailroom(msg) == 17); + + /* Add normal text which just does not fit by one character, this should not + * alter the message buffers tail pointer */ + rc = msgb_printf(msg, "|more 123456 ABC|"); + total_len = strlen((char *)msg->data); + printf("#4: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == -EINVAL); + + /* Make sure the tailroom, nor the contained string length did change */ + OSMO_ASSERT(msgb_tailroom(msg) == 17); + OSMO_ASSERT(total_len == 63); + + /* Add normal text which just fits */ + rc = msgb_printf(msg, "|more 123456 AB|"); + total_len = strlen((char *)msg->data); + printf("#5: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + + /* Make sure that the string in the bufer takes up all available + * also make sure that the available tailroom has space for one byte, + * which actually holds the string terminator */ + OSMO_ASSERT(msgb_tailroom(msg) == 1); + OSMO_ASSERT(total_len == 79); + + /* Try to add a nullstring to the already full buffer, this should + * be ok, since we still have one byte tailroom */ + rc = msgb_printf(msg, ""); + total_len = strlen((char *)msg->data); + printf("#6: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + + /* Make sure that we still have the same conditions as before */ + OSMO_ASSERT(msgb_tailroom(msg) == 1); + OSMO_ASSERT(total_len == 79); +} static struct log_info info = {}; @@ -287,6 +359,7 @@ test_msgb_api_errors(); test_msgb_copy(); test_msgb_resize_area(); + test_msgb_printf(); printf("Success.\n"); diff --git a/tests/msgb/msgb_test.ok b/tests/msgb/msgb_test.ok index 6603fe7..3638515 100644 --- a/tests/msgb/msgb_test.ok +++ b/tests/msgb/msgb_test.ok @@ -32,4 +32,11 @@ Original: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Extended: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Shrinked: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f +Add normal text: +#1: rc=0, total_len=47, msg->data=|this is a test 4711, testme, 4711| +#2: rc=0, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text| +#3: rc=-22, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text| +#4: rc=-22, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text| +#5: rc=0, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 AB| +#6: rc=0, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 AB| Success. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 12 11:33:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 11:33:51 +0000 Subject: libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 12 11:43:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 11:43:11 +0000 Subject: [PATCH] osmo-msc[master]: Remove pkg-config file Message-ID: Review at https://gerrit.osmocom.org/4231 Remove pkg-config file It's an artefact of split which is unused anyway. Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 --- M Makefile.am D osmo-msc.pc.in 2 files changed, 0 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/31/4231/1 diff --git a/Makefile.am b/Makefile.am index 9a92b08..690deae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,9 +16,6 @@ contrib \ $(NULL) -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = osmo-msc.pc - BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/osmo-msc.pc.in b/osmo-msc.pc.in deleted file mode 100644 index c406061..0000000 --- a/osmo-msc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/ - -Name: OsmoMSC -Description: Osmocom Mobile Switching Center -Requires: -Version: @VERSION@ -Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 12 12:03:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 12:03:49 +0000 Subject: [PATCH] osmo-bts[master]: Fix race condition in attribute reporting Message-ID: Review at https://gerrit.osmocom.org/4232 Fix race condition in attribute reporting Previously it could be possible that the attribute request comes from BSC before the TRX is properly initialized which would lead to SIGABRT caused by OSMO_ASSERT() in PHY instantiation. Workaround this by explicitly checking for TRX availability before handling TRX-specific attributes. This only happens with osmo-bts-trx and is hard to reproduce. Ideal fix would be to defer attribute response until we have TRX connected but that would make corresponding code more complex because we'll need to save the attribute request and properly hook response routine into TRX connection handler. Alternatively we can postpone osmo-bts-trx connection to BSC until TRX is available: it's not very useful without it anyway. Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82 Fixes: OS#2560 --- M src/common/oml.c 1 file changed, 12 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/32/4232/1 diff --git a/src/common/oml.c b/src/common/oml.c index 69a2642..2d1c862 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -209,19 +209,29 @@ { uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ struct msgb *attr_buf = oml_msgb_alloc(); + bool processed; if (!attr_buf) return -ENOMEM; for (i = 0; i < attr_len; i++) { + processed = false; switch (attr[i]) { case NM_ATT_SW_CONFIG: - add_trx_attr(attr_buf, trx); + if (trx) { + add_trx_attr(attr_buf, trx); + processed = true; + } else + LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unhandled due to missing TRX.\n", + i, get_value_string(abis_nm_att_names, attr[i])); break; default: LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by TRX.\n", i, get_value_string(abis_nm_att_names, attr[i])); - out[attr_out_index] = attr[i]; /* assemble values of supported attributes and list of unsupported ones */ + } + /* assemble values of supported attributes and list of unsupported ones */ + if (!processed) { + out[attr_out_index] = attr[i]; attr_out_index++; } } -- To view, visit https://gerrit.osmocom.org/4232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 12 12:18:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 12:18:25 +0000 Subject: [PATCH] osmo-msc[master]: osmo-msc: remove pkg-config file In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4231 to look at the new patch set (#2). osmo-msc: remove pkg-config file It's an artefact of split which is unused anyway. Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 --- M Makefile.am D osmo-msc.pc.in 2 files changed, 0 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/31/4231/2 diff --git a/Makefile.am b/Makefile.am index 9a92b08..49b65e0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,6 @@ $(NULL) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = osmo-msc.pc BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/osmo-msc.pc.in b/osmo-msc.pc.in deleted file mode 100644 index c406061..0000000 --- a/osmo-msc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/ - -Name: OsmoMSC -Description: Osmocom Mobile Switching Center -Requires: -Version: @VERSION@ -Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 12 12:24:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 12:24:47 +0000 Subject: [PATCH] osmo-msc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4231 to look at the new patch set (#3). Remove pkg-config file It's an artefact of split which is unused anyway. Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 --- M Makefile.am M configure.ac D osmo-msc.pc.in 3 files changed, 0 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/31/4231/3 diff --git a/Makefile.am b/Makefile.am index 9a92b08..690deae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,9 +16,6 @@ contrib \ $(NULL) -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = osmo-msc.pc - BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 8f468d5..64fead8 100644 --- a/configure.ac +++ b/configure.ac @@ -171,7 +171,6 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - osmo-msc.pc include/Makefile include/osmocom/Makefile include/osmocom/msc/Makefile diff --git a/osmo-msc.pc.in b/osmo-msc.pc.in deleted file mode 100644 index c406061..0000000 --- a/osmo-msc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/ - -Name: OsmoMSC -Description: Osmocom Mobile Switching Center -Requires: -Version: @VERSION@ -Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 12 12:42:04 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 12 Oct 2017 12:42:04 +0000 Subject: osmo-msc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-2 The cost of these clean-ups just seems to be too high. The commit message should be "better", it required two tries on CI? And most of it all.. is... it is wrong. osmo-msc _does_ install header files. http://git.osmocom.org/osmo-msc/tree/include/osmocom/msc/Makefile.am#n70 So maybe it shouldn't install these files but then make a fix complete or don't bother. -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 12 12:54:59 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 12 Oct 2017 12:54:59 +0000 Subject: osmo-bts[master]: Fix race condition in attribute reporting In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (3 comments) https://gerrit.osmocom.org/#/c/4232/1//COMMIT_MSG Commit Message: Line 21: it anyway. It is good to show these reflections. What would need to happen to make this work properly? E.g. the TRX gets an OPSTART and we should be able to delay the ack until the trx is reay? https://gerrit.osmocom.org/#/c/4232/1/src/common/oml.c File src/common/oml.c: Line 212: bool processed; you can move that into the scope of the for loop Line 234: out[attr_out_index] = attr[i]; trailing whitespace -- To view, visit https://gerrit.osmocom.org/4232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 12 12:59:55 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 12 Oct 2017 12:59:55 +0000 Subject: osmo-pcu[master]: Add multislot classes from latest spec In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) > tests/alloc/AllocTest.cpp requires updates to use/test the new classes as well. ^^^ Is this addressed? https://gerrit.osmocom.org/#/c/4072/2//COMMIT_MSG Commit Message: Line 15: yet - this can be extended once we have such devices to test it. How would you support it? Shall we print a runtime warning once this class is being used? https://gerrit.osmocom.org/#/c/4072/2/src/gprs_rlcmac_ts_alloc.cpp File src/gprs_rlcmac_ts_alloc.cpp: Line 531: if (ms->ms_class() >= ARRAY_SIZE(gprs_ms_multislot_class)) { I would have avoided the extra reformatting. -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 12 13:05:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 13:05:09 +0000 Subject: osmo-bts[master]: Fix race condition in attribute reporting In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4232/1/src/common/oml.c File src/common/oml.c: Line 212: bool processed; > you can move that into the scope of the for loop Hmm, I thought the style was to always put it in the beginning of the function. What's the general rule? -- To view, visit https://gerrit.osmocom.org/4232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 12 13:06:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 13:06:46 +0000 Subject: [PATCH] osmo-bts[master]: Fix race condition in attribute reporting In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4232 to look at the new patch set (#2). Fix race condition in attribute reporting Previously it could be possible that the attribute request comes from BSC before the TRX is properly initialized which would lead to SIGABRT caused by OSMO_ASSERT() in PHY instantiation. Workaround this by explicitly checking for TRX availability before handling TRX-specific attributes. This only happens with osmo-bts-trx and is hard to reproduce. Ideal fix would be to defer attribute response until we have TRX connected but that would make corresponding code more complex because we'll need to save the attribute request and properly hook response routine into TRX connection handler. Alternatively we can postpone osmo-bts-trx connection to BSC until TRX is available: it's not very useful without it anyway. Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82 Fixes: OS#2560 --- M src/common/oml.c 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/32/4232/2 diff --git a/src/common/oml.c b/src/common/oml.c index 69a2642..ff6dc41 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -214,14 +214,23 @@ return -ENOMEM; for (i = 0; i < attr_len; i++) { + bool processed = false; switch (attr[i]) { case NM_ATT_SW_CONFIG: - add_trx_attr(attr_buf, trx); + if (trx) { + add_trx_attr(attr_buf, trx); + processed = true; + } else + LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unhandled due to missing TRX.\n", + i, get_value_string(abis_nm_att_names, attr[i])); break; default: LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by TRX.\n", i, get_value_string(abis_nm_att_names, attr[i])); - out[attr_out_index] = attr[i]; /* assemble values of supported attributes and list of unsupported ones */ + } + /* assemble values of supported attributes and list of unsupported ones */ + if (!processed) { + out[attr_out_index] = attr[i]; attr_out_index++; } } -- To view, visit https://gerrit.osmocom.org/4232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 12 13:09:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 13:09:37 +0000 Subject: osmo-pcu[master]: Add multislot classes from latest spec In-Reply-To: References: Message-ID: Patch Set 2: > Is this addressed? Not yet - as I've said in the comment above, I'll get back to it in next version. The current revision was published to split formatting changes from new classes as per your feedback. -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 12 13:19:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 13:19:38 +0000 Subject: [PATCH] osmo-msc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4231 to look at the new patch set (#4). Remove pkg-config file It's an artefact of split which is unused anyway. Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 --- M Makefile.am M configure.ac M include/osmocom/msc/Makefile.am D osmo-msc.pc.in 4 files changed, 0 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/31/4231/4 diff --git a/Makefile.am b/Makefile.am index 9a92b08..690deae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,9 +16,6 @@ contrib \ $(NULL) -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = osmo-msc.pc - BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 8f468d5..64fead8 100644 --- a/configure.ac +++ b/configure.ac @@ -171,7 +171,6 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - osmo-msc.pc include/Makefile include/osmocom/Makefile include/osmocom/msc/Makefile diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 4099c9e..38c2a0c 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -66,13 +66,3 @@ vlr.h \ vty.h \ $(NULL) - -openbsc_HEADERS = \ - bsc_api.h \ - gsm_04_08.h \ - meas_rep.h \ - $(NULL) - -# DO NOT add a newline and '$(NULL)' to this line. That would add a trailing -# space to the directory installed: $prefix/include/'openbsc ' -openbscdir = $(includedir)/openbsc diff --git a/osmo-msc.pc.in b/osmo-msc.pc.in deleted file mode 100644 index c406061..0000000 --- a/osmo-msc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/ - -Name: OsmoMSC -Description: Osmocom Mobile Switching Center -Requires: -Version: @VERSION@ -Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 12 13:20:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 13:20:27 +0000 Subject: osmo-msc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Patch Set 3: Good point. Is there reason why MSC should install those headers? Neels? -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 12 13:28:59 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 12 Oct 2017 13:28:59 +0000 Subject: osmo-msc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/4231/4/include/osmocom/msc/Makefile.am File include/osmocom/msc/Makefile.am: Line 70 The build error you got was so obvious. In German we would say "Mit Anlauf gegen die Wand". Let me stretch the point of cost of clean-ups. I think the app should not install header files (it doesn't have a plugin interface and will never have one), libraries should be in other repositories. But either one gets it right or people waste their time on something not urgent and not important. You spent at least 30min on it, I spent 10min on it, now neels will spent time on it. Is this the _best_ we could have used our time? -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 12 13:39:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Oct 2017 13:39:21 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: GGSN: Document how 'tunctl' is used for non-root; call netde... Message-ID: Review at https://gerrit.osmocom.org/4233 GGSN: Document how 'tunctl' is used for non-root; call netdev 'apn0' * Some people want to manually create/configure their tun devices, show them how to do this using tunctl with the correct parameters * Let's not call the network device 'ggsn' but rather 'apn0', as the device has a 1:1 correspondence to the APN, not to the GGSN. Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def --- M OsmoGGSN/chapters/configuration.adoc 1 file changed, 46 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/33/4233/1 diff --git a/OsmoGGSN/chapters/configuration.adoc b/OsmoGGSN/chapters/configuration.adoc index 9e07fb6..a7b2c36 100644 --- a/OsmoGGSN/chapters/configuration.adoc +++ b/OsmoGGSN/chapters/configuration.adoc @@ -246,26 +246,64 @@ It's possible to run OsmoGGSN without root privileges if the tun devices are already configured. -.Example: device config via systemd-networkd using ggsn.netdev +The interface creation + configuration must then happen before osmo-ggsn starting up. This can be +achieved by mans such as + +* a custom shell script run as root before starting osmo-ggsn (e.g. as init script) +* systemd .netdev and .netwrork files + +==== Manual TUN device creation / configuration + +If you chose to go for custom shell/init scripts, you may use the `tunctl` program which is +available in major distributions as part of the `uml-utilities` package. In order to create +a tun device, you must call it like this: + +.Example: tunctl command to create a tun device +---- +tunctl -3 -u username -g groupname -t apn0 +---- + +Where _username_ and _groupname_ correspond to the User and Group that will have ownership over the +device, i.e. the privileges using which you intend to run osmo-ggsn under, and _apn0_ will be the +name of the network device created. Don't forget the `-3` option, without it, `tunctl` will create +TAP (Ethernet) devices and not TUN (IP) devices. After creating the interface, you can configure +its addresses using standard means like `ifconfig`, `ip` or your distribution-specific +utilities/tools. + + +==== systemd based TUN device creation+configuration + +If you want to have systemd take care of creating and configuring a tun device for you, +you can use the below example config files. + +.Example: device config via systemd-networkd using apn0.netdev ---- [NetDev] -Name=ggsn +Name=apn0 <1> Kind=tun [Tun] -User=username -Group=username +User=username <2> +Group=username <3> ---- +<1> The network interface name of the newly-created device +<2> The username under which you will run OsmoGGSN +<3> The group name under which you will run OsmoGGSN .Example: network settings via systemd-networkd using ggsn.network ---- [Match] -Name=ggsn +Name=apn0 <1> [Network] -Address=192.168.7.1 -IPMasquerade=yes +Address=192.168.7.1 <2> +IPMasquerade=yes <3> ---- +<1> The netowrk device name, which must match the one in the apn0.netdev script above +<2> The local IP address configured on the device +<3> Requesting systemd to configure IP masquerading for this interface. Depending on your needs, + You may not want this if you have proper end-to-end routing set up, and want to have transparent + inbound IP access to your GPRS-attached devices. The pair of the configuration files above allows you to create and configure tun device which can be used by OsmoGGSN as follows. @@ -277,7 +315,7 @@ gtp bind-ip 127.0.0.6 apn internet gtpu-mode tun - tun-device ggsn + tun-device apn0 type-support v4 ip prefix dynamic 192.168.7.0/24 ip dns 0 192.168.100.1 -- To view, visit https://gerrit.osmocom.org/4233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Oct 12 13:41:49 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Oct 2017 13:41:49 +0000 Subject: [PATCH] osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4146 to look at the new patch set (#6). client: add unified function to generate MGCP messages currently the only way to generate MGCP messages is to use mgcp_msg_crcx(), mgcp_msg_mdcx() and mgcp_msg_dlcx(). All three function take a fixed set of parameters via their parameter list. There is no way to add or leave away optional parameters. add function mgcp_msg_gen(), this function takes a unified message struct. The struct features a presence bitmask which allows to enable and disable parameters as needed. It is also possible to add new parameters in the future without breaking the API. Depends: libosmocore I15e1af68616309555d0ed9ac5da027c9833d42e3 Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.err M tests/mgcp_client/mgcp_client_test.ok 5 files changed, 250 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/4146/6 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index efc1f76..21717e3 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include @@ -37,6 +38,36 @@ uint16_t audio_port; }; +enum mgcp_verb { + MGCP_VERB_CRCX, + MGCP_VERB_MDCX, + MGCP_VERB_DLCX, + MGCP_VERB_AUEP, + MGCP_VERB_RSIP, +}; + +#define MGCP_MSG_PRESENCE_ENDPOINT 0x0001 +#define MGCP_MSG_PRESENCE_CALL_ID 0x0002 +#define MGCP_MSG_PRESENCE_CONN_ID 0x0004 +#define MGCP_MSG_PRESENCE_AUDIO_IP 0x0008 +#define MGCP_MSG_PRESENCE_AUDIO_PORT 0x0010 +#define MGCP_MSG_PRESENCE_CONN_MODE 0x0020 + +/* See also RFC3435 section 3.2.1.3 */ +#define MGCP_ENDPOINT_MAXLEN (255*2+1+1) + +struct mgcp_msg { + enum mgcp_verb verb; + /* See MGCP_MSG_PRESENCE_* constants */ + uint32_t presence; + char endpoint[MGCP_ENDPOINT_MAXLEN]; + unsigned int call_id; + uint32_t conn_id; + uint16_t audio_port; + char *audio_ip; + enum mgcp_connection_mode conn_mode; +}; + void mgcp_client_conf_init(struct mgcp_client_conf *conf); void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf); int mgcp_client_config_write(struct vty *vty, const char *indent); @@ -65,14 +96,19 @@ struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, - enum mgcp_connection_mode mode); + enum mgcp_connection_mode mode) +OSMO_DEPRECATED("Use mgcp_msg_gen() instead"); struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, const char *rtp_conn_addr, - uint16_t rtp_port, enum mgcp_connection_mode mode); + uint16_t rtp_port, enum mgcp_connection_mode mode) +OSMO_DEPRECATED("Use mgcp_msg_gen() instead"); struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, - unsigned int call_id); + unsigned int call_id) +OSMO_DEPRECATED("Use mgcp_msg_gen() instead"); + +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg); extern const struct value_string mgcp_client_connection_mode_strs[]; static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 1cd37be..c7cc989 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -614,6 +615,109 @@ "C: %x\r\n", trans_id, rtp_endpoint, call_id); } +#define MGCP_CRCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CALL_ID | \ + MGCP_MSG_PRESENCE_CONN_ID | \ + MGCP_MSG_PRESENCE_CONN_MODE) +#define MGCP_MDCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CONN_ID) +#define MGCP_DLCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_RSIP_MANDATORY 0 /* none */ + +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg) +{ + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); + uint32_t mandatory_mask; + struct msgb *msg = msgb_alloc_headroom(4096, 128, "MGCP tx"); + int rc = 0; + + msg->l2h = msg->data; + msg->cb[MSGB_CB_MGCP_TRANS_ID] = trans_id; + + /* Add command verb */ + switch (mgcp_msg->verb) { + case MGCP_VERB_CRCX: + mandatory_mask = MGCP_CRCX_MANDATORY; + rc += msgb_printf(msg, "CRCX %u", trans_id); + break; + case MGCP_VERB_MDCX: + mandatory_mask = MGCP_MDCX_MANDATORY; + rc += msgb_printf(msg, "MDCX %u", trans_id); + break; + case MGCP_VERB_DLCX: + mandatory_mask = MGCP_DLCX_MANDATORY; + rc += msgb_printf(msg, "DLCX %u", trans_id); + break; + case MGCP_VERB_AUEP: + mandatory_mask = MGCP_AUEP_MANDATORY; + rc += msgb_printf(msg, "AUEP %u", trans_id); + break; + case MGCP_VERB_RSIP: + mandatory_mask = MGCP_RSIP_MANDATORY; + rc += msgb_printf(msg, "RSIP %u", trans_id); + break; + default: + LOGP(DLMGCP, LOGL_ERROR, + "Invalid command verb, can not generate MGCP message\n"); + msgb_free(msg); + return NULL; + } + + /* Check if mandatory fields are missing */ + if (!((mgcp_msg->presence & mandatory_mask) == mandatory_mask)) { + LOGP(DLMGCP, LOGL_ERROR, + "One or more missing mandatory fields, can not generate MGCP message\n"); + msgb_free(msg); + return NULL; + } + + /* Add endpoint name */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_ENDPOINT) + rc += msgb_printf(msg, " %s", mgcp_msg->endpoint); + + /* Add protocol version */ + rc += msgb_printf(msg, " MGCP 1.0\r\n"); + + /* Add call id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CALL_ID) + rc += msgb_printf(msg, "C: %x\r\n", mgcp_msg->call_id); + + /* Add connection id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID) + rc += msgb_printf(msg, "I: %u\r\n", mgcp_msg->conn_id); + + /* Add local connection options */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID + && mgcp_msg->verb == MGCP_VERB_CRCX) + rc += msgb_printf(msg, "L: p:20, a:AMR, nt:IN\r\n"); + + /* Add mode */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_MODE) + rc += + msgb_printf(msg, "M: %s\r\n", + mgcp_client_cmode_name(mgcp_msg->conn_mode)); + + /* Add RTP address and port (SDP) */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_IP + && mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT) { + rc += msgb_printf(msg, "\r\n"); + rc += msgb_printf(msg, "c=IN IP4 %s\r\n", mgcp_msg->audio_ip); + rc += + msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", + mgcp_msg->audio_port); + } + + if (rc != 0) { + LOGP(DLMGCP, LOGL_ERROR, + "message buffer to small, can not generate MGCP message\n"); + msgb_free(msg); + msg = NULL; + } + + return msg; +} + struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index f2f0e0f..1420959 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -149,6 +149,80 @@ "a=ptime:20\r\n"); } +void test_mgcp_msg(void) +{ + struct msgb *msg; + char audio_ip_overflow[5000]; + + /* A message struct prefilled with some arbitary values */ + struct mgcp_msg mgcp_msg = { + .audio_ip = "192.168.100.23", + .endpoint = "23 at mgw", + .audio_port = 1234, + .call_id = 47, + .conn_id = 11, + .conn_mode = MGCP_CONN_RECV_SEND + }; + + if (mgcp) + talloc_free(mgcp); + mgcp = mgcp_client_init(ctx, &conf); + + printf("\n"); + + printf("Generated CRCX message:\n"); + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Generated MDCX message:\n"); + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Generated DLCX message:\n"); + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Generated AUEP message:\n"); + mgcp_msg.verb = MGCP_VERB_AUEP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated RSIP message:\n"); + mgcp_msg.verb = MGCP_VERB_RSIP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Overfolow test:\n"); + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + memset(audio_ip_overflow, 'X', sizeof(audio_ip_overflow)); + audio_ip_overflow[sizeof(audio_ip_overflow) - 1] = '\0'; + mgcp_msg.audio_ip = audio_ip_overflow; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg == NULL); + + printf("\n"); + msgb_free(msg); +} + static const struct log_info_cat log_categories[] = { }; @@ -167,6 +241,7 @@ mgcp_client_conf_init(&conf); test_crcx(); + test_mgcp_msg(); printf("Done\n"); fprintf(stderr, "Done\n"); diff --git a/tests/mgcp_client/mgcp_client_test.err b/tests/mgcp_client/mgcp_client_test.err index a965a70..5e23799 100644 --- a/tests/mgcp_client/mgcp_client_test.err +++ b/tests/mgcp_client/mgcp_client_test.err @@ -1 +1,2 @@ -Done +<0010> mgcp_client.c:746 message buffer to small, can not generate MGCP message +Done diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index d35f2d6..e3b6113 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,4 +28,34 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + +Generated CRCX message: +CRCX 1 23 at mgw MGCP 1.0 +C: 2f +I: 11 +L: p:20, a:AMR, nt:IN +M: sendrecv + +Generated MDCX message: +MDCX 2 23 at mgw MGCP 1.0 +C: 2f +I: 11 +M: sendrecv + +c=IN IP4 192.168.100.23 +m=audio 1234 RTP/AVP 255 + +Generated DLCX message: +DLCX 3 23 at mgw MGCP 1.0 +C: 2f +I: 11 + +Generated AUEP message: +AUEP 4 23 at mgw MGCP 1.0 + +Generated RSIP message: +RSIP 5 23 at mgw MGCP 1.0 + +Overfolow test: + Done -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 12 13:41:49 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Oct 2017 13:41:49 +0000 Subject: [PATCH] osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4147 to look at the new patch set (#7). client: add ip address parsing to the client Some MGCP messages (CRCX, MDCX) return IP-Addresses. Make use of this information. Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 42 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/47/4147/7 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 21717e3..11680db 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -36,6 +36,7 @@ char *body; struct mgcp_response_head head; uint16_t audio_port; + char audio_ip[INET_ADDRSTRLEN]; }; enum mgcp_verb { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index c7cc989..f8c55ac 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -174,7 +174,7 @@ } /* Parse a line like "m=audio 16002 RTP/AVP 98" */ -static int mgcp_parse_audio(struct mgcp_response *r, const char *line) +static int mgcp_parse_audio_port(struct mgcp_response *r, const char *line) { if (sscanf(line, "m=audio %hu", &r->audio_port) != 1) @@ -184,7 +184,35 @@ response_parse_failure: LOGP(DLMGCP, LOGL_ERROR, - "Failed to parse MGCP response header\n"); + "Failed to parse MGCP response header (audio port)\n"); + return -EINVAL; +} + +/* Parse a line like "c=IN IP4 10.11.12.13" */ +static int mgcp_parse_audio_ip(struct mgcp_response *r, const char *line) +{ + struct in_addr ip_test; + + if (strlen(line) < 16) + goto response_parse_failure; + + /* The current implementation strictly supports IPV4 only ! */ + if (memcmp("c=IN IP4 ", line, 9) != 0) + goto response_parse_failure; + + /* Extract IP-Address */ + strncpy(r->audio_ip, line + 9, sizeof(r->audio_ip)); + r->audio_ip[sizeof(r->audio_ip) - 1] = '\0'; + + /* Check IP-Address */ + if (inet_aton(r->audio_ip, &ip_test) == 0) + goto response_parse_failure; + + return 0; + +response_parse_failure: + LOGP(DLMGCP, LOGL_ERROR, + "Failed to parse MGCP response header (audio ip)\n"); return -EINVAL; } @@ -213,7 +241,12 @@ switch (line[0]) { case 'm': - rc = mgcp_parse_audio(r, line); + rc = mgcp_parse_audio_port(r, line); + if (rc) + return rc; + break; + case 'c': + rc = mgcp_parse_audio_ip(r, line); if (rc) return rc; break; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 1420959..e99aa37 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -99,11 +99,13 @@ " head.response_code = %d\n" " head.trans_id = %u\n" " head.comment = %s\n" - " audio_port = %u\n", + " audio_port = %u\n" + " audio_ip = %s\n", response->head.response_code, response->head.trans_id, response->head.comment, - response->audio_port + response->audio_port, + response->audio_ip ); } diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index e3b6113..d4efee4 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,6 +28,7 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + audio_ip = 10.9.1.120 Generated CRCX message: CRCX 1 23 at mgw MGCP 1.0 -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 7 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 12 13:41:49 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Oct 2017 13:41:49 +0000 Subject: [PATCH] osmo-mgw[master]: protocol: allow wildcarded DLCX In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4227 to look at the new patch set (#2). protocol: allow wildcarded DLCX In many cases it is simpler to instruct the mgcp-gw to drop all connections at once instead of removing each connection individually. drop all connections and release the endpoint in when no connection id is supplied with the DLCX command. Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736 --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp/mgcp_protocol.c 2 files changed, 20 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/27/4227/2 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 11680db..e91b190 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -36,7 +36,7 @@ char *body; struct mgcp_response_head head; uint16_t audio_port; - char audio_ip[INET_ADDRSTRLEN]; + char audio_ip[INET_ADDRSTRLEN]; }; enum mgcp_verb { diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 5d4dd47..04b0bf1 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -907,14 +907,31 @@ } } - /* find the connection */ + /* When no connection id is supplied, we will interpret this as a + * wildcarded DLCX and drop all connections at once. (See also + * RFC3435 Section F.7) */ + if (!ci) { + LOGP(DLMGCP, LOGL_NOTICE, + "DLCX: endpoint:%x missing ci (connectionIdentifier), will remove all connections at once\n", + ENDPOINT_NUMBER(endp)); + + mgcp_release_endp(endp); + + /* Note: In this case we do not return any statistics, + * as we assume that the client is not interested in + * this case. */ + return create_ok_response(endp, 200, "DLCX", p->trans); + } + + /* Parse the connection id */ if (mgcp_parse_ci(&conn_id, ci)) { LOGP(DLMGCP, LOGL_ERROR, - "DLCX: endpoint:%x insufficient parameters, missing ci (connectionIdentifier)\n", + "DLCX: endpoint:%x insufficient parameters, invalid ci (connectionIdentifier)\n", ENDPOINT_NUMBER(endp)); return create_err_response(endp, 400, "DLCX", p->trans); } + /* Find the connection */ conn = mgcp_conn_get_rtp(endp, conn_id); if (!conn) goto error3; -- To view, visit https://gerrit.osmocom.org/4227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 12 13:48:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Oct 2017 13:48:06 +0000 Subject: osmo-msc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 (1 comment) except for the 'make distcheck' failure this patch is good, right? Do you have other reasons to veto? (-2 means to me the entire direction of the patch is wrong, which to me it isn't) https://gerrit.osmocom.org/#/c/4231/4/include/osmocom/msc/Makefile.am File include/osmocom/msc/Makefile.am: Line 73 AFAICT bsc_api.h must be added to noinst_HEADERS? The other two already are in there, interestingly enough. -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 12 14:00:01 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 12 Oct 2017 14:00:01 +0000 Subject: osmo-msc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 > (1 comment) > > except for the 'make distcheck' failure this patch is good, right? > Do you have other reasons to veto? (-2 means to me the entire > direction of the patch is wrong, which to me it isn't) -2: Just because it is non-urgent cleanup that is only half done. We can't afford to lose time like that. Either it is good or someone else can try (that is my point of view as ISV) -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 12 14:13:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Oct 2017 14:13:59 +0000 Subject: osmo-gsm-manuals[master]: GGSN: Document how 'tunctl' is used for non-root; call netde... In-Reply-To: References: Message-ID: Patch Set 1: May be worth adding this one which worked for me and comes from iproute2 package which is usually more standard: "ip tuntap add dev apn0 mode tun user root group root" -- To view, visit https://gerrit.osmocom.org/4233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 12 14:46:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Oct 2017 14:46:28 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: GGSN: Document how 'ip tuntap' is used for non-root; call ne... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4233 to look at the new patch set (#2). GGSN: Document how 'ip tuntap' is used for non-root; call netdev 'apn0' * Some people want to manually create/configure their tun devices, show them how to do this using ip with the correct parameters * Let's not call the network device 'ggsn' but rather 'apn0', as the device has a 1:1 correspondence to the APN, not to the GGSN. Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def --- M OsmoGGSN/chapters/configuration.adoc 1 file changed, 44 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/33/4233/2 diff --git a/OsmoGGSN/chapters/configuration.adoc b/OsmoGGSN/chapters/configuration.adoc index 9e07fb6..f032dc9 100644 --- a/OsmoGGSN/chapters/configuration.adoc +++ b/OsmoGGSN/chapters/configuration.adoc @@ -246,26 +246,62 @@ It's possible to run OsmoGGSN without root privileges if the tun devices are already configured. -.Example: device config via systemd-networkd using ggsn.netdev +The interface creation + configuration must then happen before osmo-ggsn starting up. This can be +achieved by mans such as + +* a custom shell script run as root before starting osmo-ggsn (e.g. as init script) +* systemd .netdev and .netwrork files + +==== Manual TUN device creation / configuration + +If you chose to go for custom shell/init scripts, you may use the `ip` program which is the standard +tool for network interface configuration on Linux, part of the `iproute2` package. In order to +create a tun device, you must call it like this: + +.Example: iproute2 command to create a tun device +---- +# ip tuntap add dev apn0 mode tun user username group groupname +---- + +Where _username_ and _groupname_ correspond to the User and Group that will have ownership over the +device, i.e. the privileges using which you intend to run osmo-ggsn under, and _apn0_ will be the +name of the network device created. After creating the interface, you can configure its addresses +using standard means like `ip addr add` or your distribution-specific utilities/tools. + + +==== systemd based TUN device creation+configuration + +If you want to have systemd take care of creating and configuring a tun device for you, +you can use the below example config files. + +.Example: device config via systemd-networkd using apn0.netdev ---- [NetDev] -Name=ggsn +Name=apn0 <1> Kind=tun [Tun] -User=username -Group=username +User=username <2> +Group=username <3> ---- +<1> The network interface name of the newly-created device +<2> The username under which you will run OsmoGGSN +<3> The group name under which you will run OsmoGGSN .Example: network settings via systemd-networkd using ggsn.network ---- [Match] -Name=ggsn +Name=apn0 <1> [Network] -Address=192.168.7.1 -IPMasquerade=yes +Address=192.168.7.1 <2> +IPMasquerade=yes <3> ---- +<1> The netowrk device name, which must match the one in the apn0.netdev script above +<2> The local IP address configured on the device +<3> Requesting systemd to configure IP masquerading for this interface. Depending on your needs, + You may not want this if you have proper end-to-end routing set up, and want to have transparent + inbound IP access to your GPRS-attached devices. The pair of the configuration files above allows you to create and configure tun device which can be used by OsmoGGSN as follows. @@ -277,7 +313,7 @@ gtp bind-ip 127.0.0.6 apn internet gtpu-mode tun - tun-device ggsn + tun-device apn0 type-support v4 ip prefix dynamic 192.168.7.0/24 ip dns 0 192.168.100.1 -- To view, visit https://gerrit.osmocom.org/4233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 12 14:53:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Oct 2017 14:53:04 +0000 Subject: osmo-gsm-manuals[master]: GGSN: Document how 'ip tuntap' is used for non-root; call ne... In-Reply-To: References: Message-ID: Patch Set 2: (3 comments) https://gerrit.osmocom.org/#/c/4233/2/OsmoGGSN/chapters/configuration.adoc File OsmoGGSN/chapters/configuration.adoc: Line 250: achieved by mans such as mans->means? Line 253: * systemd .netdev and .netwrork files netwrork->network Line 267: device, i.e. the privileges using which you intend to run osmo-ggsn under, and _apn0_ will be the probably the word "using" should not be there? -- To view, visit https://gerrit.osmocom.org/4233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 12 15:33:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 15:33:11 +0000 Subject: [PATCH] libosmo-sccp[master]: Add doxygen docs Message-ID: Review at https://gerrit.osmocom.org/4234 Add doxygen docs Make sure doxygen generates library documentation by default (can be disabled at compile time). To avoid complicating doxygen setup compared to other libraries example config was moved to separate directory. Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Related: OS#2572 --- M .gitignore A Doxyfile.in M Makefile.am M configure.ac M debian/control R examples/osmo-stp.cfg 6 files changed, 1,754 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/34/4234/1 diff --git a/.gitignore b/.gitignore index c38bac1..e63e4ee 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ config.* tags +/Doxyfile diff --git a/Doxyfile.in b/Doxyfile.in new file mode 100644 index 0000000..738457b --- /dev/null +++ b/Doxyfile.in @@ -0,0 +1,1716 @@ +# Doxyfile 1.7.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = libosmo-sccp + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Osmocom SIGTRAN library" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @srcdir@/include/osmocom/sigtran @srcdir@/src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +# IMAGE_PATH = images/ + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = doc/libosmo-sccp.tag + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = /usr/bin/dot + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/Makefile.am b/Makefile.am index e2c5277..569dfda 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc libosmo-xua.pc -EXTRA_DIST = .version doc/examples/osmo-stp.cfg +EXTRA_DIST = .version examples/osmo-stp.cfg @RELMAKE@ @@ -15,3 +15,28 @@ echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version + + +if HAVE_DOXYGEN + +html_DATA = $(top_builddir)/doc/html.tar + +$(html_DATA): $(top_builddir)/doc/html/index.html + cd $(top_builddir)/doc && tar cf html.tar html + +$(top_builddir)/doc/html/index.html: $(SOURCES) Doxyfile + @rm -rf doc + mkdir -p doc + $(DOXYGEN) Doxyfile + +install-data-hook: + cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar + +uninstall-hook: + rm -rf $(DESTDIR)$(htmldir) + +DX_CLEAN = doc/html/search/* doc/{html,latex}/* doc/html.tar doc/doxygen_sqlite3.db doc/*.tag + +endif + +MOSTLYCLEANFILES = $(DX_CLEAN) diff --git a/configure.ac b/configure.ac index ed761c3..5404acf 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,15 @@ CFLAGS="$CFLAGS -Wall" CPPFLAGS="$CPPFLAGS -Wall" +AC_ARG_ENABLE(doxygen, + [AS_HELP_STRING( + [--disable-doxygen], + [Disable generation of documentation using doxygen], + )], + [doxygen=$enableval], [doxygen="yes"]) +AC_PATH_PROG(DOXYGEN,doxygen,false) +AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") + AC_OUTPUT( libosmo-sigtran.pc libosmo-sccp.pc @@ -79,4 +88,5 @@ tests/ss7/Makefile examples/Makefile stp/Makefile + Doxyfile Makefile) diff --git a/debian/control b/debian/control index 60bef71..a59dede 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,7 @@ libtool, dh-autoreconf, git, + doxygen, libdpkg-perl, libosmo-netif-dev, libsctp-dev diff --git a/doc/examples/osmo-stp.cfg b/examples/osmo-stp.cfg similarity index 100% rename from doc/examples/osmo-stp.cfg rename to examples/osmo-stp.cfg -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 12 15:57:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Oct 2017 15:57:41 +0000 Subject: [PATCH] osmo-ggsn[master]: lib/tunc.c: tun_ipv6_linklocal_get(): fix memory leak with g... Message-ID: Review at https://gerrit.osmocom.org/4235 lib/tunc.c: tun_ipv6_linklocal_get(): fix memory leak with getifaddrs() >From getifaddrs(3) man: "The data returned by getifaddrs() is dynamically allocated and should be freed using freeifaddrs() when no longer needed" Change-Id: If6300d1c8d36fcafef294a4c11bbda31a158bb9c --- M lib/tun.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/35/4235/1 diff --git a/lib/tun.c b/lib/tun.c index 32a8d2d..35d371e 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -776,7 +776,9 @@ continue; *ia = sin6->sin6_addr; + freeifaddrs(ifaddr); return 0; } + freeifaddrs(ifaddr); return -1; } -- To view, visit https://gerrit.osmocom.org/4235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If6300d1c8d36fcafef294a4c11bbda31a158bb9c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 12 16:00:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Oct 2017 16:00:24 +0000 Subject: [PATCH] osmo-ggsn[master]: lib/tun.c: tun_ipv6_linklocal_get(): fix memory leak with ge... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4235 to look at the new patch set (#2). lib/tun.c: tun_ipv6_linklocal_get(): fix memory leak with getifaddrs() >From getifaddrs(3) man: "The data returned by getifaddrs() is dynamically allocated and should be freed using freeifaddrs() when no longer needed" Change-Id: If6300d1c8d36fcafef294a4c11bbda31a158bb9c --- M lib/tun.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/35/4235/2 diff --git a/lib/tun.c b/lib/tun.c index 32a8d2d..35d371e 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -776,7 +776,9 @@ continue; *ia = sin6->sin6_addr; + freeifaddrs(ifaddr); return 0; } + freeifaddrs(ifaddr); return -1; } -- To view, visit https://gerrit.osmocom.org/4235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If6300d1c8d36fcafef294a4c11bbda31a158bb9c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 12 16:39:56 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 12 Oct 2017 16:39:56 +0000 Subject: osmo-gsm-manuals[master]: GGSN: Document how 'ip tuntap' is used for non-root; call ne... In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) Some nitpicking. https://gerrit.osmocom.org/#/c/4233/2/OsmoGGSN/chapters/configuration.adoc File OsmoGGSN/chapters/configuration.adoc: Line 300: <1> The netowrk device name, which must match the one in the apn0.netdev script above It's "unit file", not script. Line 304: inbound IP access to your GPRS-attached devices. Interesting, never used GGSN without NAT. Do we have example configuration for such scenario? -- To view, visit https://gerrit.osmocom.org/4233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From admin at opensuse.org Thu Oct 12 20:03:14 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 12 Oct 2017 20:03:14 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59dfca8f28b26_19c5d0ef80233095@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 95s] +DDB Unable to prepare SQL statement 'SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?' [ 95s] +Assert failed dbc db_test.c:811 [ 95s] +/usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/test-source: line 27: 19077 Aborted $abs_top_builddir/tests/db/db_test [ 95s] --- expout 2017-10-12 20:02:57.908000000 +0000 [ 95s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/stdout 2017-10-12 20:02:57.944000000 +0000 [ 95s] @@ -1,2 +1,5 @@ [ 95s] db_test.c [ 95s] -Done [ 95s] +backtrace() returned 4 addresses [ 95s] +/usr/src/packages/BUILD/tests/db/db_test(main+0x66dc) [0x5655f87c] [ 95s] +/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf6) [0xf7404276] [ 95s] +/usr/src/packages/BUILD/tests/db/db_test(+0x7c78) [0x5655fc78] [ 95s] ./testsuite.at:30: exit code was 134, expected 0 [ 95s] 4. testsuite.at:25: 4. db (testsuite.at:25): FAILED (testsuite.at:30) [ 95s] debian/rules:17: recipe for target 'override_dh_auto_test' failed [ 95s] make[1]: *** [override_dh_auto_test] Error 1 [ 95s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 95s] debian/rules:7: recipe for target 'build' failed [ 95s] make: *** [build] Error 2 [ 95s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 95s] [ 95s] lamb57 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:02:59 UTC 2017. [ 95s] [ 95s] ### VM INTERACTION START ### [ 98s] [ 90.408600] reboot: Power down [ 98s] ### VM INTERACTION END ### [ 98s] [ 98s] lamb57 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:03:03 UTC 2017. [ 98s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 12 20:04:23 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 12 Oct 2017 20:04:23 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59dfcacd69111_19c5d0ef802338a9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 110s] +DDB Unable to prepare SQL statement 'SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?' [ 110s] +Assert failed dbc db_test.c:811 [ 110s] +/usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/test-source: line 27: 18119 Aborted $abs_top_builddir/tests/db/db_test [ 110s] --- expout 2017-10-12 20:04:05.179000599 +0000 [ 110s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/stdout 2017-10-12 20:04:05.183000599 +0000 [ 110s] @@ -1,2 +1,5 @@ [ 110s] db_test.c [ 110s] -Done [ 110s] +backtrace() returned 4 addresses [ 110s] +/usr/src/packages/BUILD/tests/db/db_test(main+0x66dc) [0x5656d87c] [ 110s] +/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf6) [0xf740a276] [ 110s] +/usr/src/packages/BUILD/tests/db/db_test(+0x7c78) [0x5656dc78] [ 110s] ./testsuite.at:30: exit code was 134, expected 0 [ 110s] 4. testsuite.at:25: 4. db (testsuite.at:25): FAILED (testsuite.at:30) [ 110s] debian/rules:17: recipe for target 'override_dh_auto_test' failed [ 110s] make[1]: *** [override_dh_auto_test] Error 1 [ 110s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 110s] debian/rules:7: recipe for target 'build' failed [ 110s] make: *** [build] Error 2 [ 110s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 110s] [ 110s] wildcard2 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:04:06 UTC 2017. [ 110s] [ 110s] ### VM INTERACTION START ### [ 113s] [ 91.856678] reboot: Power down [ 114s] ### VM INTERACTION END ### [ 114s] [ 114s] wildcard2 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:04:10 UTC 2017. [ 114s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 12 20:04:57 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 12 Oct 2017 20:04:57 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59dfcb063f1ed_19c5d0ef80233985@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 100s] +/usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/test-source: line 27: 19572 Aborted $abs_top_builddir/tests/db/db_test [ 100s] --- expout 2017-10-12 20:04:38.868000000 +0000 [ 100s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/stdout 2017-10-12 20:04:38.884000000 +0000 [ 100s] @@ -1,2 +1,6 @@ [ 100s] db_test.c [ 100s] -Done [ 100s] +backtrace() returned 5 addresses [ 100s] +/usr/lib/i386-linux-gnu/libosmocore.so.8(osmo_generate_backtrace+0x11) [0xf7726ac1] [ 100s] +/usr/src/packages/BUILD/tests/db/db_test(main+0x69f0) [0x5661dd40] [ 100s] +/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0xf74d8723] [ 100s] +/usr/src/packages/BUILD/tests/db/db_test(+0x7da4) [0x5661dda4] [ 100s] ./testsuite.at:30: exit code was 134, expected 0 [ 100s] 4. testsuite.at:25: 4. db (testsuite.at:25): FAILED (testsuite.at:30) [ 100s] debian/rules:17: recipe for target 'override_dh_auto_test' failed [ 100s] make[1]: *** [override_dh_auto_test] Error 1 [ 100s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 100s] debian/rules:7: recipe for target 'build' failed [ 100s] make: *** [build] Error 2 [ 100s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 100s] [ 100s] lamb02 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:04:39 UTC 2017. [ 100s] [ 100s] ### VM INTERACTION START ### [ 100s] Powering off. [ 100s] [ 93.422220] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 100s] [ 100s] lamb02 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:04:41 UTC 2017. [ 100s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 12 20:05:31 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 12 Oct 2017 20:05:31 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59dfcb232669f_19c5d0ef8023415d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/i586 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 117s] -DAUC IMSI='123456789000000': No 2G Auth Data [ 117s] - [ 117s] -2G: none [ 117s] -3G: struct osmo_sub_auth_data { [ 117s] - .type = UMTS, [ 117s] - .algo = MILENAGE, [ 117s] - .u.umts.opc = 'beefedcafefaceacedaddeddecadefee', [ 117s] - .u.umts.opc_is_op = 1, [ 117s] - .u.umts.k = 'c01ffedc1cadaeac1d1f1edacac1ab0a', [ 117s] - .u.umts.amf = '0000', [ 117s] - .u.umts.sqn = 18446744073709551615, [ 117s] - .u.umts.sqn = 0xffffffffffffffff, [ 117s] - .u.umts.ind_bitlen = 5, [ 117s] -} [ 117s] - [ 117s] - [ 117s] ---- Delete subscriber [ 117s] - [ 117s] -db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 [ 117s] -struct hlr_subscriber { [ 117s] - .id = 1, [ 117s] - .imsi = '123456789000000', [ 117s] -} [ 117s] - [ 119s] -db_s[ 111.392806] reboot: Power down [ 119s] ### VM INTERACTION END ### [ 119s] [ 119s] lamb53 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:05:24 UTC 2017. [ 119s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 12 20:05:48 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 12 Oct 2017 20:05:48 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59dfcb24ae3dc_19c5d0ef802342f9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 114s] | #define HAVE_STRING_H 1 [ 114s] | #define HAVE_MEMORY_H 1 [ 114s] | #define HAVE_STRINGS_H 1 [ 114s] | #define HAVE_INTTYPES_H 1 [ 114s] | #define HAVE_STDINT_H 1 [ 114s] | #define HAVE_UNISTD_H 1 [ 114s] | #define HAVE_DLFCN_H 1 [ 114s] | #define LT_OBJDIR ".libs/" [ 114s] | #define PACKAGE "osmo-hlr" [ 114s] | #define VERSION "UNKNOWN" [ 114s] | #define STDC_HEADERS 1 [ 114s] | [ 114s] | configure: exit 0 [ 114s] [ 114s] debian/rules:17: recipe for target 'override_dh_auto_test' failed [ 114s] make[1]: *** [override_dh_auto_test] Error 1 [ 114s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 114s] debian/rules:7: recipe for target 'build' failed [ 114s] make: *** [build] Error 2 [ 114s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 114s] [ 114s] lamb03 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:05:35 UTC 2017. [ 114s] [ 114s] ### VM INTERACTION START ### [ 117s] [ 110.531070] reboot: Power down [ 117s] ### VM INTERACTION END ### [ 117s] [ 117s] lamb03 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:05:38 UTC 2017. [ 117s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 12 20:06:41 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 12 Oct 2017 20:06:41 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59dfcb639245b_19c5d0ef80235142@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 58s] +DDB Unable to prepare SQL statement 'SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?' [ 58s] +Assert failed dbc db_test.c:811 [ 58s] +/usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/test-source: line 27: 22072 Aborted $abs_top_builddir/tests/db/db_test [ 58s] --- expout 2017-10-12 20:06:35.133014539 +0000 [ 58s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/stdout 2017-10-12 20:06:35.137014539 +0000 [ 58s] @@ -1,2 +1,5 @@ [ 58s] db_test.c [ 58s] -Done [ 58s] +backtrace() returned 4 addresses [ 58s] +/usr/src/packages/BUILD/tests/db/db_test(+0xefb3) [0x55642e569fb3] [ 58s] +/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f2d785a4830] [ 58s] +/usr/src/packages/BUILD/tests/db/db_test(+0xfe49) [0x55642e56ae49] [ 58s] ./testsuite.at:30: exit code was 134, expected 0 [ 58s] 4. testsuite.at:25: 4. db (testsuite.at:25): FAILED (testsuite.at:30) [ 58s] debian/rules:17: recipe for target 'override_dh_auto_test' failed [ 58s] make[1]: *** [override_dh_auto_test] Error 1 [ 58s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 58s] debian/rules:7: recipe for target 'build' failed [ 58s] make: *** [build] Error 2 [ 58s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 58s] [ 58s] build85 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:06:35 UTC 2017. [ 58s] [ 58s] ### VM INTERACTION START ### [ 61s] [ 57.288677] reboot: Power down [ 61s] ### VM INTERACTION END ### [ 61s] [ 61s] build85 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:06:38 UTC 2017. [ 61s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 12 20:07:49 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 12 Oct 2017 20:07:49 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59dfcb9f976f9_19c5d0ef8023555d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 106s] +/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1) [0x7f5889c793f1] [ 106s] +/usr/src/packages/BUILD/tests/db/db_test(+0xfe2a) [0x55bfcfd43e2a] [ 106s] ./testsuite.at:30: exit code was 134, expected 0 [ 106s] 4. testsuite.at:25: 4. db (testsuite.at:25): FAILED (testsuite.at:30) [ 106s] debian/rules:17: recipe for target 'override_dh_auto_test' failed [ 106s] make[1]: *** [override_dh_auto_test] Error 1 [ 106s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 106s] debian/rules:7: recipe for target 'build' failed [ 106s] make: *** [build] Error 2 [ 106s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 106s] [ 106s] cloud125 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:07:32 UTC 2017. [ 106s] [ 106s] ### VM INTERACTION START ### [ 106s] [ 90.053242] serial8250: too much work for irq4 [ 106s] [ 90.114977] serial8250: too much work for irq4 [ 106s] [ 90.177440] serial8250: too much work for irq4 [ 106s] [ 90.240442] serial8250: too much work for irq4 [ 106s] [ 90.328138] serial8250: too much work for irq4 [ 106s] [ 90.392177] serial8250: too much work for irq4 [ 106s] [ 90.456110] serial8250: too much work for irq4 [ 106s] [ 90.516144] serial8250: too much work for irq4 [ 106s] [ 90.576215] serial8250: too much work for irq4 [ 106s] [ 90.640203] serial8250: too much work for irq4 [ 108s] [ 93.627543] reboot: Power down [ 110s] ### VM INTERACTION END ### [ 110s] [ 110s] cloud125 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:07:37 UTC 2017. [ 110s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 12 20:08:06 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 12 Oct 2017 20:08:06 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59dfcbb95c07d_19c5d0ef802356a6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 94s] +Assert failed dbc db_test.c:811 [ 94s] +/usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/test-source: line 27: 19687 Aborted $abs_top_builddir/tests/db/db_test [ 94s] --- expout 2017-10-12 20:07:52.780000000 +0000 [ 94s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/stdout 2017-10-12 20:07:52.792000000 +0000 [ 94s] @@ -1,2 +1,5 @@ [ 94s] db_test.c [ 94s] -Done [ 94s] +backtrace() returned 4 addresses [ 94s] +/usr/src/packages/BUILD/tests/db/db_test(+0xddf1) [0x56479fd38df1] [ 94s] +/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f38a5639b45] [ 94s] +/usr/src/packages/BUILD/tests/db/db_test(+0xedea) [0x56479fd39dea] [ 94s] ./testsuite.at:30: exit code was 134, expected 0 [ 94s] 4. testsuite.at:25: 4. db (testsuite.at:25): FAILED (testsuite.at:30) [ 94s] debian/rules:17: recipe for target 'override_dh_auto_test' failed [ 94s] make[1]: *** [override_dh_auto_test] Error 1 [ 94s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 94s] debian/rules:7: recipe for target 'build' failed [ 94s] make: *** [build] Error 2 [ 94s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 94s] [ 94s] lamb19 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:07:53 UTC 2017. [ 94s] [ 94s] ### VM INTERACTION START ### [ 95s] Powering off. [ 95s] [ 87.579050] reboot: Power down [ 95s] ### VM INTERACTION END ### [ 95s] [ 95s] lamb19 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:07:56 UTC 2017. [ 95s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 12 20:08:57 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 12 Oct 2017 20:08:57 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59dfcbf667dc1_19c5d0ef80236532@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 93s] +DDB Unable to prepare SQL statement 'SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?' [ 93s] +Assert failed dbc db_test.c:811 [ 93s] +/usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/test-source: line 27: 16773 Aborted $abs_top_builddir/tests/db/db_test [ 93s] --- expout 2017-10-12 20:08:48.820000000 +0000 [ 93s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/4/stdout 2017-10-12 20:08:48.836000000 +0000 [ 93s] @@ -1,2 +1,5 @@ [ 93s] db_test.c [ 93s] -Done [ 93s] +backtrace() returned 4 addresses [ 93s] +/usr/src/packages/BUILD/tests/db/db_test(+0xef41) [0x55fbe7892f41] [ 93s] +/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1) [0x7f2ceb6c52b1] [ 93s] +/usr/src/packages/BUILD/tests/db/db_test(+0xfdda) [0x55fbe7893dda] [ 93s] ./testsuite.at:30: exit code was 134, expected 0 [ 93s] 4. testsuite.at:25: 4. db (testsuite.at:25): FAILED (testsuite.at:30) [ 93s] debian/rules:17: recipe for target 'override_dh_auto_test' failed [ 93s] make[1]: *** [override_dh_auto_test] Error 1 [ 93s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 93s] debian/rules:7: recipe for target 'build' failed [ 93s] make: *** [build] Error 2 [ 93s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 93s] [ 93s] lamb22 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:08:49 UTC 2017. [ 93s] [ 93s] ### VM INTERACTION START ### [ 95s] [ 87.132605] reboot: Power down [ 95s] ### VM INTERACTION END ### [ 95s] [ 95s] lamb22 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:08:53 UTC 2017. [ 95s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 12 20:11:14 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 12 Oct 2017 20:11:14 +0000 Subject: Build failure of network:osmocom:nightly/osmo-hlr in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59dfcc6f7f9a3_19c5d0ef8023771b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-hlr/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-hlr failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-hlr Last lines of build log: [ 268s] | #define HAVE_STRING_H 1 [ 268s] | #define HAVE_MEMORY_H 1 [ 268s] | #define HAVE_STRINGS_H 1 [ 268s] | #define HAVE_INTTYPES_H 1 [ 268s] | #define HAVE_STDINT_H 1 [ 268s] | #define HAVE_UNISTD_H 1 [ 268s] | #define HAVE_DLFCN_H 1 [ 268s] | #define LT_OBJDIR ".libs/" [ 268s] | #define PACKAGE "osmo-hlr" [ 268s] | #define VERSION "UNKNOWN" [ 268s] | #define STDC_HEADERS 1 [ 268s] | [ 268s] | configure: exit 0 [ 268s] [ 268s] debian/rules:17: recipe for target 'override_dh_auto_test' failed [ 268s] make[1]: *** [override_dh_auto_test] Error 1 [ 268s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 268s] debian/rules:7: recipe for target 'build' failed [ 268s] make: *** [build] Error 2 [ 268s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 268s] [ 268s] cloud129 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:10:53 UTC 2017. [ 268s] [ 268s] ### VM INTERACTION START ### [ 271s] [ 247.853885] reboot: Power down [ 272s] ### VM INTERACTION END ### [ 272s] [ 272s] cloud129 failed "build osmo-hlr_0.0.1.20171012.dsc" at Thu Oct 12 20:10:57 UTC 2017. [ 272s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Thu Oct 12 22:54:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Oct 2017 22:54:51 +0000 Subject: [PATCH] osmo-hlr[master]: debian: 'make check' needs sqlite3, add to Build-Depends Message-ID: Review at https://gerrit.osmocom.org/4236 debian: 'make check' needs sqlite3, add to Build-Depends At some point we should rather offer DB bootstrap as a DB API function instead of an external .sql file, which would remove the dep on the sqlite3 binary. For now, we need the binary to build debian packages for the 'make check' step. Change-Id: I71938dff688675dcf1dbfbce2feb8b72b1de0910 --- M debian/control 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/36/4236/1 diff --git a/debian/control b/debian/control index 7104c37..d3a32c5 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,8 @@ libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, - libsqlite3-dev + libsqlite3-dev, + sqlite3 Standards-Version: 3.9.6 Vcs-Browser: http://cgit.osmocom.org/osmo-hlr Vcs-Git: git://git.osmocom.org/osmo-hlr -- To view, visit https://gerrit.osmocom.org/4236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I71938dff688675dcf1dbfbce2feb8b72b1de0910 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 12 22:55:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Oct 2017 22:55:17 +0000 Subject: osmo-hlr[master]: debian: 'make check' needs sqlite3, add to Build-Depends In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 fast track to fix debian builds -- To view, visit https://gerrit.osmocom.org/4236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I71938dff688675dcf1dbfbce2feb8b72b1de0910 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 12 22:56:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Oct 2017 22:56:09 +0000 Subject: [MERGED] osmo-hlr[master]: debian: 'make check' needs sqlite3, add to Build-Depends In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian: 'make check' needs sqlite3, add to Build-Depends ...................................................................... debian: 'make check' needs sqlite3, add to Build-Depends At some point we should rather offer DB bootstrap as a DB API function instead of an external .sql file, which would remove the dep on the sqlite3 binary. For now, we need the binary to build debian packages for the 'make check' step. Change-Id: I71938dff688675dcf1dbfbce2feb8b72b1de0910 --- M debian/control 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 7104c37..d3a32c5 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,8 @@ libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, - libsqlite3-dev + libsqlite3-dev, + sqlite3 Standards-Version: 3.9.6 Vcs-Browser: http://cgit.osmocom.org/osmo-hlr Vcs-Git: git://git.osmocom.org/osmo-hlr -- To view, visit https://gerrit.osmocom.org/4236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I71938dff688675dcf1dbfbce2feb8b72b1de0910 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From nhofmeyr at sysmocom.de Thu Oct 12 22:58:52 2017 From: nhofmeyr at sysmocom.de (Neels Hofmeyr) Date: Fri, 13 Oct 2017 00:58:52 +0200 Subject: Build failure of network:osmocom:nightly/osmo-hlr in Debian_9.0/x86_64 In-Reply-To: <59dfcbf667dc1_19c5d0ef80236532@build.opensuse.org> References: <59dfcbf667dc1_19c5d0ef80236532@build.opensuse.org> Message-ID: <20171012225852.GA9850@my.box> Should be fixed by https://gerrit.osmocom.org/4236 The sqlite3 binary needs to be in Build-Depends. ~N On Thu, Oct 12, 2017 at 08:08:57PM +0000, OBS Notification wrote: > [ 93s] +DDB Unable to prepare SQL statement 'SELECT id,imsi,msisdn,vlr_number,sgsn_number,sgsn_address,periodic_lu_tmr,periodic_rau_tau_tmr,nam_cs,nam_ps,lmsi,ms_purged_cs,ms_purged_ps FROM subscriber WHERE imsi = ?' > [ 93s] +Assert failed dbc db_test.c:811 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From gerrit-no-reply at lists.osmocom.org Fri Oct 13 00:09:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 00:09:59 +0000 Subject: libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (13 comments) The implementation is almost perfect, but we need to improve on the API doc and unit tests... https://gerrit.osmocom.org/#/c/4200/3/src/msgb.c File src/msgb.c: Line 383: /*! Print a string to the end of message buffer Always end with a full stop '.' as I commented numerous times before. Besides being common sense, it's to guarantee the doxygen autobrief works as expected. Line 388: * will not be changed at all. If the buffer has no tailroom left (<1 means ==0), then there is no valid way to change the buffer, so this remark does not really say much beyond what is obvious. It would be important to focus on the nul terminator, maybe something like: The resulting string is printed to the msgb without a trailing nul character. A nul following the data tail may be written as an implementation detail, but a trailing nul is never part of the msgb data in terms of msgb_length(). Note: the tailroom must always be one byte longer than the string to be written. The msgb is filled only up to tailroom=1. This is an implementation detail that allows leaving a nul character behind the valid data. Line 390: * In case of error, the message buffer may be left with invalid data This should be: In case of error, the msgb remains unchanged, though data may have been written to the (unused) memory after the tail pointer. Does snprintf even write anything on error? I think not, right? In that case we can just write that it remains unchanged and done. Line 394: * ready for a second attempt (with less data). I think we don't need to hint at second attempts, it follows naturally from "remains unchanged". Line 399: * terminator. Doesn't this merely restate "Print a string to the end of a message buffer"? Drop this paragraph? Line 402: * result will be a single, concatenated string. Also obvious and can be dropped? Line 424: *msgb->tail = '\0'; hmm really? I would rather leave unchanged, and leave \0 responsibility with the caller; I don't want to assume that \0 is part of the protocol used by the caller. Also questionable whether tail still points within valid buffer space. Let's rather drop this line? https://gerrit.osmocom.org/#/c/4200/3/tests/msgb/msgb_test.c File tests/msgb/msgb_test.c: Line 289: total_len = strlen((char *)msg->data); Rather use msgb_length() to verify what the msgb reflects as its length, not strlen() to interpret the data externally. With the current test you will not be able to catch erratic msgb_length(). The terminating nul is, to me, just an implementation detail, a side effect from snprintf() that we should not need nor rely on. (same each time below) Line 291: msg->data); hmm, this also relies on a terminating nul. We should again rather dump exactly the part marked as valid by msgb_length() ... not sure how to do it best, maybe with a local utility function that prints exactly msgb_length() single characters? Like that we would also catch a \0 char written in the middle of the valid data...? Line 300: below you assert tailroom == 17, I'd also have the same assert here, so that it is clear the tailroom was not changed by the call. Line 324: OSMO_ASSERT(total_len == 63); rather assert msgb_length() == 63 Line 333: /* Make sure that the string in the bufer takes up all available "all available space." ? And then start a new sentence with a captial letter? Line 349: OSMO_ASSERT(total_len == 79); and finally please add one test where an already full buffer with tailroom == 0 is passed to msgb_printf() and assert that nothing has changed. Best would be to also somehow assert that no \0 was written behind the memory allocated by the msgb. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 13 10:10:36 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Oct 2017 10:10:36 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: move port/timeslot calculator to separate header Message-ID: Review at https://gerrit.osmocom.org/4237 mgcp: move port/timeslot calculator to separate header the functions rtp_calculate_port(), mgcp_timeslot_to_endpoint(), mgcp_endpoint_to_timeslot() may be useful in an application that uses the mgcp_client as well. Unfortunately it is not possible to include mgcp.h when mgcp_client.h is already included. Move the functions to a separate header file that can be included without issues from both sides. Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e --- M include/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_calc.h 3 files changed, 70 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/37/4237/1 diff --git a/include/Makefile.am b/include/Makefile.am index 3cc4b1d..dcf9fb0 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -9,6 +9,7 @@ osmocom/mgcp_client/mgcp_client.h \ osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ + osmocom/mgcp/mgcp_calc.h \ osmocom/mgcp/mgcp_internal.h \ osmocom/mgcp/osmux.h \ $(NULL) diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 67c499b..6437203 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -36,29 +36,6 @@ #define RTP_PORT_DEFAULT_RANGE_START 16002 #define RTP_PORT_DEFAULT_RANGE_END RTP_PORT_DEFAULT_RANGE_START + 64 -/** - * Calculate the RTP audio port for the given multiplex - * and the direction. This allows a semi static endpoint - * to port calculation removing the need for the BSC - * and the MediaGateway to communicate. - * - * Port usage explained: - * base + (multiplex * 2) + 0 == local port to wait for network packets - * base + (multiplex * 2) + 1 == local port for rtcp - * - * The above port will receive packets from the BTS that need - * to be patched and forwarded to the network. - * The above port will receive packets from the network that - * need to be patched and forwarded to the BTS. - * - * We assume to have a static BTS IP address so we can differentiate - * network and BTS. - * - */ -static inline int rtp_calculate_port(int multiplex, int base) -{ - return base + (multiplex * 2); -} /* @@ -250,22 +227,6 @@ */ struct msgb *mgcp_handle_message(struct mgcp_config *cfg, struct msgb *msg); -/* adc helper */ -static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot) -{ - if (timeslot == 0) { - LOGP(DLMGCP, LOGL_ERROR, "Timeslot should not be 0\n"); - timeslot = 255; - } - - return timeslot + (32 * multiplex); -} - -static inline void mgcp_endpoint_to_timeslot(int endpoint, int *multiplex, int *timeslot) -{ - *multiplex = endpoint / 32; - *timeslot = endpoint % 32; -} int mgcp_send_reset_ep(struct mgcp_endpoint *endp, int endpoint); int mgcp_send_reset_all(struct mgcp_config *cfg); diff --git a/include/osmocom/mgcp/mgcp_calc.h b/include/osmocom/mgcp/mgcp_calc.h new file mode 100644 index 0000000..1939176 --- /dev/null +++ b/include/osmocom/mgcp/mgcp_calc.h @@ -0,0 +1,69 @@ +/* Helpers to calculate ports and endpoints */ + +/* + * (C) 2009-2012 by Holger Hans Peter Freyther + * (C) 2009-2012 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +/** + * Calculate the RTP audio port for the given multiplex + * and the direction. This allows a semi static endpoint + * to port calculation removing the need for the BSC + * and the MediaGateway to communicate. + * + * Port usage explained: + * base + (multiplex * 2) + 0 == local port to wait for network packets + * base + (multiplex * 2) + 1 == local port for rtcp + * + * The above port will receive packets from the BTS that need + * to be patched and forwarded to the network. + * The above port will receive packets from the network that + * need to be patched and forwarded to the BTS. + * + * We assume to have a static BTS IP address so we can differentiate + * network and BTS. + * + */ +static inline int rtp_calculate_port(int multiplex, int base) +{ + return base + (multiplex * 2); +} + +/** + * Calculate the MGCP endpoint from a given timeslot + */ +static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot) +{ + if (timeslot == 0) { + LOGP(DLMGCP, LOGL_ERROR, "Timeslot should not be 0\n"); + timeslot = 255; + } + + return timeslot + (32 * multiplex); +} + +/** + * Calculate the timeslot from a given mgcp endpoint + */ +static inline void mgcp_endpoint_to_timeslot(int endpoint, int *multiplex, int *timeslot) +{ + *multiplex = endpoint / 32; + *timeslot = endpoint % 32; +} -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Oct 13 10:10:36 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Oct 2017 10:10:36 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: remove unnecessary include Message-ID: Review at https://gerrit.osmocom.org/4238 mgcp: remove unnecessary include mgcp.h includes mgcp_ep.h but does not use anything from it. This does not hurt the mgcp code internally, but when mgcp.h is included by an application compilation fails because mgcp_ep.h is not installed. remove mgcp_ep.h from include list. Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 --- M include/osmocom/mgcp/mgcp.h 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/38/4238/1 diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 6437203..00d0760 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include -- To view, visit https://gerrit.osmocom.org/4238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Oct 13 11:32:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 13 Oct 2017 11:32:27 +0000 Subject: libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/4200/3/tests/msgb/msgb_test.c File tests/msgb/msgb_test.c: Line 291: msg->data); > hmm, this also relies on a terminating nul. We should again rather dump exa Not sure I get what you want, but there's msgb_hexdump() which might be useful for msgb printing. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 13 13:34:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 13:34:13 +0000 Subject: osmo-mgw[master]: mgcp: move port/timeslot calculator to separate header In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) Please clarify, does the new MGW need this at all? Is this only for bsc-nat? So far I thought the new MGW allocates ports as it sees fit and communicates the right port numbers back to the client(s), hence these functions would not be needed. Please clarify, why is it not possible to include mgcp.h when mgcp_client.h is already included? They should both be completely separate now, besides mgcp_common.h. https://gerrit.osmocom.org/#/c/4237/1/include/osmocom/mgcp/mgcp_calc.h File include/osmocom/mgcp/mgcp_calc.h: Line 1: /* Helpers to calculate ports and endpoints */ This header can be used by both libraries without linking conflicts because it only contains static inline functions. However, upon debian packaging of the -dev packages, this will hit a conflict: both the libosmo-mgcp-dev and libosmo-mgcp-client-dev will need to install this header file and hence they will conflict. With mgcp_common.h, this problem has been resolved by copying the file from mgcp/ to mgcp_client/ at build time (which avoids code dup), and by including each separate copy in the debian packages, so that one ends up in include/osmocom/mgcp and the other in include/osmocom/mgcp_client. The easiest (IMHO best) would be if you simply added these functions to mgcp/mgcp_common.h instead of a new header file. Otherwise copy this header like mgcp_common.h and make sure to add it to debian/ as well. -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 13 13:36:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 13:36:26 +0000 Subject: osmo-mgw[master]: mgcp: remove unnecessary include In-Reply-To: References: Message-ID: Patch Set 2: rebasing this onto current master to not depend on the libosmocore commit and see whether the gerrit build succeeds. -- To view, visit https://gerrit.osmocom.org/4238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 13:38:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 13:38:49 +0000 Subject: osmo-mgw[master]: mgcp: remove unnecessary include In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 This appears to introduce a build failure when applied to current master: mgcp_conn.c: In function 'mgcp_conn_alloc': mgcp_conn.c:89:45: error: dereferencing pointer to incomplete type if (llist_count(&endp->conns) >= endp->type->max_conns) ^ -- To view, visit https://gerrit.osmocom.org/4238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 13:39:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 13:39:03 +0000 Subject: osmo-ggsn[master]: lib/tun.c: tun_ipv6_linklocal_get(): fix memory leak with ge... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If6300d1c8d36fcafef294a4c11bbda31a158bb9c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 13:52:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 13:52:13 +0000 Subject: libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/4200/3/tests/msgb/msgb_test.c File tests/msgb/msgb_test.c: Line 291: msg->data); > Not sure I get what you want, but there's msgb_hexdump() which might be use what I want is to output the buffer contents as indicated by msgb_length(), instead of trying to guess its length with strlen() on the data and relying on a nul byte that is actually outside of the msgb data. msgb_hexdump() works, but it outputs the hexdump instead of the plain string, so it makes it hard for humans to verify that the resulting string is as expected. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:12:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Oct 2017 14:12:59 +0000 Subject: [MERGED] osmo-ggsn[master]: lib/tun.c: tun_ipv6_linklocal_get(): fix memory leak with ge... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: lib/tun.c: tun_ipv6_linklocal_get(): fix memory leak with getifaddrs() ...................................................................... lib/tun.c: tun_ipv6_linklocal_get(): fix memory leak with getifaddrs() >From getifaddrs(3) man: "The data returned by getifaddrs() is dynamically allocated and should be freed using freeifaddrs() when no longer needed" Change-Id: If6300d1c8d36fcafef294a4c11bbda31a158bb9c --- M lib/tun.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/tun.c b/lib/tun.c index 32a8d2d..35d371e 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -776,7 +776,9 @@ continue; *ia = sin6->sin6_addr; + freeifaddrs(ifaddr); return 0; } + freeifaddrs(ifaddr); return -1; } -- To view, visit https://gerrit.osmocom.org/4235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If6300d1c8d36fcafef294a4c11bbda31a158bb9c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:25:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 14:25:08 +0000 Subject: osmo-gsm-tester[master]: modem: Implement voice calls in modem and add voice suite In-Reply-To: References: Message-ID: Patch Set 1: (5 comments) https://gerrit.osmocom.org/#/c/4150/1/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 594: call_dbus_obj = systembus_get(call_id) > I guess it will throw an exception. I wouldn't invest time in this until we ok then Line 601: call_dbus_obj = systembus_get(call_id) > I could add a "call_exists(call_id) which basically does systembus_get(call indeed, waiting for a NoneTypeException to happen is easier for now https://gerrit.osmocom.org/#/c/4150/1/suites/voice/mo_mt_call.py File suites/voice/mo_mt_call.py: Line 35: wait(msc.subscriber_attached, ms_mo, ms_mt) > I think we should have some kind of test-side library of function for steps like a from osmo_gsm_tester.common import bootstrap_net Line 40: mt_call_id = ms_mt.call_id_list()[0] > AFAIR the VoiceCall interface has the number of the other endpoint in its p semantically I would welcome the ability to wait for a specific subscriber to call, so I think ms_mt.call_wait_incoming(ms_or_msisdn) would be worthwhile, yes Line 53: wait(lambda: len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0) > You cannot do that because it may take a while (delay) for the other ms to I mean, just make sure that before we start doing anything with voice calls way above, verify that the call_id_list() is empty as expected. Simply because here we assume that ending the call brings us back to an empty list. -- To view, visit https://gerrit.osmocom.org/4150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib402effc830db293f27a877658894e454a93a606 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:28:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:28:06 +0000 Subject: [PATCH] osmo-ggsn[master]: Add ippool unit-test for 'make check' runs Message-ID: Review at https://gerrit.osmocom.org/4245 Add ippool unit-test for 'make check' runs This test creates a variety of v4 (and one v6) pool and performs allocations until the pool is full, then frees a random number of randomly distributed addresses, re-allocates them and again checks that they're all available and finally once the pool is full allocations fail. Change-Id: Ibf4588e8f3ae71684e5262c0caaa2689aee73a94 --- M .gitignore M Makefile.am M configure.ac A tests/Makefile.am A tests/lib/Makefile.am A tests/lib/ippool_test.c A tests/lib/ippool_test.err A tests/lib/ippool_test.ok A tests/testsuite.at 9 files changed, 66,755 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/45/4245/1 -- To view, visit https://gerrit.osmocom.org/4245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf4588e8f3ae71684e5262c0caaa2689aee73a94 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:28:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:28:07 +0000 Subject: [PATCH] osmo-ggsn[master]: Remove trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/4246 Remove trailing whitespace Change-Id: I8e24f95a88bef3a59006a89c219871e6156963d7 --- M ggsn/ggsn.c M lib/in46_addr.c M lib/ippool.c M lib/ippool.h M lib/tun.c M lib/tun.h 6 files changed, 16 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/46/4246/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 6c5c1a8..67d040f 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,13 +1,13 @@ -/* +/* * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2017 by Harald Welte - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ /* ggsn.c diff --git a/lib/in46_addr.c b/lib/in46_addr.c index f78a40b..068499c 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -6,7 +6,7 @@ * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ #include "../lib/in46_addr.h" diff --git a/lib/ippool.c b/lib/ippool.c index a236fe7..d9164a3 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -7,7 +7,7 @@ * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ #include @@ -374,7 +374,7 @@ uint32_t hash; /* If static: - * Look in dynaddr. + * Look in dynaddr. * If found remove from firstdyn/lastdyn linked list. * Else allocate from stataddr. * Remove from firststat/laststat linked list. diff --git a/lib/ippool.h b/lib/ippool.h index fbac66d..56beb4e 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -1,12 +1,12 @@ -/* +/* * IP address pool functions. * Copyright (C) 2003, 2004 Mondru AB. - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ #ifndef _IPPOOL_H @@ -23,7 +23,7 @@ When initialising a new address pool it should be possible to pass a string of CIDR format networks: "10.0.0.0/24 10.15.0.0/20" would translate to 256 addresses starting at 10.0.0.0 and 1024 addresses - starting at 10.15.0.0. + starting at 10.15.0.0. The above also applies to IPv6 which can be specified as described in RFC2373. diff --git a/lib/tun.c b/lib/tun.c index 35d371e..7662146 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -1,13 +1,13 @@ -/* +/* * TUN interface functions. * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2017 by Harald Welte - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ /* diff --git a/lib/tun.h b/lib/tun.h index 95fff26..f63be50 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -1,13 +1,13 @@ -/* +/* * TUN interface functions. * Copyright (C) 2002, 2003 Mondru AB. * Copyright (C) 2017 by Harald Welte - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ #ifndef _TUN_H -- To view, visit https://gerrit.osmocom.org/4246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e24f95a88bef3a59006a89c219871e6156963d7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:28:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:28:07 +0000 Subject: [PATCH] osmo-ggsn[master]: update .gitignore Message-ID: Review at https://gerrit.osmocom.org/4247 update .gitignore Change-Id: I030bd616dd27d49e55b5bdcc7c0b4fa3eb523da4 --- M .gitignore 1 file changed, 30 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/47/4247/1 diff --git a/.gitignore b/.gitignore index 25cd613..61409f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +# autotools Makefile Makefile.in aclocal.m4 @@ -17,34 +18,51 @@ missing osmo-ggsn.spec stamp-h1 -doc/Makefile.in -ggsn/Makefile.in -gtp/Makefile.in -sgsnemu/Makefile.in +INSTALL +m4/ +Makefile +osmo-ggsn-*.tar* +.version +.tarball-version + +# debian debian/osmo-ggsn/ debian/*.debhelper -debian/libgtp/ +debian/libgtp1 +debian/osmo-ggsn-dbg debian/*.log -INSTALL debian/autoreconf.* debian/*.substvars debian/tmp/ -sgsnemu/sgsnemu debian/files debian/libgtp-dev/ + +# programs / libraries +sgsnemu/sgsnemu libgtp.pc ggsn/osmo-ggsn -m4/ -*.swp + +# compiler results *.o *.a *.la *.lo +*.pyc +.deps +.libs + +# misc +*.swp +.dirstamp +.deps *.orig +*.new *.rej -*/.deps -*/.libs -*/Makefile +*~ +osmo-ggsn.cfg +sgsnemu.pid +gsn_restart + # testsuite tests/atconfig tests/*/*_test -- To view, visit https://gerrit.osmocom.org/4247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I030bd616dd27d49e55b5bdcc7c0b4fa3eb523da4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:28:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:28:07 +0000 Subject: [PATCH] osmo-ggsn[master]: tests: Remove Makefile.in Message-ID: Review at https://gerrit.osmocom.org/4248 tests: Remove Makefile.in Change-Id: Ie21e8bfab7cda52aa696dd26280efc05c4b51bba --- D tests/Makefile.in 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/48/4248/1 diff --git a/tests/Makefile.in b/tests/Makefile.in deleted file mode 100644 index e69de29..0000000 --- a/tests/Makefile.in +++ /dev/null -- To view, visit https://gerrit.osmocom.org/4248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie21e8bfab7cda52aa696dd26280efc05c4b51bba Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:28:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:28:08 +0000 Subject: [PATCH] osmo-ggsn[master]: in46a_to_sas(): Return AF_INET6 in case of IPv6 address Message-ID: Review at https://gerrit.osmocom.org/4249 in46a_to_sas(): Return AF_INET6 in case of IPv6 address Change-Id: Ia2f9ac60f08823d5f7c1a76c0b7cbd65ac615e26 --- M lib/in46_addr.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/49/4249/1 diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 068499c..32e0f8d 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -49,7 +49,7 @@ sin->sin_addr = in->v4; break; case 16: - sin6->sin6_family = AF_INET; + sin6->sin6_family = AF_INET6; sin6->sin6_addr = in->v6; break; default: -- To view, visit https://gerrit.osmocom.org/4249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2f9ac60f08823d5f7c1a76c0b7cbd65ac615e26 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:28:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:28:08 +0000 Subject: [PATCH] osmo-ggsn[master]: Add unit tests for lib/in46_addr.c code Message-ID: Review at https://gerrit.osmocom.org/4250 Add unit tests for lib/in46_addr.c code Change-Id: Id032c330405e5dca8ecfc0970d128341ed75c675 --- M tests/lib/Makefile.am A tests/lib/in46a_test.c A tests/lib/in46a_test.ok M tests/testsuite.at 4 files changed, 297 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/50/4250/1 diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index ae54127..95d6901 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -1,8 +1,9 @@ AM_CFLAGS = -Wall -I$(top_srcdir)/include $(LIBOSMOCORE_CFLAGS) -g -EXTRA_DIST = ippool_test.ok ippool_test.err +EXTRA_DIST = ippool_test.ok ippool_test.err \ + in46a_test.ok -noinst_PROGRAMS = ippool_test +noinst_PROGRAMS = ippool_test in46a_test ippool_test_SOURCES = \ ippool_test.c \ @@ -12,3 +13,12 @@ $(top_builddir)/lib/libmisc.a \ $(LIBOSMOCORE_LIBS) \ $(NULL) + +in46a_test_SOURCES = \ + in46a_test.c \ + $(NULL) + +in46a_test_LDADD = \ + $(top_builddir)/lib/libmisc.a \ + $(LIBOSMOCORE_LIBS) \ + $(NULL) diff --git a/tests/lib/in46a_test.c b/tests/lib/in46a_test.c new file mode 100644 index 0000000..9dbbb48 --- /dev/null +++ b/tests/lib/in46a_test.c @@ -0,0 +1,262 @@ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "../../lib/in46_addr.h" +#include "../../lib/syserr.h" + +static const struct in46_addr g_ia4 = { + .len = 4, + .v4.s_addr = 0x0d0c0b0a, +}; + +static const struct in46_addr g_ia6 = { + .len = 16, + .v6.s6_addr = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }, +}; + +static void test_in46a_to_af(void) +{ + struct in46_addr ia; + + printf("Testing in46a_to_af()\n"); + + OSMO_ASSERT(in46a_to_af(&g_ia4) == AF_INET); + OSMO_ASSERT(in46a_to_af(&g_ia6) == AF_INET6); + + ia.len = 8; + OSMO_ASSERT(in46a_to_af(&ia) == AF_INET6); +} + +static void test_in46a_to_sas(void) +{ + struct sockaddr_storage ss; + struct sockaddr_in *sin = (struct sockaddr_in *) &ss; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &ss; + + printf("Testing in46a_to_sas()\n"); + + memset(&ss, 0, sizeof(ss)); + OSMO_ASSERT(in46a_to_sas(&ss, &g_ia4) == 0); + OSMO_ASSERT(sin->sin_family == AF_INET); + OSMO_ASSERT(sin->sin_addr.s_addr == g_ia4.v4.s_addr); + + memset(&ss, 0, sizeof(ss)); + OSMO_ASSERT(in46a_to_sas(&ss, &g_ia6) == 0); + OSMO_ASSERT(sin6->sin6_family == AF_INET6); + OSMO_ASSERT(!memcmp(&sin6->sin6_addr, &g_ia6.v6, sizeof(sin6->sin6_addr))); +} + +static void test_in46a_ntop(void) +{ + struct in46_addr ia; + char buf[256]; + const char *res; + + printf("Testing in46a_ntop()\n"); + + res = in46a_ntop(NULL, buf, sizeof(buf)); + OSMO_ASSERT(res && !strcmp(res, "UNDEFINED")); + printf("res = %s\n", res); + + ia.len = 0; + res = in46a_ntop(&ia, buf, sizeof(buf)); + printf("res = %s\n", res); + OSMO_ASSERT(res && !strcmp(res, "UNDEFINED")); + + ia.len = 4; + ia.v4.s_addr = htonl(0x01020304); + res = in46a_ntop(&ia, buf, sizeof(buf)); + OSMO_ASSERT(res && !strcmp(res, "1.2.3.4")); + printf("res = %s\n", res); + + res = in46a_ntop(&g_ia6, buf, sizeof(buf)); + OSMO_ASSERT(res && !strcmp(res, "102:304:506:708:90a:b0c:d0e:f10")); + printf("res = %s\n", res); +} + +static void test_in46p_ntoa(void) +{ + const struct in46_prefix ip46 = { + .prefixlen = 24, + .addr = { + .len = 4, + .v4.s_addr = htonl(0x10203000), + }, + }; + printf("in46p_ntoa() returns %s\n", in46p_ntoa(&ip46)); +} + +static void test_in46a_equal(void) +{ + struct in46_addr b; + + printf("Testing in46a_equal()\n"); + + memset(&b, 0xff, sizeof(b)); + b.len = g_ia4.len; + b.v4.s_addr = g_ia4.v4.s_addr; + OSMO_ASSERT(in46a_equal(&g_ia4, &b)); + + memset(&b, 0xff, sizeof(b)); + b.len = g_ia6.len; + b.v6 = g_ia6.v6; + OSMO_ASSERT(in46a_equal(&g_ia6, &b)); + +} + + +static int log_in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, + size_t prefixlen) +{ + int rc; + + printf("in46a_within_mask(%s, ", in46a_ntoa(addr)); + printf("%s, %lu) = ", in46a_ntoa(net), prefixlen); + + rc = in46a_within_mask(addr, net, prefixlen); + printf("%d\n", rc); + + return rc; +} + +static void test_in46a_within_mask(void) +{ + struct in46_addr addr, mask; + + printf("Testing in46a_within_mask()\n"); + + addr = g_ia4; + mask = g_ia4; + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 32)); + + mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfffffffC ); + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 30)); + + mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfff80000 ); + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 13)); + + addr.v4.s_addr = htonl(ntohl(addr.v4.s_addr) + 1); + mask = g_ia4; + OSMO_ASSERT(!log_in46a_within_mask(&addr, &mask, 32)); + mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfffffffC ); + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 30)); +} + +static void test_in46a_to_eua(void) +{ + const struct in46_addr ia_v6_8 = { + .len = 8, + .v6.s6_addr = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }, + }; + struct ul66_t eua; + + printf("testing in46a_to_eua()\n"); + +#if 0 /* triggers assert in current implementation */ + const struct in46_addr ia_invalid = { .len = 3, }; + OSMO_ASSERT(in46a_to_eua(&ia_invalid, &eua) < 0); +#endif + + /* IPv4 address */ + OSMO_ASSERT(in46a_to_eua(&g_ia4, &eua) == 0); + OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); + OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v4); + OSMO_ASSERT(*(uint32_t *) &eua.v[2] == g_ia4.v4.s_addr); + + /* IPv6 address */ + OSMO_ASSERT(in46a_to_eua(&g_ia6, &eua) == 0); + OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); + OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v6); + OSMO_ASSERT(!memcmp(&eua.v[2], &g_ia6.v6, 16)); + + /* IPv6 address with prefix / length 8 */ + OSMO_ASSERT(in46a_to_eua(&ia_v6_8, &eua) == 0); + OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); + OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v6); + OSMO_ASSERT(!memcmp(&eua.v[2], &ia_v6_8.v6, 16)); +} + +static void test_in46a_from_eua(void) +{ + struct in46_addr ia; + struct ul66_t eua; + const uint8_t v4_unspec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4 }; + const uint8_t v4_spec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4, 1,2,3,4 }; + const uint8_t v6_unspec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v6 }; + const uint8_t v6_spec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v6, + 1,2,3,4,5,6,7,8,9,0xa,0xb,0xc,0xd,0xe,0xf,0x10 }; + + memset(&eua, 0, sizeof(eua)); + + printf("Testing in46a_from_eua()\n"); + + /* default: v4 unspec */ + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 4); + OSMO_ASSERT(ia.v4.s_addr == 0); + + /* invalid */ + eua.v[0] = 0x23; + eua.v[1] = PDP_EUA_TYPE_v4; + eua.l = 6; + OSMO_ASSERT(in46a_from_eua(&eua, &ia) < 0); + + /* invalid */ + eua.v[0] = PDP_EUA_ORG_IETF; + eua.v[1] = 0x23; + eua.l = 6; + OSMO_ASSERT(in46a_from_eua(&eua, &ia) < 0); + + /* unspecified V4 */ + memcpy(eua.v, v4_unspec, sizeof(v4_unspec)); + eua.l = sizeof(v4_unspec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 4); + OSMO_ASSERT(ia.v4.s_addr == 0); + + /* specified V4 */ + memcpy(eua.v, v4_spec, sizeof(v4_spec)); + eua.l = sizeof(v4_spec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 4); + OSMO_ASSERT(ia.v4.s_addr == htonl(0x01020304)); + + /* unspecified V6 */ + memcpy(eua.v, v6_unspec, sizeof(v6_unspec)); + eua.l = sizeof(v6_unspec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 16); + OSMO_ASSERT(IN6_IS_ADDR_UNSPECIFIED(&ia.v6)); + + /* specified V6 */ + memcpy(eua.v, v6_spec, sizeof(v6_spec)); + eua.l = sizeof(v6_spec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 16); + OSMO_ASSERT(!memcmp(&ia.v6, v6_spec+2, ia.len)); +} + +int main(int argc, char **argv) +{ + osmo_init_logging(&log_info); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + + srand(time(NULL)); + + test_in46a_to_af(); + test_in46a_to_sas(); + test_in46a_ntop(); + test_in46p_ntoa(); + test_in46a_equal(); + test_in46a_within_mask(); + test_in46a_to_eua(); + test_in46a_from_eua(); +} diff --git a/tests/lib/in46a_test.ok b/tests/lib/in46a_test.ok new file mode 100644 index 0000000..b115444 --- /dev/null +++ b/tests/lib/in46a_test.ok @@ -0,0 +1,17 @@ +Testing in46a_to_af() +Testing in46a_to_sas() +Testing in46a_ntop() +res = UNDEFINED +res = UNDEFINED +res = 1.2.3.4 +res = 102:304:506:708:90a:b0c:d0e:f10 +in46p_ntoa() returns 16.32.48.0/24 +Testing in46a_equal() +Testing in46a_within_mask() +in46a_within_mask(10.11.12.13, 10.11.12.13, 32) = 1 +in46a_within_mask(10.11.12.13, 10.11.12.12, 30) = 1 +in46a_within_mask(10.11.12.13, 10.8.0.0, 13) = 1 +in46a_within_mask(10.11.12.14, 10.11.12.13, 32) = 0 +in46a_within_mask(10.11.12.14, 10.11.12.12, 30) = 1 +testing in46a_to_eua() +Testing in46a_from_eua() diff --git a/tests/testsuite.at b/tests/testsuite.at index a10152f..cc0c949 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -7,3 +7,9 @@ cat $abs_srcdir/lib/ippool_test.err > experr AT_CHECK([$abs_top_builddir/tests/lib/ippool_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([in46a]) +AT_KEYWORDS([in46a]) +cat $abs_srcdir/lib/in46a_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/lib/in46a_test], [], [expout], []) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id032c330405e5dca8ecfc0970d128341ed75c675 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:28:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:28:08 +0000 Subject: [PATCH] osmo-ggsn[master]: gtpie_tlv() gtpie_tv0(): const-ify read-only input argument Message-ID: Review at https://gerrit.osmocom.org/4251 gtpie_tlv() gtpie_tv0(): const-ify read-only input argument Change-Id: Ide487e34884c8356694246f43c3f1f562357304c --- M gtp/gtpie.c M gtp/gtpie.h 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/51/4251/1 diff --git a/gtp/gtpie.c b/gtp/gtpie.c index 0744370..accc542 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -40,7 +40,7 @@ #include "gtpie.h" int gtpie_tlv(void *p, unsigned int *length, unsigned int size, uint8_t t, - int l, void *v) + int l, const void *v) { if ((*length + 3 + l) >= size) return 1; @@ -52,7 +52,7 @@ } int gtpie_tv0(void *p, unsigned int *length, unsigned int size, uint8_t t, - int l, uint8_t * v) + int l, const uint8_t * v) { if ((*length + 1 + l) >= size) return 1; diff --git a/gtp/gtpie.h b/gtp/gtpie.h index 9fe7943..96ff67a 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -221,9 +221,9 @@ } __attribute__ ((packed)); extern int gtpie_tlv(void *p, unsigned int *length, unsigned int size, - uint8_t t, int l, void *v); + uint8_t t, int l, const void *v); extern int gtpie_tv0(void *p, unsigned int *length, unsigned int size, - uint8_t t, int l, uint8_t * v); + uint8_t t, int l, const uint8_t * v); extern int gtpie_tv1(void *p, unsigned int *length, unsigned int size, uint8_t t, uint8_t v); extern int gtpie_tv2(void *p, unsigned int *length, unsigned int size, -- To view, visit https://gerrit.osmocom.org/4251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide487e34884c8356694246f43c3f1f562357304c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:28:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:28:08 +0000 Subject: [PATCH] osmo-ggsn[master]: gtpie: Add doxygen API documentation Message-ID: Review at https://gerrit.osmocom.org/4252 gtpie: Add doxygen API documentation libgtp should have proper API documentation, let's start with the gtpie.[ch] parts. Change-Id: I97df5bd3c8dcc5c97a114c8c6abadabf33147b05 --- M gtp/gtpie.c 1 file changed, 110 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/52/4252/1 diff --git a/gtp/gtpie.c b/gtp/gtpie.c index accc542..4cfb373 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -39,6 +39,14 @@ #include "gtpie.h" +/*! Encode a TLV type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] l Length of value \a v in bytes + * \param[in] v Pointer to input value + * \returns 0 on success, 1 on error */ int gtpie_tlv(void *p, unsigned int *length, unsigned int size, uint8_t t, int l, const void *v) { @@ -51,6 +59,14 @@ return 0; } +/*! Encode a TV0 (Tag + value) type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] l Length of value \a v in bytes + * \param[in] v Pointer to input value + * \returns 0 on success, 1 on error */ int gtpie_tv0(void *p, unsigned int *length, unsigned int size, uint8_t t, int l, const uint8_t * v) { @@ -62,6 +78,13 @@ return 0; } +/*! Encode a TV1 (Tag + 8bit value) type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] v Input value + * \returns 0 on success, 1 on error */ int gtpie_tv1(void *p, unsigned int *length, unsigned int size, uint8_t t, uint8_t v) { @@ -73,6 +96,13 @@ return 0; } +/*! Encode a TV2 (Tag + 16bit value) type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] v Input value + * \returns 0 on success, 1 on error */ int gtpie_tv2(void *p, unsigned int *length, unsigned int size, uint8_t t, uint16_t v) { @@ -84,6 +114,13 @@ return 0; } +/*! Encode a TV4 (Tag + 32bit value) type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] v Input value + * \returns 0 on success, 1 on error */ int gtpie_tv4(void *p, unsigned int *length, unsigned int size, uint8_t t, uint32_t v) { @@ -95,6 +132,13 @@ return 0; } +/*! Encode a TV8 (Tag + 64bit value) type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] v Input value + * \returns 0 on success, 1 on error */ int gtpie_tv8(void *p, unsigned int *length, unsigned int size, uint8_t t, uint64_t v) { @@ -106,6 +150,11 @@ return 0; } +/*! Obtain a GTP IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \returns index into \a ie on success; -1 if not found */ int gtpie_getie(union gtpie_member *ie[], int type, int instance) { int j; @@ -118,6 +167,11 @@ return -1; } +/*! Determine if IE for a given tag/IEI exists in a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \returns 1 if IEI instance present in \a ie; 0 if not */ int gtpie_exist(union gtpie_member *ie[], int type, int instance) { int j; @@ -130,6 +184,14 @@ return 0; } +/*! Obtain Value of TLV-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[out] length Length of IE + * \param[inout] dst Caller-allocated buffer where to store value + * \param[in] size Size of \a dst in bytes + * \returns 0 on sucess; EOF in case value is larger than \a size */ int gtpie_gettlv(union gtpie_member *ie[], int type, int instance, unsigned int *length, void *dst, unsigned int size) { @@ -145,6 +207,13 @@ return 0; } +/*! Obtain Value of TV0-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[inout] dst Caller-allocated buffer where to store value + * \param[in] size Size of value in bytes + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_gettv0(union gtpie_member *ie[], int type, int instance, void *dst, unsigned int size) { @@ -157,6 +226,12 @@ return 0; } +/*! Obtain Value of TV1-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[inout] dst Caller-allocated buffer where to store value + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_gettv1(union gtpie_member *ie[], int type, int instance, uint8_t * dst) { @@ -169,6 +244,12 @@ return 0; } +/*! Obtain Value of TV2-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[inout] dst Caller-allocated buffer where to store value + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_gettv2(union gtpie_member *ie[], int type, int instance, uint16_t * dst) { @@ -181,6 +262,12 @@ return 0; } +/*! Obtain Value of TV4-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[inout] dst Caller-allocated buffer where to store value + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_gettv4(union gtpie_member *ie[], int type, int instance, uint32_t * dst) { @@ -193,6 +280,12 @@ return 0; } +/*! Obtain Value of TV8-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[inout] dst Caller-allocated buffer where to store value + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_gettv8(union gtpie_member *ie[], int type, int instance, uint64_t * dst) { @@ -205,6 +298,12 @@ return 0; } +/*! Parse an incoming GTP packet into its Information Elements. + * \param[out] ie Caller-allocated Array of GTPIE + * \param[in] version GTP protocol version + * \param[in] pack Pointer to raw GTP packet (payload part) + * \param[in] len Length of \a pack in bytes + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_decaps(union gtpie_member *ie[], int version, void *pack, unsigned len) { @@ -430,6 +529,11 @@ } } +/*! Encode GTP packet payload from Array of Information Elements. + * \param[out] ie Input Array of GTPIE + * \param[out] pack Pointer to caller-allocated buffer for raw GTP packet (GTPIE_MAX length) + * \param[out] len Encoded length of \a pack in bytes + * \returns 0 on sucess; 2 for out-of-space */ int gtpie_encaps(union gtpie_member *ie[], void *pack, unsigned *len) { int i; @@ -528,6 +632,12 @@ return 0; } +/*! Encode GTP packet payload from Array of Information Elements. + * \param[out] ie Input Array of GTPIE + * \param[in] size Size of ? + * \param[out] pack Pointer to caller-allocated buffer for raw GTP packet (GTPIE_MAX length) + * \param[out] len Encoded length of \a pack in bytes + * \returns 0 on sucess; 2 for out-of-space */ int gtpie_encaps2(union gtpie_member ie[], unsigned int size, void *pack, unsigned *len) { -- To view, visit https://gerrit.osmocom.org/4252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I97df5bd3c8dcc5c97a114c8c6abadabf33147b05 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:28:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:28:08 +0000 Subject: [PATCH] osmo-ggsn[master]: gtpie_decaps: const-ify pointer to input packet data Message-ID: Review at https://gerrit.osmocom.org/4253 gtpie_decaps: const-ify pointer to input packet data Change-Id: Ia048abcd80f29581c6ac02cd7f534f2617005671 --- M gtp/gtpie.c M gtp/gtpie.h 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/53/4253/1 diff --git a/gtp/gtpie.c b/gtp/gtpie.c index 4cfb373..6ffa184 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -304,13 +304,13 @@ * \param[in] pack Pointer to raw GTP packet (payload part) * \param[in] len Length of \a pack in bytes * \returns 0 on sucess; EOF in case IE not found */ -int gtpie_decaps(union gtpie_member *ie[], int version, void *pack, +int gtpie_decaps(union gtpie_member *ie[], int version, const void *pack, unsigned len) { int i; int j = 0; - unsigned char *p; - unsigned char *end; + const unsigned char *p; + const unsigned char *end; end = (unsigned char *)pack + len; p = pack; diff --git a/gtp/gtpie.h b/gtp/gtpie.h index 96ff67a..fa70274 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -248,7 +248,7 @@ uint64_t * dst); extern int gtpie_decaps(union gtpie_member *ie[], int version, - void *pack, unsigned len); + const void *pack, unsigned len); extern int gtpie_encaps(union gtpie_member *ie[], void *pack, unsigned *len); extern int gtpie_encaps2(union gtpie_member ie[], unsigned int size, void *pack, unsigned *len); -- To view, visit https://gerrit.osmocom.org/4253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia048abcd80f29581c6ac02cd7f534f2617005671 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:28:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:28:09 +0000 Subject: [PATCH] osmo-ggsn[master]: gtpie: Add missing #include of for htonl() and... Message-ID: Review at https://gerrit.osmocom.org/4254 gtpie: Add missing #include of for htonl() and friends Change-Id: Id69d957d0860ee49e7f0db5c64ab8ba976f8c8d6 --- M gtp/gtpie.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/54/4254/1 diff --git a/gtp/gtpie.h b/gtp/gtpie.h index fa70274..754382e 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -12,6 +12,8 @@ #ifndef _GTPIE_H #define _GTPIE_H +#include + /* Macroes for conversion between host and network byte order */ #define hton8(x) (x) #define ntoh8(x) (x) -- To view, visit https://gerrit.osmocom.org/4254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id69d957d0860ee49e7f0db5c64ab8ba976f8c8d6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:29:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:29:22 +0000 Subject: osmo-ggsn[master]: Remove trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e24f95a88bef3a59006a89c219871e6156963d7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:29:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:29:34 +0000 Subject: osmo-ggsn[master]: Add ippool unit-test for 'make check' runs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf4588e8f3ae71684e5262c0caaa2689aee73a94 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:29:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:29:40 +0000 Subject: osmo-ggsn[master]: update .gitignore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I030bd616dd27d49e55b5bdcc7c0b4fa3eb523da4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:29:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:29:46 +0000 Subject: osmo-ggsn[master]: tests: Remove Makefile.in In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie21e8bfab7cda52aa696dd26280efc05c4b51bba Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:29:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:29:50 +0000 Subject: osmo-ggsn[master]: in46a_to_sas(): Return AF_INET6 in case of IPv6 address In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2f9ac60f08823d5f7c1a76c0b7cbd65ac615e26 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:29:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:29:55 +0000 Subject: osmo-ggsn[master]: Add unit tests for lib/in46_addr.c code In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id032c330405e5dca8ecfc0970d128341ed75c675 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:30:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:30:00 +0000 Subject: osmo-ggsn[master]: gtpie_tlv() gtpie_tv0(): const-ify read-only input argument In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ide487e34884c8356694246f43c3f1f562357304c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:30:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:30:07 +0000 Subject: osmo-ggsn[master]: gtpie_decaps: const-ify pointer to input packet data In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia048abcd80f29581c6ac02cd7f534f2617005671 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:30:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:30:12 +0000 Subject: osmo-ggsn[master]: gtpie: Add missing #include of for htonl() and... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id69d957d0860ee49e7f0db5c64ab8ba976f8c8d6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:34:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:34:46 +0000 Subject: [MERGED] osmo-ggsn[master]: in46a_to_sas(): Return AF_INET6 in case of IPv6 address In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: in46a_to_sas(): Return AF_INET6 in case of IPv6 address ...................................................................... in46a_to_sas(): Return AF_INET6 in case of IPv6 address Change-Id: Ia2f9ac60f08823d5f7c1a76c0b7cbd65ac615e26 --- M lib/in46_addr.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 068499c..32e0f8d 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -49,7 +49,7 @@ sin->sin_addr = in->v4; break; case 16: - sin6->sin6_family = AF_INET; + sin6->sin6_family = AF_INET6; sin6->sin6_addr = in->v6; break; default: -- To view, visit https://gerrit.osmocom.org/4249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia2f9ac60f08823d5f7c1a76c0b7cbd65ac615e26 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:34:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:34:46 +0000 Subject: [MERGED] osmo-ggsn[master]: tests: Remove Makefile.in In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: Remove Makefile.in ...................................................................... tests: Remove Makefile.in Change-Id: Ie21e8bfab7cda52aa696dd26280efc05c4b51bba --- D tests/Makefile.in 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/Makefile.in b/tests/Makefile.in deleted file mode 100644 index e69de29..0000000 --- a/tests/Makefile.in +++ /dev/null -- To view, visit https://gerrit.osmocom.org/4248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie21e8bfab7cda52aa696dd26280efc05c4b51bba Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:34:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:34:46 +0000 Subject: [MERGED] osmo-ggsn[master]: update .gitignore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: update .gitignore ...................................................................... update .gitignore Change-Id: I030bd616dd27d49e55b5bdcc7c0b4fa3eb523da4 --- M .gitignore 1 file changed, 30 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 25cd613..61409f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +# autotools Makefile Makefile.in aclocal.m4 @@ -17,34 +18,51 @@ missing osmo-ggsn.spec stamp-h1 -doc/Makefile.in -ggsn/Makefile.in -gtp/Makefile.in -sgsnemu/Makefile.in +INSTALL +m4/ +Makefile +osmo-ggsn-*.tar* +.version +.tarball-version + +# debian debian/osmo-ggsn/ debian/*.debhelper -debian/libgtp/ +debian/libgtp1 +debian/osmo-ggsn-dbg debian/*.log -INSTALL debian/autoreconf.* debian/*.substvars debian/tmp/ -sgsnemu/sgsnemu debian/files debian/libgtp-dev/ + +# programs / libraries +sgsnemu/sgsnemu libgtp.pc ggsn/osmo-ggsn -m4/ -*.swp + +# compiler results *.o *.a *.la *.lo +*.pyc +.deps +.libs + +# misc +*.swp +.dirstamp +.deps *.orig +*.new *.rej -*/.deps -*/.libs -*/Makefile +*~ +osmo-ggsn.cfg +sgsnemu.pid +gsn_restart + # testsuite tests/atconfig tests/*/*_test -- To view, visit https://gerrit.osmocom.org/4247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I030bd616dd27d49e55b5bdcc7c0b4fa3eb523da4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:34:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:34:47 +0000 Subject: [MERGED] osmo-ggsn[master]: Remove trailing whitespace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove trailing whitespace ...................................................................... Remove trailing whitespace Change-Id: I8e24f95a88bef3a59006a89c219871e6156963d7 --- M ggsn/ggsn.c M lib/in46_addr.c M lib/ippool.c M lib/ippool.h M lib/tun.c M lib/tun.h 6 files changed, 16 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 6c5c1a8..67d040f 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,13 +1,13 @@ -/* +/* * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2017 by Harald Welte - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ /* ggsn.c diff --git a/lib/in46_addr.c b/lib/in46_addr.c index f78a40b..068499c 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -6,7 +6,7 @@ * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ #include "../lib/in46_addr.h" diff --git a/lib/ippool.c b/lib/ippool.c index a236fe7..d9164a3 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -7,7 +7,7 @@ * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ #include @@ -374,7 +374,7 @@ uint32_t hash; /* If static: - * Look in dynaddr. + * Look in dynaddr. * If found remove from firstdyn/lastdyn linked list. * Else allocate from stataddr. * Remove from firststat/laststat linked list. diff --git a/lib/ippool.h b/lib/ippool.h index fbac66d..56beb4e 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -1,12 +1,12 @@ -/* +/* * IP address pool functions. * Copyright (C) 2003, 2004 Mondru AB. - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ #ifndef _IPPOOL_H @@ -23,7 +23,7 @@ When initialising a new address pool it should be possible to pass a string of CIDR format networks: "10.0.0.0/24 10.15.0.0/20" would translate to 256 addresses starting at 10.0.0.0 and 1024 addresses - starting at 10.15.0.0. + starting at 10.15.0.0. The above also applies to IPv6 which can be specified as described in RFC2373. diff --git a/lib/tun.c b/lib/tun.c index 35d371e..7662146 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -1,13 +1,13 @@ -/* +/* * TUN interface functions. * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2017 by Harald Welte - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ /* diff --git a/lib/tun.h b/lib/tun.h index 95fff26..f63be50 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -1,13 +1,13 @@ -/* +/* * TUN interface functions. * Copyright (C) 2002, 2003 Mondru AB. * Copyright (C) 2017 by Harald Welte - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ #ifndef _TUN_H -- To view, visit https://gerrit.osmocom.org/4246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e24f95a88bef3a59006a89c219871e6156963d7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:34:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:34:47 +0000 Subject: [MERGED] osmo-ggsn[master]: Add ippool unit-test for 'make check' runs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add ippool unit-test for 'make check' runs ...................................................................... Add ippool unit-test for 'make check' runs This test creates a variety of v4 (and one v6) pool and performs allocations until the pool is full, then frees a random number of randomly distributed addresses, re-allocates them and again checks that they're all available and finally once the pool is full allocations fail. Change-Id: Ibf4588e8f3ae71684e5262c0caaa2689aee73a94 --- M .gitignore M Makefile.am M configure.ac A tests/Makefile.am A tests/lib/Makefile.am A tests/lib/ippool_test.c A tests/lib/ippool_test.err A tests/lib/ippool_test.ok A tests/testsuite.at 9 files changed, 66,755 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/4245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf4588e8f3ae71684e5262c0caaa2689aee73a94 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:35:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 14:35:34 +0000 Subject: osmo-gsm-tester[master]: debug: Add voicecall related method to interactive shell In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/4151/1/suites/aoip_debug/interactive.py File suites/aoip_debug/interactive.py: Line 26: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-answer , call-hangup ') > I'd go for b, otherwise it's annoying while using it. ok Line 52: elif cmd.startswith('call-list'): > I know, I understand, but then you cannot pass parameters and you need to k it would be a whole new intelligent parsing thing, I agree to keep it this way https://gerrit.osmocom.org/#/c/4151/1/suites/debug/interactive.py File suites/debug/interactive.py: Line 45: elif cmd.startswith('call-list'): > At a later stage it may make sense to move it to a library, or to make it g at some point it was possible to enter test scripts using pydb3, but I have somehow managed to break that and haven't figured out how to fix it again. It's all about python paths and setting a break point so that the debugger can match it with the test script. Fixing pydb3 use would indeed be the most flexible solution. -- To view, visit https://gerrit.osmocom.org/4151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2df68bf4fba0fb542eebdeb515a3dac6d5e575e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:36:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:36:56 +0000 Subject: [PATCH] osmo-ggsn[master]: Add unit tests for lib/in46_addr.c code In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4250 to look at the new patch set (#2). Add unit tests for lib/in46_addr.c code Change-Id: Id032c330405e5dca8ecfc0970d128341ed75c675 --- M tests/lib/Makefile.am A tests/lib/in46a_test.c A tests/lib/in46a_test.ok M tests/testsuite.at 4 files changed, 300 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/50/4250/2 diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index ae54127..95d6901 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -1,8 +1,9 @@ AM_CFLAGS = -Wall -I$(top_srcdir)/include $(LIBOSMOCORE_CFLAGS) -g -EXTRA_DIST = ippool_test.ok ippool_test.err +EXTRA_DIST = ippool_test.ok ippool_test.err \ + in46a_test.ok -noinst_PROGRAMS = ippool_test +noinst_PROGRAMS = ippool_test in46a_test ippool_test_SOURCES = \ ippool_test.c \ @@ -12,3 +13,12 @@ $(top_builddir)/lib/libmisc.a \ $(LIBOSMOCORE_LIBS) \ $(NULL) + +in46a_test_SOURCES = \ + in46a_test.c \ + $(NULL) + +in46a_test_LDADD = \ + $(top_builddir)/lib/libmisc.a \ + $(LIBOSMOCORE_LIBS) \ + $(NULL) diff --git a/tests/lib/in46a_test.c b/tests/lib/in46a_test.c new file mode 100644 index 0000000..d6215e7 --- /dev/null +++ b/tests/lib/in46a_test.c @@ -0,0 +1,265 @@ +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "../../lib/in46_addr.h" +#include "../../lib/syserr.h" + +static const struct in46_addr g_ia4 = { + .len = 4, + .v4.s_addr = 0x0d0c0b0a, +}; + +static const struct in46_addr g_ia6 = { + .len = 16, + .v6.s6_addr = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }, +}; + +static void test_in46a_to_af(void) +{ + struct in46_addr ia; + + printf("Testing in46a_to_af()\n"); + + OSMO_ASSERT(in46a_to_af(&g_ia4) == AF_INET); + OSMO_ASSERT(in46a_to_af(&g_ia6) == AF_INET6); + + ia.len = 8; + OSMO_ASSERT(in46a_to_af(&ia) == AF_INET6); +} + +static void test_in46a_to_sas(void) +{ + struct sockaddr_storage ss; + struct sockaddr_in *sin = (struct sockaddr_in *) &ss; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &ss; + + printf("Testing in46a_to_sas()\n"); + + memset(&ss, 0, sizeof(ss)); + OSMO_ASSERT(in46a_to_sas(&ss, &g_ia4) == 0); + OSMO_ASSERT(sin->sin_family == AF_INET); + OSMO_ASSERT(sin->sin_addr.s_addr == g_ia4.v4.s_addr); + + memset(&ss, 0, sizeof(ss)); + OSMO_ASSERT(in46a_to_sas(&ss, &g_ia6) == 0); + OSMO_ASSERT(sin6->sin6_family == AF_INET6); + OSMO_ASSERT(!memcmp(&sin6->sin6_addr, &g_ia6.v6, sizeof(sin6->sin6_addr))); +} + +static void test_in46a_ntop(void) +{ + struct in46_addr ia; + char buf[256]; + const char *res; + + printf("Testing in46a_ntop()\n"); + + res = in46a_ntop(NULL, buf, sizeof(buf)); + OSMO_ASSERT(res && !strcmp(res, "UNDEFINED")); + printf("res = %s\n", res); + + ia.len = 0; + res = in46a_ntop(&ia, buf, sizeof(buf)); + printf("res = %s\n", res); + OSMO_ASSERT(res && !strcmp(res, "UNDEFINED")); + + ia.len = 4; + ia.v4.s_addr = htonl(0x01020304); + res = in46a_ntop(&ia, buf, sizeof(buf)); + OSMO_ASSERT(res && !strcmp(res, "1.2.3.4")); + printf("res = %s\n", res); + + res = in46a_ntop(&g_ia6, buf, sizeof(buf)); + OSMO_ASSERT(res && !strcmp(res, "102:304:506:708:90a:b0c:d0e:f10")); + printf("res = %s\n", res); +} + +static void test_in46p_ntoa(void) +{ + const struct in46_prefix ip46 = { + .prefixlen = 24, + .addr = { + .len = 4, + .v4.s_addr = htonl(0x10203000), + }, + }; + printf("in46p_ntoa() returns %s\n", in46p_ntoa(&ip46)); +} + +static void test_in46a_equal(void) +{ + struct in46_addr b; + + printf("Testing in46a_equal()\n"); + + memset(&b, 0xff, sizeof(b)); + b.len = g_ia4.len; + b.v4.s_addr = g_ia4.v4.s_addr; + OSMO_ASSERT(in46a_equal(&g_ia4, &b)); + + memset(&b, 0xff, sizeof(b)); + b.len = g_ia6.len; + b.v6 = g_ia6.v6; + OSMO_ASSERT(in46a_equal(&g_ia6, &b)); + +} + + +static int log_in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, + size_t prefixlen) +{ + int rc; + + printf("in46a_within_mask(%s, ", in46a_ntoa(addr)); + printf("%s, %lu) = ", in46a_ntoa(net), prefixlen); + + rc = in46a_within_mask(addr, net, prefixlen); + printf("%d\n", rc); + + return rc; +} + +static void test_in46a_within_mask(void) +{ + struct in46_addr addr, mask; + + printf("Testing in46a_within_mask()\n"); + + addr = g_ia4; + mask = g_ia4; + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 32)); + + mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfffffffC ); + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 30)); + + mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfff80000 ); + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 13)); + + addr.v4.s_addr = htonl(ntohl(addr.v4.s_addr) + 1); + mask = g_ia4; + OSMO_ASSERT(!log_in46a_within_mask(&addr, &mask, 32)); + mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfffffffC ); + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 30)); +} + +static void test_in46a_to_eua(void) +{ + const struct in46_addr ia_v6_8 = { + .len = 8, + .v6.s6_addr = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }, + }; + struct ul66_t eua; + + printf("testing in46a_to_eua()\n"); + +#if 0 /* triggers assert in current implementation */ + const struct in46_addr ia_invalid = { .len = 3, }; + OSMO_ASSERT(in46a_to_eua(&ia_invalid, &eua) < 0); +#endif + + /* IPv4 address */ + OSMO_ASSERT(in46a_to_eua(&g_ia4, &eua) == 0); + OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); + OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v4); + OSMO_ASSERT(*(uint32_t *) &eua.v[2] == g_ia4.v4.s_addr); + + /* IPv6 address */ + OSMO_ASSERT(in46a_to_eua(&g_ia6, &eua) == 0); + OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); + OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v6); + OSMO_ASSERT(!memcmp(&eua.v[2], &g_ia6.v6, 16)); + + /* IPv6 address with prefix / length 8 */ + OSMO_ASSERT(in46a_to_eua(&ia_v6_8, &eua) == 0); + OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); + OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v6); + OSMO_ASSERT(!memcmp(&eua.v[2], &ia_v6_8.v6, 16)); +} + +static void test_in46a_from_eua(void) +{ + struct in46_addr ia; + struct ul66_t eua; + const uint8_t v4_unspec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4 }; + const uint8_t v4_spec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4, 1,2,3,4 }; + const uint8_t v6_unspec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v6 }; + const uint8_t v6_spec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v6, + 1,2,3,4,5,6,7,8,9,0xa,0xb,0xc,0xd,0xe,0xf,0x10 }; + + memset(&eua, 0, sizeof(eua)); + + printf("Testing in46a_from_eua()\n"); + + /* default: v4 unspec */ + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 4); + OSMO_ASSERT(ia.v4.s_addr == 0); + + /* invalid */ + eua.v[0] = 0x23; + eua.v[1] = PDP_EUA_TYPE_v4; + eua.l = 6; + OSMO_ASSERT(in46a_from_eua(&eua, &ia) < 0); + + /* invalid */ + eua.v[0] = PDP_EUA_ORG_IETF; + eua.v[1] = 0x23; + eua.l = 6; + OSMO_ASSERT(in46a_from_eua(&eua, &ia) < 0); + + /* unspecified V4 */ + memcpy(eua.v, v4_unspec, sizeof(v4_unspec)); + eua.l = sizeof(v4_unspec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 4); + OSMO_ASSERT(ia.v4.s_addr == 0); + + /* specified V4 */ + memcpy(eua.v, v4_spec, sizeof(v4_spec)); + eua.l = sizeof(v4_spec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 4); + OSMO_ASSERT(ia.v4.s_addr == htonl(0x01020304)); + + /* unspecified V6 */ + memcpy(eua.v, v6_unspec, sizeof(v6_unspec)); + eua.l = sizeof(v6_unspec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 16); + OSMO_ASSERT(IN6_IS_ADDR_UNSPECIFIED(&ia.v6)); + + /* specified V6 */ + memcpy(eua.v, v6_spec, sizeof(v6_spec)); + eua.l = sizeof(v6_spec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 16); + OSMO_ASSERT(!memcmp(&ia.v6, v6_spec+2, ia.len)); +} + +int main(int argc, char **argv) +{ + osmo_init_logging(&log_info); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + + srand(time(NULL)); + + test_in46a_to_af(); + test_in46a_to_sas(); + test_in46a_ntop(); + test_in46p_ntoa(); + test_in46a_equal(); + test_in46a_within_mask(); + test_in46a_to_eua(); + test_in46a_from_eua(); +} diff --git a/tests/lib/in46a_test.ok b/tests/lib/in46a_test.ok new file mode 100644 index 0000000..b115444 --- /dev/null +++ b/tests/lib/in46a_test.ok @@ -0,0 +1,17 @@ +Testing in46a_to_af() +Testing in46a_to_sas() +Testing in46a_ntop() +res = UNDEFINED +res = UNDEFINED +res = 1.2.3.4 +res = 102:304:506:708:90a:b0c:d0e:f10 +in46p_ntoa() returns 16.32.48.0/24 +Testing in46a_equal() +Testing in46a_within_mask() +in46a_within_mask(10.11.12.13, 10.11.12.13, 32) = 1 +in46a_within_mask(10.11.12.13, 10.11.12.12, 30) = 1 +in46a_within_mask(10.11.12.13, 10.8.0.0, 13) = 1 +in46a_within_mask(10.11.12.14, 10.11.12.13, 32) = 0 +in46a_within_mask(10.11.12.14, 10.11.12.12, 30) = 1 +testing in46a_to_eua() +Testing in46a_from_eua() diff --git a/tests/testsuite.at b/tests/testsuite.at index a10152f..cc0c949 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -7,3 +7,9 @@ cat $abs_srcdir/lib/ippool_test.err > experr AT_CHECK([$abs_top_builddir/tests/lib/ippool_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([in46a]) +AT_KEYWORDS([in46a]) +cat $abs_srcdir/lib/in46a_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/lib/in46a_test], [], [expout], []) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id032c330405e5dca8ecfc0970d128341ed75c675 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:37:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:37:22 +0000 Subject: osmo-ggsn[master]: Add unit tests for lib/in46_addr.c code In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id032c330405e5dca8ecfc0970d128341ed75c675 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:37:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:37:58 +0000 Subject: osmo-ggsn[master]: gtpie: Add doxygen API documentation In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97df5bd3c8dcc5c97a114c8c6abadabf33147b05 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:38:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:38:08 +0000 Subject: [MERGED] osmo-ggsn[master]: Add unit tests for lib/in46_addr.c code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add unit tests for lib/in46_addr.c code ...................................................................... Add unit tests for lib/in46_addr.c code Change-Id: Id032c330405e5dca8ecfc0970d128341ed75c675 --- M tests/lib/Makefile.am A tests/lib/in46a_test.c A tests/lib/in46a_test.ok M tests/testsuite.at 4 files changed, 300 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index ae54127..95d6901 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -1,8 +1,9 @@ AM_CFLAGS = -Wall -I$(top_srcdir)/include $(LIBOSMOCORE_CFLAGS) -g -EXTRA_DIST = ippool_test.ok ippool_test.err +EXTRA_DIST = ippool_test.ok ippool_test.err \ + in46a_test.ok -noinst_PROGRAMS = ippool_test +noinst_PROGRAMS = ippool_test in46a_test ippool_test_SOURCES = \ ippool_test.c \ @@ -12,3 +13,12 @@ $(top_builddir)/lib/libmisc.a \ $(LIBOSMOCORE_LIBS) \ $(NULL) + +in46a_test_SOURCES = \ + in46a_test.c \ + $(NULL) + +in46a_test_LDADD = \ + $(top_builddir)/lib/libmisc.a \ + $(LIBOSMOCORE_LIBS) \ + $(NULL) diff --git a/tests/lib/in46a_test.c b/tests/lib/in46a_test.c new file mode 100644 index 0000000..d6215e7 --- /dev/null +++ b/tests/lib/in46a_test.c @@ -0,0 +1,265 @@ +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "../../lib/in46_addr.h" +#include "../../lib/syserr.h" + +static const struct in46_addr g_ia4 = { + .len = 4, + .v4.s_addr = 0x0d0c0b0a, +}; + +static const struct in46_addr g_ia6 = { + .len = 16, + .v6.s6_addr = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }, +}; + +static void test_in46a_to_af(void) +{ + struct in46_addr ia; + + printf("Testing in46a_to_af()\n"); + + OSMO_ASSERT(in46a_to_af(&g_ia4) == AF_INET); + OSMO_ASSERT(in46a_to_af(&g_ia6) == AF_INET6); + + ia.len = 8; + OSMO_ASSERT(in46a_to_af(&ia) == AF_INET6); +} + +static void test_in46a_to_sas(void) +{ + struct sockaddr_storage ss; + struct sockaddr_in *sin = (struct sockaddr_in *) &ss; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &ss; + + printf("Testing in46a_to_sas()\n"); + + memset(&ss, 0, sizeof(ss)); + OSMO_ASSERT(in46a_to_sas(&ss, &g_ia4) == 0); + OSMO_ASSERT(sin->sin_family == AF_INET); + OSMO_ASSERT(sin->sin_addr.s_addr == g_ia4.v4.s_addr); + + memset(&ss, 0, sizeof(ss)); + OSMO_ASSERT(in46a_to_sas(&ss, &g_ia6) == 0); + OSMO_ASSERT(sin6->sin6_family == AF_INET6); + OSMO_ASSERT(!memcmp(&sin6->sin6_addr, &g_ia6.v6, sizeof(sin6->sin6_addr))); +} + +static void test_in46a_ntop(void) +{ + struct in46_addr ia; + char buf[256]; + const char *res; + + printf("Testing in46a_ntop()\n"); + + res = in46a_ntop(NULL, buf, sizeof(buf)); + OSMO_ASSERT(res && !strcmp(res, "UNDEFINED")); + printf("res = %s\n", res); + + ia.len = 0; + res = in46a_ntop(&ia, buf, sizeof(buf)); + printf("res = %s\n", res); + OSMO_ASSERT(res && !strcmp(res, "UNDEFINED")); + + ia.len = 4; + ia.v4.s_addr = htonl(0x01020304); + res = in46a_ntop(&ia, buf, sizeof(buf)); + OSMO_ASSERT(res && !strcmp(res, "1.2.3.4")); + printf("res = %s\n", res); + + res = in46a_ntop(&g_ia6, buf, sizeof(buf)); + OSMO_ASSERT(res && !strcmp(res, "102:304:506:708:90a:b0c:d0e:f10")); + printf("res = %s\n", res); +} + +static void test_in46p_ntoa(void) +{ + const struct in46_prefix ip46 = { + .prefixlen = 24, + .addr = { + .len = 4, + .v4.s_addr = htonl(0x10203000), + }, + }; + printf("in46p_ntoa() returns %s\n", in46p_ntoa(&ip46)); +} + +static void test_in46a_equal(void) +{ + struct in46_addr b; + + printf("Testing in46a_equal()\n"); + + memset(&b, 0xff, sizeof(b)); + b.len = g_ia4.len; + b.v4.s_addr = g_ia4.v4.s_addr; + OSMO_ASSERT(in46a_equal(&g_ia4, &b)); + + memset(&b, 0xff, sizeof(b)); + b.len = g_ia6.len; + b.v6 = g_ia6.v6; + OSMO_ASSERT(in46a_equal(&g_ia6, &b)); + +} + + +static int log_in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, + size_t prefixlen) +{ + int rc; + + printf("in46a_within_mask(%s, ", in46a_ntoa(addr)); + printf("%s, %lu) = ", in46a_ntoa(net), prefixlen); + + rc = in46a_within_mask(addr, net, prefixlen); + printf("%d\n", rc); + + return rc; +} + +static void test_in46a_within_mask(void) +{ + struct in46_addr addr, mask; + + printf("Testing in46a_within_mask()\n"); + + addr = g_ia4; + mask = g_ia4; + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 32)); + + mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfffffffC ); + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 30)); + + mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfff80000 ); + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 13)); + + addr.v4.s_addr = htonl(ntohl(addr.v4.s_addr) + 1); + mask = g_ia4; + OSMO_ASSERT(!log_in46a_within_mask(&addr, &mask, 32)); + mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfffffffC ); + OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 30)); +} + +static void test_in46a_to_eua(void) +{ + const struct in46_addr ia_v6_8 = { + .len = 8, + .v6.s6_addr = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }, + }; + struct ul66_t eua; + + printf("testing in46a_to_eua()\n"); + +#if 0 /* triggers assert in current implementation */ + const struct in46_addr ia_invalid = { .len = 3, }; + OSMO_ASSERT(in46a_to_eua(&ia_invalid, &eua) < 0); +#endif + + /* IPv4 address */ + OSMO_ASSERT(in46a_to_eua(&g_ia4, &eua) == 0); + OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); + OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v4); + OSMO_ASSERT(*(uint32_t *) &eua.v[2] == g_ia4.v4.s_addr); + + /* IPv6 address */ + OSMO_ASSERT(in46a_to_eua(&g_ia6, &eua) == 0); + OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); + OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v6); + OSMO_ASSERT(!memcmp(&eua.v[2], &g_ia6.v6, 16)); + + /* IPv6 address with prefix / length 8 */ + OSMO_ASSERT(in46a_to_eua(&ia_v6_8, &eua) == 0); + OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); + OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v6); + OSMO_ASSERT(!memcmp(&eua.v[2], &ia_v6_8.v6, 16)); +} + +static void test_in46a_from_eua(void) +{ + struct in46_addr ia; + struct ul66_t eua; + const uint8_t v4_unspec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4 }; + const uint8_t v4_spec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4, 1,2,3,4 }; + const uint8_t v6_unspec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v6 }; + const uint8_t v6_spec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v6, + 1,2,3,4,5,6,7,8,9,0xa,0xb,0xc,0xd,0xe,0xf,0x10 }; + + memset(&eua, 0, sizeof(eua)); + + printf("Testing in46a_from_eua()\n"); + + /* default: v4 unspec */ + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 4); + OSMO_ASSERT(ia.v4.s_addr == 0); + + /* invalid */ + eua.v[0] = 0x23; + eua.v[1] = PDP_EUA_TYPE_v4; + eua.l = 6; + OSMO_ASSERT(in46a_from_eua(&eua, &ia) < 0); + + /* invalid */ + eua.v[0] = PDP_EUA_ORG_IETF; + eua.v[1] = 0x23; + eua.l = 6; + OSMO_ASSERT(in46a_from_eua(&eua, &ia) < 0); + + /* unspecified V4 */ + memcpy(eua.v, v4_unspec, sizeof(v4_unspec)); + eua.l = sizeof(v4_unspec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 4); + OSMO_ASSERT(ia.v4.s_addr == 0); + + /* specified V4 */ + memcpy(eua.v, v4_spec, sizeof(v4_spec)); + eua.l = sizeof(v4_spec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 4); + OSMO_ASSERT(ia.v4.s_addr == htonl(0x01020304)); + + /* unspecified V6 */ + memcpy(eua.v, v6_unspec, sizeof(v6_unspec)); + eua.l = sizeof(v6_unspec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 16); + OSMO_ASSERT(IN6_IS_ADDR_UNSPECIFIED(&ia.v6)); + + /* specified V6 */ + memcpy(eua.v, v6_spec, sizeof(v6_spec)); + eua.l = sizeof(v6_spec); + OSMO_ASSERT(in46a_from_eua(&eua, &ia) == 0); + OSMO_ASSERT(ia.len == 16); + OSMO_ASSERT(!memcmp(&ia.v6, v6_spec+2, ia.len)); +} + +int main(int argc, char **argv) +{ + osmo_init_logging(&log_info); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + + srand(time(NULL)); + + test_in46a_to_af(); + test_in46a_to_sas(); + test_in46a_ntop(); + test_in46p_ntoa(); + test_in46a_equal(); + test_in46a_within_mask(); + test_in46a_to_eua(); + test_in46a_from_eua(); +} diff --git a/tests/lib/in46a_test.ok b/tests/lib/in46a_test.ok new file mode 100644 index 0000000..b115444 --- /dev/null +++ b/tests/lib/in46a_test.ok @@ -0,0 +1,17 @@ +Testing in46a_to_af() +Testing in46a_to_sas() +Testing in46a_ntop() +res = UNDEFINED +res = UNDEFINED +res = 1.2.3.4 +res = 102:304:506:708:90a:b0c:d0e:f10 +in46p_ntoa() returns 16.32.48.0/24 +Testing in46a_equal() +Testing in46a_within_mask() +in46a_within_mask(10.11.12.13, 10.11.12.13, 32) = 1 +in46a_within_mask(10.11.12.13, 10.11.12.12, 30) = 1 +in46a_within_mask(10.11.12.13, 10.8.0.0, 13) = 1 +in46a_within_mask(10.11.12.14, 10.11.12.13, 32) = 0 +in46a_within_mask(10.11.12.14, 10.11.12.12, 30) = 1 +testing in46a_to_eua() +Testing in46a_from_eua() diff --git a/tests/testsuite.at b/tests/testsuite.at index a10152f..cc0c949 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -7,3 +7,9 @@ cat $abs_srcdir/lib/ippool_test.err > experr AT_CHECK([$abs_top_builddir/tests/lib/ippool_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([in46a]) +AT_KEYWORDS([in46a]) +cat $abs_srcdir/lib/in46a_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/lib/in46a_test], [], [expout], []) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id032c330405e5dca8ecfc0970d128341ed75c675 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:39:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 14:39:29 +0000 Subject: osmo-msc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Patch Set 4: I see it as an important fix; Max, can you fix make distcheck please? osmo-msc should not install any headers nor .pc files. -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:41:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:41:53 +0000 Subject: [MERGED] osmo-ggsn[master]: gtpie: Add missing #include of for htonl() and... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtpie: Add missing #include of for htonl() and friends ...................................................................... gtpie: Add missing #include of for htonl() and friends Change-Id: Id69d957d0860ee49e7f0db5c64ab8ba976f8c8d6 --- M gtp/gtpie.h 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtpie.h b/gtp/gtpie.h index fa70274..754382e 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -12,6 +12,8 @@ #ifndef _GTPIE_H #define _GTPIE_H +#include + /* Macroes for conversion between host and network byte order */ #define hton8(x) (x) #define ntoh8(x) (x) -- To view, visit https://gerrit.osmocom.org/4254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id69d957d0860ee49e7f0db5c64ab8ba976f8c8d6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:41:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:41:53 +0000 Subject: [MERGED] osmo-ggsn[master]: gtpie_decaps: const-ify pointer to input packet data In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtpie_decaps: const-ify pointer to input packet data ...................................................................... gtpie_decaps: const-ify pointer to input packet data Change-Id: Ia048abcd80f29581c6ac02cd7f534f2617005671 --- M gtp/gtpie.c M gtp/gtpie.h 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtpie.c b/gtp/gtpie.c index 4cfb373..6ffa184 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -304,13 +304,13 @@ * \param[in] pack Pointer to raw GTP packet (payload part) * \param[in] len Length of \a pack in bytes * \returns 0 on sucess; EOF in case IE not found */ -int gtpie_decaps(union gtpie_member *ie[], int version, void *pack, +int gtpie_decaps(union gtpie_member *ie[], int version, const void *pack, unsigned len) { int i; int j = 0; - unsigned char *p; - unsigned char *end; + const unsigned char *p; + const unsigned char *end; end = (unsigned char *)pack + len; p = pack; diff --git a/gtp/gtpie.h b/gtp/gtpie.h index 96ff67a..fa70274 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -248,7 +248,7 @@ uint64_t * dst); extern int gtpie_decaps(union gtpie_member *ie[], int version, - void *pack, unsigned len); + const void *pack, unsigned len); extern int gtpie_encaps(union gtpie_member *ie[], void *pack, unsigned *len); extern int gtpie_encaps2(union gtpie_member ie[], unsigned int size, void *pack, unsigned *len); -- To view, visit https://gerrit.osmocom.org/4253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia048abcd80f29581c6ac02cd7f534f2617005671 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:41:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:41:54 +0000 Subject: [MERGED] osmo-ggsn[master]: gtpie: Add doxygen API documentation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtpie: Add doxygen API documentation ...................................................................... gtpie: Add doxygen API documentation libgtp should have proper API documentation, let's start with the gtpie.[ch] parts. Change-Id: I97df5bd3c8dcc5c97a114c8c6abadabf33147b05 --- M gtp/gtpie.c 1 file changed, 110 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtpie.c b/gtp/gtpie.c index accc542..4cfb373 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -39,6 +39,14 @@ #include "gtpie.h" +/*! Encode a TLV type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] l Length of value \a v in bytes + * \param[in] v Pointer to input value + * \returns 0 on success, 1 on error */ int gtpie_tlv(void *p, unsigned int *length, unsigned int size, uint8_t t, int l, const void *v) { @@ -51,6 +59,14 @@ return 0; } +/*! Encode a TV0 (Tag + value) type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] l Length of value \a v in bytes + * \param[in] v Pointer to input value + * \returns 0 on success, 1 on error */ int gtpie_tv0(void *p, unsigned int *length, unsigned int size, uint8_t t, int l, const uint8_t * v) { @@ -62,6 +78,13 @@ return 0; } +/*! Encode a TV1 (Tag + 8bit value) type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] v Input value + * \returns 0 on success, 1 on error */ int gtpie_tv1(void *p, unsigned int *length, unsigned int size, uint8_t t, uint8_t v) { @@ -73,6 +96,13 @@ return 0; } +/*! Encode a TV2 (Tag + 16bit value) type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] v Input value + * \returns 0 on success, 1 on error */ int gtpie_tv2(void *p, unsigned int *length, unsigned int size, uint8_t t, uint16_t v) { @@ -84,6 +114,13 @@ return 0; } +/*! Encode a TV4 (Tag + 32bit value) type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] v Input value + * \returns 0 on success, 1 on error */ int gtpie_tv4(void *p, unsigned int *length, unsigned int size, uint8_t t, uint32_t v) { @@ -95,6 +132,13 @@ return 0; } +/*! Encode a TV8 (Tag + 64bit value) type Information Element. + * \param[inout] p Pointer to output packet to which IE is appended + * \param[inout] length Up to which byte length is \a p used/filled + * \param[in] size Total size of \a p in bytes + * \param[in] t Tag / Information Element Identifier + * \param[in] v Input value + * \returns 0 on success, 1 on error */ int gtpie_tv8(void *p, unsigned int *length, unsigned int size, uint8_t t, uint64_t v) { @@ -106,6 +150,11 @@ return 0; } +/*! Obtain a GTP IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \returns index into \a ie on success; -1 if not found */ int gtpie_getie(union gtpie_member *ie[], int type, int instance) { int j; @@ -118,6 +167,11 @@ return -1; } +/*! Determine if IE for a given tag/IEI exists in a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \returns 1 if IEI instance present in \a ie; 0 if not */ int gtpie_exist(union gtpie_member *ie[], int type, int instance) { int j; @@ -130,6 +184,14 @@ return 0; } +/*! Obtain Value of TLV-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[out] length Length of IE + * \param[inout] dst Caller-allocated buffer where to store value + * \param[in] size Size of \a dst in bytes + * \returns 0 on sucess; EOF in case value is larger than \a size */ int gtpie_gettlv(union gtpie_member *ie[], int type, int instance, unsigned int *length, void *dst, unsigned int size) { @@ -145,6 +207,13 @@ return 0; } +/*! Obtain Value of TV0-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[inout] dst Caller-allocated buffer where to store value + * \param[in] size Size of value in bytes + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_gettv0(union gtpie_member *ie[], int type, int instance, void *dst, unsigned int size) { @@ -157,6 +226,12 @@ return 0; } +/*! Obtain Value of TV1-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[inout] dst Caller-allocated buffer where to store value + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_gettv1(union gtpie_member *ie[], int type, int instance, uint8_t * dst) { @@ -169,6 +244,12 @@ return 0; } +/*! Obtain Value of TV2-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[inout] dst Caller-allocated buffer where to store value + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_gettv2(union gtpie_member *ie[], int type, int instance, uint16_t * dst) { @@ -181,6 +262,12 @@ return 0; } +/*! Obtain Value of TV4-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[inout] dst Caller-allocated buffer where to store value + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_gettv4(union gtpie_member *ie[], int type, int instance, uint32_t * dst) { @@ -193,6 +280,12 @@ return 0; } +/*! Obtain Value of TV8-type IE for a given tag/IEI from a list/array. + * \param[in] ie Array of GTPIE + * \param[in] type Tag/IEI for which we're looking + * \param[in] instance Instance (number of occurence) of this IEI + * \param[inout] dst Caller-allocated buffer where to store value + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_gettv8(union gtpie_member *ie[], int type, int instance, uint64_t * dst) { @@ -205,6 +298,12 @@ return 0; } +/*! Parse an incoming GTP packet into its Information Elements. + * \param[out] ie Caller-allocated Array of GTPIE + * \param[in] version GTP protocol version + * \param[in] pack Pointer to raw GTP packet (payload part) + * \param[in] len Length of \a pack in bytes + * \returns 0 on sucess; EOF in case IE not found */ int gtpie_decaps(union gtpie_member *ie[], int version, void *pack, unsigned len) { @@ -430,6 +529,11 @@ } } +/*! Encode GTP packet payload from Array of Information Elements. + * \param[out] ie Input Array of GTPIE + * \param[out] pack Pointer to caller-allocated buffer for raw GTP packet (GTPIE_MAX length) + * \param[out] len Encoded length of \a pack in bytes + * \returns 0 on sucess; 2 for out-of-space */ int gtpie_encaps(union gtpie_member *ie[], void *pack, unsigned *len) { int i; @@ -528,6 +632,12 @@ return 0; } +/*! Encode GTP packet payload from Array of Information Elements. + * \param[out] ie Input Array of GTPIE + * \param[in] size Size of ? + * \param[out] pack Pointer to caller-allocated buffer for raw GTP packet (GTPIE_MAX length) + * \param[out] len Encoded length of \a pack in bytes + * \returns 0 on sucess; 2 for out-of-space */ int gtpie_encaps2(union gtpie_member ie[], unsigned int size, void *pack, unsigned *len) { -- To view, visit https://gerrit.osmocom.org/4252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I97df5bd3c8dcc5c97a114c8c6abadabf33147b05 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:41:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 14:41:54 +0000 Subject: [MERGED] osmo-ggsn[master]: gtpie_tlv() gtpie_tv0(): const-ify read-only input argument In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtpie_tlv() gtpie_tv0(): const-ify read-only input argument ...................................................................... gtpie_tlv() gtpie_tv0(): const-ify read-only input argument Change-Id: Ide487e34884c8356694246f43c3f1f562357304c --- M gtp/gtpie.c M gtp/gtpie.h 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtpie.c b/gtp/gtpie.c index 0744370..accc542 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -40,7 +40,7 @@ #include "gtpie.h" int gtpie_tlv(void *p, unsigned int *length, unsigned int size, uint8_t t, - int l, void *v) + int l, const void *v) { if ((*length + 3 + l) >= size) return 1; @@ -52,7 +52,7 @@ } int gtpie_tv0(void *p, unsigned int *length, unsigned int size, uint8_t t, - int l, uint8_t * v) + int l, const uint8_t * v) { if ((*length + 1 + l) >= size) return 1; diff --git a/gtp/gtpie.h b/gtp/gtpie.h index 9fe7943..96ff67a 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -221,9 +221,9 @@ } __attribute__ ((packed)); extern int gtpie_tlv(void *p, unsigned int *length, unsigned int size, - uint8_t t, int l, void *v); + uint8_t t, int l, const void *v); extern int gtpie_tv0(void *p, unsigned int *length, unsigned int size, - uint8_t t, int l, uint8_t * v); + uint8_t t, int l, const uint8_t * v); extern int gtpie_tv1(void *p, unsigned int *length, unsigned int size, uint8_t t, uint8_t v); extern int gtpie_tv2(void *p, unsigned int *length, unsigned int size, -- To view, visit https://gerrit.osmocom.org/4251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ide487e34884c8356694246f43c3f1f562357304c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:46:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 14:46:37 +0000 Subject: osmo-bts[master]: Fix race condition in attribute reporting In-Reply-To: References: Message-ID: Patch Set 2: > I thought the style was to always put it in the beginning of the function. What's the general rule? yes, I also misunderstood that once. The rule is to place var declarations at the beginning of each scope, yes. But if a given variable is only used within an inner scope like an if/for/while{} body, then declare that var only within that inner scope; there, again do so at the start of the scope. -- To view, visit https://gerrit.osmocom.org/4232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 14:54:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 14:54:09 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) looks good, except... https://gerrit.osmocom.org/#/c/4234/1//COMMIT_MSG Commit Message: Line 13: config was moved to separate directory. we have the doc/examples path elements in place in most other osmocom.git, and I'd prefer if we could instead tell doxygen where to find the example. What would that take? -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 13 15:15:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 13 Oct 2017 15:15:32 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 1: > if we could instead tell doxygen where to find the example What do you mean? I thought doxygen simply ignores example configs. -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 15:16:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 13 Oct 2017 15:16:46 +0000 Subject: osmo-bts[master]: Fix race condition in attribute reporting In-Reply-To: References: Message-ID: Patch Set 2: Nice, I like per-scope declarations more actually. -- To view, visit https://gerrit.osmocom.org/4232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 15:19:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 13 Oct 2017 15:19:13 +0000 Subject: libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Patch Set 3: > it makes it hard for humans to verify That's regression test - it's not meant to be human-verifiable. As long as smth change in the output the test will fail - which is good enough even if it's not easily readable. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 15:50:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Oct 2017 15:50:21 +0000 Subject: [PATCH] osmo-gsm-tester[master]: modem: Implement voice calls in modem and add voice suite In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4150 to look at the new patch set (#2). modem: Implement voice calls in modem and add voice suite Change-Id: Ib402effc830db293f27a877658894e454a93a606 --- M example/resources.conf M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/schema.py A suites/voice/mo_mt_call.py A suites/voice/suite.conf 5 files changed, 145 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/50/4150/2 diff --git a/example/resources.conf b/example/resources.conf index 3daf677..70c1c35 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -60,7 +60,7 @@ ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' ciphers: [a5_0, a5_1] - features: ['sms'] + features: ['sms', 'voice'] - label: sierra_2 path: '/sierra_2' @@ -68,7 +68,7 @@ ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' ciphers: [a5_0, a5_1] - features: ['sms'] + features: ['sms', 'voice'] - label: gobi_0 path: '/gobi_0' diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index e301ed6..66c0a79 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -37,6 +37,8 @@ I_MODEM = 'org.ofono.Modem' I_NETREG = 'org.ofono.NetworkRegistration' I_SMS = 'org.ofono.MessageManager' +I_CALLMGR = 'org.ofono.VoiceCallManager' +I_CALL = 'org.ofono.VoiceCall' # See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78 NETREG_ST_REGISTERED = 'registered' @@ -338,11 +340,15 @@ self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) self.register_attempts = 0 + self.call_list = [] # one Cancellable can handle several concurrent methods. self.cancellable = Gio.Cancellable.new() self.dbus.required_signals = { I_SMS: ( ('IncomingMessage', self._on_incoming_message), ), I_NETREG: ( ('PropertyChanged', self._on_netreg_property_changed), ), + I_CALLMGR: ( ('PropertyChanged', self._on_callmgr_property_changed), + ('CallAdded', self._on_callmgr_call_added), + ('CallRemoved', self._on_callmgr_call_removed), ), } self.dbus.watch_interfaces() @@ -558,6 +564,80 @@ return True return False + def call_id_list(self): + self.dbg('call_id_list: %r' % self.call_list) + return self.call_list + + def call_dial(self, to_msisdn_or_modem): + if isinstance(to_msisdn_or_modem, Modem): + to_msisdn = to_msisdn_or_modem.msisdn + else: + to_msisdn = str(to_msisdn_or_modem) + self.dbg('Dialing:', to_msisdn) + cmgr = self.dbus.interface(I_CALLMGR) + call_obj_path = cmgr.Dial(to_msisdn, 'default') + if call_obj_path not in self.call_list: + self.dbg('Adding %s to call list' % call_obj_path) + self.call_list.append(call_obj_path) + else: + self.dbg('Dial returned already existing call') + return call_obj_path + + def _find_call_msisdn_state(self, msisdn, state): + cmgr = self.dbus.interface(I_CALLMGR) + ret = cmgr.GetCalls() + for obj_path, props in ret: + if props['LineIdentification'] == msisdn and props['State'] == state: + return obj_path + return None + + def call_wait_incoming(self, caller_msisdn_or_modem, timeout=60): + if isinstance(caller_msisdn_or_modem, Modem): + caller_msisdn = caller_msisdn_or_modem.msisdn + else: + caller_msisdn = str(caller_msisdn_or_modem) + self.dbg('Waiting for incoming call from:', caller_msisdn) + event_loop.wait(self, lambda: self._find_call_msisdn_state(caller_msisdn, 'incoming') is not None, timeout=timeout) + return self._find_call_msisdn_state(caller_msisdn, 'incoming') + + def call_answer(self, call_id): + self.dbg('Answer call %s' % call_id) + assert self.call_state(call_id) == 'incoming' + call_dbus_obj = systembus_get(call_id) + call_dbus_obj.Answer() + + def call_hangup(self, call_id): + self.dbg('Hang up call %s' % call_id) + call_dbus_obj = systembus_get(call_id) + call_dbus_obj.Hangup() + + def call_is_active(self, call_id): + return self.call_state(call_id) == 'active' + + def call_state(self, call_id): + call_dbus_obj = systembus_get(call_id) + props = call_dbus_obj.GetProperties() + state = props.get('State') + self.dbg('call state: %s' % state) + return state + + def _on_callmgr_call_added(self, obj_path, properties): + self.dbg('%r.CallAdded() -> %s=%r' % (I_CALLMGR, obj_path, repr(properties))) + if obj_path not in self.call_list: + self.call_list.append(obj_path) + else: + self.dbg('Call already exists %r' % obj_path) + + def _on_callmgr_call_removed(self, obj_path): + self.dbg('%r.CallRemoved() -> %s' % (I_CALLMGR, obj_path)) + if obj_path in self.call_list: + self.call_list.remove(obj_path) + else: + self.dbg('Trying to remove non-existing call %r' % obj_path) + + def _on_callmgr_property_changed(self, name, value): + self.dbg('%r.PropertyChanged() -> %s=%s' % (I_CALLMGR, name, value)) + def info(self, keys=('Manufacturer', 'Model', 'Revision', 'Serial')): props = self.properties() return ', '.join(['%s: %r'%(k,props.get(k)) for k in keys]) diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 6d5f7ad..9b142d3 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -82,7 +82,7 @@ raise ValueError('Unknown Cipher value: %r' % val) def modem_feature(val): - if val in ('sms', 'gprs', 'voicecall', 'ussd'): + if val in ('sms', 'gprs', 'voice', 'ussd'): return raise ValueError('Unknown Modem Feature: %r' % val) diff --git a/suites/voice/mo_mt_call.py b/suites/voice/mo_mt_call.py new file mode 100755 index 0000000..f426037 --- /dev/null +++ b/suites/voice/mo_mt_call.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms_mo = suite.modem() +ms_mt = suite.modem() + +hlr.start() +stp.start() +msc.start() +mgcpgw.start() + +bsc.bts_add(bts) +bsc.start() + +bts.start() + +hlr.subscriber_add(ms_mo) +hlr.subscriber_add(ms_mt) + +ms_mo.connect(msc.mcc_mnc()) +ms_mt.connect(msc.mcc_mnc()) + +ms_mo.log_info() +ms_mt.log_info() + +print('waiting for modems to attach...') +wait(ms_mo.is_connected, msc.mcc_mnc()) +wait(ms_mt.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms_mo, ms_mt) + +assert len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0 +mo_cid = ms_mo.call_dial(ms_mt) +mt_cid = ms_mt.call_wait_incoming(ms_mo) +print('dial success') + +assert not ms_mo.call_is_active(mo_cid) and not ms_mt.call_is_active(mt_cid) +ms_mt.call_answer(mt_cid) +wait(ms_mo.call_is_active, mo_cid) +wait(ms_mt.call_is_active, mt_cid) +print('answer success, call established and ongoing') + +sleep(5) # maintain the call active for 5 seconds + +assert ms_mo.call_is_active(mo_cid) and ms_mt.call_is_active(mt_cid) +ms_mt.call_hangup(mt_cid) +wait(lambda: len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0) +print('hangup success') diff --git a/suites/voice/suite.conf b/suites/voice/suite.conf new file mode 100644 index 0000000..40d9f97 --- /dev/null +++ b/suites/voice/suite.conf @@ -0,0 +1,9 @@ +resources: + ip_address: + - times: 5 # msc, bsc, hlr, stp, mgw + bts: + - times: 1 + modem: + - times: 2 + features: + - voice -- To view, visit https://gerrit.osmocom.org/4150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib402effc830db293f27a877658894e454a93a606 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 13 15:50:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Oct 2017 15:50:21 +0000 Subject: [PATCH] osmo-gsm-tester[master]: debug: Add voicecall related methods to interactive shell In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4151 to look at the new patch set (#2). debug: Add voicecall related methods to interactive shell Change-Id: Id2df68bf4fba0fb542eebdeb515a3dac6d5e575e --- M suites/aoip_debug/interactive.py M suites/debug/interactive.py 2 files changed, 120 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/51/4151/2 diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index d596b68..819f207 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -23,13 +23,17 @@ m.connect(msc.mcc_mnc()) while True: - cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') + cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-wait-incoming , call-answer , call-hangup ') cmd = cmd.strip().lower() if not cmd: continue + + params = cmd.split() + if 'quit'.startswith(cmd): break + elif 'wait-registered'.startswith(cmd): try: for m in modems: @@ -37,12 +41,67 @@ wait(msc.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') + elif 'get-registered'.startswith(cmd): print(msc.imsi_list_attached()) print('RESULT: %s' % ('All modems are registered.' if msc.subscriber_attached(*modems) else 'Some modem(s) not registered yet.')) + elif 'sms'.startswith(cmd): for mo in modems: for mt in modems: mo.sms_send(mt.msisdn, 'to ' + mt.name()) + + elif cmd.startswith('call-list'): + if len(params) != 1 and len(params) != 2: + print('wrong format') + continue + for ms in modems: + if len(params) == 1 or str(ms.msisdn) == params[1]: + print('call-list: %r %r' % (ms.name(), ms.call_id_list())) + + elif cmd.startswith('call-dial'): + if len(params) != 3: + print('wrong format') + continue + src_msisdn, dst_msisdn = params[1:] + for mo in modems: + if str(mo.msisdn) == src_msisdn: + print('dialing %s->%s' % (src_msisdn, dst_msisdn)) + call_id = mo.call_dial(dst_msisdn) + print('dial success: call_id=%r' % call_id) + + elif cmd.startswith('call-wait-incoming'): + if len(params) != 3: + print('wrong format') + continue + src_msisdn, dst_msisdn = params[1:] + for mt in modems: + if str(mt.msisdn) == dst_msisdn: + print('waiting for incoming %s->%s' % (src_msisdn, dst_msisdn)) + call_id = mt.call_wait_incoming(src_msisdn) + print('incoming call success: call_id=%r' % call_id) + + elif cmd.startswith('call-answer'): + if len(params) != 3: + print('wrong format') + continue + mt_msisdn, call_id = params[1:] + for mt in modems: + if str(mt.msisdn) == mt_msisdn: + print('answering %s %r' % (mt.name(), call_id)) + mt.call_answer(call_id) + + elif cmd.startswith('call-hangup'): + if len(params) != 3: + print('wrong format') + continue + ms_msisdn, call_id = params[1:] + for ms in modems: + if str(ms.msisdn) == ms_msisdn: + print('hanging up %s %r' % (ms.name(), call_id)) + ms.call_hangup(call_id) + + else: + print('Unknown command: %s' % cmd) diff --git a/suites/debug/interactive.py b/suites/debug/interactive.py index 37076dc..1b89a7d 100755 --- a/suites/debug/interactive.py +++ b/suites/debug/interactive.py @@ -16,13 +16,17 @@ m.connect(nitb.mcc_mnc()) while True: - cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') + cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-wait-incoming , call-answer , call-hangup ') cmd = cmd.strip().lower() if not cmd: continue + + params = cmd.split() + if 'quit'.startswith(cmd): break + elif 'wait-registered'.startswith(cmd): try: for m in modems: @@ -30,12 +34,67 @@ wait(nitb.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') + elif 'get-registered'.startswith(cmd): print(nitb.imsi_list_attached()) print('RESULT: %s' % ('All modems are registered.' if nitb.subscriber_attached(*modems) else 'Some modem(s) not registered yet.')) + elif 'sms'.startswith(cmd): for mo in modems: for mt in modems: mo.sms_send(mt.msisdn, 'to ' + mt.name()) + + elif cmd.startswith('call-list'): + if len(params) != 1 and len(params) != 2: + print('wrong format') + continue + for ms in modems: + if len(params) == 1 or str(ms.msisdn) == params[1]: + print('call-list: %r %r' % (ms.name(), ms.call_id_list())) + + elif cmd.startswith('call-dial'): + if len(params) != 3: + print('wrong format') + continue + src_msisdn, dst_msisdn = params[1:] + for mo in modems: + if str(mo.msisdn) == src_msisdn: + print('dialing %s->%s' % (src_msisdn, dst_msisdn)) + call_id = mo.call_dial(dst_msisdn) + print('dial success: call_id=%r' % call_id) + + elif cmd.startswith('call-wait-incoming'): + if len(params) != 3: + print('wrong format') + continue + src_msisdn, dst_msisdn = params[1:] + for mt in modems: + if str(mt.msisdn) == dst_msisdn: + print('waiting for incoming %s->%s' % (src_msisdn, dst_msisdn)) + call_id = mt.call_wait_incoming(src_msisdn) + print('incoming call success: call_id=%r' % call_id) + + elif cmd.startswith('call-answer'): + if len(params) != 3: + print('wrong format') + continue + mt_msisdn, call_id = params[1:] + for mt in modems: + if str(mt.msisdn) == mt_msisdn: + print('answering %s %r' % (mt.name(), call_id)) + mt.call_answer(call_id) + + elif cmd.startswith('call-hangup'): + if len(params) != 3: + print('wrong format') + continue + ms_msisdn, call_id = params[1:] + for ms in modems: + if str(ms.msisdn) == ms_msisdn: + print('hanging up %s %r' % (ms.name(), call_id)) + ms.call_hangup(call_id) + + else: + print('Unknown command: %s' % cmd) -- To view, visit https://gerrit.osmocom.org/4151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id2df68bf4fba0fb542eebdeb515a3dac6d5e575e Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 13 16:06:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Oct 2017 16:06:03 +0000 Subject: [PATCH] osmo-ggsn[master]: lib/ippool: Fix listsize calculated 1 elem too small Message-ID: Review at https://gerrit.osmocom.org/4255 lib/ippool: Fix listsize calculated 1 elem too small Take the chance this commit is changing test output to also remove use of IPPOOL_NOGATEWAY which is going to be removed soon, and instead test IPPOOL_NOBROADCAST. Change-Id: I95c24bc690490155bec9e3933d678e4668d7745f --- M lib/ippool.c M tests/lib/ippool_test.c M tests/lib/ippool_test.ok 3 files changed, 21 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/55/4255/1 diff --git a/lib/ippool.c b/lib/ippool.c index d9164a3..03323e2 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -215,7 +215,7 @@ flags |= IPPOOL_NONETWORK; } - dynsize = (1 << (addr.len*8 - addrprefixlen)) -1; + dynsize = (1 << (addr.len*8 - addrprefixlen)); if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index 79e43e7..f38c1be 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -90,20 +90,20 @@ static void test_pool_sizes(void) { - /* 255 addresses [0..254] */ - test_pool_size("192.168.23.0/24", 0, 255); + /* 256 addresses [0..255] */ + test_pool_size("192.168.23.0/24", 0, 256); + + /* 255 addresses [1..255] */ + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, 255); /* 254 addresses [1..254] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, 254); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 254); - /* 253 addresses [2..254] */ - test_pool_size("192.168.23.0/24", IPPOOL_NOGATEWAY, 253); + /* 65534 addresses [0.1..255.254] */ + test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 65534); - /* 65533 addresses [3..255.254] */ - test_pool_size("192.168.0.0/16", IPPOOL_NOGATEWAY, 65533); - - /* 255 prefixes of /64 each */ - test_pool_size("2001:DB8::/56", 0, 255); + /* 256 prefixes of /64 each */ + test_pool_size("2001:DB8::/56", 0, 256); } int main(int argc, char **argv) diff --git a/tests/lib/ippool_test.ok b/tests/lib/ippool_test.ok index c1398ab..a0eeb4b 100644 --- a/tests/lib/ippool_test.ok +++ b/tests/lib/ippool_test.ok @@ -1,4 +1,4 @@ -testing pool for prefix 192.168.23.0/24, flags=0x0, expected_size=255 +testing pool for prefix 192.168.23.0/24, flags=0x0, expected_size=256 allocated address 192.168.23.0 allocated address 192.168.23.1 allocated address 192.168.23.2 @@ -254,7 +254,8 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.23.0/24, flags=0x1, expected_size=254 +allocated address 192.168.23.255 +testing pool for prefix 192.168.23.0/24, flags=0x1, expected_size=255 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -509,7 +510,9 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.23.0/24, flags=0x4, expected_size=253 +allocated address 192.168.23.255 +testing pool for prefix 192.168.23.0/24, flags=0x3, expected_size=254 +allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 allocated address 192.168.23.4 @@ -763,7 +766,8 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.0.0/16, flags=0x4, expected_size=65533 +testing pool for prefix 192.168.0.0/16, flags=0x3, expected_size=65534 +allocated address 192.168.0.1 allocated address 192.168.0.2 allocated address 192.168.0.3 allocated address 192.168.0.4 @@ -66297,7 +66301,7 @@ allocated address 192.168.255.252 allocated address 192.168.255.253 allocated address 192.168.255.254 -testing pool for prefix 2001:DB8::/56, flags=0x0, expected_size=255 +testing pool for prefix 2001:DB8::/56, flags=0x0, expected_size=256 allocated address 2001:db8:: allocated address 2001:db8:0:1:: allocated address 2001:db8:0:2:: @@ -66553,3 +66557,4 @@ allocated address 2001:db8:0:fc:: allocated address 2001:db8:0:fd:: allocated address 2001:db8:0:fe:: +allocated address 2001:db8:0:ff:: -- To view, visit https://gerrit.osmocom.org/4255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95c24bc690490155bec9e3933d678e4668d7745f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 13 16:06:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Oct 2017 16:06:03 +0000 Subject: [PATCH] osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... Message-ID: Review at https://gerrit.osmocom.org/4256 ippool: Implement and use blacklist instead of blindly using IPPOOL_NOGATEWAY Commit dda21ed7d4a897c9284c69175d0da598598eae40 modified previous calls to ippool_new() removing the pass of flags to avoid allocating certain problematic IPs from the pool to MS, such as the network, gateway and broadcast IPs. Today I did some unsucessful tests with osmo-ggsn with a pool "ip prefix dynamic 176.16.222.0/24", and thus IP 176.16.222.0 was being assigned to the MS. De-capsulated DNS packets were received in the tun interface, but the Linux system in there was unable to correctly forward the packets to the gateway interface connected to the Internet. However, adding a second MS which got 176.16.222.1 had its packets forwarded correctly. However, previous implementation relies on flag IPPOOL_NOGATEWAY flag to blindly blacklist first IP after the network ip (ie, .0 and .1 are removed), which limits the IP reserved for the tun device to be .1. If a different IP in the range is assigned, it may cause issues. As a result, a blacklist is introduced in this commit to dynamically fetch the tun IP address and exlucde it from the pool of available IPs. Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 --- M ggsn/ggsn.c M lib/in46_addr.c M lib/in46_addr.h M lib/ippool.c M lib/ippool.h M lib/tun.c M lib/tun.h M tests/lib/ippool_test.c M tests/lib/ippool_test.err M tests/lib/ippool_test.ok 10 files changed, 436 insertions(+), 38 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/56/4256/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 67d040f..9cfe085 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -149,6 +149,10 @@ /* actually start the APN with its current config */ int apn_start(struct apn_ctx *apn) { + int ipv4_blacklist_size = 0, ipv6_blacklist_size = 0; + struct in46_prefix ipv4_tun_ip, ipv6_tun_ip, ipv6_tun_linklocal_ip; + int ippool_flags = IPPOOL_NONETWORK | IPPOOL_NOBROADCAST; + if (apn->started) return 0; @@ -201,12 +205,13 @@ } if (apn->cfg.apn_type_mask & (APN_TYPE_IPv6|APN_TYPE_IPv4v6)) { - if (tun_ipv6_linklocal_get(apn->tun.tun, &apn->v6_lladdr) < 0) { + if (tun_ipv6_local_get(apn->tun.tun, &ipv6_tun_linklocal_ip, IPV6_TYPE_LINK) < 0) { LOGPAPN(LOGL_ERROR, apn, "Cannot obtain IPv6 link-local address of " "interface: %s\n", strerror(errno)); apn_stop(apn, false); return -1; } + apn->v6_lladdr = ipv6_tun_linklocal_ip.addr.v6; } /* set back-pointer from TUN device to APN */ @@ -229,8 +234,14 @@ if (apn->v4.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if(tun_ipv4_local_get(apn->tun.tun, &ipv4_tun_ip) == 0) { + ipv4_blacklist_size = 1; + LOGPAPN(LOGL_INFO, apn, "Blacklist IPv4 tun IP %s\n", + in46p_ntoa(&ipv4_tun_ip)); + } if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, - &apn->v4.cfg.static_prefix, 0)) { + &apn->v4.cfg.static_prefix, ippool_flags, + &ipv4_tun_ip, ipv4_blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); apn_stop(apn, false); return -1; @@ -241,8 +252,14 @@ if (apn->v6.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if(tun_ipv6_local_get(apn->tun.tun, &ipv6_tun_ip, IPV6_TYPE_GLOBAL) == 0) { + ipv6_blacklist_size = 1; + LOGPAPN(LOGL_INFO, apn, "Blacklist IPv6 tun IP %s\n", + in46p_ntoa(&ipv6_tun_ip)); + } if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, - &apn->v6.cfg.static_prefix, 0)) { + &apn->v6.cfg.static_prefix, ippool_flags, + &ipv6_tun_ip, ipv6_blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); apn_stop(apn, false); return -1; diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 32e0f8d..fb680f3 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -195,6 +195,54 @@ } } +unsigned int netmask_ipv4_prefixlen(const struct in_addr *netmask) +{ + struct in_addr tmp = *netmask; + int prefix = 0; + + while (tmp.s_addr & 0x01) { + prefix++; + tmp.s_addr = tmp.s_addr >> 1; + } + return prefix; +} + +unsigned int netmask_ipv6_prefixlen(const struct in6_addr *netmask) +{ + struct in6_addr tmp = *netmask; + int prefix = 0; + + #if defined(__linux__) + #define ADDRFIELD(i) s6_addr32[i] + #else + #define ADDRFIELD(i) __u6_addr.__u6_addr32[i] + #endif + + for (int i = 0; i < 4; i++) { + while (tmp.ADDRFIELD(i) & 0x01) { + prefix++; + tmp.ADDRFIELD(i) = tmp.ADDRFIELD(i) >> 1; + } + } + + #undef ADDRFIELD + + return prefix; +} + +unsigned int in46a_prefixlen(const struct in46_addr *netmask) +{ + switch (netmask->len) { + case 4: + return netmask_ipv4_prefixlen(&netmask->v4); + case 16: + return netmask_ipv6_prefixlen(&netmask->v6); + default: + OSMO_ASSERT(0); + return 0; + } +} + /*! Convert given PDP End User Address to in46_addr * \returns 0 on success; negative on error */ int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua) diff --git a/lib/in46_addr.h b/lib/in46_addr.h index ce2df14..109a933 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -27,6 +27,9 @@ extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); +extern unsigned int netmask_ipv4_prefixlen(const struct in_addr *netmask); +extern unsigned int netmask_ipv6_prefixlen(const struct in6_addr *netmask); +extern unsigned int in46a_prefixlen(const struct in46_addr *netmask); int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua); int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst); diff --git a/lib/ippool.c b/lib/ippool.c index 03323e2..f1b4223 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -184,9 +184,18 @@ } } +static bool addr_in_prefix_list(struct in46_addr *addr, struct in46_prefix *list, size_t list_size) +{ + for (int i = 0; i < list_size; i++) { + if(in46a_prefix_equal(addr, &list[i].addr)) + return true; + } + return false; +} + /* Create new address pool */ int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, const struct in46_prefix *stat, - int flags) + int flags, struct in46_prefix *blacklist, size_t blacklist_size) { /* Parse only first instance of pool for now */ @@ -210,18 +219,16 @@ if (addr.len == sizeof(struct in6_addr)) addr.len = 64/8; - /* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */ - if (flags & IPPOOL_NOGATEWAY) { - flags |= IPPOOL_NONETWORK; - } - dynsize = (1 << (addr.len*8 - addrprefixlen)); if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; - if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ - dynsize--; if (flags & IPPOOL_NOBROADCAST) /* Exclude broadcast address from pool */ dynsize--; + /* Exclude included blacklist addresses from pool */ + for (int i = 0; i < blacklist_size; i++) { + if (in46a_within_mask(&blacklist[i].addr, &addr, addrprefixlen)) + dynsize--; + } } if (!stat || stat->addr.len == 0) { @@ -278,13 +285,17 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; - if (flags & IPPOOL_NOGATEWAY) { - in46a_inc(&addr); - in46a_inc(&addr); - } else if (flags & IPPOOL_NONETWORK) { + if (flags & IPPOOL_NONETWORK) { in46a_inc(&addr); } for (i = 0; i < dynsize; i++) { + if (addr_in_prefix_list(&addr, blacklist, blacklist_size)) { + SYS_ERR(DIP, LOGL_DEBUG, 0, + "addr blacklisted from pool: %s", in46a_ntoa(&addr)); + in46a_inc(&addr); + i--; + continue; + } (*this)->member[i].addr = addr; in46a_inc(&addr); diff --git a/lib/ippool.h b/lib/ippool.h index 56beb4e..efb274b 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -31,7 +31,6 @@ #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 -#define IPPOOL_NOGATEWAY 0x04 #define IPPOOL_STATSIZE 0x10000 @@ -72,7 +71,8 @@ /* Create new address pool */ extern int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, - const struct in46_prefix *stat, int flags); + const struct in46_prefix *stat, int flags, + struct in46_prefix *blacklist, size_t blacklist_size); /* Delete existing address pool */ extern int ippool_free(struct ippool_t *this); diff --git a/lib/tun.c b/lib/tun.c index 7662146..2ebb96d 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -751,8 +751,40 @@ #include -/* obtain the link-local address of the tun device */ -int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia) +/* Obtain the local address of the tun device */ +int tun_ipv4_local_get(const struct tun_t *tun, struct in46_prefix *prefix) +{ + struct ifaddrs *ifaddr, *ifa; + + if (getifaddrs(&ifaddr) == -1) { + return -1; + } + + for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { + struct sockaddr_in *sin4 = (struct sockaddr_in *) ifa->ifa_addr; + struct sockaddr_in *netmask4 = (struct sockaddr_in *) ifa->ifa_netmask; + if (ifa->ifa_addr == NULL) + continue; + + if (ifa->ifa_addr->sa_family != AF_INET) + continue; + + if (strcmp(ifa->ifa_name, tun->devname)) + continue; + + prefix->addr.len = sizeof(sin4->sin_addr); + prefix->addr.v4 = sin4->sin_addr; + prefix->prefixlen = netmask_ipv4_prefixlen(&netmask4->sin_addr); + freeifaddrs(ifaddr); + return 0; + } + freeifaddrs(ifaddr); + return -1; +} + +/* Obtain the local address of the tun device. + Type of IPv6 address can be specified with "flags = IPV6_TYPE_LINK | IPV6_TYPE_GLOBAL" */ +int tun_ipv6_local_get(const struct tun_t *tun, struct in46_prefix *prefix, int flags) { struct ifaddrs *ifaddr, *ifa; static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; @@ -763,6 +795,7 @@ for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; + struct sockaddr_in6 *netmask6 = (struct sockaddr_in6 *) ifa->ifa_netmask; if (ifa->ifa_addr == NULL) continue; @@ -772,10 +805,17 @@ if (strcmp(ifa->ifa_name, tun->devname)) continue; - if (memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix))) + if (!(flags & IPV6_TYPE_LINK) && + !memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix))) continue; - *ia = sin6->sin6_addr; + if (!(flags & IPV6_TYPE_GLOBAL) && + memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix))) + continue; + + prefix->addr.len = sizeof(sin6->sin6_addr); + prefix->addr.v6 = sin6->sin6_addr; + prefix->prefixlen = netmask_ipv6_prefixlen(&netmask6->sin6_addr); freeifaddrs(ifaddr); return 0; } diff --git a/lib/tun.h b/lib/tun.h index f63be50..de867dd 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -23,6 +23,14 @@ #define TUN_NLBUFSIZE 1024 #include "config.h" + +/* ipv6 ip type flags for tun_ipv6_local_get() */ +enum { + IPV6_TYPE_LINK = 1, + IPV6_TYPE_GLOBAL = 2, +}; + + #ifndef HAVE_IPHDR struct iphdr { @@ -85,6 +93,7 @@ extern int tun_runscript(struct tun_t *tun, char *script); -int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia); +int tun_ipv4_local_get(const struct tun_t *tun, struct in46_prefix *prefix); +int tun_ipv6_local_get(const struct tun_t *tun, struct in46_prefix *prefix, int flags); #endif /* !_TUN_H */ diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index f38c1be..423690d 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -13,36 +13,46 @@ #include "../../lib/syserr.h" -static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags) +static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags, char **blacklist, size_t blacklist_size) { + struct in46_prefix *blacklist_pfx; struct ippool_t *pool; struct in46_prefix pfx; size_t t; int rc; + blacklist_pfx = calloc(blacklist_size, sizeof(struct in46_prefix)); + for (int i = 0; i < blacklist_size; i++) { + rc = ippool_aton(&blacklist_pfx[i].addr, &t, blacklist[i], 0); + OSMO_ASSERT(rc == 0); + pfx.prefixlen = t; + } + /* dynamic-only v4 */ - rc = ippool_aton(&pfx.addr, &t, prefix_str, flags); + rc = ippool_aton(&pfx.addr, &t, prefix_str, 0); OSMO_ASSERT(rc == 0); pfx.prefixlen = t; - rc = ippool_new(&pool, &pfx, NULL, flags); + rc = ippool_new(&pool, &pfx, NULL, flags, blacklist_pfx, blacklist_size); OSMO_ASSERT(rc == 0); //ippool_printaddr(pool); + free(blacklist_pfx); + return pool; } -static void test_pool_size(const char *pfx, unsigned int flags, unsigned int expected_size) +static void test_pool_size(const char *pfx, unsigned int flags, char **blacklist, size_t blacklist_size, unsigned int expected_size) { struct ippool_t *pool; struct ippoolm_t *member; struct in46_addr addr; int i, rc, n; - printf("testing pool for prefix %s, flags=0x%x, expected_size=%u\n", pfx, flags, expected_size); - pool = create_pool(pfx, flags); + printf("testing pool for prefix %s, flags=0x%x, blacklist_size=%lu, expected_size=%u\n", pfx, flags, blacklist_size, expected_size); + pool = create_pool(pfx, flags, blacklist, blacklist_size); OSMO_ASSERT(pool->listsize == expected_size); memset(&addr, 0, sizeof(addr)); @@ -91,19 +101,23 @@ static void test_pool_sizes(void) { /* 256 addresses [0..255] */ - test_pool_size("192.168.23.0/24", 0, 256); + test_pool_size("192.168.23.0/24", 0, NULL, 0, 256); /* 255 addresses [1..255] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, 255); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, NULL, 0, 255); /* 254 addresses [1..254] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 254); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 254); /* 65534 addresses [0.1..255.254] */ - test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 65534); + test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 65534); /* 256 prefixes of /64 each */ - test_pool_size("2001:DB8::/56", 0, 256); + test_pool_size("2001:DB8::/56", 0, NULL, 0, 256); + + /* 253 addresses [1..254] & exclude 192.168.23.1/24 */ + char *blacklist[] = {"176.16.222.10/24", "192.168.23.1/24", "192.168.38.2/24"}; + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, blacklist, 3, 253); } int main(int argc, char **argv) diff --git a/tests/lib/ippool_test.err b/tests/lib/ippool_test.err index 7dc5371..b11c12a 100644 --- a/tests/lib/ippool_test.err +++ b/tests/lib/ippool_test.err @@ -8,3 +8,5 @@ No more IP addresses available No more IP addresses available No more IP addresses available +No more IP addresses available +No more IP addresses available diff --git a/tests/lib/ippool_test.ok b/tests/lib/ippool_test.ok index a0eeb4b..263494e 100644 --- a/tests/lib/ippool_test.ok +++ b/tests/lib/ippool_test.ok @@ -1,4 +1,4 @@ -testing pool for prefix 192.168.23.0/24, flags=0x0, expected_size=256 +testing pool for prefix 192.168.23.0/24, flags=0x0, blacklist_size=0, expected_size=256 allocated address 192.168.23.0 allocated address 192.168.23.1 allocated address 192.168.23.2 @@ -255,7 +255,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x1, expected_size=255 +testing pool for prefix 192.168.23.0/24, flags=0x1, blacklist_size=0, expected_size=255 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -511,7 +511,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x3, expected_size=254 +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=0, expected_size=254 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -766,7 +766,7 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.0.0/16, flags=0x3, expected_size=65534 +testing pool for prefix 192.168.0.0/16, flags=0x3, blacklist_size=0, expected_size=65534 allocated address 192.168.0.1 allocated address 192.168.0.2 allocated address 192.168.0.3 @@ -66301,7 +66301,7 @@ allocated address 192.168.255.252 allocated address 192.168.255.253 allocated address 192.168.255.254 -testing pool for prefix 2001:DB8::/56, flags=0x0, expected_size=256 +testing pool for prefix 2001:DB8::/56, flags=0x0, blacklist_size=0, expected_size=256 allocated address 2001:db8:: allocated address 2001:db8:0:1:: allocated address 2001:db8:0:2:: @@ -66558,3 +66558,257 @@ allocated address 2001:db8:0:fd:: allocated address 2001:db8:0:fe:: allocated address 2001:db8:0:ff:: +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=3, expected_size=253 +allocated address 192.168.23.2 +allocated address 192.168.23.3 +allocated address 192.168.23.4 +allocated address 192.168.23.5 +allocated address 192.168.23.6 +allocated address 192.168.23.7 +allocated address 192.168.23.8 +allocated address 192.168.23.9 +allocated address 192.168.23.10 +allocated address 192.168.23.11 +allocated address 192.168.23.12 +allocated address 192.168.23.13 +allocated address 192.168.23.14 +allocated address 192.168.23.15 +allocated address 192.168.23.16 +allocated address 192.168.23.17 +allocated address 192.168.23.18 +allocated address 192.168.23.19 +allocated address 192.168.23.20 +allocated address 192.168.23.21 +allocated address 192.168.23.22 +allocated address 192.168.23.23 +allocated address 192.168.23.24 +allocated address 192.168.23.25 +allocated address 192.168.23.26 +allocated address 192.168.23.27 +allocated address 192.168.23.28 +allocated address 192.168.23.29 +allocated address 192.168.23.30 +allocated address 192.168.23.31 +allocated address 192.168.23.32 +allocated address 192.168.23.33 +allocated address 192.168.23.34 +allocated address 192.168.23.35 +allocated address 192.168.23.36 +allocated address 192.168.23.37 +allocated address 192.168.23.38 +allocated address 192.168.23.39 +allocated address 192.168.23.40 +allocated address 192.168.23.41 +allocated address 192.168.23.42 +allocated address 192.168.23.43 +allocated address 192.168.23.44 +allocated address 192.168.23.45 +allocated address 192.168.23.46 +allocated address 192.168.23.47 +allocated address 192.168.23.48 +allocated address 192.168.23.49 +allocated address 192.168.23.50 +allocated address 192.168.23.51 +allocated address 192.168.23.52 +allocated address 192.168.23.53 +allocated address 192.168.23.54 +allocated address 192.168.23.55 +allocated address 192.168.23.56 +allocated address 192.168.23.57 +allocated address 192.168.23.58 +allocated address 192.168.23.59 +allocated address 192.168.23.60 +allocated address 192.168.23.61 +allocated address 192.168.23.62 +allocated address 192.168.23.63 +allocated address 192.168.23.64 +allocated address 192.168.23.65 +allocated address 192.168.23.66 +allocated address 192.168.23.67 +allocated address 192.168.23.68 +allocated address 192.168.23.69 +allocated address 192.168.23.70 +allocated address 192.168.23.71 +allocated address 192.168.23.72 +allocated address 192.168.23.73 +allocated address 192.168.23.74 +allocated address 192.168.23.75 +allocated address 192.168.23.76 +allocated address 192.168.23.77 +allocated address 192.168.23.78 +allocated address 192.168.23.79 +allocated address 192.168.23.80 +allocated address 192.168.23.81 +allocated address 192.168.23.82 +allocated address 192.168.23.83 +allocated address 192.168.23.84 +allocated address 192.168.23.85 +allocated address 192.168.23.86 +allocated address 192.168.23.87 +allocated address 192.168.23.88 +allocated address 192.168.23.89 +allocated address 192.168.23.90 +allocated address 192.168.23.91 +allocated address 192.168.23.92 +allocated address 192.168.23.93 +allocated address 192.168.23.94 +allocated address 192.168.23.95 +allocated address 192.168.23.96 +allocated address 192.168.23.97 +allocated address 192.168.23.98 +allocated address 192.168.23.99 +allocated address 192.168.23.100 +allocated address 192.168.23.101 +allocated address 192.168.23.102 +allocated address 192.168.23.103 +allocated address 192.168.23.104 +allocated address 192.168.23.105 +allocated address 192.168.23.106 +allocated address 192.168.23.107 +allocated address 192.168.23.108 +allocated address 192.168.23.109 +allocated address 192.168.23.110 +allocated address 192.168.23.111 +allocated address 192.168.23.112 +allocated address 192.168.23.113 +allocated address 192.168.23.114 +allocated address 192.168.23.115 +allocated address 192.168.23.116 +allocated address 192.168.23.117 +allocated address 192.168.23.118 +allocated address 192.168.23.119 +allocated address 192.168.23.120 +allocated address 192.168.23.121 +allocated address 192.168.23.122 +allocated address 192.168.23.123 +allocated address 192.168.23.124 +allocated address 192.168.23.125 +allocated address 192.168.23.126 +allocated address 192.168.23.127 +allocated address 192.168.23.128 +allocated address 192.168.23.129 +allocated address 192.168.23.130 +allocated address 192.168.23.131 +allocated address 192.168.23.132 +allocated address 192.168.23.133 +allocated address 192.168.23.134 +allocated address 192.168.23.135 +allocated address 192.168.23.136 +allocated address 192.168.23.137 +allocated address 192.168.23.138 +allocated address 192.168.23.139 +allocated address 192.168.23.140 +allocated address 192.168.23.141 +allocated address 192.168.23.142 +allocated address 192.168.23.143 +allocated address 192.168.23.144 +allocated address 192.168.23.145 +allocated address 192.168.23.146 +allocated address 192.168.23.147 +allocated address 192.168.23.148 +allocated address 192.168.23.149 +allocated address 192.168.23.150 +allocated address 192.168.23.151 +allocated address 192.168.23.152 +allocated address 192.168.23.153 +allocated address 192.168.23.154 +allocated address 192.168.23.155 +allocated address 192.168.23.156 +allocated address 192.168.23.157 +allocated address 192.168.23.158 +allocated address 192.168.23.159 +allocated address 192.168.23.160 +allocated address 192.168.23.161 +allocated address 192.168.23.162 +allocated address 192.168.23.163 +allocated address 192.168.23.164 +allocated address 192.168.23.165 +allocated address 192.168.23.166 +allocated address 192.168.23.167 +allocated address 192.168.23.168 +allocated address 192.168.23.169 +allocated address 192.168.23.170 +allocated address 192.168.23.171 +allocated address 192.168.23.172 +allocated address 192.168.23.173 +allocated address 192.168.23.174 +allocated address 192.168.23.175 +allocated address 192.168.23.176 +allocated address 192.168.23.177 +allocated address 192.168.23.178 +allocated address 192.168.23.179 +allocated address 192.168.23.180 +allocated address 192.168.23.181 +allocated address 192.168.23.182 +allocated address 192.168.23.183 +allocated address 192.168.23.184 +allocated address 192.168.23.185 +allocated address 192.168.23.186 +allocated address 192.168.23.187 +allocated address 192.168.23.188 +allocated address 192.168.23.189 +allocated address 192.168.23.190 +allocated address 192.168.23.191 +allocated address 192.168.23.192 +allocated address 192.168.23.193 +allocated address 192.168.23.194 +allocated address 192.168.23.195 +allocated address 192.168.23.196 +allocated address 192.168.23.197 +allocated address 192.168.23.198 +allocated address 192.168.23.199 +allocated address 192.168.23.200 +allocated address 192.168.23.201 +allocated address 192.168.23.202 +allocated address 192.168.23.203 +allocated address 192.168.23.204 +allocated address 192.168.23.205 +allocated address 192.168.23.206 +allocated address 192.168.23.207 +allocated address 192.168.23.208 +allocated address 192.168.23.209 +allocated address 192.168.23.210 +allocated address 192.168.23.211 +allocated address 192.168.23.212 +allocated address 192.168.23.213 +allocated address 192.168.23.214 +allocated address 192.168.23.215 +allocated address 192.168.23.216 +allocated address 192.168.23.217 +allocated address 192.168.23.218 +allocated address 192.168.23.219 +allocated address 192.168.23.220 +allocated address 192.168.23.221 +allocated address 192.168.23.222 +allocated address 192.168.23.223 +allocated address 192.168.23.224 +allocated address 192.168.23.225 +allocated address 192.168.23.226 +allocated address 192.168.23.227 +allocated address 192.168.23.228 +allocated address 192.168.23.229 +allocated address 192.168.23.230 +allocated address 192.168.23.231 +allocated address 192.168.23.232 +allocated address 192.168.23.233 +allocated address 192.168.23.234 +allocated address 192.168.23.235 +allocated address 192.168.23.236 +allocated address 192.168.23.237 +allocated address 192.168.23.238 +allocated address 192.168.23.239 +allocated address 192.168.23.240 +allocated address 192.168.23.241 +allocated address 192.168.23.242 +allocated address 192.168.23.243 +allocated address 192.168.23.244 +allocated address 192.168.23.245 +allocated address 192.168.23.246 +allocated address 192.168.23.247 +allocated address 192.168.23.248 +allocated address 192.168.23.249 +allocated address 192.168.23.250 +allocated address 192.168.23.251 +allocated address 192.168.23.252 +allocated address 192.168.23.253 +allocated address 192.168.23.254 -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 13 16:25:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 13 Oct 2017 16:25:34 +0000 Subject: [PATCH] libosmo-netif[master]: examples: add simple UDP client/server Message-ID: Review at https://gerrit.osmocom.org/4257 examples: add simple UDP client/server In addition to showing basic UDP send/receive example, it helps to test corner-case when dealing with 0-length UDP packets. Change-Id: I08c0adf1cf9b6a6f1f7090b237d0497c2ec13cdf Related: OS#2219 --- M .gitignore M examples/Makefile.am A examples/udp-test-client.c A examples/udp-test-server.c A examples/udp-test.h 5 files changed, 227 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/57/4257/1 diff --git a/.gitignore b/.gitignore index 2d582bd..4ee9929 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,5 @@ examples/stream-server Doxyfile +/examples/udp-test-client +/examples/udp-test-server diff --git a/examples/Makefile.am b/examples/Makefile.am index ddfaa48..df13808 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -14,8 +14,12 @@ rs232-write \ rtp-udp-test-client \ rtp-udp-test-server \ + udp-test-client \ + udp-test-server \ osmux-test-input \ osmux-test-output + +noinst_HEADERS = udp-test.h ipa_stream_client_SOURCES = ipa-stream-client.c ipa_stream_client_LDADD = $(top_builddir)/src/libosmonetif.la \ @@ -57,6 +61,12 @@ rtp_udp_test_server_LDADD = $(top_builddir)/src/libosmonetif.la \ $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) +udp_test_client_SOURCES = udp-test-client.c +udp_test_client_LDADD = $(top_builddir)/src/libosmonetif.la $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + +udp_test_server_SOURCES = udp-test-server.c +udp_test_server_LDADD = $(top_builddir)/src/libosmonetif.la $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + osmux_test_input_SOURCES = osmux-test-input.c osmux_test_input_LDADD = $(top_builddir)/src/libosmonetif.la \ $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) diff --git a/examples/udp-test-client.c b/examples/udp-test-client.c new file mode 100644 index 0000000..efd746b --- /dev/null +++ b/examples/udp-test-client.c @@ -0,0 +1,43 @@ +#include "udp-test.h" + +static int read_cb(struct osmo_dgram *conn) +{ + struct msgb *msg = print_recv(conn); + if (!msg) + return -1; + + if (msgb_length(msg)) + if (msgb_data(msg)[0] >= NUM_MSG - 1) + please_dont_die = false; /* end test: */ + + msgb_free(msg); + + return 0; +} + +int main(int argc, char **argv) +{ + uint8_t i; + + if (!dgram_init(THOST, CPORT, SPORT, read_cb)) + exit(EXIT_FAILURE); + + for(i = 0; i < NUM_MSG + 1; i++) { + /* N. B: moving this alocation outside of the loop will result in segfault */ + struct msgb *msg = msgb_alloc(MAX_MSG, "UDP/client"); + if (!msg) { + LOGP(DUDP_TEST, LOGL_ERROR, "cann't allocate message\n"); + return EXIT_FAILURE; + } + + if (!mtrim(msg, i, i)) + return EXIT_FAILURE; + + LOGP(DUDP_TEST, LOGL_NOTICE, "queue [%u] %s\n", msgb_length(msg), msgb_hexdump(msg)); + osmo_dgram_send(conn, msg); + } + + main_loop(THOST, CPORT, SPORT); + + return 0; +} diff --git a/examples/udp-test-server.c b/examples/udp-test-server.c new file mode 100644 index 0000000..444843a --- /dev/null +++ b/examples/udp-test-server.c @@ -0,0 +1,35 @@ +#include "udp-test.h" + +int read_cb(struct osmo_dgram *conn) +{ + int bytes; + struct msgb *msg = print_recv(conn); + + if (!msg) + return -1; + + /* build reply: */ + bytes = msgb_length(msg); + + if (!mtrim(msg, 0, bytes)) + return -1; + + /* sent reply: */ + osmo_dgram_send(conn, msg); + + /* end test: */ + if (bytes > NUM_MSG - 1) + please_dont_die = false; + + return 0; +} + +int main(int argc, char **argv) +{ + if (!dgram_init(THOST, SPORT, CPORT, read_cb)) + return EXIT_FAILURE; + + main_loop(THOST, SPORT, CPORT); + + return 0; +} diff --git a/examples/udp-test.h b/examples/udp-test.h new file mode 100644 index 0000000..14bbd91 --- /dev/null +++ b/examples/udp-test.h @@ -0,0 +1,137 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#define MAX_MSG 255 +#define NUM_MSG 11 +#define DUDP_TEST 0 +#define THOST "127.0.0.1" +#define SPORT 15000 +#define CPORT 15001 + +static struct osmo_dgram *conn; +static void *tall_test; +bool please_dont_die = true; + +static void sighandler(int foo) +{ + LOGP(DLINP, LOGL_NOTICE, "closing UDP test...\n"); + osmo_dgram_close(conn); + osmo_dgram_destroy(conn); + please_dont_die = false; +} + +static inline struct msgb *print_recv(struct osmo_dgram *conn) +{ + struct msgb *msg = msgb_alloc(MAX_MSG, "UDP/test"); + int bytes; + + LOGP(DUDP_TEST, LOGL_NOTICE, "received datagram: "); + + if (!msg) { + LOGPC(DUDP_TEST, LOGL_ERROR, "can't allocate message\n"); + return NULL; + } + + /* receive message: */ + bytes = osmo_dgram_recv(conn, msg); + if (bytes < 0) { + LOGPC(DUDP_TEST, LOGL_ERROR, "can't receive message: %u\n", -bytes); + msgb_free(msg); + return NULL; + } + + /* process message: */ + LOGPC(DUDP_TEST, LOGL_NOTICE, "[%u] %s\n", bytes, msgb_hexdump(msg)); + + return msg; +} + +static inline bool dgram_init(const char *host, uint16_t lport, uint16_t rport, void *read_cb) +{ + const struct log_info_cat udp_test_cat[] = { + [DUDP_TEST] = { + .name = "DUDP_TEST", + .description = "UDP test", + .color = "\033[1;35m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + }; + + const struct log_info udp_test_log_info = { + .filter_fn = NULL, + .cat = udp_test_cat, + .num_cat = ARRAY_SIZE(udp_test_cat), + }; + + signal(SIGINT, sighandler); + + tall_test = talloc_named_const(NULL, 1, "udp_test"); + + osmo_init_logging(&udp_test_log_info); + log_set_log_level(osmo_stderr_target, LOGL_NOTICE); + + conn = osmo_dgram_create(tall_test); + if (!conn) { + LOGP(DUDP_TEST, LOGL_ERROR, "cannot create UDP socket\n"); + return false; + } + + osmo_dgram_set_local_addr(conn, host); + osmo_dgram_set_local_port(conn, lport); + osmo_dgram_set_remote_addr(conn, host); + osmo_dgram_set_remote_port(conn, rport); + osmo_dgram_set_read_cb(conn, read_cb); + + if (osmo_dgram_open(conn) < 0) { + LOGP(DUDP_TEST, LOGL_ERROR, "cannot open client connection %s:%u -> %s:%u\n", host, lport, host, rport); + return false; + } + + return true; +} + +static inline void main_loop(const char *host, uint16_t lport, uint16_t rport) +{ + LOGP(DUDP_TEST, LOGL_NOTICE, "Entering main loop: %s:%u -> %s:%u\n", host, lport, host, rport); + + while(please_dont_die) + osmo_select_main(0); +} + +/* Smart message trimmer: + * for all positive i trims msg to i - 1 + * for i = 0 trims msg to 0 + * for all positive x adds x to msg +*/ +/*! Smart message trimmer. + * \param[in] msg message buffer + * \param[in] i trim value: for all positive i, msg is trimmed to i - 1, otherwise msg is trimmed to 0 + * \param[in] x message content: for all positive x, x is added to msg, otherwise it's ignored + */ +static inline bool mtrim(struct msgb *msg, uint8_t i, uint8_t x) +{ + if (msgb_trim(msg, i ? i - 1 : i) != 0) { + LOGP(DLINP, LOGL_ERROR, "failed to trim message by %u\n", i); + return false; + } + + if (x) + msgb_put_u8(msg, x); + + return true; +} -- To view, visit https://gerrit.osmocom.org/4257 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I08c0adf1cf9b6a6f1f7090b237d0497c2ec13cdf Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 13 16:25:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 13 Oct 2017 16:25:37 +0000 Subject: [PATCH] libosmo-netif[master]: cosmetic: relax UDP length check Message-ID: Review at https://gerrit.osmocom.org/4258 cosmetic: relax UDP length check Previously recv() returning 0 for UDP socket was considered as error although it's legitimate return value for empty UDP packets. Relax the error check to avoid confusing error messages. The function behavior is the same: * msg is not altered while receiving 0-length UDP packet * return value is 0 The only result of the relaxed error check is the absense of error log message for 0-length UDP packet. Change-Id: I32e5fcbf5ed92cc923660ac59e6a37fd3f0703a7 Fixes: OS#2219 --- M src/datagram.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/58/4258/1 diff --git a/src/datagram.c b/src/datagram.c index c2c84e0..10204e2 100644 --- a/src/datagram.c +++ b/src/datagram.c @@ -236,14 +236,14 @@ /*! \brief Receive data via Osmocom datagram receiver * \param[in] conn Datagram Receiver from which to receive * \param msg pre-allocate message buffer to which received data is appended - * \returns number of bytes read, negative on error. */ + * \returns number of bytes read (might be 0 for empty UDP packet), negative on error. */ int osmo_dgram_rx_recv(struct osmo_dgram_rx *conn, struct msgb *msg) { int ret; ret = recv(conn->ofd.fd, msg->data, msg->data_len, 0); - if (ret <= 0) { + if (ret < 0) { LOGP(DLINP, LOGL_ERROR, "error receiving data from tx\n"); return ret; } -- To view, visit https://gerrit.osmocom.org/4258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32e5fcbf5ed92cc923660ac59e6a37fd3f0703a7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 13 16:25:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 13 Oct 2017 16:25:38 +0000 Subject: [PATCH] libosmo-netif[master]: cosmetic: print textual error from recv() Message-ID: Review at https://gerrit.osmocom.org/4259 cosmetic: print textual error from recv() Change-Id: Ic9557c6519b44b5985daf7d2d14ec063790441fb --- M src/datagram.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/59/4259/1 diff --git a/src/datagram.c b/src/datagram.c index 10204e2..ea31cd1 100644 --- a/src/datagram.c +++ b/src/datagram.c @@ -244,7 +244,7 @@ ret = recv(conn->ofd.fd, msg->data, msg->data_len, 0); if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "error receiving data from tx\n"); + LOGP(DLINP, LOGL_ERROR, "error receiving data from tx: %s\n", strerror(errno)); return ret; } msgb_put(msg, ret); -- To view, visit https://gerrit.osmocom.org/4259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9557c6519b44b5985daf7d2d14ec063790441fb Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 13 16:26:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Oct 2017 16:26:45 +0000 Subject: [PATCH] osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4256 to look at the new patch set (#2). ippool: Implement and use blacklist instead of blindly using IPPOOL_NOGATEWAY Commit dda21ed7d4a897c9284c69175d0da598598eae40 modified previous calls to ippool_new() removing the pass of flags to avoid allocating certain problematic IPs from the pool to MS, such as the network, gateway and broadcast IPs. Today I did some unsucessful tests with osmo-ggsn with a pool "ip prefix dynamic 176.16.222.0/24", and thus IP 176.16.222.0 was being assigned to the MS. De-capsulated DNS packets were received in the tun interface, but the Linux system in there was unable to correctly forward the packets to the gateway interface connected to the Internet. However, adding a second MS which got 176.16.222.1 had its packets forwarded correctly. However, previous implementation relies on flag IPPOOL_NOGATEWAY flag to blindly blacklist first IP after the network ip (ie, .0 and .1 are removed), which limits the IP reserved for the tun device to be .1. If a different IP in the range is assigned, it may cause issues. As a result, a blacklist is introduced in this commit to dynamically fetch the tun IP address and exlucde it from the pool of available IPs. Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 --- M ggsn/ggsn.c M lib/in46_addr.c M lib/in46_addr.h M lib/ippool.c M lib/ippool.h M lib/tun.c M lib/tun.h M tests/lib/ippool_test.c M tests/lib/ippool_test.err M tests/lib/ippool_test.ok 10 files changed, 439 insertions(+), 38 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/56/4256/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 67d040f..76ff127 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -149,6 +149,10 @@ /* actually start the APN with its current config */ int apn_start(struct apn_ctx *apn) { + int ipv4_blacklist_size = 0, ipv6_blacklist_size = 0; + struct in46_prefix ipv4_tun_ip, ipv6_tun_ip, ipv6_tun_linklocal_ip; + int ippool_flags = IPPOOL_NONETWORK | IPPOOL_NOBROADCAST; + if (apn->started) return 0; @@ -201,12 +205,13 @@ } if (apn->cfg.apn_type_mask & (APN_TYPE_IPv6|APN_TYPE_IPv4v6)) { - if (tun_ipv6_linklocal_get(apn->tun.tun, &apn->v6_lladdr) < 0) { + if (tun_ipv6_local_get(apn->tun.tun, &ipv6_tun_linklocal_ip, IPV6_TYPE_LINK) < 0) { LOGPAPN(LOGL_ERROR, apn, "Cannot obtain IPv6 link-local address of " "interface: %s\n", strerror(errno)); apn_stop(apn, false); return -1; } + apn->v6_lladdr = ipv6_tun_linklocal_ip.addr.v6; } /* set back-pointer from TUN device to APN */ @@ -229,8 +234,14 @@ if (apn->v4.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if (tun_ipv4_local_get(apn->tun.tun, &ipv4_tun_ip) == 0) { + ipv4_blacklist_size = 1; + LOGPAPN(LOGL_INFO, apn, "Blacklist IPv4 tun IP %s\n", + in46p_ntoa(&ipv4_tun_ip)); + } if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, - &apn->v4.cfg.static_prefix, 0)) { + &apn->v4.cfg.static_prefix, ippool_flags, + &ipv4_tun_ip, ipv4_blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); apn_stop(apn, false); return -1; @@ -241,8 +252,14 @@ if (apn->v6.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if (tun_ipv6_local_get(apn->tun.tun, &ipv6_tun_ip, IPV6_TYPE_GLOBAL) == 0) { + ipv6_blacklist_size = 1; + LOGPAPN(LOGL_INFO, apn, "Blacklist IPv6 tun IP %s\n", + in46p_ntoa(&ipv6_tun_ip)); + } if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, - &apn->v6.cfg.static_prefix, 0)) { + &apn->v6.cfg.static_prefix, ippool_flags, + &ipv6_tun_ip, ipv6_blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); apn_stop(apn, false); return -1; diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 32e0f8d..674acbf 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -195,6 +195,55 @@ } } +unsigned int netmask_ipv4_prefixlen(const struct in_addr *netmask) +{ + struct in_addr tmp = *netmask; + int prefix = 0; + + while (tmp.s_addr & 0x01) { + prefix++; + tmp.s_addr = tmp.s_addr >> 1; + } + return prefix; +} + +unsigned int netmask_ipv6_prefixlen(const struct in6_addr *netmask) +{ + struct in6_addr tmp = *netmask; + int prefix = 0; + int i; + + #if defined(__linux__) + #define ADDRFIELD(i) s6_addr32[i] + #else + #define ADDRFIELD(i) __u6_addr.__u6_addr32[i] + #endif + + for (i = 0; i < 4; i++) { + while (tmp.ADDRFIELD(i) & 0x01) { + prefix++; + tmp.ADDRFIELD(i) = tmp.ADDRFIELD(i) >> 1; + } + } + + #undef ADDRFIELD + + return prefix; +} + +unsigned int in46a_prefixlen(const struct in46_addr *netmask) +{ + switch (netmask->len) { + case 4: + return netmask_ipv4_prefixlen(&netmask->v4); + case 16: + return netmask_ipv6_prefixlen(&netmask->v6); + default: + OSMO_ASSERT(0); + return 0; + } +} + /*! Convert given PDP End User Address to in46_addr * \returns 0 on success; negative on error */ int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua) diff --git a/lib/in46_addr.h b/lib/in46_addr.h index ce2df14..109a933 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -27,6 +27,9 @@ extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); +extern unsigned int netmask_ipv4_prefixlen(const struct in_addr *netmask); +extern unsigned int netmask_ipv6_prefixlen(const struct in6_addr *netmask); +extern unsigned int in46a_prefixlen(const struct in46_addr *netmask); int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua); int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst); diff --git a/lib/ippool.c b/lib/ippool.c index 03323e2..55a41d0 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -184,9 +184,19 @@ } } +static bool addr_in_prefix_list(struct in46_addr *addr, struct in46_prefix *list, size_t list_size) +{ + int i; + for (i = 0; i < list_size; i++) { + if (in46a_prefix_equal(addr, &list[i].addr)) + return true; + } + return false; +} + /* Create new address pool */ int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, const struct in46_prefix *stat, - int flags) + int flags, struct in46_prefix *blacklist, size_t blacklist_size) { /* Parse only first instance of pool for now */ @@ -210,18 +220,16 @@ if (addr.len == sizeof(struct in6_addr)) addr.len = 64/8; - /* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */ - if (flags & IPPOOL_NOGATEWAY) { - flags |= IPPOOL_NONETWORK; - } - dynsize = (1 << (addr.len*8 - addrprefixlen)); if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; - if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ - dynsize--; if (flags & IPPOOL_NOBROADCAST) /* Exclude broadcast address from pool */ dynsize--; + /* Exclude included blacklist addresses from pool */ + for (i = 0; i < blacklist_size; i++) { + if (in46a_within_mask(&blacklist[i].addr, &addr, addrprefixlen)) + dynsize--; + } } if (!stat || stat->addr.len == 0) { @@ -278,13 +286,17 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; - if (flags & IPPOOL_NOGATEWAY) { - in46a_inc(&addr); - in46a_inc(&addr); - } else if (flags & IPPOOL_NONETWORK) { + if (flags & IPPOOL_NONETWORK) { in46a_inc(&addr); } for (i = 0; i < dynsize; i++) { + if (addr_in_prefix_list(&addr, blacklist, blacklist_size)) { + SYS_ERR(DIP, LOGL_DEBUG, 0, + "addr blacklisted from pool: %s", in46a_ntoa(&addr)); + in46a_inc(&addr); + i--; + continue; + } (*this)->member[i].addr = addr; in46a_inc(&addr); diff --git a/lib/ippool.h b/lib/ippool.h index 56beb4e..efb274b 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -31,7 +31,6 @@ #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 -#define IPPOOL_NOGATEWAY 0x04 #define IPPOOL_STATSIZE 0x10000 @@ -72,7 +71,8 @@ /* Create new address pool */ extern int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, - const struct in46_prefix *stat, int flags); + const struct in46_prefix *stat, int flags, + struct in46_prefix *blacklist, size_t blacklist_size); /* Delete existing address pool */ extern int ippool_free(struct ippool_t *this); diff --git a/lib/tun.c b/lib/tun.c index 7662146..2ebb96d 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -751,8 +751,40 @@ #include -/* obtain the link-local address of the tun device */ -int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia) +/* Obtain the local address of the tun device */ +int tun_ipv4_local_get(const struct tun_t *tun, struct in46_prefix *prefix) +{ + struct ifaddrs *ifaddr, *ifa; + + if (getifaddrs(&ifaddr) == -1) { + return -1; + } + + for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { + struct sockaddr_in *sin4 = (struct sockaddr_in *) ifa->ifa_addr; + struct sockaddr_in *netmask4 = (struct sockaddr_in *) ifa->ifa_netmask; + if (ifa->ifa_addr == NULL) + continue; + + if (ifa->ifa_addr->sa_family != AF_INET) + continue; + + if (strcmp(ifa->ifa_name, tun->devname)) + continue; + + prefix->addr.len = sizeof(sin4->sin_addr); + prefix->addr.v4 = sin4->sin_addr; + prefix->prefixlen = netmask_ipv4_prefixlen(&netmask4->sin_addr); + freeifaddrs(ifaddr); + return 0; + } + freeifaddrs(ifaddr); + return -1; +} + +/* Obtain the local address of the tun device. + Type of IPv6 address can be specified with "flags = IPV6_TYPE_LINK | IPV6_TYPE_GLOBAL" */ +int tun_ipv6_local_get(const struct tun_t *tun, struct in46_prefix *prefix, int flags) { struct ifaddrs *ifaddr, *ifa; static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; @@ -763,6 +795,7 @@ for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; + struct sockaddr_in6 *netmask6 = (struct sockaddr_in6 *) ifa->ifa_netmask; if (ifa->ifa_addr == NULL) continue; @@ -772,10 +805,17 @@ if (strcmp(ifa->ifa_name, tun->devname)) continue; - if (memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix))) + if (!(flags & IPV6_TYPE_LINK) && + !memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix))) continue; - *ia = sin6->sin6_addr; + if (!(flags & IPV6_TYPE_GLOBAL) && + memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix))) + continue; + + prefix->addr.len = sizeof(sin6->sin6_addr); + prefix->addr.v6 = sin6->sin6_addr; + prefix->prefixlen = netmask_ipv6_prefixlen(&netmask6->sin6_addr); freeifaddrs(ifaddr); return 0; } diff --git a/lib/tun.h b/lib/tun.h index f63be50..de867dd 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -23,6 +23,14 @@ #define TUN_NLBUFSIZE 1024 #include "config.h" + +/* ipv6 ip type flags for tun_ipv6_local_get() */ +enum { + IPV6_TYPE_LINK = 1, + IPV6_TYPE_GLOBAL = 2, +}; + + #ifndef HAVE_IPHDR struct iphdr { @@ -85,6 +93,7 @@ extern int tun_runscript(struct tun_t *tun, char *script); -int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia); +int tun_ipv4_local_get(const struct tun_t *tun, struct in46_prefix *prefix); +int tun_ipv6_local_get(const struct tun_t *tun, struct in46_prefix *prefix, int flags); #endif /* !_TUN_H */ diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index f38c1be..ea56edd 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -13,36 +13,47 @@ #include "../../lib/syserr.h" -static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags) +static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags, char **blacklist, size_t blacklist_size) { + struct in46_prefix *blacklist_pfx; struct ippool_t *pool; struct in46_prefix pfx; size_t t; int rc; + int i; + + blacklist_pfx = calloc(blacklist_size, sizeof(struct in46_prefix)); + for (i = 0; i < blacklist_size; i++) { + rc = ippool_aton(&blacklist_pfx[i].addr, &t, blacklist[i], 0); + OSMO_ASSERT(rc == 0); + pfx.prefixlen = t; + } /* dynamic-only v4 */ - rc = ippool_aton(&pfx.addr, &t, prefix_str, flags); + rc = ippool_aton(&pfx.addr, &t, prefix_str, 0); OSMO_ASSERT(rc == 0); pfx.prefixlen = t; - rc = ippool_new(&pool, &pfx, NULL, flags); + rc = ippool_new(&pool, &pfx, NULL, flags, blacklist_pfx, blacklist_size); OSMO_ASSERT(rc == 0); //ippool_printaddr(pool); + free(blacklist_pfx); + return pool; } -static void test_pool_size(const char *pfx, unsigned int flags, unsigned int expected_size) +static void test_pool_size(const char *pfx, unsigned int flags, char **blacklist, size_t blacklist_size, unsigned int expected_size) { struct ippool_t *pool; struct ippoolm_t *member; struct in46_addr addr; int i, rc, n; - printf("testing pool for prefix %s, flags=0x%x, expected_size=%u\n", pfx, flags, expected_size); - pool = create_pool(pfx, flags); + printf("testing pool for prefix %s, flags=0x%x, blacklist_size=%lu, expected_size=%u\n", pfx, flags, blacklist_size, expected_size); + pool = create_pool(pfx, flags, blacklist, blacklist_size); OSMO_ASSERT(pool->listsize == expected_size); memset(&addr, 0, sizeof(addr)); @@ -91,19 +102,23 @@ static void test_pool_sizes(void) { /* 256 addresses [0..255] */ - test_pool_size("192.168.23.0/24", 0, 256); + test_pool_size("192.168.23.0/24", 0, NULL, 0, 256); /* 255 addresses [1..255] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, 255); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, NULL, 0, 255); /* 254 addresses [1..254] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 254); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 254); /* 65534 addresses [0.1..255.254] */ - test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 65534); + test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 65534); /* 256 prefixes of /64 each */ - test_pool_size("2001:DB8::/56", 0, 256); + test_pool_size("2001:DB8::/56", 0, NULL, 0, 256); + + /* 253 addresses [1..254] & exclude 192.168.23.1/24 */ + char *blacklist[] = {"176.16.222.10/24", "192.168.23.1/24", "192.168.38.2/24"}; + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, blacklist, 3, 253); } int main(int argc, char **argv) diff --git a/tests/lib/ippool_test.err b/tests/lib/ippool_test.err index 7dc5371..b11c12a 100644 --- a/tests/lib/ippool_test.err +++ b/tests/lib/ippool_test.err @@ -8,3 +8,5 @@ No more IP addresses available No more IP addresses available No more IP addresses available +No more IP addresses available +No more IP addresses available diff --git a/tests/lib/ippool_test.ok b/tests/lib/ippool_test.ok index a0eeb4b..263494e 100644 --- a/tests/lib/ippool_test.ok +++ b/tests/lib/ippool_test.ok @@ -1,4 +1,4 @@ -testing pool for prefix 192.168.23.0/24, flags=0x0, expected_size=256 +testing pool for prefix 192.168.23.0/24, flags=0x0, blacklist_size=0, expected_size=256 allocated address 192.168.23.0 allocated address 192.168.23.1 allocated address 192.168.23.2 @@ -255,7 +255,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x1, expected_size=255 +testing pool for prefix 192.168.23.0/24, flags=0x1, blacklist_size=0, expected_size=255 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -511,7 +511,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x3, expected_size=254 +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=0, expected_size=254 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -766,7 +766,7 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.0.0/16, flags=0x3, expected_size=65534 +testing pool for prefix 192.168.0.0/16, flags=0x3, blacklist_size=0, expected_size=65534 allocated address 192.168.0.1 allocated address 192.168.0.2 allocated address 192.168.0.3 @@ -66301,7 +66301,7 @@ allocated address 192.168.255.252 allocated address 192.168.255.253 allocated address 192.168.255.254 -testing pool for prefix 2001:DB8::/56, flags=0x0, expected_size=256 +testing pool for prefix 2001:DB8::/56, flags=0x0, blacklist_size=0, expected_size=256 allocated address 2001:db8:: allocated address 2001:db8:0:1:: allocated address 2001:db8:0:2:: @@ -66558,3 +66558,257 @@ allocated address 2001:db8:0:fd:: allocated address 2001:db8:0:fe:: allocated address 2001:db8:0:ff:: +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=3, expected_size=253 +allocated address 192.168.23.2 +allocated address 192.168.23.3 +allocated address 192.168.23.4 +allocated address 192.168.23.5 +allocated address 192.168.23.6 +allocated address 192.168.23.7 +allocated address 192.168.23.8 +allocated address 192.168.23.9 +allocated address 192.168.23.10 +allocated address 192.168.23.11 +allocated address 192.168.23.12 +allocated address 192.168.23.13 +allocated address 192.168.23.14 +allocated address 192.168.23.15 +allocated address 192.168.23.16 +allocated address 192.168.23.17 +allocated address 192.168.23.18 +allocated address 192.168.23.19 +allocated address 192.168.23.20 +allocated address 192.168.23.21 +allocated address 192.168.23.22 +allocated address 192.168.23.23 +allocated address 192.168.23.24 +allocated address 192.168.23.25 +allocated address 192.168.23.26 +allocated address 192.168.23.27 +allocated address 192.168.23.28 +allocated address 192.168.23.29 +allocated address 192.168.23.30 +allocated address 192.168.23.31 +allocated address 192.168.23.32 +allocated address 192.168.23.33 +allocated address 192.168.23.34 +allocated address 192.168.23.35 +allocated address 192.168.23.36 +allocated address 192.168.23.37 +allocated address 192.168.23.38 +allocated address 192.168.23.39 +allocated address 192.168.23.40 +allocated address 192.168.23.41 +allocated address 192.168.23.42 +allocated address 192.168.23.43 +allocated address 192.168.23.44 +allocated address 192.168.23.45 +allocated address 192.168.23.46 +allocated address 192.168.23.47 +allocated address 192.168.23.48 +allocated address 192.168.23.49 +allocated address 192.168.23.50 +allocated address 192.168.23.51 +allocated address 192.168.23.52 +allocated address 192.168.23.53 +allocated address 192.168.23.54 +allocated address 192.168.23.55 +allocated address 192.168.23.56 +allocated address 192.168.23.57 +allocated address 192.168.23.58 +allocated address 192.168.23.59 +allocated address 192.168.23.60 +allocated address 192.168.23.61 +allocated address 192.168.23.62 +allocated address 192.168.23.63 +allocated address 192.168.23.64 +allocated address 192.168.23.65 +allocated address 192.168.23.66 +allocated address 192.168.23.67 +allocated address 192.168.23.68 +allocated address 192.168.23.69 +allocated address 192.168.23.70 +allocated address 192.168.23.71 +allocated address 192.168.23.72 +allocated address 192.168.23.73 +allocated address 192.168.23.74 +allocated address 192.168.23.75 +allocated address 192.168.23.76 +allocated address 192.168.23.77 +allocated address 192.168.23.78 +allocated address 192.168.23.79 +allocated address 192.168.23.80 +allocated address 192.168.23.81 +allocated address 192.168.23.82 +allocated address 192.168.23.83 +allocated address 192.168.23.84 +allocated address 192.168.23.85 +allocated address 192.168.23.86 +allocated address 192.168.23.87 +allocated address 192.168.23.88 +allocated address 192.168.23.89 +allocated address 192.168.23.90 +allocated address 192.168.23.91 +allocated address 192.168.23.92 +allocated address 192.168.23.93 +allocated address 192.168.23.94 +allocated address 192.168.23.95 +allocated address 192.168.23.96 +allocated address 192.168.23.97 +allocated address 192.168.23.98 +allocated address 192.168.23.99 +allocated address 192.168.23.100 +allocated address 192.168.23.101 +allocated address 192.168.23.102 +allocated address 192.168.23.103 +allocated address 192.168.23.104 +allocated address 192.168.23.105 +allocated address 192.168.23.106 +allocated address 192.168.23.107 +allocated address 192.168.23.108 +allocated address 192.168.23.109 +allocated address 192.168.23.110 +allocated address 192.168.23.111 +allocated address 192.168.23.112 +allocated address 192.168.23.113 +allocated address 192.168.23.114 +allocated address 192.168.23.115 +allocated address 192.168.23.116 +allocated address 192.168.23.117 +allocated address 192.168.23.118 +allocated address 192.168.23.119 +allocated address 192.168.23.120 +allocated address 192.168.23.121 +allocated address 192.168.23.122 +allocated address 192.168.23.123 +allocated address 192.168.23.124 +allocated address 192.168.23.125 +allocated address 192.168.23.126 +allocated address 192.168.23.127 +allocated address 192.168.23.128 +allocated address 192.168.23.129 +allocated address 192.168.23.130 +allocated address 192.168.23.131 +allocated address 192.168.23.132 +allocated address 192.168.23.133 +allocated address 192.168.23.134 +allocated address 192.168.23.135 +allocated address 192.168.23.136 +allocated address 192.168.23.137 +allocated address 192.168.23.138 +allocated address 192.168.23.139 +allocated address 192.168.23.140 +allocated address 192.168.23.141 +allocated address 192.168.23.142 +allocated address 192.168.23.143 +allocated address 192.168.23.144 +allocated address 192.168.23.145 +allocated address 192.168.23.146 +allocated address 192.168.23.147 +allocated address 192.168.23.148 +allocated address 192.168.23.149 +allocated address 192.168.23.150 +allocated address 192.168.23.151 +allocated address 192.168.23.152 +allocated address 192.168.23.153 +allocated address 192.168.23.154 +allocated address 192.168.23.155 +allocated address 192.168.23.156 +allocated address 192.168.23.157 +allocated address 192.168.23.158 +allocated address 192.168.23.159 +allocated address 192.168.23.160 +allocated address 192.168.23.161 +allocated address 192.168.23.162 +allocated address 192.168.23.163 +allocated address 192.168.23.164 +allocated address 192.168.23.165 +allocated address 192.168.23.166 +allocated address 192.168.23.167 +allocated address 192.168.23.168 +allocated address 192.168.23.169 +allocated address 192.168.23.170 +allocated address 192.168.23.171 +allocated address 192.168.23.172 +allocated address 192.168.23.173 +allocated address 192.168.23.174 +allocated address 192.168.23.175 +allocated address 192.168.23.176 +allocated address 192.168.23.177 +allocated address 192.168.23.178 +allocated address 192.168.23.179 +allocated address 192.168.23.180 +allocated address 192.168.23.181 +allocated address 192.168.23.182 +allocated address 192.168.23.183 +allocated address 192.168.23.184 +allocated address 192.168.23.185 +allocated address 192.168.23.186 +allocated address 192.168.23.187 +allocated address 192.168.23.188 +allocated address 192.168.23.189 +allocated address 192.168.23.190 +allocated address 192.168.23.191 +allocated address 192.168.23.192 +allocated address 192.168.23.193 +allocated address 192.168.23.194 +allocated address 192.168.23.195 +allocated address 192.168.23.196 +allocated address 192.168.23.197 +allocated address 192.168.23.198 +allocated address 192.168.23.199 +allocated address 192.168.23.200 +allocated address 192.168.23.201 +allocated address 192.168.23.202 +allocated address 192.168.23.203 +allocated address 192.168.23.204 +allocated address 192.168.23.205 +allocated address 192.168.23.206 +allocated address 192.168.23.207 +allocated address 192.168.23.208 +allocated address 192.168.23.209 +allocated address 192.168.23.210 +allocated address 192.168.23.211 +allocated address 192.168.23.212 +allocated address 192.168.23.213 +allocated address 192.168.23.214 +allocated address 192.168.23.215 +allocated address 192.168.23.216 +allocated address 192.168.23.217 +allocated address 192.168.23.218 +allocated address 192.168.23.219 +allocated address 192.168.23.220 +allocated address 192.168.23.221 +allocated address 192.168.23.222 +allocated address 192.168.23.223 +allocated address 192.168.23.224 +allocated address 192.168.23.225 +allocated address 192.168.23.226 +allocated address 192.168.23.227 +allocated address 192.168.23.228 +allocated address 192.168.23.229 +allocated address 192.168.23.230 +allocated address 192.168.23.231 +allocated address 192.168.23.232 +allocated address 192.168.23.233 +allocated address 192.168.23.234 +allocated address 192.168.23.235 +allocated address 192.168.23.236 +allocated address 192.168.23.237 +allocated address 192.168.23.238 +allocated address 192.168.23.239 +allocated address 192.168.23.240 +allocated address 192.168.23.241 +allocated address 192.168.23.242 +allocated address 192.168.23.243 +allocated address 192.168.23.244 +allocated address 192.168.23.245 +allocated address 192.168.23.246 +allocated address 192.168.23.247 +allocated address 192.168.23.248 +allocated address 192.168.23.249 +allocated address 192.168.23.250 +allocated address 192.168.23.251 +allocated address 192.168.23.252 +allocated address 192.168.23.253 +allocated address 192.168.23.254 -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 16:35:31 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Oct 2017 16:35:31 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp_test: do not send rtp packets Message-ID: Review at https://gerrit.osmocom.org/4260 mgcp_test: do not send rtp packets The sendto() override in mgcp_test sends rtp packets out. This might be a problem for some test hosts (e.g. OBS). Remove the execution of the real_sendto and just return len. Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5 --- M tests/mgcp/mgcp_test.c 1 file changed, 1 insertion(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/60/4260/1 diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 5b292a5..e14b7ee 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -509,15 +509,9 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen) { - typedef ssize_t(*sendto_t) (int, const void *, size_t, int, - const struct sockaddr *, socklen_t); - static sendto_t real_sendto = NULL; uint32_t dest_host = htonl(((struct sockaddr_in *)dest_addr)->sin_addr.s_addr); int dest_port = htons(((struct sockaddr_in *)dest_addr)->sin_port); - - if (!real_sendto) - real_sendto = dlsym(RTLD_NEXT, "sendto"); if (len == 1 && ((const char *)buf)[0] == MGCP_DUMMY_LOAD) { fprintf(stderr, @@ -526,7 +520,7 @@ dummy_packets += 1; } - return real_sendto(sockfd, buf, len, flags, dest_addr, addrlen); + return len; } static int64_t force_monotonic_time_us = -1; -- To view, visit https://gerrit.osmocom.org/4260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Oct 13 17:04:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Oct 2017 17:04:54 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Improve resource requirements in suite.conf Message-ID: Review at https://gerrit.osmocom.org/4261 Improve resource requirements in suite.conf Change-Id: I10fd47f53509f04abe1e2a39036e5d97c781ddab --- M example/default-suites.conf M suites/aoip_encryption/suite.conf M suites/aoip_smpp/suite.conf M suites/aoip_sms/suite.conf M suites/smpp/suite.conf M suites/sms/suite.conf 6 files changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/61/4261/1 diff --git a/example/default-suites.conf b/example/default-suites.conf index 1e8d47a..0198486 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -6,4 +6,4 @@ - aoip_sms:trx-sysmocell5000 - smpp - aoip_smpp -- aoip_encryption:cipher-a50+cipher-a51 +- aoip_encryption diff --git a/suites/aoip_encryption/suite.conf b/suites/aoip_encryption/suite.conf index 3cdc525..d6d0eee 100644 --- a/suites/aoip_encryption/suite.conf +++ b/suites/aoip_encryption/suite.conf @@ -3,8 +3,14 @@ - times: 5 # msc, bsc, hlr, stp, mgw bts: - times: 1 + ciphers: + - a5_0 + - a5_1 modem: - times: 1 + ciphers: + - a5_0 + - a5_1 defaults: timeout: 120s diff --git a/suites/aoip_smpp/suite.conf b/suites/aoip_smpp/suite.conf index 46f8d09..688fe0a 100644 --- a/suites/aoip_smpp/suite.conf +++ b/suites/aoip_smpp/suite.conf @@ -5,6 +5,8 @@ - times: 1 modem: - times: 1 + features: + - sms defaults: timeout: 60s diff --git a/suites/aoip_sms/suite.conf b/suites/aoip_sms/suite.conf index 216d3ea..677a95e 100644 --- a/suites/aoip_sms/suite.conf +++ b/suites/aoip_sms/suite.conf @@ -5,3 +5,5 @@ - times: 1 modem: - times: 2 + features: + - sms diff --git a/suites/smpp/suite.conf b/suites/smpp/suite.conf index eb59abb..eb5dc01 100644 --- a/suites/smpp/suite.conf +++ b/suites/smpp/suite.conf @@ -5,6 +5,8 @@ - times: 1 modem: - times: 1 + features: + - sms defaults: timeout: 60s diff --git a/suites/sms/suite.conf b/suites/sms/suite.conf index 376f6cd..485402b 100644 --- a/suites/sms/suite.conf +++ b/suites/sms/suite.conf @@ -5,6 +5,8 @@ - times: 1 modem: - times: 2 + features: + - sms defaults: timeout: 60s -- To view, visit https://gerrit.osmocom.org/4261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I10fd47f53509f04abe1e2a39036e5d97c781ddab Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Oct 13 18:17:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 13 Oct 2017 18:17:41 +0000 Subject: [ABANDON] libosmocore[master]: Check for getrandom syscall directly In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Check for getrandom syscall directly ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I028724d41b3f5495a1a8adb51a5341de31ed0d82 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 13 18:41:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 18:41:56 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp_test: do not send rtp packets In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4260 to look at the new patch set (#2). mgcp_test: do not send rtp packets The sendto() override in mgcp_test sends rtp packets out. This might be a problem for some test hosts. e.g. on OBS, sending packets fails with an error message, which exits sendto() early and hence fails to send the expected amount of "Dummy Packets". Interestingly enough calling the real sendto is not necessary to run the test at all. Remove the execution of the real_sendto and just return len. Related: OS#2561 Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5 --- M tests/mgcp/mgcp_test.c 1 file changed, 1 insertion(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/60/4260/2 diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 5b292a5..e14b7ee 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -509,15 +509,9 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen) { - typedef ssize_t(*sendto_t) (int, const void *, size_t, int, - const struct sockaddr *, socklen_t); - static sendto_t real_sendto = NULL; uint32_t dest_host = htonl(((struct sockaddr_in *)dest_addr)->sin_addr.s_addr); int dest_port = htons(((struct sockaddr_in *)dest_addr)->sin_port); - - if (!real_sendto) - real_sendto = dlsym(RTLD_NEXT, "sendto"); if (len == 1 && ((const char *)buf)[0] == MGCP_DUMMY_LOAD) { fprintf(stderr, @@ -526,7 +520,7 @@ dummy_packets += 1; } - return real_sendto(sockfd, buf, len, flags, dest_addr, addrlen); + return len; } static int64_t force_monotonic_time_us = -1; -- To view, visit https://gerrit.osmocom.org/4260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 18:42:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 18:42:02 +0000 Subject: osmo-mgw[master]: mgcp_test: do not send rtp packets In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 18:42:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 18:42:03 +0000 Subject: [MERGED] osmo-mgw[master]: mgcp_test: do not send rtp packets In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: mgcp_test: do not send rtp packets ...................................................................... mgcp_test: do not send rtp packets The sendto() override in mgcp_test sends rtp packets out. This might be a problem for some test hosts. e.g. on OBS, sending packets fails with an error message, which exits sendto() early and hence fails to send the expected amount of "Dummy Packets". Interestingly enough calling the real sendto is not necessary to run the test at all. Remove the execution of the real_sendto and just return len. Related: OS#2561 Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5 --- M tests/mgcp/mgcp_test.c 1 file changed, 1 insertion(+), 7 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 5b292a5..e14b7ee 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -509,15 +509,9 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen) { - typedef ssize_t(*sendto_t) (int, const void *, size_t, int, - const struct sockaddr *, socklen_t); - static sendto_t real_sendto = NULL; uint32_t dest_host = htonl(((struct sockaddr_in *)dest_addr)->sin_addr.s_addr); int dest_port = htons(((struct sockaddr_in *)dest_addr)->sin_port); - - if (!real_sendto) - real_sendto = dlsym(RTLD_NEXT, "sendto"); if (len == 1 && ((const char *)buf)[0] == MGCP_DUMMY_LOAD) { fprintf(stderr, @@ -526,7 +520,7 @@ dummy_packets += 1; } - return real_sendto(sockfd, buf, len, flags, dest_addr, addrlen); + return len; } static int64_t force_monotonic_time_us = -1; -- To view, visit https://gerrit.osmocom.org/4260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 13 18:51:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 18:51:58 +0000 Subject: libosmo-netif[master]: cosmetic: print textual error from recv() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9557c6519b44b5985daf7d2d14ec063790441fb Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 18:52:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 18:52:07 +0000 Subject: libosmo-netif[master]: cosmetic: relax UDP length check In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I32e5fcbf5ed92cc923660ac59e6a37fd3f0703a7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 18:52:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 18:52:38 +0000 Subject: libosmo-netif[master]: examples: add simple UDP client/server In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4257 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I08c0adf1cf9b6a6f1f7090b237d0497c2ec13cdf Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 18:53:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 18:53:55 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 13 18:54:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 18:54:30 +0000 Subject: [MERGED] libosmo-netif[master]: examples: add simple UDP client/server In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: examples: add simple UDP client/server ...................................................................... examples: add simple UDP client/server In addition to showing basic UDP send/receive example, it helps to test corner-case when dealing with 0-length UDP packets. Change-Id: I08c0adf1cf9b6a6f1f7090b237d0497c2ec13cdf Related: OS#2219 --- M .gitignore M examples/Makefile.am A examples/udp-test-client.c A examples/udp-test-server.c A examples/udp-test.h 5 files changed, 227 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 2d582bd..4ee9929 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,5 @@ examples/stream-server Doxyfile +/examples/udp-test-client +/examples/udp-test-server diff --git a/examples/Makefile.am b/examples/Makefile.am index ddfaa48..df13808 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -14,8 +14,12 @@ rs232-write \ rtp-udp-test-client \ rtp-udp-test-server \ + udp-test-client \ + udp-test-server \ osmux-test-input \ osmux-test-output + +noinst_HEADERS = udp-test.h ipa_stream_client_SOURCES = ipa-stream-client.c ipa_stream_client_LDADD = $(top_builddir)/src/libosmonetif.la \ @@ -57,6 +61,12 @@ rtp_udp_test_server_LDADD = $(top_builddir)/src/libosmonetif.la \ $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) +udp_test_client_SOURCES = udp-test-client.c +udp_test_client_LDADD = $(top_builddir)/src/libosmonetif.la $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + +udp_test_server_SOURCES = udp-test-server.c +udp_test_server_LDADD = $(top_builddir)/src/libosmonetif.la $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + osmux_test_input_SOURCES = osmux-test-input.c osmux_test_input_LDADD = $(top_builddir)/src/libosmonetif.la \ $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) diff --git a/examples/udp-test-client.c b/examples/udp-test-client.c new file mode 100644 index 0000000..efd746b --- /dev/null +++ b/examples/udp-test-client.c @@ -0,0 +1,43 @@ +#include "udp-test.h" + +static int read_cb(struct osmo_dgram *conn) +{ + struct msgb *msg = print_recv(conn); + if (!msg) + return -1; + + if (msgb_length(msg)) + if (msgb_data(msg)[0] >= NUM_MSG - 1) + please_dont_die = false; /* end test: */ + + msgb_free(msg); + + return 0; +} + +int main(int argc, char **argv) +{ + uint8_t i; + + if (!dgram_init(THOST, CPORT, SPORT, read_cb)) + exit(EXIT_FAILURE); + + for(i = 0; i < NUM_MSG + 1; i++) { + /* N. B: moving this alocation outside of the loop will result in segfault */ + struct msgb *msg = msgb_alloc(MAX_MSG, "UDP/client"); + if (!msg) { + LOGP(DUDP_TEST, LOGL_ERROR, "cann't allocate message\n"); + return EXIT_FAILURE; + } + + if (!mtrim(msg, i, i)) + return EXIT_FAILURE; + + LOGP(DUDP_TEST, LOGL_NOTICE, "queue [%u] %s\n", msgb_length(msg), msgb_hexdump(msg)); + osmo_dgram_send(conn, msg); + } + + main_loop(THOST, CPORT, SPORT); + + return 0; +} diff --git a/examples/udp-test-server.c b/examples/udp-test-server.c new file mode 100644 index 0000000..444843a --- /dev/null +++ b/examples/udp-test-server.c @@ -0,0 +1,35 @@ +#include "udp-test.h" + +int read_cb(struct osmo_dgram *conn) +{ + int bytes; + struct msgb *msg = print_recv(conn); + + if (!msg) + return -1; + + /* build reply: */ + bytes = msgb_length(msg); + + if (!mtrim(msg, 0, bytes)) + return -1; + + /* sent reply: */ + osmo_dgram_send(conn, msg); + + /* end test: */ + if (bytes > NUM_MSG - 1) + please_dont_die = false; + + return 0; +} + +int main(int argc, char **argv) +{ + if (!dgram_init(THOST, SPORT, CPORT, read_cb)) + return EXIT_FAILURE; + + main_loop(THOST, SPORT, CPORT); + + return 0; +} diff --git a/examples/udp-test.h b/examples/udp-test.h new file mode 100644 index 0000000..14bbd91 --- /dev/null +++ b/examples/udp-test.h @@ -0,0 +1,137 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#define MAX_MSG 255 +#define NUM_MSG 11 +#define DUDP_TEST 0 +#define THOST "127.0.0.1" +#define SPORT 15000 +#define CPORT 15001 + +static struct osmo_dgram *conn; +static void *tall_test; +bool please_dont_die = true; + +static void sighandler(int foo) +{ + LOGP(DLINP, LOGL_NOTICE, "closing UDP test...\n"); + osmo_dgram_close(conn); + osmo_dgram_destroy(conn); + please_dont_die = false; +} + +static inline struct msgb *print_recv(struct osmo_dgram *conn) +{ + struct msgb *msg = msgb_alloc(MAX_MSG, "UDP/test"); + int bytes; + + LOGP(DUDP_TEST, LOGL_NOTICE, "received datagram: "); + + if (!msg) { + LOGPC(DUDP_TEST, LOGL_ERROR, "can't allocate message\n"); + return NULL; + } + + /* receive message: */ + bytes = osmo_dgram_recv(conn, msg); + if (bytes < 0) { + LOGPC(DUDP_TEST, LOGL_ERROR, "can't receive message: %u\n", -bytes); + msgb_free(msg); + return NULL; + } + + /* process message: */ + LOGPC(DUDP_TEST, LOGL_NOTICE, "[%u] %s\n", bytes, msgb_hexdump(msg)); + + return msg; +} + +static inline bool dgram_init(const char *host, uint16_t lport, uint16_t rport, void *read_cb) +{ + const struct log_info_cat udp_test_cat[] = { + [DUDP_TEST] = { + .name = "DUDP_TEST", + .description = "UDP test", + .color = "\033[1;35m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + }; + + const struct log_info udp_test_log_info = { + .filter_fn = NULL, + .cat = udp_test_cat, + .num_cat = ARRAY_SIZE(udp_test_cat), + }; + + signal(SIGINT, sighandler); + + tall_test = talloc_named_const(NULL, 1, "udp_test"); + + osmo_init_logging(&udp_test_log_info); + log_set_log_level(osmo_stderr_target, LOGL_NOTICE); + + conn = osmo_dgram_create(tall_test); + if (!conn) { + LOGP(DUDP_TEST, LOGL_ERROR, "cannot create UDP socket\n"); + return false; + } + + osmo_dgram_set_local_addr(conn, host); + osmo_dgram_set_local_port(conn, lport); + osmo_dgram_set_remote_addr(conn, host); + osmo_dgram_set_remote_port(conn, rport); + osmo_dgram_set_read_cb(conn, read_cb); + + if (osmo_dgram_open(conn) < 0) { + LOGP(DUDP_TEST, LOGL_ERROR, "cannot open client connection %s:%u -> %s:%u\n", host, lport, host, rport); + return false; + } + + return true; +} + +static inline void main_loop(const char *host, uint16_t lport, uint16_t rport) +{ + LOGP(DUDP_TEST, LOGL_NOTICE, "Entering main loop: %s:%u -> %s:%u\n", host, lport, host, rport); + + while(please_dont_die) + osmo_select_main(0); +} + +/* Smart message trimmer: + * for all positive i trims msg to i - 1 + * for i = 0 trims msg to 0 + * for all positive x adds x to msg +*/ +/*! Smart message trimmer. + * \param[in] msg message buffer + * \param[in] i trim value: for all positive i, msg is trimmed to i - 1, otherwise msg is trimmed to 0 + * \param[in] x message content: for all positive x, x is added to msg, otherwise it's ignored + */ +static inline bool mtrim(struct msgb *msg, uint8_t i, uint8_t x) +{ + if (msgb_trim(msg, i ? i - 1 : i) != 0) { + LOGP(DLINP, LOGL_ERROR, "failed to trim message by %u\n", i); + return false; + } + + if (x) + msgb_put_u8(msg, x); + + return true; +} -- To view, visit https://gerrit.osmocom.org/4257 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I08c0adf1cf9b6a6f1f7090b237d0497c2ec13cdf Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 18:54:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 18:54:30 +0000 Subject: [MERGED] libosmo-netif[master]: cosmetic: relax UDP length check In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: relax UDP length check ...................................................................... cosmetic: relax UDP length check Previously recv() returning 0 for UDP socket was considered as error although it's legitimate return value for empty UDP packets. Relax the error check to avoid confusing error messages. The function behavior is the same: * msg is not altered while receiving 0-length UDP packet * return value is 0 The only result of the relaxed error check is the absense of error log message for 0-length UDP packet. Change-Id: I32e5fcbf5ed92cc923660ac59e6a37fd3f0703a7 Fixes: OS#2219 --- M src/datagram.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/datagram.c b/src/datagram.c index c2c84e0..10204e2 100644 --- a/src/datagram.c +++ b/src/datagram.c @@ -236,14 +236,14 @@ /*! \brief Receive data via Osmocom datagram receiver * \param[in] conn Datagram Receiver from which to receive * \param msg pre-allocate message buffer to which received data is appended - * \returns number of bytes read, negative on error. */ + * \returns number of bytes read (might be 0 for empty UDP packet), negative on error. */ int osmo_dgram_rx_recv(struct osmo_dgram_rx *conn, struct msgb *msg) { int ret; ret = recv(conn->ofd.fd, msg->data, msg->data_len, 0); - if (ret <= 0) { + if (ret < 0) { LOGP(DLINP, LOGL_ERROR, "error receiving data from tx\n"); return ret; } -- To view, visit https://gerrit.osmocom.org/4258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I32e5fcbf5ed92cc923660ac59e6a37fd3f0703a7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 18:54:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Oct 2017 18:54:30 +0000 Subject: [MERGED] libosmo-netif[master]: cosmetic: print textual error from recv() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: print textual error from recv() ...................................................................... cosmetic: print textual error from recv() Change-Id: Ic9557c6519b44b5985daf7d2d14ec063790441fb --- M src/datagram.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/datagram.c b/src/datagram.c index 10204e2..ea31cd1 100644 --- a/src/datagram.c +++ b/src/datagram.c @@ -244,7 +244,7 @@ ret = recv(conn->ofd.fd, msg->data, msg->data_len, 0); if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "error receiving data from tx\n"); + LOGP(DLINP, LOGL_ERROR, "error receiving data from tx: %s\n", strerror(errno)); return ret; } msgb_put(msg, ret); -- To view, visit https://gerrit.osmocom.org/4259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic9557c6519b44b5985daf7d2d14ec063790441fb Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 13 19:31:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 13 Oct 2017 19:31:04 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 > doxygen simply ignores example configs. Please clarify, why exactly are you moving the example file around? What happens if you don't, and are there alternatives to moving? -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:34:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:34:26 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: GGSN: Document how 'ip tuntap' is used for non-root; call ne... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4233 to look at the new patch set (#3). GGSN: Document how 'ip tuntap' is used for non-root; call netdev 'apn0' * Some people want to manually create/configure their tun devices, show them how to do this using ip with the correct parameters * Let's not call the network device 'ggsn' but rather 'apn0', as the device has a 1:1 correspondence to the APN, not to the GGSN. Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def --- M OsmoGGSN/chapters/configuration.adoc 1 file changed, 44 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/33/4233/3 diff --git a/OsmoGGSN/chapters/configuration.adoc b/OsmoGGSN/chapters/configuration.adoc index 9e07fb6..9a4c81b 100644 --- a/OsmoGGSN/chapters/configuration.adoc +++ b/OsmoGGSN/chapters/configuration.adoc @@ -246,26 +246,62 @@ It's possible to run OsmoGGSN without root privileges if the tun devices are already configured. -.Example: device config via systemd-networkd using ggsn.netdev +The interface creation + configuration must then happen before osmo-ggsn starting up. This can be +achieved by means such as + +* a custom shell script run as root before starting osmo-ggsn (e.g. as init script) +* systemd .netdev and .network files + +==== Manual TUN device creation / configuration + +If you chose to go for custom shell/init scripts, you may use the `ip` program which is the standard +tool for network interface configuration on Linux, part of the `iproute2` package. In order to +create a tun device, you must call it like this: + +.Example: iproute2 command to create a tun device +---- +# ip tuntap add dev apn0 mode tun user username group groupname +---- + +Where _username_ and _groupname_ correspond to the User and Group that will have ownership over the +device, i.e. the privileges which you intend to run osmo-ggsn under, and _apn0_ will be the +name of the network device created. After creating the interface, you can configure its addresses +using standard means like `ip addr add` or your distribution-specific utilities/tools. + + +==== systemd based TUN device creation+configuration + +If you want to have systemd take care of creating and configuring a tun device for you, +you can use the below example config files. + +.Example: device config via systemd-networkd using apn0.netdev ---- [NetDev] -Name=ggsn +Name=apn0 <1> Kind=tun [Tun] -User=username -Group=username +User=username <2> +Group=username <3> ---- +<1> The network interface name of the newly-created device +<2> The username under which you will run OsmoGGSN +<3> The group name under which you will run OsmoGGSN .Example: network settings via systemd-networkd using ggsn.network ---- [Match] -Name=ggsn +Name=apn0 <1> [Network] -Address=192.168.7.1 -IPMasquerade=yes +Address=192.168.7.1 <2> +IPMasquerade=yes <3> ---- +<1> The netowrk device name, which must match the one in the apn0.netdev unit file above +<2> The local IP address configured on the device +<3> Requesting systemd to configure IP masquerading for this interface. Depending on your needs, + You may not want this if you have proper end-to-end routing set up, and want to have transparent + inbound IP access to your GPRS-attached devices. The pair of the configuration files above allows you to create and configure tun device which can be used by OsmoGGSN as follows. @@ -277,7 +313,7 @@ gtp bind-ip 127.0.0.6 apn internet gtpu-mode tun - tun-device ggsn + tun-device apn0 type-support v4 ip prefix dynamic 192.168.7.0/24 ip dns 0 192.168.100.1 -- To view, visit https://gerrit.osmocom.org/4233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:35:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:35:15 +0000 Subject: osmo-gsm-manuals[master]: GGSN: Document how 'ip tuntap' is used for non-root; call ne... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/4233/2/OsmoGGSN/chapters/configuration.adoc File OsmoGGSN/chapters/configuration.adoc: Line 304: inbound IP access to your GPRS-attached devices. > Interesting, never used GGSN without NAT. Do we have example configuration Having an IP network with routed addresses is the most normal thing on the planet. NAT is only needed if you do not have routing in place due to insufficient addresses/networks. -- To view, visit https://gerrit.osmocom.org/4233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:36:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:36:23 +0000 Subject: osmo-gsm-manuals[master]: GGSN: Document how 'ip tuntap' is used for non-root; call ne... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:36:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:36:26 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: GGSN: Document how 'ip tuntap' is used for non-root; call ne... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GGSN: Document how 'ip tuntap' is used for non-root; call netdev 'apn0' ...................................................................... GGSN: Document how 'ip tuntap' is used for non-root; call netdev 'apn0' * Some people want to manually create/configure their tun devices, show them how to do this using ip with the correct parameters * Let's not call the network device 'ggsn' but rather 'apn0', as the device has a 1:1 correspondence to the APN, not to the GGSN. Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def --- M OsmoGGSN/chapters/configuration.adoc 1 file changed, 44 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoGGSN/chapters/configuration.adoc b/OsmoGGSN/chapters/configuration.adoc index 9e07fb6..9a4c81b 100644 --- a/OsmoGGSN/chapters/configuration.adoc +++ b/OsmoGGSN/chapters/configuration.adoc @@ -246,26 +246,62 @@ It's possible to run OsmoGGSN without root privileges if the tun devices are already configured. -.Example: device config via systemd-networkd using ggsn.netdev +The interface creation + configuration must then happen before osmo-ggsn starting up. This can be +achieved by means such as + +* a custom shell script run as root before starting osmo-ggsn (e.g. as init script) +* systemd .netdev and .network files + +==== Manual TUN device creation / configuration + +If you chose to go for custom shell/init scripts, you may use the `ip` program which is the standard +tool for network interface configuration on Linux, part of the `iproute2` package. In order to +create a tun device, you must call it like this: + +.Example: iproute2 command to create a tun device +---- +# ip tuntap add dev apn0 mode tun user username group groupname +---- + +Where _username_ and _groupname_ correspond to the User and Group that will have ownership over the +device, i.e. the privileges which you intend to run osmo-ggsn under, and _apn0_ will be the +name of the network device created. After creating the interface, you can configure its addresses +using standard means like `ip addr add` or your distribution-specific utilities/tools. + + +==== systemd based TUN device creation+configuration + +If you want to have systemd take care of creating and configuring a tun device for you, +you can use the below example config files. + +.Example: device config via systemd-networkd using apn0.netdev ---- [NetDev] -Name=ggsn +Name=apn0 <1> Kind=tun [Tun] -User=username -Group=username +User=username <2> +Group=username <3> ---- +<1> The network interface name of the newly-created device +<2> The username under which you will run OsmoGGSN +<3> The group name under which you will run OsmoGGSN .Example: network settings via systemd-networkd using ggsn.network ---- [Match] -Name=ggsn +Name=apn0 <1> [Network] -Address=192.168.7.1 -IPMasquerade=yes +Address=192.168.7.1 <2> +IPMasquerade=yes <3> ---- +<1> The netowrk device name, which must match the one in the apn0.netdev unit file above +<2> The local IP address configured on the device +<3> Requesting systemd to configure IP masquerading for this interface. Depending on your needs, + You may not want this if you have proper end-to-end routing set up, and want to have transparent + inbound IP access to your GPRS-attached devices. The pair of the configuration files above allows you to create and configure tun device which can be used by OsmoGGSN as follows. @@ -277,7 +313,7 @@ gtp bind-ip 127.0.0.6 apn internet gtpu-mode tun - tun-device ggsn + tun-device apn0 type-support v4 ip prefix dynamic 192.168.7.0/24 ip dns 0 192.168.100.1 -- To view, visit https://gerrit.osmocom.org/4233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:36:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:36:53 +0000 Subject: osmo-mgw[master]: mgcp: remove unnecessary include In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:39:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:39:49 +0000 Subject: osmo-ci[master]: coverity: build with --enable-trx In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0684bc04b82ad57a1513bbd4627144d6c254b965 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:39:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:39:51 +0000 Subject: osmo-ci[master]: coverity: build with --enable-trx In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0684bc04b82ad57a1513bbd4627144d6c254b965 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:39:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:39:54 +0000 Subject: [MERGED] osmo-ci[master]: coverity: build with --enable-trx In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: coverity: build with --enable-trx ...................................................................... coverity: build with --enable-trx Change-Id: I0684bc04b82ad57a1513bbd4627144d6c254b965 --- M coverity/build_Osmocom.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 3cb0c84..81a346d 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -53,7 +53,7 @@ build_osmobts() { pushd osmo-bts - do_build --enable-sysmocom-bts + do_build --enable-sysmocom-bts --enable-trx popd } -- To view, visit https://gerrit.osmocom.org/4211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0684bc04b82ad57a1513bbd4627144d6c254b965 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:59:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:59:28 +0000 Subject: [PATCH] osmo-ggsn[master]: Allow Common flags 0x94 and ignore them in PDP activation Message-ID: Review at https://gerrit.osmocom.org/4262 Allow Common flags 0x94 and ignore them in PDP activation extended from https://github.com/osmocom/openggsn/pull/2 Change-Id: I31b3e4b378e74bb5a0a2f54af6d2a15b629876cf --- M gtp/gtpie.c M gtp/gtpie.h 2 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/62/4262/1 diff --git a/gtp/gtpie.c b/gtp/gtpie.c index 6ffa184..68422f0 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -491,6 +491,7 @@ case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: case GTPIE_CHARGING_ADDR: + case GTPIE_COMMON_FLAGS: case GTPIE_RAT_TYPE: case GTPIE_USER_LOC: case GTPIE_MS_TZ: @@ -616,6 +617,7 @@ case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: case GTPIE_CHARGING_ADDR: + case GTPIE_COMMON_FLAGS: case GTPIE_PRIVATE: iesize = 3 + hton16(ie[i]->tlv.l); break; @@ -722,6 +724,7 @@ case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: case GTPIE_CHARGING_ADDR: + case GTPIE_COMMON_FLAGS: case GTPIE_PRIVATE: iesize = 3 + hton16(ie[i].tlv.l); break; diff --git a/gtp/gtpie.h b/gtp/gtpie.h index 754382e..8ea19ea 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -104,6 +104,7 @@ #define GTPIE_EXT_HEADER_T 141 /* Extension Header Type List */ #define GTPIE_TRIGGER_ID 142 /* Trigger Id */ #define GTPIE_OMC_ID 143 /* OMC Identity */ +#define GTPIE_COMMON_FLAGS 148 /* Common Flags */ #define GTPIE_RAT_TYPE 151 /* Radio Access Technology Type */ #define GTPIE_USER_LOC 152 /* User Location Information */ #define GTPIE_MS_TZ 153 /* MS Time Zone */ -- To view, visit https://gerrit.osmocom.org/4262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I31b3e4b378e74bb5a0a2f54af6d2a15b629876cf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:59:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:59:35 +0000 Subject: [PATCH] osmo-ggsn[master]: gtpie.h: Add IE identifier definitions up to 29.60 v11.8.0 R... Message-ID: Review at https://gerrit.osmocom.org/4263 gtpie.h: Add IE identifier definitions up to 29.60 v11.8.0 Release 11 Change-Id: I6ab7bfb31f93f52f9f6b1b5880dcb2c232bba794 --- M gtp/gtpie.c M gtp/gtpie.h 2 files changed, 275 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/63/4263/1 diff --git a/gtp/gtpie.c b/gtp/gtpie.c index 68422f0..c4eabf8 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -490,12 +490,76 @@ case GTPIE_RAB_SETUP: case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: - case GTPIE_CHARGING_ADDR: + case GTPIE_RAN_T_CONTAIN: + case GTPIE_PDP_CTX_PRIO: + case GTPIE_ADDL_RAB_S_I: + case GTPIE_SGSN_NUMBER: case GTPIE_COMMON_FLAGS: + case GTPIE_APN_RESTR: + case GTPIE_R_PRIO_LCS: case GTPIE_RAT_TYPE: case GTPIE_USER_LOC: case GTPIE_MS_TZ: case GTPIE_IMEI_SV: + case GTPIE_CML_CHG_I_CT: + case GTPIE_MBMS_UE_CTX: + case GTPIE_TMGI: + case GTPIE_RIM_ROUT_ADDR: + case GTPIE_MBMS_PCO: + case GTPIE_MBMS_SA: + case GTPIE_SRNC_PDCP_CTX: + case GTPIE_ADDL_TRACE: + case GTPIE_HOP_CTR: + case GTPIE_SEL_PLMN_ID: + case GTPIE_MBMS_SESS_ID: + case GTPIE_MBMS_2_3G_IND: + case GTPIE_ENH_NSAPI: + case GTPIE_MBMS_SESS_DUR: + case GTPIE_A_MBMS_TRAC_I: + case GTPIE_MBMS_S_REP_N: + case GTPIE_MBMS_TTDT: + case GTPIE_PS_HO_REQ_CTX: + case GTPIE_BSS_CONTAINER: + case GTPIE_CELL_ID: + case GTPIE_PDU_NUMBERS: + case GTPIE_BSSGP_CAUSE: + case GTPIE_RQD_MBMS_BCAP: + case GTPIE_RIM_RA_DISCR: + case GTPIE_L_SETUP_PFCS: + case GTPIE_PS_HO_XID_PAR: + case GTPIE_MS_CHG_REP_A: + case GTPIE_DIR_TUN_FLAGS: + case GTPIE_CORREL_ID: + case GTPIE_MBMS_FLOWI: + case GTPIE_MBMS_MC_DIST: + case GTPIE_MBMS_DIST_ACK: + case GTPIE_R_IRAT_HO_INF: + case GTPIE_RFSP_IDX: + case GTPIE_FQDN: + case GTPIE_E_ALL_PRIO_1: + case GTPIE_E_ALL_PRIO_2: + case GTPIE_E_CMN_FLAGS: + case GTPIE_U_CSG_INFO: + case GTPIE_CSG_I_REP_ACT: + case GTPIE_CSG_ID: + case GTPIE_CSG_MEMB_IND: + case GTPIE_AMBR: + case GTPIE_UE_NET_CAPA: + case GTPIE_UE_AMBR: + case GTPIE_APN_AMBR_NS: + case GTPIE_GGSN_BACKOFF: + case GTPIE_S_PRIO_IND: + case GTPIE_S_PRIO_IND_NS: + case GTPIE_H_BR_16MBPS_F: + case GTPIE_A_MMCTX_SRVCC: + case GTPIE_A_FLAGS_SRVCC: + case GTPIE_STN_SR: + case GTPIE_C_MSISDN: + case GTPIE_E_RANAP_CAUSE: + case GTPIE_ENODEB_ID: + case GTPIE_SEL_MODE_NS: + case GTPIE_ULI_TIMESTAMP: + case GTPIE_CHARGING_ADDR: case GTPIE_PRIVATE: if (j < GTPIE_SIZE) { ie[j] = (union gtpie_member *)p; @@ -616,8 +680,76 @@ case GTPIE_RAB_SETUP: case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: - case GTPIE_CHARGING_ADDR: + case GTPIE_RAN_T_CONTAIN: + case GTPIE_PDP_CTX_PRIO: + case GTPIE_ADDL_RAB_S_I: + case GTPIE_SGSN_NUMBER: case GTPIE_COMMON_FLAGS: + case GTPIE_APN_RESTR: + case GTPIE_R_PRIO_LCS: + case GTPIE_RAT_TYPE: + case GTPIE_USER_LOC: + case GTPIE_MS_TZ: + case GTPIE_IMEI_SV: + case GTPIE_CML_CHG_I_CT: + case GTPIE_MBMS_UE_CTX: + case GTPIE_TMGI: + case GTPIE_RIM_ROUT_ADDR: + case GTPIE_MBMS_PCO: + case GTPIE_MBMS_SA: + case GTPIE_SRNC_PDCP_CTX: + case GTPIE_ADDL_TRACE: + case GTPIE_HOP_CTR: + case GTPIE_SEL_PLMN_ID: + case GTPIE_MBMS_SESS_ID: + case GTPIE_MBMS_2_3G_IND: + case GTPIE_ENH_NSAPI: + case GTPIE_MBMS_SESS_DUR: + case GTPIE_A_MBMS_TRAC_I: + case GTPIE_MBMS_S_REP_N: + case GTPIE_MBMS_TTDT: + case GTPIE_PS_HO_REQ_CTX: + case GTPIE_BSS_CONTAINER: + case GTPIE_CELL_ID: + case GTPIE_PDU_NUMBERS: + case GTPIE_BSSGP_CAUSE: + case GTPIE_RQD_MBMS_BCAP: + case GTPIE_RIM_RA_DISCR: + case GTPIE_L_SETUP_PFCS: + case GTPIE_PS_HO_XID_PAR: + case GTPIE_MS_CHG_REP_A: + case GTPIE_DIR_TUN_FLAGS: + case GTPIE_CORREL_ID: + case GTPIE_MBMS_FLOWI: + case GTPIE_MBMS_MC_DIST: + case GTPIE_MBMS_DIST_ACK: + case GTPIE_R_IRAT_HO_INF: + case GTPIE_RFSP_IDX: + case GTPIE_FQDN: + case GTPIE_E_ALL_PRIO_1: + case GTPIE_E_ALL_PRIO_2: + case GTPIE_E_CMN_FLAGS: + case GTPIE_U_CSG_INFO: + case GTPIE_CSG_I_REP_ACT: + case GTPIE_CSG_ID: + case GTPIE_CSG_MEMB_IND: + case GTPIE_AMBR: + case GTPIE_UE_NET_CAPA: + case GTPIE_UE_AMBR: + case GTPIE_APN_AMBR_NS: + case GTPIE_GGSN_BACKOFF: + case GTPIE_S_PRIO_IND: + case GTPIE_S_PRIO_IND_NS: + case GTPIE_H_BR_16MBPS_F: + case GTPIE_A_MMCTX_SRVCC: + case GTPIE_A_FLAGS_SRVCC: + case GTPIE_STN_SR: + case GTPIE_C_MSISDN: + case GTPIE_E_RANAP_CAUSE: + case GTPIE_ENODEB_ID: + case GTPIE_SEL_MODE_NS: + case GTPIE_ULI_TIMESTAMP: + case GTPIE_CHARGING_ADDR: case GTPIE_PRIVATE: iesize = 3 + hton16(ie[i]->tlv.l); break; @@ -689,6 +821,7 @@ case GTPIE_P_TMSI: case GTPIE_TEI_DI: case GTPIE_TEI_C: + case GTPIE_CHARGING_ID: iesize = 5; break; case GTPIE_TEI_DII: /* TV GTPIE types with value length 5 */ @@ -707,8 +840,7 @@ case GTPIE_EXT_HEADER_T: /* GTP extension header */ iesize = 2 + hton8(ie[i].ext.l); break; - case GTPIE_CHARGING_ID: /* TLV GTPIE types with length length 2 */ - case GTPIE_EUA: + case GTPIE_EUA: /* TLV GTPIE types with length length 2 */ case GTPIE_MM_CONTEXT: case GTPIE_PDP_CONTEXT: case GTPIE_APN: @@ -723,8 +855,76 @@ case GTPIE_RAB_SETUP: case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: - case GTPIE_CHARGING_ADDR: + case GTPIE_RAN_T_CONTAIN: + case GTPIE_PDP_CTX_PRIO: + case GTPIE_ADDL_RAB_S_I: + case GTPIE_SGSN_NUMBER: case GTPIE_COMMON_FLAGS: + case GTPIE_APN_RESTR: + case GTPIE_R_PRIO_LCS: + case GTPIE_RAT_TYPE: + case GTPIE_USER_LOC: + case GTPIE_MS_TZ: + case GTPIE_IMEI_SV: + case GTPIE_CML_CHG_I_CT: + case GTPIE_MBMS_UE_CTX: + case GTPIE_TMGI: + case GTPIE_RIM_ROUT_ADDR: + case GTPIE_MBMS_PCO: + case GTPIE_MBMS_SA: + case GTPIE_SRNC_PDCP_CTX: + case GTPIE_ADDL_TRACE: + case GTPIE_HOP_CTR: + case GTPIE_SEL_PLMN_ID: + case GTPIE_MBMS_SESS_ID: + case GTPIE_MBMS_2_3G_IND: + case GTPIE_ENH_NSAPI: + case GTPIE_MBMS_SESS_DUR: + case GTPIE_A_MBMS_TRAC_I: + case GTPIE_MBMS_S_REP_N: + case GTPIE_MBMS_TTDT: + case GTPIE_PS_HO_REQ_CTX: + case GTPIE_BSS_CONTAINER: + case GTPIE_CELL_ID: + case GTPIE_PDU_NUMBERS: + case GTPIE_BSSGP_CAUSE: + case GTPIE_RQD_MBMS_BCAP: + case GTPIE_RIM_RA_DISCR: + case GTPIE_L_SETUP_PFCS: + case GTPIE_PS_HO_XID_PAR: + case GTPIE_MS_CHG_REP_A: + case GTPIE_DIR_TUN_FLAGS: + case GTPIE_CORREL_ID: + case GTPIE_MBMS_FLOWI: + case GTPIE_MBMS_MC_DIST: + case GTPIE_MBMS_DIST_ACK: + case GTPIE_R_IRAT_HO_INF: + case GTPIE_RFSP_IDX: + case GTPIE_FQDN: + case GTPIE_E_ALL_PRIO_1: + case GTPIE_E_ALL_PRIO_2: + case GTPIE_E_CMN_FLAGS: + case GTPIE_U_CSG_INFO: + case GTPIE_CSG_I_REP_ACT: + case GTPIE_CSG_ID: + case GTPIE_CSG_MEMB_IND: + case GTPIE_AMBR: + case GTPIE_UE_NET_CAPA: + case GTPIE_UE_AMBR: + case GTPIE_APN_AMBR_NS: + case GTPIE_GGSN_BACKOFF: + case GTPIE_S_PRIO_IND: + case GTPIE_S_PRIO_IND_NS: + case GTPIE_H_BR_16MBPS_F: + case GTPIE_A_MMCTX_SRVCC: + case GTPIE_A_FLAGS_SRVCC: + case GTPIE_STN_SR: + case GTPIE_C_MSISDN: + case GTPIE_E_RANAP_CAUSE: + case GTPIE_ENODEB_ID: + case GTPIE_SEL_MODE_NS: + case GTPIE_ULI_TIMESTAMP: + case GTPIE_CHARGING_ADDR: case GTPIE_PRIVATE: iesize = 3 + hton16(ie[i].tlv.l); break; diff --git a/gtp/gtpie.h b/gtp/gtpie.h index 8ea19ea..b6fea6e 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -50,7 +50,7 @@ #define GTPIE_DEBUG 0 /* Print debug information */ -/* GTP Information elements from 29.060 v3.9.0 7.7 Information Elements */ +/* GTP Information elements from 29.060 v11.8.0 7.7 Information Elements */ /* Also covers version 0. Note that version 0 6: QOS Profile was superceded * * by 135: QOS Profile in version 1 */ @@ -86,7 +86,7 @@ #define GTPIE_TRACE_TYPE 28 /* Trace Type 2 */ #define GTPIE_MS_NOT_REACH 29 /* MS Not Reachable Reason 1 */ /* 30-116 UNUSED */ -/* 117-126 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15) */ +/* 117-126 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15 / 32.295) */ #define GTPIE_CHARGING_ID 127 /* Charging ID 4 */ #define GTPIE_EUA 128 /* End User Address */ #define GTPIE_MM_CONTEXT 129 /* MM Context */ @@ -104,15 +104,81 @@ #define GTPIE_EXT_HEADER_T 141 /* Extension Header Type List */ #define GTPIE_TRIGGER_ID 142 /* Trigger Id */ #define GTPIE_OMC_ID 143 /* OMC Identity */ +#define GTPIE_RAN_T_CONTAIN 144 /* RAN Transparent Container */ +#define GTPIE_PDP_CTX_PRIO 145 /* PDP Context Prioritization */ +#define GTPIE_ADDL_RAB_S_I 146 /* Additional RAB Setup Information */ +#define GTPIE_SGSN_NUMBER 147 /* SGSN Number */ #define GTPIE_COMMON_FLAGS 148 /* Common Flags */ +#define GTPIE_APN_RESTR 149 /* APN Restriction */ +#define GTPIE_R_PRIO_LCS 150 /* Radio Priority LCS */ #define GTPIE_RAT_TYPE 151 /* Radio Access Technology Type */ #define GTPIE_USER_LOC 152 /* User Location Information */ #define GTPIE_MS_TZ 153 /* MS Time Zone */ #define GTPIE_IMEI_SV 154 /* IMEI Software Version */ +#define GTPIE_CML_CHG_I_CT 155 /* CAMEL Charging Information Container */ +#define GTPIE_MBMS_UE_CTX 156 /* MSMS UE Context */ +#define GTPIE_TMGI 157 /* Temporary Mobile Group Identity (TMGI) */ +#define GTPIE_RIM_ROUT_ADDR 158 /* RIM Routing Address */ +#define GTPIE_MBMS_PCO 159 /* MBMS Protocol Configuratin Options */ +#define GTPIE_MBMS_SA 160 /* MBMS Service Area */ +#define GTPIE_SRNC_PDCP_CTX 161 /* Source RNC PDCP Context Info */ +#define GTPIE_ADDL_TRACE 162 /* Additional Trace Info */ +#define GTPIE_HOP_CTR 163 /* Hop Counter */ +#define GTPIE_SEL_PLMN_ID 164 /* Selected PLMN ID */ +#define GTPIE_MBMS_SESS_ID 165 /* MBMS Session Identifier */ +#define GTPIE_MBMS_2_3G_IND 166 /* MBMS 2G/3G Indicator */ +#define GTPIE_ENH_NSAPI 167 /* Enhanced NSAPI */ +#define GTPIE_MBMS_SESS_DUR 168 /* MBMS Session Duration */ +#define GTPIE_A_MBMS_TRAC_I 169 /* Additional MBMS Trace Info */ +#define GTPIE_MBMS_S_REP_N 170 /* MBMS Session Repetition Number */ +#define GTPIE_MBMS_TTDT 171 /* MBMS Time To Data Transfer */ +#define GTPIE_PS_HO_REQ_CTX 172 /* PS Handover Request Context */ +#define GTPIE_BSS_CONTAINER 173 /* BSS Container */ +#define GTPIE_CELL_ID 174 /* Cell Identification */ +#define GTPIE_PDU_NUMBERS 175 /* PDU Numbers */ +#define GTPIE_BSSGP_CAUSE 176 /* BSSGP Cause */ +#define GTPIE_RQD_MBMS_BCAP 177 /* Required MBMS Bearer Capabilities */ +#define GTPIE_RIM_RA_DISCR 178 /* RIM Routing Address Discriminator */ +#define GTPIE_L_SETUP_PFCS 179 /* List of set-up PFCs */ +#define GTPIE_PS_HO_XID_PAR 180 /* PS Handover XID Parameters */ +#define GTPIE_MS_CHG_REP_A 181 /* MS Info Change Reporting Action */ +#define GTPIE_DIR_TUN_FLAGS 182 /* Direct Tunnel Flags */ +#define GTPIE_CORREL_ID 183 /* Correlation-ID */ #define GTPIE_BCM 184 /* Bearer control mode */ -/* 239-250 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15) */ +#define GTPIE_MBMS_FLOWI 185 /* MBMS Flow Identifier */ +#define GTPIE_MBMS_MC_DIST 186 /* MBMS IP Multicast Distribution */ +#define GTPIE_MBMS_DIST_ACK 187 /* MBMS Distribution Acknowledgement */ +#define GTPIE_R_IRAT_HO_INF 188 /* Reliable INTER RAT HANDOVER INFO */ +#define GTPIE_RFSP_IDX 189 /* RFSP Index */ +#define GTPIE_FQDN 190 /* FQDN */ +#define GTPIE_E_ALL_PRIO_1 191 /* Evolvd Allocation/Retention Priority I */ +#define GTPIE_E_ALL_PRIO_2 192 /* Evolvd Allocation/Retention Priority II */ +#define GTPIE_E_CMN_FLAGS 193 /* Extended Common Flags */ +#define GTPIE_U_CSG_INFO 194 /* User CSG Information (UCI) */ +#define GTPIE_CSG_I_REP_ACT 195 /* CSG Information Reporting Action */ +#define GTPIE_CSG_ID 196 /* CSG ID */ +#define GTPIE_CSG_MEMB_IND 197 /* CSG Membership Indication (CMI) */ +#define GTPIE_AMBR 198 /* Aggregate Maximum Bit Rate (AMBR) */ +#define GTPIE_UE_NET_CAPA 199 /* UE Network Capability */ +#define GTPIE_UE_AMBR 200 /* UE-AMBR */ +#define GTPIE_APN_AMBR_NS 201 /* APN-AMBR with NSAPI */ +#define GTPIE_GGSN_BACKOFF 202 /* GGSN Back-Off Time */ +#define GTPIE_S_PRIO_IND 203 /* Signalling Priority Indication */ +#define GTPIE_S_PRIO_IND_NS 204 /* Signalling Priority Indication with NSAPI */ +#define GTPIE_H_BR_16MBPS_F 205 /* Higher Bitrates than 16 Mbps flag */ +/* 206: Reserved */ +#define GTPIE_A_MMCTX_SRVCC 207 /* Additional MM context for SRVCC */ +#define GTPIE_A_FLAGS_SRVCC 208 /* Additional flags fro SRVC */ +#define GTPIE_STN_SR 209 /* STN-SR */ +#define GTPIE_C_MSISDN 210 /* C-MSISDN */ +#define GTPIE_E_RANAP_CAUSE 211 /* Extended RANAP Cause */ +#define GTPIE_ENODEB_ID 212 /* eNodeB ID */ +#define GTPIE_SEL_MODE_NS 213 /* Selection Mode with NSAPI */ +#define GTPIE_ULI_TIMESTAMP 214 /* ULI Timestamp */ +/* 215-238 Spare. For future use */ +/* 239-250 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15 / 32.295) */ #define GTPIE_CHARGING_ADDR 251 /* Charging Gateway Address */ -/* 252-254 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15) */ +/* 252-254 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15 / 32.295) */ #define GTPIE_PRIVATE 255 /* Private Extension */ /* GTP information element structs in network order */ -- To view, visit https://gerrit.osmocom.org/4263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ab7bfb31f93f52f9f6b1b5880dcb2c232bba794 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:59:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:59:35 +0000 Subject: [PATCH] osmo-ggsn[master]: gtpie_{encaps, encaps2}(): RAI is a fixe 6-byte length field, ... Message-ID: Review at https://gerrit.osmocom.org/4264 gtpie_{encaps,encaps2}(): RAI is a fixe 6-byte length field, not 8 bytes gtpie_decaps() always had this right, but the encapsulation functions treated it as 8-byte fixed length IE. I hope we had a chance to convert all of this to the normal libosmogsm tlv_parser one day. This would have one description table for all TLV types which then is used from encoder and decoder. Change-Id: I48471f2735511806ac424b5ffc1929e85bb156f3 --- M gtp/gtpie.c 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/64/4264/1 diff --git a/gtp/gtpie.c b/gtp/gtpie.c index c4eabf8..fa21ab2 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -652,11 +652,13 @@ case GTPIE_TEI_DII: /* TV GTPIE types with value length 5 */ iesize = 6; break; + case GTPIE_RAI: /* TV GTPIE types with value length 6 */ + iesize = 7; + break; case GTPIE_RAB_CONTEXT: /* TV GTPIE types with value length 7 */ iesize = 8; break; case GTPIE_IMSI: /* TV GTPIE types with value length 8 */ - case GTPIE_RAI: iesize = 9; break; case GTPIE_AUTH_TRIPLET: /* TV GTPIE types with value length 28 */ @@ -827,11 +829,13 @@ case GTPIE_TEI_DII: /* TV GTPIE types with value length 5 */ iesize = 6; break; + case GTPIE_RAI: /* TV GTPIE types with value length 6 */ + iesize = 7; + break; case GTPIE_RAB_CONTEXT: /* TV GTPIE types with value length 7 */ iesize = 8; break; case GTPIE_IMSI: /* TV GTPIE types with value length 8 */ - case GTPIE_RAI: iesize = 9; break; case GTPIE_AUTH_TRIPLET: /* TV GTPIE types with value length 28 */ -- To view, visit https://gerrit.osmocom.org/4264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I48471f2735511806ac424b5ffc1929e85bb156f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 14 05:59:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 05:59:35 +0000 Subject: [PATCH] osmo-ggsn[master]: Add unit tests for libgtp gtpie.[ch] functions Message-ID: Review at https://gerrit.osmocom.org/4265 Add unit tests for libgtp gtpie.[ch] functions This doesn't yet cover all the functions in gtpie.[ch], but testing half of them is better than not testing any of them, so let's merge this current state with a couple of TDOO's on what we still need to test. Change-Id: I30a6dd8a01b7a074ef2d3936d186dfff6c79e6c0 --- M configure.ac M tests/Makefile.am A tests/gtp/Makefile.am A tests/gtp/gtpie_test.c A tests/gtp/gtpie_test.ok M tests/testsuite.at 6 files changed, 159 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/65/4265/1 diff --git a/configure.ac b/configure.ac index 72cbe48..ca455ce 100644 --- a/configure.ac +++ b/configure.ac @@ -151,6 +151,7 @@ sgsnemu/Makefile tests/Makefile tests/lib/Makefile + tests/gtp/Makefile libgtp.pc osmo-ggsn.spec]) AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am index ca4bdd8..8430a8f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ lib \ + gtp \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/gtp/Makefile.am b/tests/gtp/Makefile.am new file mode 100644 index 0000000..160af49 --- /dev/null +++ b/tests/gtp/Makefile.am @@ -0,0 +1,18 @@ +EXTRA_DIST = \ + gtpie_test.ok \ + $(NULL) + + +noinst_PROGRAMS = \ + gtpie_test \ + $(NULL) + +gtpie_test_SOURCES = \ + gtpie_test.c \ + $(NULL) + +gtpie_test_LDADD = \ + $(top_builddir)/lib/debug.o \ + $(top_builddir)/gtp/libgtp.la \ + $(LIBOSMOCORE_LIBS) \ + $(NULL) diff --git a/tests/gtp/gtpie_test.c b/tests/gtp/gtpie_test.c new file mode 100644 index 0000000..fe2d502 --- /dev/null +++ b/tests/gtp/gtpie_test.c @@ -0,0 +1,127 @@ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "../../lib/syserr.h" +#include "../../gtp/gtpie.h" + +static const uint8_t in[] = { 1,2,3,4,5,6 }; +static uint8_t buf[256]; +static int rc; + +static void test_gtpie_tlv() +{ + unsigned int len = 0; + + printf("Testing gtpie_tlv()\n"); + + /* normal / successful case */ + memset(buf, 0, sizeof(buf)); + rc = gtpie_tlv(buf, &len, sizeof(buf), 23, sizeof(in), in); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == sizeof(in) + 3); + OSMO_ASSERT(buf[0] == 23); + OSMO_ASSERT(ntohs(*(uint16_t *) &buf[1]) == sizeof(in)); + OSMO_ASSERT(!memcmp(buf+3, in, sizeof(in))); + + /* overflow */ + memset(buf, 0, sizeof(buf)); + rc = gtpie_tlv(buf, &len, 4, 23, sizeof(in), in); + OSMO_ASSERT(rc == 1); +} + +static void test_gtpie_tv0() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv0()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv0(buf, &len, sizeof(buf), 42, sizeof(in), in); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == sizeof(in) + 1); +} + +static void test_gtpie_tv1() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv1()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv1(buf, &len, sizeof(buf), 42, 0xAD); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 2); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(buf[1] == 0xAD); +} + +static void test_gtpie_tv2() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv2()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv2(buf, &len, sizeof(buf), 42, 0xABCD); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 3); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(ntohs(*(uint16_t *) &buf[1]) == 0xABCD); +} + +static void test_gtpie_tv4() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv4()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv4(buf, &len, sizeof(buf), 42, 0xABCD0123); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 5); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(ntohl(*(uint32_t *) &buf[1]) == 0xABCD0123); +} + +static void test_gtpie_tv8() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv8()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv8(buf, &len, sizeof(buf), 42, 0x0001020304050607ULL); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 9); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(ntohl(*(uint32_t *) &buf[1]) == 0x00010203); + OSMO_ASSERT(ntohl(*(uint32_t *) &buf[5]) == 0x04050607); +} + +int main(int argc, char **argv) +{ + osmo_init_logging(&log_info); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + + srand(time(NULL)); + + test_gtpie_tlv(); + test_gtpie_tv0(); + test_gtpie_tv1(); + test_gtpie_tv2(); + test_gtpie_tv4(); + test_gtpie_tv8(); + + /* TODO: gtpie_decaps() */ + /* TODO: gtpie_encaps() */ + /* TODO: gtpie_encaps2() */ + /* TODO: gtpie_getie(), gtpie_exist(), gtpie_get*() */ +} diff --git a/tests/gtp/gtpie_test.ok b/tests/gtp/gtpie_test.ok new file mode 100644 index 0000000..465df72 --- /dev/null +++ b/tests/gtp/gtpie_test.ok @@ -0,0 +1,6 @@ +Testing gtpie_tlv() +Testing gtpie_tv0() +Testing gtpie_tv1() +Testing gtpie_tv2() +Testing gtpie_tv4() +Testing gtpie_tv8() diff --git a/tests/testsuite.at b/tests/testsuite.at index cc0c949..f365f95 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -13,3 +13,9 @@ cat $abs_srcdir/lib/in46a_test.ok > expout AT_CHECK([$abs_top_builddir/tests/lib/in46a_test], [], [expout], []) AT_CLEANUP + +AT_SETUP([gtpie]) +AT_KEYWORDS([gtpie]) +cat $abs_srcdir/gtp/gtpie_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gtp/gtpie_test], [], [expout], []) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I30a6dd8a01b7a074ef2d3936d186dfff6c79e6c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 14 06:06:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 06:06:23 +0000 Subject: osmo-ggsn[master]: gtpie_{encaps, encaps2}(): RAI is a fixe 6-byte length field, ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I48471f2735511806ac424b5ffc1929e85bb156f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 06:06:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 06:06:25 +0000 Subject: osmo-ggsn[master]: gtpie.h: Add IE identifier definitions up to 29.60 v11.8.0 R... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6ab7bfb31f93f52f9f6b1b5880dcb2c232bba794 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 06:06:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 06:06:28 +0000 Subject: osmo-ggsn[master]: Allow Common flags 0x94 and ignore them in PDP activation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31b3e4b378e74bb5a0a2f54af6d2a15b629876cf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 06:11:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 06:11:36 +0000 Subject: [PATCH] osmo-ggsn[master]: Add unit tests for libgtp gtpie.[ch] functions In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4265 to look at the new patch set (#2). Add unit tests for libgtp gtpie.[ch] functions This doesn't yet cover all the functions in gtpie.[ch], but testing half of them is better than not testing any of them, so let's merge this current state with a couple of TDOO's on what we still need to test. Change-Id: I30a6dd8a01b7a074ef2d3936d186dfff6c79e6c0 --- M configure.ac M tests/Makefile.am A tests/gtp/Makefile.am A tests/gtp/gtpie_test.c A tests/gtp/gtpie_test.ok M tests/testsuite.at 6 files changed, 160 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/65/4265/2 diff --git a/configure.ac b/configure.ac index 72cbe48..ca455ce 100644 --- a/configure.ac +++ b/configure.ac @@ -151,6 +151,7 @@ sgsnemu/Makefile tests/Makefile tests/lib/Makefile + tests/gtp/Makefile libgtp.pc osmo-ggsn.spec]) AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am index ca4bdd8..8430a8f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ lib \ + gtp \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/gtp/Makefile.am b/tests/gtp/Makefile.am new file mode 100644 index 0000000..bb01e3d --- /dev/null +++ b/tests/gtp/Makefile.am @@ -0,0 +1,19 @@ +AM_CFLAGS = -Wall -I$(top_srcdir)/include $(LIBOSMOCORE_CFLAGS) -g + +EXTRA_DIST = \ + gtpie_test.ok \ + $(NULL) + +noinst_PROGRAMS = \ + gtpie_test \ + $(NULL) + +gtpie_test_SOURCES = \ + gtpie_test.c \ + $(NULL) + +gtpie_test_LDADD = \ + $(top_builddir)/lib/debug.o \ + $(top_builddir)/gtp/libgtp.la \ + $(LIBOSMOCORE_LIBS) \ + $(NULL) diff --git a/tests/gtp/gtpie_test.c b/tests/gtp/gtpie_test.c new file mode 100644 index 0000000..fe2d502 --- /dev/null +++ b/tests/gtp/gtpie_test.c @@ -0,0 +1,127 @@ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "../../lib/syserr.h" +#include "../../gtp/gtpie.h" + +static const uint8_t in[] = { 1,2,3,4,5,6 }; +static uint8_t buf[256]; +static int rc; + +static void test_gtpie_tlv() +{ + unsigned int len = 0; + + printf("Testing gtpie_tlv()\n"); + + /* normal / successful case */ + memset(buf, 0, sizeof(buf)); + rc = gtpie_tlv(buf, &len, sizeof(buf), 23, sizeof(in), in); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == sizeof(in) + 3); + OSMO_ASSERT(buf[0] == 23); + OSMO_ASSERT(ntohs(*(uint16_t *) &buf[1]) == sizeof(in)); + OSMO_ASSERT(!memcmp(buf+3, in, sizeof(in))); + + /* overflow */ + memset(buf, 0, sizeof(buf)); + rc = gtpie_tlv(buf, &len, 4, 23, sizeof(in), in); + OSMO_ASSERT(rc == 1); +} + +static void test_gtpie_tv0() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv0()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv0(buf, &len, sizeof(buf), 42, sizeof(in), in); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == sizeof(in) + 1); +} + +static void test_gtpie_tv1() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv1()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv1(buf, &len, sizeof(buf), 42, 0xAD); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 2); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(buf[1] == 0xAD); +} + +static void test_gtpie_tv2() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv2()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv2(buf, &len, sizeof(buf), 42, 0xABCD); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 3); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(ntohs(*(uint16_t *) &buf[1]) == 0xABCD); +} + +static void test_gtpie_tv4() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv4()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv4(buf, &len, sizeof(buf), 42, 0xABCD0123); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 5); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(ntohl(*(uint32_t *) &buf[1]) == 0xABCD0123); +} + +static void test_gtpie_tv8() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv8()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv8(buf, &len, sizeof(buf), 42, 0x0001020304050607ULL); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 9); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(ntohl(*(uint32_t *) &buf[1]) == 0x00010203); + OSMO_ASSERT(ntohl(*(uint32_t *) &buf[5]) == 0x04050607); +} + +int main(int argc, char **argv) +{ + osmo_init_logging(&log_info); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + + srand(time(NULL)); + + test_gtpie_tlv(); + test_gtpie_tv0(); + test_gtpie_tv1(); + test_gtpie_tv2(); + test_gtpie_tv4(); + test_gtpie_tv8(); + + /* TODO: gtpie_decaps() */ + /* TODO: gtpie_encaps() */ + /* TODO: gtpie_encaps2() */ + /* TODO: gtpie_getie(), gtpie_exist(), gtpie_get*() */ +} diff --git a/tests/gtp/gtpie_test.ok b/tests/gtp/gtpie_test.ok new file mode 100644 index 0000000..465df72 --- /dev/null +++ b/tests/gtp/gtpie_test.ok @@ -0,0 +1,6 @@ +Testing gtpie_tlv() +Testing gtpie_tv0() +Testing gtpie_tv1() +Testing gtpie_tv2() +Testing gtpie_tv4() +Testing gtpie_tv8() diff --git a/tests/testsuite.at b/tests/testsuite.at index cc0c949..f365f95 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -13,3 +13,9 @@ cat $abs_srcdir/lib/in46a_test.ok > expout AT_CHECK([$abs_top_builddir/tests/lib/in46a_test], [], [expout], []) AT_CLEANUP + +AT_SETUP([gtpie]) +AT_KEYWORDS([gtpie]) +cat $abs_srcdir/gtp/gtpie_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gtp/gtpie_test], [], [expout], []) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30a6dd8a01b7a074ef2d3936d186dfff6c79e6c0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 14 06:16:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 06:16:34 +0000 Subject: osmo-ggsn[master]: Add unit tests for libgtp gtpie.[ch] functions In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I30a6dd8a01b7a074ef2d3936d186dfff6c79e6c0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 06:16:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 06:16:36 +0000 Subject: [MERGED] osmo-ggsn[master]: Add unit tests for libgtp gtpie.[ch] functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add unit tests for libgtp gtpie.[ch] functions ...................................................................... Add unit tests for libgtp gtpie.[ch] functions This doesn't yet cover all the functions in gtpie.[ch], but testing half of them is better than not testing any of them, so let's merge this current state with a couple of TDOO's on what we still need to test. Change-Id: I30a6dd8a01b7a074ef2d3936d186dfff6c79e6c0 --- M configure.ac M tests/Makefile.am A tests/gtp/Makefile.am A tests/gtp/gtpie_test.c A tests/gtp/gtpie_test.ok M tests/testsuite.at 6 files changed, 160 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 72cbe48..ca455ce 100644 --- a/configure.ac +++ b/configure.ac @@ -151,6 +151,7 @@ sgsnemu/Makefile tests/Makefile tests/lib/Makefile + tests/gtp/Makefile libgtp.pc osmo-ggsn.spec]) AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am index ca4bdd8..8430a8f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ lib \ + gtp \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/gtp/Makefile.am b/tests/gtp/Makefile.am new file mode 100644 index 0000000..bb01e3d --- /dev/null +++ b/tests/gtp/Makefile.am @@ -0,0 +1,19 @@ +AM_CFLAGS = -Wall -I$(top_srcdir)/include $(LIBOSMOCORE_CFLAGS) -g + +EXTRA_DIST = \ + gtpie_test.ok \ + $(NULL) + +noinst_PROGRAMS = \ + gtpie_test \ + $(NULL) + +gtpie_test_SOURCES = \ + gtpie_test.c \ + $(NULL) + +gtpie_test_LDADD = \ + $(top_builddir)/lib/debug.o \ + $(top_builddir)/gtp/libgtp.la \ + $(LIBOSMOCORE_LIBS) \ + $(NULL) diff --git a/tests/gtp/gtpie_test.c b/tests/gtp/gtpie_test.c new file mode 100644 index 0000000..fe2d502 --- /dev/null +++ b/tests/gtp/gtpie_test.c @@ -0,0 +1,127 @@ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "../../lib/syserr.h" +#include "../../gtp/gtpie.h" + +static const uint8_t in[] = { 1,2,3,4,5,6 }; +static uint8_t buf[256]; +static int rc; + +static void test_gtpie_tlv() +{ + unsigned int len = 0; + + printf("Testing gtpie_tlv()\n"); + + /* normal / successful case */ + memset(buf, 0, sizeof(buf)); + rc = gtpie_tlv(buf, &len, sizeof(buf), 23, sizeof(in), in); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == sizeof(in) + 3); + OSMO_ASSERT(buf[0] == 23); + OSMO_ASSERT(ntohs(*(uint16_t *) &buf[1]) == sizeof(in)); + OSMO_ASSERT(!memcmp(buf+3, in, sizeof(in))); + + /* overflow */ + memset(buf, 0, sizeof(buf)); + rc = gtpie_tlv(buf, &len, 4, 23, sizeof(in), in); + OSMO_ASSERT(rc == 1); +} + +static void test_gtpie_tv0() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv0()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv0(buf, &len, sizeof(buf), 42, sizeof(in), in); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == sizeof(in) + 1); +} + +static void test_gtpie_tv1() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv1()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv1(buf, &len, sizeof(buf), 42, 0xAD); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 2); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(buf[1] == 0xAD); +} + +static void test_gtpie_tv2() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv2()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv2(buf, &len, sizeof(buf), 42, 0xABCD); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 3); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(ntohs(*(uint16_t *) &buf[1]) == 0xABCD); +} + +static void test_gtpie_tv4() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv4()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv4(buf, &len, sizeof(buf), 42, 0xABCD0123); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 5); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(ntohl(*(uint32_t *) &buf[1]) == 0xABCD0123); +} + +static void test_gtpie_tv8() +{ + unsigned int len = 0; + + printf("Testing gtpie_tv8()\n"); + + memset(buf, 0, sizeof(buf)); + rc = gtpie_tv8(buf, &len, sizeof(buf), 42, 0x0001020304050607ULL); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(len == 9); + OSMO_ASSERT(buf[0] == 42); + OSMO_ASSERT(ntohl(*(uint32_t *) &buf[1]) == 0x00010203); + OSMO_ASSERT(ntohl(*(uint32_t *) &buf[5]) == 0x04050607); +} + +int main(int argc, char **argv) +{ + osmo_init_logging(&log_info); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + + srand(time(NULL)); + + test_gtpie_tlv(); + test_gtpie_tv0(); + test_gtpie_tv1(); + test_gtpie_tv2(); + test_gtpie_tv4(); + test_gtpie_tv8(); + + /* TODO: gtpie_decaps() */ + /* TODO: gtpie_encaps() */ + /* TODO: gtpie_encaps2() */ + /* TODO: gtpie_getie(), gtpie_exist(), gtpie_get*() */ +} diff --git a/tests/gtp/gtpie_test.ok b/tests/gtp/gtpie_test.ok new file mode 100644 index 0000000..465df72 --- /dev/null +++ b/tests/gtp/gtpie_test.ok @@ -0,0 +1,6 @@ +Testing gtpie_tlv() +Testing gtpie_tv0() +Testing gtpie_tv1() +Testing gtpie_tv2() +Testing gtpie_tv4() +Testing gtpie_tv8() diff --git a/tests/testsuite.at b/tests/testsuite.at index cc0c949..f365f95 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -13,3 +13,9 @@ cat $abs_srcdir/lib/in46a_test.ok > expout AT_CHECK([$abs_top_builddir/tests/lib/in46a_test], [], [expout], []) AT_CLEANUP + +AT_SETUP([gtpie]) +AT_KEYWORDS([gtpie]) +cat $abs_srcdir/gtp/gtpie_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gtp/gtpie_test], [], [expout], []) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I30a6dd8a01b7a074ef2d3936d186dfff6c79e6c0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 14 06:16:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 06:16:36 +0000 Subject: [MERGED] osmo-ggsn[master]: Allow Common flags 0x94 and ignore them in PDP activation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Allow Common flags 0x94 and ignore them in PDP activation ...................................................................... Allow Common flags 0x94 and ignore them in PDP activation extended from https://github.com/osmocom/openggsn/pull/2 Change-Id: I31b3e4b378e74bb5a0a2f54af6d2a15b629876cf --- M gtp/gtpie.c M gtp/gtpie.h 2 files changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtpie.c b/gtp/gtpie.c index 6ffa184..68422f0 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -491,6 +491,7 @@ case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: case GTPIE_CHARGING_ADDR: + case GTPIE_COMMON_FLAGS: case GTPIE_RAT_TYPE: case GTPIE_USER_LOC: case GTPIE_MS_TZ: @@ -616,6 +617,7 @@ case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: case GTPIE_CHARGING_ADDR: + case GTPIE_COMMON_FLAGS: case GTPIE_PRIVATE: iesize = 3 + hton16(ie[i]->tlv.l); break; @@ -722,6 +724,7 @@ case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: case GTPIE_CHARGING_ADDR: + case GTPIE_COMMON_FLAGS: case GTPIE_PRIVATE: iesize = 3 + hton16(ie[i].tlv.l); break; diff --git a/gtp/gtpie.h b/gtp/gtpie.h index 754382e..8ea19ea 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -104,6 +104,7 @@ #define GTPIE_EXT_HEADER_T 141 /* Extension Header Type List */ #define GTPIE_TRIGGER_ID 142 /* Trigger Id */ #define GTPIE_OMC_ID 143 /* OMC Identity */ +#define GTPIE_COMMON_FLAGS 148 /* Common Flags */ #define GTPIE_RAT_TYPE 151 /* Radio Access Technology Type */ #define GTPIE_USER_LOC 152 /* User Location Information */ #define GTPIE_MS_TZ 153 /* MS Time Zone */ -- To view, visit https://gerrit.osmocom.org/4262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I31b3e4b378e74bb5a0a2f54af6d2a15b629876cf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 14 06:16:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 06:16:37 +0000 Subject: [MERGED] osmo-ggsn[master]: gtpie.h: Add IE identifier definitions up to 29.60 v11.8.0 R... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtpie.h: Add IE identifier definitions up to 29.60 v11.8.0 Release 11 ...................................................................... gtpie.h: Add IE identifier definitions up to 29.60 v11.8.0 Release 11 Change-Id: I6ab7bfb31f93f52f9f6b1b5880dcb2c232bba794 --- M gtp/gtpie.c M gtp/gtpie.h 2 files changed, 275 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtpie.c b/gtp/gtpie.c index 68422f0..c4eabf8 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -490,12 +490,76 @@ case GTPIE_RAB_SETUP: case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: - case GTPIE_CHARGING_ADDR: + case GTPIE_RAN_T_CONTAIN: + case GTPIE_PDP_CTX_PRIO: + case GTPIE_ADDL_RAB_S_I: + case GTPIE_SGSN_NUMBER: case GTPIE_COMMON_FLAGS: + case GTPIE_APN_RESTR: + case GTPIE_R_PRIO_LCS: case GTPIE_RAT_TYPE: case GTPIE_USER_LOC: case GTPIE_MS_TZ: case GTPIE_IMEI_SV: + case GTPIE_CML_CHG_I_CT: + case GTPIE_MBMS_UE_CTX: + case GTPIE_TMGI: + case GTPIE_RIM_ROUT_ADDR: + case GTPIE_MBMS_PCO: + case GTPIE_MBMS_SA: + case GTPIE_SRNC_PDCP_CTX: + case GTPIE_ADDL_TRACE: + case GTPIE_HOP_CTR: + case GTPIE_SEL_PLMN_ID: + case GTPIE_MBMS_SESS_ID: + case GTPIE_MBMS_2_3G_IND: + case GTPIE_ENH_NSAPI: + case GTPIE_MBMS_SESS_DUR: + case GTPIE_A_MBMS_TRAC_I: + case GTPIE_MBMS_S_REP_N: + case GTPIE_MBMS_TTDT: + case GTPIE_PS_HO_REQ_CTX: + case GTPIE_BSS_CONTAINER: + case GTPIE_CELL_ID: + case GTPIE_PDU_NUMBERS: + case GTPIE_BSSGP_CAUSE: + case GTPIE_RQD_MBMS_BCAP: + case GTPIE_RIM_RA_DISCR: + case GTPIE_L_SETUP_PFCS: + case GTPIE_PS_HO_XID_PAR: + case GTPIE_MS_CHG_REP_A: + case GTPIE_DIR_TUN_FLAGS: + case GTPIE_CORREL_ID: + case GTPIE_MBMS_FLOWI: + case GTPIE_MBMS_MC_DIST: + case GTPIE_MBMS_DIST_ACK: + case GTPIE_R_IRAT_HO_INF: + case GTPIE_RFSP_IDX: + case GTPIE_FQDN: + case GTPIE_E_ALL_PRIO_1: + case GTPIE_E_ALL_PRIO_2: + case GTPIE_E_CMN_FLAGS: + case GTPIE_U_CSG_INFO: + case GTPIE_CSG_I_REP_ACT: + case GTPIE_CSG_ID: + case GTPIE_CSG_MEMB_IND: + case GTPIE_AMBR: + case GTPIE_UE_NET_CAPA: + case GTPIE_UE_AMBR: + case GTPIE_APN_AMBR_NS: + case GTPIE_GGSN_BACKOFF: + case GTPIE_S_PRIO_IND: + case GTPIE_S_PRIO_IND_NS: + case GTPIE_H_BR_16MBPS_F: + case GTPIE_A_MMCTX_SRVCC: + case GTPIE_A_FLAGS_SRVCC: + case GTPIE_STN_SR: + case GTPIE_C_MSISDN: + case GTPIE_E_RANAP_CAUSE: + case GTPIE_ENODEB_ID: + case GTPIE_SEL_MODE_NS: + case GTPIE_ULI_TIMESTAMP: + case GTPIE_CHARGING_ADDR: case GTPIE_PRIVATE: if (j < GTPIE_SIZE) { ie[j] = (union gtpie_member *)p; @@ -616,8 +680,76 @@ case GTPIE_RAB_SETUP: case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: - case GTPIE_CHARGING_ADDR: + case GTPIE_RAN_T_CONTAIN: + case GTPIE_PDP_CTX_PRIO: + case GTPIE_ADDL_RAB_S_I: + case GTPIE_SGSN_NUMBER: case GTPIE_COMMON_FLAGS: + case GTPIE_APN_RESTR: + case GTPIE_R_PRIO_LCS: + case GTPIE_RAT_TYPE: + case GTPIE_USER_LOC: + case GTPIE_MS_TZ: + case GTPIE_IMEI_SV: + case GTPIE_CML_CHG_I_CT: + case GTPIE_MBMS_UE_CTX: + case GTPIE_TMGI: + case GTPIE_RIM_ROUT_ADDR: + case GTPIE_MBMS_PCO: + case GTPIE_MBMS_SA: + case GTPIE_SRNC_PDCP_CTX: + case GTPIE_ADDL_TRACE: + case GTPIE_HOP_CTR: + case GTPIE_SEL_PLMN_ID: + case GTPIE_MBMS_SESS_ID: + case GTPIE_MBMS_2_3G_IND: + case GTPIE_ENH_NSAPI: + case GTPIE_MBMS_SESS_DUR: + case GTPIE_A_MBMS_TRAC_I: + case GTPIE_MBMS_S_REP_N: + case GTPIE_MBMS_TTDT: + case GTPIE_PS_HO_REQ_CTX: + case GTPIE_BSS_CONTAINER: + case GTPIE_CELL_ID: + case GTPIE_PDU_NUMBERS: + case GTPIE_BSSGP_CAUSE: + case GTPIE_RQD_MBMS_BCAP: + case GTPIE_RIM_RA_DISCR: + case GTPIE_L_SETUP_PFCS: + case GTPIE_PS_HO_XID_PAR: + case GTPIE_MS_CHG_REP_A: + case GTPIE_DIR_TUN_FLAGS: + case GTPIE_CORREL_ID: + case GTPIE_MBMS_FLOWI: + case GTPIE_MBMS_MC_DIST: + case GTPIE_MBMS_DIST_ACK: + case GTPIE_R_IRAT_HO_INF: + case GTPIE_RFSP_IDX: + case GTPIE_FQDN: + case GTPIE_E_ALL_PRIO_1: + case GTPIE_E_ALL_PRIO_2: + case GTPIE_E_CMN_FLAGS: + case GTPIE_U_CSG_INFO: + case GTPIE_CSG_I_REP_ACT: + case GTPIE_CSG_ID: + case GTPIE_CSG_MEMB_IND: + case GTPIE_AMBR: + case GTPIE_UE_NET_CAPA: + case GTPIE_UE_AMBR: + case GTPIE_APN_AMBR_NS: + case GTPIE_GGSN_BACKOFF: + case GTPIE_S_PRIO_IND: + case GTPIE_S_PRIO_IND_NS: + case GTPIE_H_BR_16MBPS_F: + case GTPIE_A_MMCTX_SRVCC: + case GTPIE_A_FLAGS_SRVCC: + case GTPIE_STN_SR: + case GTPIE_C_MSISDN: + case GTPIE_E_RANAP_CAUSE: + case GTPIE_ENODEB_ID: + case GTPIE_SEL_MODE_NS: + case GTPIE_ULI_TIMESTAMP: + case GTPIE_CHARGING_ADDR: case GTPIE_PRIVATE: iesize = 3 + hton16(ie[i]->tlv.l); break; @@ -689,6 +821,7 @@ case GTPIE_P_TMSI: case GTPIE_TEI_DI: case GTPIE_TEI_C: + case GTPIE_CHARGING_ID: iesize = 5; break; case GTPIE_TEI_DII: /* TV GTPIE types with value length 5 */ @@ -707,8 +840,7 @@ case GTPIE_EXT_HEADER_T: /* GTP extension header */ iesize = 2 + hton8(ie[i].ext.l); break; - case GTPIE_CHARGING_ID: /* TLV GTPIE types with length length 2 */ - case GTPIE_EUA: + case GTPIE_EUA: /* TLV GTPIE types with length length 2 */ case GTPIE_MM_CONTEXT: case GTPIE_PDP_CONTEXT: case GTPIE_APN: @@ -723,8 +855,76 @@ case GTPIE_RAB_SETUP: case GTPIE_TRIGGER_ID: case GTPIE_OMC_ID: - case GTPIE_CHARGING_ADDR: + case GTPIE_RAN_T_CONTAIN: + case GTPIE_PDP_CTX_PRIO: + case GTPIE_ADDL_RAB_S_I: + case GTPIE_SGSN_NUMBER: case GTPIE_COMMON_FLAGS: + case GTPIE_APN_RESTR: + case GTPIE_R_PRIO_LCS: + case GTPIE_RAT_TYPE: + case GTPIE_USER_LOC: + case GTPIE_MS_TZ: + case GTPIE_IMEI_SV: + case GTPIE_CML_CHG_I_CT: + case GTPIE_MBMS_UE_CTX: + case GTPIE_TMGI: + case GTPIE_RIM_ROUT_ADDR: + case GTPIE_MBMS_PCO: + case GTPIE_MBMS_SA: + case GTPIE_SRNC_PDCP_CTX: + case GTPIE_ADDL_TRACE: + case GTPIE_HOP_CTR: + case GTPIE_SEL_PLMN_ID: + case GTPIE_MBMS_SESS_ID: + case GTPIE_MBMS_2_3G_IND: + case GTPIE_ENH_NSAPI: + case GTPIE_MBMS_SESS_DUR: + case GTPIE_A_MBMS_TRAC_I: + case GTPIE_MBMS_S_REP_N: + case GTPIE_MBMS_TTDT: + case GTPIE_PS_HO_REQ_CTX: + case GTPIE_BSS_CONTAINER: + case GTPIE_CELL_ID: + case GTPIE_PDU_NUMBERS: + case GTPIE_BSSGP_CAUSE: + case GTPIE_RQD_MBMS_BCAP: + case GTPIE_RIM_RA_DISCR: + case GTPIE_L_SETUP_PFCS: + case GTPIE_PS_HO_XID_PAR: + case GTPIE_MS_CHG_REP_A: + case GTPIE_DIR_TUN_FLAGS: + case GTPIE_CORREL_ID: + case GTPIE_MBMS_FLOWI: + case GTPIE_MBMS_MC_DIST: + case GTPIE_MBMS_DIST_ACK: + case GTPIE_R_IRAT_HO_INF: + case GTPIE_RFSP_IDX: + case GTPIE_FQDN: + case GTPIE_E_ALL_PRIO_1: + case GTPIE_E_ALL_PRIO_2: + case GTPIE_E_CMN_FLAGS: + case GTPIE_U_CSG_INFO: + case GTPIE_CSG_I_REP_ACT: + case GTPIE_CSG_ID: + case GTPIE_CSG_MEMB_IND: + case GTPIE_AMBR: + case GTPIE_UE_NET_CAPA: + case GTPIE_UE_AMBR: + case GTPIE_APN_AMBR_NS: + case GTPIE_GGSN_BACKOFF: + case GTPIE_S_PRIO_IND: + case GTPIE_S_PRIO_IND_NS: + case GTPIE_H_BR_16MBPS_F: + case GTPIE_A_MMCTX_SRVCC: + case GTPIE_A_FLAGS_SRVCC: + case GTPIE_STN_SR: + case GTPIE_C_MSISDN: + case GTPIE_E_RANAP_CAUSE: + case GTPIE_ENODEB_ID: + case GTPIE_SEL_MODE_NS: + case GTPIE_ULI_TIMESTAMP: + case GTPIE_CHARGING_ADDR: case GTPIE_PRIVATE: iesize = 3 + hton16(ie[i].tlv.l); break; diff --git a/gtp/gtpie.h b/gtp/gtpie.h index 8ea19ea..b6fea6e 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -50,7 +50,7 @@ #define GTPIE_DEBUG 0 /* Print debug information */ -/* GTP Information elements from 29.060 v3.9.0 7.7 Information Elements */ +/* GTP Information elements from 29.060 v11.8.0 7.7 Information Elements */ /* Also covers version 0. Note that version 0 6: QOS Profile was superceded * * by 135: QOS Profile in version 1 */ @@ -86,7 +86,7 @@ #define GTPIE_TRACE_TYPE 28 /* Trace Type 2 */ #define GTPIE_MS_NOT_REACH 29 /* MS Not Reachable Reason 1 */ /* 30-116 UNUSED */ -/* 117-126 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15) */ +/* 117-126 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15 / 32.295) */ #define GTPIE_CHARGING_ID 127 /* Charging ID 4 */ #define GTPIE_EUA 128 /* End User Address */ #define GTPIE_MM_CONTEXT 129 /* MM Context */ @@ -104,15 +104,81 @@ #define GTPIE_EXT_HEADER_T 141 /* Extension Header Type List */ #define GTPIE_TRIGGER_ID 142 /* Trigger Id */ #define GTPIE_OMC_ID 143 /* OMC Identity */ +#define GTPIE_RAN_T_CONTAIN 144 /* RAN Transparent Container */ +#define GTPIE_PDP_CTX_PRIO 145 /* PDP Context Prioritization */ +#define GTPIE_ADDL_RAB_S_I 146 /* Additional RAB Setup Information */ +#define GTPIE_SGSN_NUMBER 147 /* SGSN Number */ #define GTPIE_COMMON_FLAGS 148 /* Common Flags */ +#define GTPIE_APN_RESTR 149 /* APN Restriction */ +#define GTPIE_R_PRIO_LCS 150 /* Radio Priority LCS */ #define GTPIE_RAT_TYPE 151 /* Radio Access Technology Type */ #define GTPIE_USER_LOC 152 /* User Location Information */ #define GTPIE_MS_TZ 153 /* MS Time Zone */ #define GTPIE_IMEI_SV 154 /* IMEI Software Version */ +#define GTPIE_CML_CHG_I_CT 155 /* CAMEL Charging Information Container */ +#define GTPIE_MBMS_UE_CTX 156 /* MSMS UE Context */ +#define GTPIE_TMGI 157 /* Temporary Mobile Group Identity (TMGI) */ +#define GTPIE_RIM_ROUT_ADDR 158 /* RIM Routing Address */ +#define GTPIE_MBMS_PCO 159 /* MBMS Protocol Configuratin Options */ +#define GTPIE_MBMS_SA 160 /* MBMS Service Area */ +#define GTPIE_SRNC_PDCP_CTX 161 /* Source RNC PDCP Context Info */ +#define GTPIE_ADDL_TRACE 162 /* Additional Trace Info */ +#define GTPIE_HOP_CTR 163 /* Hop Counter */ +#define GTPIE_SEL_PLMN_ID 164 /* Selected PLMN ID */ +#define GTPIE_MBMS_SESS_ID 165 /* MBMS Session Identifier */ +#define GTPIE_MBMS_2_3G_IND 166 /* MBMS 2G/3G Indicator */ +#define GTPIE_ENH_NSAPI 167 /* Enhanced NSAPI */ +#define GTPIE_MBMS_SESS_DUR 168 /* MBMS Session Duration */ +#define GTPIE_A_MBMS_TRAC_I 169 /* Additional MBMS Trace Info */ +#define GTPIE_MBMS_S_REP_N 170 /* MBMS Session Repetition Number */ +#define GTPIE_MBMS_TTDT 171 /* MBMS Time To Data Transfer */ +#define GTPIE_PS_HO_REQ_CTX 172 /* PS Handover Request Context */ +#define GTPIE_BSS_CONTAINER 173 /* BSS Container */ +#define GTPIE_CELL_ID 174 /* Cell Identification */ +#define GTPIE_PDU_NUMBERS 175 /* PDU Numbers */ +#define GTPIE_BSSGP_CAUSE 176 /* BSSGP Cause */ +#define GTPIE_RQD_MBMS_BCAP 177 /* Required MBMS Bearer Capabilities */ +#define GTPIE_RIM_RA_DISCR 178 /* RIM Routing Address Discriminator */ +#define GTPIE_L_SETUP_PFCS 179 /* List of set-up PFCs */ +#define GTPIE_PS_HO_XID_PAR 180 /* PS Handover XID Parameters */ +#define GTPIE_MS_CHG_REP_A 181 /* MS Info Change Reporting Action */ +#define GTPIE_DIR_TUN_FLAGS 182 /* Direct Tunnel Flags */ +#define GTPIE_CORREL_ID 183 /* Correlation-ID */ #define GTPIE_BCM 184 /* Bearer control mode */ -/* 239-250 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15) */ +#define GTPIE_MBMS_FLOWI 185 /* MBMS Flow Identifier */ +#define GTPIE_MBMS_MC_DIST 186 /* MBMS IP Multicast Distribution */ +#define GTPIE_MBMS_DIST_ACK 187 /* MBMS Distribution Acknowledgement */ +#define GTPIE_R_IRAT_HO_INF 188 /* Reliable INTER RAT HANDOVER INFO */ +#define GTPIE_RFSP_IDX 189 /* RFSP Index */ +#define GTPIE_FQDN 190 /* FQDN */ +#define GTPIE_E_ALL_PRIO_1 191 /* Evolvd Allocation/Retention Priority I */ +#define GTPIE_E_ALL_PRIO_2 192 /* Evolvd Allocation/Retention Priority II */ +#define GTPIE_E_CMN_FLAGS 193 /* Extended Common Flags */ +#define GTPIE_U_CSG_INFO 194 /* User CSG Information (UCI) */ +#define GTPIE_CSG_I_REP_ACT 195 /* CSG Information Reporting Action */ +#define GTPIE_CSG_ID 196 /* CSG ID */ +#define GTPIE_CSG_MEMB_IND 197 /* CSG Membership Indication (CMI) */ +#define GTPIE_AMBR 198 /* Aggregate Maximum Bit Rate (AMBR) */ +#define GTPIE_UE_NET_CAPA 199 /* UE Network Capability */ +#define GTPIE_UE_AMBR 200 /* UE-AMBR */ +#define GTPIE_APN_AMBR_NS 201 /* APN-AMBR with NSAPI */ +#define GTPIE_GGSN_BACKOFF 202 /* GGSN Back-Off Time */ +#define GTPIE_S_PRIO_IND 203 /* Signalling Priority Indication */ +#define GTPIE_S_PRIO_IND_NS 204 /* Signalling Priority Indication with NSAPI */ +#define GTPIE_H_BR_16MBPS_F 205 /* Higher Bitrates than 16 Mbps flag */ +/* 206: Reserved */ +#define GTPIE_A_MMCTX_SRVCC 207 /* Additional MM context for SRVCC */ +#define GTPIE_A_FLAGS_SRVCC 208 /* Additional flags fro SRVC */ +#define GTPIE_STN_SR 209 /* STN-SR */ +#define GTPIE_C_MSISDN 210 /* C-MSISDN */ +#define GTPIE_E_RANAP_CAUSE 211 /* Extended RANAP Cause */ +#define GTPIE_ENODEB_ID 212 /* eNodeB ID */ +#define GTPIE_SEL_MODE_NS 213 /* Selection Mode with NSAPI */ +#define GTPIE_ULI_TIMESTAMP 214 /* ULI Timestamp */ +/* 215-238 Spare. For future use */ +/* 239-250 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15 / 32.295) */ #define GTPIE_CHARGING_ADDR 251 /* Charging Gateway Address */ -/* 252-254 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15) */ +/* 252-254 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15 / 32.295) */ #define GTPIE_PRIVATE 255 /* Private Extension */ /* GTP information element structs in network order */ -- To view, visit https://gerrit.osmocom.org/4263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ab7bfb31f93f52f9f6b1b5880dcb2c232bba794 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 14 06:16:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 06:16:37 +0000 Subject: [MERGED] osmo-ggsn[master]: gtpie_{encaps, encaps2}(): RAI is a fixe 6-byte length field, ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtpie_{encaps,encaps2}(): RAI is a fixe 6-byte length field, not 8 bytes ...................................................................... gtpie_{encaps,encaps2}(): RAI is a fixe 6-byte length field, not 8 bytes gtpie_decaps() always had this right, but the encapsulation functions treated it as 8-byte fixed length IE. I hope we had a chance to convert all of this to the normal libosmogsm tlv_parser one day. This would have one description table for all TLV types which then is used from encoder and decoder. Change-Id: I48471f2735511806ac424b5ffc1929e85bb156f3 --- M gtp/gtpie.c 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtpie.c b/gtp/gtpie.c index c4eabf8..fa21ab2 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -652,11 +652,13 @@ case GTPIE_TEI_DII: /* TV GTPIE types with value length 5 */ iesize = 6; break; + case GTPIE_RAI: /* TV GTPIE types with value length 6 */ + iesize = 7; + break; case GTPIE_RAB_CONTEXT: /* TV GTPIE types with value length 7 */ iesize = 8; break; case GTPIE_IMSI: /* TV GTPIE types with value length 8 */ - case GTPIE_RAI: iesize = 9; break; case GTPIE_AUTH_TRIPLET: /* TV GTPIE types with value length 28 */ @@ -827,11 +829,13 @@ case GTPIE_TEI_DII: /* TV GTPIE types with value length 5 */ iesize = 6; break; + case GTPIE_RAI: /* TV GTPIE types with value length 6 */ + iesize = 7; + break; case GTPIE_RAB_CONTEXT: /* TV GTPIE types with value length 7 */ iesize = 8; break; case GTPIE_IMSI: /* TV GTPIE types with value length 8 */ - case GTPIE_RAI: iesize = 9; break; case GTPIE_AUTH_TRIPLET: /* TV GTPIE types with value length 28 */ -- To view, visit https://gerrit.osmocom.org/4264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I48471f2735511806ac424b5ffc1929e85bb156f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 14 14:05:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 14:05:51 +0000 Subject: osmo-ggsn[master]: sgsnemu: Add '--tun-device' option to specify TUN device name In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id12fbadf924a60db255b6d51b9f647aa51dd2e16 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 14:05:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 14:05:53 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Add '--tun-device' option to specify TUN device name In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Add '--tun-device' option to specify TUN device name ...................................................................... sgsnemu: Add '--tun-device' option to specify TUN device name This way, multiple sgsnemu instances can be runnig in parallel, each of them creating a different tun device for their respective PDP context Change-Id: Id12fbadf924a60db255b6d51b9f647aa51dd2e16 --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h M sgsnemu/sgsnemu.c 4 files changed, 90 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 60c0a25..441322b 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -70,6 +70,7 @@ " --defaultroute Create default route (default=off)", " --ipup=STRING Script to run after link-up", " --ipdown=STRING Script to run after link-down", + " --tun-device=STRING Name of the local network interface", " --pinghost=STRING Ping remote host", " --pingrate=INT Number of ping req per second (default=`1')", " --pingsize=INT Number of ping data bytes (default=`56')", @@ -94,6 +95,9 @@ struct cmdline_parser_params *params, const char *additional_error); +static int +cmdline_parser_required2(struct gengetopt_args_info *args_info, + const char *prog_name, const char *additional_error); struct line_list { char *string_arg; struct line_list *next; @@ -156,6 +160,7 @@ args_info->defaultroute_given = 0; args_info->ipup_given = 0; args_info->ipdown_given = 0; + args_info->tun_device_given = 0; args_info->pinghost_given = 0; args_info->pingrate_given = 0; args_info->pingsize_given = 0; @@ -233,6 +238,8 @@ args_info->ipup_orig = NULL; args_info->ipdown_arg = NULL; args_info->ipdown_orig = NULL; + args_info->tun_device_arg = NULL; + args_info->tun_device_orig = NULL; args_info->pinghost_arg = NULL; args_info->pinghost_orig = NULL; args_info->pingrate_arg = 1; @@ -288,13 +295,14 @@ args_info->defaultroute_help = gengetopt_args_info_help[33]; args_info->ipup_help = gengetopt_args_info_help[34]; args_info->ipdown_help = gengetopt_args_info_help[35]; - args_info->pinghost_help = gengetopt_args_info_help[36]; - args_info->pingrate_help = gengetopt_args_info_help[37]; - args_info->pingsize_help = gengetopt_args_info_help[38]; - args_info->pingcount_help = gengetopt_args_info_help[39]; - args_info->pingquiet_help = gengetopt_args_info_help[40]; - args_info->no_tx_gpdu_seq_help = gengetopt_args_info_help[41]; - args_info->pdp_type_help = gengetopt_args_info_help[42]; + args_info->tun_device_help = gengetopt_args_info_help[36]; + args_info->pinghost_help = gengetopt_args_info_help[37]; + args_info->pingrate_help = gengetopt_args_info_help[38]; + args_info->pingsize_help = gengetopt_args_info_help[39]; + args_info->pingcount_help = gengetopt_args_info_help[40]; + args_info->pingquiet_help = gengetopt_args_info_help[41]; + args_info->no_tx_gpdu_seq_help = gengetopt_args_info_help[42]; + args_info->pdp_type_help = gengetopt_args_info_help[43]; } @@ -419,6 +427,8 @@ free_string_field(&(args_info->ipup_orig)); free_string_field(&(args_info->ipdown_arg)); free_string_field(&(args_info->ipdown_orig)); + free_string_field(&(args_info->tun_device_arg)); + free_string_field(&(args_info->tun_device_orig)); free_string_field(&(args_info->pinghost_arg)); free_string_field(&(args_info->pinghost_orig)); free_string_field(&(args_info->pingrate_orig)); @@ -529,6 +539,9 @@ write_into_file(outfile, "ipup", args_info->ipup_orig, 0); if (args_info->ipdown_given) write_into_file(outfile, "ipdown", args_info->ipdown_orig, 0); + if (args_info->tun_device_given) + write_into_file(outfile, "tun-device", + args_info->tun_device_orig, 0); if (args_info->pinghost_given) write_into_file(outfile, "pinghost", args_info->pinghost_orig, 0); @@ -640,9 +653,37 @@ cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name) { - FIX_UNUSED(args_info); - FIX_UNUSED(prog_name); - return EXIT_SUCCESS; + int result = EXIT_SUCCESS; + + if (cmdline_parser_required2(args_info, prog_name, 0) > 0) + result = EXIT_FAILURE; + + if (result == EXIT_FAILURE) { + cmdline_parser_free(args_info); + exit(EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser_required2(struct gengetopt_args_info *args_info, + const char *prog_name, const char *additional_error) +{ + int error_occurred = 0; + FIX_UNUSED(additional_error); + + /* checks for required options */ + + /* checks for dependences among options */ + if (args_info->tun_device_given && !args_info->createif_given) { + fprintf(stderr, + "%s: '--tun-device' option depends on option 'createif'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + + return error_occurred; } static char *package_name = 0; @@ -837,6 +878,7 @@ {"defaultroute", 0, NULL, 0}, {"ipup", 1, NULL, 0}, {"ipdown", 1, NULL, 0}, + {"tun-device", 1, NULL, 0}, {"pinghost", 1, NULL, 0}, {"pingrate", 1, NULL, 0}, {"pingsize", 1, NULL, 0}, @@ -1355,6 +1397,22 @@ goto failure; } + /* Name of the local network interface. */ + else if (strcmp + (long_options[option_index].name, + "tun-device") == 0) { + + if (update_arg + ((void *)&(args_info->tun_device_arg), + &(args_info->tun_device_orig), + &(args_info->tun_device_given), + &(local_args_info.tun_device_given), + optarg, 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "tun-device", '-', + additional_error)) + goto failure; + + } /* Ping remote host. */ else if (strcmp (long_options[option_index].name, @@ -1460,6 +1518,12 @@ } /* switch */ } /* while */ + if (check_required) { + error_occurred += + cmdline_parser_required2(args_info, argv[0], + additional_error); + } + cmdline_parser_release(&local_args_info); if (error_occurred) diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index d8b3c26..7592eb5 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -54,6 +54,7 @@ option "defaultroute" - "Create default route" flag off option "ipup" - "Script to run after link-up" string no option "ipdown" - "Script to run after link-down" string no +option "tun-device" - "Name of the local network interface" string dependon="createif" no option "pinghost" - "Ping remote host" string no option "pingrate" - "Number of ping req per second" int default="1" no diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 1accfd0..9dc210e 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -236,6 +236,12 @@ /**< @brief Script to run after link-down original value given at command line. */ const char *ipdown_help; /**< @brief Script to run after link-down help description. */ + char *tun_device_arg; + /**< @brief Name of the local network interface. */ + char *tun_device_orig; + /**< @brief Name of the local network interface original value given at command line. */ + const char *tun_device_help; + /**< @brief Name of the local network interface help description. */ char *pinghost_arg; /**< @brief Ping remote host. */ char *pinghost_orig; @@ -347,6 +353,8 @@ /**< @brief Whether ipup was given. */ unsigned int ipdown_given; /**< @brief Whether ipdown was given. */ + unsigned int tun_device_given; + /**< @brief Whether tun-device was given. */ unsigned int pinghost_given; /**< @brief Whether pinghost was given. */ unsigned int pingrate_given; diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index fa295da..c83aebd 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -84,6 +84,7 @@ struct { int debug; /* Print debug messages */ int createif; /* Create local network interface */ + char *tun_dev_name; struct in_addr netaddr, destaddr, net; /* Network interface */ size_t prefixlen; char *ipup, *ipdown; /* Filename of scripts */ @@ -289,6 +290,8 @@ printf("contexts: %d\n", args_info.contexts_arg); printf("timelimit: %d\n", args_info.timelimit_arg); printf("createif: %d\n", args_info.createif_flag); + if (args_info.tun_device_arg) + printf("tun-device: %d\n", args_info.tun_device_arg); if (args_info.ipup_arg) printf("ipup: %s\n", args_info.ipup_arg); if (args_info.ipdown_arg) @@ -345,6 +348,8 @@ printf("contexts: %d\n", args_info.contexts_arg); printf("timelimit: %d\n", args_info.timelimit_arg); printf("createif: %d\n", args_info.createif_flag); + if (args_info.tun_device_arg) + printf("tun-device: %d\n", args_info.tun_device_arg); if (args_info.ipup_arg) printf("ipup: %s\n", args_info.ipup_arg); if (args_info.ipdown_arg) @@ -863,6 +868,7 @@ /* createif */ options.createif = args_info.createif_flag; + options.tun_dev_name = args_info.tun_device_arg; /* net */ /* Store net as in_addr net and mask */ @@ -1525,7 +1531,7 @@ if (options.createif) { printf("Setting up interface\n"); /* Create a tunnel interface */ - if (tun_new((struct tun_t **)&tun, NULL)) { + if (tun_new((struct tun_t **)&tun, options.tun_dev_name)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Failed to create tun"); exit(1); -- To view, visit https://gerrit.osmocom.org/4190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id12fbadf924a60db255b6d51b9f647aa51dd2e16 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 14 14:39:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 14:39:17 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Avoid crash on wrong EUA type Message-ID: Review at https://gerrit.osmocom.org/4266 ggsn: Avoid crash on wrong EUA type If the EUA in the Create PDP Context Request was not supported by the given APN (e.g. IPv6 request for a v4-only APN), we crashed. Avoid this and add proper handling of this error case. Change-Id: I8d1f7ec727c5d2d4427232015f81ed57d3440dff --- M ggsn/ggsn.c 1 file changed, 28 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/66/4266/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 67d040f..29d8473 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -432,6 +432,20 @@ msgb_free(msg); } +static bool apn_supports_ipv4(const struct apn_ctx *apn) +{ + if (apn->v4.cfg.static_prefix.addr.len || apn->v4.cfg.dynamic_prefix.addr.len) + return true; + return false; +} + +static bool apn_supports_ipv6(const struct apn_ctx *apn) +{ + if (apn->v6.cfg.static_prefix.addr.len || apn->v6.cfg.dynamic_prefix.addr.len) + return true; + return false; +} + int create_context_ind(struct pdp_t *pdp) { static char name_buf[256]; @@ -483,6 +497,10 @@ } if (addr.len == sizeof(struct in_addr)) { + /* does this APN actually have an IPv4 pool? */ + if (!apn_supports_ipv4(apn)) + goto err_wrong_af; + rc = ippool_newip(apn->v4.pool, &member, &addr, 0); if (rc < 0) goto err_pool_full; @@ -496,6 +514,11 @@ } } else if (addr.len == sizeof(struct in6_addr)) { struct in46_addr tmp; + + /* does this APN actually have an IPv6 pool? */ + if (!apn_supports_ipv6(apn)) + goto err_wrong_af; + rc = ippool_newip(apn->v6.pool, &member, &addr, 0); if (rc < 0) goto err_pool_full; @@ -534,6 +557,11 @@ LOGPPDP(LOGL_ERROR, pdp, "Cannot allocate IP address from pool (full!)\n"); gtp_create_context_resp(gsn, pdp, -rc); return 0; /* Already in use, or no more available */ + +err_wrong_af: + LOGPPDP(LOGL_ERROR, pdp, "APN doesn't support requested EUA / AF type\n"); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_UNKNOWN_PDP); + return 0; } /* Internet-originated IP packet, needs to be sent via GTP towards MS */ -- To view, visit https://gerrit.osmocom.org/4266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8d1f7ec727c5d2d4427232015f81ed57d3440dff Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 14 14:39:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 14:39:18 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Make use of "dependon" feature in gengetopt Message-ID: Review at https://gerrit.osmocom.org/4267 sgsnemu: Make use of "dependon" feature in gengetopt The gengetopt syntax can specify that a particular command line argument depends on some other argument/option present. We can use this to provide useful feedback to the user at the command line parsing state, like --pingrate making no sense without --pinghost being specified. Change-Id: Ief27275e90e6bce23aed1e83874dbac98dd0926b --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo 2 files changed, 57 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/67/4267/1 diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 441322b..1c02baa 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -676,12 +676,60 @@ /* checks for required options */ /* checks for dependences among options */ + if (args_info->net_given && !args_info->createif_given) { + fprintf(stderr, + "%s: '--net' ('-n') option depends on option 'createif'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->defaultroute_given && !args_info->createif_given) { + fprintf(stderr, + "%s: '--defaultroute' option depends on option 'createif'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->ipup_given && !args_info->createif_given) { + fprintf(stderr, + "%s: '--ipup' option depends on option 'createif'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->ipdown_given && !args_info->createif_given) { + fprintf(stderr, + "%s: '--ipdown' option depends on option 'createif'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } if (args_info->tun_device_given && !args_info->createif_given) { fprintf(stderr, "%s: '--tun-device' option depends on option 'createif'%s\n", prog_name, (additional_error ? additional_error : "")); error_occurred = 1; } + if (args_info->pingrate_given && !args_info->pinghost_given) { + fprintf(stderr, + "%s: '--pingrate' option depends on option 'pinghost'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->pingsize_given && !args_info->pinghost_given) { + fprintf(stderr, + "%s: '--pingsize' option depends on option 'pinghost'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->pingcount_given && !args_info->pinghost_given) { + fprintf(stderr, + "%s: '--pingcount' option depends on option 'pinghost'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->pingquiet_given && !args_info->pinghost_given) { + fprintf(stderr, + "%s: '--pingquiet' option depends on option 'pinghost'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } return error_occurred; } diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 7592eb5..8136d3a 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -50,16 +50,17 @@ option "pwd" p "Login password" string default="hemmelig" no option "createif" - "Create local network interface" flag off -option "net" n "Network address for local interface" string no -option "defaultroute" - "Create default route" flag off -option "ipup" - "Script to run after link-up" string no -option "ipdown" - "Script to run after link-down" string no +option "net" n "Network address for local interface" string dependon="createif" no +option "defaultroute" - "Create default route" flag dependon="createif" off +option "ipup" - "Script to run after link-up" string dependon="createif" no +option "ipdown" - "Script to run after link-down" string dependon="createif" no option "tun-device" - "Name of the local network interface" string dependon="createif" no option "pinghost" - "Ping remote host" string no -option "pingrate" - "Number of ping req per second" int default="1" no -option "pingsize" - "Number of ping data bytes" int default="56" no -option "pingcount" - "Number of ping req to send" int default="0" no -option "pingquiet" - "Do not print ping packet info" flag off +option "pingrate" - "Number of ping req per second" int default="1" dependon="pinghost" no +option "pingsize" - "Number of ping data bytes" int default="56" dependon="pinghost" no +option "pingcount" - "Number of ping req to send" int default="0" dependon="pinghost" no +option "pingquiet" - "Do not print ping packet info" flag dependon="pinghost" off + option "no-tx-gpdu-seq" - "Don't transmit G-PDU sequence nums" flag off option "pdp-type" t "PDP Type" string default="v4" no typestr="(v4|v6)" -- To view, visit https://gerrit.osmocom.org/4267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief27275e90e6bce23aed1e83874dbac98dd0926b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 14 14:39:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 14:39:18 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Mark local functions 'static' Message-ID: Review at https://gerrit.osmocom.org/4268 sgsnemu: Mark local functions 'static' We don't need to export those to the global name space as they're not called from code in other files. Change-Id: I454249335ba46abdb3afbc669c4a06a06f39ae72 --- M sgsnemu/sgsnemu.c 1 file changed, 23 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/68/4268/1 diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index a85c9cf..7b7bb4e 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -161,13 +161,13 @@ int pingseq = 0; /* Ping sequence counter */ struct timeval firstping; -void signal_handler(int signo) +static void signal_handler(int signo) { if (state == 2) state = 3; /* Tell main loop to finish. */ } -int ipset(struct iphash_t *ipaddr, struct in46_addr *addr) +static int ipset(struct iphash_t *ipaddr, struct in46_addr *addr) { int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; @@ -183,7 +183,7 @@ return 0; } -int ipdel(struct iphash_t *ipaddr) +static int ipdel(struct iphash_t *ipaddr) { int hash = ippool_hash(&ipaddr->addr) % MAXCONTEXTS; struct iphash_t *h; @@ -201,7 +201,7 @@ return EOF; /* End of linked list and not found */ } -int ipget(struct iphash_t **ipaddr, struct in46_addr *addr) +static int ipget(struct iphash_t **ipaddr, struct in46_addr *addr) { int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; @@ -215,7 +215,7 @@ } /* Used to write process ID to file. Assume someone else will delete */ -void log_pid(char *pidfile) +static void log_pid(char *pidfile) { FILE *file; mode_t oldmask; @@ -229,7 +229,7 @@ fclose(file); } -int process_options(int argc, char **argv) +static int process_options(int argc, char **argv) { /* gengeopt declarations */ struct gengetopt_args_info args_info; @@ -955,7 +955,7 @@ } -int encaps_printf(struct pdp_t *pdp, void *pack, unsigned len) +static int encaps_printf(struct pdp_t *pdp, void *pack, unsigned len) { unsigned int i; printf("The packet looks like this:\n"); @@ -1004,7 +1004,7 @@ return proc_read(path); } -char *print_ipprot(int t) +static char *print_ipprot(int t) { switch (t) { case 1: @@ -1018,7 +1018,7 @@ }; } -char *print_icmptype(int t) +static char *print_icmptype(int t) { static char *ttab[] = { "Echo Reply", @@ -1044,7 +1044,7 @@ return (ttab[t]); } -int msisdn_add(struct ul16_t *src, struct ul16_t *dst, int add) +static int msisdn_add(struct ul16_t *src, struct ul16_t *dst, int add) { unsigned int n; uint64_t i64 = 0; @@ -1088,7 +1088,7 @@ } -int imsi_add(uint64_t src, uint64_t * dst, int add) +static int imsi_add(uint64_t src, uint64_t * dst, int add) { /* TODO: big endian / small endian ??? */ uint64_t i64 = 0; @@ -1123,7 +1123,7 @@ } /* Calculate time left until we have to send off next ping packet */ -int ping_timeout(struct timeval *tp) +static int ping_timeout(struct timeval *tp) { struct timezone tz; struct timeval tv; @@ -1145,7 +1145,7 @@ } /* Print out statistics when at the end of ping sequence */ -int ping_finish() +static int ping_finish() { struct timezone tz; struct timeval tv; @@ -1178,7 +1178,7 @@ } /* Handle a received ping packet. Print out line and update statistics. */ -int encaps_ping(struct pdp_t *pdp, void *pack, unsigned len) +static int encaps_ping(struct pdp_t *pdp, void *pack, unsigned len) { struct timezone tz; struct timeval tv; @@ -1247,8 +1247,8 @@ } /* Create a new ping packet and send it off to peer. */ -int create_ping(void *gsn, struct pdp_t *pdp, - struct in_addr *dst, int seq, unsigned int datasize) +static int create_ping(void *gsn, struct pdp_t *pdp, + struct in_addr *dst, int seq, unsigned int datasize) { struct ip_ping pack; @@ -1326,7 +1326,7 @@ return gtp_data_req(gsn, pdp, &pack, 28 + datasize); } -int delete_context(struct pdp_t *pdp) +static int delete_context(struct pdp_t *pdp) { if (tun && options.ipdown) @@ -1345,7 +1345,7 @@ static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; /* Callback for receiving messages from tun */ -int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; struct in46_addr src; @@ -1389,7 +1389,7 @@ return 0; } -int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) +static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) { struct in46_addr addr; @@ -1489,14 +1489,14 @@ return 0; } -int delete_pdp_conf(struct pdp_t *pdp, int cause) +static int delete_pdp_conf(struct pdp_t *pdp, int cause) { printf("Received delete PDP context response. Cause value: %d\n", cause); return 0; } -int echo_conf(int recovery) +static int echo_conf(int recovery) { if (recovery < 0) { @@ -1518,7 +1518,7 @@ return 0; } -int conf(int type, int cause, struct pdp_t *pdp, void *cbp) +static int conf(int type, int cause, struct pdp_t *pdp, void *cbp) { /* if (cause < 0) return 0; Some error occurred. We don't care */ switch (type) { @@ -1535,7 +1535,7 @@ } } -int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) +static int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { /* printf("encaps_tun. Packet received: forwarding to tun\n"); */ return tun_encaps((struct tun_t *)pdp->ipif, pack, len); -- To view, visit https://gerrit.osmocom.org/4268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I454249335ba46abdb3afbc669c4a06a06f39ae72 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 14 14:39:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 14:39:18 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Remove dead code: encaps_printf() Message-ID: Review at https://gerrit.osmocom.org/4269 sgsnemu: Remove dead code: encaps_printf() This function is never used/called, remove it. Change-Id: I37a447e4d5387e3fc5f4433ab20ceba7c446684b --- M sgsnemu/sgsnemu.c 1 file changed, 0 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/69/4269/1 diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 7b7bb4e..50eca63 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -955,19 +955,6 @@ } -static int encaps_printf(struct pdp_t *pdp, void *pack, unsigned len) -{ - unsigned int i; - printf("The packet looks like this:\n"); - for (i = 0; i < len; i++) { - printf("%02x ", (unsigned char)*(char *)(pack + i)); - if (!((i + 1) % 16)) - printf("\n"); - }; - printf("\n"); - return 0; -} - /* read a single value from a /procc file, up to 255 bytes, callee-allocated */ static char *proc_read(const char *path) { -- To view, visit https://gerrit.osmocom.org/4269 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37a447e4d5387e3fc5f4433ab20ceba7c446684b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 14 14:39:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 14:39:18 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Use getprotobynumber() in print_ipprot() Message-ID: Review at https://gerrit.osmocom.org/4270 sgsnemu: Use getprotobynumber() in print_ipprot() There's no point in sgsnemu doing a poor mans reimplementation of what the C library provides already by means of getprotobynumber() Change-Id: I8cdc460e4fa5d86d80addf6e5f341d2d80093a35 --- M sgsnemu/sgsnemu.c 1 file changed, 5 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/70/4270/1 diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 50eca63..23cf208 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -993,16 +993,12 @@ static char *print_ipprot(int t) { - switch (t) { - case 1: - return "ICMP"; - case 6: - return "TCP"; - case 17: - return "UDP"; - default: + struct protoent *pe = getprotobynumber(t); + + if (!pe) return "Unknown"; - }; + else + return pe->p_name; } static char *print_icmptype(int t) -- To view, visit https://gerrit.osmocom.org/4270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8cdc460e4fa5d86d80addf6e5f341d2d80093a35 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 14 14:39:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 14:39:45 +0000 Subject: osmo-ggsn[master]: ggsn: Avoid crash on wrong EUA type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d1f7ec727c5d2d4427232015f81ed57d3440dff Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 15:08:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 15:08:49 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn: Avoid crash on wrong EUA type In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Avoid crash on wrong EUA type ...................................................................... ggsn: Avoid crash on wrong EUA type If the EUA in the Create PDP Context Request was not supported by the given APN (e.g. IPv6 request for a v4-only APN), we crashed. Avoid this and add proper handling of this error case. Change-Id: I8d1f7ec727c5d2d4427232015f81ed57d3440dff --- M ggsn/ggsn.c 1 file changed, 28 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 67d040f..29d8473 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -432,6 +432,20 @@ msgb_free(msg); } +static bool apn_supports_ipv4(const struct apn_ctx *apn) +{ + if (apn->v4.cfg.static_prefix.addr.len || apn->v4.cfg.dynamic_prefix.addr.len) + return true; + return false; +} + +static bool apn_supports_ipv6(const struct apn_ctx *apn) +{ + if (apn->v6.cfg.static_prefix.addr.len || apn->v6.cfg.dynamic_prefix.addr.len) + return true; + return false; +} + int create_context_ind(struct pdp_t *pdp) { static char name_buf[256]; @@ -483,6 +497,10 @@ } if (addr.len == sizeof(struct in_addr)) { + /* does this APN actually have an IPv4 pool? */ + if (!apn_supports_ipv4(apn)) + goto err_wrong_af; + rc = ippool_newip(apn->v4.pool, &member, &addr, 0); if (rc < 0) goto err_pool_full; @@ -496,6 +514,11 @@ } } else if (addr.len == sizeof(struct in6_addr)) { struct in46_addr tmp; + + /* does this APN actually have an IPv6 pool? */ + if (!apn_supports_ipv6(apn)) + goto err_wrong_af; + rc = ippool_newip(apn->v6.pool, &member, &addr, 0); if (rc < 0) goto err_pool_full; @@ -534,6 +557,11 @@ LOGPPDP(LOGL_ERROR, pdp, "Cannot allocate IP address from pool (full!)\n"); gtp_create_context_resp(gsn, pdp, -rc); return 0; /* Already in use, or no more available */ + +err_wrong_af: + LOGPPDP(LOGL_ERROR, pdp, "APN doesn't support requested EUA / AF type\n"); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_UNKNOWN_PDP); + return 0; } /* Internet-originated IP packet, needs to be sent via GTP towards MS */ -- To view, visit https://gerrit.osmocom.org/4266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8d1f7ec727c5d2d4427232015f81ed57d3440dff Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 14 15:08:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 15:08:58 +0000 Subject: osmo-ggsn[master]: sgsnemu: Mark local functions 'static' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I454249335ba46abdb3afbc669c4a06a06f39ae72 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 15:09:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 15:09:00 +0000 Subject: osmo-ggsn[master]: sgsnemu: Remove dead code: encaps_printf() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4269 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I37a447e4d5387e3fc5f4433ab20ceba7c446684b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 15:09:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 14 Oct 2017 15:09:05 +0000 Subject: osmo-ggsn[master]: sgsnemu: Use getprotobynumber() in print_ipprot() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8cdc460e4fa5d86d80addf6e5f341d2d80093a35 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 14 18:32:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 14 Oct 2017 18:32:20 +0000 Subject: libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Patch Set 3: > That's regression test - it's not meant to be human-verifiable. On the contrary. If we cannot easily see that the test is correct, the whole test is pointless. If it verifies arbitrary hex dumps and these hex dumps are plain wrong without us noticing, that's worse than no test. If anything in the code ever changes, we need to be able to work with the code and understand what it is doing without effort. So yes, we can shape the strings such that reading hexdumps thereof is easy, like simply the alphabet from A-Z. But with these free form texts, the test output should definitely not be hex dumps. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 15 03:39:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 03:39:08 +0000 Subject: [PATCH] python/osmo-python-tests[master]: add osmo_ipa.py, from originally openbsc.git/contrib/ipa.py Message-ID: Review at https://gerrit.osmocom.org/4271 add osmo_ipa.py, from originally openbsc.git/contrib/ipa.py At least now that openbsc.git has been split, the IPA and Ctrl API offered by this file are used across multiple git repositories for python tests. Instead of having a separate copy of ipa.py in each, have one here. Rename to osmo_ipa.py to avoid any confusion between old and new files that might be lying around in the python path. Change-Id: Iaef955f04b97e8f266339b37b46d2523d1247cb9 --- M osmopy/__init__.py A osmopy/osmo_ipa.py 2 files changed, 280 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/71/4271/1 diff --git a/osmopy/__init__.py b/osmopy/__init__.py index f6ed99b..e211108 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -2,4 +2,5 @@ __version__ = '0.0.1' __all__ = ['obscvty', 'osmodumpdoc', 'osmotestconfig', 'osmotestvty', - 'osmoutil'] + 'osmoutil', + 'osmo_ipa',] diff --git a/osmopy/osmo_ipa.py b/osmopy/osmo_ipa.py new file mode 100755 index 0000000..71cbf45 --- /dev/null +++ b/osmopy/osmo_ipa.py @@ -0,0 +1,278 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexer: add/remove/parse (extended) header + """ + version = "0.0.5" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL=0x00, CCM=0xFE, SCCP=0xFD, OML=0xFF, OSMO=0xEE, MGCP_OLD=0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL=0, MGCP=1, LAC=2, SMSC=3, ORC=4, GSUP=5, OAP=6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING=0x00, PONG=0x01, ID_GET=0x04, ID_RESP=0x05, ID_ACK=0x06, SCCP_OLD=0xFF) + _IDTAG = dict(SERNR=0, UNITNAME=1, LOCATION=2, TYPE=3, EQUIPVERS=4, SWVERSION=5, IPADDR=6, MACADDR=7, UNIT=8) + CTRL_GET = 'GET' + CTRL_SET = 'SET' + CTRL_REP = 'REPLY' + CTRL_ERR = 'ERR' + CTRL_TRAP = 'TRAP' + + def _l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p is None: + return 'UNKNOWN' + return list(d.keys())[list(d.values()).index(p)] + + def _tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self._l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self._l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self._l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self._l(self._IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext=None): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext is None: + return struct.pack(">HB", len(data) + 1, proto) + data + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + + def del_header(self, data): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length, IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + if not len(data): + return None, None, None, None + (dlen, proto) = struct.unpack('>HB', data[:3]) + if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: # there's extension which we have to unpack + return struct.unpack('>HBB', data[:4]) + (data[4:], ) # length, protocol, extension, data + return dlen, proto, None, data[3:] # length, protocol, _, data + + def split_combined(self, data): + """ + Split the data which contains multiple concatenated IPA messages into tuple (first, rest) where rest contains remaining messages, first is the single IPA message + """ + (length, _, _, _) = self.del_header(data) + return data[:(length + 3)], data[(length + 3):] + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self._tag(self._IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self._tag(self._IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self._tag(self._IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self._tag(self._IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self._tag(self._IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self._tag(self._IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self._tag(self._IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self._tag(self._IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self._tag(self._IDTAG['UNIT'], data) + + def identity(self, unit=b'', mac=b'', location=b'', utype=b'', equip=b'', sw=b'', name=b'', serial=b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING']) + + def pong(self): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG']) + + def id_ack(self): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK']) + + def id_get(self): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET']) + + def id_resp(self, data): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP']) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexer + """ + def __init__(self): + random.seed() + + def add_header(self, data): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL']) + + def rem_header(self, data): + """ + Remove CTRL header, check for appropriate protocol and extension + """ + (_, proto, ext, d) = super(Ctrl, self).del_header(data) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return None + return d + + def parse(self, data, op=None): + """ + Parse Ctrl string returning (var, value) pair + var could be None in case of ERROR message + value could be None in case of GET message + """ + (s, i, v) = data.split(' ', 2) + if s == self.CTRL_ERR: + return None, v + if s == self.CTRL_GET: + return v, None + (s, i, var, val) = data.split(' ', 3) + if s == self.CTRL_TRAP and i != '0': + return None, '%s with non-zero id %s' % (s, i) + if op is not None and i != op: + if s == self.CTRL_GET + '_' + self.CTRL_REP or s == self.CTRL_SET + '_' + self.CTRL_REP: + return None, '%s with unexpected id %s' % (s, i) + return var, val + + def trap(self, var, val): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("%s 0 %s %s" % (self.CTRL_TRAP, var, val)) + + def cmd(self, var, val=None): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxsize) + if val is not None: + return r, self.add_header("%s %s %s %s" % (self.CTRL_SET, r, var, val)) + return r, self.add_header("%s %s %s" % (self.CTRL_GET, r, var)) + + def verify(self, reply, r, var, val=None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val is not None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexer v%s loaded." % IPA.version) -- To view, visit https://gerrit.osmocom.org/4271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaef955f04b97e8f266339b37b46d2523d1247cb9 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 15 03:39:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 03:39:08 +0000 Subject: [PATCH] python/osmo-python-tests[master]: add osmo_verify_transcript_{vty, ctrl}.py for easier vty and ... Message-ID: Review at https://gerrit.osmocom.org/4272 add osmo_verify_transcript_{vty,ctrl}.py for easier vty and ctrl testing While adding VTY and CTRL tests to new programs like OsmoHLR, I wanted to have a simple way to translate a VTY interaction transcript to a VTY python test. It is fairly trivial to simply read in a transcript, extract both the commands to send as well as the expected results, and to verify these without having to write one line of application-specific code. From there it was just a little step to allow the same for CTRL interaction. With osmo_verify_transcript_vty.py and osmo_verify_transcript_ctrl.py, it is possible to have a simple text file of a telnet VTY or CTRL interface interaction and run it against a given application. With the --update option, the scripts run the given command and rewrite the transcript file to whatever the application currently produces as response. Backed by version control, it is super easy to tweak commands, --update the test results and verify that only the desired bits changed. A '...' wildcard can skip any number of lines in the expected result and is usually preserved during --update. This python3 implementation is independent from the previous obscvty implementations. Take the opportunity to clarify/fix a few aspects: for example, it is now possible to verify the hints that the interactive VTY displays when the user enters '?' in various places, and to evaluate the prompt character '>'/'#'. Unitl now, code is duplicated/scattered across various vty_test_runner.py scripts in different git repositories. Now, a VTY or CTRL transcript is enough to put a complete test in place. The simplest invocation is directly from the Makefile, feeding an application commandline, the proper port number to contact it and e.g. a VTY prompt name. This new code is also usable as python modules, to be able to build more complex tests that require specialized intermediate actions, possibly coordinating launch of applications or data manipulation. The first repository to employ this is osmo-hlr.git. See change-ids I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 for VTY and Iff93abe370b8f3ecf42082d1d0eaa1fbeca5b122 for CTRL. Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c --- M osmopy/__init__.py A osmopy/osmo_verify_transcript_common.py A osmopy/osmo_verify_transcript_ctrl.py A osmopy/osmo_verify_transcript_vty.py M setup.py 5 files changed, 668 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/72/4272/1 diff --git a/osmopy/__init__.py b/osmopy/__init__.py index e211108..01ff3de 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -3,4 +3,7 @@ __all__ = ['obscvty', 'osmodumpdoc', 'osmotestconfig', 'osmotestvty', 'osmoutil', - 'osmo_ipa',] + 'osmo_ipa', + 'osmo_verify_transcript_common', + 'osmo_verify_transcript_vty', + 'osmo_verify_transcript_ctrl'] diff --git a/osmopy/osmo_verify_transcript_common.py b/osmopy/osmo_verify_transcript_common.py new file mode 100644 index 0000000..4c7d815 --- /dev/null +++ b/osmopy/osmo_verify_transcript_common.py @@ -0,0 +1,372 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Common code for verify_transcript_vty.py and verify_transcript_ctrl.py. +''' + +import argparse +import sys +import os +import subprocess +import time +import traceback +import socket +import shlex + + +class Interact: + + class StepBase: + command = None + result = None + leading_blanks = None + + def __init__(self): + self.result = [] + + def verify_interact_state(self, interact_instance): + # for example to verify that the last VTY prompt received shows the + # right node. + pass + + def command_str(self, interact_instance=None): + return self.command + + def __str__(self): + return '%s\n%s' % (self.command_str(), '\n'.join(self.result)) + + @staticmethod + def is_next_step(line, interact_instance): + assert not "implemented by InteractVty.VtyStep and InteractCtrl.CtrlStep" + + socket = None + + def __init__(self, step_class, port, host, verbose=False, update=False): + ''' + host is the hostname to connect to. + port is the CTRL port to connect on. + ''' + self.Step = step_class + self.port = port + self.host = host + self.verbose = verbose + self.update = update + + def connect(self): + assert self.socket is None + retries = 30 + took = 0 + while True: + took += 1 + try: + self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.socket.setblocking(1) + self.socket.connect((self.host, int(self.port))) + except IOError: + retries -= 1 + if retries <= 0: + raise + time.sleep(.1) + continue + break + + def close(self): + if self.socket is None: + return + self.socket.close() + self.socket = None + + def command(self, command): + assert not "implemented separately by InteractVty and InteractCtrl" + + def verify_transcript_file(self, transcript_file): + with open(transcript_file, 'r') as f: + content = f.read() + + try: + result = self.verify_transcript(content) + except: + print('Error while verifying transcript file %r' % transcript_file, file=sys.stderr) + sys.stderr.flush() + raise + + if not self.update: + return + content = '\n'.join(result) + with open(transcript_file, 'w') as f: + f.write(content) + + def verify_transcript(self, transcript): + '''' + transcript is a "screenshot" of a session, a multi-line string + including commands and expected results. + Feed commands to self.command() and verify the expected results. + ''' + + # parse steps + steps = [] + step = None + blank_lines = 0 + for line in transcript.splitlines(): + if not line: + blank_lines += 1 + continue + next_step_started = self.Step.is_next_step(line, self) + if next_step_started: + if step: + steps.append(step) + step = next_step_started + step.leading_blanks = blank_lines + blank_lines = 0 + elif step: + # we only count blank lines directly preceding the start of a + # next step. Insert blank lines in the middle of a response + # back into the response: + if blank_lines: + step.result.extend([''] * blank_lines) + blank_lines = 0 + step.result.append(line) + if step: + steps.append(step) + step = None + + actual_result = [] + + # run steps + step_nr = 0 + for step in steps: + step_nr += 1 + try: + if self.verbose: + if step.leading_blanks: + print('\n' * step.leading_blanks, end='') + print(step.command_str()) + sys.stdout.flush() + + step.verify_interact_state(self) + + res = self.command(step.command) + + if self.verbose: + sys.stderr.flush() + sys.stdout.flush() + print('\n'.join(res)) + sys.stdout.flush() + + if step.leading_blanks: + actual_result.extend([''] * step.leading_blanks) + actual_result.append(step.command_str(self)) + + match_result = self.match_lines(step.result, res) + + if self.update: + if match_result is True: + # preserve any wildcards + actual_result.extend(step.result) + else: + # mismatch, take exactly what came in + actual_result.extend(res) + continue + if match_result is not True: + raise Exception('Result mismatch:\n%s\n\nExpected:\n[\n%s\n]\n\nGot:\n[\n%s\n%s\n]' + % (match_result, step, step.command_str(), '\n'.join(res))) + except: + print('Error during transcript step %d:\n[\n%s\n]' % (step_nr, step), + file=sys.stderr) + sys.stderr.flush() + raise + + # final line ending + actual_result.append('') + return actual_result + + @staticmethod + def match_lines(expect, got): + ''' + Match two lists of strings, allowing certain wildcards: + - In 'expect', if a line is exactly '...', it matches any number of + arbitrary lines in 'got'; the implementation is trivial and skips + lines to the first occurence in 'got' that continues after '...'. + + Return 'True' on match, or a string describing the mismatch. + ''' + def match_line(expect_line, got_line): + return expect_line == got_line + + e = 0 + g = 0 + while e < len(expect): + if expect[e] == '...': + e += 1 + + if e >= len(expect): + # anything left in 'got' is accepted. + return True + + # look for the next occurence of the expected line in 'got' + while g < len(got) and not match_line(expect[e], got[g]): + g += 1 + continue + + if g >= len(got): + return 'Cannot find line %r' % expect[e] + + if not match_line(expect[e], got[g]): + return 'Mismatch:\nExpect:\n%s\nGot:\n%s' % (expect[e], got[g]) + + e += 1 + g += 1 + + if g < len(got): + return 'Did not expect line %r' % got[g] + return True + +def end_process(proc): + if not proc: + return + + rc = proc.poll() + if rc is not None: + print('Process has already terminated with', rc) + proc.wait() + return + + proc.terminate() + time_to_wait_for_term = 5 + wait_step = 0.001 + waited_time = 0 + while True: + # poll returns None if proc is still running + if proc.poll() is not None: + break + waited_time += wait_step + # make wait_step approach 1.0 + wait_step = (1. + 5. * wait_step) / 6. + if waited_time >= time_to_wait_for_term: + break + time.sleep(wait_step) + + if proc.poll() is None: + # termination seems to be slower than that, let's just kill + proc.kill() + print("Killed child process") + elif waited_time > .002: + print("Terminating took %.3fs" % waited_time) + proc.wait() + +class Application: + proc = None + _devnull = None + + @staticmethod + def devnull(): + if Application._devnull is None: + Application._devnull = open(os.devnull, 'w') + return Application._devnull + + def __init__(self, command_tuple, purge_output=True): + self.command_tuple = command_tuple + self.purge_output = purge_output + + def run(self): + out_err = None + if self.purge_output: + out_err = Application.devnull() + + print('Launching: cd %r; %s' % (os.getcwd(), ' '.join(self.command_tuple))) + self.proc = subprocess.Popen(self.command_tuple, stdout=out_err, stderr=out_err) + + def stop(self): + end_process(self.proc) + +def verify_application(command_tuple, interact, transcript_file, verbose): + passed = None + application = None + + sys.stdout.flush() + sys.stderr.flush() + + if command_tuple: + application = Application(command_tuple, purge_output=not verbose) + application.run() + + try: + interact.connect() + interact.verify_transcript_file(transcript_file) + passed = True + except: + traceback.print_exc() + passed = False + interact.close() + + if application: + application.stop() + + sys.stdout.flush() + sys.stderr.flush() + + return passed + +def common_parser(): + parser = argparse.ArgumentParser() + parser.add_argument('-r', '--run', dest='command_str', + help='command to run to launch application to test,' + ' including command line arguments. If omitted, no' + ' application is launched.') + parser.add_argument('-p', '--port', dest='port', + help="Port that the application opens.") + parser.add_argument('-H', '--host', dest='host', default='localhost', + help="Host that the application opens the port on.") + parser.add_argument('-u', '--update', dest='update', action='store_true', + help='Do not verify, but OVERWRITE transcripts based on' + ' the applications current behavior. OVERWRITES TRANSCRIPT' + ' FILES.') + parser.add_argument('-v', '--verbose', action='store_true', + help='Print commands and application output') + parser.add_argument('transcript_files', nargs='*', help='transcript files to verify') + return parser + +def main(command_str, transcript_files, interact, verbose): + + if command_str: + command_tuple = shlex.split(command_str) + else: + command_tuple = None + + results = [] + for t in transcript_files: + passed = verify_application(command_tuple=command_tuple, + interact=interact, + transcript_file=t, + verbose=verbose) + results.append((passed, t)) + + print('\nRESULTS:') + all_passed = True + for passed, t in results: + print('%s: %s' % ('pass' if passed else 'FAIL', t)) + all_passed = all_passed and passed + print() + + if not all_passed: + sys.exit(1) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_ctrl.py b/osmopy/osmo_verify_transcript_ctrl.py new file mode 100755 index 0000000..3c3559e --- /dev/null +++ b/osmopy/osmo_verify_transcript_ctrl.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run CTRL test transcripts against a given application. + +A CTRL transcript contains CTRL commands and their expected results. +It looks like: + +" +SET 1 var val +SET_REPLY 1 var OK +GET 2 var +GET_REPLY 2 var val +" + +The application to be tested is described by +- a binary to run, +- command line arguments to pass to the binary, +- the CTRL port. + +This module can either be run directly to run or update a given CTRL transcript, +or it can be imported as a module to run more complex setups. +''' + +import re + +from osmopy.osmo_verify_transcript_common import * +from osmopy.osmo_ipa import Ctrl, IPA + +class InteractCtrl(Interact): + next_id = 1 + keep_ids = True + re_command = re.compile('^(SET|GET) ([^ ]*) (.*)$') + + class CtrlStep(Interact.StepBase): + + @staticmethod + def is_next_step(line, interact_instance): + m = InteractCtrl.re_command.match(line) + if not m: + return None + next_step = InteractCtrl.CtrlStep() + + set_get = m.group(1) + cmd_id = m.group(2) + var_val = m.group(3) + if not InteractCtrl.keep_ids: + cmd_id = InteractCtrl.next_id + InteractCtrl.next_id += 1 + next_step.command = '%s %d %s' % (set_get, cmd_id, var_val) + + return next_step + + def __init__(self, port, host, verbose=False, update=False, keep_ids=True): + InteractCtrl.keep_ids = keep_ids + super().__init__(InteractCtrl.CtrlStep, port=port, host=host, verbose=verbose, update=update) + + def send(self, data): + data = Ctrl().add_header(data) + return self.socket.send(data) == len(data) + + def receive(self): + responses = [] + data = self.socket.recv(4096) + while (len(data)>0): + (response_with_header, data) = IPA().split_combined(data) + response = Ctrl().rem_header(response_with_header) + responses.append(response.decode('utf-8')) + return responses + + def command(self, command): + assert self.send(command) + res = self.receive() + sys.stdout.flush() + sys.stderr.flush() + return res + +if __name__ == '__main__': + parser = common_parser() + parser.add_argument('-i', '--keep-ids', dest='keep_ids', action='store_true', + help='With --update, default is to overwrite the command IDs' + ' so that they are consecutive numbers starting from 1.' + ' With --keep-ids, do not change these command IDs.') + args = parser.parse_args() + + interact = InteractCtrl(args.port, args.host, args.verbose, args.update, args.keep_ids) + + main(command_str=args.command_str, + transcript_files=args.transcript_files, + interact=interact, + verbose=args.verbose) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_vty.py b/osmopy/osmo_verify_transcript_vty.py new file mode 100755 index 0000000..3a4d630 --- /dev/null +++ b/osmopy/osmo_verify_transcript_vty.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run VTY test transcripts against a given application. + +A VTY transcript contains VTY commands and their expected results. +It looks like: + +" +OsmoHLR> enable + +OsmoHLR# subscriber show imsi 123456789023000 +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber show msisdn 12345 +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber create imsi 123456789023000 +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + No auth data +" + +The application to be tested is described by +- a binary to run, +- command line arguments to pass to the binary, +- the VTY telnet port, +- the application name as printed in the VTY prompt. + +This module can either be run directly to run or update a given VTY transcript, +or it can be imported as a module to run more complex setups. +''' + +import re + +from osmopy.osmo_verify_transcript_common import * + +class InteractVty(Interact): + + class VtyStep(Interact.StepBase): + expect_node = None # e.g. '(config-net)' + expect_prompt_char = None # '>' or '#' + + def __init__(self, prompt): + super().__init__() + self.prompt = prompt + + def verify_interact_state(self, interact_instance): + if interact_instance.update: + return + if interact_instance.this_node != self.expect_node: + raise Exception('Mismatch: expected VTY node %r in the prompt, got %r' + % (self.expect_node, interact_instance.this_node)) + if interact_instance.this_prompt_char != self.expect_prompt_char: + raise Exception('Mismatch: expected VTY prompt character %r, got %r' + % (self.expect_prompt_char, interact_instance.this_prompt_char)) + + @staticmethod + def is_next_step(line, interact_instance): + m = interact_instance.re_prompt.match(line) + if not m: + return None + next_step = InteractVty.VtyStep(interact_instance.prompt) + next_step.expect_node = m.group(1) + next_step.expect_prompt_char = m.group(2) + next_step.command = m.group(3) + return next_step + + def command_str(self, interact_instance=None): + if interact_instance is None: + node = self.expect_node + prompt_char = self.expect_prompt_char + else: + node = interact_instance.last_node + prompt_char = interact_instance.last_prompt_char + if node: + node = '(%s)' % node + node = node or '' + return '%s%s%s %s' % (self.prompt, node, prompt_char, self.command) + + def __init__(self, prompt, port, host, verbose, update): + self.prompt = prompt + self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) + super().__init__(InteractVty.VtyStep, port, host, verbose, update) + + def connect(self): + self.this_node = None + self.this_prompt_char = '>' # slight cheat for initial prompt char + self.last_node = None + self.last_prompt_char = None + + super().connect() + # receive the first welcome message and discard + self.socket.recv(4096) + + def _command(self, command_str, timeout=10): + self.socket.send(command_str.encode()) + + waited_since = time.time() + received_lines = [] + last_line = '' + + while True: + new_data = self.socket.recv(4096).decode('utf-8') + + last_line = "%s%s" % (last_line, new_data) + + if last_line: + lines = last_line.splitlines() + received_lines.extend(lines[:-1]) + last_line = lines[-1] + + match = self.re_prompt.match(last_line) + if not match: + if time.time() - waited_since > timeout: + raise IOError("Failed to read data (did the app crash?)") + time.sleep(.1) + continue + + self.last_node = self.this_node + self.last_prompt_char = self.this_prompt_char + self.this_node = match.group(1) or None + self.this_prompt_char = match.group(2) + break + + # expecting to have received the command we sent as echo, remove it + clean_command_str = command_str.strip() + if clean_command_str.endswith('?'): + clean_command_str = clean_command_str[:-1] + if received_lines and received_lines[0] == clean_command_str: + received_lines = received_lines[1:] + return received_lines + + def command(self, command_str, timeout=10): + command_str = command_str or '\r' + if command_str[-1] not in '?\r\t': + command_str = command_str + '\r' + + received_lines = self._command(command_str, timeout) + + if command_str[-1] == '?': + self._command('\x03', timeout) + + return received_lines + +if __name__ == '__main__': + parser = common_parser() + parser.add_argument('-n', '--prompt-name', dest='prompt', + help="Name used in application's telnet VTY prompt.") + args = parser.parse_args() + + interact = InteractVty(args.prompt, args.port, args.host, args.verbose, args.update) + + main(command_str=args.command_str, + transcript_files=args.transcript_files, + interact=interact, + verbose=args.verbose) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/setup.py b/setup.py index 44e7fd1..9c25a0d 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,9 @@ version = __version__, packages = ["osmopy"], scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py", - "osmopy/osmotestvty.py"], + "osmopy/osmotestvty.py", + "osmopy/osmo_verify_transcript_vty.py", + "osmopy/osmo_verify_transcript_ctrl.py"], license = "AGPLv3", description = "Osmopython: osmocom testing scripts", author = "Katerina Barone-Adesi", -- To view, visit https://gerrit.osmocom.org/4272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 15 03:47:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 03:47:24 +0000 Subject: [PATCH] osmo-hlr[master]: add test_nodes.vty Message-ID: Review at https://gerrit.osmocom.org/4274 add test_nodes.vty Automatically picked up by the vty-test target, by file name extension. Change-Id: I8dba373cee1be954504f79c3305b0111071757e7 --- M tests/Makefile.am A tests/test_nodes.vty 2 files changed, 118 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/74/4274/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index 8f1826d..cddea0b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,6 +26,7 @@ testsuite.at \ $(srcdir)/package.m4 \ $(TESTSUITE) \ + test_nodes.vty \ test_subscriber.vty \ ctrl_test_runner.py \ $(NULL) diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty new file mode 100644 index 0000000..0de4ff4 --- /dev/null +++ b/tests/test_nodes.vty @@ -0,0 +1,117 @@ +OsmoHLR> list + show version + show online-help + list + exit + help + enable + terminal length <0-512> + terminal no length + who + show history + logging enable +... + show logging vty + show alarms + subscriber (imsi|msisdn|id) IDENT show + +OsmoHLR> enable +OsmoHLR# list + help + list + write terminal + write file + write memory + write + show running-config + exit + disable + configure terminal + copy running-config startup-config + show startup-config + show version + show online-help + terminal length <0-512> + terminal no length + who + show history + terminal monitor + terminal no monitor + logging enable +... + +OsmoHLR# configure terminal +OsmoHLR(config)# list + help + list + write terminal + write file + write memory + write + show running-config + exit + end +... + hlr + +OsmoHLR(config)# hlr +OsmoHLR(config-hlr)# list + help + list + write terminal + write file + write memory + write + show running-config + exit + end + gsup + +OsmoHLR(config-hlr)# gsup +OsmoHLR(config-hlr-gsup)# list + help + list + write terminal + write file + write memory + write + show running-config + exit + end + bind ip A.B.C.D + +OsmoHLR(config-hlr-gsup)# exit +OsmoHLR(config-hlr)# exit +OsmoHLR(config)# exit +OsmoHLR# configure terminal +OsmoHLR(config)# hlr +OsmoHLR(config-hlr)# gsup +OsmoHLR(config-hlr-gsup)# end +OsmoHLR# disable +OsmoHLR> enable + +OsmoHLR# show running-config + +Current configuration: +! +! +log stderr + logging filter all 1 + logging color 1 + logging print category 1 + logging print extended-timestamp 1 + logging level all debug + logging level main debug + logging level db debug + logging level auc debug +... +! +line vty + no login +! +ctrl + bind 127.0.0.1 +hlr + gsup + bind ip 127.0.0.1 +end -- To view, visit https://gerrit.osmocom.org/4274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8dba373cee1be954504f79c3305b0111071757e7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 15 03:47:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 03:47:23 +0000 Subject: [PATCH] osmo-hlr[master]: implement subscriber vty interface, tests Message-ID: Review at https://gerrit.osmocom.org/4273 implement subscriber vty interface, tests Implement VTY commands for subscriber manipulation: - create / delete subscriber - modify MSISDN - add/edit/remove 2G and 3G authentication data - show by IMSI, MSISDN or DB ID. (enable/disable CS/PS and purge/unpurge to follow later.) Implement VTY unit tests for the new commands using new osmo_verify_transcript_vty.py from osmo-python-tests. Depends: libosmocore I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 osmo-python-tests Id47331009910e651372b9c9c76e12f2e8964cc2c Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 --- M src/Makefile.am M src/hlr_vty.c A src/hlr_vty_subscr.c A src/hlr_vty_subscr.h M tests/Makefile.am A tests/test_subscriber.vty 6 files changed, 859 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/73/4273/1 diff --git a/src/Makefile.am b/src/Makefile.am index b410ff3..fc7c653 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,6 +23,7 @@ rand.h \ ctrl.h \ hlr_vty.h \ + hlr_vty_subscr.h \ $(NULL) bin_PROGRAMS = \ @@ -46,6 +47,7 @@ logging.c \ rand_urandom.c \ hlr_vty.c \ + hlr_vty_subscr.c \ $(NULL) osmo_hlr_LDADD = \ diff --git a/src/hlr_vty.c b/src/hlr_vty.c index 946117e..a5eb26f 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -26,6 +26,7 @@ #include #include "hlr_vty.h" +#include "hlr_vty_subscr.h" static struct hlr *g_hlr = NULL; @@ -135,4 +136,6 @@ install_default(GSUP_NODE); install_element(GSUP_NODE, &cfg_hlr_gsup_bind_ip_cmd); + + hlr_vty_subscriber_init(hlr); } diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c new file mode 100644 index 0000000..018872a --- /dev/null +++ b/src/hlr_vty_subscr.c @@ -0,0 +1,484 @@ +/* OsmoHLR subscriber management VTY implementation */ +/* (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "hlr.h" +#include "db.h" + +struct vty; + +#define osmo_hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) + +static struct hlr *g_hlr = NULL; + +static void subscr_dump_full_vty(struct vty *vty, struct hlr_subscriber *subscr) +{ + int rc; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + + vty_out(vty, " ID: %"PRIu64"%s", subscr->id, VTY_NEWLINE); + + vty_out(vty, " IMSI: %s%s", subscr->imsi ? subscr->imsi : "none", VTY_NEWLINE); + vty_out(vty, " MSISDN: %s%s", *subscr->msisdn ? subscr->msisdn : "none", VTY_NEWLINE); + if (*subscr->vlr_number) + vty_out(vty, " VLR number: %s%s", subscr->vlr_number, VTY_NEWLINE); + if (*subscr->sgsn_number) + vty_out(vty, " SGSN number: %s%s", subscr->sgsn_number, VTY_NEWLINE); + if (*subscr->sgsn_address) + vty_out(vty, " SGSN address: %s%s", subscr->sgsn_address, VTY_NEWLINE); + if (subscr->periodic_lu_timer) + vty_out(vty, " Periodic LU timer: %u%s", subscr->periodic_lu_timer, VTY_NEWLINE); + if (subscr->periodic_rau_tau_timer) + vty_out(vty, " Periodic RAU/TAU timer: %u%s", subscr->periodic_rau_tau_timer, VTY_NEWLINE); + if (subscr->lmsi) + vty_out(vty, " LMSI: %x%s", subscr->lmsi, VTY_NEWLINE); + if (!subscr->nam_cs) + vty_out(vty, " CS disabled%s", VTY_NEWLINE); + if (subscr->ms_purged_cs) + vty_out(vty, " CS purged%s", VTY_NEWLINE); + if (!subscr->nam_ps) + vty_out(vty, " PS disabled%s", VTY_NEWLINE); + if (subscr->ms_purged_ps) + vty_out(vty, " PS purged%s", VTY_NEWLINE); + + if (!*subscr->imsi) + return; + + OSMO_ASSERT(g_hlr); + rc = db_get_auth_data(g_hlr->dbc, subscr->imsi, &aud2g, &aud3g, NULL); + + if (rc) { + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else { + vty_out(vty, "%% Error retrieving data from database (%d)%s", rc, VTY_NEWLINE); + return; + } + } + + if (aud2g.type != OSMO_AUTH_TYPE_NONE && aud2g.type != OSMO_AUTH_TYPE_GSM) { + vty_out(vty, "%% Error: 2G auth data is not of type 'GSM'%s", VTY_NEWLINE); + aud2g = (struct osmo_sub_auth_data){}; + } + + if (aud3g.type != OSMO_AUTH_TYPE_NONE && aud3g.type != OSMO_AUTH_TYPE_UMTS) { + vty_out(vty, "%% Error: 3G auth data is not of type 'UMTS'%s", VTY_NEWLINE); + aud3g = (struct osmo_sub_auth_data){}; + } + + if (aud2g.algo != OSMO_AUTH_ALG_NONE && aud2g.type != OSMO_AUTH_TYPE_NONE) { + vty_out(vty, " 2G auth: %s%s", + osmo_auth_alg_name(aud2g.algo), VTY_NEWLINE); + vty_out(vty, " KI=%s%s", + osmo_hexdump_buf(aud2g.u.gsm.ki), VTY_NEWLINE); + } + + if (aud3g.algo != OSMO_AUTH_ALG_NONE && aud3g.type != OSMO_AUTH_TYPE_NONE) { + vty_out(vty, " 3G auth: %s%s", osmo_auth_alg_name(aud3g.algo), VTY_NEWLINE); + vty_out(vty, " K=%s%s", osmo_hexdump_buf(aud3g.u.umts.k), VTY_NEWLINE); + vty_out(vty, " %s=%s%s", aud3g.u.umts.opc_is_op? "OP" : "OPC", + osmo_hexdump_buf(aud3g.u.umts.opc), VTY_NEWLINE); + vty_out(vty, " IND-bitlen=%u", aud3g.u.umts.ind_bitlen); + if (aud3g.u.umts.sqn) + vty_out(vty, " last-SQN=%"PRIu64, aud3g.u.umts.sqn); + vty_out(vty, VTY_NEWLINE); + } +} + +static int get_subscr_by_argv(struct vty *vty, const char *type, const char *id, struct hlr_subscriber *subscr) +{ + int rc = -1; + if (strcmp(type, "imsi") == 0) + rc = db_subscr_get_by_imsi(g_hlr->dbc, id, subscr); + else if (strcmp(type, "msisdn") == 0) + rc = db_subscr_get_by_msisdn(g_hlr->dbc, id, subscr); + else if (strcmp(type, "id") == 0) + rc = db_subscr_get_by_id(g_hlr->dbc, atoll(id), subscr); + if (rc) + vty_out(vty, "%% No subscriber for %s = '%s'%s", + type, id, VTY_NEWLINE); + return rc; +} + +#define SUBSCR_CMD "subscriber " +#define SUBSCR_CMD_HELP "Subscriber management commands\n" + +#define SUBSCR_ID "(imsi|msisdn|id) IDENT " +#define SUBSCR_ID_HELP \ + "Identify subscriber by IMSI\n" \ + "Identify subscriber by MSISDN (phone number)\n" \ + "Identify subscriber by database ID\n" \ + "IMSI/MSISDN/ID of the subscriber\n" + +#define SUBSCR SUBSCR_CMD SUBSCR_ID +#define SUBSCR_HELP SUBSCR_CMD_HELP SUBSCR_ID_HELP + +#define SUBSCR_UPDATE SUBSCR "update " +#define SUBSCR_UPDATE_HELP SUBSCR_HELP "Set or update subscriber data\n" + +DEFUN(subscriber_show, + subscriber_show_cmd, + SUBSCR "show", + SUBSCR_HELP "Show subscriber information\n") +{ + struct hlr_subscriber subscr; + const char *id_type = argv[0]; + const char *id = argv[1]; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + subscr_dump_full_vty(vty, &subscr); + return CMD_SUCCESS; +} + +DEFUN(subscriber_create, + subscriber_create_cmd, + SUBSCR_CMD "imsi IDENT create", + SUBSCR_CMD_HELP + "Create subscriber by IMSI\n" + "IMSI/MSISDN/ID of the subscriber\n") +{ + int rc; + struct hlr_subscriber subscr; + const char *imsi = argv[0]; + + if (!osmo_imsi_str_valid(imsi)) { + vty_out(vty, "%% Not a valid IMSI: %s%s", imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + rc = db_subscr_create(g_hlr->dbc, imsi); + + if (rc) { + if (rc == -EEXIST) + vty_out(vty, "%% Subscriber already exists for IMSI = %s%s", + imsi, VTY_NEWLINE); + else + vty_out(vty, "%% Error (rc=%d): cannot create subscriber for IMSI = %s%s", + rc, imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + rc = db_subscr_get_by_imsi(g_hlr->dbc, imsi, &subscr); + vty_out(vty, "%% Created subscriber %s%s", imsi, VTY_NEWLINE); + + subscr_dump_full_vty(vty, &subscr); + + return CMD_SUCCESS; +} + +DEFUN(subscriber_delete, + subscriber_delete_cmd, + SUBSCR "delete", + SUBSCR_HELP "Delete subscriber from database\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + + /* Find out the IMSI regardless of which way the caller decided to + * identify the subscriber by. */ + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_delete_by_id(g_hlr->dbc, subscr.id); + if (rc) { + vty_out(vty, "%% Error: Failed to remove subscriber for IMSI '%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% Deleted subscriber for IMSI '%s'%s", subscr.imsi, VTY_NEWLINE); + return CMD_SUCCESS; +} + +DEFUN(subscriber_msisdn, + subscriber_msisdn_cmd, + SUBSCR_UPDATE "msisdn MSISDN", + SUBSCR_UPDATE_HELP + "Set MSISDN (phone number) of the subscriber\n" + "New MSISDN (phone number)\n") +{ + struct hlr_subscriber subscr; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *msisdn = argv[2]; + + if (strlen(msisdn) > sizeof(subscr.msisdn) - 1) { + vty_out(vty, "%% MSISDN is too long, max. %zu characters are allowed%s", + sizeof(subscr.msisdn)-1, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!osmo_msisdn_str_valid(msisdn)) { + vty_out(vty, "%% MSISDN invalid: '%s'%s", msisdn, VTY_NEWLINE); + return CMD_WARNING; + } + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + if (db_subscr_update_msisdn_by_imsi(g_hlr->dbc, subscr.imsi, msisdn)) { + vty_out(vty, "%% Error: cannot update MSISDN for subscriber IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% Updated subscriber IMSI='%s' to MSISDN='%s'%s", + subscr.imsi, msisdn, VTY_NEWLINE); + return CMD_SUCCESS; +} + +static bool is_hexkey_valid(struct vty *vty, const char *label, + const char *hex_str, int minlen, int maxlen) +{ + if (osmo_is_hexstr(hex_str, minlen * 2, maxlen * 2, true)) + return true; + vty_out(vty, "%% Invalid value for %s: '%s'%s", label, hex_str, VTY_NEWLINE); + return false; +} + +#define AUTH_ALG_TYPES_2G "(comp128v1|comp128v2|comp128v3|xor)" +#define AUTH_ALG_TYPES_2G_HELP \ + "Use COMP128v1 algorithm\n" \ + "Use COMP128v2 algorithm\n" \ + "Use COMP128v3 algorithm\n" \ + "Use XOR algorithm\n" + +#define AUTH_ALG_TYPES_3G "milenage" +#define AUTH_ALG_TYPES_3G_HELP \ + "Use Milenage algorithm\n" + +#define A38_XOR_MIN_KEY_LEN 12 +#define A38_XOR_MAX_KEY_LEN 16 +#define A38_COMP128_KEY_LEN 16 + +#define MILENAGE_KEY_LEN 16 + +static bool auth_algo_parse(const char *alg_str, enum osmo_auth_algo *algo, + int *minlen, int *maxlen) +{ + if (!strcasecmp(alg_str, "none")) { + *algo = OSMO_AUTH_ALG_NONE; + *minlen = *maxlen = 0; + } else if (!strcasecmp(alg_str, "comp128v1")) { + *algo = OSMO_AUTH_ALG_COMP128v1; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v2")) { + *algo = OSMO_AUTH_ALG_COMP128v2; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v3")) { + *algo = OSMO_AUTH_ALG_COMP128v3; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "xor")) { + *algo = OSMO_AUTH_ALG_XOR; + *minlen = A38_XOR_MIN_KEY_LEN; + *maxlen = A38_XOR_MAX_KEY_LEN; + } else if (!strcasecmp(alg_str, "milenage")) { + *algo = OSMO_AUTH_ALG_MILENAGE; + *minlen = *maxlen = MILENAGE_KEY_LEN; + } else + return false; + return true; +} + +DEFUN(subscriber_no_aud2g, + subscriber_no_aud2g_cmd, + SUBSCR_UPDATE "aud2g none", + SUBSCR_UPDATE_HELP + "Set 2G authentication data\n" + "Delete 2G authentication data\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + struct sub_auth_data_str aud = { + .type = OSMO_AUTH_TYPE_GSM, + .algo = OSMO_AUTH_ALG_NONE, + }; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud); + + if (rc) { + vty_out(vty, "%% Error: cannot disable 2G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_aud2g, + subscriber_aud2g_cmd, + SUBSCR_UPDATE "aud2g " AUTH_ALG_TYPES_2G " ki KI", + SUBSCR_UPDATE_HELP + "Set 2G authentication data\n" + AUTH_ALG_TYPES_2G_HELP + "Set Ki Encryption Key\n" "Ki as 32 hexadecimal characters\n") +{ + struct hlr_subscriber subscr; + int rc; + int minlen = 0; + int maxlen = 0; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *alg_type = argv[2]; + const char *ki = argv[3]; + struct sub_auth_data_str aud2g = { + .type = OSMO_AUTH_TYPE_GSM, + .u.gsm.ki = ki, + }; + + if (!auth_algo_parse(alg_type, &aud2g.algo, &minlen, &maxlen)) { + vty_out(vty, "%% Unknown auth algorithm: '%s'%s", alg_type, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!is_hexkey_valid(vty, "KI", aud2g.u.gsm.ki, minlen, maxlen)) + return CMD_WARNING; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud2g); + + if (rc) { + vty_out(vty, "%% Error: cannot set 2G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_no_aud3g, + subscriber_no_aud3g_cmd, + SUBSCR_UPDATE "aud3g none", + SUBSCR_UPDATE_HELP + "Set UMTS authentication data (3G, and 2G with UMTS AKA)\n" + "Delete 3G authentication data\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + struct sub_auth_data_str aud = { + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_NONE, + }; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud); + + if (rc) { + vty_out(vty, "%% Error: cannot disable 3G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_aud3g, + subscriber_aud3g_cmd, + SUBSCR_UPDATE "aud3g " AUTH_ALG_TYPES_3G + " k K" + " (op|opc) OP_C" + " [ind-bitlen] [<0-28>]", + SUBSCR_UPDATE_HELP + "Set UMTS authentication data (3G, and 2G with UMTS AKA)\n" + AUTH_ALG_TYPES_3G_HELP + "Set Encryption Key K\n" "K as 32 hexadecimal characters\n" + "Set OP key\n" "Set OPC key\n" "OP or OPC as 32 hexadecimal characters\n" + "Set IND bit length\n" "IND bit length value (default: 5)\n") +{ + struct hlr_subscriber subscr; + int minlen = 0; + int maxlen = 0; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *alg_type = AUTH_ALG_TYPES_3G; + const char *k = argv[2]; + bool opc_is_op = (strcasecmp("op", argv[3]) == 0); + const char *op_opc = argv[4]; + int ind_bitlen = argc > 6? atoi(argv[6]) : 5; + struct sub_auth_data_str aud3g = { + .type = OSMO_AUTH_TYPE_UMTS, + .u.umts = { + .k = k, + .opc_is_op = opc_is_op, + .opc = op_opc, + .ind_bitlen = ind_bitlen, + }, + }; + + if (!auth_algo_parse(alg_type, &aud3g.algo, &minlen, &maxlen)) { + vty_out(vty, "%% Unknown auth algorithm: '%s'%s", alg_type, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!is_hexkey_valid(vty, "K", aud3g.u.umts.k, minlen, maxlen)) + return CMD_WARNING; + + if (!is_hexkey_valid(vty, opc_is_op ? "OP" : "OPC", aud3g.u.umts.opc, + MILENAGE_KEY_LEN, MILENAGE_KEY_LEN)) + return CMD_WARNING; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud3g); + + if (rc) { + vty_out(vty, "%% Error: cannot set 3G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +void hlr_vty_subscriber_init(struct hlr *hlr) +{ + g_hlr = hlr; + + install_element_ve(&subscriber_show_cmd); + install_element(ENABLE_NODE, &subscriber_create_cmd); + install_element(ENABLE_NODE, &subscriber_delete_cmd); + install_element(ENABLE_NODE, &subscriber_msisdn_cmd); + install_element(ENABLE_NODE, &subscriber_no_aud2g_cmd); + install_element(ENABLE_NODE, &subscriber_aud2g_cmd); + install_element(ENABLE_NODE, &subscriber_no_aud3g_cmd); + install_element(ENABLE_NODE, &subscriber_aud3g_cmd); +} diff --git a/src/hlr_vty_subscr.h b/src/hlr_vty_subscr.h new file mode 100644 index 0000000..841db5a --- /dev/null +++ b/src/hlr_vty_subscr.h @@ -0,0 +1,3 @@ +#pragma once + +void hlr_vty_subscriber_init(struct hlr *hlr); diff --git a/tests/Makefile.am b/tests/Makefile.am index 0b625f5..8f1826d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,6 +26,7 @@ testsuite.at \ $(srcdir)/package.m4 \ $(TESTSUITE) \ + test_subscriber.vty \ ctrl_test_runner.py \ $(NULL) @@ -36,10 +37,26 @@ $(NULL) if ENABLE_EXT_TESTS -python-tests: $(BUILT_SOURCES) +python-tests: +# don't run vty and ctrl tests concurrently so that the ports don't conflict + $(MAKE) vty-test $(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v + +VTY_TEST_DB = hlr_vty_test.db + +# To update the VTY script from current application behavior, +# pass -u to vty_script_runner.py by doing: +# make vty-test U=-u +vty-test: + -rm -f $(VTY_TEST_DB) + sqlite3 $(VTY_TEST_DB) < $(top_srcdir)/sql/hlr.sql + osmo_verify_transcript_vty.py -v \ + -n OsmoHLR -p 4258 \ + -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_vty_test.db" \ + $(U) $(srcdir)/*.vty + -rm -f $(VTY_TEST_DB) else -python-tests: $(BUILT_SOURCES) +python-tests: echo "Not running python-based tests (determined at configure-time)" endif diff --git a/tests/test_subscriber.vty b/tests/test_subscriber.vty new file mode 100644 index 0000000..cac8d76 --- /dev/null +++ b/tests/test_subscriber.vty @@ -0,0 +1,348 @@ +OsmoHLR> enable + +OsmoHLR# list +... + subscriber (imsi|msisdn|id) IDENT show + subscriber imsi IDENT create + subscriber (imsi|msisdn|id) IDENT delete + subscriber (imsi|msisdn|id) IDENT update msisdn MSISDN + subscriber (imsi|msisdn|id) IDENT update aud2g none + subscriber (imsi|msisdn|id) IDENT update aud2g (comp128v1|comp128v2|comp128v3|xor) ki KI + subscriber (imsi|msisdn|id) IDENT update aud3g none + subscriber (imsi|msisdn|id) IDENT update aud3g milenage k K (op|opc) OP_C [ind-bitlen] [<0-28>] + +OsmoHLR# subscriber? + subscriber Subscriber management commands + +OsmoHLR# subscriber ? + imsi Identify subscriber by IMSI + msisdn Identify subscriber by MSISDN (phone number) + id Identify subscriber by database ID + +OsmoHLR# subscriber imsi ? + IDENT IMSI/MSISDN/ID of the subscriber +OsmoHLR# subscriber msisdn ? + IDENT IMSI/MSISDN/ID of the subscriber +OsmoHLR# subscriber id ? + IDENT IMSI/MSISDN/ID of the subscriber + +OsmoHLR# subscriber imsi 123456789023000 show +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber id 1 show +% No subscriber for id = '1' +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 1234567890230001 create +% Not a valid IMSI: 1234567890230001 +OsmoHLR# subscriber imsi 12345678902300x create +% Not a valid IMSI: 12345678902300x +OsmoHLR# subscriber imsi 12345 create +% Not a valid IMSI: 12345 + +OsmoHLR# subscriber imsi 123456789023000 create +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: none +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: none +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 123456789023000 update msisdn 12345 +% Updated subscriber IMSI='123456789023000' to MSISDN='12345' + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 +OsmoHLR# subscriber msisdn 12345 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 + +OsmoHLR# subscriber msisdn 12345 update msisdn 423 +% Updated subscriber IMSI='123456789023000' to MSISDN='423' +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + +OsmoHLR# subscriber imsi 123456789023000 update ? + msisdn Set MSISDN (phone number) of the subscriber + aud2g Set 2G authentication data + aud3g Set UMTS authentication data (3G, and 2G with UMTS AKA) + +OsmoHLR# subscriber imsi 123456789023000 update aud2g ? + none Delete 2G authentication data + comp128v1 Use COMP128v1 algorithm + comp128v2 Use COMP128v2 algorithm + comp128v3 Use COMP128v3 algorithm + xor Use XOR algorithm + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ? + ki Set Ki Encryption Key + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki ? + KI Ki as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki val ? + + +OsmoHLR# subscriber imsi 123456789023000 update aud2g xor ki Deaf0ff1ceD0d0DabbedD1ced1ceF00d +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: XOR + KI=deaf0ff1ced0d0dabbedd1ced1cef00d + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki BeefedCafeFaceAcedAddedDecadeFee +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee + +OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef + +OsmoHLR# subscriber msisdn 423 update aud2g comp128v3 ki C01ffedC1cadaeAc1d1f1edAcac1aB0a +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g nonsense BeefedCafeFaceAcedAddedDecadeFee +% Unknown command. +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g milenage BeefedCafeFaceAcedAddedDecadeFee +% Unknown command. +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g xor CoiffedCicadaeAcidifiedAcaciaBoa +% Unknown command. +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g xor C01ffedC1cadaeAc1d1f1edAcac1aB0aX +% Unknown command. +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g none +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + + +OsmoHLR# subscriber imsi 123456789023000 update aud3g ? + none Delete 3G authentication data + milenage Use Milenage algorithm + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage ? + k Set Encryption Key K + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k ? + K K as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d ? + op Set OP key + opc Set OPC key + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc ? + OP_C OP or OPC as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ? + [ind-bitlen] Set IND bit length + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ind-bitlen ? + [<0-28>] IND bit length value (default: 5) + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=5 + + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op DeafBeddedBabeAcceededFadedDecaf +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OP=deafbeddedbabeacceededfadeddecaf + IND-bitlen=5 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g none +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ind-bitlen 23 +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k CoiffedCicadaeAcidifiedAcaciaBoa opc CededEffacedAceFacedBadFadedBeef +% Invalid value for K: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CoiffedCicadaeAcidifiedAcaciaBoa +% Invalid value for OPC: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op CoiffedCicadaeAcidifiedAcaciaBoa +% Invalid value for OP: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 delete +% Deleted subscriber for IMSI '123456789023000' + +OsmoHLR# subscriber imsi 123456789023000 show +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber id 1 show +% No subscriber for id = '1' +OsmoHLR# subscriber msisdn 423 show +% No subscriber for msisdn = '423' + +OsmoHLR# subscriber imsi 123456789023000 create +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + +OsmoHLR# subscriber imsi 123456789023000 delete +% Deleted subscriber for IMSI '123456789023000' -- To view, visit https://gerrit.osmocom.org/4273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 15 03:47:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 03:47:24 +0000 Subject: [PATCH] osmo-hlr[master]: replace ctrl_test_runner.py with transcript test_subscriber.... Message-ID: Review at https://gerrit.osmocom.org/4275 replace ctrl_test_runner.py with transcript test_subscriber.ctrl Use the new osmo_verify_transcript_ctrl.py from osmo-python-tests to completely replace current ctrl_test_runner.py with a CTRL interaction transcript. Add missing EXTRA_DIST entry of test_subscriber.sql. Depends: osmo-python-tests Id47331009910e651372b9c9c76e12f2e8964cc2c Change-Id: Iff93abe370b8f3ecf42082d1d0eaa1fbeca5b122 --- M tests/Makefile.am D tests/ctrl_test_runner.py A tests/test_subscriber.ctrl 3 files changed, 46 insertions(+), 243 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/75/4275/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index cddea0b..e71a250 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -28,7 +28,8 @@ $(TESTSUITE) \ test_nodes.vty \ test_subscriber.vty \ - ctrl_test_runner.py \ + test_subscriber.sql \ + test_subscriber.ctrl \ $(NULL) TESTSUITE = $(srcdir)/testsuite @@ -41,7 +42,7 @@ python-tests: # don't run vty and ctrl tests concurrently so that the ports don't conflict $(MAKE) vty-test - $(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v + $(MAKE) ctrl-test VTY_TEST_DB = hlr_vty_test.db @@ -56,6 +57,22 @@ -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_vty_test.db" \ $(U) $(srcdir)/*.vty -rm -f $(VTY_TEST_DB) + +CTRL_TEST_DB = hlr_ctrl_test.db + +# To update the CTRL script from current application behavior, +# pass -u to ctrl_script_runner.py by doing: +# make ctrl-test U=-u +ctrl-test: + -rm -f $(CTRL_TEST_DB) + sqlite3 $(CTRL_TEST_DB) < $(top_srcdir)/sql/hlr.sql + sqlite3 $(CTRL_TEST_DB) < $(srcdir)/test_subscriber.sql + osmo_verify_transcript_ctrl.py -v \ + -p 4259 \ + -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_ctrl_test.db" \ + $(U) $(srcdir)/*.ctrl + -rm -f $(CTRL_TEST_DB) + else python-tests: echo "Not running python-based tests (determined at configure-time)" diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py deleted file mode 100644 index 1c5ec2a..0000000 --- a/tests/ctrl_test_runner.py +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/env python - -# (C) 2013 by Jacob Erlbeck -# (C) 2014 by Holger Hans Peter Freyther -# based on vty_test_runner.py: -# (C) 2013 by Katerina Barone-Adesi -# (C) 2013 by Holger Hans Peter Freyther -# based on bsc_control.py. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -import os -import time -import unittest -import socket -import sys -import struct -import subprocess - -import osmopy.osmoutil as osmoutil - -# add $top_srcdir/contrib to find ipa.py -sys.path.append(os.path.join(sys.path[0], '..', 'contrib')) - -from ipa import Ctrl, IPA - -# to be able to find $top_srcdir/doc/... -confpath = os.path.join(sys.path[0], '..') -verbose = False - -class TestCtrlBase(unittest.TestCase): - - def ctrl_command(self): - raise Exception("Needs to be implemented by a subclass") - - def ctrl_app(self): - raise Exception("Needs to be implemented by a subclass") - - def setUp(self): - osmo_ctrl_cmd = self.ctrl_command()[:] - config_index = osmo_ctrl_cmd.index('-c') - if config_index: - cfi = config_index + 1 - osmo_ctrl_cmd[cfi] = os.path.join(confpath, osmo_ctrl_cmd[cfi]) - - try: - self.proc = osmoutil.popen_devnull(osmo_ctrl_cmd) - except OSError: - print >> sys.stderr, "Current directory: %s" % os.getcwd() - print >> sys.stderr, "Consider setting -b" - time.sleep(2) - - appstring = self.ctrl_app()[2] - appport = self.ctrl_app()[0] - self.connect("127.0.0.1", appport) - self.next_id = 1000 - - def tearDown(self): - self.disconnect() - osmoutil.end_proc(self.proc) - - def disconnect(self): - if not (self.sock is None): - self.sock.close() - - def connect(self, host, port): - if verbose: - print "Connecting to host %s:%i" % (host, port) - - retries = 30 - while True: - try: - sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sck.setblocking(1) - sck.connect((host, port)) - except IOError: - retries -= 1 - if retries <= 0: - raise - time.sleep(.1) - continue - break - self.sock = sck - return sck - - def send(self, data): - if verbose: - print "Sending \"%s\"" %(data) - data = Ctrl().add_header(data) - return self.sock.send(data) == len(data) - - def send_set(self, var, value, id): - setmsg = "SET %s %s %s" %(id, var, value) - return self.send(setmsg) - - def send_get(self, var, id): - getmsg = "GET %s %s" %(id, var) - return self.send(getmsg) - - def do_set(self, var, value): - id = self.next_id - self.next_id += 1 - self.send_set(var, value, id) - return self.recv_msgs()[id] - - def do_get(self, var): - id = self.next_id - self.next_id += 1 - self.send_get(var, id) - return self.recv_msgs()[id] - - def assert_reply(self, r, mtype, var, val): - expect = dict(mtype=mtype, var=var, value=val) - result_matches = all([r.get(k) == expect.get(k) for k in expect.keys()]) - if not result_matches: - print('\nError details:\nGot reply: %r\nExpected reply: %r\n' % (r, expect)) - self.assertTrue(result_matches) - - def assert_set(self, var, val, result_val): - r = self.do_set(var, val) - self.assert_reply(r, 'SET_REPLY', var, result_val) - - def assert_get(self, var, result_val): - r = self.do_get(var) - self.assert_reply(r, 'GET_REPLY', var, result_val) - - def recv_msgs(self): - responses = {} - data = self.sock.recv(4096) - while (len(data)>0): - (head, data) = IPA().split_combined(data) - answer = Ctrl().rem_header(head) - if verbose: - print "Got message:", answer - (mtype, id, msg) = answer.split(None, 2) - id = int(id) - rsp = {'mtype': mtype, 'id': id} - if mtype == "ERROR": - rsp['error'] = msg - else: - split = msg.split(None, 1) - rsp['var'] = split[0] - if len(split) > 1: - rsp['value'] = split[1] - else: - rsp['value'] = None - responses[id] = rsp - - if verbose: - print "Decoded replies: ", responses - - return responses - - -class TestCtrlHLR(TestCtrlBase): - - HLR_DB = 'hlr_ctrl_test.db' - HLR_SQL = '%s/sql/hlr.sql' % confpath - HLR_TEST_SQL = '%s/tests/test_subscriber.sql' % confpath - - def setUp(self): - print('\n') - print(os.getcwd()) - assert subprocess.call('sqlite3 %s < %s' % (self.HLR_DB, self.HLR_SQL), shell=True) == 0 - assert subprocess.call('sqlite3 %s < %s' % (self.HLR_DB, self.HLR_TEST_SQL), shell=True) == 0 - super(TestCtrlHLR, self).setUp() - - def tearDown(self): - super(TestCtrlHLR, self).tearDown() - os.unlink(self.HLR_DB) - - def ctrl_command(self): - return ["./src/osmo-hlr", "-c", "doc/examples/osmo-hlr.cfg", '-l', 'hlr_ctrl_test.db'] - - def ctrl_app(self): - return (4259, "./src/osmo-hlr", "OsmoHLR", "hlr") - - def testCtrlErrs(self): - r = self.do_get('invalid') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Command not found') - - def testEnableDisablePs(self): - self.assert_set('enable-ps', '901990000000001', 'OK') - self.assert_set('status-ps', '901990000000001', '1') - self.assert_set('enable-ps', '901990000000001', 'OK') - self.assert_set('status-ps', '901990000000001', '1') - self.assert_set('disable-ps', '901990000000001', 'OK') - self.assert_set('status-ps', '901990000000001', '0') - self.assert_set('disable-ps', '901990000000001', 'OK') - self.assert_set('status-ps', '901990000000001', '0') - self.assert_set('enable-ps', '901990000000001', 'OK') - self.assert_set('status-ps', '901990000000001', '1') - -if __name__ == '__main__': - import argparse - import sys - - workdir = '.' - - parser = argparse.ArgumentParser() - parser.add_argument("-v", "--verbose", dest="verbose", - action="store_true", help="verbose mode") - parser.add_argument("-p", "--pythonconfpath", dest="p", - help="searchpath for config") - parser.add_argument("-w", "--workdir", dest="w", - help="Working directory") - args = parser.parse_args() - - verbose_level = 1 - if args.verbose: - verbose_level = 2 - verbose = True - - if args.w: - workdir = args.w - - if args.p: - confpath = args.p - - print "confpath %s, workdir %s" % (confpath, workdir) - os.chdir(workdir) - print "Running tests for specific control commands" - suite = unittest.TestSuite() - test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlHLR) - suite.addTest(test) - res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) - sys.exit(len(res.errors) + len(res.failures)) - -# vim: tabstop=4 shiftwidth=4 expandtab diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl new file mode 100644 index 0000000..3284ae5 --- /dev/null +++ b/tests/test_subscriber.ctrl @@ -0,0 +1,27 @@ +GET 1 invalid +ERROR 1 Command not found +SET 2 invalid nonsense +ERROR 2 Command not found + +SET 3 enable-ps 901990000000001 +SET_REPLY 3 enable-ps OK +SET 4 status-ps 901990000000001 +SET_REPLY 4 status-ps 1 +SET 5 enable-ps 901990000000001 +SET_REPLY 5 enable-ps OK +SET 6 status-ps 901990000000001 +SET_REPLY 6 status-ps 1 + +SET 7 disable-ps 901990000000001 +SET_REPLY 7 disable-ps OK +SET 8 status-ps 901990000000001 +SET_REPLY 8 status-ps 0 +SET 9 disable-ps 901990000000001 +SET_REPLY 9 disable-ps OK +SET 10 status-ps 901990000000001 +SET_REPLY 10 status-ps 0 + +SET 11 enable-ps 901990000000001 +SET_REPLY 11 enable-ps OK +SET 12 status-ps 901990000000001 +SET_REPLY 12 status-ps 1 -- To view, visit https://gerrit.osmocom.org/4275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff93abe370b8f3ecf42082d1d0eaa1fbeca5b122 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 15 03:48:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 03:48:18 +0000 Subject: python/osmo-python-tests[master]: add osmo_ipa.py, from originally openbsc.git/contrib/ipa.py In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaef955f04b97e8f266339b37b46d2523d1247cb9 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 15 03:48:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 03:48:25 +0000 Subject: python/osmo-python-tests[master]: add osmo_verify_transcript_{vty, ctrl}.py for easier vty and ... In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 15 03:52:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 03:52:49 +0000 Subject: [PATCH] osmo-hlr[master]: fix db_subscr_get_by_*(): clear output data; test in db_test.c In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4230 to look at the new patch set (#4). fix db_subscr_get_by_*(): clear output data; test in db_test.c db_subscr_get_by_*() failed to clear the out-param struct, meaning that data could remain in a struct even though it is not present in the database. Always zero out the struct before writing to it. Adjust the db_test to catch this error by writing "-invalid-data-" to each struct before running db get functions. Change-Id: I038bd437452c87841d709fcdd5ac30ab1356b2db --- M src/db_hlr.c M tests/db/db_test.c 2 files changed, 18 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/30/4230/4 diff --git a/src/db_hlr.c b/src/db_hlr.c index 71f682d..cf6e4f8 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -379,6 +379,8 @@ if (!subscr) goto out; + *subscr = (struct hlr_subscriber){}; + /* obtain the various columns */ subscr->id = sqlite3_column_int64(stmt, 0); SL3_TXT(subscr->imsi, stmt, 1); diff --git a/tests/db/db_test.c b/tests/db/db_test.c index db3318c..591418b 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -34,6 +34,19 @@ #define comment(fmt, args...) fprintf(stderr, "\n--- " fmt "\n\n", ## args); #define comment_end() fprintf(stderr, "===== %s: SUCCESS\n\n", __func__); +#define fill_invalid(x) _fill_invalid(&x, sizeof(x)) +static void _fill_invalid(void *dest, size_t size) +{ + uint8_t *pos = dest; + size_t remain = size; + int wrote = 0; + do { + remain -= wrote; + pos += wrote; + wrote = snprintf((void*)pos, remain, "-invalid-data"); + } while (wrote < remain); +} + /* Perform a function call and verbosely assert that its return value is as expected. * The return code is then available in g_rc. */ #define ASSERT_RC(call, expect_rc) \ @@ -53,7 +66,7 @@ #define ASSERT_SEL(by, val, expect_rc) \ do { \ int rc; \ - g_subscr = (struct hlr_subscriber){}; \ + fill_invalid(g_subscr); \ fprintf(stderr, "db_subscr_get_by_" #by "(dbc, " #val ", &g_subscr) --> " \ #expect_rc "\n"); \ rc = db_subscr_get_by_##by(dbc, val, &g_subscr); \ @@ -71,8 +84,8 @@ * The results are then available in g_aud2g and g_aud3g. */ #define ASSERT_SEL_AUD(imsi, expect_rc, expect_id) \ do { \ - g_aud2g = (struct osmo_sub_auth_data){}; \ - g_aud3g = (struct osmo_sub_auth_data){}; \ + fill_invalid(g_aud2g); \ + fill_invalid(g_aud3g); \ g_id = 0; \ ASSERT_RC(db_get_auth_data(dbc, imsi, &g_aud2g, &g_aud3g, &g_id), expect_rc); \ if (!g_rc) { \ -- To view, visit https://gerrit.osmocom.org/4230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I038bd437452c87841d709fcdd5ac30ab1356b2db Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 15 03:53:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 03:53:46 +0000 Subject: [ABANDON] libosmocore[master]: CTRL: allow argument for GET commands In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: CTRL: allow argument for GET commands ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I228342bedd623f6058493e1d0dea0c721d21c4e5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 15 03:59:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 03:59:18 +0000 Subject: [PATCH] python/osmo-python-tests[master]: add osmo_verify_transcript_{vty, ctrl}.py for easier vty and ... In-Reply-To: References: Message-ID: add osmo_verify_transcript_{vty,ctrl}.py for easier vty and ctrl testing While adding VTY and CTRL tests to new programs like OsmoHLR, I wanted to have a simple way to translate a VTY interaction transcript to a VTY python test. It is fairly trivial to simply read in a transcript, extract both the commands to send as well as the expected results, and to verify these without having to write one line of application-specific code. From there it was just a little step to allow the same for CTRL interaction. With osmo_verify_transcript_vty.py and osmo_verify_transcript_ctrl.py, it is possible to have a simple text file of a telnet VTY or CTRL interface interaction and run it against a given application. With the --update option, the scripts run the given command and rewrite the transcript file to whatever the application currently produces as response. Backed by version control, it is super easy to tweak commands, --update the test results and verify that only the desired bits changed. A '...' wildcard can skip any number of lines in the expected result and is usually preserved during --update. This python3 implementation is independent from the previous obscvty implementations. Take the opportunity to clarify/fix a few aspects: for example, it is now possible to verify the hints that the interactive VTY displays when the user enters '?' in various places, and to evaluate the prompt character '>'/'#'. Unitl now, code is duplicated/scattered across various vty_test_runner.py scripts in different git repositories. Now, a VTY or CTRL transcript is enough to put a complete test in place. The simplest invocation is directly from the Makefile, feeding an application commandline, the proper port number to contact it and e.g. a VTY prompt name. This new code is also usable as python modules, to be able to build more complex tests that require specialized intermediate actions, possibly coordinating launch of applications or data manipulation. The first repository to employ this is osmo-hlr.git. See change-ids I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 for VTY and Iff93abe370b8f3ecf42082d1d0eaa1fbeca5b122 for CTRL. Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c --- M osmopy/__init__.py A osmopy/osmo_verify_transcript_common.py A osmopy/osmo_verify_transcript_ctrl.py A osmopy/osmo_verify_transcript_vty.py M setup.py 5 files changed, 668 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/72/4272/2 diff --git a/osmopy/__init__.py b/osmopy/__init__.py index e211108..01ff3de 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -3,4 +3,7 @@ __all__ = ['obscvty', 'osmodumpdoc', 'osmotestconfig', 'osmotestvty', 'osmoutil', - 'osmo_ipa',] + 'osmo_ipa', + 'osmo_verify_transcript_common', + 'osmo_verify_transcript_vty', + 'osmo_verify_transcript_ctrl'] diff --git a/osmopy/osmo_verify_transcript_common.py b/osmopy/osmo_verify_transcript_common.py new file mode 100644 index 0000000..70224a5 --- /dev/null +++ b/osmopy/osmo_verify_transcript_common.py @@ -0,0 +1,372 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Common code for verify_transcript_vty.py and verify_transcript_ctrl.py. +''' + +import argparse +import sys +import os +import subprocess +import time +import traceback +import socket +import shlex + + +class Interact: + + class StepBase: + command = None + result = None + leading_blanks = None + + def __init__(self): + self.result = [] + + def verify_interact_state(self, interact_instance): + # for example to verify that the last VTY prompt received shows the + # right node. + pass + + def command_str(self, interact_instance=None): + return self.command + + def __str__(self): + return '%s\n%s' % (self.command_str(), '\n'.join(self.result)) + + @staticmethod + def is_next_step(line, interact_instance): + assert not "implemented by InteractVty.VtyStep and InteractCtrl.CtrlStep" + + socket = None + + def __init__(self, step_class, port, host, verbose=False, update=False): + ''' + host is the hostname to connect to. + port is the CTRL port to connect on. + ''' + self.Step = step_class + self.port = port + self.host = host + self.verbose = verbose + self.update = update + + def connect(self): + assert self.socket is None + retries = 30 + took = 0 + while True: + took += 1 + try: + self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.socket.setblocking(1) + self.socket.connect((self.host, int(self.port))) + except IOError: + retries -= 1 + if retries <= 0: + raise + time.sleep(.1) + continue + break + + def close(self): + if self.socket is None: + return + self.socket.close() + self.socket = None + + def command(self, command): + assert not "implemented separately by InteractVty and InteractCtrl" + + def verify_transcript_file(self, transcript_file): + with open(transcript_file, 'r') as f: + content = f.read() + + try: + result = self.verify_transcript(content) + except: + print('Error while verifying transcript file %r' % transcript_file, file=sys.stderr) + sys.stderr.flush() + raise + + if not self.update: + return + content = '\n'.join(result) + with open(transcript_file, 'w') as f: + f.write(content) + + def verify_transcript(self, transcript): + '''' + transcript is a "screenshot" of a session, a multi-line string + including commands and expected results. + Feed commands to self.command() and verify the expected results. + ''' + + # parse steps + steps = [] + step = None + blank_lines = 0 + for line in transcript.splitlines(): + if not line: + blank_lines += 1 + continue + next_step_started = self.Step.is_next_step(line, self) + if next_step_started: + if step: + steps.append(step) + step = next_step_started + step.leading_blanks = blank_lines + blank_lines = 0 + elif step: + # we only count blank lines directly preceding the start of a + # next step. Insert blank lines in the middle of a response + # back into the response: + if blank_lines: + step.result.extend([''] * blank_lines) + blank_lines = 0 + step.result.append(line) + if step: + steps.append(step) + step = None + + actual_result = [] + + # run steps + step_nr = 0 + for step in steps: + step_nr += 1 + try: + if self.verbose: + if step.leading_blanks: + print('\n' * step.leading_blanks, end='') + print(step.command_str()) + sys.stdout.flush() + + step.verify_interact_state(self) + + res = self.command(step.command) + + if self.verbose: + sys.stderr.flush() + sys.stdout.flush() + print('\n'.join(res)) + sys.stdout.flush() + + if step.leading_blanks: + actual_result.extend([''] * step.leading_blanks) + actual_result.append(step.command_str(self)) + + match_result = self.match_lines(step.result, res) + + if self.update: + if match_result is True: + # preserve any wildcards + actual_result.extend(step.result) + else: + # mismatch, take exactly what came in + actual_result.extend(res) + continue + if match_result is not True: + raise Exception('Result mismatch:\n%s\n\nExpected:\n[\n%s\n]\n\nGot:\n[\n%s\n%s\n]' + % (match_result, step, step.command_str(), '\n'.join(res))) + except: + print('Error during transcript step %d:\n[\n%s\n]' % (step_nr, step), + file=sys.stderr) + sys.stderr.flush() + raise + + # final line ending + actual_result.append('') + return actual_result + + @staticmethod + def match_lines(expect, got): + ''' + Match two lists of strings, allowing certain wildcards: + - In 'expect', if a line is exactly '...', it matches any number of + arbitrary lines in 'got'; the implementation is trivial and skips + lines to the first occurence in 'got' that continues after '...'. + + Return 'True' on match, or a string describing the mismatch. + ''' + def match_line(expect_line, got_line): + return expect_line == got_line + + e = 0 + g = 0 + while e < len(expect): + if expect[e] == '...': + e += 1 + + if e >= len(expect): + # anything left in 'got' is accepted. + return True + + # look for the next occurence of the expected line in 'got' + while g < len(got) and not match_line(expect[e], got[g]): + g += 1 + continue + + if g >= len(got): + return 'Cannot find line %r' % expect[e] + + if not match_line(expect[e], got[g]): + return 'Mismatch:\nExpect:\n%s\nGot:\n%s' % (expect[e], got[g]) + + e += 1 + g += 1 + + if g < len(got): + return 'Did not expect line %r' % got[g] + return True + +def end_process(proc): + if not proc: + return + + rc = proc.poll() + if rc is not None: + print('Process has already terminated with', rc) + proc.wait() + return + + proc.terminate() + time_to_wait_for_term = 5 + wait_step = 0.001 + waited_time = 0 + while True: + # poll returns None if proc is still running + if proc.poll() is not None: + break + waited_time += wait_step + # make wait_step approach 1.0 + wait_step = (1. + 5. * wait_step) / 6. + if waited_time >= time_to_wait_for_term: + break + time.sleep(wait_step) + + if proc.poll() is None: + # termination seems to be slower than that, let's just kill + proc.kill() + print("Killed child process") + elif waited_time > .002: + print("Terminating took %.3fs" % waited_time) + proc.wait() + +class Application: + proc = None + _devnull = None + + @staticmethod + def devnull(): + if Application._devnull is None: + Application._devnull = open(os.devnull, 'w') + return Application._devnull + + def __init__(self, command_tuple, purge_output=True): + self.command_tuple = command_tuple + self.purge_output = purge_output + + def run(self): + out_err = None + if self.purge_output: + out_err = Application.devnull() + + print('Launching: cd %r; %s' % (os.getcwd(), ' '.join(self.command_tuple))) + self.proc = subprocess.Popen(self.command_tuple, stdout=out_err, stderr=out_err) + + def stop(self): + end_process(self.proc) + +def verify_application(command_tuple, interact, transcript_file, verbose): + passed = None + application = None + + sys.stdout.flush() + sys.stderr.flush() + + if command_tuple: + application = Application(command_tuple, purge_output=not verbose) + application.run() + + try: + interact.connect() + interact.verify_transcript_file(transcript_file) + passed = True + except: + traceback.print_exc() + passed = False + interact.close() + + if application: + application.stop() + + sys.stdout.flush() + sys.stderr.flush() + + return passed + +def common_parser(): + parser = argparse.ArgumentParser() + parser.add_argument('-r', '--run', dest='command_str', + help='command to run to launch application to test,' + ' including command line arguments. If omitted, no' + ' application is launched.') + parser.add_argument('-p', '--port', dest='port', + help="Port that the application opens.") + parser.add_argument('-H', '--host', dest='host', default='localhost', + help="Host that the application opens the port on.") + parser.add_argument('-u', '--update', dest='update', action='store_true', + help='Do not verify, but OVERWRITE transcripts based on' + ' the applications current behavior. OVERWRITES TRANSCRIPT' + ' FILES.') + parser.add_argument('-v', '--verbose', action='store_true', + help='Print commands and application output') + parser.add_argument('transcript_files', nargs='*', help='transcript files to verify') + return parser + +def main(command_str, transcript_files, interact, verbose): + + if command_str: + command_tuple = shlex.split(command_str) + else: + command_tuple = None + + results = [] + for t in transcript_files: + passed = verify_application(command_tuple=command_tuple, + interact=interact, + transcript_file=t, + verbose=verbose) + results.append((passed, t)) + + print('\nRESULTS:') + all_passed = True + for passed, t in results: + print('%s: %s' % ('pass' if passed else 'FAIL', t)) + all_passed = all_passed and passed + print() + + if not all_passed: + sys.exit(1) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_ctrl.py b/osmopy/osmo_verify_transcript_ctrl.py new file mode 100755 index 0000000..3c3559e --- /dev/null +++ b/osmopy/osmo_verify_transcript_ctrl.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run CTRL test transcripts against a given application. + +A CTRL transcript contains CTRL commands and their expected results. +It looks like: + +" +SET 1 var val +SET_REPLY 1 var OK +GET 2 var +GET_REPLY 2 var val +" + +The application to be tested is described by +- a binary to run, +- command line arguments to pass to the binary, +- the CTRL port. + +This module can either be run directly to run or update a given CTRL transcript, +or it can be imported as a module to run more complex setups. +''' + +import re + +from osmopy.osmo_verify_transcript_common import * +from osmopy.osmo_ipa import Ctrl, IPA + +class InteractCtrl(Interact): + next_id = 1 + keep_ids = True + re_command = re.compile('^(SET|GET) ([^ ]*) (.*)$') + + class CtrlStep(Interact.StepBase): + + @staticmethod + def is_next_step(line, interact_instance): + m = InteractCtrl.re_command.match(line) + if not m: + return None + next_step = InteractCtrl.CtrlStep() + + set_get = m.group(1) + cmd_id = m.group(2) + var_val = m.group(3) + if not InteractCtrl.keep_ids: + cmd_id = InteractCtrl.next_id + InteractCtrl.next_id += 1 + next_step.command = '%s %d %s' % (set_get, cmd_id, var_val) + + return next_step + + def __init__(self, port, host, verbose=False, update=False, keep_ids=True): + InteractCtrl.keep_ids = keep_ids + super().__init__(InteractCtrl.CtrlStep, port=port, host=host, verbose=verbose, update=update) + + def send(self, data): + data = Ctrl().add_header(data) + return self.socket.send(data) == len(data) + + def receive(self): + responses = [] + data = self.socket.recv(4096) + while (len(data)>0): + (response_with_header, data) = IPA().split_combined(data) + response = Ctrl().rem_header(response_with_header) + responses.append(response.decode('utf-8')) + return responses + + def command(self, command): + assert self.send(command) + res = self.receive() + sys.stdout.flush() + sys.stderr.flush() + return res + +if __name__ == '__main__': + parser = common_parser() + parser.add_argument('-i', '--keep-ids', dest='keep_ids', action='store_true', + help='With --update, default is to overwrite the command IDs' + ' so that they are consecutive numbers starting from 1.' + ' With --keep-ids, do not change these command IDs.') + args = parser.parse_args() + + interact = InteractCtrl(args.port, args.host, args.verbose, args.update, args.keep_ids) + + main(command_str=args.command_str, + transcript_files=args.transcript_files, + interact=interact, + verbose=args.verbose) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_vty.py b/osmopy/osmo_verify_transcript_vty.py new file mode 100755 index 0000000..3a4d630 --- /dev/null +++ b/osmopy/osmo_verify_transcript_vty.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run VTY test transcripts against a given application. + +A VTY transcript contains VTY commands and their expected results. +It looks like: + +" +OsmoHLR> enable + +OsmoHLR# subscriber show imsi 123456789023000 +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber show msisdn 12345 +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber create imsi 123456789023000 +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + No auth data +" + +The application to be tested is described by +- a binary to run, +- command line arguments to pass to the binary, +- the VTY telnet port, +- the application name as printed in the VTY prompt. + +This module can either be run directly to run or update a given VTY transcript, +or it can be imported as a module to run more complex setups. +''' + +import re + +from osmopy.osmo_verify_transcript_common import * + +class InteractVty(Interact): + + class VtyStep(Interact.StepBase): + expect_node = None # e.g. '(config-net)' + expect_prompt_char = None # '>' or '#' + + def __init__(self, prompt): + super().__init__() + self.prompt = prompt + + def verify_interact_state(self, interact_instance): + if interact_instance.update: + return + if interact_instance.this_node != self.expect_node: + raise Exception('Mismatch: expected VTY node %r in the prompt, got %r' + % (self.expect_node, interact_instance.this_node)) + if interact_instance.this_prompt_char != self.expect_prompt_char: + raise Exception('Mismatch: expected VTY prompt character %r, got %r' + % (self.expect_prompt_char, interact_instance.this_prompt_char)) + + @staticmethod + def is_next_step(line, interact_instance): + m = interact_instance.re_prompt.match(line) + if not m: + return None + next_step = InteractVty.VtyStep(interact_instance.prompt) + next_step.expect_node = m.group(1) + next_step.expect_prompt_char = m.group(2) + next_step.command = m.group(3) + return next_step + + def command_str(self, interact_instance=None): + if interact_instance is None: + node = self.expect_node + prompt_char = self.expect_prompt_char + else: + node = interact_instance.last_node + prompt_char = interact_instance.last_prompt_char + if node: + node = '(%s)' % node + node = node or '' + return '%s%s%s %s' % (self.prompt, node, prompt_char, self.command) + + def __init__(self, prompt, port, host, verbose, update): + self.prompt = prompt + self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) + super().__init__(InteractVty.VtyStep, port, host, verbose, update) + + def connect(self): + self.this_node = None + self.this_prompt_char = '>' # slight cheat for initial prompt char + self.last_node = None + self.last_prompt_char = None + + super().connect() + # receive the first welcome message and discard + self.socket.recv(4096) + + def _command(self, command_str, timeout=10): + self.socket.send(command_str.encode()) + + waited_since = time.time() + received_lines = [] + last_line = '' + + while True: + new_data = self.socket.recv(4096).decode('utf-8') + + last_line = "%s%s" % (last_line, new_data) + + if last_line: + lines = last_line.splitlines() + received_lines.extend(lines[:-1]) + last_line = lines[-1] + + match = self.re_prompt.match(last_line) + if not match: + if time.time() - waited_since > timeout: + raise IOError("Failed to read data (did the app crash?)") + time.sleep(.1) + continue + + self.last_node = self.this_node + self.last_prompt_char = self.this_prompt_char + self.this_node = match.group(1) or None + self.this_prompt_char = match.group(2) + break + + # expecting to have received the command we sent as echo, remove it + clean_command_str = command_str.strip() + if clean_command_str.endswith('?'): + clean_command_str = clean_command_str[:-1] + if received_lines and received_lines[0] == clean_command_str: + received_lines = received_lines[1:] + return received_lines + + def command(self, command_str, timeout=10): + command_str = command_str or '\r' + if command_str[-1] not in '?\r\t': + command_str = command_str + '\r' + + received_lines = self._command(command_str, timeout) + + if command_str[-1] == '?': + self._command('\x03', timeout) + + return received_lines + +if __name__ == '__main__': + parser = common_parser() + parser.add_argument('-n', '--prompt-name', dest='prompt', + help="Name used in application's telnet VTY prompt.") + args = parser.parse_args() + + interact = InteractVty(args.prompt, args.port, args.host, args.verbose, args.update) + + main(command_str=args.command_str, + transcript_files=args.transcript_files, + interact=interact, + verbose=args.verbose) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/setup.py b/setup.py index 44e7fd1..9c25a0d 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,9 @@ version = __version__, packages = ["osmopy"], scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py", - "osmopy/osmotestvty.py"], + "osmopy/osmotestvty.py", + "osmopy/osmo_verify_transcript_vty.py", + "osmopy/osmo_verify_transcript_ctrl.py"], license = "AGPLv3", description = "Osmopython: osmocom testing scripts", author = "Katerina Barone-Adesi", -- To view, visit https://gerrit.osmocom.org/4272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 15 04:11:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 04:11:06 +0000 Subject: [PATCH] osmo-hlr[master]: implement subscriber vty interface, tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4273 to look at the new patch set (#2). implement subscriber vty interface, tests Implement VTY commands for subscriber manipulation: - create / delete subscriber - modify MSISDN - add/edit/remove 2G and 3G authentication data - show by IMSI, MSISDN or DB ID. (enable/disable CS/PS and purge/unpurge to follow later.) Implement VTY unit tests for the new commands using new osmo_verify_transcript_vty.py from osmo-python-tests. Depends: libosmocore I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 osmo-python-tests Id47331009910e651372b9c9c76e12f2e8964cc2c Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 --- M src/Makefile.am M src/hlr_vty.c A src/hlr_vty_subscr.c A src/hlr_vty_subscr.h M tests/Makefile.am A tests/test_subscriber.vty 6 files changed, 859 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/73/4273/2 diff --git a/src/Makefile.am b/src/Makefile.am index b410ff3..fc7c653 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,6 +23,7 @@ rand.h \ ctrl.h \ hlr_vty.h \ + hlr_vty_subscr.h \ $(NULL) bin_PROGRAMS = \ @@ -46,6 +47,7 @@ logging.c \ rand_urandom.c \ hlr_vty.c \ + hlr_vty_subscr.c \ $(NULL) osmo_hlr_LDADD = \ diff --git a/src/hlr_vty.c b/src/hlr_vty.c index 946117e..a5eb26f 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -26,6 +26,7 @@ #include #include "hlr_vty.h" +#include "hlr_vty_subscr.h" static struct hlr *g_hlr = NULL; @@ -135,4 +136,6 @@ install_default(GSUP_NODE); install_element(GSUP_NODE, &cfg_hlr_gsup_bind_ip_cmd); + + hlr_vty_subscriber_init(hlr); } diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c new file mode 100644 index 0000000..018872a --- /dev/null +++ b/src/hlr_vty_subscr.c @@ -0,0 +1,484 @@ +/* OsmoHLR subscriber management VTY implementation */ +/* (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "hlr.h" +#include "db.h" + +struct vty; + +#define osmo_hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) + +static struct hlr *g_hlr = NULL; + +static void subscr_dump_full_vty(struct vty *vty, struct hlr_subscriber *subscr) +{ + int rc; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + + vty_out(vty, " ID: %"PRIu64"%s", subscr->id, VTY_NEWLINE); + + vty_out(vty, " IMSI: %s%s", subscr->imsi ? subscr->imsi : "none", VTY_NEWLINE); + vty_out(vty, " MSISDN: %s%s", *subscr->msisdn ? subscr->msisdn : "none", VTY_NEWLINE); + if (*subscr->vlr_number) + vty_out(vty, " VLR number: %s%s", subscr->vlr_number, VTY_NEWLINE); + if (*subscr->sgsn_number) + vty_out(vty, " SGSN number: %s%s", subscr->sgsn_number, VTY_NEWLINE); + if (*subscr->sgsn_address) + vty_out(vty, " SGSN address: %s%s", subscr->sgsn_address, VTY_NEWLINE); + if (subscr->periodic_lu_timer) + vty_out(vty, " Periodic LU timer: %u%s", subscr->periodic_lu_timer, VTY_NEWLINE); + if (subscr->periodic_rau_tau_timer) + vty_out(vty, " Periodic RAU/TAU timer: %u%s", subscr->periodic_rau_tau_timer, VTY_NEWLINE); + if (subscr->lmsi) + vty_out(vty, " LMSI: %x%s", subscr->lmsi, VTY_NEWLINE); + if (!subscr->nam_cs) + vty_out(vty, " CS disabled%s", VTY_NEWLINE); + if (subscr->ms_purged_cs) + vty_out(vty, " CS purged%s", VTY_NEWLINE); + if (!subscr->nam_ps) + vty_out(vty, " PS disabled%s", VTY_NEWLINE); + if (subscr->ms_purged_ps) + vty_out(vty, " PS purged%s", VTY_NEWLINE); + + if (!*subscr->imsi) + return; + + OSMO_ASSERT(g_hlr); + rc = db_get_auth_data(g_hlr->dbc, subscr->imsi, &aud2g, &aud3g, NULL); + + if (rc) { + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else { + vty_out(vty, "%% Error retrieving data from database (%d)%s", rc, VTY_NEWLINE); + return; + } + } + + if (aud2g.type != OSMO_AUTH_TYPE_NONE && aud2g.type != OSMO_AUTH_TYPE_GSM) { + vty_out(vty, "%% Error: 2G auth data is not of type 'GSM'%s", VTY_NEWLINE); + aud2g = (struct osmo_sub_auth_data){}; + } + + if (aud3g.type != OSMO_AUTH_TYPE_NONE && aud3g.type != OSMO_AUTH_TYPE_UMTS) { + vty_out(vty, "%% Error: 3G auth data is not of type 'UMTS'%s", VTY_NEWLINE); + aud3g = (struct osmo_sub_auth_data){}; + } + + if (aud2g.algo != OSMO_AUTH_ALG_NONE && aud2g.type != OSMO_AUTH_TYPE_NONE) { + vty_out(vty, " 2G auth: %s%s", + osmo_auth_alg_name(aud2g.algo), VTY_NEWLINE); + vty_out(vty, " KI=%s%s", + osmo_hexdump_buf(aud2g.u.gsm.ki), VTY_NEWLINE); + } + + if (aud3g.algo != OSMO_AUTH_ALG_NONE && aud3g.type != OSMO_AUTH_TYPE_NONE) { + vty_out(vty, " 3G auth: %s%s", osmo_auth_alg_name(aud3g.algo), VTY_NEWLINE); + vty_out(vty, " K=%s%s", osmo_hexdump_buf(aud3g.u.umts.k), VTY_NEWLINE); + vty_out(vty, " %s=%s%s", aud3g.u.umts.opc_is_op? "OP" : "OPC", + osmo_hexdump_buf(aud3g.u.umts.opc), VTY_NEWLINE); + vty_out(vty, " IND-bitlen=%u", aud3g.u.umts.ind_bitlen); + if (aud3g.u.umts.sqn) + vty_out(vty, " last-SQN=%"PRIu64, aud3g.u.umts.sqn); + vty_out(vty, VTY_NEWLINE); + } +} + +static int get_subscr_by_argv(struct vty *vty, const char *type, const char *id, struct hlr_subscriber *subscr) +{ + int rc = -1; + if (strcmp(type, "imsi") == 0) + rc = db_subscr_get_by_imsi(g_hlr->dbc, id, subscr); + else if (strcmp(type, "msisdn") == 0) + rc = db_subscr_get_by_msisdn(g_hlr->dbc, id, subscr); + else if (strcmp(type, "id") == 0) + rc = db_subscr_get_by_id(g_hlr->dbc, atoll(id), subscr); + if (rc) + vty_out(vty, "%% No subscriber for %s = '%s'%s", + type, id, VTY_NEWLINE); + return rc; +} + +#define SUBSCR_CMD "subscriber " +#define SUBSCR_CMD_HELP "Subscriber management commands\n" + +#define SUBSCR_ID "(imsi|msisdn|id) IDENT " +#define SUBSCR_ID_HELP \ + "Identify subscriber by IMSI\n" \ + "Identify subscriber by MSISDN (phone number)\n" \ + "Identify subscriber by database ID\n" \ + "IMSI/MSISDN/ID of the subscriber\n" + +#define SUBSCR SUBSCR_CMD SUBSCR_ID +#define SUBSCR_HELP SUBSCR_CMD_HELP SUBSCR_ID_HELP + +#define SUBSCR_UPDATE SUBSCR "update " +#define SUBSCR_UPDATE_HELP SUBSCR_HELP "Set or update subscriber data\n" + +DEFUN(subscriber_show, + subscriber_show_cmd, + SUBSCR "show", + SUBSCR_HELP "Show subscriber information\n") +{ + struct hlr_subscriber subscr; + const char *id_type = argv[0]; + const char *id = argv[1]; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + subscr_dump_full_vty(vty, &subscr); + return CMD_SUCCESS; +} + +DEFUN(subscriber_create, + subscriber_create_cmd, + SUBSCR_CMD "imsi IDENT create", + SUBSCR_CMD_HELP + "Create subscriber by IMSI\n" + "IMSI/MSISDN/ID of the subscriber\n") +{ + int rc; + struct hlr_subscriber subscr; + const char *imsi = argv[0]; + + if (!osmo_imsi_str_valid(imsi)) { + vty_out(vty, "%% Not a valid IMSI: %s%s", imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + rc = db_subscr_create(g_hlr->dbc, imsi); + + if (rc) { + if (rc == -EEXIST) + vty_out(vty, "%% Subscriber already exists for IMSI = %s%s", + imsi, VTY_NEWLINE); + else + vty_out(vty, "%% Error (rc=%d): cannot create subscriber for IMSI = %s%s", + rc, imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + rc = db_subscr_get_by_imsi(g_hlr->dbc, imsi, &subscr); + vty_out(vty, "%% Created subscriber %s%s", imsi, VTY_NEWLINE); + + subscr_dump_full_vty(vty, &subscr); + + return CMD_SUCCESS; +} + +DEFUN(subscriber_delete, + subscriber_delete_cmd, + SUBSCR "delete", + SUBSCR_HELP "Delete subscriber from database\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + + /* Find out the IMSI regardless of which way the caller decided to + * identify the subscriber by. */ + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_delete_by_id(g_hlr->dbc, subscr.id); + if (rc) { + vty_out(vty, "%% Error: Failed to remove subscriber for IMSI '%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% Deleted subscriber for IMSI '%s'%s", subscr.imsi, VTY_NEWLINE); + return CMD_SUCCESS; +} + +DEFUN(subscriber_msisdn, + subscriber_msisdn_cmd, + SUBSCR_UPDATE "msisdn MSISDN", + SUBSCR_UPDATE_HELP + "Set MSISDN (phone number) of the subscriber\n" + "New MSISDN (phone number)\n") +{ + struct hlr_subscriber subscr; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *msisdn = argv[2]; + + if (strlen(msisdn) > sizeof(subscr.msisdn) - 1) { + vty_out(vty, "%% MSISDN is too long, max. %zu characters are allowed%s", + sizeof(subscr.msisdn)-1, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!osmo_msisdn_str_valid(msisdn)) { + vty_out(vty, "%% MSISDN invalid: '%s'%s", msisdn, VTY_NEWLINE); + return CMD_WARNING; + } + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + if (db_subscr_update_msisdn_by_imsi(g_hlr->dbc, subscr.imsi, msisdn)) { + vty_out(vty, "%% Error: cannot update MSISDN for subscriber IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% Updated subscriber IMSI='%s' to MSISDN='%s'%s", + subscr.imsi, msisdn, VTY_NEWLINE); + return CMD_SUCCESS; +} + +static bool is_hexkey_valid(struct vty *vty, const char *label, + const char *hex_str, int minlen, int maxlen) +{ + if (osmo_is_hexstr(hex_str, minlen * 2, maxlen * 2, true)) + return true; + vty_out(vty, "%% Invalid value for %s: '%s'%s", label, hex_str, VTY_NEWLINE); + return false; +} + +#define AUTH_ALG_TYPES_2G "(comp128v1|comp128v2|comp128v3|xor)" +#define AUTH_ALG_TYPES_2G_HELP \ + "Use COMP128v1 algorithm\n" \ + "Use COMP128v2 algorithm\n" \ + "Use COMP128v3 algorithm\n" \ + "Use XOR algorithm\n" + +#define AUTH_ALG_TYPES_3G "milenage" +#define AUTH_ALG_TYPES_3G_HELP \ + "Use Milenage algorithm\n" + +#define A38_XOR_MIN_KEY_LEN 12 +#define A38_XOR_MAX_KEY_LEN 16 +#define A38_COMP128_KEY_LEN 16 + +#define MILENAGE_KEY_LEN 16 + +static bool auth_algo_parse(const char *alg_str, enum osmo_auth_algo *algo, + int *minlen, int *maxlen) +{ + if (!strcasecmp(alg_str, "none")) { + *algo = OSMO_AUTH_ALG_NONE; + *minlen = *maxlen = 0; + } else if (!strcasecmp(alg_str, "comp128v1")) { + *algo = OSMO_AUTH_ALG_COMP128v1; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v2")) { + *algo = OSMO_AUTH_ALG_COMP128v2; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v3")) { + *algo = OSMO_AUTH_ALG_COMP128v3; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "xor")) { + *algo = OSMO_AUTH_ALG_XOR; + *minlen = A38_XOR_MIN_KEY_LEN; + *maxlen = A38_XOR_MAX_KEY_LEN; + } else if (!strcasecmp(alg_str, "milenage")) { + *algo = OSMO_AUTH_ALG_MILENAGE; + *minlen = *maxlen = MILENAGE_KEY_LEN; + } else + return false; + return true; +} + +DEFUN(subscriber_no_aud2g, + subscriber_no_aud2g_cmd, + SUBSCR_UPDATE "aud2g none", + SUBSCR_UPDATE_HELP + "Set 2G authentication data\n" + "Delete 2G authentication data\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + struct sub_auth_data_str aud = { + .type = OSMO_AUTH_TYPE_GSM, + .algo = OSMO_AUTH_ALG_NONE, + }; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud); + + if (rc) { + vty_out(vty, "%% Error: cannot disable 2G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_aud2g, + subscriber_aud2g_cmd, + SUBSCR_UPDATE "aud2g " AUTH_ALG_TYPES_2G " ki KI", + SUBSCR_UPDATE_HELP + "Set 2G authentication data\n" + AUTH_ALG_TYPES_2G_HELP + "Set Ki Encryption Key\n" "Ki as 32 hexadecimal characters\n") +{ + struct hlr_subscriber subscr; + int rc; + int minlen = 0; + int maxlen = 0; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *alg_type = argv[2]; + const char *ki = argv[3]; + struct sub_auth_data_str aud2g = { + .type = OSMO_AUTH_TYPE_GSM, + .u.gsm.ki = ki, + }; + + if (!auth_algo_parse(alg_type, &aud2g.algo, &minlen, &maxlen)) { + vty_out(vty, "%% Unknown auth algorithm: '%s'%s", alg_type, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!is_hexkey_valid(vty, "KI", aud2g.u.gsm.ki, minlen, maxlen)) + return CMD_WARNING; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud2g); + + if (rc) { + vty_out(vty, "%% Error: cannot set 2G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_no_aud3g, + subscriber_no_aud3g_cmd, + SUBSCR_UPDATE "aud3g none", + SUBSCR_UPDATE_HELP + "Set UMTS authentication data (3G, and 2G with UMTS AKA)\n" + "Delete 3G authentication data\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + struct sub_auth_data_str aud = { + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_NONE, + }; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud); + + if (rc) { + vty_out(vty, "%% Error: cannot disable 3G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_aud3g, + subscriber_aud3g_cmd, + SUBSCR_UPDATE "aud3g " AUTH_ALG_TYPES_3G + " k K" + " (op|opc) OP_C" + " [ind-bitlen] [<0-28>]", + SUBSCR_UPDATE_HELP + "Set UMTS authentication data (3G, and 2G with UMTS AKA)\n" + AUTH_ALG_TYPES_3G_HELP + "Set Encryption Key K\n" "K as 32 hexadecimal characters\n" + "Set OP key\n" "Set OPC key\n" "OP or OPC as 32 hexadecimal characters\n" + "Set IND bit length\n" "IND bit length value (default: 5)\n") +{ + struct hlr_subscriber subscr; + int minlen = 0; + int maxlen = 0; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *alg_type = AUTH_ALG_TYPES_3G; + const char *k = argv[2]; + bool opc_is_op = (strcasecmp("op", argv[3]) == 0); + const char *op_opc = argv[4]; + int ind_bitlen = argc > 6? atoi(argv[6]) : 5; + struct sub_auth_data_str aud3g = { + .type = OSMO_AUTH_TYPE_UMTS, + .u.umts = { + .k = k, + .opc_is_op = opc_is_op, + .opc = op_opc, + .ind_bitlen = ind_bitlen, + }, + }; + + if (!auth_algo_parse(alg_type, &aud3g.algo, &minlen, &maxlen)) { + vty_out(vty, "%% Unknown auth algorithm: '%s'%s", alg_type, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!is_hexkey_valid(vty, "K", aud3g.u.umts.k, minlen, maxlen)) + return CMD_WARNING; + + if (!is_hexkey_valid(vty, opc_is_op ? "OP" : "OPC", aud3g.u.umts.opc, + MILENAGE_KEY_LEN, MILENAGE_KEY_LEN)) + return CMD_WARNING; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud3g); + + if (rc) { + vty_out(vty, "%% Error: cannot set 3G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +void hlr_vty_subscriber_init(struct hlr *hlr) +{ + g_hlr = hlr; + + install_element_ve(&subscriber_show_cmd); + install_element(ENABLE_NODE, &subscriber_create_cmd); + install_element(ENABLE_NODE, &subscriber_delete_cmd); + install_element(ENABLE_NODE, &subscriber_msisdn_cmd); + install_element(ENABLE_NODE, &subscriber_no_aud2g_cmd); + install_element(ENABLE_NODE, &subscriber_aud2g_cmd); + install_element(ENABLE_NODE, &subscriber_no_aud3g_cmd); + install_element(ENABLE_NODE, &subscriber_aud3g_cmd); +} diff --git a/src/hlr_vty_subscr.h b/src/hlr_vty_subscr.h new file mode 100644 index 0000000..841db5a --- /dev/null +++ b/src/hlr_vty_subscr.h @@ -0,0 +1,3 @@ +#pragma once + +void hlr_vty_subscriber_init(struct hlr *hlr); diff --git a/tests/Makefile.am b/tests/Makefile.am index 0b625f5..8f1826d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,6 +26,7 @@ testsuite.at \ $(srcdir)/package.m4 \ $(TESTSUITE) \ + test_subscriber.vty \ ctrl_test_runner.py \ $(NULL) @@ -36,10 +37,26 @@ $(NULL) if ENABLE_EXT_TESTS -python-tests: $(BUILT_SOURCES) +python-tests: +# don't run vty and ctrl tests concurrently so that the ports don't conflict + $(MAKE) vty-test $(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v + +VTY_TEST_DB = hlr_vty_test.db + +# To update the VTY script from current application behavior, +# pass -u to vty_script_runner.py by doing: +# make vty-test U=-u +vty-test: + -rm -f $(VTY_TEST_DB) + sqlite3 $(VTY_TEST_DB) < $(top_srcdir)/sql/hlr.sql + osmo_verify_transcript_vty.py -v \ + -n OsmoHLR -p 4258 \ + -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_vty_test.db" \ + $(U) $(srcdir)/*.vty + -rm -f $(VTY_TEST_DB) else -python-tests: $(BUILT_SOURCES) +python-tests: echo "Not running python-based tests (determined at configure-time)" endif diff --git a/tests/test_subscriber.vty b/tests/test_subscriber.vty new file mode 100644 index 0000000..2e0bdce --- /dev/null +++ b/tests/test_subscriber.vty @@ -0,0 +1,348 @@ +OsmoHLR> enable + +OsmoHLR# list +... + subscriber (imsi|msisdn|id) IDENT show + subscriber imsi IDENT create + subscriber (imsi|msisdn|id) IDENT delete + subscriber (imsi|msisdn|id) IDENT update msisdn MSISDN + subscriber (imsi|msisdn|id) IDENT update aud2g none + subscriber (imsi|msisdn|id) IDENT update aud2g (comp128v1|comp128v2|comp128v3|xor) ki KI + subscriber (imsi|msisdn|id) IDENT update aud3g none + subscriber (imsi|msisdn|id) IDENT update aud3g milenage k K (op|opc) OP_C [ind-bitlen] [<0-28>] + +OsmoHLR# subscriber? + subscriber Subscriber management commands + +OsmoHLR# subscriber ? + imsi Identify subscriber by IMSI + msisdn Identify subscriber by MSISDN (phone number) + id Identify subscriber by database ID + +OsmoHLR# subscriber imsi ? + IDENT IMSI/MSISDN/ID of the subscriber +OsmoHLR# subscriber msisdn ? + IDENT IMSI/MSISDN/ID of the subscriber +OsmoHLR# subscriber id ? + IDENT IMSI/MSISDN/ID of the subscriber + +OsmoHLR# subscriber imsi 123456789023000 show +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber id 1 show +% No subscriber for id = '1' +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 1234567890230001 create +% Not a valid IMSI: 1234567890230001 +OsmoHLR# subscriber imsi 12345678902300x create +% Not a valid IMSI: 12345678902300x +OsmoHLR# subscriber imsi 12345 create +% Not a valid IMSI: 12345 + +OsmoHLR# subscriber imsi 123456789023000 create +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: none +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: none +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 123456789023000 update msisdn 12345 +% Updated subscriber IMSI='123456789023000' to MSISDN='12345' + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 +OsmoHLR# subscriber msisdn 12345 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 + +OsmoHLR# subscriber msisdn 12345 update msisdn 423 +% Updated subscriber IMSI='123456789023000' to MSISDN='423' +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + +OsmoHLR# subscriber imsi 123456789023000 update ? + msisdn Set MSISDN (phone number) of the subscriber + aud2g Set 2G authentication data + aud3g Set UMTS authentication data (3G, and 2G with UMTS AKA) + +OsmoHLR# subscriber imsi 123456789023000 update aud2g ? + none Delete 2G authentication data + comp128v1 Use COMP128v1 algorithm + comp128v2 Use COMP128v2 algorithm + comp128v3 Use COMP128v3 algorithm + xor Use XOR algorithm + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ? + ki Set Ki Encryption Key + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki ? + KI Ki as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki val ? + + +OsmoHLR# subscriber imsi 123456789023000 update aud2g xor ki Deaf0ff1ceD0d0DabbedD1ced1ceF00d +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: XOR + KI=deaf0ff1ced0d0dabbedd1ced1cef00d + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki BeefedCafeFaceAcedAddedDecadeFee +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee + +OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef + +OsmoHLR# subscriber msisdn 423 update aud2g comp128v3 ki C01ffedC1cadaeAc1d1f1edAcac1aB0a +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g nonsense ki BeefedCafeFaceAcedAddedDecadeFee +% Unknown command. +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g milenage ki BeefedCafeFaceAcedAddedDecadeFee +% Unknown command. +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g xor ki CoiffedCicadaeAcidifiedAcaciaBoa +% Invalid value for KI: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g xor ki C01ffedC1cadaeAc1d1f1edAcac1aB0aX +% Invalid value for KI: 'C01ffedC1cadaeAc1d1f1edAcac1aB0aX' +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g none +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + + +OsmoHLR# subscriber imsi 123456789023000 update aud3g ? + none Delete 3G authentication data + milenage Use Milenage algorithm + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage ? + k Set Encryption Key K + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k ? + K K as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d ? + op Set OP key + opc Set OPC key + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc ? + OP_C OP or OPC as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ? + [ind-bitlen] Set IND bit length + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ind-bitlen ? + [<0-28>] IND bit length value (default: 5) + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=5 + + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op DeafBeddedBabeAcceededFadedDecaf +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OP=deafbeddedbabeacceededfadeddecaf + IND-bitlen=5 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g none +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ind-bitlen 23 +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k CoiffedCicadaeAcidifiedAcaciaBoa opc CededEffacedAceFacedBadFadedBeef +% Invalid value for K: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CoiffedCicadaeAcidifiedAcaciaBoa +% Invalid value for OPC: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op CoiffedCicadaeAcidifiedAcaciaBoa +% Invalid value for OP: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 delete +% Deleted subscriber for IMSI '123456789023000' + +OsmoHLR# subscriber imsi 123456789023000 show +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber id 1 show +% No subscriber for id = '1' +OsmoHLR# subscriber msisdn 423 show +% No subscriber for msisdn = '423' + +OsmoHLR# subscriber imsi 123456789023000 create +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + +OsmoHLR# subscriber imsi 123456789023000 delete +% Deleted subscriber for IMSI '123456789023000' -- To view, visit https://gerrit.osmocom.org/4273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 15 04:12:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 04:12:38 +0000 Subject: python/osmo-python-tests[master]: add osmo_verify_transcript_{vty, ctrl}.py for easier vty and ... In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 15 04:17:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 15 Oct 2017 04:17:05 +0000 Subject: python/osmo-python-tests[master]: add osmo_verify_transcript_{vty, ctrl}.py for easier vty and ... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/4272/2/osmopy/osmo_verify_transcript_ctrl.py File osmopy/osmo_verify_transcript_ctrl.py: Line 82: data = self.socket.recv(4096) this obviously fails to receive any response above 4kb; this is code taken from ctrl_test_runner.py and so far isn't worth the trouble to fix. -- To view, visit https://gerrit.osmocom.org/4272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 15 16:00:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 15 Oct 2017 16:00:21 +0000 Subject: osmo-hlr[master]: fix db_subscr_get_by_*(): clear output data; test in db_test.c In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I038bd437452c87841d709fcdd5ac30ab1356b2db Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 15 16:01:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 15 Oct 2017 16:01:00 +0000 Subject: osmo-ggsn[master]: sgsnemu: Print warnings on broken IPv6 configuration (acept_ra) In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I563092ca35bc74f035a5023e11256779aac46e11 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 15 16:01:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 15 Oct 2017 16:01:02 +0000 Subject: osmo-ggsn[master]: sgsnemu: Make use of "dependon" feature in gengetopt In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ief27275e90e6bce23aed1e83874dbac98dd0926b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 15 16:01:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 15 Oct 2017 16:01:08 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Make use of "dependon" feature in gengetopt In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Make use of "dependon" feature in gengetopt ...................................................................... sgsnemu: Make use of "dependon" feature in gengetopt The gengetopt syntax can specify that a particular command line argument depends on some other argument/option present. We can use this to provide useful feedback to the user at the command line parsing state, like --pingrate making no sense without --pinghost being specified. Change-Id: Ief27275e90e6bce23aed1e83874dbac98dd0926b --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo 2 files changed, 57 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 441322b..1c02baa 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -676,12 +676,60 @@ /* checks for required options */ /* checks for dependences among options */ + if (args_info->net_given && !args_info->createif_given) { + fprintf(stderr, + "%s: '--net' ('-n') option depends on option 'createif'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->defaultroute_given && !args_info->createif_given) { + fprintf(stderr, + "%s: '--defaultroute' option depends on option 'createif'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->ipup_given && !args_info->createif_given) { + fprintf(stderr, + "%s: '--ipup' option depends on option 'createif'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->ipdown_given && !args_info->createif_given) { + fprintf(stderr, + "%s: '--ipdown' option depends on option 'createif'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } if (args_info->tun_device_given && !args_info->createif_given) { fprintf(stderr, "%s: '--tun-device' option depends on option 'createif'%s\n", prog_name, (additional_error ? additional_error : "")); error_occurred = 1; } + if (args_info->pingrate_given && !args_info->pinghost_given) { + fprintf(stderr, + "%s: '--pingrate' option depends on option 'pinghost'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->pingsize_given && !args_info->pinghost_given) { + fprintf(stderr, + "%s: '--pingsize' option depends on option 'pinghost'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->pingcount_given && !args_info->pinghost_given) { + fprintf(stderr, + "%s: '--pingcount' option depends on option 'pinghost'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + if (args_info->pingquiet_given && !args_info->pinghost_given) { + fprintf(stderr, + "%s: '--pingquiet' option depends on option 'pinghost'%s\n", + prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } return error_occurred; } diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 7592eb5..8136d3a 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -50,16 +50,17 @@ option "pwd" p "Login password" string default="hemmelig" no option "createif" - "Create local network interface" flag off -option "net" n "Network address for local interface" string no -option "defaultroute" - "Create default route" flag off -option "ipup" - "Script to run after link-up" string no -option "ipdown" - "Script to run after link-down" string no +option "net" n "Network address for local interface" string dependon="createif" no +option "defaultroute" - "Create default route" flag dependon="createif" off +option "ipup" - "Script to run after link-up" string dependon="createif" no +option "ipdown" - "Script to run after link-down" string dependon="createif" no option "tun-device" - "Name of the local network interface" string dependon="createif" no option "pinghost" - "Ping remote host" string no -option "pingrate" - "Number of ping req per second" int default="1" no -option "pingsize" - "Number of ping data bytes" int default="56" no -option "pingcount" - "Number of ping req to send" int default="0" no -option "pingquiet" - "Do not print ping packet info" flag off +option "pingrate" - "Number of ping req per second" int default="1" dependon="pinghost" no +option "pingsize" - "Number of ping data bytes" int default="56" dependon="pinghost" no +option "pingcount" - "Number of ping req to send" int default="0" dependon="pinghost" no +option "pingquiet" - "Do not print ping packet info" flag dependon="pinghost" off + option "no-tx-gpdu-seq" - "Don't transmit G-PDU sequence nums" flag off option "pdp-type" t "PDP Type" string default="v4" no typestr="(v4|v6)" -- To view, visit https://gerrit.osmocom.org/4267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ief27275e90e6bce23aed1e83874dbac98dd0926b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 15 16:01:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 15 Oct 2017 16:01:08 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Print warnings on broken IPv6 configuration (acept_ra) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Print warnings on broken IPv6 configuration (acept_ra) ...................................................................... sgsnemu: Print warnings on broken IPv6 configuration (acept_ra) When sgsnemu is used for an IPv6 pdp context, we rely on the router discovery procedure and SLAAC to set the correct IPv6 address/prefix on the tun device. This requires the system to be configure to accept router-advertisements on the tun device. Let's print a warning if accept_ra for the specific tun device is set to a wrong value. We're leaving it up to the user to either set a system-wide /proc/sys/net/ipv6/conf/default/accept_ra or to configure this in an ip-up script used together with sgsnemu. Change-Id: I563092ca35bc74f035a5023e11256779aac46e11 --- M sgsnemu/sgsnemu.c 1 file changed, 57 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index c83aebd..a85c9cf 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -968,6 +968,42 @@ return 0; } +/* read a single value from a /procc file, up to 255 bytes, callee-allocated */ +static char *proc_read(const char *path) +{ + char *ret = NULL; + FILE *f; + + f = fopen(path, "r"); + if (!f) + return NULL; + + ret = malloc(256); + if (!ret) + goto out; + + if (!fgets(ret, 256, f)) { + free(ret); + ret = NULL; + goto out; + } + return ret; + +out: + fclose(f); + return ret; +} + +/* Read value of a /proc/sys/net/ipv6/conf file for given device. + * Memory is dynamically allocated, caller must free it later. */ +static char *proc_ipv6_conf_read(const char *dev, const char *file) +{ + const char *fmt = "/proc/sys/net/ipv6/conf/%s/%s"; + char path[strlen(fmt) + strlen(dev) + strlen(file)]; + snprintf(path, sizeof(path), fmt, dev, file); + return proc_read(path); +} + char *print_ipprot(int t) { switch (t) { @@ -1425,6 +1461,27 @@ tun_runscript(tun, options.ipup); } + /* now that ip-up has been executed, check if we are configured to + * accept router advertisements */ + if (options.createif && options.pdp_type == PDP_EUA_TYPE_v6) { + char *accept_ra, *forwarding; + + accept_ra = proc_ipv6_conf_read(tun->devname, "accept_ra"); + forwarding = proc_ipv6_conf_read(tun->devname, "forwarding"); + if (!accept_ra || !forwarding) + printf("Could not open proc file for %s ?!?\n", tun->devname); + else { + if (!strcmp(accept_ra, "0") || + (!strcmp(forwarding, "1") && !strcmp(accept_ra, "1"))) { + printf("%s is %s, i.e. your tun device is not configured to accept " + "router advertisements; SLAAC will not suceed, please " + "fix your setup!\n"); + } + free(accept_ra); + free(forwarding); + } + } + ipset((struct iphash_t *)pdp->peer, &addr); state = 2; /* Connected */ -- To view, visit https://gerrit.osmocom.org/4191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I563092ca35bc74f035a5023e11256779aac46e11 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 15 16:01:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 15 Oct 2017 16:01:08 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Use getprotobynumber() in print_ipprot() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Use getprotobynumber() in print_ipprot() ...................................................................... sgsnemu: Use getprotobynumber() in print_ipprot() There's no point in sgsnemu doing a poor mans reimplementation of what the C library provides already by means of getprotobynumber() Change-Id: I8cdc460e4fa5d86d80addf6e5f341d2d80093a35 --- M sgsnemu/sgsnemu.c 1 file changed, 5 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 50eca63..23cf208 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -993,16 +993,12 @@ static char *print_ipprot(int t) { - switch (t) { - case 1: - return "ICMP"; - case 6: - return "TCP"; - case 17: - return "UDP"; - default: + struct protoent *pe = getprotobynumber(t); + + if (!pe) return "Unknown"; - }; + else + return pe->p_name; } static char *print_icmptype(int t) -- To view, visit https://gerrit.osmocom.org/4270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8cdc460e4fa5d86d80addf6e5f341d2d80093a35 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 15 16:01:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 15 Oct 2017 16:01:09 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Remove dead code: encaps_printf() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Remove dead code: encaps_printf() ...................................................................... sgsnemu: Remove dead code: encaps_printf() This function is never used/called, remove it. Change-Id: I37a447e4d5387e3fc5f4433ab20ceba7c446684b --- M sgsnemu/sgsnemu.c 1 file changed, 0 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 7b7bb4e..50eca63 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -955,19 +955,6 @@ } -static int encaps_printf(struct pdp_t *pdp, void *pack, unsigned len) -{ - unsigned int i; - printf("The packet looks like this:\n"); - for (i = 0; i < len; i++) { - printf("%02x ", (unsigned char)*(char *)(pack + i)); - if (!((i + 1) % 16)) - printf("\n"); - }; - printf("\n"); - return 0; -} - /* read a single value from a /procc file, up to 255 bytes, callee-allocated */ static char *proc_read(const char *path) { -- To view, visit https://gerrit.osmocom.org/4269 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I37a447e4d5387e3fc5f4433ab20ceba7c446684b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 15 16:01:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 15 Oct 2017 16:01:09 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Mark local functions 'static' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Mark local functions 'static' ...................................................................... sgsnemu: Mark local functions 'static' We don't need to export those to the global name space as they're not called from code in other files. Change-Id: I454249335ba46abdb3afbc669c4a06a06f39ae72 --- M sgsnemu/sgsnemu.c 1 file changed, 23 insertions(+), 23 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index a85c9cf..7b7bb4e 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -161,13 +161,13 @@ int pingseq = 0; /* Ping sequence counter */ struct timeval firstping; -void signal_handler(int signo) +static void signal_handler(int signo) { if (state == 2) state = 3; /* Tell main loop to finish. */ } -int ipset(struct iphash_t *ipaddr, struct in46_addr *addr) +static int ipset(struct iphash_t *ipaddr, struct in46_addr *addr) { int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; @@ -183,7 +183,7 @@ return 0; } -int ipdel(struct iphash_t *ipaddr) +static int ipdel(struct iphash_t *ipaddr) { int hash = ippool_hash(&ipaddr->addr) % MAXCONTEXTS; struct iphash_t *h; @@ -201,7 +201,7 @@ return EOF; /* End of linked list and not found */ } -int ipget(struct iphash_t **ipaddr, struct in46_addr *addr) +static int ipget(struct iphash_t **ipaddr, struct in46_addr *addr) { int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; @@ -215,7 +215,7 @@ } /* Used to write process ID to file. Assume someone else will delete */ -void log_pid(char *pidfile) +static void log_pid(char *pidfile) { FILE *file; mode_t oldmask; @@ -229,7 +229,7 @@ fclose(file); } -int process_options(int argc, char **argv) +static int process_options(int argc, char **argv) { /* gengeopt declarations */ struct gengetopt_args_info args_info; @@ -955,7 +955,7 @@ } -int encaps_printf(struct pdp_t *pdp, void *pack, unsigned len) +static int encaps_printf(struct pdp_t *pdp, void *pack, unsigned len) { unsigned int i; printf("The packet looks like this:\n"); @@ -1004,7 +1004,7 @@ return proc_read(path); } -char *print_ipprot(int t) +static char *print_ipprot(int t) { switch (t) { case 1: @@ -1018,7 +1018,7 @@ }; } -char *print_icmptype(int t) +static char *print_icmptype(int t) { static char *ttab[] = { "Echo Reply", @@ -1044,7 +1044,7 @@ return (ttab[t]); } -int msisdn_add(struct ul16_t *src, struct ul16_t *dst, int add) +static int msisdn_add(struct ul16_t *src, struct ul16_t *dst, int add) { unsigned int n; uint64_t i64 = 0; @@ -1088,7 +1088,7 @@ } -int imsi_add(uint64_t src, uint64_t * dst, int add) +static int imsi_add(uint64_t src, uint64_t * dst, int add) { /* TODO: big endian / small endian ??? */ uint64_t i64 = 0; @@ -1123,7 +1123,7 @@ } /* Calculate time left until we have to send off next ping packet */ -int ping_timeout(struct timeval *tp) +static int ping_timeout(struct timeval *tp) { struct timezone tz; struct timeval tv; @@ -1145,7 +1145,7 @@ } /* Print out statistics when at the end of ping sequence */ -int ping_finish() +static int ping_finish() { struct timezone tz; struct timeval tv; @@ -1178,7 +1178,7 @@ } /* Handle a received ping packet. Print out line and update statistics. */ -int encaps_ping(struct pdp_t *pdp, void *pack, unsigned len) +static int encaps_ping(struct pdp_t *pdp, void *pack, unsigned len) { struct timezone tz; struct timeval tv; @@ -1247,8 +1247,8 @@ } /* Create a new ping packet and send it off to peer. */ -int create_ping(void *gsn, struct pdp_t *pdp, - struct in_addr *dst, int seq, unsigned int datasize) +static int create_ping(void *gsn, struct pdp_t *pdp, + struct in_addr *dst, int seq, unsigned int datasize) { struct ip_ping pack; @@ -1326,7 +1326,7 @@ return gtp_data_req(gsn, pdp, &pack, 28 + datasize); } -int delete_context(struct pdp_t *pdp) +static int delete_context(struct pdp_t *pdp) { if (tun && options.ipdown) @@ -1345,7 +1345,7 @@ static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; /* Callback for receiving messages from tun */ -int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; struct in46_addr src; @@ -1389,7 +1389,7 @@ return 0; } -int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) +static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) { struct in46_addr addr; @@ -1489,14 +1489,14 @@ return 0; } -int delete_pdp_conf(struct pdp_t *pdp, int cause) +static int delete_pdp_conf(struct pdp_t *pdp, int cause) { printf("Received delete PDP context response. Cause value: %d\n", cause); return 0; } -int echo_conf(int recovery) +static int echo_conf(int recovery) { if (recovery < 0) { @@ -1518,7 +1518,7 @@ return 0; } -int conf(int type, int cause, struct pdp_t *pdp, void *cbp) +static int conf(int type, int cause, struct pdp_t *pdp, void *cbp) { /* if (cause < 0) return 0; Some error occurred. We don't care */ switch (type) { @@ -1535,7 +1535,7 @@ } } -int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) +static int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { /* printf("encaps_tun. Packet received: forwarding to tun\n"); */ return tun_encaps((struct tun_t *)pdp->ipif, pack, len); -- To view, visit https://gerrit.osmocom.org/4268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I454249335ba46abdb3afbc669c4a06a06f39ae72 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 15 16:03:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 15 Oct 2017 16:03:55 +0000 Subject: osmo-ggsn[master]: lib/ippool: Fix listsize calculated 1 elem too small In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4255/1/lib/ippool.c File lib/ippool.c: Line 218: dynsize = (1 << (addr.len*8 - addrprefixlen)); I always thought the "-1" is for the GGSN itself. So if you have a /24 with 256 addresses, one of the addresses is for the GGSN itself. Then you may also want to exclude the network, gateway and/or broadcast addresses in addition. However, the existing code would have mandated the GGSN to use the highest address within the pool to work. All of those assumptions are bad anyway. -- To view, visit https://gerrit.osmocom.org/4255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I95c24bc690490155bec9e3933d678e4668d7745f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 15 16:11:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 15 Oct 2017 16:11:04 +0000 Subject: osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Patch Set 2: (4 comments) https://gerrit.osmocom.org/#/c/4256/2/lib/in46_addr.c File lib/in46_addr.c: Line 198: unsigned int netmask_ipv4_prefixlen(const struct in_addr *netmask) the new functions should have test cases in the (newly introduced) in46a_tests.c file. Adding these three functions and their test cases can then be split out into a separate patch. Also, if we don't need the ipv4/ipv6 specific functions in other code, they could be made static with in46a_prefixlne being the only exported API. Also, doxygen documentation is missing. Line 234: unsigned int in46a_prefixlen(const struct in46_addr *netmask) let's call it in46a_netmasklen or the like? I don't want to have a name that implies it returns the length of a prefix (whihc would take an in46_prefix as input argument anyway) https://gerrit.osmocom.org/#/c/4256/2/lib/tun.c File lib/tun.c: Line 755: int tun_ipv4_local_get(const struct tun_t *tun, struct in46_prefix *prefix) I think this is copy+paste style programming with the ipv6 function below, and the two should probably be unified. Would you agree? https://gerrit.osmocom.org/#/c/4256/2/lib/tun.h File lib/tun.h: Line 97: int tun_ipv6_local_get(const struct tun_t *tun, struct in46_prefix *prefix, int flags); the change of tun_ipv6_local_get() api with flags could be split out as separate commit -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 15 17:26:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 15 Oct 2017 17:26:55 +0000 Subject: [PATCH] libosmocore[master]: stat_item: Complete doxygen documentation for API Message-ID: Review at https://gerrit.osmocom.org/4276 stat_item: Complete doxygen documentation for API The stat_item code base had some incomplete doxygen documentation so far. Let's complete it, and at the same time fix some cosmetic as well as copy+paste issues in the existing documentation bits. Change-Id: Ib514c137b40bf7b9791bd74be99af0b65575f2b6 --- M include/osmocom/core/stat_item.h M src/stat_item.c 2 files changed, 89 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/4276/1 diff --git a/include/osmocom/core/stat_item.h b/include/osmocom/core/stat_item.h index 4cee8a8..260ffb1 100644 --- a/include/osmocom/core/stat_item.h +++ b/include/osmocom/core/stat_item.h @@ -13,32 +13,34 @@ #define OSMO_STAT_ITEM_NOVALUE_ID 0 #define OSMO_STAT_ITEM_NO_UNIT NULL +/*! Individual entry in value FIFO */ struct osmo_stat_item_value { - int32_t id; - int32_t value; + int32_t id; /*!< identifier of value */ + int32_t value; /*!< actual value */ }; -/*! data we keep for each actual value */ +/*! data we keep for each actual item */ struct osmo_stat_item { + /*! back-reference to the item description */ const struct osmo_stat_item_desc *desc; /*! the index of the freshest value */ int32_t last_value_index; - /*! offset to the freshest value in the value fifo */ + /*! offset to the freshest value in the value FIFO */ int16_t last_offs; - /*! value fifo */ + /*! value FIFO */ struct osmo_stat_item_value values[0]; }; -/*! statistics value description */ +/*! Statistics item description */ struct osmo_stat_item_desc { const char *name; /*!< name of the item */ const char *description;/*!< description of the item */ const char *unit; /*!< unit of a value */ - unsigned int num_values;/*!< number of values to store */ - int32_t default_value; + unsigned int num_values;/*!< number of values to store in FIFO */ + int32_t default_value; /*!< default value */ }; -/*! description of a statistics value group */ +/*! Description of a statistics item group */ struct osmo_stat_item_group_desc { /*! The prefix to the name of all values in this group */ const char *group_name_prefix; @@ -46,9 +48,9 @@ const char *group_description; /*! The class to which this group belongs */ int class_id; - /*! The number of values in this group */ + /*! The number of values in this group (size of item_desc) */ const unsigned int num_items; - /*! Pointer to array of value names */ + /*! Pointer to array of value names, length as per num_items */ const struct osmo_stat_item_desc *item_desc; }; @@ -87,31 +89,13 @@ const struct osmo_stat_item *osmo_stat_item_get_by_name( const struct osmo_stat_item_group *statg, const char *name); -/*! Retrieve the next value from the osmo_stat_item object. - * If a new value has been set, it is returned. The idx is used to decide - * which value to return. - * On success, *idx is updated to refer to the next unread value. If - * values have been missed due to FIFO overflow, *idx is incremented by - * (1 + num_lost). - * This way, the osmo_stat_item object can be kept stateless from the reader's - * perspective and therefore be used by several backends simultaneously. - * - * \param val the osmo_stat_item object - * \param idx identifies the next value to be read - * \param value a pointer to store the value - * \returns the increment of the index (0: no value has been read, - * 1: one value has been taken, - * (1+n): n values have been skipped, one has been taken) - */ int osmo_stat_item_get_next(const struct osmo_stat_item *item, int32_t *idx, int32_t *value); /*! Get the last (freshest) value */ static int32_t osmo_stat_item_get_last(const struct osmo_stat_item *item); -/*! Skip all values of the item and update idx accordingly */ int osmo_stat_item_discard(const struct osmo_stat_item *item, int32_t *idx); -/*! Skip all values of all items and update idx accordingly */ int osmo_stat_item_discard_all(int32_t *idx); typedef int (*osmo_stat_item_handler_t)( @@ -119,10 +103,6 @@ typedef int (*osmo_stat_item_group_handler_t)(struct osmo_stat_item_group *, void *); -/*! Iteate over all items - * \param[in] handle_item Call-back function, aborts if rc < 0 - * \param[in] data Private data handed through to \a handle_item - */ int osmo_stat_item_for_each_item(struct osmo_stat_item_group *statg, osmo_stat_item_handler_t handle_item, void *data); diff --git a/src/stat_item.c b/src/stat_item.c index c073a3e..cbcdebc 100644 --- a/src/stat_item.c +++ b/src/stat_item.c @@ -1,5 +1,5 @@ /*! \file stat_item.c - * utility routines for keeping conters about events and the event rates. */ + * utility routines for keeping statistical values */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * (C) 2009-2010 by Harald Welte @@ -24,7 +24,31 @@ /*! \addtogroup osmo_stat_item * @{ - * \file stat_item.c */ + * + * This osmo_stat_item module adds instrumentation capabilities to + * gather measurement and statistical values in a similar fashion to + * what we have as \ref osmo_counter_group. + * + * As opposed to counters, osmo_stat_item do not increment but consist + * of a configurable-sized FIFO, which can store not only the current + * (most recent) value, but also historic values. + * + * The only supported value type is an int32_t. + * + * Getting values from the osmo_stat_item does not modify its state to + * allow for multiple independent back-ends retrieving values (e.g. VTY + * and statd). + * + * Each value stored in the FIFO of an osmo_stat_item has an associated + * value_id. The value_id is derived from an application-wide globally + * incrementing counter, so (until the counter wraps) more recent + * values will have higher values. + * + * When a new value is set, the oldest value in the FIFO gets silently + * overwritten. Lost values are skipped when getting values from the + * item. + * + */ #include #include @@ -35,12 +59,17 @@ #include #include +/*! global list of stat_item groups */ static LLIST_HEAD(osmo_stat_item_groups); +/*! counter for assigning globally unique value identifiers */ static int32_t global_value_id = 0; +/*! talloc context from which we allocate */ static void *tall_stat_item_ctx; -/*! Allocate a new group of counters according to description +/*! Allocate a new group of counters according to description. + * Allocate a group of stat items described in \a desc from talloc context \a ctx, + * giving the new group the index \a idx. * \param[in] ctx \ref talloc context * \param[in] desc Statistics item group description * \param[in] idx Index of new stat item group @@ -112,13 +141,19 @@ return group; } -/*! Free the memory for the specified group of counters */ +/*! Free the memory for the specified group of stat items */ void osmo_stat_item_group_free(struct osmo_stat_item_group *grp) { llist_del(&grp->list); talloc_free(grp); } +/*! Set the a given stat_item to the given value. + * This function adds a new value for the given stat_item at the end of + * the FIFO. + * \param[in] item The stat_item whose \a value we want to set + * \param[in] value The numeric value we want to store at end of FIFO + */ void osmo_stat_item_set(struct osmo_stat_item *item, int32_t value) { item->last_offs += 1; @@ -133,6 +168,22 @@ item->values[item->last_offs].id = global_value_id; } +/*! Retrieve the next value from the osmo_stat_item object. + * If a new value has been set, it is returned. The idx is used to decide + * which value to return. + * On success, *idx is updated to refer to the next unread value. If + * values have been missed due to FIFO overflow, *idx is incremented by + * (1 + num_lost). + * This way, the osmo_stat_item object can be kept stateless from the reader's + * perspective and therefore be used by several backends simultaneously. + * + * \param val the osmo_stat_item object + * \param idx identifies the next value to be read + * \param value a pointer to store the value + * \returns the increment of the index (0: no value has been read, + * 1: one value has been taken, + * (1+n): n values have been skipped, one has been taken) + */ int osmo_stat_item_get_next(const struct osmo_stat_item *item, int32_t *next_idx, int32_t *value) { @@ -170,7 +221,7 @@ return idx_delta; } -/*! Skip all values of this item and update idx accordingly */ +/*! Skip/discard all values of this item and update \a idx accordingly */ int osmo_stat_item_discard(const struct osmo_stat_item *item, int32_t *idx) { int discarded = item->values[item->last_offs].id + 1 - *idx; @@ -179,7 +230,7 @@ return discarded; } -/*! Skip all values of all items and update idx accordingly */ +/*! Skip all values of all items and update \a idx accordingly */ int osmo_stat_item_discard_all(int32_t *idx) { int discarded = global_value_id + 1 - *idx; @@ -188,7 +239,8 @@ return discarded; } -/*! Initialize the stat item module */ +/*! Initialize the stat item module. Call this once from your program. + * \param[in] tall_ctx Talloc context from which this module allocates */ int osmo_stat_item_init(void *tall_ctx) { tall_stat_item_ctx = tall_ctx; @@ -196,7 +248,10 @@ return 0; } -/*! Search for item group based on group name and index */ +/*! Search for item group based on group name and index + * \param[in] name Name of stats_item_group we want to find + * \param[in] idx Index of the group we want to find + * \returns pointer to group, if found; NULL otherwise */ struct osmo_stat_item_group *osmo_stat_item_get_group_by_name_idx( const char *name, const unsigned int idx) { @@ -213,7 +268,10 @@ return NULL; } -/*! Search for item group based on group name */ +/*! Search for item based on group + item name + * \param[in] statg group in which to search for the item + * \param[in] name name of item to search within \a statg + * \returns pointer to item, if found; NULL otherwise */ const struct osmo_stat_item *osmo_stat_item_get_by_name( const struct osmo_stat_item_group *statg, const char *name) { @@ -233,6 +291,11 @@ return NULL; } +/*! Iterate over all items in group, call user-supplied function on each + * \param[in] statg stat_item group over whose items to iterate + * \param[in] handle_item Call-back function, aborts if rc < 0 + * \param[in] data Private data handed through to \a handle_item + */ int osmo_stat_item_for_each_item(struct osmo_stat_item_group *statg, osmo_stat_item_handler_t handle_item, void *data) { @@ -249,6 +312,10 @@ return rc; } +/*! Iterate over all stat_item groups in system, call user-supplied function on each + * \param[in] handle_group Call-back function, aborts if rc < 0 + * \param[in] data Private data handed through to \a handle_group + */ int osmo_stat_item_for_each_group(osmo_stat_item_group_handler_t handle_group, void *data) { struct osmo_stat_item_group *statg; -- To view, visit https://gerrit.osmocom.org/4276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib514c137b40bf7b9791bd74be99af0b65575f2b6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 15 17:33:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 15 Oct 2017 17:33:22 +0000 Subject: osmo-ggsn[master]: lib/ippool: Fix listsize calculated 1 elem too small In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4255/1/lib/ippool.c File lib/ippool.c: Line 218: dynsize = (1 << (addr.len*8 - addrprefixlen)); > I always thought the "-1" is for the GGSN itself. So if you have a /24 wit I agree with all those wrong assumptions the code was difficult to understand. For instance I thought that the GATEWAY IP is the one assigned to the tun interface, but indeed it can be yet another IP. I think this patch is still OK as all this cases should be implemented by using the blacklist feature presented in next patch, perhaps by adding extra config parameters such as "ip blacklist list-of-A.B.C.D" -- To view, visit https://gerrit.osmocom.org/4255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I95c24bc690490155bec9e3933d678e4668d7745f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 16 08:52:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Oct 2017 08:52:28 +0000 Subject: [PATCH] openbsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail Message-ID: Review at https://gerrit.osmocom.org/4277 bsc_api: Fix NULL secondary_lchan access in handle_ass_fail Related: OW#3893 Program terminated with signal SIGSEGV, Segmentation fault. 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 (gdb) bt 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 1 0x0805ab80 in lchan_release (lchan=0x0, sacch_deact=sacch_deact at entry=0, mode=mode at entry=RSL_REL_LOCAL_END) at chan_alloc.c:410 2 0x0805c1dd in handle_ass_fail (msg=0x94142b8, conn=0x9251048) at bsc_api.c:459 3 dispatch_dtap (msg=0x94142b8, link_id=0 '\000', conn=0x9251048) at bsc_api.c:598 4 gsm0408_rcvmsg (msg=msg at entry=0x94142b8, link_id=0 '\000') at bsc_api.c:658 5 0x08058ca2 in abis_rsl_rx_rll (msg=0x94142b8) at abis_rsl.c:1686 6 abis_rsl_rcvmsg (msg=0x94142b8) at abis_rsl.c:2097 7 0xb7e8cf9a in handle_ts1_read (bfd=0x94e8e08) at input/ipaccess.c:271 8 ipaccess_fd_cb (bfd=0x94e8e08, what=1) at input/ipaccess.c:386 9 0xb7ee8434 in osmo_select_main (polling=polling at entry=0) at select.c:158 10 0x0804bd7c in main (argc=6, argv=0xbfc27144) at osmo_bsc_main.c:272 (gdb) print lchan $2 = (const struct gsm_lchan *) 0x0 Change-Id: Ied5bd90b9c06f27135a2e3c46e40d49d27d9a387 --- M openbsc/src/libbsc/bsc_api.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/77/4277/1 diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index fa45421..0c16db3 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -485,8 +485,10 @@ /* stop the timer and release it */ osmo_timer_del(&conn->T10); - lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); - conn->secondary_lchan = NULL; + if (conn->secondary_lchan) { + lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); + conn->secondary_lchan = NULL; + } gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { -- To view, visit https://gerrit.osmocom.org/4277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied5bd90b9c06f27135a2e3c46e40d49d27d9a387 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 16 08:52:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Oct 2017 08:52:32 +0000 Subject: [PATCH] osmo-bsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail Message-ID: Review at https://gerrit.osmocom.org/4278 bsc_api: Fix NULL secondary_lchan access in handle_ass_fail Related: OW#3893 Program terminated with signal SIGSEGV, Segmentation fault. 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 (gdb) bt 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 1 0x0805ab80 in lchan_release (lchan=0x0, sacch_deact=sacch_deact at entry=0, mode=mode at entry=RSL_REL_LOCAL_END) at chan_alloc.c:410 2 0x0805c1dd in handle_ass_fail (msg=0x94142b8, conn=0x9251048) at bsc_api.c:459 3 dispatch_dtap (msg=0x94142b8, link_id=0 '\000', conn=0x9251048) at bsc_api.c:598 4 gsm0408_rcvmsg (msg=msg at entry=0x94142b8, link_id=0 '\000') at bsc_api.c:658 5 0x08058ca2 in abis_rsl_rx_rll (msg=0x94142b8) at abis_rsl.c:1686 6 abis_rsl_rcvmsg (msg=0x94142b8) at abis_rsl.c:2097 7 0xb7e8cf9a in handle_ts1_read (bfd=0x94e8e08) at input/ipaccess.c:271 8 ipaccess_fd_cb (bfd=0x94e8e08, what=1) at input/ipaccess.c:386 9 0xb7ee8434 in osmo_select_main (polling=polling at entry=0) at select.c:158 10 0x0804bd7c in main (argc=6, argv=0xbfc27144) at osmo_bsc_main.c:272 (gdb) print lchan $2 = (const struct gsm_lchan *) 0x0 Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1 --- M src/libbsc/bsc_api.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/78/4278/1 diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index b42c382..44c50c1 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -487,8 +487,10 @@ /* stop the timer and release it */ osmo_timer_del(&conn->T10); - lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); - conn->secondary_lchan = NULL; + if (conn->secondary_lchan) { + lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); + conn->secondary_lchan = NULL; + } gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { -- To view, visit https://gerrit.osmocom.org/4278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 16 09:48:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 16 Oct 2017 09:48:37 +0000 Subject: python/osmo-python-tests[master]: add osmo_ipa.py, from originally openbsc.git/contrib/ipa.py In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Once this is merged we can remove duplicates from other repos. -- To view, visit https://gerrit.osmocom.org/4271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaef955f04b97e8f266339b37b46d2523d1247cb9 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 10:44:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 10:44:20 +0000 Subject: openbsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Patch Set 1: Do you conceptually understand when this can happen? If yes, please add the rationale to the commit log message -- To view, visit https://gerrit.osmocom.org/4277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied5bd90b9c06f27135a2e3c46e40d49d27d9a387 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 10:44:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 10:44:24 +0000 Subject: openbsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied5bd90b9c06f27135a2e3c46e40d49d27d9a387 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 11:21:36 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 16 Oct 2017 11:21:36 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 1: The makefile snippet to use doxygen is taken from libosmo-netif. It assumes empty doc/ which is cleared on every invocation. In case of libosmo-netif examples are in the separate directory. So ether we have to move examples or change the Makefile.am. I prefer the former as it makes libraries to follow the same structure and simplifies further maintenance. -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 11:25:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 16 Oct 2017 11:25:11 +0000 Subject: libosmocore[master]: stat_item: Complete doxygen documentation for API In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) On a related note: is there some way to quantify this? I mean to compute smth like "XX% of the public API functions are documented". https://gerrit.osmocom.org/#/c/4276/1/src/stat_item.c File src/stat_item.c: Line 181: * \param idx identifies the next value to be read This looks different from the rest of the docs: tabs instead of spaces. Is this intentional? If so - why? -- To view, visit https://gerrit.osmocom.org/4276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib514c137b40bf7b9791bd74be99af0b65575f2b6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:37:25 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 16 Oct 2017 12:37:25 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: move port/timeslot calculator to separate header In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4237 to look at the new patch set (#3). mgcp: move port/timeslot calculator to separate header the functions rtp_calculate_port(), mgcp_timeslot_to_endpoint(), mgcp_endpoint_to_timeslot() may be useful in an application that uses the mgcp_client as well. Unfortunately it is not possible to include mgcp.h when mgcp_client.h is already included. Move the functions to a separate header file that can be included without issues from both sides. Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e --- M include/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_calc.h 3 files changed, 70 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/37/4237/3 diff --git a/include/Makefile.am b/include/Makefile.am index b52e5ea..c0af923 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -10,6 +10,7 @@ osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ osmocom/mgcp/mgcp_common.h \ + osmocom/mgcp/mgcp_calc.h \ osmocom/mgcp/mgcp_internal.h \ osmocom/mgcp/osmux.h \ $(NULL) diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 7307f3c..e78513b 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -37,29 +37,6 @@ #define RTP_PORT_DEFAULT_RANGE_START 16002 #define RTP_PORT_DEFAULT_RANGE_END RTP_PORT_DEFAULT_RANGE_START + 64 -/** - * Calculate the RTP audio port for the given multiplex - * and the direction. This allows a semi static endpoint - * to port calculation removing the need for the BSC - * and the MediaGateway to communicate. - * - * Port usage explained: - * base + (multiplex * 2) + 0 == local port to wait for network packets - * base + (multiplex * 2) + 1 == local port for rtcp - * - * The above port will receive packets from the BTS that need - * to be patched and forwarded to the network. - * The above port will receive packets from the network that - * need to be patched and forwarded to the BTS. - * - * We assume to have a static BTS IP address so we can differentiate - * network and BTS. - * - */ -static inline int rtp_calculate_port(int multiplex, int base) -{ - return base + (multiplex * 2); -} /* @@ -236,22 +213,6 @@ */ struct msgb *mgcp_handle_message(struct mgcp_config *cfg, struct msgb *msg); -/* adc helper */ -static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot) -{ - if (timeslot == 0) { - LOGP(DLMGCP, LOGL_ERROR, "Timeslot should not be 0\n"); - timeslot = 255; - } - - return timeslot + (32 * multiplex); -} - -static inline void mgcp_endpoint_to_timeslot(int endpoint, int *multiplex, int *timeslot) -{ - *multiplex = endpoint / 32; - *timeslot = endpoint % 32; -} int mgcp_send_reset_ep(struct mgcp_endpoint *endp, int endpoint); int mgcp_send_reset_all(struct mgcp_config *cfg); diff --git a/include/osmocom/mgcp/mgcp_calc.h b/include/osmocom/mgcp/mgcp_calc.h new file mode 100644 index 0000000..1939176 --- /dev/null +++ b/include/osmocom/mgcp/mgcp_calc.h @@ -0,0 +1,69 @@ +/* Helpers to calculate ports and endpoints */ + +/* + * (C) 2009-2012 by Holger Hans Peter Freyther + * (C) 2009-2012 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +/** + * Calculate the RTP audio port for the given multiplex + * and the direction. This allows a semi static endpoint + * to port calculation removing the need for the BSC + * and the MediaGateway to communicate. + * + * Port usage explained: + * base + (multiplex * 2) + 0 == local port to wait for network packets + * base + (multiplex * 2) + 1 == local port for rtcp + * + * The above port will receive packets from the BTS that need + * to be patched and forwarded to the network. + * The above port will receive packets from the network that + * need to be patched and forwarded to the BTS. + * + * We assume to have a static BTS IP address so we can differentiate + * network and BTS. + * + */ +static inline int rtp_calculate_port(int multiplex, int base) +{ + return base + (multiplex * 2); +} + +/** + * Calculate the MGCP endpoint from a given timeslot + */ +static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot) +{ + if (timeslot == 0) { + LOGP(DLMGCP, LOGL_ERROR, "Timeslot should not be 0\n"); + timeslot = 255; + } + + return timeslot + (32 * multiplex); +} + +/** + * Calculate the timeslot from a given mgcp endpoint + */ +static inline void mgcp_endpoint_to_timeslot(int endpoint, int *multiplex, int *timeslot) +{ + *multiplex = endpoint / 32; + *timeslot = endpoint % 32; +} -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:50:04 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 16 Oct 2017 12:50:04 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: move misplaced include In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4238 to look at the new patch set (#5). mgcp: move misplaced include mgcp.h includes mgcp_ep.h but does not use anything from it. This does not hurt the mgcp code internally, but when mgcp.h is included by an application compilation fails because mgcp_ep.h is not installed. remove mgcp_ep.h from include list in mgcp.h add mgcp_ep.h to include list in mgcp_conn.c where it is needed. Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 --- M include/osmocom/mgcp/mgcp.h M src/libosmo-mgcp/mgcp_conn.c 2 files changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/38/4238/5 diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 07d9516..7307f3c 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -26,7 +26,6 @@ #include #include #include -#include #include diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index 0da62bc..e0eec63 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -24,6 +24,7 @@ #include #include #include +#include /* Reset codec state and free memory */ static void mgcp_rtp_codec_reset(struct mgcp_rtp_codec *codec) -- To view, visit https://gerrit.osmocom.org/4238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:46 +0000 Subject: [PATCH] libosmocore[master]: [doc] stat_item: Complete doxygen documentation for API In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4276 to look at the new patch set (#2). [doc] stat_item: Complete doxygen documentation for API The stat_item code base had some incomplete doxygen documentation so far. Let's complete it, and at the same time fix some cosmetic as well as copy+paste issues in the existing documentation bits. Change-Id: Ib514c137b40bf7b9791bd74be99af0b65575f2b6 --- M include/osmocom/core/stat_item.h M src/stat_item.c 2 files changed, 89 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/4276/2 diff --git a/include/osmocom/core/stat_item.h b/include/osmocom/core/stat_item.h index 4cee8a8..260ffb1 100644 --- a/include/osmocom/core/stat_item.h +++ b/include/osmocom/core/stat_item.h @@ -13,32 +13,34 @@ #define OSMO_STAT_ITEM_NOVALUE_ID 0 #define OSMO_STAT_ITEM_NO_UNIT NULL +/*! Individual entry in value FIFO */ struct osmo_stat_item_value { - int32_t id; - int32_t value; + int32_t id; /*!< identifier of value */ + int32_t value; /*!< actual value */ }; -/*! data we keep for each actual value */ +/*! data we keep for each actual item */ struct osmo_stat_item { + /*! back-reference to the item description */ const struct osmo_stat_item_desc *desc; /*! the index of the freshest value */ int32_t last_value_index; - /*! offset to the freshest value in the value fifo */ + /*! offset to the freshest value in the value FIFO */ int16_t last_offs; - /*! value fifo */ + /*! value FIFO */ struct osmo_stat_item_value values[0]; }; -/*! statistics value description */ +/*! Statistics item description */ struct osmo_stat_item_desc { const char *name; /*!< name of the item */ const char *description;/*!< description of the item */ const char *unit; /*!< unit of a value */ - unsigned int num_values;/*!< number of values to store */ - int32_t default_value; + unsigned int num_values;/*!< number of values to store in FIFO */ + int32_t default_value; /*!< default value */ }; -/*! description of a statistics value group */ +/*! Description of a statistics item group */ struct osmo_stat_item_group_desc { /*! The prefix to the name of all values in this group */ const char *group_name_prefix; @@ -46,9 +48,9 @@ const char *group_description; /*! The class to which this group belongs */ int class_id; - /*! The number of values in this group */ + /*! The number of values in this group (size of item_desc) */ const unsigned int num_items; - /*! Pointer to array of value names */ + /*! Pointer to array of value names, length as per num_items */ const struct osmo_stat_item_desc *item_desc; }; @@ -87,31 +89,13 @@ const struct osmo_stat_item *osmo_stat_item_get_by_name( const struct osmo_stat_item_group *statg, const char *name); -/*! Retrieve the next value from the osmo_stat_item object. - * If a new value has been set, it is returned. The idx is used to decide - * which value to return. - * On success, *idx is updated to refer to the next unread value. If - * values have been missed due to FIFO overflow, *idx is incremented by - * (1 + num_lost). - * This way, the osmo_stat_item object can be kept stateless from the reader's - * perspective and therefore be used by several backends simultaneously. - * - * \param val the osmo_stat_item object - * \param idx identifies the next value to be read - * \param value a pointer to store the value - * \returns the increment of the index (0: no value has been read, - * 1: one value has been taken, - * (1+n): n values have been skipped, one has been taken) - */ int osmo_stat_item_get_next(const struct osmo_stat_item *item, int32_t *idx, int32_t *value); /*! Get the last (freshest) value */ static int32_t osmo_stat_item_get_last(const struct osmo_stat_item *item); -/*! Skip all values of the item and update idx accordingly */ int osmo_stat_item_discard(const struct osmo_stat_item *item, int32_t *idx); -/*! Skip all values of all items and update idx accordingly */ int osmo_stat_item_discard_all(int32_t *idx); typedef int (*osmo_stat_item_handler_t)( @@ -119,10 +103,6 @@ typedef int (*osmo_stat_item_group_handler_t)(struct osmo_stat_item_group *, void *); -/*! Iteate over all items - * \param[in] handle_item Call-back function, aborts if rc < 0 - * \param[in] data Private data handed through to \a handle_item - */ int osmo_stat_item_for_each_item(struct osmo_stat_item_group *statg, osmo_stat_item_handler_t handle_item, void *data); diff --git a/src/stat_item.c b/src/stat_item.c index c073a3e..cbcdebc 100644 --- a/src/stat_item.c +++ b/src/stat_item.c @@ -1,5 +1,5 @@ /*! \file stat_item.c - * utility routines for keeping conters about events and the event rates. */ + * utility routines for keeping statistical values */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * (C) 2009-2010 by Harald Welte @@ -24,7 +24,31 @@ /*! \addtogroup osmo_stat_item * @{ - * \file stat_item.c */ + * + * This osmo_stat_item module adds instrumentation capabilities to + * gather measurement and statistical values in a similar fashion to + * what we have as \ref osmo_counter_group. + * + * As opposed to counters, osmo_stat_item do not increment but consist + * of a configurable-sized FIFO, which can store not only the current + * (most recent) value, but also historic values. + * + * The only supported value type is an int32_t. + * + * Getting values from the osmo_stat_item does not modify its state to + * allow for multiple independent back-ends retrieving values (e.g. VTY + * and statd). + * + * Each value stored in the FIFO of an osmo_stat_item has an associated + * value_id. The value_id is derived from an application-wide globally + * incrementing counter, so (until the counter wraps) more recent + * values will have higher values. + * + * When a new value is set, the oldest value in the FIFO gets silently + * overwritten. Lost values are skipped when getting values from the + * item. + * + */ #include #include @@ -35,12 +59,17 @@ #include #include +/*! global list of stat_item groups */ static LLIST_HEAD(osmo_stat_item_groups); +/*! counter for assigning globally unique value identifiers */ static int32_t global_value_id = 0; +/*! talloc context from which we allocate */ static void *tall_stat_item_ctx; -/*! Allocate a new group of counters according to description +/*! Allocate a new group of counters according to description. + * Allocate a group of stat items described in \a desc from talloc context \a ctx, + * giving the new group the index \a idx. * \param[in] ctx \ref talloc context * \param[in] desc Statistics item group description * \param[in] idx Index of new stat item group @@ -112,13 +141,19 @@ return group; } -/*! Free the memory for the specified group of counters */ +/*! Free the memory for the specified group of stat items */ void osmo_stat_item_group_free(struct osmo_stat_item_group *grp) { llist_del(&grp->list); talloc_free(grp); } +/*! Set the a given stat_item to the given value. + * This function adds a new value for the given stat_item at the end of + * the FIFO. + * \param[in] item The stat_item whose \a value we want to set + * \param[in] value The numeric value we want to store at end of FIFO + */ void osmo_stat_item_set(struct osmo_stat_item *item, int32_t value) { item->last_offs += 1; @@ -133,6 +168,22 @@ item->values[item->last_offs].id = global_value_id; } +/*! Retrieve the next value from the osmo_stat_item object. + * If a new value has been set, it is returned. The idx is used to decide + * which value to return. + * On success, *idx is updated to refer to the next unread value. If + * values have been missed due to FIFO overflow, *idx is incremented by + * (1 + num_lost). + * This way, the osmo_stat_item object can be kept stateless from the reader's + * perspective and therefore be used by several backends simultaneously. + * + * \param val the osmo_stat_item object + * \param idx identifies the next value to be read + * \param value a pointer to store the value + * \returns the increment of the index (0: no value has been read, + * 1: one value has been taken, + * (1+n): n values have been skipped, one has been taken) + */ int osmo_stat_item_get_next(const struct osmo_stat_item *item, int32_t *next_idx, int32_t *value) { @@ -170,7 +221,7 @@ return idx_delta; } -/*! Skip all values of this item and update idx accordingly */ +/*! Skip/discard all values of this item and update \a idx accordingly */ int osmo_stat_item_discard(const struct osmo_stat_item *item, int32_t *idx) { int discarded = item->values[item->last_offs].id + 1 - *idx; @@ -179,7 +230,7 @@ return discarded; } -/*! Skip all values of all items and update idx accordingly */ +/*! Skip all values of all items and update \a idx accordingly */ int osmo_stat_item_discard_all(int32_t *idx) { int discarded = global_value_id + 1 - *idx; @@ -188,7 +239,8 @@ return discarded; } -/*! Initialize the stat item module */ +/*! Initialize the stat item module. Call this once from your program. + * \param[in] tall_ctx Talloc context from which this module allocates */ int osmo_stat_item_init(void *tall_ctx) { tall_stat_item_ctx = tall_ctx; @@ -196,7 +248,10 @@ return 0; } -/*! Search for item group based on group name and index */ +/*! Search for item group based on group name and index + * \param[in] name Name of stats_item_group we want to find + * \param[in] idx Index of the group we want to find + * \returns pointer to group, if found; NULL otherwise */ struct osmo_stat_item_group *osmo_stat_item_get_group_by_name_idx( const char *name, const unsigned int idx) { @@ -213,7 +268,10 @@ return NULL; } -/*! Search for item group based on group name */ +/*! Search for item based on group + item name + * \param[in] statg group in which to search for the item + * \param[in] name name of item to search within \a statg + * \returns pointer to item, if found; NULL otherwise */ const struct osmo_stat_item *osmo_stat_item_get_by_name( const struct osmo_stat_item_group *statg, const char *name) { @@ -233,6 +291,11 @@ return NULL; } +/*! Iterate over all items in group, call user-supplied function on each + * \param[in] statg stat_item group over whose items to iterate + * \param[in] handle_item Call-back function, aborts if rc < 0 + * \param[in] data Private data handed through to \a handle_item + */ int osmo_stat_item_for_each_item(struct osmo_stat_item_group *statg, osmo_stat_item_handler_t handle_item, void *data) { @@ -249,6 +312,10 @@ return rc; } +/*! Iterate over all stat_item groups in system, call user-supplied function on each + * \param[in] handle_group Call-back function, aborts if rc < 0 + * \param[in] data Private data handed through to \a handle_group + */ int osmo_stat_item_for_each_group(osmo_stat_item_group_handler_t handle_group, void *data) { struct osmo_stat_item_group *statg; -- To view, visit https://gerrit.osmocom.org/4276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib514c137b40bf7b9791bd74be99af0b65575f2b6 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:46 +0000 Subject: [PATCH] libosmocore[master]: Rename 'statistics.c' to 'counter.c' Message-ID: Review at https://gerrit.osmocom.org/4279 Rename 'statistics.c' to 'counter.c' With stat_item, stats.c and stats_statsd.c, it is becoming a bit difficult to understand file naming. Also, the 'statistics.c' file actually only contained osmo_counter handling, so let's rename it to counter.c altogether. Change-Id: I2cfb2310543902b7da46cb15a76e2da317eaed7d --- M include/Makefile.am A include/osmocom/core/counter.h M include/osmocom/core/statistics.h M src/Makefile.am R src/counter.c M src/ctrl/control_if.c M src/stats.c M src/vty/stats_vty.c M src/vty/utils.c 9 files changed, 70 insertions(+), 67 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/4279/1 diff --git a/include/Makefile.am b/include/Makefile.am index 4e92d55..4714003 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -12,6 +12,7 @@ osmocom/core/bitcomp.h \ osmocom/core/byteswap.h \ osmocom/core/conv.h \ + osmocom/core/counter.h \ osmocom/core/crc16.h \ osmocom/core/crc16gen.h \ osmocom/core/crc32gen.h \ diff --git a/include/osmocom/core/counter.h b/include/osmocom/core/counter.h new file mode 100644 index 0000000..f4429cd --- /dev/null +++ b/include/osmocom/core/counter.h @@ -0,0 +1,60 @@ +#pragma once + +/*! \file counter.h + * Common routines regarding counter handling */ + +/*! structure representing a single counter */ +struct osmo_counter { + struct llist_head list; /*!< internal list head */ + const char *name; /*!< human-readable name */ + const char *description; /*!< humn-readable description */ + unsigned long value; /*!< current value */ + unsigned long previous; /*!< previous value */ +}; + +/*! Decrement counter */ +static inline void osmo_counter_dec(struct osmo_counter *ctr) +{ + ctr->value--; +} + +/*! Increment counter */ +static inline void osmo_counter_inc(struct osmo_counter *ctr) +{ + ctr->value++; +} + +/*! Get current value of counter */ +static inline unsigned long osmo_counter_get(struct osmo_counter *ctr) +{ + return ctr->value; +} + +/*! Reset current value of counter to 0 */ +static inline void osmo_counter_reset(struct osmo_counter *ctr) +{ + ctr->value = 0; +} + +/*! Allocate a new counter */ +struct osmo_counter *osmo_counter_alloc(const char *name); + +/*! Free the specified counter + * \param[in] ctr Counter + */ +void osmo_counter_free(struct osmo_counter *ctr); + +/*! Iterate over all counters + * \param[in] handle_counter Call-back function, aborts if rc < 0 + * \param[in] data Private dtata handed through to \a handle_counter + */ +int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data); + +/*! Resolve counter by human-readable name + * \param[in] name human-readable name of counter + * \returns pointer to counter (\ref osmo_counter) or NULL otherwise + */ +struct osmo_counter *osmo_counter_get_by_name(const char *name); + +/*! Return the counter difference since the last call to this function */ +int osmo_counter_difference(struct osmo_counter *ctr); diff --git a/include/osmocom/core/statistics.h b/include/osmocom/core/statistics.h index 5ebb5fc..e7da72a 100644 --- a/include/osmocom/core/statistics.h +++ b/include/osmocom/core/statistics.h @@ -1,60 +1,2 @@ -#pragma once - -/*! \file statistics.h - * Common routines regarding statistics */ - -/*! structure representing a single counter */ -struct osmo_counter { - struct llist_head list; /*!< internal list head */ - const char *name; /*!< human-readable name */ - const char *description; /*!< humn-readable description */ - unsigned long value; /*!< current value */ - unsigned long previous; /*!< previous value */ -}; - -/*! Decrement counter */ -static inline void osmo_counter_dec(struct osmo_counter *ctr) -{ - ctr->value--; -} - -/*! Increment counter */ -static inline void osmo_counter_inc(struct osmo_counter *ctr) -{ - ctr->value++; -} - -/*! Get current value of counter */ -static inline unsigned long osmo_counter_get(struct osmo_counter *ctr) -{ - return ctr->value; -} - -/*! Reset current value of counter to 0 */ -static inline void osmo_counter_reset(struct osmo_counter *ctr) -{ - ctr->value = 0; -} - -/*! Allocate a new counter */ -struct osmo_counter *osmo_counter_alloc(const char *name); - -/*! Free the specified counter - * \param[in] ctr Counter - */ -void osmo_counter_free(struct osmo_counter *ctr); - -/*! Iterate over all counters - * \param[in] handle_counter Call-back function, aborts if rc < 0 - * \param[in] data Private dtata handed through to \a handle_counter - */ -int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data); - -/*! Resolve counter by human-readable name - * \param[in] name human-readable name of counter - * \returns pointer to counter (\ref osmo_counter) or NULL otherwise - */ -struct osmo_counter *osmo_counter_get_by_name(const char *name); - -/*! Return the counter difference since the last call to this function */ -int osmo_counter_difference(struct osmo_counter *ctr); +/* wrapper for legacy code, when counter.h was called statistics.h */ +#include diff --git a/src/Makefile.am b/src/Makefile.am index 8e7ef4b..4925eed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,7 +14,7 @@ libosmocore_la_LIBADD = $(BACKTRACE_LIB) $(TALLOC_LIBS) libosmocore_la_SOURCES = timer.c timer_gettimeofday.c select.c signal.c msgb.c bits.c \ - bitvec.c bitcomp.c statistics.c fsm.c \ + bitvec.c bitcomp.c counter.c fsm.c \ write_queue.c utils.c socket.c \ logging.c logging_syslog.c logging_gsmtap.c rate_ctr.c \ gsmtap_util.c crc16.c panic.c backtrace.c \ diff --git a/src/statistics.c b/src/counter.c similarity index 96% rename from src/statistics.c rename to src/counter.c index fc808f5..6fa87ba 100644 --- a/src/statistics.c +++ b/src/counter.c @@ -1,4 +1,4 @@ -/*! \file statistics.c +/*! \file counter.c * utility routines for keeping some statistics. */ /* * (C) 2009 by Harald Welte @@ -25,7 +25,7 @@ #include #include -#include +#include static LLIST_HEAD(counters); diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index 47efb25..d50ddd0 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/stats.c b/src/stats.c index b39ec53..d9df232 100644 --- a/src/stats.c +++ b/src/stats.c @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #define STATS_DEFAULT_INTERVAL 5 /* secs */ diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index a4c73fa..95f04bc 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -35,7 +35,7 @@ #include #include -#include +#include #include #define CFG_STATS_STR "Configure stats sub-system\n" diff --git a/src/vty/utils.c b/src/vty/utils.c index 9d1bdf9..e7aeb88 100644 --- a/src/vty/utils.c +++ b/src/vty/utils.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include -- To view, visit https://gerrit.osmocom.org/4279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2cfb2310543902b7da46cb15a76e2da317eaed7d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:46 +0000 Subject: [PATCH] libosmocore[master]: [doc] counter.[ch] Add Doxygen API documentation Message-ID: Review at https://gerrit.osmocom.org/4280 [doc] counter.[ch] Add Doxygen API documentation This adds a more complete set of API documentation for all osmo_counter relatedd functions and definitions. Change-Id: I24283c05620ee86a8beb165af98a85d754549efb --- M include/osmocom/core/counter.h M src/counter.c 2 files changed, 23 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/4280/1 diff --git a/include/osmocom/core/counter.h b/include/osmocom/core/counter.h index f4429cd..e692f7e 100644 --- a/include/osmocom/core/counter.h +++ b/include/osmocom/core/counter.h @@ -3,7 +3,7 @@ /*! \file counter.h * Common routines regarding counter handling */ -/*! structure representing a single counter */ +/*! Structure representing a single counter */ struct osmo_counter { struct llist_head list; /*!< internal list head */ const char *name; /*!< human-readable name */ @@ -12,13 +12,15 @@ unsigned long previous; /*!< previous value */ }; -/*! Decrement counter */ +/*! Decrement given counter by one + * \param[in] ctr Counter that's to be decremented */ static inline void osmo_counter_dec(struct osmo_counter *ctr) { ctr->value--; } -/*! Increment counter */ +/*! Increment counter by one. + * \param[in] Counter that's to be incremented */ static inline void osmo_counter_inc(struct osmo_counter *ctr) { ctr->value++; @@ -36,25 +38,12 @@ ctr->value = 0; } -/*! Allocate a new counter */ struct osmo_counter *osmo_counter_alloc(const char *name); -/*! Free the specified counter - * \param[in] ctr Counter - */ void osmo_counter_free(struct osmo_counter *ctr); -/*! Iterate over all counters - * \param[in] handle_counter Call-back function, aborts if rc < 0 - * \param[in] data Private dtata handed through to \a handle_counter - */ int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data); -/*! Resolve counter by human-readable name - * \param[in] name human-readable name of counter - * \returns pointer to counter (\ref osmo_counter) or NULL otherwise - */ struct osmo_counter *osmo_counter_get_by_name(const char *name); -/*! Return the counter difference since the last call to this function */ int osmo_counter_difference(struct osmo_counter *ctr); diff --git a/src/counter.c b/src/counter.c index 6fa87ba..2963777 100644 --- a/src/counter.c +++ b/src/counter.c @@ -29,8 +29,12 @@ static LLIST_HEAD(counters); +/*! Global talloc context for all osmo_counter allocations. */ void *tall_ctr_ctx; +/*! Allocate a new counter with given name. Allocates from tall_ctr_ctx + * \param[in] name Human-readable string name for the counter + * \returns Allocated counter on success; NULL on error */ struct osmo_counter *osmo_counter_alloc(const char *name) { struct osmo_counter *ctr = talloc_zero(tall_ctr_ctx, struct osmo_counter); @@ -44,12 +48,18 @@ return ctr; } +/*! Release/Destroy a given counter + * \param[in] ctr Counter to be destroyed */ void osmo_counter_free(struct osmo_counter *ctr) { llist_del(&ctr->list); talloc_free(ctr); } +/*! Iterate over all counters; call \a handle_cunter call-back for each. + * \param[in] handle_counter Call-back to be called for each counter; aborts if rc < 0 + * \param[in] data Opaque data passed through to \a handle_counter function + * \returns 0 if all \a handle_counter calls successfull; negative on error */ int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data) { @@ -65,6 +75,9 @@ return rc; } +/*! Find a counter by its name. + * \param[in] name Name used to look-up/search counter + * \returns Counter on success; NULL if not found */ struct osmo_counter *osmo_counter_get_by_name(const char *name) { struct osmo_counter *ctr; @@ -76,6 +89,11 @@ return NULL; } +/*! Compute difference between current and previous counter value. + * \param[in] ctr Counter of which the difference is to be computed + * \returns Delta value between current counter and previous counter. Please + * note that the actual counter values are unsigned long, while the + * difference is computed as signed integer! */ int osmo_counter_difference(struct osmo_counter *ctr) { int delta = ctr->value - ctr->previous; -- To view, visit https://gerrit.osmocom.org/4280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24283c05620ee86a8beb165af98a85d754549efb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:46 +0000 Subject: [PATCH] libosmocore[master]: [doc] Add Doxygen API documentation for stats.c and stats_st... Message-ID: Review at https://gerrit.osmocom.org/4281 [doc] Add Doxygen API documentation for stats.c and stats_statsd.c Change-Id: I8e49505f5c19beac90290fdba8821714e8eecd97 --- M include/osmocom/core/stats.h M src/stats.c M src/stats_statsd.c 3 files changed, 145 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/4281/1 diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h index 161b34c..f50796c 100644 --- a/include/osmocom/core/stats.h +++ b/include/osmocom/core/stats.h @@ -1,4 +1,3 @@ -/*! \file stats.h */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * @@ -21,6 +20,10 @@ */ #pragma once +/*! \defgroup stats Statistics reporting + * @{ + * \file stats.h */ + /* a bit of a crude way to disable building/using this on (bare iron) * embedded systems. We cannot use the autoconf-defined HAVE_... macros * here, as that only works at library compile time, not at application @@ -40,42 +43,50 @@ struct rate_ctr_group; struct rate_ctr_desc; +/*! Statistics Class definitions */ enum osmo_stats_class { - OSMO_STATS_CLASS_UNKNOWN, - OSMO_STATS_CLASS_GLOBAL, - OSMO_STATS_CLASS_PEER, - OSMO_STATS_CLASS_SUBSCRIBER, + OSMO_STATS_CLASS_UNKNOWN, /*!< unknown class */ + OSMO_STATS_CLASS_GLOBAL, /*!< global counter/stat_item */ + OSMO_STATS_CLASS_PEER, /*!< peer in a communications link */ + OSMO_STATS_CLASS_SUBSCRIBER, /*!< subscriber */ }; +/*! Statistics Reporter Type */ enum osmo_stats_reporter_type { - OSMO_STATS_REPORTER_LOG, - OSMO_STATS_REPORTER_STATSD, + OSMO_STATS_REPORTER_LOG, /*!< libosmocore logging */ + OSMO_STATS_REPORTER_STATSD, /*!< statsd backend */ }; +/*! One statistics reporter instance. */ struct osmo_stats_reporter { + /*! Type of the reporter (log, statsd) */ enum osmo_stats_reporter_type type; + /*! Human-readable name of this reporter */ char *name; unsigned int have_net_config : 1; /* config */ - int enabled; - char *name_prefix; - char *dest_addr_str; - char *bind_addr_str; - int dest_port; - int mtu; + int enabled; /*!< is this reporter enabled */ + char *name_prefix; /*!< prefix for counter names */ + char *dest_addr_str; /*!< destination IP address */ + char *bind_addr_str; /*!< local bind IP address */ + int dest_port; /*!< destination (UDP) port */ + int mtu; /*!< Maximum Transmission Unit */ + + /*! Maximum class/index to report. FIXME: More details! */ enum osmo_stats_class max_class; /* state */ - int running; - struct sockaddr dest_addr; - int dest_addr_len; - struct sockaddr bind_addr; - int bind_addr_len; - int fd; - struct msgb *buffer; - int agg_enabled; + + int running; /*!< is this reporter running */ + struct sockaddr dest_addr; /*!< destination address of socket */ + int dest_addr_len; /*!< length of \a dest_addr in bytes */ + struct sockaddr bind_addr; /*!< local bind address of socket */ + int bind_addr_len; /*!< length of \a bind_addr in bytes */ + int fd; /*!< file descriptor of socket */ + struct msgb *buffer; /*!< message buffer for log output */ + int agg_enabled; /*!< is aggregation enabled? */ int force_single_flush; struct llist_head list; @@ -131,3 +142,4 @@ int osmo_stats_reporter_udp_close(struct osmo_stats_reporter *srep); #endif /* unix */ +/*! @} */ diff --git a/src/stats.c b/src/stats.c index d9df232..ff31ff6 100644 --- a/src/stats.c +++ b/src/stats.c @@ -22,6 +22,46 @@ * */ +/*! \addtogroup stats + * @{ + * + * This module implements periodic reporting of statistics / counters. + * It supports the notion of multiple \ref osmo_stats_reporter objects + * which independently of each other can report statistics at different + * configurable intervals to different destinations. + * + * In order to use this facility, you have to call \ref + * osmo_stats_init() once at application start-up and then create one or + * more \ref osmo_stats_reporter, either using the direct API functions + * or by using the optional VTY bindings: + * + * - reporting to any of the libosmocore log targets + * \ref osmo_stats_reporter_create_log() creates a new stats_reporter + * which reports to the libosmcoore \ref logging subsystem. + * + * - reporting to statsd (a front-end proxy for the Graphite/Carbon + * metrics server + * \ref osmo_stats_reporter_create_statsd() creates a new stats_reporter + * which reports via UDP to statsd. + * + * You can either use the above API functions directly to create \ref + * osmo_stats_reporter instances, or you can use the VTY support + * contained in libosmovty. See the "stats" configuration node + * installed by osmo_stats_vty_Add_cmds(). + * + * An \ref osmo_stats_reporter reports statistics on all of the following + * libosmocore internal counter/statistics objects: + * - \ref osmo_counter + * - \ref rate_ctr + * - \ref osmo_stat_item + * + * You do not need to do anything in particular to expose a given + * counter or stat_item, they are all exported automatically via any + * \ref osmo_stats_reporter. If you have multiple \ref + * osmo_stats_reporter, they will each report all counters/stat_items. + * + * \file stats.c */ + #include "config.h" #if !defined(EMBEDDED) @@ -137,6 +177,8 @@ return srep; } +/*! Destroy a given stats_reporter. Takes care of first disabling it. + * \param[in] srep stats_reporter that shall be disabled + destroyed */ void osmo_stats_reporter_free(struct osmo_stats_reporter *srep) { osmo_stats_reporter_disable(srep); @@ -144,6 +186,8 @@ talloc_free(srep); } +/*! Initilize the stats reporting module; call this once in your program + * \param[in] ctx Talloc context from which stats related memory is allocated */ void osmo_stats_init(void *ctx) { osmo_stats_ctx = ctx; @@ -153,6 +197,10 @@ start_timer(); } +/*! Find a stats_reporter of given \a type and \a name. + * \param[in] type Type of stats_reporter to find + * \param[in] name Name of stats_reporter to find + * \returns stats_reporter matching \a type and \a name; NULL otherwise */ struct osmo_stats_reporter *osmo_stats_reporter_find(enum osmo_stats_reporter_type type, const char *name) { @@ -172,6 +220,10 @@ #ifdef HAVE_SYS_SOCKET_H +/*! Set the remote (IP) address of a given stats_reporter. + * \param[in] srep stats_reporter whose remote address is to be set + * \param[in] addr String representation of remote IPv4 address + * \returns 0 on success; negative on error */ int osmo_stats_reporter_set_remote_addr(struct osmo_stats_reporter *srep, const char *addr) { int rc; @@ -197,6 +249,10 @@ return update_srep_config(srep); } +/*! Set the remote (UDP) port of a given stats_reporter + * \param[in] srep stats_reporter whose remote address is to be set + * \param[in] port UDP port of remote statsd to which we report + * \returns 0 on success; negative on error */ int osmo_stats_reporter_set_remote_port(struct osmo_stats_reporter *srep, int port) { struct sockaddr_in *sock_addr = (struct sockaddr_in *)&srep->dest_addr; @@ -210,6 +266,10 @@ return update_srep_config(srep); } +/*! Set the local (IP) address of a given stats_reporter. + * \param[in] srep stats_reporter whose remote address is to be set + * \param[in] addr String representation of local IP address + * \returns 0 on success; negative on error */ int osmo_stats_reporter_set_local_addr(struct osmo_stats_reporter *srep, const char *addr) { int rc; @@ -237,6 +297,10 @@ return update_srep_config(srep); } +/*! Set the maximum transmission unit of a given stats_reporter. + * \param[in] srep stats_reporter whose remote address is to be set + * \param[in] mtu Maximum Transmission Unit of \a srep + * \returns 0 on success; negative on error */ int osmo_stats_reporter_set_mtu(struct osmo_stats_reporter *srep, int mtu) { if (!srep->have_net_config) @@ -262,6 +326,10 @@ return 0; } +/*! Set the reporting interval of a given stats_reporter (in seconds). + * \param[in] srep stats_reporter whose remote address is to be set + * \param[in] interval Reporting interval in seconds + * \returns 0 on success; negative on error */ int osmo_stats_set_interval(int interval) { if (interval <= 0) @@ -274,6 +342,10 @@ return 0; } +/*! Set the name prefix of a given stats_reporter. + * \param[in] srep stats_reporter whose name prefix is to be set + * \param[in] prefix NAme perfix to pre-pend for any reported value + * \returns 0 on success; negative on error */ int osmo_stats_reporter_set_name_prefix(struct osmo_stats_reporter *srep, const char *prefix) { talloc_free(srep->name_prefix); @@ -283,6 +355,10 @@ return update_srep_config(srep); } + +/*! Enable the given stats_reporter. + * \param[in] srep stats_reporter who is to be enabled + * \returns 0 on success; negative on error */ int osmo_stats_reporter_enable(struct osmo_stats_reporter *srep) { srep->enabled = 1; @@ -290,6 +366,9 @@ return update_srep_config(srep); } +/*! Disable the given stats_reporter. + * \param[in] srep stats_reporter who is to be disabled + * \returns 0 on success; negative on error */ int osmo_stats_reporter_disable(struct osmo_stats_reporter *srep) { srep->enabled = 0; @@ -301,6 +380,9 @@ #ifdef HAVE_SYS_SOCKET_H +/*! Open the UDP socket for given stats_reporter. + * \param[in] srep stats_reporter whose UDP socket is to be opened + * ]returns 0 on success; negative otherwise */ int osmo_stats_reporter_udp_open(struct osmo_stats_reporter *srep) { int sock; @@ -346,6 +428,9 @@ return rc; } +/*! Closee the UDP socket for given stats_reporter. + * \param[in] srep stats_reporter whose UDP socket is to be closed + * ]returns 0 on success; negative otherwise */ int osmo_stats_reporter_udp_close(struct osmo_stats_reporter *srep) { int rc; @@ -361,6 +446,11 @@ return rc == -1 ? -errno : 0; } +/*! Send given date to given stats_reporter. + * \param[in] srep stats_reporter whose UDP socket is to be opened + * \param[in] data string data to be sent + * \param[in] data_len Length of \a data in bytes + * \returns number of bytes on success; negative otherwise */ int osmo_stats_reporter_send(struct osmo_stats_reporter *srep, const char *data, int data_len) { @@ -379,6 +469,9 @@ return rc; } +/*! Send current accumulated buffer to given stats_reporter. + * \param[in] srep stats_reporter whose UDP socket is to be opened + * \returns number of bytes on success; negative otherwise */ int osmo_stats_reporter_send_buffer(struct osmo_stats_reporter *srep) { int rc; @@ -397,6 +490,13 @@ /*** log reporter ***/ +/*! Create a stats_reporter that logs via libosmocore logging. + * A stats_reporter created via this function will simply print the statistics + * via the libosmocore logging framework, using DLSTATS subsystem and LOGL_INFO + * priority. The configuration of the libosmocore log targets define where this + * information will end up (ignored, text file, stderr, syslog, ...). + * \param[in] name Name of the to-be-created stats_reporter + * \returns stats_reporter on success; NULL on error */ struct osmo_stats_reporter *osmo_stats_reporter_create_log(const char *name) { struct osmo_stats_reporter *srep; @@ -626,3 +726,5 @@ } #endif /* !EMBEDDED */ + +/*! @} */ diff --git a/src/stats_statsd.c b/src/stats_statsd.c index 6e7be73..5145bf7 100644 --- a/src/stats_statsd.c +++ b/src/stats_statsd.c @@ -1,4 +1,3 @@ -/*! \file stats_statsd.c */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * @@ -21,6 +20,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ + +/*! \addtogroup stats + * @{ + * \file stats_statsd.c */ #include "config.h" #if !defined(EMBEDDED) @@ -46,6 +49,10 @@ const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, int64_t value); +/*! Create a stats_reporter reporting to statsd. This creates a stats_reporter + * instance which reports the related statistics data to statsd. + * \param[in] name Name of the to-be-created stats_reporter + * \returns stats_reporter on success; NULL on error */ struct osmo_stats_reporter *osmo_stats_reporter_create_statsd(const char *name) { struct osmo_stats_reporter *srep; @@ -172,3 +179,5 @@ desc->name, value, unit); } #endif /* !EMBEDDED */ + +/* @} */ -- To view, visit https://gerrit.osmocom.org/4281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e49505f5c19beac90290fdba8821714e8eecd97 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:47 +0000 Subject: [PATCH] libosmocore[master]: [doc] src/logging.c: Fix Doxygen syntax to make logging.c sh... Message-ID: Review at https://gerrit.osmocom.org/4282 [doc] src/logging.c: Fix Doxygen syntax to make logging.c show up in logging group Change-Id: I56718e1eca1739a1b0a790f2f3a1b554899a93ab --- M src/logging.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/4282/1 diff --git a/src/logging.c b/src/logging.c index 2e913e5..fa733cd 100644 --- a/src/logging.c +++ b/src/logging.c @@ -21,7 +21,7 @@ * */ -/* \addtogroup logging +/*! \addtogroup logging * @{ * libosmocore Logging sub-system * -- To view, visit https://gerrit.osmocom.org/4282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I56718e1eca1739a1b0a790f2f3a1b554899a93ab Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:47 +0000 Subject: [PATCH] libosmocore[master]: [doc] rate_ctr: Extend Doxygen API documentation with human-... Message-ID: Review at https://gerrit.osmocom.org/4283 [doc] rate_ctr: Extend Doxygen API documentation with human-readable text on its use Change-Id: If9abd46e1b0ebb6114522418fd3b45c1d802968a --- M src/rate_ctr.c 1 file changed, 35 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/4283/1 diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 2985bbb..a04a776 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -22,6 +22,37 @@ * @{ * Counters about events and their event rates. * + * As \ref osmo_counter and \ref osmo_stat_item are concerned only with + * a single given value that may be increased/decreased, or the difference + * to one given previous value, this module adds some support for keeping + * long term information about a given event rate. + * + * A \ref rate_ctr keeps information on the amount of events per second, + * per minute, per hour and per day. + * + * \ref rate_ctr come in groups: An application describes a group of counters + * with their names and identities once in a (typically const) \ref + * rate_ctr_group_desc. + * + * As objects (such as e.g. a subscriber or a PDP context) are + * allocated dynamically at runtime, the application calls \ref + * rate_ctr_group_alloc with a refernce to the \ref + * rate_ctr_group_desc, which causes the library to allocate one set of + * \ref rate_ctr: One for each in the group. + * + * The application then uses functions like \ref rate_ctr_add or \ref + * rate_ctr_inc to increment the value as certain events (e.g. location + * update) happens. + * + * The library internally keeps a timer once per second which iterates + * over all registered counters and which updates the per-second, + * per-minute, per-hour and per-day averages based on the current + * value. + * + * The counters can be reported using \ref stats or by VTY + * introspection, as well as by any application-specific code accessing + * the \ref rate_ctr.intv array directly. + * * \file rate_ctr.c */ #include @@ -140,7 +171,9 @@ osmo_timer_schedule(&rate_ctr_timer, 1, 0); } -/*! Initialize the counter module */ +/*! Initialize the counter module. Call this once from your application. + * \param[in] tall_ctx Talloc context from which rate_ctr_group will be allocated + * \returns 0 on success; negative on error */ int rate_ctr_init(void *tall_ctx) { tall_rate_ctr_ctx = tall_ctx; @@ -173,7 +206,7 @@ /*! Search for counter based on group + name * \param[in] ctrg pointer to \ref rate_ctr_group * \param[in] name name of counter inside group - * \returns \ref rate_ctr or NULL in caes of error + * \returns \ref rate_ctr or NULL in case of error */ const struct rate_ctr *rate_ctr_get_by_name(const struct rate_ctr_group *ctrg, const char *name) { -- To view, visit https://gerrit.osmocom.org/4283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If9abd46e1b0ebb6114522418fd3b45c1d802968a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:47 +0000 Subject: [PATCH] libosmocore[master]: [doc] bits.c: Better / more Doxygen documentation Message-ID: Review at https://gerrit.osmocom.org/4284 [doc] bits.c: Better / more Doxygen documentation Change-Id: If824a5c8d8ee6e3dc96a3fddeb105786c0c027c1 --- M include/osmocom/core/bits.h M src/bits.c 2 files changed, 17 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/4284/1 diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index c6a142f..b1b8040 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -1,9 +1,6 @@ /*! \file bits.h * Osmocom bit level support code. * - * NOTE on the endianess of pbit_t: - * Bits in a pbit_t are ordered MSB first, i.e. 0x80 is the first bit. - * Bit i in a pbit_t array is array[i/8] & (1<<(7-i%8)) */ #pragma once @@ -19,9 +16,18 @@ * @{ * \file bits.h */ -typedef int8_t sbit_t; /*!< soft bit (-127...127) */ -typedef uint8_t ubit_t; /*!< unpacked bit (0 or 1) */ -typedef uint8_t pbit_t; /*!< packed bis (8 bits in a byte) */ +/*! soft bit with value (-127...127), as commonly used in + * communications receivers such as [viterbi] decoders */ +typedef int8_t sbit_t; + +/*! unpacked bit (0 or 1): 1 bit per byte */ +typedef uint8_t ubit_t; + +/*! packed bits (8 bits in a byte). + * NOTE on the endian-ness of \ref pbit_t: + * - Bits in a \ref pbit_t are ordered MSB first, i.e. 0x80 is the first bit. + * - Bit i in a \ref pbit_t array is array[i/8] & (1<<(7-i%8)) */ +typedef uint8_t pbit_t; /*! determine how many bytes we would need for \a num_bits packed bits * \param[in] num_bits Number of packed bits @@ -95,16 +101,12 @@ OSMO_BR_WORD_SWAP = 16, }; -/*! generic bit reversal function */ uint32_t osmo_bit_reversal(uint32_t x, enum osmo_br_mode k); -/* reverse the bits within each byte of a 32bit word */ uint32_t osmo_revbytebits_32(uint32_t x); -/* reverse the bits within a byte */ uint32_t osmo_revbytebits_8(uint8_t x); -/* reverse the bits of each byte in a given buffer */ void osmo_revbytebits_buf(uint8_t *buf, int len); /*! left circular shift diff --git a/src/bits.c b/src/bits.c index af09441..fa917b0 100644 --- a/src/bits.c +++ b/src/bits.c @@ -28,6 +28,11 @@ * @{ * Osmocom bit level support code. * + * This module implements the notion of different bit-fields, such as + * - unpacked bits (\ref ubit_t), i.e. 1 bit per byte + * - packed bits (\ref pbit_t), i.e. 8 bits per byte + * - soft bits (\ref sbit_t), 1 bit per byte from -127 to 127 + * * \file bits.c */ /*! convert unpacked bits to packed bits, return length in bytes -- To view, visit https://gerrit.osmocom.org/4284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If824a5c8d8ee6e3dc96a3fddeb105786c0c027c1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:47 +0000 Subject: [PATCH] libosmocore[master]: [doc] Put CRC-16 and generic CRC code in one Doxygen module Message-ID: Review at https://gerrit.osmocom.org/4285 [doc] Put CRC-16 and generic CRC code in one Doxygen module .. and add missing API documentation bits Change-Id: I67119894bcbf8c779426a0272bae4c5ce1fbd1ed --- M include/osmocom/core/crc16.h M include/osmocom/core/crcXXgen.h.tpl M include/osmocom/core/crcgen.h M src/crc16.c M src/crcXXgen.c.tpl 5 files changed, 28 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/4285/1 diff --git a/include/osmocom/core/crc16.h b/include/osmocom/core/crc16.h index 52807af..f2e77e4 100644 --- a/include/osmocom/core/crc16.h +++ b/include/osmocom/core/crc16.h @@ -1,13 +1,16 @@ -/*! \file crc16.h - * This was copied from the linux kernel and adjusted for our types. +/*! \addtogroup crc + * @{ + * \file crc16.h + * This was copied from the linux kernel and adjusted for our types. */ + /* * crc16.h - CRC-16 routine * * Implements the standard CRC-16: - * Width 16 - * Poly 0x8005 (x^16 + x^15 + x^2 + 1) - * Init 0 + * - Width 16 + * - Poly 0x8005 (x^16 + x^15 + x^2 + 1) + * - Init 0 * * Copyright (c) 2005 Ben Gardner * @@ -25,19 +28,22 @@ extern uint16_t osmo_crc16(uint16_t crc, const uint8_t *buffer, size_t len); +/*! CRC-16 polynome 0x8005 (x^16 + x^15 + x^2 + 1) */ static inline uint16_t osmo_crc16_byte(uint16_t crc, const uint8_t data) { return (crc >> 8) ^ osmo_crc16_table[(crc ^ data) & 0xff]; } -/* CCITT polynome 0x8408. This corresponds to x^0 + x^5 + x^12 */ extern uint16_t const osmo_crc16_ccitt_table[256]; extern uint16_t osmo_crc16_ccitt(uint16_t crc, const uint8_t *buffer, size_t len); +/*! CCITT polynome 0x8408 (x^0 + x^5 + x^12) */ static inline uint16_t osmo_crc16_ccitt_byte(uint16_t crc, const uint8_t data) { return (crc >> 8) ^ osmo_crc16_ccitt_table[(crc ^ data) & 0xff]; } + +/*! @} */ diff --git a/include/osmocom/core/crcXXgen.h.tpl b/include/osmocom/core/crcXXgen.h.tpl index 2c909f9..823f21f 100644 --- a/include/osmocom/core/crcXXgen.h.tpl +++ b/include/osmocom/core/crcXXgen.h.tpl @@ -22,7 +22,7 @@ #pragma once -/*! \addtogroup crcgen +/*! \addtogroup crc * @{ * \file crcXXgen.h.tpl */ diff --git a/include/osmocom/core/crcgen.h b/include/osmocom/core/crcgen.h index d73e6e8..7cfe869 100644 --- a/include/osmocom/core/crcgen.h +++ b/include/osmocom/core/crcgen.h @@ -22,7 +22,7 @@ #pragma once -/*! \defgroup crcgen Osmocom generic CRC routines +/*! \defgroup crc Osmocom CRC routines * @{ * \file crcgen.h */ diff --git a/src/crc16.c b/src/crc16.c index b5cb956..c03c008 100644 --- a/src/crc16.c +++ b/src/crc16.c @@ -1,4 +1,6 @@ -/*! \file crc16.c +/*! \addtogroup crc + * @{ + * \file crc16.c * This was copied from the linux kernel and adjusted for our types. */ /* @@ -46,7 +48,7 @@ 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 }; -/*! compute the CRC-16 for the data buffer +/*! Compute 16bit CCITT polynome 0x8408 (x^0 + x^5 + x^12) over given buffer. * \param crc[in] previous CRC value * \param buffer[in] data pointer * \param len[in] number of bytes in input \ref buffer @@ -59,6 +61,7 @@ return crc; } +/*! CRC table for the CCITT CRC-6. The poly is 0x8408 (x^0 + x^5 + x^12) */ uint16_t const osmo_crc16_ccitt_table[256] = { 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, @@ -94,9 +97,17 @@ 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 }; + +/*! Compute 16bit CCITT polynome 0x8408 (x^0 + x^5 + x^12) over given buffer. + * \param[in] crc initial value of CRC + * \param[in] buffer pointer to buffer of input data + * \param[in] len length of \a buffer in bytes + * \returns 16bit CRC */ uint16_t osmo_crc16_ccitt(uint16_t crc, uint8_t const *buffer, size_t len) { while (len--) crc = osmo_crc16_ccitt_byte(crc, *buffer++); return crc; } + +/*! @} */ diff --git a/src/crcXXgen.c.tpl b/src/crcXXgen.c.tpl index e92a538..befba4d 100644 --- a/src/crcXXgen.c.tpl +++ b/src/crcXXgen.c.tpl @@ -20,7 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/*! \addtogroup crcgen +/*! \addtogroup crc * @{ * Osmocom generic CRC routines (for max XX bits poly). * -- To view, visit https://gerrit.osmocom.org/4285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67119894bcbf8c779426a0272bae4c5ce1fbd1ed Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:48 +0000 Subject: [PATCH] libosmocore[master]: [doc] Doxygen documentation on osmo_hexdump print buffer size Message-ID: Review at https://gerrit.osmocom.org/4286 [doc] Doxygen documentation on osmo_hexdump print buffer size Change-Id: I83ca2a3a555e5b3c1b7f23bf9e463a5063a8006c --- M src/utils.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/86/4286/1 diff --git a/src/utils.c b/src/utils.c index b4345c7..534916b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -235,6 +235,9 @@ * * This function will print a sequence of bytes as hexadecimal numbers, * adding one space character between each byte (e.g. "1a ef d9") + * + * The maximum size of the output buffer is 4096 bytes, i.e. the maximum + * number of input bytes that can be printed in one call is 1365! */ char *osmo_hexdump(const unsigned char *buf, int len) { @@ -248,6 +251,9 @@ * * This function will print a sequence of bytes as hexadecimal numbers, * without any space character between each byte (e.g. "1aefd9") + * + * The maximum size of the output buffer is 4096 bytes, i.e. the maximum + * number of input bytes that can be printed in one call is 2048! */ char *osmo_hexdump_nospc(const unsigned char *buf, int len) { -- To view, visit https://gerrit.osmocom.org/4286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83ca2a3a555e5b3c1b7f23bf9e463a5063a8006c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:48 +0000 Subject: [PATCH] libosmocore[master]: [doc] Make sure loggingrb.c file is in correct Doxygen group. Message-ID: Review at https://gerrit.osmocom.org/4287 [doc] Make sure loggingrb.c file is in correct Doxygen group. loggingrb.c, like loggingrb.h should be part of the loggingrb group! Change-Id: I4822a46631b45df1afda202c00038b6ad2c8b5ae --- M src/loggingrb.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/87/4287/1 diff --git a/src/loggingrb.c b/src/loggingrb.c index 5127a2f..b7d8d1f 100644 --- a/src/loggingrb.c +++ b/src/loggingrb.c @@ -20,7 +20,7 @@ * */ -/*! \addtogroup logging +/*! \addtogroup loggingrb * @{ * \file loggingrb.c */ -- To view, visit https://gerrit.osmocom.org/4287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4822a46631b45df1afda202c00038b6ad2c8b5ae Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:48 +0000 Subject: [PATCH] libosmocore[master]: [doc] Introductory text on what the logging ring buffer is a... Message-ID: Review at https://gerrit.osmocom.org/4288 [doc] Introductory text on what the logging ring buffer is about Change-Id: I876cd31e03a53ca90e658e353c0c8a839dece8ad --- M src/loggingrb.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/4288/1 diff --git a/src/loggingrb.c b/src/loggingrb.c index b7d8d1f..d3dd254 100644 --- a/src/loggingrb.c +++ b/src/loggingrb.c @@ -22,6 +22,13 @@ /*! \addtogroup loggingrb * @{ + * This adds a log which consist of an in-memory ring buffer. The idea + * is that the user can configure his logging in a way that critical + * messages get stored in the ring buffer, and that the last few + * critical messages can then always obtained by dumping the ring + * buffer. It can hence be used as a more generic version of the + * "show me the last N alarms" functionality. + * * \file loggingrb.c */ #include -- To view, visit https://gerrit.osmocom.org/4288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I876cd31e03a53ca90e658e353c0c8a839dece8ad Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:53:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 12:53:48 +0000 Subject: [PATCH] libosmocore[master]: [doc] Expand Doxuygen documentation for osmo_prim Message-ID: Review at https://gerrit.osmocom.org/4289 [doc] Expand Doxuygen documentation for osmo_prim Also, make sure prim.c is actually part of the 'prim' module. Change-Id: I4363e46a5f606eb2114a9cc1d2086007eaa58d31 --- M include/osmocom/core/prim.h M src/prim.c 2 files changed, 28 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/4289/1 diff --git a/include/osmocom/core/prim.h b/include/osmocom/core/prim.h index 88ae08b..99eabff 100644 --- a/include/osmocom/core/prim.h +++ b/include/osmocom/core/prim.h @@ -2,6 +2,18 @@ /*! \defgroup prim Osmocom primitives * @{ + * + * Osmocom Primitives are a method to express inter-layer primitives as + * used often in ITU/ETSI/3GPP specifications in a generic way. They + * are based on \ref msgb and encapsulate any (optional) user payload + * data with a primitive header. The header contains information on + * - which SAP this primitive is used on + * - what is the name of the primitive + * - is it REQUEST, RESPONSE, INDICATION or CONFIRMATION + * + * For more information on the inter-layer primitives concept, see + * ITU-T X.21@ as found at https://www.itu.int/rec/T-REC-X.212-199511-I/en + * * \file prim.h */ #include @@ -20,21 +32,28 @@ extern const struct value_string osmo_prim_op_names[5]; +/*!< The upper 8 byte of the technology, the lower 24 bits for the SAP */ #define _SAP_GSM_SHIFT 24 #define _SAP_GSM_BASE (0x01 << _SAP_GSM_SHIFT) #define _SAP_TETRA_BASE (0x02 << _SAP_GSM_SHIFT) #define _SAP_SS7_BASE (0x03 << _SAP_GSM_SHIFT) -/*! primitive header */ +/*! Osmocom primitive header */ struct osmo_prim_hdr { - unsigned int sap; /*!< Service Access Point */ + unsigned int sap; /*!< Service Access Point Identifier */ unsigned int primitive; /*!< Primitive number */ enum osmo_prim_operation operation; /*! Primitive Operation */ - struct msgb *msg; /*!< \ref msgb containing associated data */ + struct msgb *msg; /*!< \ref msgb containing associated data. + * Note this can be slightly confusing, as the \ref osmo_prim_hdr + * is stored inside a \ref msgb, but then it contains a pointer + * back to the msgb. This is to simplify development: You can + * pass around a \ref osmo_prim_hdr by itself, and any function + * can autonomously resolve the underlying msgb, if needed (e.g. + * for \ref msgb_free. */ }; -/*! initialize a primitive header +/*! Convenience function to initialize a primitive header * \param[in,out] oph primitive header * \param[in] sap Service Access Point * \param[in] primitive Primitive Number diff --git a/src/prim.c b/src/prim.c index 2035581..d18dbd7 100644 --- a/src/prim.c +++ b/src/prim.c @@ -1,4 +1,6 @@ -/*! \file prim.c */ +/*! \addtogroup prim + * @{ + * \file prim.c */ #include #include @@ -30,3 +32,5 @@ } return OSMO_NO_EVENT; } + +/*! @} */ -- To view, visit https://gerrit.osmocom.org/4289 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4363e46a5f606eb2114a9cc1d2086007eaa58d31 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:57:33 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 16 Oct 2017 12:57:33 +0000 Subject: osmo-mgw[master]: mgcp: move misplaced include In-Reply-To: References: Message-ID: Patch Set 5: > This appears to introduce a build failure when applied to current > master: > > mgcp_conn.c: In function 'mgcp_conn_alloc': > mgcp_conn.c:89:45: error: dereferencing pointer to incomplete type > if (llist_count(&endp->conns) >= endp->type->max_conns) > ^ Its now fixed, since mgcp_ep.h was removed from the include list in mgcp.h, it was missing in mgcp_conn.c. I have now added it there and it compiles again. -- To view, visit https://gerrit.osmocom.org/4238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 12:59:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 16 Oct 2017 12:59:26 +0000 Subject: libosmocore[master]: Rename 'statistics.c' to 'counter.c' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2cfb2310543902b7da46cb15a76e2da317eaed7d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:00:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 16 Oct 2017 13:00:09 +0000 Subject: osmo-mgw[master]: mgcp: move misplaced include In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:03:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Oct 2017 13:03:32 +0000 Subject: [PATCH] osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4256 to look at the new patch set (#3). ippool: Implement and use blacklist instead of blindly using IPPOOL_NOGATEWAY Commit dda21ed7d4a897c9284c69175d0da598598eae40 modified previous calls to ippool_new() removing the pass of flags to avoid allocating certain problematic IPs from the pool to MS, such as the network, gateway and broadcast IPs. Today I did some unsucessful tests with osmo-ggsn with a pool "ip prefix dynamic 176.16.222.0/24", and thus IP 176.16.222.0 was being assigned to the MS. De-capsulated DNS packets were received in the tun interface, but the Linux system in there was unable to correctly forward the packets to the gateway interface connected to the Internet. However, adding a second MS which got 176.16.222.1 had its packets forwarded correctly. However, previous implementation relies on flag IPPOOL_NOGATEWAY flag to blindly blacklist first IP after the network ip (ie, .0 and .1 are removed), which limits the IP reserved for the tun device to be .1. If a different IP in the range is assigned, it may cause issues. As a result, a blacklist is introduced in this commit to dynamically fetch the tun IP address and exlucde it from the pool of available IPs. Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 --- M ggsn/ggsn.c M lib/ippool.c M lib/ippool.h M tests/lib/ippool_test.c M tests/lib/ippool_test.err M tests/lib/ippool_test.ok 6 files changed, 331 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/56/4256/3 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c04d32e..3ba7517 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -149,7 +149,10 @@ /* actually start the APN with its current config */ int apn_start(struct apn_ctx *apn) { - struct in46_prefix ipv6_tun_linklocal_ip; + int ipv4_blacklist_size = 0, ipv6_blacklist_size = 0; + struct in46_prefix ipv4_tun_ip, ipv6_tun_ip, ipv6_tun_linklocal_ip; + int ippool_flags = IPPOOL_NONETWORK | IPPOOL_NOBROADCAST; + if (apn->started) return 0; @@ -231,8 +234,14 @@ if (apn->v4.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if (tun_ip_local_get(apn->tun.tun, &ipv4_tun_ip, IP_TYPE_IPv4) == 0) { + ipv4_blacklist_size = 1; + LOGPAPN(LOGL_INFO, apn, "Blacklist IPv4 tun IP %s\n", + in46p_ntoa(&ipv4_tun_ip)); + } if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, - &apn->v4.cfg.static_prefix, 0)) { + &apn->v4.cfg.static_prefix, ippool_flags, + &ipv4_tun_ip, ipv4_blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); apn_stop(apn, false); return -1; @@ -243,8 +252,14 @@ if (apn->v6.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if (tun_ip_local_get(apn->tun.tun, &ipv6_tun_ip, IP_TYPE_IPv6_GLOBAL) == 0) { + ipv6_blacklist_size = 1; + LOGPAPN(LOGL_INFO, apn, "Blacklist IPv6 tun IP %s\n", + in46p_ntoa(&ipv6_tun_ip)); + } if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, - &apn->v6.cfg.static_prefix, 0)) { + &apn->v6.cfg.static_prefix, ippool_flags, + &ipv6_tun_ip, ipv6_blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); apn_stop(apn, false); return -1; diff --git a/lib/ippool.c b/lib/ippool.c index 03323e2..55a41d0 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -184,9 +184,19 @@ } } +static bool addr_in_prefix_list(struct in46_addr *addr, struct in46_prefix *list, size_t list_size) +{ + int i; + for (i = 0; i < list_size; i++) { + if (in46a_prefix_equal(addr, &list[i].addr)) + return true; + } + return false; +} + /* Create new address pool */ int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, const struct in46_prefix *stat, - int flags) + int flags, struct in46_prefix *blacklist, size_t blacklist_size) { /* Parse only first instance of pool for now */ @@ -210,18 +220,16 @@ if (addr.len == sizeof(struct in6_addr)) addr.len = 64/8; - /* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */ - if (flags & IPPOOL_NOGATEWAY) { - flags |= IPPOOL_NONETWORK; - } - dynsize = (1 << (addr.len*8 - addrprefixlen)); if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; - if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ - dynsize--; if (flags & IPPOOL_NOBROADCAST) /* Exclude broadcast address from pool */ dynsize--; + /* Exclude included blacklist addresses from pool */ + for (i = 0; i < blacklist_size; i++) { + if (in46a_within_mask(&blacklist[i].addr, &addr, addrprefixlen)) + dynsize--; + } } if (!stat || stat->addr.len == 0) { @@ -278,13 +286,17 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; - if (flags & IPPOOL_NOGATEWAY) { - in46a_inc(&addr); - in46a_inc(&addr); - } else if (flags & IPPOOL_NONETWORK) { + if (flags & IPPOOL_NONETWORK) { in46a_inc(&addr); } for (i = 0; i < dynsize; i++) { + if (addr_in_prefix_list(&addr, blacklist, blacklist_size)) { + SYS_ERR(DIP, LOGL_DEBUG, 0, + "addr blacklisted from pool: %s", in46a_ntoa(&addr)); + in46a_inc(&addr); + i--; + continue; + } (*this)->member[i].addr = addr; in46a_inc(&addr); diff --git a/lib/ippool.h b/lib/ippool.h index 56beb4e..efb274b 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -31,7 +31,6 @@ #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 -#define IPPOOL_NOGATEWAY 0x04 #define IPPOOL_STATSIZE 0x10000 @@ -72,7 +71,8 @@ /* Create new address pool */ extern int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, - const struct in46_prefix *stat, int flags); + const struct in46_prefix *stat, int flags, + struct in46_prefix *blacklist, size_t blacklist_size); /* Delete existing address pool */ extern int ippool_free(struct ippool_t *this); diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index f38c1be..ea56edd 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -13,36 +13,47 @@ #include "../../lib/syserr.h" -static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags) +static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags, char **blacklist, size_t blacklist_size) { + struct in46_prefix *blacklist_pfx; struct ippool_t *pool; struct in46_prefix pfx; size_t t; int rc; + int i; + + blacklist_pfx = calloc(blacklist_size, sizeof(struct in46_prefix)); + for (i = 0; i < blacklist_size; i++) { + rc = ippool_aton(&blacklist_pfx[i].addr, &t, blacklist[i], 0); + OSMO_ASSERT(rc == 0); + pfx.prefixlen = t; + } /* dynamic-only v4 */ - rc = ippool_aton(&pfx.addr, &t, prefix_str, flags); + rc = ippool_aton(&pfx.addr, &t, prefix_str, 0); OSMO_ASSERT(rc == 0); pfx.prefixlen = t; - rc = ippool_new(&pool, &pfx, NULL, flags); + rc = ippool_new(&pool, &pfx, NULL, flags, blacklist_pfx, blacklist_size); OSMO_ASSERT(rc == 0); //ippool_printaddr(pool); + free(blacklist_pfx); + return pool; } -static void test_pool_size(const char *pfx, unsigned int flags, unsigned int expected_size) +static void test_pool_size(const char *pfx, unsigned int flags, char **blacklist, size_t blacklist_size, unsigned int expected_size) { struct ippool_t *pool; struct ippoolm_t *member; struct in46_addr addr; int i, rc, n; - printf("testing pool for prefix %s, flags=0x%x, expected_size=%u\n", pfx, flags, expected_size); - pool = create_pool(pfx, flags); + printf("testing pool for prefix %s, flags=0x%x, blacklist_size=%lu, expected_size=%u\n", pfx, flags, blacklist_size, expected_size); + pool = create_pool(pfx, flags, blacklist, blacklist_size); OSMO_ASSERT(pool->listsize == expected_size); memset(&addr, 0, sizeof(addr)); @@ -91,19 +102,23 @@ static void test_pool_sizes(void) { /* 256 addresses [0..255] */ - test_pool_size("192.168.23.0/24", 0, 256); + test_pool_size("192.168.23.0/24", 0, NULL, 0, 256); /* 255 addresses [1..255] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, 255); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, NULL, 0, 255); /* 254 addresses [1..254] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 254); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 254); /* 65534 addresses [0.1..255.254] */ - test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 65534); + test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 65534); /* 256 prefixes of /64 each */ - test_pool_size("2001:DB8::/56", 0, 256); + test_pool_size("2001:DB8::/56", 0, NULL, 0, 256); + + /* 253 addresses [1..254] & exclude 192.168.23.1/24 */ + char *blacklist[] = {"176.16.222.10/24", "192.168.23.1/24", "192.168.38.2/24"}; + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, blacklist, 3, 253); } int main(int argc, char **argv) diff --git a/tests/lib/ippool_test.err b/tests/lib/ippool_test.err index 7dc5371..b11c12a 100644 --- a/tests/lib/ippool_test.err +++ b/tests/lib/ippool_test.err @@ -8,3 +8,5 @@ No more IP addresses available No more IP addresses available No more IP addresses available +No more IP addresses available +No more IP addresses available diff --git a/tests/lib/ippool_test.ok b/tests/lib/ippool_test.ok index a0eeb4b..263494e 100644 --- a/tests/lib/ippool_test.ok +++ b/tests/lib/ippool_test.ok @@ -1,4 +1,4 @@ -testing pool for prefix 192.168.23.0/24, flags=0x0, expected_size=256 +testing pool for prefix 192.168.23.0/24, flags=0x0, blacklist_size=0, expected_size=256 allocated address 192.168.23.0 allocated address 192.168.23.1 allocated address 192.168.23.2 @@ -255,7 +255,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x1, expected_size=255 +testing pool for prefix 192.168.23.0/24, flags=0x1, blacklist_size=0, expected_size=255 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -511,7 +511,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x3, expected_size=254 +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=0, expected_size=254 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -766,7 +766,7 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.0.0/16, flags=0x3, expected_size=65534 +testing pool for prefix 192.168.0.0/16, flags=0x3, blacklist_size=0, expected_size=65534 allocated address 192.168.0.1 allocated address 192.168.0.2 allocated address 192.168.0.3 @@ -66301,7 +66301,7 @@ allocated address 192.168.255.252 allocated address 192.168.255.253 allocated address 192.168.255.254 -testing pool for prefix 2001:DB8::/56, flags=0x0, expected_size=256 +testing pool for prefix 2001:DB8::/56, flags=0x0, blacklist_size=0, expected_size=256 allocated address 2001:db8:: allocated address 2001:db8:0:1:: allocated address 2001:db8:0:2:: @@ -66558,3 +66558,257 @@ allocated address 2001:db8:0:fd:: allocated address 2001:db8:0:fe:: allocated address 2001:db8:0:ff:: +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=3, expected_size=253 +allocated address 192.168.23.2 +allocated address 192.168.23.3 +allocated address 192.168.23.4 +allocated address 192.168.23.5 +allocated address 192.168.23.6 +allocated address 192.168.23.7 +allocated address 192.168.23.8 +allocated address 192.168.23.9 +allocated address 192.168.23.10 +allocated address 192.168.23.11 +allocated address 192.168.23.12 +allocated address 192.168.23.13 +allocated address 192.168.23.14 +allocated address 192.168.23.15 +allocated address 192.168.23.16 +allocated address 192.168.23.17 +allocated address 192.168.23.18 +allocated address 192.168.23.19 +allocated address 192.168.23.20 +allocated address 192.168.23.21 +allocated address 192.168.23.22 +allocated address 192.168.23.23 +allocated address 192.168.23.24 +allocated address 192.168.23.25 +allocated address 192.168.23.26 +allocated address 192.168.23.27 +allocated address 192.168.23.28 +allocated address 192.168.23.29 +allocated address 192.168.23.30 +allocated address 192.168.23.31 +allocated address 192.168.23.32 +allocated address 192.168.23.33 +allocated address 192.168.23.34 +allocated address 192.168.23.35 +allocated address 192.168.23.36 +allocated address 192.168.23.37 +allocated address 192.168.23.38 +allocated address 192.168.23.39 +allocated address 192.168.23.40 +allocated address 192.168.23.41 +allocated address 192.168.23.42 +allocated address 192.168.23.43 +allocated address 192.168.23.44 +allocated address 192.168.23.45 +allocated address 192.168.23.46 +allocated address 192.168.23.47 +allocated address 192.168.23.48 +allocated address 192.168.23.49 +allocated address 192.168.23.50 +allocated address 192.168.23.51 +allocated address 192.168.23.52 +allocated address 192.168.23.53 +allocated address 192.168.23.54 +allocated address 192.168.23.55 +allocated address 192.168.23.56 +allocated address 192.168.23.57 +allocated address 192.168.23.58 +allocated address 192.168.23.59 +allocated address 192.168.23.60 +allocated address 192.168.23.61 +allocated address 192.168.23.62 +allocated address 192.168.23.63 +allocated address 192.168.23.64 +allocated address 192.168.23.65 +allocated address 192.168.23.66 +allocated address 192.168.23.67 +allocated address 192.168.23.68 +allocated address 192.168.23.69 +allocated address 192.168.23.70 +allocated address 192.168.23.71 +allocated address 192.168.23.72 +allocated address 192.168.23.73 +allocated address 192.168.23.74 +allocated address 192.168.23.75 +allocated address 192.168.23.76 +allocated address 192.168.23.77 +allocated address 192.168.23.78 +allocated address 192.168.23.79 +allocated address 192.168.23.80 +allocated address 192.168.23.81 +allocated address 192.168.23.82 +allocated address 192.168.23.83 +allocated address 192.168.23.84 +allocated address 192.168.23.85 +allocated address 192.168.23.86 +allocated address 192.168.23.87 +allocated address 192.168.23.88 +allocated address 192.168.23.89 +allocated address 192.168.23.90 +allocated address 192.168.23.91 +allocated address 192.168.23.92 +allocated address 192.168.23.93 +allocated address 192.168.23.94 +allocated address 192.168.23.95 +allocated address 192.168.23.96 +allocated address 192.168.23.97 +allocated address 192.168.23.98 +allocated address 192.168.23.99 +allocated address 192.168.23.100 +allocated address 192.168.23.101 +allocated address 192.168.23.102 +allocated address 192.168.23.103 +allocated address 192.168.23.104 +allocated address 192.168.23.105 +allocated address 192.168.23.106 +allocated address 192.168.23.107 +allocated address 192.168.23.108 +allocated address 192.168.23.109 +allocated address 192.168.23.110 +allocated address 192.168.23.111 +allocated address 192.168.23.112 +allocated address 192.168.23.113 +allocated address 192.168.23.114 +allocated address 192.168.23.115 +allocated address 192.168.23.116 +allocated address 192.168.23.117 +allocated address 192.168.23.118 +allocated address 192.168.23.119 +allocated address 192.168.23.120 +allocated address 192.168.23.121 +allocated address 192.168.23.122 +allocated address 192.168.23.123 +allocated address 192.168.23.124 +allocated address 192.168.23.125 +allocated address 192.168.23.126 +allocated address 192.168.23.127 +allocated address 192.168.23.128 +allocated address 192.168.23.129 +allocated address 192.168.23.130 +allocated address 192.168.23.131 +allocated address 192.168.23.132 +allocated address 192.168.23.133 +allocated address 192.168.23.134 +allocated address 192.168.23.135 +allocated address 192.168.23.136 +allocated address 192.168.23.137 +allocated address 192.168.23.138 +allocated address 192.168.23.139 +allocated address 192.168.23.140 +allocated address 192.168.23.141 +allocated address 192.168.23.142 +allocated address 192.168.23.143 +allocated address 192.168.23.144 +allocated address 192.168.23.145 +allocated address 192.168.23.146 +allocated address 192.168.23.147 +allocated address 192.168.23.148 +allocated address 192.168.23.149 +allocated address 192.168.23.150 +allocated address 192.168.23.151 +allocated address 192.168.23.152 +allocated address 192.168.23.153 +allocated address 192.168.23.154 +allocated address 192.168.23.155 +allocated address 192.168.23.156 +allocated address 192.168.23.157 +allocated address 192.168.23.158 +allocated address 192.168.23.159 +allocated address 192.168.23.160 +allocated address 192.168.23.161 +allocated address 192.168.23.162 +allocated address 192.168.23.163 +allocated address 192.168.23.164 +allocated address 192.168.23.165 +allocated address 192.168.23.166 +allocated address 192.168.23.167 +allocated address 192.168.23.168 +allocated address 192.168.23.169 +allocated address 192.168.23.170 +allocated address 192.168.23.171 +allocated address 192.168.23.172 +allocated address 192.168.23.173 +allocated address 192.168.23.174 +allocated address 192.168.23.175 +allocated address 192.168.23.176 +allocated address 192.168.23.177 +allocated address 192.168.23.178 +allocated address 192.168.23.179 +allocated address 192.168.23.180 +allocated address 192.168.23.181 +allocated address 192.168.23.182 +allocated address 192.168.23.183 +allocated address 192.168.23.184 +allocated address 192.168.23.185 +allocated address 192.168.23.186 +allocated address 192.168.23.187 +allocated address 192.168.23.188 +allocated address 192.168.23.189 +allocated address 192.168.23.190 +allocated address 192.168.23.191 +allocated address 192.168.23.192 +allocated address 192.168.23.193 +allocated address 192.168.23.194 +allocated address 192.168.23.195 +allocated address 192.168.23.196 +allocated address 192.168.23.197 +allocated address 192.168.23.198 +allocated address 192.168.23.199 +allocated address 192.168.23.200 +allocated address 192.168.23.201 +allocated address 192.168.23.202 +allocated address 192.168.23.203 +allocated address 192.168.23.204 +allocated address 192.168.23.205 +allocated address 192.168.23.206 +allocated address 192.168.23.207 +allocated address 192.168.23.208 +allocated address 192.168.23.209 +allocated address 192.168.23.210 +allocated address 192.168.23.211 +allocated address 192.168.23.212 +allocated address 192.168.23.213 +allocated address 192.168.23.214 +allocated address 192.168.23.215 +allocated address 192.168.23.216 +allocated address 192.168.23.217 +allocated address 192.168.23.218 +allocated address 192.168.23.219 +allocated address 192.168.23.220 +allocated address 192.168.23.221 +allocated address 192.168.23.222 +allocated address 192.168.23.223 +allocated address 192.168.23.224 +allocated address 192.168.23.225 +allocated address 192.168.23.226 +allocated address 192.168.23.227 +allocated address 192.168.23.228 +allocated address 192.168.23.229 +allocated address 192.168.23.230 +allocated address 192.168.23.231 +allocated address 192.168.23.232 +allocated address 192.168.23.233 +allocated address 192.168.23.234 +allocated address 192.168.23.235 +allocated address 192.168.23.236 +allocated address 192.168.23.237 +allocated address 192.168.23.238 +allocated address 192.168.23.239 +allocated address 192.168.23.240 +allocated address 192.168.23.241 +allocated address 192.168.23.242 +allocated address 192.168.23.243 +allocated address 192.168.23.244 +allocated address 192.168.23.245 +allocated address 192.168.23.246 +allocated address 192.168.23.247 +allocated address 192.168.23.248 +allocated address 192.168.23.249 +allocated address 192.168.23.250 +allocated address 192.168.23.251 +allocated address 192.168.23.252 +allocated address 192.168.23.253 +allocated address 192.168.23.254 -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:03:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Oct 2017 13:03:32 +0000 Subject: [PATCH] osmo-ggsn[master]: lib/in46a: Introduce in46a_netmasklen API Message-ID: Review at https://gerrit.osmocom.org/4290 lib/in46a: Introduce in46a_netmasklen API Change-Id: I06e3e038afd8f7afaec2a3fa67b1616500c8db80 --- M lib/in46_addr.c M lib/in46_addr.h M tests/lib/in46a_test.c M tests/lib/in46a_test.ok 4 files changed, 120 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/90/4290/1 diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 32e0f8d..7b9f0cb 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -195,6 +195,64 @@ } } +static unsigned int ipv4_netmasklen(const struct in_addr *netmask) +{ + uint32_t bits = netmask->s_addr; + uint8_t *b = (uint8_t*) &bits; + unsigned int i, prefix = 0; + + for (i = 0; i < 4; i++) { + while(b[i] & 0x80) { + prefix++; + b[i] = b[i] << 1; + } + } + return prefix; +} + +static unsigned int ipv6_netmasklen(const struct in6_addr *netmask) +{ + #if defined(__linux__) + #define ADDRFIELD(i) s6_addr32[i] + #else + #define ADDRFIELD(i) __u6_addr.__u6_addr32[i] + #endif + + unsigned int i, j, prefix = 0; + + for (j = 0; j < 4; j++) { + uint32_t bits = netmask->ADDRFIELD(j); + uint8_t *b = (uint8_t*) &bits; + for (i = 0; i < 4; i++) { + while(b[i] & 0x80) { + prefix++; + b[i] = b[i] << 1; + } + } + } + + #undef ADDRFIELD + + return prefix; +} + +/*! Convert netmask to prefix length representation + * \param[in] in46_addr containing a netmask (consecutive list of 1-bit followed by consecutive list of 0-bit) + * \returns prefix length representation of the netmask (count of 1-bit from the start of the netmask) + */ +unsigned int in46a_netmasklen(const struct in46_addr *netmask) +{ + switch (netmask->len) { + case 4: + return ipv4_netmasklen(&netmask->v4); + case 16: + return ipv6_netmasklen(&netmask->v6); + default: + OSMO_ASSERT(0); + return 0; + } +} + /*! Convert given PDP End User Address to in46_addr * \returns 0 on success; negative on error */ int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua) diff --git a/lib/in46_addr.h b/lib/in46_addr.h index ce2df14..ff26521 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -27,6 +27,7 @@ extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); +unsigned int in46a_netmasklen(const struct in46_addr *netmask); int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua); int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst); diff --git a/tests/lib/in46a_test.c b/tests/lib/in46a_test.c index d6215e7..42a1768 100644 --- a/tests/lib/in46a_test.c +++ b/tests/lib/in46a_test.c @@ -246,6 +246,64 @@ OSMO_ASSERT(!memcmp(&ia.v6, v6_spec+2, ia.len)); } +static void test_in46a_netmasklen(void) +{ + struct in46_addr netmask; + unsigned int len; + + printf("Testing in46a_netmasklen() with IPv4 addresses\n"); + netmask.len = 4; + + netmask.v4.s_addr = 0xffffffff; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 32); + + netmask.v4.s_addr = 0x00ffffff; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 24); + + netmask.v4.s_addr = 0x00f0ffff; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 20); + + netmask.v4.s_addr = 0x000000fe; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 7); + + netmask.v4.s_addr = 0x00000000; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 0); + + printf("Testing in46a_netmasklen() with IPv6 addresses\n"); + const struct in46_addr netmaskA = { + .len = 16, + .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}, + }; + len = in46a_netmasklen(&netmaskA); + OSMO_ASSERT(len == 128); + + const struct in46_addr netmaskB = { + .len = 16, + .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00}, + }; + len = in46a_netmasklen(&netmaskB); + OSMO_ASSERT(len == 104); + + const struct in46_addr netmaskC = { + .len = 16, + .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00}, + }; + len = in46a_netmasklen(&netmaskC); + OSMO_ASSERT(len == 103); + + const struct in46_addr netmaskD = { + .len = 16, + .v6.s6_addr = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + }; + len = in46a_netmasklen(&netmaskD); + OSMO_ASSERT(len == 0); +} + int main(int argc, char **argv) { osmo_init_logging(&log_info); @@ -262,4 +320,5 @@ test_in46a_within_mask(); test_in46a_to_eua(); test_in46a_from_eua(); + test_in46a_netmasklen(); } diff --git a/tests/lib/in46a_test.ok b/tests/lib/in46a_test.ok index b115444..9a0ff7a 100644 --- a/tests/lib/in46a_test.ok +++ b/tests/lib/in46a_test.ok @@ -15,3 +15,5 @@ in46a_within_mask(10.11.12.14, 10.11.12.12, 30) = 1 testing in46a_to_eua() Testing in46a_from_eua() +Testing in46a_netmasklen() with IPv4 addresses +Testing in46a_netmasklen() with IPv6 addresses -- To view, visit https://gerrit.osmocom.org/4290 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06e3e038afd8f7afaec2a3fa67b1616500c8db80 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:03:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Oct 2017 13:03:32 +0000 Subject: [PATCH] osmo-ggsn[master]: tun: Convert tun_ipv6_linklocal_get to be more generic Message-ID: Review at https://gerrit.osmocom.org/4291 tun: Convert tun_ipv6_linklocal_get to be more generic Add support for IPv4 and IPv6 global IPs. Also return the prefix length of the IP address by using a in46_prefix. Change-Id: I277af191dc611b6bbcb83479f4ae338083740322 --- M ggsn/ggsn.c M lib/tun.c M lib/tun.h 3 files changed, 55 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/91/4291/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 29d8473..c04d32e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -149,6 +149,7 @@ /* actually start the APN with its current config */ int apn_start(struct apn_ctx *apn) { + struct in46_prefix ipv6_tun_linklocal_ip; if (apn->started) return 0; @@ -201,12 +202,13 @@ } if (apn->cfg.apn_type_mask & (APN_TYPE_IPv6|APN_TYPE_IPv4v6)) { - if (tun_ipv6_linklocal_get(apn->tun.tun, &apn->v6_lladdr) < 0) { + if (tun_ip_local_get(apn->tun.tun, &ipv6_tun_linklocal_ip, IP_TYPE_IPv6_LINK) < 0) { LOGPAPN(LOGL_ERROR, apn, "Cannot obtain IPv6 link-local address of " "interface: %s\n", strerror(errno)); apn_stop(apn, false); return -1; } + apn->v6_lladdr = ipv6_tun_linklocal_ip.addr.v6; } /* set back-pointer from TUN device to APN */ diff --git a/lib/tun.c b/lib/tun.c index 7662146..e8b55db 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -751,34 +751,63 @@ #include -/* obtain the link-local address of the tun device */ -int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia) +/*! Obtain the local address of the tun device. + * \param[in] tun Target device owning the IP + * \param[out] prefix Structure to fill with an IPv4/6 and prefix length + * \param[in] flags Specify which kind of IP to look for: IP_TYPE_IPv4, IP_TYPE_IPv6_LINK, IP_TYPE_IPv6_GLOBAL + * \returns 0 if the IP was found and prefix structure was filled successfully, -1 othwerise + */ +int tun_ip_local_get(const struct tun_t *tun, struct in46_prefix *prefix, int flags) { - struct ifaddrs *ifaddr, *ifa; static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; + struct ifaddrs *ifaddr, *ifa; + struct in46_addr netmask; + bool is_ipv6_ll; if (getifaddrs(&ifaddr) == -1) { return -1; } for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; if (ifa->ifa_addr == NULL) - continue; - - if (ifa->ifa_addr->sa_family != AF_INET6) continue; if (strcmp(ifa->ifa_name, tun->devname)) continue; - if (memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix))) - continue; + if (ifa->ifa_addr->sa_family == AF_INET && (flags & IP_TYPE_IPv4)) { + struct sockaddr_in *sin4 = (struct sockaddr_in *) ifa->ifa_addr; + struct sockaddr_in *netmask4 = (struct sockaddr_in *) ifa->ifa_netmask; - *ia = sin6->sin6_addr; - freeifaddrs(ifaddr); - return 0; + netmask.len = sizeof(netmask4->sin_addr); + netmask.v4 = netmask4->sin_addr; + prefix->addr.len = sizeof(sin4->sin_addr); + prefix->addr.v4 = sin4->sin_addr; + prefix->prefixlen = in46a_netmasklen(&netmask); + freeifaddrs(ifaddr); + return 0; + } + + if (ifa->ifa_addr->sa_family == AF_INET6 && (flags & IP_TYPE_IPv6)) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; + struct sockaddr_in6 *netmask6 = (struct sockaddr_in6 *) ifa->ifa_netmask; + + is_ipv6_ll = !memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix)); + if ((flags & IP_TYPE_IPv6_GLOBAL) && is_ipv6_ll) + continue; + if ((flags & IP_TYPE_IPv6_LINK) && !is_ipv6_ll) + continue; + + netmask.len = sizeof(netmask6->sin6_addr); + netmask.v6 = netmask6->sin6_addr; + prefix->addr.len = sizeof(sin6->sin6_addr); + prefix->addr.v6 = sin6->sin6_addr; + prefix->prefixlen = in46a_netmasklen(&netmask); + freeifaddrs(ifaddr); + return 0; + } } + freeifaddrs(ifaddr); return -1; } diff --git a/lib/tun.h b/lib/tun.h index f63be50..c50f907 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -23,6 +23,16 @@ #define TUN_NLBUFSIZE 1024 #include "config.h" + +/* ipv6 ip type flags for tun_ipv6_local_get() */ +enum { + IP_TYPE_IPv4 = 1, + IP_TYPE_IPv6_LINK = 2, + IP_TYPE_IPv6_GLOBAL = 4, +}; +#define IP_TYPE_IPv6 (IP_TYPE_IPv6_LINK | IP_TYPE_IPv6_GLOBAL) + + #ifndef HAVE_IPHDR struct iphdr { @@ -85,6 +95,6 @@ extern int tun_runscript(struct tun_t *tun, char *script); -int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia); +int tun_ip_local_get(const struct tun_t *tun, struct in46_prefix *prefix, int flags); #endif /* !_TUN_H */ -- To view, visit https://gerrit.osmocom.org/4291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I277af191dc611b6bbcb83479f4ae338083740322 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:15:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 16 Oct 2017 13:15:53 +0000 Subject: osmo-mgw[master]: mgcp: move misplaced include In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:15:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 16 Oct 2017 13:15:57 +0000 Subject: [MERGED] osmo-mgw[master]: mgcp: move misplaced include In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: mgcp: move misplaced include ...................................................................... mgcp: move misplaced include mgcp.h includes mgcp_ep.h but does not use anything from it. This does not hurt the mgcp code internally, but when mgcp.h is included by an application compilation fails because mgcp_ep.h is not installed. remove mgcp_ep.h from include list in mgcp.h add mgcp_ep.h to include list in mgcp_conn.c where it is needed. Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 --- M include/osmocom/mgcp/mgcp.h M src/libosmo-mgcp/mgcp_conn.c 2 files changed, 1 insertion(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 07d9516..7307f3c 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -26,7 +26,6 @@ #include #include #include -#include #include diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index 0da62bc..e0eec63 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -24,6 +24,7 @@ #include #include #include +#include /* Reset codec state and free memory */ static void mgcp_rtp_codec_reset(struct mgcp_rtp_codec *codec) -- To view, visit https://gerrit.osmocom.org/4238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib58a8ed64f729055282c2b9673f7684cdfdb5936 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:17:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 16 Oct 2017 13:17:08 +0000 Subject: osmo-mgw[master]: mgcp: move port/timeslot calculator to separate header In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 my earlier comments still apply. -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:18:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:18:42 +0000 Subject: libosmocore[master]: Rename 'statistics.c' to 'counter.c' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2cfb2310543902b7da46cb15a76e2da317eaed7d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:18:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:18:44 +0000 Subject: libosmocore[master]: [doc] stat_item: Complete doxygen documentation for API In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib514c137b40bf7b9791bd74be99af0b65575f2b6 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:18:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:18:47 +0000 Subject: libosmocore[master]: [doc] counter.[ch] Add Doxygen API documentation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24283c05620ee86a8beb165af98a85d754549efb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:18:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:18:48 +0000 Subject: libosmocore[master]: [doc] Add Doxygen API documentation for stats.c and stats_st... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e49505f5c19beac90290fdba8821714e8eecd97 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:18:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:18:51 +0000 Subject: libosmocore[master]: [doc] src/logging.c: Fix Doxygen syntax to make logging.c sh... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56718e1eca1739a1b0a790f2f3a1b554899a93ab Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:18:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:18:52 +0000 Subject: libosmocore[master]: [doc] rate_ctr: Extend Doxygen API documentation with human-... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9abd46e1b0ebb6114522418fd3b45c1d802968a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:18:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:18:55 +0000 Subject: libosmocore[master]: [doc] bits.c: Better / more Doxygen documentation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If824a5c8d8ee6e3dc96a3fddeb105786c0c027c1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:18:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:18:57 +0000 Subject: libosmocore[master]: [doc] Put CRC-16 and generic CRC code in one Doxygen module In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I67119894bcbf8c779426a0272bae4c5ce1fbd1ed Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:18:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:18:59 +0000 Subject: libosmocore[master]: [doc] Doxygen documentation on osmo_hexdump print buffer size In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I83ca2a3a555e5b3c1b7f23bf9e463a5063a8006c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:01 +0000 Subject: libosmocore[master]: [doc] Make sure loggingrb.c file is in correct Doxygen group. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4822a46631b45df1afda202c00038b6ad2c8b5ae Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:09 +0000 Subject: [MERGED] libosmocore[master]: [doc] Make sure loggingrb.c file is in correct Doxygen group. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Make sure loggingrb.c file is in correct Doxygen group. ...................................................................... [doc] Make sure loggingrb.c file is in correct Doxygen group. loggingrb.c, like loggingrb.h should be part of the loggingrb group! Change-Id: I4822a46631b45df1afda202c00038b6ad2c8b5ae --- M src/loggingrb.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/loggingrb.c b/src/loggingrb.c index 5127a2f..b7d8d1f 100644 --- a/src/loggingrb.c +++ b/src/loggingrb.c @@ -20,7 +20,7 @@ * */ -/*! \addtogroup logging +/*! \addtogroup loggingrb * @{ * \file loggingrb.c */ -- To view, visit https://gerrit.osmocom.org/4287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4822a46631b45df1afda202c00038b6ad2c8b5ae Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:10 +0000 Subject: [MERGED] libosmocore[master]: [doc] Doxygen documentation on osmo_hexdump print buffer size In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Doxygen documentation on osmo_hexdump print buffer size ...................................................................... [doc] Doxygen documentation on osmo_hexdump print buffer size Change-Id: I83ca2a3a555e5b3c1b7f23bf9e463a5063a8006c --- M src/utils.c 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/utils.c b/src/utils.c index b4345c7..534916b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -235,6 +235,9 @@ * * This function will print a sequence of bytes as hexadecimal numbers, * adding one space character between each byte (e.g. "1a ef d9") + * + * The maximum size of the output buffer is 4096 bytes, i.e. the maximum + * number of input bytes that can be printed in one call is 1365! */ char *osmo_hexdump(const unsigned char *buf, int len) { @@ -248,6 +251,9 @@ * * This function will print a sequence of bytes as hexadecimal numbers, * without any space character between each byte (e.g. "1aefd9") + * + * The maximum size of the output buffer is 4096 bytes, i.e. the maximum + * number of input bytes that can be printed in one call is 2048! */ char *osmo_hexdump_nospc(const unsigned char *buf, int len) { -- To view, visit https://gerrit.osmocom.org/4286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I83ca2a3a555e5b3c1b7f23bf9e463a5063a8006c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:10 +0000 Subject: [MERGED] libosmocore[master]: [doc] Put CRC-16 and generic CRC code in one Doxygen module In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Put CRC-16 and generic CRC code in one Doxygen module ...................................................................... [doc] Put CRC-16 and generic CRC code in one Doxygen module .. and add missing API documentation bits Change-Id: I67119894bcbf8c779426a0272bae4c5ce1fbd1ed --- M include/osmocom/core/crc16.h M include/osmocom/core/crcXXgen.h.tpl M include/osmocom/core/crcgen.h M src/crc16.c M src/crcXXgen.c.tpl 5 files changed, 28 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/crc16.h b/include/osmocom/core/crc16.h index 52807af..f2e77e4 100644 --- a/include/osmocom/core/crc16.h +++ b/include/osmocom/core/crc16.h @@ -1,13 +1,16 @@ -/*! \file crc16.h - * This was copied from the linux kernel and adjusted for our types. +/*! \addtogroup crc + * @{ + * \file crc16.h + * This was copied from the linux kernel and adjusted for our types. */ + /* * crc16.h - CRC-16 routine * * Implements the standard CRC-16: - * Width 16 - * Poly 0x8005 (x^16 + x^15 + x^2 + 1) - * Init 0 + * - Width 16 + * - Poly 0x8005 (x^16 + x^15 + x^2 + 1) + * - Init 0 * * Copyright (c) 2005 Ben Gardner * @@ -25,19 +28,22 @@ extern uint16_t osmo_crc16(uint16_t crc, const uint8_t *buffer, size_t len); +/*! CRC-16 polynome 0x8005 (x^16 + x^15 + x^2 + 1) */ static inline uint16_t osmo_crc16_byte(uint16_t crc, const uint8_t data) { return (crc >> 8) ^ osmo_crc16_table[(crc ^ data) & 0xff]; } -/* CCITT polynome 0x8408. This corresponds to x^0 + x^5 + x^12 */ extern uint16_t const osmo_crc16_ccitt_table[256]; extern uint16_t osmo_crc16_ccitt(uint16_t crc, const uint8_t *buffer, size_t len); +/*! CCITT polynome 0x8408 (x^0 + x^5 + x^12) */ static inline uint16_t osmo_crc16_ccitt_byte(uint16_t crc, const uint8_t data) { return (crc >> 8) ^ osmo_crc16_ccitt_table[(crc ^ data) & 0xff]; } + +/*! @} */ diff --git a/include/osmocom/core/crcXXgen.h.tpl b/include/osmocom/core/crcXXgen.h.tpl index 2c909f9..823f21f 100644 --- a/include/osmocom/core/crcXXgen.h.tpl +++ b/include/osmocom/core/crcXXgen.h.tpl @@ -22,7 +22,7 @@ #pragma once -/*! \addtogroup crcgen +/*! \addtogroup crc * @{ * \file crcXXgen.h.tpl */ diff --git a/include/osmocom/core/crcgen.h b/include/osmocom/core/crcgen.h index d73e6e8..7cfe869 100644 --- a/include/osmocom/core/crcgen.h +++ b/include/osmocom/core/crcgen.h @@ -22,7 +22,7 @@ #pragma once -/*! \defgroup crcgen Osmocom generic CRC routines +/*! \defgroup crc Osmocom CRC routines * @{ * \file crcgen.h */ diff --git a/src/crc16.c b/src/crc16.c index b5cb956..c03c008 100644 --- a/src/crc16.c +++ b/src/crc16.c @@ -1,4 +1,6 @@ -/*! \file crc16.c +/*! \addtogroup crc + * @{ + * \file crc16.c * This was copied from the linux kernel and adjusted for our types. */ /* @@ -46,7 +48,7 @@ 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 }; -/*! compute the CRC-16 for the data buffer +/*! Compute 16bit CCITT polynome 0x8408 (x^0 + x^5 + x^12) over given buffer. * \param crc[in] previous CRC value * \param buffer[in] data pointer * \param len[in] number of bytes in input \ref buffer @@ -59,6 +61,7 @@ return crc; } +/*! CRC table for the CCITT CRC-6. The poly is 0x8408 (x^0 + x^5 + x^12) */ uint16_t const osmo_crc16_ccitt_table[256] = { 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, @@ -94,9 +97,17 @@ 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 }; + +/*! Compute 16bit CCITT polynome 0x8408 (x^0 + x^5 + x^12) over given buffer. + * \param[in] crc initial value of CRC + * \param[in] buffer pointer to buffer of input data + * \param[in] len length of \a buffer in bytes + * \returns 16bit CRC */ uint16_t osmo_crc16_ccitt(uint16_t crc, uint8_t const *buffer, size_t len) { while (len--) crc = osmo_crc16_ccitt_byte(crc, *buffer++); return crc; } + +/*! @} */ diff --git a/src/crcXXgen.c.tpl b/src/crcXXgen.c.tpl index e92a538..befba4d 100644 --- a/src/crcXXgen.c.tpl +++ b/src/crcXXgen.c.tpl @@ -20,7 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/*! \addtogroup crcgen +/*! \addtogroup crc * @{ * Osmocom generic CRC routines (for max XX bits poly). * -- To view, visit https://gerrit.osmocom.org/4285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I67119894bcbf8c779426a0272bae4c5ce1fbd1ed Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:10 +0000 Subject: [MERGED] libosmocore[master]: [doc] bits.c: Better / more Doxygen documentation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] bits.c: Better / more Doxygen documentation ...................................................................... [doc] bits.c: Better / more Doxygen documentation Change-Id: If824a5c8d8ee6e3dc96a3fddeb105786c0c027c1 --- M include/osmocom/core/bits.h M src/bits.c 2 files changed, 17 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index c6a142f..b1b8040 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -1,9 +1,6 @@ /*! \file bits.h * Osmocom bit level support code. * - * NOTE on the endianess of pbit_t: - * Bits in a pbit_t are ordered MSB first, i.e. 0x80 is the first bit. - * Bit i in a pbit_t array is array[i/8] & (1<<(7-i%8)) */ #pragma once @@ -19,9 +16,18 @@ * @{ * \file bits.h */ -typedef int8_t sbit_t; /*!< soft bit (-127...127) */ -typedef uint8_t ubit_t; /*!< unpacked bit (0 or 1) */ -typedef uint8_t pbit_t; /*!< packed bis (8 bits in a byte) */ +/*! soft bit with value (-127...127), as commonly used in + * communications receivers such as [viterbi] decoders */ +typedef int8_t sbit_t; + +/*! unpacked bit (0 or 1): 1 bit per byte */ +typedef uint8_t ubit_t; + +/*! packed bits (8 bits in a byte). + * NOTE on the endian-ness of \ref pbit_t: + * - Bits in a \ref pbit_t are ordered MSB first, i.e. 0x80 is the first bit. + * - Bit i in a \ref pbit_t array is array[i/8] & (1<<(7-i%8)) */ +typedef uint8_t pbit_t; /*! determine how many bytes we would need for \a num_bits packed bits * \param[in] num_bits Number of packed bits @@ -95,16 +101,12 @@ OSMO_BR_WORD_SWAP = 16, }; -/*! generic bit reversal function */ uint32_t osmo_bit_reversal(uint32_t x, enum osmo_br_mode k); -/* reverse the bits within each byte of a 32bit word */ uint32_t osmo_revbytebits_32(uint32_t x); -/* reverse the bits within a byte */ uint32_t osmo_revbytebits_8(uint8_t x); -/* reverse the bits of each byte in a given buffer */ void osmo_revbytebits_buf(uint8_t *buf, int len); /*! left circular shift diff --git a/src/bits.c b/src/bits.c index af09441..fa917b0 100644 --- a/src/bits.c +++ b/src/bits.c @@ -28,6 +28,11 @@ * @{ * Osmocom bit level support code. * + * This module implements the notion of different bit-fields, such as + * - unpacked bits (\ref ubit_t), i.e. 1 bit per byte + * - packed bits (\ref pbit_t), i.e. 8 bits per byte + * - soft bits (\ref sbit_t), 1 bit per byte from -127 to 127 + * * \file bits.c */ /*! convert unpacked bits to packed bits, return length in bytes -- To view, visit https://gerrit.osmocom.org/4284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If824a5c8d8ee6e3dc96a3fddeb105786c0c027c1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:10 +0000 Subject: [MERGED] libosmocore[master]: [doc] rate_ctr: Extend Doxygen API documentation with human-... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] rate_ctr: Extend Doxygen API documentation with human-readable text on its use ...................................................................... [doc] rate_ctr: Extend Doxygen API documentation with human-readable text on its use Change-Id: If9abd46e1b0ebb6114522418fd3b45c1d802968a --- M src/rate_ctr.c 1 file changed, 35 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 2985bbb..a04a776 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -22,6 +22,37 @@ * @{ * Counters about events and their event rates. * + * As \ref osmo_counter and \ref osmo_stat_item are concerned only with + * a single given value that may be increased/decreased, or the difference + * to one given previous value, this module adds some support for keeping + * long term information about a given event rate. + * + * A \ref rate_ctr keeps information on the amount of events per second, + * per minute, per hour and per day. + * + * \ref rate_ctr come in groups: An application describes a group of counters + * with their names and identities once in a (typically const) \ref + * rate_ctr_group_desc. + * + * As objects (such as e.g. a subscriber or a PDP context) are + * allocated dynamically at runtime, the application calls \ref + * rate_ctr_group_alloc with a refernce to the \ref + * rate_ctr_group_desc, which causes the library to allocate one set of + * \ref rate_ctr: One for each in the group. + * + * The application then uses functions like \ref rate_ctr_add or \ref + * rate_ctr_inc to increment the value as certain events (e.g. location + * update) happens. + * + * The library internally keeps a timer once per second which iterates + * over all registered counters and which updates the per-second, + * per-minute, per-hour and per-day averages based on the current + * value. + * + * The counters can be reported using \ref stats or by VTY + * introspection, as well as by any application-specific code accessing + * the \ref rate_ctr.intv array directly. + * * \file rate_ctr.c */ #include @@ -140,7 +171,9 @@ osmo_timer_schedule(&rate_ctr_timer, 1, 0); } -/*! Initialize the counter module */ +/*! Initialize the counter module. Call this once from your application. + * \param[in] tall_ctx Talloc context from which rate_ctr_group will be allocated + * \returns 0 on success; negative on error */ int rate_ctr_init(void *tall_ctx) { tall_rate_ctr_ctx = tall_ctx; @@ -173,7 +206,7 @@ /*! Search for counter based on group + name * \param[in] ctrg pointer to \ref rate_ctr_group * \param[in] name name of counter inside group - * \returns \ref rate_ctr or NULL in caes of error + * \returns \ref rate_ctr or NULL in case of error */ const struct rate_ctr *rate_ctr_get_by_name(const struct rate_ctr_group *ctrg, const char *name) { -- To view, visit https://gerrit.osmocom.org/4283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If9abd46e1b0ebb6114522418fd3b45c1d802968a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:11 +0000 Subject: [MERGED] libosmocore[master]: [doc] src/logging.c: Fix Doxygen syntax to make logging.c sh... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] src/logging.c: Fix Doxygen syntax to make logging.c show up in logging group ...................................................................... [doc] src/logging.c: Fix Doxygen syntax to make logging.c show up in logging group Change-Id: I56718e1eca1739a1b0a790f2f3a1b554899a93ab --- M src/logging.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/logging.c b/src/logging.c index 2e913e5..fa733cd 100644 --- a/src/logging.c +++ b/src/logging.c @@ -21,7 +21,7 @@ * */ -/* \addtogroup logging +/*! \addtogroup logging * @{ * libosmocore Logging sub-system * -- To view, visit https://gerrit.osmocom.org/4282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I56718e1eca1739a1b0a790f2f3a1b554899a93ab Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:11 +0000 Subject: [MERGED] libosmocore[master]: [doc] Add Doxygen API documentation for stats.c and stats_st... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Add Doxygen API documentation for stats.c and stats_statsd.c ...................................................................... [doc] Add Doxygen API documentation for stats.c and stats_statsd.c Change-Id: I8e49505f5c19beac90290fdba8821714e8eecd97 --- M include/osmocom/core/stats.h M src/stats.c M src/stats_statsd.c 3 files changed, 145 insertions(+), 22 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h index 161b34c..f50796c 100644 --- a/include/osmocom/core/stats.h +++ b/include/osmocom/core/stats.h @@ -1,4 +1,3 @@ -/*! \file stats.h */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * @@ -21,6 +20,10 @@ */ #pragma once +/*! \defgroup stats Statistics reporting + * @{ + * \file stats.h */ + /* a bit of a crude way to disable building/using this on (bare iron) * embedded systems. We cannot use the autoconf-defined HAVE_... macros * here, as that only works at library compile time, not at application @@ -40,42 +43,50 @@ struct rate_ctr_group; struct rate_ctr_desc; +/*! Statistics Class definitions */ enum osmo_stats_class { - OSMO_STATS_CLASS_UNKNOWN, - OSMO_STATS_CLASS_GLOBAL, - OSMO_STATS_CLASS_PEER, - OSMO_STATS_CLASS_SUBSCRIBER, + OSMO_STATS_CLASS_UNKNOWN, /*!< unknown class */ + OSMO_STATS_CLASS_GLOBAL, /*!< global counter/stat_item */ + OSMO_STATS_CLASS_PEER, /*!< peer in a communications link */ + OSMO_STATS_CLASS_SUBSCRIBER, /*!< subscriber */ }; +/*! Statistics Reporter Type */ enum osmo_stats_reporter_type { - OSMO_STATS_REPORTER_LOG, - OSMO_STATS_REPORTER_STATSD, + OSMO_STATS_REPORTER_LOG, /*!< libosmocore logging */ + OSMO_STATS_REPORTER_STATSD, /*!< statsd backend */ }; +/*! One statistics reporter instance. */ struct osmo_stats_reporter { + /*! Type of the reporter (log, statsd) */ enum osmo_stats_reporter_type type; + /*! Human-readable name of this reporter */ char *name; unsigned int have_net_config : 1; /* config */ - int enabled; - char *name_prefix; - char *dest_addr_str; - char *bind_addr_str; - int dest_port; - int mtu; + int enabled; /*!< is this reporter enabled */ + char *name_prefix; /*!< prefix for counter names */ + char *dest_addr_str; /*!< destination IP address */ + char *bind_addr_str; /*!< local bind IP address */ + int dest_port; /*!< destination (UDP) port */ + int mtu; /*!< Maximum Transmission Unit */ + + /*! Maximum class/index to report. FIXME: More details! */ enum osmo_stats_class max_class; /* state */ - int running; - struct sockaddr dest_addr; - int dest_addr_len; - struct sockaddr bind_addr; - int bind_addr_len; - int fd; - struct msgb *buffer; - int agg_enabled; + + int running; /*!< is this reporter running */ + struct sockaddr dest_addr; /*!< destination address of socket */ + int dest_addr_len; /*!< length of \a dest_addr in bytes */ + struct sockaddr bind_addr; /*!< local bind address of socket */ + int bind_addr_len; /*!< length of \a bind_addr in bytes */ + int fd; /*!< file descriptor of socket */ + struct msgb *buffer; /*!< message buffer for log output */ + int agg_enabled; /*!< is aggregation enabled? */ int force_single_flush; struct llist_head list; @@ -131,3 +142,4 @@ int osmo_stats_reporter_udp_close(struct osmo_stats_reporter *srep); #endif /* unix */ +/*! @} */ diff --git a/src/stats.c b/src/stats.c index d9df232..ff31ff6 100644 --- a/src/stats.c +++ b/src/stats.c @@ -22,6 +22,46 @@ * */ +/*! \addtogroup stats + * @{ + * + * This module implements periodic reporting of statistics / counters. + * It supports the notion of multiple \ref osmo_stats_reporter objects + * which independently of each other can report statistics at different + * configurable intervals to different destinations. + * + * In order to use this facility, you have to call \ref + * osmo_stats_init() once at application start-up and then create one or + * more \ref osmo_stats_reporter, either using the direct API functions + * or by using the optional VTY bindings: + * + * - reporting to any of the libosmocore log targets + * \ref osmo_stats_reporter_create_log() creates a new stats_reporter + * which reports to the libosmcoore \ref logging subsystem. + * + * - reporting to statsd (a front-end proxy for the Graphite/Carbon + * metrics server + * \ref osmo_stats_reporter_create_statsd() creates a new stats_reporter + * which reports via UDP to statsd. + * + * You can either use the above API functions directly to create \ref + * osmo_stats_reporter instances, or you can use the VTY support + * contained in libosmovty. See the "stats" configuration node + * installed by osmo_stats_vty_Add_cmds(). + * + * An \ref osmo_stats_reporter reports statistics on all of the following + * libosmocore internal counter/statistics objects: + * - \ref osmo_counter + * - \ref rate_ctr + * - \ref osmo_stat_item + * + * You do not need to do anything in particular to expose a given + * counter or stat_item, they are all exported automatically via any + * \ref osmo_stats_reporter. If you have multiple \ref + * osmo_stats_reporter, they will each report all counters/stat_items. + * + * \file stats.c */ + #include "config.h" #if !defined(EMBEDDED) @@ -137,6 +177,8 @@ return srep; } +/*! Destroy a given stats_reporter. Takes care of first disabling it. + * \param[in] srep stats_reporter that shall be disabled + destroyed */ void osmo_stats_reporter_free(struct osmo_stats_reporter *srep) { osmo_stats_reporter_disable(srep); @@ -144,6 +186,8 @@ talloc_free(srep); } +/*! Initilize the stats reporting module; call this once in your program + * \param[in] ctx Talloc context from which stats related memory is allocated */ void osmo_stats_init(void *ctx) { osmo_stats_ctx = ctx; @@ -153,6 +197,10 @@ start_timer(); } +/*! Find a stats_reporter of given \a type and \a name. + * \param[in] type Type of stats_reporter to find + * \param[in] name Name of stats_reporter to find + * \returns stats_reporter matching \a type and \a name; NULL otherwise */ struct osmo_stats_reporter *osmo_stats_reporter_find(enum osmo_stats_reporter_type type, const char *name) { @@ -172,6 +220,10 @@ #ifdef HAVE_SYS_SOCKET_H +/*! Set the remote (IP) address of a given stats_reporter. + * \param[in] srep stats_reporter whose remote address is to be set + * \param[in] addr String representation of remote IPv4 address + * \returns 0 on success; negative on error */ int osmo_stats_reporter_set_remote_addr(struct osmo_stats_reporter *srep, const char *addr) { int rc; @@ -197,6 +249,10 @@ return update_srep_config(srep); } +/*! Set the remote (UDP) port of a given stats_reporter + * \param[in] srep stats_reporter whose remote address is to be set + * \param[in] port UDP port of remote statsd to which we report + * \returns 0 on success; negative on error */ int osmo_stats_reporter_set_remote_port(struct osmo_stats_reporter *srep, int port) { struct sockaddr_in *sock_addr = (struct sockaddr_in *)&srep->dest_addr; @@ -210,6 +266,10 @@ return update_srep_config(srep); } +/*! Set the local (IP) address of a given stats_reporter. + * \param[in] srep stats_reporter whose remote address is to be set + * \param[in] addr String representation of local IP address + * \returns 0 on success; negative on error */ int osmo_stats_reporter_set_local_addr(struct osmo_stats_reporter *srep, const char *addr) { int rc; @@ -237,6 +297,10 @@ return update_srep_config(srep); } +/*! Set the maximum transmission unit of a given stats_reporter. + * \param[in] srep stats_reporter whose remote address is to be set + * \param[in] mtu Maximum Transmission Unit of \a srep + * \returns 0 on success; negative on error */ int osmo_stats_reporter_set_mtu(struct osmo_stats_reporter *srep, int mtu) { if (!srep->have_net_config) @@ -262,6 +326,10 @@ return 0; } +/*! Set the reporting interval of a given stats_reporter (in seconds). + * \param[in] srep stats_reporter whose remote address is to be set + * \param[in] interval Reporting interval in seconds + * \returns 0 on success; negative on error */ int osmo_stats_set_interval(int interval) { if (interval <= 0) @@ -274,6 +342,10 @@ return 0; } +/*! Set the name prefix of a given stats_reporter. + * \param[in] srep stats_reporter whose name prefix is to be set + * \param[in] prefix NAme perfix to pre-pend for any reported value + * \returns 0 on success; negative on error */ int osmo_stats_reporter_set_name_prefix(struct osmo_stats_reporter *srep, const char *prefix) { talloc_free(srep->name_prefix); @@ -283,6 +355,10 @@ return update_srep_config(srep); } + +/*! Enable the given stats_reporter. + * \param[in] srep stats_reporter who is to be enabled + * \returns 0 on success; negative on error */ int osmo_stats_reporter_enable(struct osmo_stats_reporter *srep) { srep->enabled = 1; @@ -290,6 +366,9 @@ return update_srep_config(srep); } +/*! Disable the given stats_reporter. + * \param[in] srep stats_reporter who is to be disabled + * \returns 0 on success; negative on error */ int osmo_stats_reporter_disable(struct osmo_stats_reporter *srep) { srep->enabled = 0; @@ -301,6 +380,9 @@ #ifdef HAVE_SYS_SOCKET_H +/*! Open the UDP socket for given stats_reporter. + * \param[in] srep stats_reporter whose UDP socket is to be opened + * ]returns 0 on success; negative otherwise */ int osmo_stats_reporter_udp_open(struct osmo_stats_reporter *srep) { int sock; @@ -346,6 +428,9 @@ return rc; } +/*! Closee the UDP socket for given stats_reporter. + * \param[in] srep stats_reporter whose UDP socket is to be closed + * ]returns 0 on success; negative otherwise */ int osmo_stats_reporter_udp_close(struct osmo_stats_reporter *srep) { int rc; @@ -361,6 +446,11 @@ return rc == -1 ? -errno : 0; } +/*! Send given date to given stats_reporter. + * \param[in] srep stats_reporter whose UDP socket is to be opened + * \param[in] data string data to be sent + * \param[in] data_len Length of \a data in bytes + * \returns number of bytes on success; negative otherwise */ int osmo_stats_reporter_send(struct osmo_stats_reporter *srep, const char *data, int data_len) { @@ -379,6 +469,9 @@ return rc; } +/*! Send current accumulated buffer to given stats_reporter. + * \param[in] srep stats_reporter whose UDP socket is to be opened + * \returns number of bytes on success; negative otherwise */ int osmo_stats_reporter_send_buffer(struct osmo_stats_reporter *srep) { int rc; @@ -397,6 +490,13 @@ /*** log reporter ***/ +/*! Create a stats_reporter that logs via libosmocore logging. + * A stats_reporter created via this function will simply print the statistics + * via the libosmocore logging framework, using DLSTATS subsystem and LOGL_INFO + * priority. The configuration of the libosmocore log targets define where this + * information will end up (ignored, text file, stderr, syslog, ...). + * \param[in] name Name of the to-be-created stats_reporter + * \returns stats_reporter on success; NULL on error */ struct osmo_stats_reporter *osmo_stats_reporter_create_log(const char *name) { struct osmo_stats_reporter *srep; @@ -626,3 +726,5 @@ } #endif /* !EMBEDDED */ + +/*! @} */ diff --git a/src/stats_statsd.c b/src/stats_statsd.c index 6e7be73..5145bf7 100644 --- a/src/stats_statsd.c +++ b/src/stats_statsd.c @@ -1,4 +1,3 @@ -/*! \file stats_statsd.c */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * @@ -21,6 +20,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ + +/*! \addtogroup stats + * @{ + * \file stats_statsd.c */ #include "config.h" #if !defined(EMBEDDED) @@ -46,6 +49,10 @@ const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, int64_t value); +/*! Create a stats_reporter reporting to statsd. This creates a stats_reporter + * instance which reports the related statistics data to statsd. + * \param[in] name Name of the to-be-created stats_reporter + * \returns stats_reporter on success; NULL on error */ struct osmo_stats_reporter *osmo_stats_reporter_create_statsd(const char *name) { struct osmo_stats_reporter *srep; @@ -172,3 +179,5 @@ desc->name, value, unit); } #endif /* !EMBEDDED */ + +/* @} */ -- To view, visit https://gerrit.osmocom.org/4281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e49505f5c19beac90290fdba8821714e8eecd97 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:11 +0000 Subject: [MERGED] libosmocore[master]: [doc] counter.[ch] Add Doxygen API documentation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] counter.[ch] Add Doxygen API documentation ...................................................................... [doc] counter.[ch] Add Doxygen API documentation This adds a more complete set of API documentation for all osmo_counter relatedd functions and definitions. Change-Id: I24283c05620ee86a8beb165af98a85d754549efb --- M include/osmocom/core/counter.h M src/counter.c 2 files changed, 23 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/counter.h b/include/osmocom/core/counter.h index f4429cd..e692f7e 100644 --- a/include/osmocom/core/counter.h +++ b/include/osmocom/core/counter.h @@ -3,7 +3,7 @@ /*! \file counter.h * Common routines regarding counter handling */ -/*! structure representing a single counter */ +/*! Structure representing a single counter */ struct osmo_counter { struct llist_head list; /*!< internal list head */ const char *name; /*!< human-readable name */ @@ -12,13 +12,15 @@ unsigned long previous; /*!< previous value */ }; -/*! Decrement counter */ +/*! Decrement given counter by one + * \param[in] ctr Counter that's to be decremented */ static inline void osmo_counter_dec(struct osmo_counter *ctr) { ctr->value--; } -/*! Increment counter */ +/*! Increment counter by one. + * \param[in] Counter that's to be incremented */ static inline void osmo_counter_inc(struct osmo_counter *ctr) { ctr->value++; @@ -36,25 +38,12 @@ ctr->value = 0; } -/*! Allocate a new counter */ struct osmo_counter *osmo_counter_alloc(const char *name); -/*! Free the specified counter - * \param[in] ctr Counter - */ void osmo_counter_free(struct osmo_counter *ctr); -/*! Iterate over all counters - * \param[in] handle_counter Call-back function, aborts if rc < 0 - * \param[in] data Private dtata handed through to \a handle_counter - */ int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data); -/*! Resolve counter by human-readable name - * \param[in] name human-readable name of counter - * \returns pointer to counter (\ref osmo_counter) or NULL otherwise - */ struct osmo_counter *osmo_counter_get_by_name(const char *name); -/*! Return the counter difference since the last call to this function */ int osmo_counter_difference(struct osmo_counter *ctr); diff --git a/src/counter.c b/src/counter.c index 6fa87ba..2963777 100644 --- a/src/counter.c +++ b/src/counter.c @@ -29,8 +29,12 @@ static LLIST_HEAD(counters); +/*! Global talloc context for all osmo_counter allocations. */ void *tall_ctr_ctx; +/*! Allocate a new counter with given name. Allocates from tall_ctr_ctx + * \param[in] name Human-readable string name for the counter + * \returns Allocated counter on success; NULL on error */ struct osmo_counter *osmo_counter_alloc(const char *name) { struct osmo_counter *ctr = talloc_zero(tall_ctr_ctx, struct osmo_counter); @@ -44,12 +48,18 @@ return ctr; } +/*! Release/Destroy a given counter + * \param[in] ctr Counter to be destroyed */ void osmo_counter_free(struct osmo_counter *ctr) { llist_del(&ctr->list); talloc_free(ctr); } +/*! Iterate over all counters; call \a handle_cunter call-back for each. + * \param[in] handle_counter Call-back to be called for each counter; aborts if rc < 0 + * \param[in] data Opaque data passed through to \a handle_counter function + * \returns 0 if all \a handle_counter calls successfull; negative on error */ int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data) { @@ -65,6 +75,9 @@ return rc; } +/*! Find a counter by its name. + * \param[in] name Name used to look-up/search counter + * \returns Counter on success; NULL if not found */ struct osmo_counter *osmo_counter_get_by_name(const char *name) { struct osmo_counter *ctr; @@ -76,6 +89,11 @@ return NULL; } +/*! Compute difference between current and previous counter value. + * \param[in] ctr Counter of which the difference is to be computed + * \returns Delta value between current counter and previous counter. Please + * note that the actual counter values are unsigned long, while the + * difference is computed as signed integer! */ int osmo_counter_difference(struct osmo_counter *ctr) { int delta = ctr->value - ctr->previous; -- To view, visit https://gerrit.osmocom.org/4280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24283c05620ee86a8beb165af98a85d754549efb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:11 +0000 Subject: [MERGED] libosmocore[master]: [doc] stat_item: Complete doxygen documentation for API In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] stat_item: Complete doxygen documentation for API ...................................................................... [doc] stat_item: Complete doxygen documentation for API The stat_item code base had some incomplete doxygen documentation so far. Let's complete it, and at the same time fix some cosmetic as well as copy+paste issues in the existing documentation bits. Change-Id: Ib514c137b40bf7b9791bd74be99af0b65575f2b6 --- M include/osmocom/core/stat_item.h M src/stat_item.c 2 files changed, 89 insertions(+), 42 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/stat_item.h b/include/osmocom/core/stat_item.h index 4cee8a8..260ffb1 100644 --- a/include/osmocom/core/stat_item.h +++ b/include/osmocom/core/stat_item.h @@ -13,32 +13,34 @@ #define OSMO_STAT_ITEM_NOVALUE_ID 0 #define OSMO_STAT_ITEM_NO_UNIT NULL +/*! Individual entry in value FIFO */ struct osmo_stat_item_value { - int32_t id; - int32_t value; + int32_t id; /*!< identifier of value */ + int32_t value; /*!< actual value */ }; -/*! data we keep for each actual value */ +/*! data we keep for each actual item */ struct osmo_stat_item { + /*! back-reference to the item description */ const struct osmo_stat_item_desc *desc; /*! the index of the freshest value */ int32_t last_value_index; - /*! offset to the freshest value in the value fifo */ + /*! offset to the freshest value in the value FIFO */ int16_t last_offs; - /*! value fifo */ + /*! value FIFO */ struct osmo_stat_item_value values[0]; }; -/*! statistics value description */ +/*! Statistics item description */ struct osmo_stat_item_desc { const char *name; /*!< name of the item */ const char *description;/*!< description of the item */ const char *unit; /*!< unit of a value */ - unsigned int num_values;/*!< number of values to store */ - int32_t default_value; + unsigned int num_values;/*!< number of values to store in FIFO */ + int32_t default_value; /*!< default value */ }; -/*! description of a statistics value group */ +/*! Description of a statistics item group */ struct osmo_stat_item_group_desc { /*! The prefix to the name of all values in this group */ const char *group_name_prefix; @@ -46,9 +48,9 @@ const char *group_description; /*! The class to which this group belongs */ int class_id; - /*! The number of values in this group */ + /*! The number of values in this group (size of item_desc) */ const unsigned int num_items; - /*! Pointer to array of value names */ + /*! Pointer to array of value names, length as per num_items */ const struct osmo_stat_item_desc *item_desc; }; @@ -87,31 +89,13 @@ const struct osmo_stat_item *osmo_stat_item_get_by_name( const struct osmo_stat_item_group *statg, const char *name); -/*! Retrieve the next value from the osmo_stat_item object. - * If a new value has been set, it is returned. The idx is used to decide - * which value to return. - * On success, *idx is updated to refer to the next unread value. If - * values have been missed due to FIFO overflow, *idx is incremented by - * (1 + num_lost). - * This way, the osmo_stat_item object can be kept stateless from the reader's - * perspective and therefore be used by several backends simultaneously. - * - * \param val the osmo_stat_item object - * \param idx identifies the next value to be read - * \param value a pointer to store the value - * \returns the increment of the index (0: no value has been read, - * 1: one value has been taken, - * (1+n): n values have been skipped, one has been taken) - */ int osmo_stat_item_get_next(const struct osmo_stat_item *item, int32_t *idx, int32_t *value); /*! Get the last (freshest) value */ static int32_t osmo_stat_item_get_last(const struct osmo_stat_item *item); -/*! Skip all values of the item and update idx accordingly */ int osmo_stat_item_discard(const struct osmo_stat_item *item, int32_t *idx); -/*! Skip all values of all items and update idx accordingly */ int osmo_stat_item_discard_all(int32_t *idx); typedef int (*osmo_stat_item_handler_t)( @@ -119,10 +103,6 @@ typedef int (*osmo_stat_item_group_handler_t)(struct osmo_stat_item_group *, void *); -/*! Iteate over all items - * \param[in] handle_item Call-back function, aborts if rc < 0 - * \param[in] data Private data handed through to \a handle_item - */ int osmo_stat_item_for_each_item(struct osmo_stat_item_group *statg, osmo_stat_item_handler_t handle_item, void *data); diff --git a/src/stat_item.c b/src/stat_item.c index c073a3e..cbcdebc 100644 --- a/src/stat_item.c +++ b/src/stat_item.c @@ -1,5 +1,5 @@ /*! \file stat_item.c - * utility routines for keeping conters about events and the event rates. */ + * utility routines for keeping statistical values */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * (C) 2009-2010 by Harald Welte @@ -24,7 +24,31 @@ /*! \addtogroup osmo_stat_item * @{ - * \file stat_item.c */ + * + * This osmo_stat_item module adds instrumentation capabilities to + * gather measurement and statistical values in a similar fashion to + * what we have as \ref osmo_counter_group. + * + * As opposed to counters, osmo_stat_item do not increment but consist + * of a configurable-sized FIFO, which can store not only the current + * (most recent) value, but also historic values. + * + * The only supported value type is an int32_t. + * + * Getting values from the osmo_stat_item does not modify its state to + * allow for multiple independent back-ends retrieving values (e.g. VTY + * and statd). + * + * Each value stored in the FIFO of an osmo_stat_item has an associated + * value_id. The value_id is derived from an application-wide globally + * incrementing counter, so (until the counter wraps) more recent + * values will have higher values. + * + * When a new value is set, the oldest value in the FIFO gets silently + * overwritten. Lost values are skipped when getting values from the + * item. + * + */ #include #include @@ -35,12 +59,17 @@ #include #include +/*! global list of stat_item groups */ static LLIST_HEAD(osmo_stat_item_groups); +/*! counter for assigning globally unique value identifiers */ static int32_t global_value_id = 0; +/*! talloc context from which we allocate */ static void *tall_stat_item_ctx; -/*! Allocate a new group of counters according to description +/*! Allocate a new group of counters according to description. + * Allocate a group of stat items described in \a desc from talloc context \a ctx, + * giving the new group the index \a idx. * \param[in] ctx \ref talloc context * \param[in] desc Statistics item group description * \param[in] idx Index of new stat item group @@ -112,13 +141,19 @@ return group; } -/*! Free the memory for the specified group of counters */ +/*! Free the memory for the specified group of stat items */ void osmo_stat_item_group_free(struct osmo_stat_item_group *grp) { llist_del(&grp->list); talloc_free(grp); } +/*! Set the a given stat_item to the given value. + * This function adds a new value for the given stat_item at the end of + * the FIFO. + * \param[in] item The stat_item whose \a value we want to set + * \param[in] value The numeric value we want to store at end of FIFO + */ void osmo_stat_item_set(struct osmo_stat_item *item, int32_t value) { item->last_offs += 1; @@ -133,6 +168,22 @@ item->values[item->last_offs].id = global_value_id; } +/*! Retrieve the next value from the osmo_stat_item object. + * If a new value has been set, it is returned. The idx is used to decide + * which value to return. + * On success, *idx is updated to refer to the next unread value. If + * values have been missed due to FIFO overflow, *idx is incremented by + * (1 + num_lost). + * This way, the osmo_stat_item object can be kept stateless from the reader's + * perspective and therefore be used by several backends simultaneously. + * + * \param val the osmo_stat_item object + * \param idx identifies the next value to be read + * \param value a pointer to store the value + * \returns the increment of the index (0: no value has been read, + * 1: one value has been taken, + * (1+n): n values have been skipped, one has been taken) + */ int osmo_stat_item_get_next(const struct osmo_stat_item *item, int32_t *next_idx, int32_t *value) { @@ -170,7 +221,7 @@ return idx_delta; } -/*! Skip all values of this item and update idx accordingly */ +/*! Skip/discard all values of this item and update \a idx accordingly */ int osmo_stat_item_discard(const struct osmo_stat_item *item, int32_t *idx) { int discarded = item->values[item->last_offs].id + 1 - *idx; @@ -179,7 +230,7 @@ return discarded; } -/*! Skip all values of all items and update idx accordingly */ +/*! Skip all values of all items and update \a idx accordingly */ int osmo_stat_item_discard_all(int32_t *idx) { int discarded = global_value_id + 1 - *idx; @@ -188,7 +239,8 @@ return discarded; } -/*! Initialize the stat item module */ +/*! Initialize the stat item module. Call this once from your program. + * \param[in] tall_ctx Talloc context from which this module allocates */ int osmo_stat_item_init(void *tall_ctx) { tall_stat_item_ctx = tall_ctx; @@ -196,7 +248,10 @@ return 0; } -/*! Search for item group based on group name and index */ +/*! Search for item group based on group name and index + * \param[in] name Name of stats_item_group we want to find + * \param[in] idx Index of the group we want to find + * \returns pointer to group, if found; NULL otherwise */ struct osmo_stat_item_group *osmo_stat_item_get_group_by_name_idx( const char *name, const unsigned int idx) { @@ -213,7 +268,10 @@ return NULL; } -/*! Search for item group based on group name */ +/*! Search for item based on group + item name + * \param[in] statg group in which to search for the item + * \param[in] name name of item to search within \a statg + * \returns pointer to item, if found; NULL otherwise */ const struct osmo_stat_item *osmo_stat_item_get_by_name( const struct osmo_stat_item_group *statg, const char *name) { @@ -233,6 +291,11 @@ return NULL; } +/*! Iterate over all items in group, call user-supplied function on each + * \param[in] statg stat_item group over whose items to iterate + * \param[in] handle_item Call-back function, aborts if rc < 0 + * \param[in] data Private data handed through to \a handle_item + */ int osmo_stat_item_for_each_item(struct osmo_stat_item_group *statg, osmo_stat_item_handler_t handle_item, void *data) { @@ -249,6 +312,10 @@ return rc; } +/*! Iterate over all stat_item groups in system, call user-supplied function on each + * \param[in] handle_group Call-back function, aborts if rc < 0 + * \param[in] data Private data handed through to \a handle_group + */ int osmo_stat_item_for_each_group(osmo_stat_item_group_handler_t handle_group, void *data) { struct osmo_stat_item_group *statg; -- To view, visit https://gerrit.osmocom.org/4276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib514c137b40bf7b9791bd74be99af0b65575f2b6 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:11 +0000 Subject: [MERGED] libosmocore[master]: Rename 'statistics.c' to 'counter.c' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Rename 'statistics.c' to 'counter.c' ...................................................................... Rename 'statistics.c' to 'counter.c' With stat_item, stats.c and stats_statsd.c, it is becoming a bit difficult to understand file naming. Also, the 'statistics.c' file actually only contained osmo_counter handling, so let's rename it to counter.c altogether. Change-Id: I2cfb2310543902b7da46cb15a76e2da317eaed7d --- M include/Makefile.am A include/osmocom/core/counter.h M include/osmocom/core/statistics.h M src/Makefile.am R src/counter.c M src/ctrl/control_if.c M src/stats.c M src/vty/stats_vty.c M src/vty/utils.c 9 files changed, 70 insertions(+), 67 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/Makefile.am b/include/Makefile.am index 4e92d55..4714003 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -12,6 +12,7 @@ osmocom/core/bitcomp.h \ osmocom/core/byteswap.h \ osmocom/core/conv.h \ + osmocom/core/counter.h \ osmocom/core/crc16.h \ osmocom/core/crc16gen.h \ osmocom/core/crc32gen.h \ diff --git a/include/osmocom/core/counter.h b/include/osmocom/core/counter.h new file mode 100644 index 0000000..f4429cd --- /dev/null +++ b/include/osmocom/core/counter.h @@ -0,0 +1,60 @@ +#pragma once + +/*! \file counter.h + * Common routines regarding counter handling */ + +/*! structure representing a single counter */ +struct osmo_counter { + struct llist_head list; /*!< internal list head */ + const char *name; /*!< human-readable name */ + const char *description; /*!< humn-readable description */ + unsigned long value; /*!< current value */ + unsigned long previous; /*!< previous value */ +}; + +/*! Decrement counter */ +static inline void osmo_counter_dec(struct osmo_counter *ctr) +{ + ctr->value--; +} + +/*! Increment counter */ +static inline void osmo_counter_inc(struct osmo_counter *ctr) +{ + ctr->value++; +} + +/*! Get current value of counter */ +static inline unsigned long osmo_counter_get(struct osmo_counter *ctr) +{ + return ctr->value; +} + +/*! Reset current value of counter to 0 */ +static inline void osmo_counter_reset(struct osmo_counter *ctr) +{ + ctr->value = 0; +} + +/*! Allocate a new counter */ +struct osmo_counter *osmo_counter_alloc(const char *name); + +/*! Free the specified counter + * \param[in] ctr Counter + */ +void osmo_counter_free(struct osmo_counter *ctr); + +/*! Iterate over all counters + * \param[in] handle_counter Call-back function, aborts if rc < 0 + * \param[in] data Private dtata handed through to \a handle_counter + */ +int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data); + +/*! Resolve counter by human-readable name + * \param[in] name human-readable name of counter + * \returns pointer to counter (\ref osmo_counter) or NULL otherwise + */ +struct osmo_counter *osmo_counter_get_by_name(const char *name); + +/*! Return the counter difference since the last call to this function */ +int osmo_counter_difference(struct osmo_counter *ctr); diff --git a/include/osmocom/core/statistics.h b/include/osmocom/core/statistics.h index 5ebb5fc..e7da72a 100644 --- a/include/osmocom/core/statistics.h +++ b/include/osmocom/core/statistics.h @@ -1,60 +1,2 @@ -#pragma once - -/*! \file statistics.h - * Common routines regarding statistics */ - -/*! structure representing a single counter */ -struct osmo_counter { - struct llist_head list; /*!< internal list head */ - const char *name; /*!< human-readable name */ - const char *description; /*!< humn-readable description */ - unsigned long value; /*!< current value */ - unsigned long previous; /*!< previous value */ -}; - -/*! Decrement counter */ -static inline void osmo_counter_dec(struct osmo_counter *ctr) -{ - ctr->value--; -} - -/*! Increment counter */ -static inline void osmo_counter_inc(struct osmo_counter *ctr) -{ - ctr->value++; -} - -/*! Get current value of counter */ -static inline unsigned long osmo_counter_get(struct osmo_counter *ctr) -{ - return ctr->value; -} - -/*! Reset current value of counter to 0 */ -static inline void osmo_counter_reset(struct osmo_counter *ctr) -{ - ctr->value = 0; -} - -/*! Allocate a new counter */ -struct osmo_counter *osmo_counter_alloc(const char *name); - -/*! Free the specified counter - * \param[in] ctr Counter - */ -void osmo_counter_free(struct osmo_counter *ctr); - -/*! Iterate over all counters - * \param[in] handle_counter Call-back function, aborts if rc < 0 - * \param[in] data Private dtata handed through to \a handle_counter - */ -int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data); - -/*! Resolve counter by human-readable name - * \param[in] name human-readable name of counter - * \returns pointer to counter (\ref osmo_counter) or NULL otherwise - */ -struct osmo_counter *osmo_counter_get_by_name(const char *name); - -/*! Return the counter difference since the last call to this function */ -int osmo_counter_difference(struct osmo_counter *ctr); +/* wrapper for legacy code, when counter.h was called statistics.h */ +#include diff --git a/src/Makefile.am b/src/Makefile.am index 8e7ef4b..4925eed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,7 +14,7 @@ libosmocore_la_LIBADD = $(BACKTRACE_LIB) $(TALLOC_LIBS) libosmocore_la_SOURCES = timer.c timer_gettimeofday.c select.c signal.c msgb.c bits.c \ - bitvec.c bitcomp.c statistics.c fsm.c \ + bitvec.c bitcomp.c counter.c fsm.c \ write_queue.c utils.c socket.c \ logging.c logging_syslog.c logging_gsmtap.c rate_ctr.c \ gsmtap_util.c crc16.c panic.c backtrace.c \ diff --git a/src/statistics.c b/src/counter.c similarity index 96% rename from src/statistics.c rename to src/counter.c index fc808f5..6fa87ba 100644 --- a/src/statistics.c +++ b/src/counter.c @@ -1,4 +1,4 @@ -/*! \file statistics.c +/*! \file counter.c * utility routines for keeping some statistics. */ /* * (C) 2009 by Harald Welte @@ -25,7 +25,7 @@ #include #include -#include +#include static LLIST_HEAD(counters); diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index 47efb25..d50ddd0 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/stats.c b/src/stats.c index b39ec53..d9df232 100644 --- a/src/stats.c +++ b/src/stats.c @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #define STATS_DEFAULT_INTERVAL 5 /* secs */ diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index a4c73fa..95f04bc 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -35,7 +35,7 @@ #include #include -#include +#include #include #define CFG_STATS_STR "Configure stats sub-system\n" diff --git a/src/vty/utils.c b/src/vty/utils.c index 9d1bdf9..e7aeb88 100644 --- a/src/vty/utils.c +++ b/src/vty/utils.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include -- To view, visit https://gerrit.osmocom.org/4279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2cfb2310543902b7da46cb15a76e2da317eaed7d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 16 Oct 2017 13:19:16 +0000 Subject: osmo-bsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 is this identical to 4277?? -- To view, visit https://gerrit.osmocom.org/4278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:16 +0000 Subject: libosmocore[master]: [doc] Introductory text on what the logging ring buffer is a... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I876cd31e03a53ca90e658e353c0c8a839dece8ad Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:19:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:19:20 +0000 Subject: libosmocore[master]: [doc] Expand Doxuygen documentation for osmo_prim In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4289 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4363e46a5f606eb2114a9cc1d2086007eaa58d31 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:20:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 16 Oct 2017 13:20:26 +0000 Subject: [MERGED] osmo-hlr[master]: fix db_subscr_get_by_*(): clear output data; test in db_test.c In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix db_subscr_get_by_*(): clear output data; test in db_test.c ...................................................................... fix db_subscr_get_by_*(): clear output data; test in db_test.c db_subscr_get_by_*() failed to clear the out-param struct, meaning that data could remain in a struct even though it is not present in the database. Always zero out the struct before writing to it. Adjust the db_test to catch this error by writing "-invalid-data-" to each struct before running db get functions. Change-Id: I038bd437452c87841d709fcdd5ac30ab1356b2db --- M src/db_hlr.c M tests/db/db_test.c 2 files changed, 18 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db_hlr.c b/src/db_hlr.c index 71f682d..cf6e4f8 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -379,6 +379,8 @@ if (!subscr) goto out; + *subscr = (struct hlr_subscriber){}; + /* obtain the various columns */ subscr->id = sqlite3_column_int64(stmt, 0); SL3_TXT(subscr->imsi, stmt, 1); diff --git a/tests/db/db_test.c b/tests/db/db_test.c index db3318c..591418b 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -34,6 +34,19 @@ #define comment(fmt, args...) fprintf(stderr, "\n--- " fmt "\n\n", ## args); #define comment_end() fprintf(stderr, "===== %s: SUCCESS\n\n", __func__); +#define fill_invalid(x) _fill_invalid(&x, sizeof(x)) +static void _fill_invalid(void *dest, size_t size) +{ + uint8_t *pos = dest; + size_t remain = size; + int wrote = 0; + do { + remain -= wrote; + pos += wrote; + wrote = snprintf((void*)pos, remain, "-invalid-data"); + } while (wrote < remain); +} + /* Perform a function call and verbosely assert that its return value is as expected. * The return code is then available in g_rc. */ #define ASSERT_RC(call, expect_rc) \ @@ -53,7 +66,7 @@ #define ASSERT_SEL(by, val, expect_rc) \ do { \ int rc; \ - g_subscr = (struct hlr_subscriber){}; \ + fill_invalid(g_subscr); \ fprintf(stderr, "db_subscr_get_by_" #by "(dbc, " #val ", &g_subscr) --> " \ #expect_rc "\n"); \ rc = db_subscr_get_by_##by(dbc, val, &g_subscr); \ @@ -71,8 +84,8 @@ * The results are then available in g_aud2g and g_aud3g. */ #define ASSERT_SEL_AUD(imsi, expect_rc, expect_id) \ do { \ - g_aud2g = (struct osmo_sub_auth_data){}; \ - g_aud3g = (struct osmo_sub_auth_data){}; \ + fill_invalid(g_aud2g); \ + fill_invalid(g_aud3g); \ g_id = 0; \ ASSERT_RC(db_get_auth_data(dbc, imsi, &g_aud2g, &g_aud3g, &g_id), expect_rc); \ if (!g_rc) { \ -- To view, visit https://gerrit.osmocom.org/4230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I038bd437452c87841d709fcdd5ac30ab1356b2db Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:20:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:20:34 +0000 Subject: osmo-ggsn[master]: lib/ippool: Fix listsize calculated 1 elem too small In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I95c24bc690490155bec9e3933d678e4668d7745f Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:20:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:20:53 +0000 Subject: osmo-ggsn[master]: lib/in46a: Introduce in46a_netmasklen API In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4290 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06e3e038afd8f7afaec2a3fa67b1616500c8db80 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:23:40 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 16 Oct 2017 13:23:40 +0000 Subject: osmo-mgw[master]: mgcp: move port/timeslot calculator to separate header In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) > (1 comment) > > Please clarify, does the new MGW need this at all? Is this only for > bsc-nat? So far I thought the new MGW allocates ports as it sees > fit and communicates the right port numbers back to the client(s), > hence these functions would not be needed. > > Please clarify, why is it not possible to include mgcp.h when > mgcp_client.h is already included? They should both be completely > separate now, besides mgcp_common.h. I see: I have tried: #include #include this worked so far. https://gerrit.osmocom.org/#/c/4237/1/include/osmocom/mgcp/mgcp_calc.h File include/osmocom/mgcp/mgcp_calc.h: Line 1: /* Helpers to calculate ports and endpoints */ > This header can be used by both libraries without linking conflicts because Done -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:24:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:24:13 +0000 Subject: osmo-ggsn[master]: tun: Convert tun_ipv6_linklocal_get to be more generic In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4291/1/lib/tun.h File lib/tun.h: Line 31: IP_TYPE_IPv6_GLOBAL = 4, naming is not exactly corect. there are link-local, node-locala and organization-local addresses, as well as global adresses. Your "global" basically means "anything not link-local", which is a different definition of that what IETF calls global adresses. -- To view, visit https://gerrit.osmocom.org/4291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I277af191dc611b6bbcb83479f4ae338083740322 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:26:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 13:26:13 +0000 Subject: osmo-ggsn[master]: tun: Convert tun_ipv6_linklocal_get to be more generic In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4291/1/lib/tun.c File lib/tun.c: Line 788: return 0; we're not happy with the old code making assumptions such as where the gateway IP address is within the subnet. In your propsoed patch, we also make assumtions: That there's only one non-link-local address (for each IPv4 and IPv6). It should be rather easy to iterate over all such addresses and add all of them to the blacklist, shouldn't it? Basically if there are 10 local ip addresses configured in the pool, we should skip all 10. -- To view, visit https://gerrit.osmocom.org/4291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I277af191dc611b6bbcb83479f4ae338083740322 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:26:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 16 Oct 2017 13:26:53 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 1: > The makefile snippet to use doxygen is taken from libosmo-netif. It > assumes empty doc/ which is cleared on every invocation. ok, I understand now; would be great to mention this in the commit log instead of just "to avoid complicating". What is the direction then, will we move all other repositories' doc/examples to examples/ to follow the same structure everywhere? I'm not sure of how much practical use my comments are, but somehow it feels wrong to trade one slight inconsistency for another which then ripples similar changes through all other repositories... An alternative would be to not delete the entire doc/ but merely the doxygen generated files during make, right? -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:28:41 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 16 Oct 2017 13:28:41 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: move port/timeslot calculator to mgcp_common.h In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4237 to look at the new patch set (#5). mgcp: move port/timeslot calculator to mgcp_common.h the functions rtp_calculate_port(), mgcp_timeslot_to_endpoint(), mgcp_endpoint_to_timeslot() may be useful in an application that uses the mgcp_client as well. Move the functions to mgcp_common.h Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e --- M include/osmocom/mgcp/mgcp.h M include/osmocom/mgcp/mgcp_common.h 2 files changed, 46 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/37/4237/5 diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 7307f3c..4c72844 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -37,31 +37,6 @@ #define RTP_PORT_DEFAULT_RANGE_START 16002 #define RTP_PORT_DEFAULT_RANGE_END RTP_PORT_DEFAULT_RANGE_START + 64 -/** - * Calculate the RTP audio port for the given multiplex - * and the direction. This allows a semi static endpoint - * to port calculation removing the need for the BSC - * and the MediaGateway to communicate. - * - * Port usage explained: - * base + (multiplex * 2) + 0 == local port to wait for network packets - * base + (multiplex * 2) + 1 == local port for rtcp - * - * The above port will receive packets from the BTS that need - * to be patched and forwarded to the network. - * The above port will receive packets from the network that - * need to be patched and forwarded to the BTS. - * - * We assume to have a static BTS IP address so we can differentiate - * network and BTS. - * - */ -static inline int rtp_calculate_port(int multiplex, int base) -{ - return base + (multiplex * 2); -} - - /* * Handling of MGCP Endpoints and the MGCP Config */ @@ -235,23 +210,6 @@ * format helper functions */ struct msgb *mgcp_handle_message(struct mgcp_config *cfg, struct msgb *msg); - -/* adc helper */ -static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot) -{ - if (timeslot == 0) { - LOGP(DLMGCP, LOGL_ERROR, "Timeslot should not be 0\n"); - timeslot = 255; - } - - return timeslot + (32 * multiplex); -} - -static inline void mgcp_endpoint_to_timeslot(int endpoint, int *multiplex, int *timeslot) -{ - *multiplex = endpoint / 32; - *timeslot = endpoint % 32; -} int mgcp_send_reset_ep(struct mgcp_endpoint *endp, int endpoint); int mgcp_send_reset_all(struct mgcp_config *cfg); diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h index 0eb1388..c2fb780 100644 --- a/include/osmocom/mgcp/mgcp_common.h +++ b/include/osmocom/mgcp/mgcp_common.h @@ -68,4 +68,50 @@ return 0; } +/** + * Calculate the RTP audio port for the given multiplex + * and the direction. This allows a semi static endpoint + * to port calculation removing the need for the BSC + * and the MediaGateway to communicate. + * + * Port usage explained: + * base + (multiplex * 2) + 0 == local port to wait for network packets + * base + (multiplex * 2) + 1 == local port for rtcp + * + * The above port will receive packets from the BTS that need + * to be patched and forwarded to the network. + * The above port will receive packets from the network that + * need to be patched and forwarded to the BTS. + * + * We assume to have a static BTS IP address so we can differentiate + * network and BTS. + * + */ +static inline int rtp_calculate_port(int multiplex, int base) +{ + return base + (multiplex * 2); +} + +/** + * Calculate the MGCP endpoint from a given timeslot + */ +static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot) +{ + if (timeslot == 0) { + LOGP(DLMGCP, LOGL_ERROR, "Timeslot should not be 0\n"); + timeslot = 255; + } + + return timeslot + (32 * multiplex); +} + +/** + * Calculate the timeslot from a given mgcp endpoint + */ +static inline void mgcp_endpoint_to_timeslot(int endpoint, int *multiplex, int *timeslot) +{ + *multiplex = endpoint / 32; + *timeslot = endpoint % 32; +} + #endif -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:29:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 16 Oct 2017 13:29:38 +0000 Subject: [PATCH] osmo-msc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4231 to look at the new patch set (#5). Remove pkg-config file It's an artefact of split which is unused anyway. Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 --- M Makefile.am M configure.ac M include/osmocom/msc/Makefile.am D osmo-msc.pc.in 4 files changed, 1 insertion(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/31/4231/5 diff --git a/Makefile.am b/Makefile.am index 9a92b08..690deae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,9 +16,6 @@ contrib \ $(NULL) -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = osmo-msc.pc - BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 8f468d5..64fead8 100644 --- a/configure.ac +++ b/configure.ac @@ -171,7 +171,6 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - osmo-msc.pc include/Makefile include/osmocom/Makefile include/osmocom/msc/Makefile diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 4099c9e..1419e8e 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -6,6 +6,7 @@ a_iface_bssap.h \ arfcn_range_encode.h \ auth.h \ + bsc_api.h \ bsc_msc.h \ bsc_msg_filter.h \ bsc_rll.h \ @@ -66,13 +67,3 @@ vlr.h \ vty.h \ $(NULL) - -openbsc_HEADERS = \ - bsc_api.h \ - gsm_04_08.h \ - meas_rep.h \ - $(NULL) - -# DO NOT add a newline and '$(NULL)' to this line. That would add a trailing -# space to the directory installed: $prefix/include/'openbsc ' -openbscdir = $(includedir)/openbsc diff --git a/osmo-msc.pc.in b/osmo-msc.pc.in deleted file mode 100644 index c406061..0000000 --- a/osmo-msc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/ - -Name: OsmoMSC -Description: Osmocom Mobile Switching Center -Requires: -Version: @VERSION@ -Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:37:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 16 Oct 2017 13:37:54 +0000 Subject: [PATCH] libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4234 to look at the new patch set (#2). Add doxygen docs Make sure doxygen generates library documentation by default (can be disabled at compile time). To avoid complicating doxygen setup compared to other libraries example config was moved to separate directory. The Makefile snippet to use doxygen is taken from libosmo-netif. It assumes empty doc/ which is cleared on every invocation. In case of libosmo-netif examples are in the separate directory. So ether we have to move examples or change the Makefile.am. Let's do the former as it makes libraries to follow the same structure and simplifies further maintenance. Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Related: OS#2572 --- M .gitignore A Doxyfile.in M Makefile.am M configure.ac M debian/control R examples/osmo-stp.cfg 6 files changed, 1,754 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/34/4234/2 diff --git a/.gitignore b/.gitignore index c38bac1..e63e4ee 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ config.* tags +/Doxyfile diff --git a/Doxyfile.in b/Doxyfile.in new file mode 100644 index 0000000..738457b --- /dev/null +++ b/Doxyfile.in @@ -0,0 +1,1716 @@ +# Doxyfile 1.7.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = libosmo-sccp + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Osmocom SIGTRAN library" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @srcdir@/include/osmocom/sigtran @srcdir@/src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +# IMAGE_PATH = images/ + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = doc/libosmo-sccp.tag + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = /usr/bin/dot + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/Makefile.am b/Makefile.am index e2c5277..569dfda 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc libosmo-xua.pc -EXTRA_DIST = .version doc/examples/osmo-stp.cfg +EXTRA_DIST = .version examples/osmo-stp.cfg @RELMAKE@ @@ -15,3 +15,28 @@ echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version + + +if HAVE_DOXYGEN + +html_DATA = $(top_builddir)/doc/html.tar + +$(html_DATA): $(top_builddir)/doc/html/index.html + cd $(top_builddir)/doc && tar cf html.tar html + +$(top_builddir)/doc/html/index.html: $(SOURCES) Doxyfile + @rm -rf doc + mkdir -p doc + $(DOXYGEN) Doxyfile + +install-data-hook: + cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar + +uninstall-hook: + rm -rf $(DESTDIR)$(htmldir) + +DX_CLEAN = doc/html/search/* doc/{html,latex}/* doc/html.tar doc/doxygen_sqlite3.db doc/*.tag + +endif + +MOSTLYCLEANFILES = $(DX_CLEAN) diff --git a/configure.ac b/configure.ac index ed761c3..5404acf 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,15 @@ CFLAGS="$CFLAGS -Wall" CPPFLAGS="$CPPFLAGS -Wall" +AC_ARG_ENABLE(doxygen, + [AS_HELP_STRING( + [--disable-doxygen], + [Disable generation of documentation using doxygen], + )], + [doxygen=$enableval], [doxygen="yes"]) +AC_PATH_PROG(DOXYGEN,doxygen,false) +AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") + AC_OUTPUT( libosmo-sigtran.pc libosmo-sccp.pc @@ -79,4 +88,5 @@ tests/ss7/Makefile examples/Makefile stp/Makefile + Doxyfile Makefile) diff --git a/debian/control b/debian/control index 60bef71..a59dede 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,7 @@ libtool, dh-autoreconf, git, + doxygen, libdpkg-perl, libosmo-netif-dev, libsctp-dev diff --git a/doc/examples/osmo-stp.cfg b/examples/osmo-stp.cfg similarity index 100% rename from doc/examples/osmo-stp.cfg rename to examples/osmo-stp.cfg -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:43:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 16 Oct 2017 13:43:31 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4234/2//COMMIT_MSG Commit Message: Line 18: same structure and simplifies further maintenance. what about the same structure across git repositories to keep examples in doc/examples? What's the intention / a reply to my earlier remarks? -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:44:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 16 Oct 2017 13:44:16 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 2: > What is the direction then, will we move all other repositories' doc/examples to examples/ to follow the same structure everywhere? No, only for repositories where: - we need to add doxygen docs - doc/examples are used - such move would not cause any complications (.deb packaging does not rely on it etc) I don't think this will be significant number and anyway we'll handle it on the case-by-case basis. > An alternative would be to not delete the entire doc/ but merely the doxygen generated files during make, right? An alternative would be to use different doxygen handling in Makefile.am in different libraries depending on the directory structure. And all that - just to preserve old location for a single file. I don't think it's worth it. -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 13:50:01 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 16 Oct 2017 13:50:01 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: > > > > I got an error about missing QEMU when running make check > > without > > > > our LC15 toolchain built from Yocto framework. > > > > > > I suspect you're still doing a cross-compile, i.e. the > > > './configure' was executed with the environment for your > > > cross-toolchain? > > > > > > > Any suggestion? > > > > > > If you do a native compile on your PC, rendering an x86/x68_64 > > > executable for osmo-pcu, make check should work for master. > This > > > is what all of us execute on our various development machines > > (all > > > flavors of Linux from Gentoo to Arch to Debian to Ubuntu), and > > > which is also what our jenkins.osmoocom.org is testing > > continuously > > > e.g. for verifying patch submissions. > > > > > > In case of doubt, feel free to open a redmine issue attaching > > your > > > config.log and "make check" output. Thanks! > > > > I found out an issue with patch set #2 using two successive > > bitvec_set_bit(dest, H ,2) calls making bit index increased by 4 > > bits which is not correct. > > In my original comments I had suggested to use two consecutive > "bitvec_set_bit(dest, H)" in order to append two "H" bits, not > to duplicate the "bitvec_write_field(dest, &wp, 3, 2);", which will > in fact append four bits (two times '2' bits), both of them '1' as > 3 = 11b. > > > I have also noticed that my MS is able to send packet control ack > > as 4 successive PRACH bursts without this patch using a clean > Yocto > > image built with up-to-date libraries. > > This is good to hear, but it could simply be coincidence. Whether > or > not H=1 or H=0 depends on the bit offset into the MAC block (due to > the 0x2B padding). > > I still think your patch has found an important bug in the encoding > that should be fixed. > > Did you validate the rest octet contents of the old code with an > independent > decoder like a TEMS Pocket phone or the like? Did you confirm the > current osmo-pcu code is performing correct encoding irrespective > of > the offset of the rest octets (depends on variable-length data > ahead > of the rest octets)? > > > Therefore, I would prefer to drop this patch. > > I would prefer to keep it, with the "bitvec_set_bit(dest, H)" as > suggested earlier. It should fix an encoding bug, let's not > abandon it unless we know for sure the old code is correct. > > Thanks again! Update: I did validate LH bit encoding using test phone. I discovered that H bit encoding in below section of write_ia_rest_downlink fucntion in encoding.cpp was wrong. This leads to MS does not send Control ACK as 4 PRACH when network initiates IMM ASS via BCCH. The MS is only able to decode correct information if I use bitvec_write_field_lh rather than bitvec_write_field for 'H' if (tbf->is_egprs_enabled()) { /* see GMS 44.018, 10.5.2.16 */ unsigned int ws_enc = (tbf->m_window.ws() - 64) / 32; bitvec_write_field(dest, &wp, 1, 1); // "H" bitvec_write_field(dest, &wp, ws_enc, 5); // EGPRS Window Size bitvec_write_field(dest, &wp, 0x0, 2); // LINK_QUALITY_MEASUREMENT_MODE bitvec_write_field(dest, &wp, 0, 1); // BEP_PERIOD2 not present } LH bits encoding in other functions using bitvec_write_field are fine because they are not affected by 0x2B masking of LH encoding. This could explain why the MS seems to work fine if I do not use control ack as 4 PRACH and performing DL IMM ASS via BCCH I wrote a small test program to encode IA octets in DL IMM ASS. Below result shows that the the last two bytes are encoded differently between bitvec_write_field and bitvec_write_field_lh. === start test_bitvec_ia_octet_encode_pkt_dl_ass === Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b === end test_bitvec_ia_octet_encode_pkt_dl_ass === === start test_bitvec_lh_ia_octet_encode_pkt_dl_ass === Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 20 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b === end test_bitvec_lh_ia_octet_encode_pkt_dl_ass === I prefer to use bitvec_write_field_lh rather than bitvec_write_field to encoding LH bit in order to avoid confusing in current working encoded LH bits and wrong encoded LH bits in write_ia_rest_downlink function. -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 14:01:29 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Oct 2017 14:01:29 +0000 Subject: osmo-bsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Patch Set 1: One is for openbsc, the other one is for osmo-bsc -- To view, visit https://gerrit.osmocom.org/4278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 15:52:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Oct 2017 15:52:42 +0000 Subject: [PATCH] osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4256 to look at the new patch set (#4). ippool: Implement and use blacklist instead of blindly using IPPOOL_NOGATEWAY Commit dda21ed7d4a897c9284c69175d0da598598eae40 modified previous calls to ippool_new() removing the pass of flags to avoid allocating certain problematic IPs from the pool to MS, such as the network, gateway and broadcast IPs. Today I did some unsucessful tests with osmo-ggsn with a pool "ip prefix dynamic 176.16.222.0/24", and thus IP 176.16.222.0 was being assigned to the MS. De-capsulated DNS packets were received in the tun interface, but the Linux system in there was unable to correctly forward the packets to the gateway interface connected to the Internet. However, adding a second MS which got 176.16.222.1 had its packets forwarded correctly. However, previous implementation relies on flag IPPOOL_NOGATEWAY flag to blindly blacklist first IP after the network ip (ie, .0 and .1 are removed), which limits the IP reserved for the tun device to be .1. If a different IP in the range is assigned, it may cause issues. As a result, a blacklist is introduced in this commit to dynamically fetch the tun IP address and exlucde it from the pool of available IPs. Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 --- M ggsn/ggsn.c M lib/ippool.c M lib/ippool.h M tests/lib/ippool_test.c M tests/lib/ippool_test.err M tests/lib/ippool_test.ok 6 files changed, 365 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/56/4256/4 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index ff760cf..54dd18e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -146,10 +146,50 @@ return 0; } + +static int alloc_ippool_blacklist(struct apn_ctx *apn, const struct tun_t *tun, struct in46_prefix **blacklist, bool ipv6) +{ + + int flags, len, len2, i; + + if (ipv6) + flags = IP_TYPE_IPv6_NONLINK; + else + flags = IP_TYPE_IPv4; + + while (1) { + len = tun_ip_local_get(apn->tun.tun, NULL, 0, flags); + if (len < 1) + return len; + + *blacklist = calloc(len, sizeof(struct in46_prefix)); + len2 = tun_ip_local_get(apn->tun.tun, *blacklist, len, flags); + if (len2 < 1) { + free(*blacklist); + return len2; + } + + if (len2 > len) /* iface was added between 2 calls, repeat operation */ + free(*blacklist); + else + break; + } + + for (i = 0; i < len2; i++) + LOGPAPN(LOGL_INFO, apn, "Blacklist tun IP %s\n", + in46p_ntoa(&(*blacklist)[i])); + + return len2; +} + /* actually start the APN with its current config */ int apn_start(struct apn_ctx *apn) { + int ippool_flags = IPPOOL_NONETWORK | IPPOOL_NOBROADCAST; struct in46_prefix ipv6_tun_linklocal_ip; + struct in46_prefix *blacklist; + int blacklist_size; + if (apn->started) return 0; @@ -231,24 +271,34 @@ if (apn->v4.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if ((blacklist_size = alloc_ippool_blacklist(apn, apn->tun.tun, &blacklist, false)) < 0) + LOGPAPN(LOGL_ERROR, apn, "Failed obtaining IPv4 tun IPs\n"); if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, - &apn->v4.cfg.static_prefix, 0)) { + &apn->v4.cfg.static_prefix, ippool_flags, + blacklist, blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); + free(blacklist); apn_stop(apn, false); return -1; } + free(blacklist); } /* Create IPv6 pool */ if (apn->v6.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if ((blacklist_size = alloc_ippool_blacklist(apn, apn->tun.tun, &blacklist, true)) < 0) + LOGPAPN(LOGL_ERROR, apn, "Failed obtaining IPv6 tun IPs\n"); if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, - &apn->v6.cfg.static_prefix, 0)) { + &apn->v6.cfg.static_prefix, ippool_flags, + blacklist, blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); + free(blacklist); apn_stop(apn, false); return -1; } + free(blacklist); } LOGPAPN(LOGL_NOTICE, apn, "Successfully started\n"); diff --git a/lib/ippool.c b/lib/ippool.c index 03323e2..55a41d0 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -184,9 +184,19 @@ } } +static bool addr_in_prefix_list(struct in46_addr *addr, struct in46_prefix *list, size_t list_size) +{ + int i; + for (i = 0; i < list_size; i++) { + if (in46a_prefix_equal(addr, &list[i].addr)) + return true; + } + return false; +} + /* Create new address pool */ int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, const struct in46_prefix *stat, - int flags) + int flags, struct in46_prefix *blacklist, size_t blacklist_size) { /* Parse only first instance of pool for now */ @@ -210,18 +220,16 @@ if (addr.len == sizeof(struct in6_addr)) addr.len = 64/8; - /* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */ - if (flags & IPPOOL_NOGATEWAY) { - flags |= IPPOOL_NONETWORK; - } - dynsize = (1 << (addr.len*8 - addrprefixlen)); if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; - if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ - dynsize--; if (flags & IPPOOL_NOBROADCAST) /* Exclude broadcast address from pool */ dynsize--; + /* Exclude included blacklist addresses from pool */ + for (i = 0; i < blacklist_size; i++) { + if (in46a_within_mask(&blacklist[i].addr, &addr, addrprefixlen)) + dynsize--; + } } if (!stat || stat->addr.len == 0) { @@ -278,13 +286,17 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; - if (flags & IPPOOL_NOGATEWAY) { - in46a_inc(&addr); - in46a_inc(&addr); - } else if (flags & IPPOOL_NONETWORK) { + if (flags & IPPOOL_NONETWORK) { in46a_inc(&addr); } for (i = 0; i < dynsize; i++) { + if (addr_in_prefix_list(&addr, blacklist, blacklist_size)) { + SYS_ERR(DIP, LOGL_DEBUG, 0, + "addr blacklisted from pool: %s", in46a_ntoa(&addr)); + in46a_inc(&addr); + i--; + continue; + } (*this)->member[i].addr = addr; in46a_inc(&addr); diff --git a/lib/ippool.h b/lib/ippool.h index 56beb4e..efb274b 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -31,7 +31,6 @@ #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 -#define IPPOOL_NOGATEWAY 0x04 #define IPPOOL_STATSIZE 0x10000 @@ -72,7 +71,8 @@ /* Create new address pool */ extern int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, - const struct in46_prefix *stat, int flags); + const struct in46_prefix *stat, int flags, + struct in46_prefix *blacklist, size_t blacklist_size); /* Delete existing address pool */ extern int ippool_free(struct ippool_t *this); diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index f38c1be..ea56edd 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -13,36 +13,47 @@ #include "../../lib/syserr.h" -static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags) +static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags, char **blacklist, size_t blacklist_size) { + struct in46_prefix *blacklist_pfx; struct ippool_t *pool; struct in46_prefix pfx; size_t t; int rc; + int i; + + blacklist_pfx = calloc(blacklist_size, sizeof(struct in46_prefix)); + for (i = 0; i < blacklist_size; i++) { + rc = ippool_aton(&blacklist_pfx[i].addr, &t, blacklist[i], 0); + OSMO_ASSERT(rc == 0); + pfx.prefixlen = t; + } /* dynamic-only v4 */ - rc = ippool_aton(&pfx.addr, &t, prefix_str, flags); + rc = ippool_aton(&pfx.addr, &t, prefix_str, 0); OSMO_ASSERT(rc == 0); pfx.prefixlen = t; - rc = ippool_new(&pool, &pfx, NULL, flags); + rc = ippool_new(&pool, &pfx, NULL, flags, blacklist_pfx, blacklist_size); OSMO_ASSERT(rc == 0); //ippool_printaddr(pool); + free(blacklist_pfx); + return pool; } -static void test_pool_size(const char *pfx, unsigned int flags, unsigned int expected_size) +static void test_pool_size(const char *pfx, unsigned int flags, char **blacklist, size_t blacklist_size, unsigned int expected_size) { struct ippool_t *pool; struct ippoolm_t *member; struct in46_addr addr; int i, rc, n; - printf("testing pool for prefix %s, flags=0x%x, expected_size=%u\n", pfx, flags, expected_size); - pool = create_pool(pfx, flags); + printf("testing pool for prefix %s, flags=0x%x, blacklist_size=%lu, expected_size=%u\n", pfx, flags, blacklist_size, expected_size); + pool = create_pool(pfx, flags, blacklist, blacklist_size); OSMO_ASSERT(pool->listsize == expected_size); memset(&addr, 0, sizeof(addr)); @@ -91,19 +102,23 @@ static void test_pool_sizes(void) { /* 256 addresses [0..255] */ - test_pool_size("192.168.23.0/24", 0, 256); + test_pool_size("192.168.23.0/24", 0, NULL, 0, 256); /* 255 addresses [1..255] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, 255); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, NULL, 0, 255); /* 254 addresses [1..254] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 254); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 254); /* 65534 addresses [0.1..255.254] */ - test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 65534); + test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 65534); /* 256 prefixes of /64 each */ - test_pool_size("2001:DB8::/56", 0, 256); + test_pool_size("2001:DB8::/56", 0, NULL, 0, 256); + + /* 253 addresses [1..254] & exclude 192.168.23.1/24 */ + char *blacklist[] = {"176.16.222.10/24", "192.168.23.1/24", "192.168.38.2/24"}; + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, blacklist, 3, 253); } int main(int argc, char **argv) diff --git a/tests/lib/ippool_test.err b/tests/lib/ippool_test.err index 7dc5371..b11c12a 100644 --- a/tests/lib/ippool_test.err +++ b/tests/lib/ippool_test.err @@ -8,3 +8,5 @@ No more IP addresses available No more IP addresses available No more IP addresses available +No more IP addresses available +No more IP addresses available diff --git a/tests/lib/ippool_test.ok b/tests/lib/ippool_test.ok index a0eeb4b..263494e 100644 --- a/tests/lib/ippool_test.ok +++ b/tests/lib/ippool_test.ok @@ -1,4 +1,4 @@ -testing pool for prefix 192.168.23.0/24, flags=0x0, expected_size=256 +testing pool for prefix 192.168.23.0/24, flags=0x0, blacklist_size=0, expected_size=256 allocated address 192.168.23.0 allocated address 192.168.23.1 allocated address 192.168.23.2 @@ -255,7 +255,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x1, expected_size=255 +testing pool for prefix 192.168.23.0/24, flags=0x1, blacklist_size=0, expected_size=255 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -511,7 +511,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x3, expected_size=254 +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=0, expected_size=254 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -766,7 +766,7 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.0.0/16, flags=0x3, expected_size=65534 +testing pool for prefix 192.168.0.0/16, flags=0x3, blacklist_size=0, expected_size=65534 allocated address 192.168.0.1 allocated address 192.168.0.2 allocated address 192.168.0.3 @@ -66301,7 +66301,7 @@ allocated address 192.168.255.252 allocated address 192.168.255.253 allocated address 192.168.255.254 -testing pool for prefix 2001:DB8::/56, flags=0x0, expected_size=256 +testing pool for prefix 2001:DB8::/56, flags=0x0, blacklist_size=0, expected_size=256 allocated address 2001:db8:: allocated address 2001:db8:0:1:: allocated address 2001:db8:0:2:: @@ -66558,3 +66558,257 @@ allocated address 2001:db8:0:fd:: allocated address 2001:db8:0:fe:: allocated address 2001:db8:0:ff:: +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=3, expected_size=253 +allocated address 192.168.23.2 +allocated address 192.168.23.3 +allocated address 192.168.23.4 +allocated address 192.168.23.5 +allocated address 192.168.23.6 +allocated address 192.168.23.7 +allocated address 192.168.23.8 +allocated address 192.168.23.9 +allocated address 192.168.23.10 +allocated address 192.168.23.11 +allocated address 192.168.23.12 +allocated address 192.168.23.13 +allocated address 192.168.23.14 +allocated address 192.168.23.15 +allocated address 192.168.23.16 +allocated address 192.168.23.17 +allocated address 192.168.23.18 +allocated address 192.168.23.19 +allocated address 192.168.23.20 +allocated address 192.168.23.21 +allocated address 192.168.23.22 +allocated address 192.168.23.23 +allocated address 192.168.23.24 +allocated address 192.168.23.25 +allocated address 192.168.23.26 +allocated address 192.168.23.27 +allocated address 192.168.23.28 +allocated address 192.168.23.29 +allocated address 192.168.23.30 +allocated address 192.168.23.31 +allocated address 192.168.23.32 +allocated address 192.168.23.33 +allocated address 192.168.23.34 +allocated address 192.168.23.35 +allocated address 192.168.23.36 +allocated address 192.168.23.37 +allocated address 192.168.23.38 +allocated address 192.168.23.39 +allocated address 192.168.23.40 +allocated address 192.168.23.41 +allocated address 192.168.23.42 +allocated address 192.168.23.43 +allocated address 192.168.23.44 +allocated address 192.168.23.45 +allocated address 192.168.23.46 +allocated address 192.168.23.47 +allocated address 192.168.23.48 +allocated address 192.168.23.49 +allocated address 192.168.23.50 +allocated address 192.168.23.51 +allocated address 192.168.23.52 +allocated address 192.168.23.53 +allocated address 192.168.23.54 +allocated address 192.168.23.55 +allocated address 192.168.23.56 +allocated address 192.168.23.57 +allocated address 192.168.23.58 +allocated address 192.168.23.59 +allocated address 192.168.23.60 +allocated address 192.168.23.61 +allocated address 192.168.23.62 +allocated address 192.168.23.63 +allocated address 192.168.23.64 +allocated address 192.168.23.65 +allocated address 192.168.23.66 +allocated address 192.168.23.67 +allocated address 192.168.23.68 +allocated address 192.168.23.69 +allocated address 192.168.23.70 +allocated address 192.168.23.71 +allocated address 192.168.23.72 +allocated address 192.168.23.73 +allocated address 192.168.23.74 +allocated address 192.168.23.75 +allocated address 192.168.23.76 +allocated address 192.168.23.77 +allocated address 192.168.23.78 +allocated address 192.168.23.79 +allocated address 192.168.23.80 +allocated address 192.168.23.81 +allocated address 192.168.23.82 +allocated address 192.168.23.83 +allocated address 192.168.23.84 +allocated address 192.168.23.85 +allocated address 192.168.23.86 +allocated address 192.168.23.87 +allocated address 192.168.23.88 +allocated address 192.168.23.89 +allocated address 192.168.23.90 +allocated address 192.168.23.91 +allocated address 192.168.23.92 +allocated address 192.168.23.93 +allocated address 192.168.23.94 +allocated address 192.168.23.95 +allocated address 192.168.23.96 +allocated address 192.168.23.97 +allocated address 192.168.23.98 +allocated address 192.168.23.99 +allocated address 192.168.23.100 +allocated address 192.168.23.101 +allocated address 192.168.23.102 +allocated address 192.168.23.103 +allocated address 192.168.23.104 +allocated address 192.168.23.105 +allocated address 192.168.23.106 +allocated address 192.168.23.107 +allocated address 192.168.23.108 +allocated address 192.168.23.109 +allocated address 192.168.23.110 +allocated address 192.168.23.111 +allocated address 192.168.23.112 +allocated address 192.168.23.113 +allocated address 192.168.23.114 +allocated address 192.168.23.115 +allocated address 192.168.23.116 +allocated address 192.168.23.117 +allocated address 192.168.23.118 +allocated address 192.168.23.119 +allocated address 192.168.23.120 +allocated address 192.168.23.121 +allocated address 192.168.23.122 +allocated address 192.168.23.123 +allocated address 192.168.23.124 +allocated address 192.168.23.125 +allocated address 192.168.23.126 +allocated address 192.168.23.127 +allocated address 192.168.23.128 +allocated address 192.168.23.129 +allocated address 192.168.23.130 +allocated address 192.168.23.131 +allocated address 192.168.23.132 +allocated address 192.168.23.133 +allocated address 192.168.23.134 +allocated address 192.168.23.135 +allocated address 192.168.23.136 +allocated address 192.168.23.137 +allocated address 192.168.23.138 +allocated address 192.168.23.139 +allocated address 192.168.23.140 +allocated address 192.168.23.141 +allocated address 192.168.23.142 +allocated address 192.168.23.143 +allocated address 192.168.23.144 +allocated address 192.168.23.145 +allocated address 192.168.23.146 +allocated address 192.168.23.147 +allocated address 192.168.23.148 +allocated address 192.168.23.149 +allocated address 192.168.23.150 +allocated address 192.168.23.151 +allocated address 192.168.23.152 +allocated address 192.168.23.153 +allocated address 192.168.23.154 +allocated address 192.168.23.155 +allocated address 192.168.23.156 +allocated address 192.168.23.157 +allocated address 192.168.23.158 +allocated address 192.168.23.159 +allocated address 192.168.23.160 +allocated address 192.168.23.161 +allocated address 192.168.23.162 +allocated address 192.168.23.163 +allocated address 192.168.23.164 +allocated address 192.168.23.165 +allocated address 192.168.23.166 +allocated address 192.168.23.167 +allocated address 192.168.23.168 +allocated address 192.168.23.169 +allocated address 192.168.23.170 +allocated address 192.168.23.171 +allocated address 192.168.23.172 +allocated address 192.168.23.173 +allocated address 192.168.23.174 +allocated address 192.168.23.175 +allocated address 192.168.23.176 +allocated address 192.168.23.177 +allocated address 192.168.23.178 +allocated address 192.168.23.179 +allocated address 192.168.23.180 +allocated address 192.168.23.181 +allocated address 192.168.23.182 +allocated address 192.168.23.183 +allocated address 192.168.23.184 +allocated address 192.168.23.185 +allocated address 192.168.23.186 +allocated address 192.168.23.187 +allocated address 192.168.23.188 +allocated address 192.168.23.189 +allocated address 192.168.23.190 +allocated address 192.168.23.191 +allocated address 192.168.23.192 +allocated address 192.168.23.193 +allocated address 192.168.23.194 +allocated address 192.168.23.195 +allocated address 192.168.23.196 +allocated address 192.168.23.197 +allocated address 192.168.23.198 +allocated address 192.168.23.199 +allocated address 192.168.23.200 +allocated address 192.168.23.201 +allocated address 192.168.23.202 +allocated address 192.168.23.203 +allocated address 192.168.23.204 +allocated address 192.168.23.205 +allocated address 192.168.23.206 +allocated address 192.168.23.207 +allocated address 192.168.23.208 +allocated address 192.168.23.209 +allocated address 192.168.23.210 +allocated address 192.168.23.211 +allocated address 192.168.23.212 +allocated address 192.168.23.213 +allocated address 192.168.23.214 +allocated address 192.168.23.215 +allocated address 192.168.23.216 +allocated address 192.168.23.217 +allocated address 192.168.23.218 +allocated address 192.168.23.219 +allocated address 192.168.23.220 +allocated address 192.168.23.221 +allocated address 192.168.23.222 +allocated address 192.168.23.223 +allocated address 192.168.23.224 +allocated address 192.168.23.225 +allocated address 192.168.23.226 +allocated address 192.168.23.227 +allocated address 192.168.23.228 +allocated address 192.168.23.229 +allocated address 192.168.23.230 +allocated address 192.168.23.231 +allocated address 192.168.23.232 +allocated address 192.168.23.233 +allocated address 192.168.23.234 +allocated address 192.168.23.235 +allocated address 192.168.23.236 +allocated address 192.168.23.237 +allocated address 192.168.23.238 +allocated address 192.168.23.239 +allocated address 192.168.23.240 +allocated address 192.168.23.241 +allocated address 192.168.23.242 +allocated address 192.168.23.243 +allocated address 192.168.23.244 +allocated address 192.168.23.245 +allocated address 192.168.23.246 +allocated address 192.168.23.247 +allocated address 192.168.23.248 +allocated address 192.168.23.249 +allocated address 192.168.23.250 +allocated address 192.168.23.251 +allocated address 192.168.23.252 +allocated address 192.168.23.253 +allocated address 192.168.23.254 -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 15:52:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Oct 2017 15:52:42 +0000 Subject: [PATCH] osmo-ggsn[master]: lib/in46a: Introduce in46a_netmasklen API In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4290 to look at the new patch set (#2). lib/in46a: Introduce in46a_netmasklen API Change-Id: I06e3e038afd8f7afaec2a3fa67b1616500c8db80 --- M lib/in46_addr.c M lib/in46_addr.h M tests/lib/in46a_test.c M tests/lib/in46a_test.ok 4 files changed, 120 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/90/4290/2 diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 32e0f8d..36ad6af 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -195,6 +195,64 @@ } } +static unsigned int ipv4_netmasklen(const struct in_addr *netmask) +{ + uint32_t bits = netmask->s_addr; + uint8_t *b = (uint8_t*) &bits; + unsigned int i, prefix = 0; + + for (i = 0; i < 4; i++) { + while (b[i] & 0x80) { + prefix++; + b[i] = b[i] << 1; + } + } + return prefix; +} + +static unsigned int ipv6_netmasklen(const struct in6_addr *netmask) +{ + #if defined(__linux__) + #define ADDRFIELD(i) s6_addr32[i] + #else + #define ADDRFIELD(i) __u6_addr.__u6_addr32[i] + #endif + + unsigned int i, j, prefix = 0; + + for (j = 0; j < 4; j++) { + uint32_t bits = netmask->ADDRFIELD(j); + uint8_t *b = (uint8_t*) &bits; + for (i = 0; i < 4; i++) { + while (b[i] & 0x80) { + prefix++; + b[i] = b[i] << 1; + } + } + } + + #undef ADDRFIELD + + return prefix; +} + +/*! Convert netmask to prefix length representation + * \param[in] netmask in46_addr containing a netmask (consecutive list of 1-bit followed by consecutive list of 0-bit) + * \returns prefix length representation of the netmask (count of 1-bit from the start of the netmask) + */ +unsigned int in46a_netmasklen(const struct in46_addr *netmask) +{ + switch (netmask->len) { + case 4: + return ipv4_netmasklen(&netmask->v4); + case 16: + return ipv6_netmasklen(&netmask->v6); + default: + OSMO_ASSERT(0); + return 0; + } +} + /*! Convert given PDP End User Address to in46_addr * \returns 0 on success; negative on error */ int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua) diff --git a/lib/in46_addr.h b/lib/in46_addr.h index ce2df14..ff26521 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -27,6 +27,7 @@ extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); +unsigned int in46a_netmasklen(const struct in46_addr *netmask); int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua); int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst); diff --git a/tests/lib/in46a_test.c b/tests/lib/in46a_test.c index d6215e7..42a1768 100644 --- a/tests/lib/in46a_test.c +++ b/tests/lib/in46a_test.c @@ -246,6 +246,64 @@ OSMO_ASSERT(!memcmp(&ia.v6, v6_spec+2, ia.len)); } +static void test_in46a_netmasklen(void) +{ + struct in46_addr netmask; + unsigned int len; + + printf("Testing in46a_netmasklen() with IPv4 addresses\n"); + netmask.len = 4; + + netmask.v4.s_addr = 0xffffffff; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 32); + + netmask.v4.s_addr = 0x00ffffff; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 24); + + netmask.v4.s_addr = 0x00f0ffff; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 20); + + netmask.v4.s_addr = 0x000000fe; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 7); + + netmask.v4.s_addr = 0x00000000; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 0); + + printf("Testing in46a_netmasklen() with IPv6 addresses\n"); + const struct in46_addr netmaskA = { + .len = 16, + .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}, + }; + len = in46a_netmasklen(&netmaskA); + OSMO_ASSERT(len == 128); + + const struct in46_addr netmaskB = { + .len = 16, + .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00}, + }; + len = in46a_netmasklen(&netmaskB); + OSMO_ASSERT(len == 104); + + const struct in46_addr netmaskC = { + .len = 16, + .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00}, + }; + len = in46a_netmasklen(&netmaskC); + OSMO_ASSERT(len == 103); + + const struct in46_addr netmaskD = { + .len = 16, + .v6.s6_addr = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + }; + len = in46a_netmasklen(&netmaskD); + OSMO_ASSERT(len == 0); +} + int main(int argc, char **argv) { osmo_init_logging(&log_info); @@ -262,4 +320,5 @@ test_in46a_within_mask(); test_in46a_to_eua(); test_in46a_from_eua(); + test_in46a_netmasklen(); } diff --git a/tests/lib/in46a_test.ok b/tests/lib/in46a_test.ok index b115444..9a0ff7a 100644 --- a/tests/lib/in46a_test.ok +++ b/tests/lib/in46a_test.ok @@ -15,3 +15,5 @@ in46a_within_mask(10.11.12.14, 10.11.12.12, 30) = 1 testing in46a_to_eua() Testing in46a_from_eua() +Testing in46a_netmasklen() with IPv4 addresses +Testing in46a_netmasklen() with IPv6 addresses -- To view, visit https://gerrit.osmocom.org/4290 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I06e3e038afd8f7afaec2a3fa67b1616500c8db80 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 15:52:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Oct 2017 15:52:42 +0000 Subject: [PATCH] osmo-ggsn[master]: tun: Convert tun_ipv6_linklocal_get to be more generic In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4291 to look at the new patch set (#2). tun: Convert tun_ipv6_linklocal_get to be more generic Add support for IPv4 and IPv6 global IPs. Also return the prefix length of the IP address by using a in46_prefix. Change-Id: I277af191dc611b6bbcb83479f4ae338083740322 --- M ggsn/ggsn.c M lib/tun.c M lib/tun.h 3 files changed, 67 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/91/4291/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 29d8473..ff760cf 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -149,6 +149,7 @@ /* actually start the APN with its current config */ int apn_start(struct apn_ctx *apn) { + struct in46_prefix ipv6_tun_linklocal_ip; if (apn->started) return 0; @@ -201,12 +202,13 @@ } if (apn->cfg.apn_type_mask & (APN_TYPE_IPv6|APN_TYPE_IPv4v6)) { - if (tun_ipv6_linklocal_get(apn->tun.tun, &apn->v6_lladdr) < 0) { + if (tun_ip_local_get(apn->tun.tun, &ipv6_tun_linklocal_ip, 1, IP_TYPE_IPv6_LINK) < 1) { LOGPAPN(LOGL_ERROR, apn, "Cannot obtain IPv6 link-local address of " "interface: %s\n", strerror(errno)); apn_stop(apn, false); return -1; } + apn->v6_lladdr = ipv6_tun_linklocal_ip.addr.v6; } /* set back-pointer from TUN device to APN */ diff --git a/lib/tun.c b/lib/tun.c index 7662146..6bcc13b 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -751,34 +751,73 @@ #include -/* obtain the link-local address of the tun device */ -int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia) +/*! Obtain the local address of the tun device. + * \param[in] tun Target device owning the IP + * \param[out] prefix_list List of prefix structures to fill with each IPv4/6 and prefix length found. + * \param[in] prefix_size Amount of elements allowed to be fill in the prefix_list array. + * \param[in] flags Specify which kind of IP to look for: IP_TYPE_IPv4, IP_TYPE_IPv6_LINK, IP_TYPE_IPv6_NONLINK + * \returns The number of ips found following the criteria specified by flags, -1 on error. + * + * This function will fill prefix_list with up to prefix_size IPs following the + * criteria specified by flags parameter. It returns the number of IPs matching + * the criteria. As a result, the number returned can be bigger than + * prefix_size. It can be used with prefix_size=0 to get an estimate of the size + * needed for prefix_list. + */ +int tun_ip_local_get(const struct tun_t *tun, struct in46_prefix *prefix_list, size_t prefix_size, int flags) { - struct ifaddrs *ifaddr, *ifa; static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; + struct ifaddrs *ifaddr, *ifa; + struct in46_addr netmask; + size_t count = 0; + bool is_ipv6_ll; if (getifaddrs(&ifaddr) == -1) { return -1; } for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; if (ifa->ifa_addr == NULL) - continue; - - if (ifa->ifa_addr->sa_family != AF_INET6) continue; if (strcmp(ifa->ifa_name, tun->devname)) continue; - if (memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix))) - continue; + if (ifa->ifa_addr->sa_family == AF_INET && (flags & IP_TYPE_IPv4)) { + struct sockaddr_in *sin4 = (struct sockaddr_in *) ifa->ifa_addr; + struct sockaddr_in *netmask4 = (struct sockaddr_in *) ifa->ifa_netmask; - *ia = sin6->sin6_addr; - freeifaddrs(ifaddr); - return 0; + if (count < prefix_size) { + netmask.len = sizeof(netmask4->sin_addr); + netmask.v4 = netmask4->sin_addr; + prefix_list[count].addr.len = sizeof(sin4->sin_addr); + prefix_list[count].addr.v4 = sin4->sin_addr; + prefix_list[count].prefixlen = in46a_netmasklen(&netmask); + } + count++; + } + + if (ifa->ifa_addr->sa_family == AF_INET6 && (flags & IP_TYPE_IPv6)) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; + struct sockaddr_in6 *netmask6 = (struct sockaddr_in6 *) ifa->ifa_netmask; + + is_ipv6_ll = !memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix)); + if ((flags & IP_TYPE_IPv6_NONLINK) && is_ipv6_ll) + continue; + if ((flags & IP_TYPE_IPv6_LINK) && !is_ipv6_ll) + continue; + + if (count < prefix_size) { + netmask.len = sizeof(netmask6->sin6_addr); + netmask.v6 = netmask6->sin6_addr; + prefix_list[count].addr.len = sizeof(sin6->sin6_addr); + prefix_list[count].addr.v6 = sin6->sin6_addr; + prefix_list[count].prefixlen = in46a_netmasklen(&netmask); + } + count++; + } } + freeifaddrs(ifaddr); - return -1; + return count; } diff --git a/lib/tun.h b/lib/tun.h index f63be50..0b960e5 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -23,6 +23,16 @@ #define TUN_NLBUFSIZE 1024 #include "config.h" + +/* ipv6 ip type flags for tun_ipv6_local_get() */ +enum { + IP_TYPE_IPv4 = 1, + IP_TYPE_IPv6_LINK = 2, + IP_TYPE_IPv6_NONLINK = 4, +}; +#define IP_TYPE_IPv6 (IP_TYPE_IPv6_LINK | IP_TYPE_IPv6_NONLINK) + + #ifndef HAVE_IPHDR struct iphdr { @@ -85,6 +95,7 @@ extern int tun_runscript(struct tun_t *tun, char *script); -int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia); +int tun_ip_local_get(const struct tun_t *tun, struct in46_prefix *prefix_list, + size_t prefix_size, int flags); #endif /* !_TUN_H */ -- To view, visit https://gerrit.osmocom.org/4291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I277af191dc611b6bbcb83479f4ae338083740322 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 16:15:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 16 Oct 2017 16:15:37 +0000 Subject: [PATCH] libosmocore[master]: Expand bitvec_write_field() function Message-ID: Review at https://gerrit.osmocom.org/4292 Expand bitvec_write_field() function Previously only boolean values were allowed while in practice it's sometimes necessary to use L/H. Allow user to specify this explicitly and make old function into wrapper around extended version. Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Related: OS#1526 --- M include/osmocom/core/bitvec.h M src/bitvec.c 2 files changed, 26 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/4292/1 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index d4c7d68..f31eb96 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -70,6 +70,8 @@ unsigned int bitvec_unpack(struct bitvec *bv, const uint8_t *buffer); uint64_t bitvec_read_field(struct bitvec *bv, unsigned int *read_index, unsigned int len); int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len); +int bitvec_write_field_ext(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len, + bool use_boolean); int bitvec_fill(struct bitvec *bv, unsigned int num_bits, enum bit_value fill); char bit_value_to_char(enum bit_value v); void bitvec_to_string_r(const struct bitvec *bv, char *str); diff --git a/src/bitvec.c b/src/bitvec.c index f07b42c..20aa31b 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -483,23 +483,43 @@ /*! write into the vector * \param[in] bv The boolean vector to work on * \param[in,out] write_index Where writing supposed to start in the vector + * \param[in] val value to be written to the vector * \param[in] len How many bits to write * \returns next write index or negative value on error */ int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) { + return bitvec_write_field_ext(bv, write_index, val, len, true); +} + +/*! write L/H value into the vector + * \param[in] bv The boolean vector to work on + * \param[in,out] write_index Where writing supposed to start in the vector + * \param[in] val value to be written to the vector + * \param[in] len How many bits to write + * \param[in] use_boolean write val as 0/1 if set, as L/H otherwise + * \returns 0 in case of success or negative value on error + */ +int bitvec_write_field_ext(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len, + bool use_boolean) +{ unsigned int i; - int rc; + bv->cur_bit = *write_index; + for (i = 0; i < len; i++) { - int bit = 0; + int rc; if (val & ((uint64_t)1 << (len - i - 1))) - bit = 1; - rc = bitvec_set_bit(bv, bit); + rc = bitvec_set_bit(bv, use_boolean ? 1 : H); + else + rc = bitvec_set_bit(bv, use_boolean ? 0 : L); + if (rc) return rc; } + *write_index += len; + return 0; } -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 16 16:17:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 16 Oct 2017 16:17:42 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: > I wrote a small test program to encode IA octets in DL IMM ASS Sounds like a good candidate for bitvec_write_field() test which we don't have yet. Could you please share it? -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 17:51:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Oct 2017 17:51:12 +0000 Subject: openbsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Patch Set 1: > Do you conceptually understand when this can happen? If yes, > please add the rationale to the commit log message I'm not entirely sure as it's difficult to say only from the bt crash and I don't have deep knowledge about the protocol, but my bet is that it can happen if: 1- gsm0808_assign_req() calls handle_new_assignment() which sends an CHAN ACTIVATE msg and arms T10 timer. 2- ACTIVATE ACK is received (handle_chan_ack), which calls gsm48_send_rr_ass_cmd() which sends an ASSIGNMENT CMD, and doesn't disable/modify T10 timer. 3- T10 timeout is triggered (assignment_t10_timeout()), which sets conn->secondary_lchan = NULL 4- Immediately after, the ASSIGNMENT FAILURE message (which might have been already queued) is processed in handle_ass_fail, and then the crash occurs. This race condition is not an issue for handle_ass_compl() path because there's this check there which would trigger most probably if secondary_lchan is NULL: "if (conn->secondary_lchan != msg->lchan)" If it makes sense for you too then I can add this description to the commit and submit it. -- To view, visit https://gerrit.osmocom.org/4277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied5bd90b9c06f27135a2e3c46e40d49d27d9a387 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 18:53:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 16 Oct 2017 18:53:43 +0000 Subject: osmo-hlr[master]: implement subscriber vty interface, tests In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4273/2/src/hlr_vty_subscr.c File src/hlr_vty_subscr.c: Line 34: #define osmo_hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) should rather not be named osmo_ ... maybe add to libosmocore? also going to be used in osmo-hlr's ctrl.c -- To view, visit https://gerrit.osmocom.org/4273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 16 19:21:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 19:21:01 +0000 Subject: python/osmo-python-tests[master]: add osmo_ipa.py, from originally openbsc.git/contrib/ipa.py In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaef955f04b97e8f266339b37b46d2523d1247cb9 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 19:21:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 19:21:17 +0000 Subject: python/osmo-python-tests[master]: add osmo_verify_transcript_{vty, ctrl}.py for easier vty and ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:07 +0000 Subject: [PATCH] libosmocore[master]: [doc] Don't add libosmovty bits to libosmocore groups Message-ID: Review at https://gerrit.osmocom.org/4293 [doc] Don't add libosmovty bits to libosmocore groups Let's not put files of libosmovty into Doxygen groups of libosmocore, as this seems to confuse Doxygen. Also, some minor updates/fixes of libosmovty documentation. Change-Id: I70e612b8d06aabefe634fcd7861641ffb941d974 --- M src/vty/fsm_vty.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/telnet_interface.c 4 files changed, 29 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/4293/1 diff --git a/src/vty/fsm_vty.c b/src/vty/fsm_vty.c index 345be66..50c7fd5 100644 --- a/src/vty/fsm_vty.c +++ b/src/vty/fsm_vty.c @@ -1,5 +1,3 @@ -/*! \file fsm_vty.c - * Osmocom FSM introspection via VTY. */ /* * (C) 2016 by Harald Welte * All Rights Reserved @@ -35,9 +33,8 @@ #include #include -/*! \addtogroup fsm - * @{ - * VTY interface for Osmocom FSM +/*! \file fsm_vty.c + * Osmocom FSM introspection via VTY. * * This is code implementing generic VTY access to Osmocom FSMs from * libosmocore. This means that any application can expose all state @@ -187,5 +184,3 @@ install_element_ve(&show_fsm_inst_cmd); install_element_ve(&show_fsm_insts_cmd); } - -/*! @} */ diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 0ab7686..9b7d10a 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -1,5 +1,3 @@ -/*! \file logging_vty.c - * OpenBSC logging helper for the VTY. */ /* * (C) 2009-2010 by Harald Welte * (C) 2009-2014 by Holger Hans Peter Freyther @@ -41,14 +39,21 @@ #define LOG_STR "Configure logging sub-system\n" -/*! \addtogroup logging - * @{ +/*! \file logging_vty.c * Configuration of logging from VTY * - * This module implements functions that permit configuration of - * the libosmocore logging framework from VTY commands. This applies - * both to logging to the VTY (telnet sessions), as well as logging to - * other targets, such as sysslog, file, gsmtap, ... + * This module implements + * - functions that permit configuration of the libosmocore logging + * framework from VTY commands in the configure -> logging node. + * + * - functions that permit logging *to* a VTY session. Basically each + * VTY session gets its own log target, with configurable + * per-subsystem log levels. This is performed internally via the + * \ref log_target_create_vty function. + * + * You have to call \ref logging_vty_add_cmds from your application + * once to enable both of the above. + * */ extern const struct log_info *osmo_log_info; @@ -756,6 +761,8 @@ return 1; } +/*! Register logging related commands to the VTY. Call this once from + * your application if you want to support those commands. */ void logging_vty_add_cmds() { install_element_ve(&enable_logging_cmd); @@ -796,5 +803,3 @@ #endif install_element(CONFIG_NODE, &cfg_log_gsmtap_cmd); } - -/* @} */ diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 95f04bc..2ccbf66 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -1,5 +1,3 @@ -/*! \file stats_vty.c - * OpenBSC stats helper for the VTY. */ /* * (C) 2009-2010 by Harald Welte * (C) 2009-2014 by Holger Hans Peter Freyther @@ -43,9 +41,14 @@ #define SHOW_STATS_STR "Show statistical values\n" -/*! \addtogroup stats - * @{ +/*! \file stats_vty.c * VTY interface for statsd / statistic items + * + * This code allows you to register a couple of VTY commands that + * permit configuration of the \ref stats functionality from the VTY. + * + * Use \ref osmo_stats_vty_add_cmds once at application start-up to + * enable related commands. */ /* containing version info */ @@ -609,5 +612,3 @@ install_element_ve(&show_stats_asciidoc_table_cmd); } - -/*! @} */ diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index f82a7ff..40154fe 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -1,5 +1,3 @@ -/*! \file telnet_interface.c - * minimalistic telnet/network interface it might turn into a wire interface */ /* (C) 2009 by Holger Hans Peter Freyther * All Rights Reserved * @@ -37,8 +35,7 @@ #include #include -/*! \addtogroup telnet_interface - * @{ +/*! \file telnet_interface.c * Telnet interface towards Osmocom VTY * * This module contains the code implementing a telnet server for VTY @@ -46,7 +43,9 @@ * process in order to enable interactive command-line introspection, * interaction and configuration. * - * \file telnet_interface.c */ + * You typically call \ref telnet_init or \ref telnet_init_dynif once + * from your application code to enable this. + */ /* per connection data */ LLIST_HEAD(active_connections); @@ -219,6 +218,7 @@ } } +/*! Close all telnet connections and release the telnet socket */ void telnet_exit(void) { struct telnet_connection *tc, *tc2; @@ -230,5 +230,3 @@ close(server_socket.fd); talloc_free(tall_telnet_ctx); } - -/*! @} */ -- To view, visit https://gerrit.osmocom.org/4293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I70e612b8d06aabefe634fcd7861641ffb941d974 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:16 +0000 Subject: [PATCH] libosmocore[master]: [doc] Rename "RSL" to "A-bis RSL" in documentation. Message-ID: Review at https://gerrit.osmocom.org/4294 [doc] Rename "RSL" to "A-bis RSL" in documentation. We also have "A-bis OML" and it's a bit odd to have one with prefix and the other without. Change-Id: Ida325f8a9c40b40c1aeaa4edfd1123ced7cc92b8 --- M include/osmocom/gsm/rsl.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/94/4294/1 diff --git a/include/osmocom/gsm/rsl.h b/include/osmocom/gsm/rsl.h index 3d9c66f..be0fa79 100644 --- a/include/osmocom/gsm/rsl.h +++ b/include/osmocom/gsm/rsl.h @@ -5,7 +5,7 @@ #include #include -/*! \defgroup rsl RSL +/*! \defgroup rsl A-bis RSL * @{ * \file rsl.h */ -- To view, visit https://gerrit.osmocom.org/4294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida325f8a9c40b40c1aeaa4edfd1123ced7cc92b8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:16 +0000 Subject: [PATCH] libosmocore[master]: [doc] TLV parser has far grown beyond GSM L3 Message-ID: Review at https://gerrit.osmocom.org/4295 [doc] TLV parser has far grown beyond GSM L3 Let's hence not call the group "GSM L3 compatible TLV parser" Change-Id: Ic53f9c0d5ee787f994f42cf2aff313c6e131fbe6 --- M include/osmocom/gsm/tlv.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/95/4295/1 diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h index f903223..5bf4a87 100644 --- a/include/osmocom/gsm/tlv.h +++ b/include/osmocom/gsm/tlv.h @@ -7,7 +7,7 @@ #include #include -/*! \defgroup tlv GSM L3 compatible TLV parser +/*! \defgroup tlv TLV parser * @{ * \file tlv.h */ -- To view, visit https://gerrit.osmocom.org/4295 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic53f9c0d5ee787f994f42cf2aff313c6e131fbe6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:17 +0000 Subject: [PATCH] libosmocore[master]: [doc] Ensure include/crypt/* is part of libosmogsm documenta... Message-ID: Review at https://gerrit.osmocom.org/4296 [doc] Ensure include/crypt/* is part of libosmogsm documentation Change-Id: Ic41f807dabb3b0d2d20b9d8963cad639e98f04dd --- M Doxyfile.gsm.in 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/96/4296/1 diff --git a/Doxyfile.gsm.in b/Doxyfile.gsm.in index 896765e..27d14cc 100644 --- a/Doxyfile.gsm.in +++ b/Doxyfile.gsm.in @@ -610,7 +610,7 @@ # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = @srcdir@/include/osmocom/gsm @srcdir@/src/gsm +INPUT = @srcdir@/include/osmocom/gsm @srcdir@/include/osmocom/crypt @srcdir@/src/gsm # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -- To view, visit https://gerrit.osmocom.org/4296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic41f807dabb3b0d2d20b9d8963cad639e98f04dd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:17 +0000 Subject: [PATCH] libosmocore[master]: [doc] Ensure stats.h is parsed properly for Doxygen Message-ID: Review at https://gerrit.osmocom.org/4297 [doc] Ensure stats.h is parsed properly for Doxygen stats.h uses a rather crude '#ifdef unix' hack, which means that Doxygen will not scan the body of the file. This patch ensures 'unix' is defined to parse the stats.h body and thus have all relevant information in it is parsed. Change-Id: I65384e5cc01f2ad7783cf6b71ab78b4422902aa1 --- M Doxyfile.core.in 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/4297/1 diff --git a/Doxyfile.core.in b/Doxyfile.core.in index c47ff3c..7a3cce5 100644 --- a/Doxyfile.core.in +++ b/Doxyfile.core.in @@ -1447,7 +1447,7 @@ # undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = +PREDEFINED = "unix=1" # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. -- To view, visit https://gerrit.osmocom.org/4297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I65384e5cc01f2ad7783cf6b71ab78b4422902aa1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:17 +0000 Subject: [PATCH] libosmocore[master]: [doc] Provide proper name for 'auth' group Message-ID: Review at https://gerrit.osmocom.org/4298 [doc] Provide proper name for 'auth' group Change-Id: I5fb1c34475ea9db36c2ec5cddc988074a72a35f7 --- M include/osmocom/crypt/auth.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/98/4298/1 diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 1b017c0..4dbc6a4 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -1,6 +1,6 @@ #pragma once -/*! \addtogroup auth +/*! \defgroup auth GSM/GPRS/3G Authentication * @{ * \file auth.h */ -- To view, visit https://gerrit.osmocom.org/4298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fb1c34475ea9db36c2ec5cddc988074a72a35f7 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:17 +0000 Subject: [PATCH] libosmocore[master]: [doc] gea has separate group; A5 is not part of crypto but a... Message-ID: Review at https://gerrit.osmocom.org/4299 [doc] gea has separate group; A5 is not part of crypto but a5 group Change-Id: I2fd24c86f9b52244073ec800a3287e3d38e660d9 --- M include/osmocom/gsm/a5.h M include/osmocom/gsm/gea.h M src/gsm/a5.c M src/gsm/gea.c 4 files changed, 18 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/99/4299/1 diff --git a/include/osmocom/gsm/a5.h b/include/osmocom/gsm/a5.h index fae3fdd..fa63246 100644 --- a/include/osmocom/gsm/a5.h +++ b/include/osmocom/gsm/a5.h @@ -1,5 +1,3 @@ -/*! \file gsm/a5.h - * Osmocom GSM A5 ciphering algorithm header. */ /* * Copyright (C) 2011 Sylvain Munaut * diff --git a/include/osmocom/gsm/gea.h b/include/osmocom/gsm/gea.h index 5c23d2a..fff9baa 100644 --- a/include/osmocom/gsm/gea.h +++ b/include/osmocom/gsm/gea.h @@ -1,5 +1,8 @@ -/*! \file gea.h - * GEA3 header. +/*! \defgroup gea GPRS GEA3/GEA4 ciphering algorithm + * @{ + * \file gea.h + * + * GEA3/GEA4 header. * * See gea.c for details */ @@ -15,3 +18,5 @@ int gea4(uint8_t *out, uint16_t len, uint8_t *kc, uint32_t iv, enum gprs_cipher_direction direct); + +/*! @} */ diff --git a/src/gsm/a5.c b/src/gsm/a5.c index e906b6d..ea09e17 100644 --- a/src/gsm/a5.c +++ b/src/gsm/a5.c @@ -1,10 +1,3 @@ -/*! \file a5.c - * Full reimplementation of A5/1,2 (split and threadsafe). - * - * The logic behind the algorithm is taken from "A pedagogical implementation - * of the GSM A5/1 and A5/2 "voice privacy" encryption algorithms." by - * Marc Briceno, Ian Goldberg, and David Wagner. - */ /* * Copyright (C) 2011 Sylvain Munaut * @@ -25,11 +18,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/*! \addtogroup crypto +/*! \addtogroup a5 * @{ - * Osmocom GSM/GPRS ciphering algorithm implementation + * Osmocom GSM ciphering algorithm implementation * - * \file gsm/a5.c */ + * Full reimplementation of A5/1,2,3,4 (split and threadsafe). + * + * The logic behind the algorithm is taken from "A pedagogical implementation + * of the GSM A5/1 and A5/2 "voice privacy" encryption algorithms." by + * Marc Briceno, Ian Goldberg, and David Wagner. + */ #include #include diff --git a/src/gsm/gea.c b/src/gsm/gea.c index d95c03e..70f08ad 100644 --- a/src/gsm/gea.c +++ b/src/gsm/gea.c @@ -1,5 +1,3 @@ -/*! \file gea.c - * Implementation of GEA3 and GEA4. */ /* * Copyright (C) 2016 by Sysmocom s.f.m.c. GmbH * @@ -28,9 +26,10 @@ #include #include -/*! \addtogroup crypto +/*! \addtogroup gea * @{ - * \file gsm/gea.c */ + * Implementation of GPRS Ciphers GEA3 and GEA4. + * \file gea.c */ /*! Performs the GEA4 algorithm as in 3GPP TS 55.226 V9.0.0 * \param[in,out] out Buffer for gamma for encrypted/decrypted -- To view, visit https://gerrit.osmocom.org/4299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2fd24c86f9b52244073ec800a3287e3d38e660d9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:18 +0000 Subject: [PATCH] libosmocore[master]: [doc] make sure all SMS related code is part of the 'sms' group Message-ID: Review at https://gerrit.osmocom.org/4300 [doc] make sure all SMS related code is part of the 'sms' group Change-Id: I24c56ccb56d5b39cfb887808f91b715da54c0f8b --- M include/osmocom/gsm/gsm0341.h M include/osmocom/gsm/gsm0411_smc.h M include/osmocom/gsm/gsm0411_smr.h M include/osmocom/gsm/gsm0411_utils.h M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_smr.c M src/gsm/gsm0411_utils.c 8 files changed, 27 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/4300/1 diff --git a/include/osmocom/gsm/gsm0341.h b/include/osmocom/gsm/gsm0341.h index 2fc83e4..834dbf9 100644 --- a/include/osmocom/gsm/gsm0341.h +++ b/include/osmocom/gsm/gsm0341.h @@ -1,4 +1,6 @@ -/*! \file gsm0341.h */ +/*! \defgroup sms Short Message Service (SMS) + * @{ + * \file gsm0341.h */ #pragma once @@ -9,3 +11,5 @@ uint8_t update, uint16_t msg_id, uint8_t dcs, uint8_t page_total, uint8_t page_cur, uint8_t *data, uint8_t len); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0411_smc.h b/include/osmocom/gsm/gsm0411_smc.h index 0cd1f94..7dfaa15 100644 --- a/include/osmocom/gsm/gsm0411_smc.h +++ b/include/osmocom/gsm/gsm0411_smc.h @@ -1,4 +1,6 @@ -/*! \file gsm0411_smc.h */ +/*! \addtogroup sms + * @{ + * \file gsm0411_smc.h */ #pragma once @@ -61,3 +63,5 @@ /* message from lower layer */ int gsm411_smc_recv(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg, int cp_msg_type); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0411_smr.h b/include/osmocom/gsm/gsm0411_smr.h index 19f9c5d..28f43de 100644 --- a/include/osmocom/gsm/gsm0411_smr.h +++ b/include/osmocom/gsm/gsm0411_smr.h @@ -1,4 +1,6 @@ -/*! \file gsm0411_smr.h */ +/*! \addtogroup sms + * @{ + * \file gsm0411_smr.h */ #pragma once @@ -42,3 +44,5 @@ /* message from lower layer */ int gsm411_smr_recv(struct gsm411_smr_inst *inst, int msg_type, struct msgb *msg); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0411_utils.h b/include/osmocom/gsm/gsm0411_utils.h index 1c51111..2cd87b8 100644 --- a/include/osmocom/gsm/gsm0411_utils.h +++ b/include/osmocom/gsm/gsm0411_utils.h @@ -1,4 +1,6 @@ -/*! \file gsm0411_utils.h */ +/*! \addtogroup sms + * @{ + * \file gsm0411_utils.h */ #pragma once @@ -35,3 +37,5 @@ /* Prefix msg with a 04.08/04.11 CP header */ int gsm411_push_cp_header(struct msgb *msg, uint8_t proto, uint8_t trans, uint8_t msg_type); + +/*! @} */ diff --git a/src/gsm/gsm0341.c b/src/gsm/gsm0341.c index 05a0b4a..485023f 100644 --- a/src/gsm/gsm0341.c +++ b/src/gsm/gsm0341.c @@ -1,4 +1,3 @@ -/*! \file gsm0341.c */ /* * (C) 2014 by Harald Welte * All Rights Reserved @@ -30,6 +29,7 @@ /*! \addtogroup sms * @{ + * \file gsm0341.c */ /*! Encode a 3GPP TS 03.41 SMS-CB message diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c index 7414e95..f7c536b 100644 --- a/src/gsm/gsm0411_smc.c +++ b/src/gsm/gsm0411_smc.c @@ -1,5 +1,4 @@ -/*! \file gsm0411_smc.c - * Point-to-Point (PP) Short Message Service (SMS). +/* Point-to-Point (PP) Short Message Service (SMS). * Support on Mobile Radio Interface * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ /* @@ -63,6 +62,7 @@ /*! \addtogroup sms * @{ + * \file gsm0411_smc.c * Point-to-Point (PP) Short Message Service (SMS) as per TS 04.11 */ diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c index 67bb249..0a25c7c 100644 --- a/src/gsm/gsm0411_smr.c +++ b/src/gsm/gsm0411_smr.c @@ -1,5 +1,4 @@ -/*! \file gsm0411_smr.c - * Point-to-Point (PP) Short Message Service (SMS). +/* Point-to-Point (PP) Short Message Service (SMS). * Support on Mobile Radio Interface * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0 */ /* @@ -65,6 +64,7 @@ /*! \addtogroup sms * @{ + * \file gsm0411_smr.c */ static void rp_timer_expired(void *data); diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index a4e9d0d..acf7e23 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -1,5 +1,4 @@ -/*! \file gsm0411_utils.c - * Point-to-Point (PP) Short Message Service (SMS). +/* Point-to-Point (PP) Short Message Service (SMS). * Support on Mobile Radio Interface * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ /* @@ -41,6 +40,7 @@ /*! \addtogroup sms * @{ + * \file gsm0411_utils.c */ #define GSM411_ALLOC_SIZE 1024 -- To view, visit https://gerrit.osmocom.org/4300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24c56ccb56d5b39cfb887808f91b715da54c0f8b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:18 +0000 Subject: [PATCH] libosmocore[master]: [doc] Define 'gsup' group with proper name, add intro text Message-ID: Review at https://gerrit.osmocom.org/4301 [doc] Define 'gsup' group with proper name, add intro text Change-Id: Ieee6213dc5aad082a2d439c7418b51f281b80b1a --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c 2 files changed, 20 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/4301/1 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 36e5c84..8daf460 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -1,5 +1,20 @@ -/*! \file gsup.h - * Osmocom Generic Subscriber Update Protocol message encoder/decoder. */ +/*! \defgroup gsup Generic Subscriber Update Protocol + * @{ + * + * The Generic Subscriber Update Protocol (GSUP) is an Osmocom-specific + * non-standard protocol replacing MAP as the protocol between + * MSC/VLR/SGSN and HLR in a 3GPP cellular communications network. + * + * It was designed around the same transactions and architecture as the + * MAP messages/operations, but without the complexity of TCAP and MAP, + * and without the need for ASN.1 encoding. + * + * The purpose is to keep protocol complexity out of OsmoSGSN and + * OsmoMSC, while providing a clean path to an external GSUP to MAP + * translator. + * + * \file gsup.h + * Osmocom Generic Subscriber Update Protocol message encoder/decoder. */ /* * (C) 2014 by sysmocom s.f.m.c. GmbH, Author: Jacob Erlbeck * (C) 2016 by Harald Welte @@ -163,3 +178,5 @@ int osmo_gsup_decode(const uint8_t *data, size_t data_len, struct osmo_gsup_message *gsup_msg); void osmo_gsup_encode(struct msgb *msg, const struct osmo_gsup_message *gsup_msg); + +/*! @} */ diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 685c91f..e5b0a66 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -1,5 +1,3 @@ -/*! \file gsup.c - * Osmocom Generic Subscriber Update Protocol message encoder/decoder. */ /* * (C) 2014 by sysmocom s.f.m.c. GmbH * (C) 2015 by Holger Hans Peter Freyther @@ -33,6 +31,7 @@ /*! \addtogroup gsup * @{ + * \file gsup.c * Osmocom Generic Subscriber Update Protocol */ -- To view, visit https://gerrit.osmocom.org/4301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieee6213dc5aad082a2d439c7418b51f281b80b1a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:18 +0000 Subject: [PATCH] libosmocore[master]: [doc] Properly define 'oap' group and add introductory text Message-ID: Review at https://gerrit.osmocom.org/4302 [doc] Properly define 'oap' group and add introductory text Change-Id: I1e875991ae1dd93862f850f85d40b3dac61ece72 --- M include/osmocom/gsm/oap.h M src/gsm/oap.c 2 files changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/02/4302/1 diff --git a/include/osmocom/gsm/oap.h b/include/osmocom/gsm/oap.h index ef83b79..ce1e151 100644 --- a/include/osmocom/gsm/oap.h +++ b/include/osmocom/gsm/oap.h @@ -1,5 +1,12 @@ -/*! \file oap.h - * Osmocom Authentication Protocol message encoder/decoder. */ +/*! \defgroup oap Osmocom Authentication Protocol + * @{ + * + * The Osmocom Authentication Protocol (OAP) is a way to use the 3GPP + * AKA (Authentication and Key Agreement) as cryptographic + * authentication mechanism in other protocols that don't provide + * cryptographic authentication. + * + * \file oap.h */ /* * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -71,3 +78,5 @@ int osmo_oap_decode(struct osmo_oap_message *oap_msg, const uint8_t *data, size_t data_len); void osmo_oap_encode(struct msgb *msg, const struct osmo_oap_message *oap_msg); + +/*! @} */ diff --git a/src/gsm/oap.c b/src/gsm/oap.c index b07eafc..aab5cac 100644 --- a/src/gsm/oap.c +++ b/src/gsm/oap.c @@ -1,5 +1,3 @@ -/*! \file oap.c - * Osmocom Authentication Protocol message encoder/decoder */ /* * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -31,6 +29,7 @@ /*! \addtogroup oap * @{ + * \file oap.c * Osmocom Authentication Protocol */ -- To view, visit https://gerrit.osmocom.org/4302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e875991ae1dd93862f850f85d40b3dac61ece72 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:18 +0000 Subject: [PATCH] libosmocore[master]: [doc] Properly define gsm0800 group and move all related fil... Message-ID: Review at https://gerrit.osmocom.org/4303 [doc] Properly define gsm0800 group and move all related files into it Change-Id: I91920c69c86d6a1932172becacb76faff2d3eb1e --- M include/osmocom/gsm/gsm0808.h M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c 4 files changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/03/4303/1 diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index 4369cab..3deee70 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -1,4 +1,6 @@ -/*! \file gsm0808.h */ +/*! \defgroup gsm0808 GSM 08.08 / 3GPP TS 48.008 A Interface + * @{ + * \file gsm0808.h */ /* * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves @@ -75,3 +77,5 @@ const char *gsm0808_bssmap_name(uint8_t msg_type); const char *gsm0808_bssap_name(uint8_t msg_type); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 17a03f5..db15666 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -1,4 +1,6 @@ -/*! \file gsm0808_utils.h */ +/*! \addtogroup gsm0808 + * @{ + * \file gsm0808_utils.h */ /* * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -53,3 +55,5 @@ int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch); int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc, uint8_t perm_spch); + +/*! @} */ diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index a8a5e45..ee5eda4 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1,4 +1,3 @@ -/*! \file gsm0808.c */ /* * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves @@ -28,7 +27,9 @@ /*! \addtogroup gsm0808 * @{ - * Helper functions regarding the TS 08.08 / 48.008 A interface + * \file gsm0808.c + * Helper functions regarding the TS 08.08 / 48.008 A interface, primarily + * message generation/encoding. */ #define BSSMAP_MSG_SIZE 512 diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index e2cd91b..798a122 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -1,4 +1,3 @@ -/*! \file gsm0808_utils.c */ /* * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -44,6 +43,7 @@ /*! \addtogroup gsm0808 * @{ + * \file gsm0808_utils.c */ /*! Encode TS 08.08 AoIP transport address IE -- To view, visit https://gerrit.osmocom.org/4303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91920c69c86d6a1932172becacb76faff2d3eb1e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:46 +0000 Subject: openbsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Patch Set 1: > If it makes sense for you too then I can add this description to > the commit and submit it. makes sense, please add it. -- To view, visit https://gerrit.osmocom.org/4277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied5bd90b9c06f27135a2e3c46e40d49d27d9a387 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:42:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:42:56 +0000 Subject: libosmocore[master]: [doc] Don't add libosmovty bits to libosmocore groups In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70e612b8d06aabefe634fcd7861641ffb941d974 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:10 +0000 Subject: libosmocore[master]: [doc] Rename "RSL" to "A-bis RSL" in documentation. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida325f8a9c40b40c1aeaa4edfd1123ced7cc92b8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:14 +0000 Subject: libosmocore[master]: [doc] TLV parser has far grown beyond GSM L3 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4295 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic53f9c0d5ee787f994f42cf2aff313c6e131fbe6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:18 +0000 Subject: libosmocore[master]: [doc] Ensure include/crypt/* is part of libosmogsm documenta... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic41f807dabb3b0d2d20b9d8963cad639e98f04dd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:22 +0000 Subject: libosmocore[master]: [doc] Ensure stats.h is parsed properly for Doxygen In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I65384e5cc01f2ad7783cf6b71ab78b4422902aa1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:26 +0000 Subject: libosmocore[master]: [doc] Provide proper name for 'auth' group In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5fb1c34475ea9db36c2ec5cddc988074a72a35f7 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:29 +0000 Subject: libosmocore[master]: [doc] gea has separate group; A5 is not part of crypto but a... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fd24c86f9b52244073ec800a3287e3d38e660d9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:33 +0000 Subject: libosmocore[master]: [doc] make sure all SMS related code is part of the 'sms' group In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24c56ccb56d5b39cfb887808f91b715da54c0f8b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:37 +0000 Subject: libosmocore[master]: [doc] Define 'gsup' group with proper name, add intro text In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieee6213dc5aad082a2d439c7418b51f281b80b1a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:41 +0000 Subject: libosmocore[master]: [doc] Properly define 'oap' group and add introductory text In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1e875991ae1dd93862f850f85d40b3dac61ece72 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:46 +0000 Subject: libosmocore[master]: [doc] Properly define gsm0800 group and move all related fil... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91920c69c86d6a1932172becacb76faff2d3eb1e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:49 +0000 Subject: [MERGED] libosmocore[master]: [doc] Expand Doxuygen documentation for osmo_prim In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Expand Doxuygen documentation for osmo_prim ...................................................................... [doc] Expand Doxuygen documentation for osmo_prim Also, make sure prim.c is actually part of the 'prim' module. Change-Id: I4363e46a5f606eb2114a9cc1d2086007eaa58d31 --- M include/osmocom/core/prim.h M src/prim.c 2 files changed, 28 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/prim.h b/include/osmocom/core/prim.h index 88ae08b..99eabff 100644 --- a/include/osmocom/core/prim.h +++ b/include/osmocom/core/prim.h @@ -2,6 +2,18 @@ /*! \defgroup prim Osmocom primitives * @{ + * + * Osmocom Primitives are a method to express inter-layer primitives as + * used often in ITU/ETSI/3GPP specifications in a generic way. They + * are based on \ref msgb and encapsulate any (optional) user payload + * data with a primitive header. The header contains information on + * - which SAP this primitive is used on + * - what is the name of the primitive + * - is it REQUEST, RESPONSE, INDICATION or CONFIRMATION + * + * For more information on the inter-layer primitives concept, see + * ITU-T X.21@ as found at https://www.itu.int/rec/T-REC-X.212-199511-I/en + * * \file prim.h */ #include @@ -20,21 +32,28 @@ extern const struct value_string osmo_prim_op_names[5]; +/*!< The upper 8 byte of the technology, the lower 24 bits for the SAP */ #define _SAP_GSM_SHIFT 24 #define _SAP_GSM_BASE (0x01 << _SAP_GSM_SHIFT) #define _SAP_TETRA_BASE (0x02 << _SAP_GSM_SHIFT) #define _SAP_SS7_BASE (0x03 << _SAP_GSM_SHIFT) -/*! primitive header */ +/*! Osmocom primitive header */ struct osmo_prim_hdr { - unsigned int sap; /*!< Service Access Point */ + unsigned int sap; /*!< Service Access Point Identifier */ unsigned int primitive; /*!< Primitive number */ enum osmo_prim_operation operation; /*! Primitive Operation */ - struct msgb *msg; /*!< \ref msgb containing associated data */ + struct msgb *msg; /*!< \ref msgb containing associated data. + * Note this can be slightly confusing, as the \ref osmo_prim_hdr + * is stored inside a \ref msgb, but then it contains a pointer + * back to the msgb. This is to simplify development: You can + * pass around a \ref osmo_prim_hdr by itself, and any function + * can autonomously resolve the underlying msgb, if needed (e.g. + * for \ref msgb_free. */ }; -/*! initialize a primitive header +/*! Convenience function to initialize a primitive header * \param[in,out] oph primitive header * \param[in] sap Service Access Point * \param[in] primitive Primitive Number diff --git a/src/prim.c b/src/prim.c index 2035581..d18dbd7 100644 --- a/src/prim.c +++ b/src/prim.c @@ -1,4 +1,6 @@ -/*! \file prim.c */ +/*! \addtogroup prim + * @{ + * \file prim.c */ #include #include @@ -30,3 +32,5 @@ } return OSMO_NO_EVENT; } + +/*! @} */ -- To view, visit https://gerrit.osmocom.org/4289 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4363e46a5f606eb2114a9cc1d2086007eaa58d31 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:43:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:43:50 +0000 Subject: [MERGED] libosmocore[master]: [doc] Introductory text on what the logging ring buffer is a... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Introductory text on what the logging ring buffer is about ...................................................................... [doc] Introductory text on what the logging ring buffer is about Change-Id: I876cd31e03a53ca90e658e353c0c8a839dece8ad --- M src/loggingrb.c 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/loggingrb.c b/src/loggingrb.c index b7d8d1f..d3dd254 100644 --- a/src/loggingrb.c +++ b/src/loggingrb.c @@ -22,6 +22,13 @@ /*! \addtogroup loggingrb * @{ + * This adds a log which consist of an in-memory ring buffer. The idea + * is that the user can configure his logging in a way that critical + * messages get stored in the ring buffer, and that the last few + * critical messages can then always obtained by dumping the ring + * buffer. It can hence be used as a more generic version of the + * "show me the last N alarms" functionality. + * * \file loggingrb.c */ #include -- To view, visit https://gerrit.osmocom.org/4288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I876cd31e03a53ca90e658e353c0c8a839dece8ad Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:44:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:44:33 +0000 Subject: osmo-ggsn[master]: lib/in46a: Introduce in46a_netmasklen API In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4290 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06e3e038afd8f7afaec2a3fa67b1616500c8db80 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:45:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:45:28 +0000 Subject: osmo-ggsn[master]: tun: Convert tun_ipv6_linklocal_get to be more generic In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I277af191dc611b6bbcb83479f4ae338083740322 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:48:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:48:19 +0000 Subject: osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) sorry, one more iteration for calloc -> talloc, but then I think it's ready! https://gerrit.osmocom.org/#/c/4256/4/ggsn/ggsn.c File ggsn/ggsn.c: Line 165: *blacklist = calloc(len, sizeof(struct in46_prefix)); we have the apn_ctx which is a talloc object, so we could slave this to the apn_ctx instead of using generic libc allocators (which we normally don't) for easier tracking of memory allocations. -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:49:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:49:10 +0000 Subject: [MERGED] libosmocore[master]: [doc] Rename "RSL" to "A-bis RSL" in documentation. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Rename "RSL" to "A-bis RSL" in documentation. ...................................................................... [doc] Rename "RSL" to "A-bis RSL" in documentation. We also have "A-bis OML" and it's a bit odd to have one with prefix and the other without. Change-Id: Ida325f8a9c40b40c1aeaa4edfd1123ced7cc92b8 --- M include/osmocom/gsm/rsl.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/rsl.h b/include/osmocom/gsm/rsl.h index 3d9c66f..be0fa79 100644 --- a/include/osmocom/gsm/rsl.h +++ b/include/osmocom/gsm/rsl.h @@ -5,7 +5,7 @@ #include #include -/*! \defgroup rsl RSL +/*! \defgroup rsl A-bis RSL * @{ * \file rsl.h */ -- To view, visit https://gerrit.osmocom.org/4294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida325f8a9c40b40c1aeaa4edfd1123ced7cc92b8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 20:49:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 20:49:11 +0000 Subject: [MERGED] libosmocore[master]: [doc] Don't add libosmovty bits to libosmocore groups In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Don't add libosmovty bits to libosmocore groups ...................................................................... [doc] Don't add libosmovty bits to libosmocore groups Let's not put files of libosmovty into Doxygen groups of libosmocore, as this seems to confuse Doxygen. Also, some minor updates/fixes of libosmovty documentation. Change-Id: I70e612b8d06aabefe634fcd7861641ffb941d974 --- M src/vty/fsm_vty.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/telnet_interface.c 4 files changed, 29 insertions(+), 30 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/fsm_vty.c b/src/vty/fsm_vty.c index 345be66..50c7fd5 100644 --- a/src/vty/fsm_vty.c +++ b/src/vty/fsm_vty.c @@ -1,5 +1,3 @@ -/*! \file fsm_vty.c - * Osmocom FSM introspection via VTY. */ /* * (C) 2016 by Harald Welte * All Rights Reserved @@ -35,9 +33,8 @@ #include #include -/*! \addtogroup fsm - * @{ - * VTY interface for Osmocom FSM +/*! \file fsm_vty.c + * Osmocom FSM introspection via VTY. * * This is code implementing generic VTY access to Osmocom FSMs from * libosmocore. This means that any application can expose all state @@ -187,5 +184,3 @@ install_element_ve(&show_fsm_inst_cmd); install_element_ve(&show_fsm_insts_cmd); } - -/*! @} */ diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 0ab7686..9b7d10a 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -1,5 +1,3 @@ -/*! \file logging_vty.c - * OpenBSC logging helper for the VTY. */ /* * (C) 2009-2010 by Harald Welte * (C) 2009-2014 by Holger Hans Peter Freyther @@ -41,14 +39,21 @@ #define LOG_STR "Configure logging sub-system\n" -/*! \addtogroup logging - * @{ +/*! \file logging_vty.c * Configuration of logging from VTY * - * This module implements functions that permit configuration of - * the libosmocore logging framework from VTY commands. This applies - * both to logging to the VTY (telnet sessions), as well as logging to - * other targets, such as sysslog, file, gsmtap, ... + * This module implements + * - functions that permit configuration of the libosmocore logging + * framework from VTY commands in the configure -> logging node. + * + * - functions that permit logging *to* a VTY session. Basically each + * VTY session gets its own log target, with configurable + * per-subsystem log levels. This is performed internally via the + * \ref log_target_create_vty function. + * + * You have to call \ref logging_vty_add_cmds from your application + * once to enable both of the above. + * */ extern const struct log_info *osmo_log_info; @@ -756,6 +761,8 @@ return 1; } +/*! Register logging related commands to the VTY. Call this once from + * your application if you want to support those commands. */ void logging_vty_add_cmds() { install_element_ve(&enable_logging_cmd); @@ -796,5 +803,3 @@ #endif install_element(CONFIG_NODE, &cfg_log_gsmtap_cmd); } - -/* @} */ diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 95f04bc..2ccbf66 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -1,5 +1,3 @@ -/*! \file stats_vty.c - * OpenBSC stats helper for the VTY. */ /* * (C) 2009-2010 by Harald Welte * (C) 2009-2014 by Holger Hans Peter Freyther @@ -43,9 +41,14 @@ #define SHOW_STATS_STR "Show statistical values\n" -/*! \addtogroup stats - * @{ +/*! \file stats_vty.c * VTY interface for statsd / statistic items + * + * This code allows you to register a couple of VTY commands that + * permit configuration of the \ref stats functionality from the VTY. + * + * Use \ref osmo_stats_vty_add_cmds once at application start-up to + * enable related commands. */ /* containing version info */ @@ -609,5 +612,3 @@ install_element_ve(&show_stats_asciidoc_table_cmd); } - -/*! @} */ diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index f82a7ff..40154fe 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -1,5 +1,3 @@ -/*! \file telnet_interface.c - * minimalistic telnet/network interface it might turn into a wire interface */ /* (C) 2009 by Holger Hans Peter Freyther * All Rights Reserved * @@ -37,8 +35,7 @@ #include #include -/*! \addtogroup telnet_interface - * @{ +/*! \file telnet_interface.c * Telnet interface towards Osmocom VTY * * This module contains the code implementing a telnet server for VTY @@ -46,7 +43,9 @@ * process in order to enable interactive command-line introspection, * interaction and configuration. * - * \file telnet_interface.c */ + * You typically call \ref telnet_init or \ref telnet_init_dynif once + * from your application code to enable this. + */ /* per connection data */ LLIST_HEAD(active_connections); @@ -219,6 +218,7 @@ } } +/*! Close all telnet connections and release the telnet socket */ void telnet_exit(void) { struct telnet_connection *tc, *tc2; @@ -230,5 +230,3 @@ close(server_socket.fd); talloc_free(tall_telnet_ctx); } - -/*! @} */ -- To view, visit https://gerrit.osmocom.org/4293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I70e612b8d06aabefe634fcd7861641ffb941d974 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 16 21:45:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Oct 2017 21:45:56 +0000 Subject: [MERGED] libosmocore[master]: [doc] TLV parser has far grown beyond GSM L3 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] TLV parser has far grown beyond GSM L3 ...................................................................... [doc] TLV parser has far grown beyond GSM L3 Let's hence not call the group "GSM L3 compatible TLV parser" Change-Id: Ic53f9c0d5ee787f994f42cf2aff313c6e131fbe6 --- M include/osmocom/gsm/tlv.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h index f903223..5bf4a87 100644 --- a/include/osmocom/gsm/tlv.h +++ b/include/osmocom/gsm/tlv.h @@ -7,7 +7,7 @@ #include #include -/*! \defgroup tlv GSM L3 compatible TLV parser +/*! \defgroup tlv TLV parser * @{ * \file tlv.h */ -- To view, visit https://gerrit.osmocom.org/4295 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic53f9c0d5ee787f994f42cf2aff313c6e131fbe6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 00:53:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 00:53:08 +0000 Subject: [PATCH] python/osmo-python-tests[master]: add osmo_verify_transcript_{vty, ctrl}.py for easier vty and ... In-Reply-To: References: Message-ID: Hello Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4272 to look at the new patch set (#3). add osmo_verify_transcript_{vty,ctrl}.py for easier vty and ctrl testing While adding VTY and CTRL tests to new programs like OsmoHLR, I wanted to have a simple way to translate a VTY interaction transcript to a VTY python test. It is fairly trivial to simply read in a transcript, extract both the commands to send as well as the expected results, and to verify these without having to write one line of application-specific code. From there it was just a little step to allow the same for CTRL interaction. With osmo_verify_transcript_vty.py and osmo_verify_transcript_ctrl.py, it is possible to have a simple text file of a telnet VTY or CTRL interface interaction and run it against a given application. With the --update option, the scripts run the given command and rewrite the transcript file to whatever the application currently produces as response. Backed by version control, it is super easy to tweak commands, --update the test results and verify that only the desired bits changed. A '...' wildcard can skip any number of lines in the expected result and is usually preserved during --update. This python3 implementation is independent from the previous obscvty implementations. Take the opportunity to clarify/fix a few aspects: for example, it is now possible to verify the hints that the interactive VTY displays when the user enters '?' in various places, and to evaluate the prompt character '>'/'#'. Unitl now, code is duplicated/scattered across various vty_test_runner.py scripts in different git repositories. Now, a VTY or CTRL transcript is enough to put a complete test in place. The simplest invocation is directly from the Makefile, feeding an application commandline, the proper port number to contact it and e.g. a VTY prompt name. This new code is also usable as python modules, to be able to build more complex tests that require specialized intermediate actions, possibly coordinating launch of applications or data manipulation. The first repository to employ this is osmo-hlr.git. See change-ids I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 for VTY and Iff93abe370b8f3ecf42082d1d0eaa1fbeca5b122 for CTRL. Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c --- M osmopy/__init__.py A osmopy/osmo_verify_transcript_common.py A osmopy/osmo_verify_transcript_ctrl.py A osmopy/osmo_verify_transcript_vty.py M setup.py 5 files changed, 677 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/72/4272/3 diff --git a/osmopy/__init__.py b/osmopy/__init__.py index e211108..01ff3de 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -3,4 +3,7 @@ __all__ = ['obscvty', 'osmodumpdoc', 'osmotestconfig', 'osmotestvty', 'osmoutil', - 'osmo_ipa',] + 'osmo_ipa', + 'osmo_verify_transcript_common', + 'osmo_verify_transcript_vty', + 'osmo_verify_transcript_ctrl'] diff --git a/osmopy/osmo_verify_transcript_common.py b/osmopy/osmo_verify_transcript_common.py new file mode 100644 index 0000000..e4b5553 --- /dev/null +++ b/osmopy/osmo_verify_transcript_common.py @@ -0,0 +1,372 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Common code for verify_transcript_vty.py and verify_transcript_ctrl.py. +''' + +import argparse +import sys +import os +import subprocess +import time +import traceback +import socket +import shlex + + +class Interact: + + class StepBase: + command = None + result = None + leading_blanks = None + + def __init__(self): + self.result = [] + + def verify_interact_state(self, interact_instance): + # for example to verify that the last VTY prompt received shows the + # right node. + pass + + def command_str(self, interact_instance=None): + return self.command + + def __str__(self): + return '%s\n%s' % (self.command_str(), '\n'.join(self.result)) + + @staticmethod + def is_next_step(line, interact_instance): + assert not "implemented by InteractVty.VtyStep and InteractCtrl.CtrlStep" + + socket = None + + def __init__(self, step_class, port, host, verbose=False, update=False): + ''' + host is the hostname to connect to. + port is the CTRL port to connect on. + ''' + self.Step = step_class + self.port = port + self.host = host + self.verbose = verbose + self.update = update + + def connect(self): + assert self.socket is None + retries = 30 + took = 0 + while True: + took += 1 + try: + self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.socket.setblocking(1) + self.socket.connect((self.host, int(self.port))) + except IOError: + retries -= 1 + if retries <= 0: + raise + time.sleep(.1) + continue + break + + def close(self): + if self.socket is None: + return + self.socket.close() + self.socket = None + + def command(self, command): + assert not "implemented separately by InteractVty and InteractCtrl" + + def verify_transcript_file(self, transcript_file): + with open(transcript_file, 'r') as f: + content = f.read() + + try: + result = self.verify_transcript(content) + except: + print('Error while verifying transcript file %r' % transcript_file, file=sys.stderr) + sys.stderr.flush() + raise + + if not self.update: + return + content = '\n'.join(result) + with open(transcript_file, 'w') as f: + f.write(content) + + def verify_transcript(self, transcript): + '''' + transcript is a "screenshot" of a session, a multi-line string + including commands and expected results. + Feed commands to self.command() and verify the expected results. + ''' + + # parse steps + steps = [] + step = None + blank_lines = 0 + for line in transcript.splitlines(): + if not line: + blank_lines += 1 + continue + next_step_started = self.Step.is_next_step(line, self) + if next_step_started: + if step: + steps.append(step) + step = next_step_started + step.leading_blanks = blank_lines + blank_lines = 0 + elif step: + # we only count blank lines directly preceding the start of a + # next step. Insert blank lines in the middle of a response + # back into the response: + if blank_lines: + step.result.extend([''] * blank_lines) + blank_lines = 0 + step.result.append(line) + if step: + steps.append(step) + step = None + + actual_result = [] + + # run steps + step_nr = 0 + for step in steps: + step_nr += 1 + try: + if self.verbose: + if step.leading_blanks: + print('\n' * step.leading_blanks, end='') + print(step.command_str()) + sys.stdout.flush() + + step.verify_interact_state(self) + + res = self.command(step.command) + + if self.verbose: + sys.stderr.flush() + sys.stdout.flush() + print('\n'.join(res)) + sys.stdout.flush() + + if step.leading_blanks: + actual_result.extend([''] * step.leading_blanks) + actual_result.append(step.command_str(self)) + + match_result = self.match_lines(step.result, res) + + if self.update: + if match_result is True: + # preserve any wildcards + actual_result.extend(step.result) + else: + # mismatch, take exactly what came in + actual_result.extend(res) + continue + if match_result is not True: + raise Exception('Result mismatch:\n%s\n\nExpected:\n[\n%s\n]\n\nGot:\n[\n%s\n%s\n]' + % (match_result, step, step.command_str(), '\n'.join(res))) + except: + print('Error during transcript step %d:\n[\n%s\n]' % (step_nr, step), + file=sys.stderr) + sys.stderr.flush() + raise + + # final line ending + actual_result.append('') + return actual_result + + @staticmethod + def match_lines(expect, got): + ''' + Match two lists of strings, allowing certain wildcards: + - In 'expect', if a line is exactly '...', it matches any number of + arbitrary lines in 'got'; the implementation is trivial and skips + lines to the first occurence in 'got' that continues after '...'. + + Return 'True' on match, or a string describing the mismatch. + ''' + def match_line(expect_line, got_line): + return expect_line == got_line + + e = 0 + g = 0 + while e < len(expect): + if expect[e] == '...': + e += 1 + + if e >= len(expect): + # anything left in 'got' is accepted. + return True + + # look for the next occurence of the expected line in 'got' + while g < len(got) and not match_line(expect[e], got[g]): + g += 1 + continue + + if g >= len(got): + return 'Cannot find line %r' % expect[e] + + if not match_line(expect[e], got[g]): + return 'Mismatch:\nExpect:\n%r\nGot:\n%r' % (expect[e], got[g]) + + e += 1 + g += 1 + + if g < len(got): + return 'Did not expect line %r' % got[g] + return True + +def end_process(proc): + if not proc: + return + + rc = proc.poll() + if rc is not None: + print('Process has already terminated with', rc) + proc.wait() + return + + proc.terminate() + time_to_wait_for_term = 5 + wait_step = 0.001 + waited_time = 0 + while True: + # poll returns None if proc is still running + if proc.poll() is not None: + break + waited_time += wait_step + # make wait_step approach 1.0 + wait_step = (1. + 5. * wait_step) / 6. + if waited_time >= time_to_wait_for_term: + break + time.sleep(wait_step) + + if proc.poll() is None: + # termination seems to be slower than that, let's just kill + proc.kill() + print("Killed child process") + elif waited_time > .002: + print("Terminating took %.3fs" % waited_time) + proc.wait() + +class Application: + proc = None + _devnull = None + + @staticmethod + def devnull(): + if Application._devnull is None: + Application._devnull = open(os.devnull, 'w') + return Application._devnull + + def __init__(self, command_tuple, purge_output=True): + self.command_tuple = command_tuple + self.purge_output = purge_output + + def run(self): + out_err = None + if self.purge_output: + out_err = Application.devnull() + + print('Launching: cd %r; %s' % (os.getcwd(), ' '.join(self.command_tuple))) + self.proc = subprocess.Popen(self.command_tuple, stdout=out_err, stderr=out_err) + + def stop(self): + end_process(self.proc) + +def verify_application(command_tuple, interact, transcript_file, verbose): + passed = None + application = None + + sys.stdout.flush() + sys.stderr.flush() + + if command_tuple: + application = Application(command_tuple, purge_output=not verbose) + application.run() + + try: + interact.connect() + interact.verify_transcript_file(transcript_file) + passed = True + except: + traceback.print_exc() + passed = False + interact.close() + + if application: + application.stop() + + sys.stdout.flush() + sys.stderr.flush() + + return passed + +def common_parser(): + parser = argparse.ArgumentParser() + parser.add_argument('-r', '--run', dest='command_str', + help='command to run to launch application to test,' + ' including command line arguments. If omitted, no' + ' application is launched.') + parser.add_argument('-p', '--port', dest='port', + help="Port that the application opens.") + parser.add_argument('-H', '--host', dest='host', default='localhost', + help="Host that the application opens the port on.") + parser.add_argument('-u', '--update', dest='update', action='store_true', + help='Do not verify, but OVERWRITE transcripts based on' + ' the applications current behavior. OVERWRITES TRANSCRIPT' + ' FILES.') + parser.add_argument('-v', '--verbose', action='store_true', + help='Print commands and application output') + parser.add_argument('transcript_files', nargs='*', help='transcript files to verify') + return parser + +def main(command_str, transcript_files, interact, verbose): + + if command_str: + command_tuple = shlex.split(command_str) + else: + command_tuple = None + + results = [] + for t in transcript_files: + passed = verify_application(command_tuple=command_tuple, + interact=interact, + transcript_file=t, + verbose=verbose) + results.append((passed, t)) + + print('\nRESULTS:') + all_passed = True + for passed, t in results: + print('%s: %s' % ('pass' if passed else 'FAIL', t)) + all_passed = all_passed and passed + print() + + if not all_passed: + sys.exit(1) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_ctrl.py b/osmopy/osmo_verify_transcript_ctrl.py new file mode 100755 index 0000000..7afe4bf --- /dev/null +++ b/osmopy/osmo_verify_transcript_ctrl.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run CTRL test transcripts against a given application. + +A CTRL transcript contains CTRL commands and their expected results. +It looks like: + +" +SET 1 var val +SET_REPLY 1 var OK +GET 2 var +GET_REPLY 2 var val +" + +The application to be tested is described by +- a binary to run, +- command line arguments to pass to the binary, +- the CTRL port. + +This module can either be run directly to run or update a given CTRL transcript, +or it can be imported as a module to run more complex setups. +''' + +import re + +from osmopy.osmo_verify_transcript_common import * +from osmopy.osmo_ipa import Ctrl, IPA + +class InteractCtrl(Interact): + next_id = 1 + keep_ids = True + re_command = re.compile('^(SET|GET) ([^ ]*) (.*)$') + + class CtrlStep(Interact.StepBase): + + @staticmethod + def is_next_step(line, interact_instance): + m = InteractCtrl.re_command.match(line) + if not m: + return None + next_step = InteractCtrl.CtrlStep() + + set_get = m.group(1) + cmd_id = m.group(2) + var_val = m.group(3) + if not interact_instance.keep_ids: + cmd_id = interact_instance.next_id + interact_instance.next_id += 1 + next_step.command = '%s %s %s' % (set_get, cmd_id, var_val) + + return next_step + + def __init__(self, port, host, verbose=False, update=False, keep_ids=True): + if not update: + keep_ids = True + self.keep_ids = keep_ids + super().__init__(InteractCtrl.CtrlStep, port=port, host=host, verbose=verbose, update=update) + + def connect(self): + self.next_id = 1 + super().connect() + + def send(self, data): + data = Ctrl().add_header(data) + return self.socket.send(data) == len(data) + + def receive(self): + responses = [] + data = self.socket.recv(4096) + while (len(data)>0): + (response_with_header, data) = IPA().split_combined(data) + response = Ctrl().rem_header(response_with_header) + responses.append(response.decode('utf-8')) + return responses + + def command(self, command): + assert self.send(command) + res = self.receive() + split_responses = [] + for r in res: + split_responses.extend(r.splitlines()) + sys.stdout.flush() + sys.stderr.flush() + return split_responses + +if __name__ == '__main__': + parser = common_parser() + parser.add_argument('-i', '--keep-ids', dest='keep_ids', action='store_true', + help='With --update, default is to overwrite the command IDs' + ' so that they are consecutive numbers starting from 1.' + ' With --keep-ids, do not change these command IDs.') + args = parser.parse_args() + + interact = InteractCtrl(args.port, args.host, args.verbose, args.update, args.keep_ids) + + main(command_str=args.command_str, + transcript_files=args.transcript_files, + interact=interact, + verbose=args.verbose) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_vty.py b/osmopy/osmo_verify_transcript_vty.py new file mode 100755 index 0000000..3a4d630 --- /dev/null +++ b/osmopy/osmo_verify_transcript_vty.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run VTY test transcripts against a given application. + +A VTY transcript contains VTY commands and their expected results. +It looks like: + +" +OsmoHLR> enable + +OsmoHLR# subscriber show imsi 123456789023000 +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber show msisdn 12345 +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber create imsi 123456789023000 +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + No auth data +" + +The application to be tested is described by +- a binary to run, +- command line arguments to pass to the binary, +- the VTY telnet port, +- the application name as printed in the VTY prompt. + +This module can either be run directly to run or update a given VTY transcript, +or it can be imported as a module to run more complex setups. +''' + +import re + +from osmopy.osmo_verify_transcript_common import * + +class InteractVty(Interact): + + class VtyStep(Interact.StepBase): + expect_node = None # e.g. '(config-net)' + expect_prompt_char = None # '>' or '#' + + def __init__(self, prompt): + super().__init__() + self.prompt = prompt + + def verify_interact_state(self, interact_instance): + if interact_instance.update: + return + if interact_instance.this_node != self.expect_node: + raise Exception('Mismatch: expected VTY node %r in the prompt, got %r' + % (self.expect_node, interact_instance.this_node)) + if interact_instance.this_prompt_char != self.expect_prompt_char: + raise Exception('Mismatch: expected VTY prompt character %r, got %r' + % (self.expect_prompt_char, interact_instance.this_prompt_char)) + + @staticmethod + def is_next_step(line, interact_instance): + m = interact_instance.re_prompt.match(line) + if not m: + return None + next_step = InteractVty.VtyStep(interact_instance.prompt) + next_step.expect_node = m.group(1) + next_step.expect_prompt_char = m.group(2) + next_step.command = m.group(3) + return next_step + + def command_str(self, interact_instance=None): + if interact_instance is None: + node = self.expect_node + prompt_char = self.expect_prompt_char + else: + node = interact_instance.last_node + prompt_char = interact_instance.last_prompt_char + if node: + node = '(%s)' % node + node = node or '' + return '%s%s%s %s' % (self.prompt, node, prompt_char, self.command) + + def __init__(self, prompt, port, host, verbose, update): + self.prompt = prompt + self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) + super().__init__(InteractVty.VtyStep, port, host, verbose, update) + + def connect(self): + self.this_node = None + self.this_prompt_char = '>' # slight cheat for initial prompt char + self.last_node = None + self.last_prompt_char = None + + super().connect() + # receive the first welcome message and discard + self.socket.recv(4096) + + def _command(self, command_str, timeout=10): + self.socket.send(command_str.encode()) + + waited_since = time.time() + received_lines = [] + last_line = '' + + while True: + new_data = self.socket.recv(4096).decode('utf-8') + + last_line = "%s%s" % (last_line, new_data) + + if last_line: + lines = last_line.splitlines() + received_lines.extend(lines[:-1]) + last_line = lines[-1] + + match = self.re_prompt.match(last_line) + if not match: + if time.time() - waited_since > timeout: + raise IOError("Failed to read data (did the app crash?)") + time.sleep(.1) + continue + + self.last_node = self.this_node + self.last_prompt_char = self.this_prompt_char + self.this_node = match.group(1) or None + self.this_prompt_char = match.group(2) + break + + # expecting to have received the command we sent as echo, remove it + clean_command_str = command_str.strip() + if clean_command_str.endswith('?'): + clean_command_str = clean_command_str[:-1] + if received_lines and received_lines[0] == clean_command_str: + received_lines = received_lines[1:] + return received_lines + + def command(self, command_str, timeout=10): + command_str = command_str or '\r' + if command_str[-1] not in '?\r\t': + command_str = command_str + '\r' + + received_lines = self._command(command_str, timeout) + + if command_str[-1] == '?': + self._command('\x03', timeout) + + return received_lines + +if __name__ == '__main__': + parser = common_parser() + parser.add_argument('-n', '--prompt-name', dest='prompt', + help="Name used in application's telnet VTY prompt.") + args = parser.parse_args() + + interact = InteractVty(args.prompt, args.port, args.host, args.verbose, args.update) + + main(command_str=args.command_str, + transcript_files=args.transcript_files, + interact=interact, + verbose=args.verbose) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/setup.py b/setup.py index 44e7fd1..9c25a0d 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,9 @@ version = __version__, packages = ["osmopy"], scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py", - "osmopy/osmotestvty.py"], + "osmopy/osmotestvty.py", + "osmopy/osmo_verify_transcript_vty.py", + "osmopy/osmo_verify_transcript_ctrl.py"], license = "AGPLv3", description = "Osmopython: osmocom testing scripts", author = "Katerina Barone-Adesi", -- To view, visit https://gerrit.osmocom.org/4272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c Gerrit-PatchSet: 3 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 00:59:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 00:59:22 +0000 Subject: [PATCH] libosmocore[master]: api doc: fix two doxygen group closing braces Message-ID: Review at https://gerrit.osmocom.org/4304 api doc: fix two doxygen group closing braces Change-Id: I6c1f47d13c5b7a9cb2281de9f017df4f1ed88ba7 --- M include/osmocom/core/linuxlist.h M include/osmocom/gprs/gprs_ns.h 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/04/4304/1 diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h index cb753d1..8d0533f 100644 --- a/include/osmocom/core/linuxlist.h +++ b/include/osmocom/core/linuxlist.h @@ -397,5 +397,5 @@ } /*! - * }@ + * @} */ diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 938ad99..5aee755 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -218,4 +218,4 @@ void gprs_ns_set_log_ss(int ss); -/*! }@ */ +/*! @} */ -- To view, visit https://gerrit.osmocom.org/4304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c1f47d13c5b7a9cb2281de9f017df4f1ed88ba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 00:59:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 00:59:39 +0000 Subject: [PATCH] libosmocore[master]: ctrl: allow more nodes than those in enum ctrl_node_type Message-ID: Review at https://gerrit.osmocom.org/4305 ctrl: allow more nodes than those in enum ctrl_node_type Add ctrl_interface_setup_dynip2() to add a node_count parameter, which can be used to define more ctrl nodes without having to merge a patch to libosmocore. In consequence, also add ctrl_handle_alloc2(), since ctrl_interface_setup_dynip() uses ctrl_handle_alloc() to allocate the node slots, and add node_count param to static ctrl_init(). Passing zero as node_count indicates to use the default of _LAST_CTRL_NODE as before, i.e. to not define more ctrl nodes. Assert that we never allocate less than _LAST_CTRL_NODE slots. The current ctrl_interface_setup_dynip() and ctrl_handle_alloc() become simple wrappers that pass zero as node_count. Their use is still valid and they do not need to be deprecated. The API comment to ctrl_interface_setup_dynip2() explains how to define more node IDs. This patch was verified to work by osmo-hlr.git change I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 which adds two node IDs for use by osmo-hlr only. Change-Id: I1bd62ae0d4eefde7e1517db15a2155640a1bab58 --- M include/osmocom/ctrl/control_if.h M src/ctrl/control_if.c 2 files changed, 76 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/05/4305/1 diff --git a/include/osmocom/ctrl/control_if.h b/include/osmocom/ctrl/control_if.h index 6e49742..d444328 100644 --- a/include/osmocom/ctrl/control_if.h +++ b/include/osmocom/ctrl/control_if.h @@ -24,12 +24,20 @@ int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd); int ctrl_cmd_send_trap(struct ctrl_handle *ctrl, const char *name, char *value); struct ctrl_handle *ctrl_handle_alloc(void *ctx, void *data, ctrl_cmd_lookup lookup); +struct ctrl_handle *ctrl_handle_alloc2(void *ctx, void *data, + ctrl_cmd_lookup lookup, + unsigned int node_count); struct ctrl_handle *ctrl_interface_setup(void *data, uint16_t port, ctrl_cmd_lookup lookup); struct ctrl_handle *ctrl_interface_setup_dynip(void *data, const char *bind_addr, uint16_t port, ctrl_cmd_lookup lookup); +struct ctrl_handle *ctrl_interface_setup_dynip2(void *data, + const char *bind_addr, + uint16_t port, + ctrl_cmd_lookup lookup, + unsigned int node_count); struct ctrl_connection *osmo_ctrl_conn_alloc(void *ctx, void *data); int ctrl_cmd_handle(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd, void *data); struct ctrl_cmd *ctrl_cmd_exec_from_string(struct ctrl_handle *ch, const char *cmdstr); diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index d50ddd0..9b8a194 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -698,14 +698,20 @@ static int ctrl_initialized = 0; /* global ctrl initialization */ -static int ctrl_init(void) +static int ctrl_init(unsigned int node_count) { int ret; - if (ctrl_initialized) - return 0; + if (!node_count) + node_count = _LAST_CTRL_NODE; + OSMO_ASSERT(node_count >= _LAST_CTRL_NODE); - ctrl_node_vec = vector_init(_LAST_CTRL_NODE); + if (ctrl_initialized) { + OSMO_ASSERT(ctrl_initialized == node_count); + return 0; + } + + ctrl_node_vec = vector_init(node_count); if (!ctrl_node_vec) goto err; @@ -720,7 +726,7 @@ if (ret) goto err_vec; - ctrl_initialized = 1; + ctrl_initialized = node_count; return 0; err_vec: @@ -730,18 +736,24 @@ return -1; } -/*! Allocate a CTRL interface handle - * \param[in] ctx Tallo callocation context to be used +/*! Allocate a CTRL interface handle. + * \param[in] ctx Talloc allocation context to be used * \param[in] data Pointer which will be made available to each set_..() get_..() verify_..() control command function * \param[in] lookup Lookup function pointer, can be NULL + * \param[in] node_count Number of CTRL nodes to allocate, 0 for default. * \returns ctrl_handle pointer or NULL in case of errors + * + * Please see ctrl_interface_setup_dynip2() for a detailed description of \a + * node_count semantics. */ -struct ctrl_handle *ctrl_handle_alloc(void *ctx, void *data, ctrl_cmd_lookup lookup) +struct ctrl_handle *ctrl_handle_alloc2(void *ctx, void *data, + ctrl_cmd_lookup lookup, + unsigned int node_count) { struct ctrl_handle *ctrl; - ctrl_init(); + ctrl_init(node_count); ctrl = talloc_zero(ctx, struct ctrl_handle); if (!ctrl) @@ -755,23 +767,47 @@ return ctrl; } -/*! Setup CTRL interface on a given address +/*! Allocate a CTRL interface handle. + * \param[in] ctx Talloc allocation context to be used + * \param[in] data Pointer which will be made available to each + set_..() get_..() verify_..() control command function + * \param[in] lookup Lookup function pointer, can be NULL + * \returns ctrl_handle pointer or NULL in case of errors + */ +struct ctrl_handle *ctrl_handle_alloc(void *ctx, void *data, ctrl_cmd_lookup lookup) +{ + return ctrl_handle_alloc2(ctx, data, lookup, 0); +} + +/*! Setup CTRL interface on a given address. * \param[in] data Pointer which will be made available to each set_..() get_..() verify_..() control command function * \param[in] bind_addr Address on which CTRL socket shall listen * \param[in] port Port on which CTRL socket shall listen * \param[in] lookup Lookup function pointer, can be NULL + * \param[in] node_count Number of CTRL nodes to allocate, 0 for default. * \returns ctrl_handle pointer or NULL in case of errors + * + * Control interface nodes are identified by a node handle; some of these are + * defined in enum ctrl_node_type, here in libosmocore. However, applications + * defining own nodes may add own control nodes without having to extend the + * enum in libosmocore. For example, in the calling application, define an enum + * like "enum more_ctrl_nodes { CTRL_NODE_FOO = _LAST_CTRL_NODE, CTRL_NODE_BAR, + * _LAST_CTRL_NODE_EXTENDED }". In order to provide space for the additional + * control nodes, pass _LAST_CTRL_NODE_EXTENDED to the \a node_count parameter. + * Passing 0 is identical to passing _LAST_CTRL_NODE, i.e. to not define own + * control nodes apart from libosmocore ones. */ -struct ctrl_handle *ctrl_interface_setup_dynip(void *data, - const char *bind_addr, - uint16_t port, - ctrl_cmd_lookup lookup) +struct ctrl_handle *ctrl_interface_setup_dynip2(void *data, + const char *bind_addr, + uint16_t port, + ctrl_cmd_lookup lookup, + unsigned int node_count) { int ret; struct ctrl_handle *ctrl; - ctrl = ctrl_handle_alloc(data, data, lookup); + ctrl = ctrl_handle_alloc2(data, data, lookup, node_count); if (!ctrl) return NULL; @@ -789,6 +825,23 @@ return ctrl; } +/*! Setup CTRL interface on a given address. + * \param[in] data Pointer which will be made available to each + set_..() get_..() verify_..() control command function + * \param[in] bind_addr Address on which CTRL socket shall listen + * \param[in] port Port on which CTRL socket shall listen + * \param[in] lookup Lookup function pointer, can be NULL + * \returns ctrl_handle pointer or NULL in case of errors + */ +struct ctrl_handle *ctrl_interface_setup_dynip(void *data, + const char *bind_addr, + uint16_t port, + ctrl_cmd_lookup lookup) +{ + return ctrl_interface_setup_dynip2(data, bind_addr, port, lookup, 0); +} + + /*! Install a lookup helper function for control nodes * This function is used by e.g. library code to install lookup helpers * for additional nodes in the control interface. -- To view, visit https://gerrit.osmocom.org/4305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1bd62ae0d4eefde7e1517db15a2155640a1bab58 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:01:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:01:02 +0000 Subject: python/osmo-python-tests[master]: add osmo_verify_transcript_{vty, ctrl}.py for easier vty and ... In-Reply-To: References: Message-ID: Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/4272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c Gerrit-PatchSet: 3 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:02:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:02:12 +0000 Subject: python/osmo-python-tests[master]: add osmo_verify_transcript_{vty, ctrl}.py for easier vty and ... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 re-add previous +2, only minor fixes added -- To view, visit https://gerrit.osmocom.org/4272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c Gerrit-PatchSet: 3 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:02:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:02:16 +0000 Subject: [MERGED] python/osmo-python-tests[master]: add osmo_verify_transcript_{vty, ctrl}.py for easier vty and ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add osmo_verify_transcript_{vty,ctrl}.py for easier vty and ctrl testing ...................................................................... add osmo_verify_transcript_{vty,ctrl}.py for easier vty and ctrl testing While adding VTY and CTRL tests to new programs like OsmoHLR, I wanted to have a simple way to translate a VTY interaction transcript to a VTY python test. It is fairly trivial to simply read in a transcript, extract both the commands to send as well as the expected results, and to verify these without having to write one line of application-specific code. From there it was just a little step to allow the same for CTRL interaction. With osmo_verify_transcript_vty.py and osmo_verify_transcript_ctrl.py, it is possible to have a simple text file of a telnet VTY or CTRL interface interaction and run it against a given application. With the --update option, the scripts run the given command and rewrite the transcript file to whatever the application currently produces as response. Backed by version control, it is super easy to tweak commands, --update the test results and verify that only the desired bits changed. A '...' wildcard can skip any number of lines in the expected result and is usually preserved during --update. This python3 implementation is independent from the previous obscvty implementations. Take the opportunity to clarify/fix a few aspects: for example, it is now possible to verify the hints that the interactive VTY displays when the user enters '?' in various places, and to evaluate the prompt character '>'/'#'. Unitl now, code is duplicated/scattered across various vty_test_runner.py scripts in different git repositories. Now, a VTY or CTRL transcript is enough to put a complete test in place. The simplest invocation is directly from the Makefile, feeding an application commandline, the proper port number to contact it and e.g. a VTY prompt name. This new code is also usable as python modules, to be able to build more complex tests that require specialized intermediate actions, possibly coordinating launch of applications or data manipulation. The first repository to employ this is osmo-hlr.git. See change-ids I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 for VTY and Iff93abe370b8f3ecf42082d1d0eaa1fbeca5b122 for CTRL. Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c --- M osmopy/__init__.py A osmopy/osmo_verify_transcript_common.py A osmopy/osmo_verify_transcript_ctrl.py A osmopy/osmo_verify_transcript_vty.py M setup.py 5 files changed, 677 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/osmopy/__init__.py b/osmopy/__init__.py index e211108..01ff3de 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -3,4 +3,7 @@ __all__ = ['obscvty', 'osmodumpdoc', 'osmotestconfig', 'osmotestvty', 'osmoutil', - 'osmo_ipa',] + 'osmo_ipa', + 'osmo_verify_transcript_common', + 'osmo_verify_transcript_vty', + 'osmo_verify_transcript_ctrl'] diff --git a/osmopy/osmo_verify_transcript_common.py b/osmopy/osmo_verify_transcript_common.py new file mode 100644 index 0000000..e4b5553 --- /dev/null +++ b/osmopy/osmo_verify_transcript_common.py @@ -0,0 +1,372 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Common code for verify_transcript_vty.py and verify_transcript_ctrl.py. +''' + +import argparse +import sys +import os +import subprocess +import time +import traceback +import socket +import shlex + + +class Interact: + + class StepBase: + command = None + result = None + leading_blanks = None + + def __init__(self): + self.result = [] + + def verify_interact_state(self, interact_instance): + # for example to verify that the last VTY prompt received shows the + # right node. + pass + + def command_str(self, interact_instance=None): + return self.command + + def __str__(self): + return '%s\n%s' % (self.command_str(), '\n'.join(self.result)) + + @staticmethod + def is_next_step(line, interact_instance): + assert not "implemented by InteractVty.VtyStep and InteractCtrl.CtrlStep" + + socket = None + + def __init__(self, step_class, port, host, verbose=False, update=False): + ''' + host is the hostname to connect to. + port is the CTRL port to connect on. + ''' + self.Step = step_class + self.port = port + self.host = host + self.verbose = verbose + self.update = update + + def connect(self): + assert self.socket is None + retries = 30 + took = 0 + while True: + took += 1 + try: + self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.socket.setblocking(1) + self.socket.connect((self.host, int(self.port))) + except IOError: + retries -= 1 + if retries <= 0: + raise + time.sleep(.1) + continue + break + + def close(self): + if self.socket is None: + return + self.socket.close() + self.socket = None + + def command(self, command): + assert not "implemented separately by InteractVty and InteractCtrl" + + def verify_transcript_file(self, transcript_file): + with open(transcript_file, 'r') as f: + content = f.read() + + try: + result = self.verify_transcript(content) + except: + print('Error while verifying transcript file %r' % transcript_file, file=sys.stderr) + sys.stderr.flush() + raise + + if not self.update: + return + content = '\n'.join(result) + with open(transcript_file, 'w') as f: + f.write(content) + + def verify_transcript(self, transcript): + '''' + transcript is a "screenshot" of a session, a multi-line string + including commands and expected results. + Feed commands to self.command() and verify the expected results. + ''' + + # parse steps + steps = [] + step = None + blank_lines = 0 + for line in transcript.splitlines(): + if not line: + blank_lines += 1 + continue + next_step_started = self.Step.is_next_step(line, self) + if next_step_started: + if step: + steps.append(step) + step = next_step_started + step.leading_blanks = blank_lines + blank_lines = 0 + elif step: + # we only count blank lines directly preceding the start of a + # next step. Insert blank lines in the middle of a response + # back into the response: + if blank_lines: + step.result.extend([''] * blank_lines) + blank_lines = 0 + step.result.append(line) + if step: + steps.append(step) + step = None + + actual_result = [] + + # run steps + step_nr = 0 + for step in steps: + step_nr += 1 + try: + if self.verbose: + if step.leading_blanks: + print('\n' * step.leading_blanks, end='') + print(step.command_str()) + sys.stdout.flush() + + step.verify_interact_state(self) + + res = self.command(step.command) + + if self.verbose: + sys.stderr.flush() + sys.stdout.flush() + print('\n'.join(res)) + sys.stdout.flush() + + if step.leading_blanks: + actual_result.extend([''] * step.leading_blanks) + actual_result.append(step.command_str(self)) + + match_result = self.match_lines(step.result, res) + + if self.update: + if match_result is True: + # preserve any wildcards + actual_result.extend(step.result) + else: + # mismatch, take exactly what came in + actual_result.extend(res) + continue + if match_result is not True: + raise Exception('Result mismatch:\n%s\n\nExpected:\n[\n%s\n]\n\nGot:\n[\n%s\n%s\n]' + % (match_result, step, step.command_str(), '\n'.join(res))) + except: + print('Error during transcript step %d:\n[\n%s\n]' % (step_nr, step), + file=sys.stderr) + sys.stderr.flush() + raise + + # final line ending + actual_result.append('') + return actual_result + + @staticmethod + def match_lines(expect, got): + ''' + Match two lists of strings, allowing certain wildcards: + - In 'expect', if a line is exactly '...', it matches any number of + arbitrary lines in 'got'; the implementation is trivial and skips + lines to the first occurence in 'got' that continues after '...'. + + Return 'True' on match, or a string describing the mismatch. + ''' + def match_line(expect_line, got_line): + return expect_line == got_line + + e = 0 + g = 0 + while e < len(expect): + if expect[e] == '...': + e += 1 + + if e >= len(expect): + # anything left in 'got' is accepted. + return True + + # look for the next occurence of the expected line in 'got' + while g < len(got) and not match_line(expect[e], got[g]): + g += 1 + continue + + if g >= len(got): + return 'Cannot find line %r' % expect[e] + + if not match_line(expect[e], got[g]): + return 'Mismatch:\nExpect:\n%r\nGot:\n%r' % (expect[e], got[g]) + + e += 1 + g += 1 + + if g < len(got): + return 'Did not expect line %r' % got[g] + return True + +def end_process(proc): + if not proc: + return + + rc = proc.poll() + if rc is not None: + print('Process has already terminated with', rc) + proc.wait() + return + + proc.terminate() + time_to_wait_for_term = 5 + wait_step = 0.001 + waited_time = 0 + while True: + # poll returns None if proc is still running + if proc.poll() is not None: + break + waited_time += wait_step + # make wait_step approach 1.0 + wait_step = (1. + 5. * wait_step) / 6. + if waited_time >= time_to_wait_for_term: + break + time.sleep(wait_step) + + if proc.poll() is None: + # termination seems to be slower than that, let's just kill + proc.kill() + print("Killed child process") + elif waited_time > .002: + print("Terminating took %.3fs" % waited_time) + proc.wait() + +class Application: + proc = None + _devnull = None + + @staticmethod + def devnull(): + if Application._devnull is None: + Application._devnull = open(os.devnull, 'w') + return Application._devnull + + def __init__(self, command_tuple, purge_output=True): + self.command_tuple = command_tuple + self.purge_output = purge_output + + def run(self): + out_err = None + if self.purge_output: + out_err = Application.devnull() + + print('Launching: cd %r; %s' % (os.getcwd(), ' '.join(self.command_tuple))) + self.proc = subprocess.Popen(self.command_tuple, stdout=out_err, stderr=out_err) + + def stop(self): + end_process(self.proc) + +def verify_application(command_tuple, interact, transcript_file, verbose): + passed = None + application = None + + sys.stdout.flush() + sys.stderr.flush() + + if command_tuple: + application = Application(command_tuple, purge_output=not verbose) + application.run() + + try: + interact.connect() + interact.verify_transcript_file(transcript_file) + passed = True + except: + traceback.print_exc() + passed = False + interact.close() + + if application: + application.stop() + + sys.stdout.flush() + sys.stderr.flush() + + return passed + +def common_parser(): + parser = argparse.ArgumentParser() + parser.add_argument('-r', '--run', dest='command_str', + help='command to run to launch application to test,' + ' including command line arguments. If omitted, no' + ' application is launched.') + parser.add_argument('-p', '--port', dest='port', + help="Port that the application opens.") + parser.add_argument('-H', '--host', dest='host', default='localhost', + help="Host that the application opens the port on.") + parser.add_argument('-u', '--update', dest='update', action='store_true', + help='Do not verify, but OVERWRITE transcripts based on' + ' the applications current behavior. OVERWRITES TRANSCRIPT' + ' FILES.') + parser.add_argument('-v', '--verbose', action='store_true', + help='Print commands and application output') + parser.add_argument('transcript_files', nargs='*', help='transcript files to verify') + return parser + +def main(command_str, transcript_files, interact, verbose): + + if command_str: + command_tuple = shlex.split(command_str) + else: + command_tuple = None + + results = [] + for t in transcript_files: + passed = verify_application(command_tuple=command_tuple, + interact=interact, + transcript_file=t, + verbose=verbose) + results.append((passed, t)) + + print('\nRESULTS:') + all_passed = True + for passed, t in results: + print('%s: %s' % ('pass' if passed else 'FAIL', t)) + all_passed = all_passed and passed + print() + + if not all_passed: + sys.exit(1) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_ctrl.py b/osmopy/osmo_verify_transcript_ctrl.py new file mode 100755 index 0000000..7afe4bf --- /dev/null +++ b/osmopy/osmo_verify_transcript_ctrl.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run CTRL test transcripts against a given application. + +A CTRL transcript contains CTRL commands and their expected results. +It looks like: + +" +SET 1 var val +SET_REPLY 1 var OK +GET 2 var +GET_REPLY 2 var val +" + +The application to be tested is described by +- a binary to run, +- command line arguments to pass to the binary, +- the CTRL port. + +This module can either be run directly to run or update a given CTRL transcript, +or it can be imported as a module to run more complex setups. +''' + +import re + +from osmopy.osmo_verify_transcript_common import * +from osmopy.osmo_ipa import Ctrl, IPA + +class InteractCtrl(Interact): + next_id = 1 + keep_ids = True + re_command = re.compile('^(SET|GET) ([^ ]*) (.*)$') + + class CtrlStep(Interact.StepBase): + + @staticmethod + def is_next_step(line, interact_instance): + m = InteractCtrl.re_command.match(line) + if not m: + return None + next_step = InteractCtrl.CtrlStep() + + set_get = m.group(1) + cmd_id = m.group(2) + var_val = m.group(3) + if not interact_instance.keep_ids: + cmd_id = interact_instance.next_id + interact_instance.next_id += 1 + next_step.command = '%s %s %s' % (set_get, cmd_id, var_val) + + return next_step + + def __init__(self, port, host, verbose=False, update=False, keep_ids=True): + if not update: + keep_ids = True + self.keep_ids = keep_ids + super().__init__(InteractCtrl.CtrlStep, port=port, host=host, verbose=verbose, update=update) + + def connect(self): + self.next_id = 1 + super().connect() + + def send(self, data): + data = Ctrl().add_header(data) + return self.socket.send(data) == len(data) + + def receive(self): + responses = [] + data = self.socket.recv(4096) + while (len(data)>0): + (response_with_header, data) = IPA().split_combined(data) + response = Ctrl().rem_header(response_with_header) + responses.append(response.decode('utf-8')) + return responses + + def command(self, command): + assert self.send(command) + res = self.receive() + split_responses = [] + for r in res: + split_responses.extend(r.splitlines()) + sys.stdout.flush() + sys.stderr.flush() + return split_responses + +if __name__ == '__main__': + parser = common_parser() + parser.add_argument('-i', '--keep-ids', dest='keep_ids', action='store_true', + help='With --update, default is to overwrite the command IDs' + ' so that they are consecutive numbers starting from 1.' + ' With --keep-ids, do not change these command IDs.') + args = parser.parse_args() + + interact = InteractCtrl(args.port, args.host, args.verbose, args.update, args.keep_ids) + + main(command_str=args.command_str, + transcript_files=args.transcript_files, + interact=interact, + verbose=args.verbose) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_vty.py b/osmopy/osmo_verify_transcript_vty.py new file mode 100755 index 0000000..3a4d630 --- /dev/null +++ b/osmopy/osmo_verify_transcript_vty.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run VTY test transcripts against a given application. + +A VTY transcript contains VTY commands and their expected results. +It looks like: + +" +OsmoHLR> enable + +OsmoHLR# subscriber show imsi 123456789023000 +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber show msisdn 12345 +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber create imsi 123456789023000 +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + No auth data +" + +The application to be tested is described by +- a binary to run, +- command line arguments to pass to the binary, +- the VTY telnet port, +- the application name as printed in the VTY prompt. + +This module can either be run directly to run or update a given VTY transcript, +or it can be imported as a module to run more complex setups. +''' + +import re + +from osmopy.osmo_verify_transcript_common import * + +class InteractVty(Interact): + + class VtyStep(Interact.StepBase): + expect_node = None # e.g. '(config-net)' + expect_prompt_char = None # '>' or '#' + + def __init__(self, prompt): + super().__init__() + self.prompt = prompt + + def verify_interact_state(self, interact_instance): + if interact_instance.update: + return + if interact_instance.this_node != self.expect_node: + raise Exception('Mismatch: expected VTY node %r in the prompt, got %r' + % (self.expect_node, interact_instance.this_node)) + if interact_instance.this_prompt_char != self.expect_prompt_char: + raise Exception('Mismatch: expected VTY prompt character %r, got %r' + % (self.expect_prompt_char, interact_instance.this_prompt_char)) + + @staticmethod + def is_next_step(line, interact_instance): + m = interact_instance.re_prompt.match(line) + if not m: + return None + next_step = InteractVty.VtyStep(interact_instance.prompt) + next_step.expect_node = m.group(1) + next_step.expect_prompt_char = m.group(2) + next_step.command = m.group(3) + return next_step + + def command_str(self, interact_instance=None): + if interact_instance is None: + node = self.expect_node + prompt_char = self.expect_prompt_char + else: + node = interact_instance.last_node + prompt_char = interact_instance.last_prompt_char + if node: + node = '(%s)' % node + node = node or '' + return '%s%s%s %s' % (self.prompt, node, prompt_char, self.command) + + def __init__(self, prompt, port, host, verbose, update): + self.prompt = prompt + self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) + super().__init__(InteractVty.VtyStep, port, host, verbose, update) + + def connect(self): + self.this_node = None + self.this_prompt_char = '>' # slight cheat for initial prompt char + self.last_node = None + self.last_prompt_char = None + + super().connect() + # receive the first welcome message and discard + self.socket.recv(4096) + + def _command(self, command_str, timeout=10): + self.socket.send(command_str.encode()) + + waited_since = time.time() + received_lines = [] + last_line = '' + + while True: + new_data = self.socket.recv(4096).decode('utf-8') + + last_line = "%s%s" % (last_line, new_data) + + if last_line: + lines = last_line.splitlines() + received_lines.extend(lines[:-1]) + last_line = lines[-1] + + match = self.re_prompt.match(last_line) + if not match: + if time.time() - waited_since > timeout: + raise IOError("Failed to read data (did the app crash?)") + time.sleep(.1) + continue + + self.last_node = self.this_node + self.last_prompt_char = self.this_prompt_char + self.this_node = match.group(1) or None + self.this_prompt_char = match.group(2) + break + + # expecting to have received the command we sent as echo, remove it + clean_command_str = command_str.strip() + if clean_command_str.endswith('?'): + clean_command_str = clean_command_str[:-1] + if received_lines and received_lines[0] == clean_command_str: + received_lines = received_lines[1:] + return received_lines + + def command(self, command_str, timeout=10): + command_str = command_str or '\r' + if command_str[-1] not in '?\r\t': + command_str = command_str + '\r' + + received_lines = self._command(command_str, timeout) + + if command_str[-1] == '?': + self._command('\x03', timeout) + + return received_lines + +if __name__ == '__main__': + parser = common_parser() + parser.add_argument('-n', '--prompt-name', dest='prompt', + help="Name used in application's telnet VTY prompt.") + args = parser.parse_args() + + interact = InteractVty(args.prompt, args.port, args.host, args.verbose, args.update) + + main(command_str=args.command_str, + transcript_files=args.transcript_files, + interact=interact, + verbose=args.verbose) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/setup.py b/setup.py index 44e7fd1..9c25a0d 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,9 @@ version = __version__, packages = ["osmopy"], scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py", - "osmopy/osmotestvty.py"], + "osmopy/osmotestvty.py", + "osmopy/osmo_verify_transcript_vty.py", + "osmopy/osmo_verify_transcript_ctrl.py"], license = "AGPLv3", description = "Osmopython: osmocom testing scripts", author = "Katerina Barone-Adesi", -- To view, visit https://gerrit.osmocom.org/4272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id47331009910e651372b9c9c76e12f2e8964cc2c Gerrit-PatchSet: 3 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:02:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:02:16 +0000 Subject: [MERGED] python/osmo-python-tests[master]: add osmo_ipa.py, from originally openbsc.git/contrib/ipa.py In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add osmo_ipa.py, from originally openbsc.git/contrib/ipa.py ...................................................................... add osmo_ipa.py, from originally openbsc.git/contrib/ipa.py At least now that openbsc.git has been split, the IPA and Ctrl API offered by this file are used across multiple git repositories for python tests. Instead of having a separate copy of ipa.py in each, have one here. Rename to osmo_ipa.py to avoid any confusion between old and new files that might be lying around in the python path. Change-Id: Iaef955f04b97e8f266339b37b46d2523d1247cb9 --- M osmopy/__init__.py A osmopy/osmo_ipa.py 2 files changed, 280 insertions(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/osmopy/__init__.py b/osmopy/__init__.py index f6ed99b..e211108 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -2,4 +2,5 @@ __version__ = '0.0.1' __all__ = ['obscvty', 'osmodumpdoc', 'osmotestconfig', 'osmotestvty', - 'osmoutil'] + 'osmoutil', + 'osmo_ipa',] diff --git a/osmopy/osmo_ipa.py b/osmopy/osmo_ipa.py new file mode 100755 index 0000000..71cbf45 --- /dev/null +++ b/osmopy/osmo_ipa.py @@ -0,0 +1,278 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexer: add/remove/parse (extended) header + """ + version = "0.0.5" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL=0x00, CCM=0xFE, SCCP=0xFD, OML=0xFF, OSMO=0xEE, MGCP_OLD=0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL=0, MGCP=1, LAC=2, SMSC=3, ORC=4, GSUP=5, OAP=6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING=0x00, PONG=0x01, ID_GET=0x04, ID_RESP=0x05, ID_ACK=0x06, SCCP_OLD=0xFF) + _IDTAG = dict(SERNR=0, UNITNAME=1, LOCATION=2, TYPE=3, EQUIPVERS=4, SWVERSION=5, IPADDR=6, MACADDR=7, UNIT=8) + CTRL_GET = 'GET' + CTRL_SET = 'SET' + CTRL_REP = 'REPLY' + CTRL_ERR = 'ERR' + CTRL_TRAP = 'TRAP' + + def _l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p is None: + return 'UNKNOWN' + return list(d.keys())[list(d.values()).index(p)] + + def _tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self._l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self._l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self._l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self._l(self._IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext=None): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext is None: + return struct.pack(">HB", len(data) + 1, proto) + data + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + + def del_header(self, data): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length, IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + if not len(data): + return None, None, None, None + (dlen, proto) = struct.unpack('>HB', data[:3]) + if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: # there's extension which we have to unpack + return struct.unpack('>HBB', data[:4]) + (data[4:], ) # length, protocol, extension, data + return dlen, proto, None, data[3:] # length, protocol, _, data + + def split_combined(self, data): + """ + Split the data which contains multiple concatenated IPA messages into tuple (first, rest) where rest contains remaining messages, first is the single IPA message + """ + (length, _, _, _) = self.del_header(data) + return data[:(length + 3)], data[(length + 3):] + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self._tag(self._IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self._tag(self._IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self._tag(self._IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self._tag(self._IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self._tag(self._IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self._tag(self._IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self._tag(self._IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self._tag(self._IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self._tag(self._IDTAG['UNIT'], data) + + def identity(self, unit=b'', mac=b'', location=b'', utype=b'', equip=b'', sw=b'', name=b'', serial=b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING']) + + def pong(self): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG']) + + def id_ack(self): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK']) + + def id_get(self): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET']) + + def id_resp(self, data): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP']) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexer + """ + def __init__(self): + random.seed() + + def add_header(self, data): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL']) + + def rem_header(self, data): + """ + Remove CTRL header, check for appropriate protocol and extension + """ + (_, proto, ext, d) = super(Ctrl, self).del_header(data) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return None + return d + + def parse(self, data, op=None): + """ + Parse Ctrl string returning (var, value) pair + var could be None in case of ERROR message + value could be None in case of GET message + """ + (s, i, v) = data.split(' ', 2) + if s == self.CTRL_ERR: + return None, v + if s == self.CTRL_GET: + return v, None + (s, i, var, val) = data.split(' ', 3) + if s == self.CTRL_TRAP and i != '0': + return None, '%s with non-zero id %s' % (s, i) + if op is not None and i != op: + if s == self.CTRL_GET + '_' + self.CTRL_REP or s == self.CTRL_SET + '_' + self.CTRL_REP: + return None, '%s with unexpected id %s' % (s, i) + return var, val + + def trap(self, var, val): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("%s 0 %s %s" % (self.CTRL_TRAP, var, val)) + + def cmd(self, var, val=None): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxsize) + if val is not None: + return r, self.add_header("%s %s %s %s" % (self.CTRL_SET, r, var, val)) + return r, self.add_header("%s %s %s" % (self.CTRL_GET, r, var)) + + def verify(self, reply, r, var, val=None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val is not None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexer v%s loaded." % IPA.version) -- To view, visit https://gerrit.osmocom.org/4271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaef955f04b97e8f266339b37b46d2523d1247cb9 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:09:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:09:31 +0000 Subject: [PATCH] osmo-hlr[master]: implement subscriber vty interface, tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4273 to look at the new patch set (#3). implement subscriber vty interface, tests Implement VTY commands for subscriber manipulation: - create / delete subscriber - modify MSISDN - add/edit/remove 2G and 3G authentication data - show by IMSI, MSISDN or DB ID. (enable/disable CS/PS and purge/unpurge to follow later.) Implement VTY unit tests for the new commands using new osmo_verify_transcript_vty.py from osmo-python-tests. Depends: libosmocore I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 osmo-python-tests Id47331009910e651372b9c9c76e12f2e8964cc2c Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 --- M src/Makefile.am M src/hlr_vty.c A src/hlr_vty_subscr.c A src/hlr_vty_subscr.h M tests/Makefile.am A tests/test_subscriber.vty 6 files changed, 859 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/73/4273/3 diff --git a/src/Makefile.am b/src/Makefile.am index b410ff3..fc7c653 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,6 +23,7 @@ rand.h \ ctrl.h \ hlr_vty.h \ + hlr_vty_subscr.h \ $(NULL) bin_PROGRAMS = \ @@ -46,6 +47,7 @@ logging.c \ rand_urandom.c \ hlr_vty.c \ + hlr_vty_subscr.c \ $(NULL) osmo_hlr_LDADD = \ diff --git a/src/hlr_vty.c b/src/hlr_vty.c index 946117e..a5eb26f 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -26,6 +26,7 @@ #include #include "hlr_vty.h" +#include "hlr_vty_subscr.h" static struct hlr *g_hlr = NULL; @@ -135,4 +136,6 @@ install_default(GSUP_NODE); install_element(GSUP_NODE, &cfg_hlr_gsup_bind_ip_cmd); + + hlr_vty_subscriber_init(hlr); } diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c new file mode 100644 index 0000000..5704922 --- /dev/null +++ b/src/hlr_vty_subscr.c @@ -0,0 +1,484 @@ +/* OsmoHLR subscriber management VTY implementation */ +/* (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "hlr.h" +#include "db.h" + +struct vty; + +#define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) + +static struct hlr *g_hlr = NULL; + +static void subscr_dump_full_vty(struct vty *vty, struct hlr_subscriber *subscr) +{ + int rc; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + + vty_out(vty, " ID: %"PRIu64"%s", subscr->id, VTY_NEWLINE); + + vty_out(vty, " IMSI: %s%s", subscr->imsi ? subscr->imsi : "none", VTY_NEWLINE); + vty_out(vty, " MSISDN: %s%s", *subscr->msisdn ? subscr->msisdn : "none", VTY_NEWLINE); + if (*subscr->vlr_number) + vty_out(vty, " VLR number: %s%s", subscr->vlr_number, VTY_NEWLINE); + if (*subscr->sgsn_number) + vty_out(vty, " SGSN number: %s%s", subscr->sgsn_number, VTY_NEWLINE); + if (*subscr->sgsn_address) + vty_out(vty, " SGSN address: %s%s", subscr->sgsn_address, VTY_NEWLINE); + if (subscr->periodic_lu_timer) + vty_out(vty, " Periodic LU timer: %u%s", subscr->periodic_lu_timer, VTY_NEWLINE); + if (subscr->periodic_rau_tau_timer) + vty_out(vty, " Periodic RAU/TAU timer: %u%s", subscr->periodic_rau_tau_timer, VTY_NEWLINE); + if (subscr->lmsi) + vty_out(vty, " LMSI: %x%s", subscr->lmsi, VTY_NEWLINE); + if (!subscr->nam_cs) + vty_out(vty, " CS disabled%s", VTY_NEWLINE); + if (subscr->ms_purged_cs) + vty_out(vty, " CS purged%s", VTY_NEWLINE); + if (!subscr->nam_ps) + vty_out(vty, " PS disabled%s", VTY_NEWLINE); + if (subscr->ms_purged_ps) + vty_out(vty, " PS purged%s", VTY_NEWLINE); + + if (!*subscr->imsi) + return; + + OSMO_ASSERT(g_hlr); + rc = db_get_auth_data(g_hlr->dbc, subscr->imsi, &aud2g, &aud3g, NULL); + + if (rc) { + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else { + vty_out(vty, "%% Error retrieving data from database (%d)%s", rc, VTY_NEWLINE); + return; + } + } + + if (aud2g.type != OSMO_AUTH_TYPE_NONE && aud2g.type != OSMO_AUTH_TYPE_GSM) { + vty_out(vty, "%% Error: 2G auth data is not of type 'GSM'%s", VTY_NEWLINE); + aud2g = (struct osmo_sub_auth_data){}; + } + + if (aud3g.type != OSMO_AUTH_TYPE_NONE && aud3g.type != OSMO_AUTH_TYPE_UMTS) { + vty_out(vty, "%% Error: 3G auth data is not of type 'UMTS'%s", VTY_NEWLINE); + aud3g = (struct osmo_sub_auth_data){}; + } + + if (aud2g.algo != OSMO_AUTH_ALG_NONE && aud2g.type != OSMO_AUTH_TYPE_NONE) { + vty_out(vty, " 2G auth: %s%s", + osmo_auth_alg_name(aud2g.algo), VTY_NEWLINE); + vty_out(vty, " KI=%s%s", + hexdump_buf(aud2g.u.gsm.ki), VTY_NEWLINE); + } + + if (aud3g.algo != OSMO_AUTH_ALG_NONE && aud3g.type != OSMO_AUTH_TYPE_NONE) { + vty_out(vty, " 3G auth: %s%s", osmo_auth_alg_name(aud3g.algo), VTY_NEWLINE); + vty_out(vty, " K=%s%s", hexdump_buf(aud3g.u.umts.k), VTY_NEWLINE); + vty_out(vty, " %s=%s%s", aud3g.u.umts.opc_is_op? "OP" : "OPC", + hexdump_buf(aud3g.u.umts.opc), VTY_NEWLINE); + vty_out(vty, " IND-bitlen=%u", aud3g.u.umts.ind_bitlen); + if (aud3g.u.umts.sqn) + vty_out(vty, " last-SQN=%"PRIu64, aud3g.u.umts.sqn); + vty_out(vty, VTY_NEWLINE); + } +} + +static int get_subscr_by_argv(struct vty *vty, const char *type, const char *id, struct hlr_subscriber *subscr) +{ + int rc = -1; + if (strcmp(type, "imsi") == 0) + rc = db_subscr_get_by_imsi(g_hlr->dbc, id, subscr); + else if (strcmp(type, "msisdn") == 0) + rc = db_subscr_get_by_msisdn(g_hlr->dbc, id, subscr); + else if (strcmp(type, "id") == 0) + rc = db_subscr_get_by_id(g_hlr->dbc, atoll(id), subscr); + if (rc) + vty_out(vty, "%% No subscriber for %s = '%s'%s", + type, id, VTY_NEWLINE); + return rc; +} + +#define SUBSCR_CMD "subscriber " +#define SUBSCR_CMD_HELP "Subscriber management commands\n" + +#define SUBSCR_ID "(imsi|msisdn|id) IDENT " +#define SUBSCR_ID_HELP \ + "Identify subscriber by IMSI\n" \ + "Identify subscriber by MSISDN (phone number)\n" \ + "Identify subscriber by database ID\n" \ + "IMSI/MSISDN/ID of the subscriber\n" + +#define SUBSCR SUBSCR_CMD SUBSCR_ID +#define SUBSCR_HELP SUBSCR_CMD_HELP SUBSCR_ID_HELP + +#define SUBSCR_UPDATE SUBSCR "update " +#define SUBSCR_UPDATE_HELP SUBSCR_HELP "Set or update subscriber data\n" + +DEFUN(subscriber_show, + subscriber_show_cmd, + SUBSCR "show", + SUBSCR_HELP "Show subscriber information\n") +{ + struct hlr_subscriber subscr; + const char *id_type = argv[0]; + const char *id = argv[1]; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + subscr_dump_full_vty(vty, &subscr); + return CMD_SUCCESS; +} + +DEFUN(subscriber_create, + subscriber_create_cmd, + SUBSCR_CMD "imsi IDENT create", + SUBSCR_CMD_HELP + "Create subscriber by IMSI\n" + "IMSI/MSISDN/ID of the subscriber\n") +{ + int rc; + struct hlr_subscriber subscr; + const char *imsi = argv[0]; + + if (!osmo_imsi_str_valid(imsi)) { + vty_out(vty, "%% Not a valid IMSI: %s%s", imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + rc = db_subscr_create(g_hlr->dbc, imsi); + + if (rc) { + if (rc == -EEXIST) + vty_out(vty, "%% Subscriber already exists for IMSI = %s%s", + imsi, VTY_NEWLINE); + else + vty_out(vty, "%% Error (rc=%d): cannot create subscriber for IMSI = %s%s", + rc, imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + rc = db_subscr_get_by_imsi(g_hlr->dbc, imsi, &subscr); + vty_out(vty, "%% Created subscriber %s%s", imsi, VTY_NEWLINE); + + subscr_dump_full_vty(vty, &subscr); + + return CMD_SUCCESS; +} + +DEFUN(subscriber_delete, + subscriber_delete_cmd, + SUBSCR "delete", + SUBSCR_HELP "Delete subscriber from database\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + + /* Find out the IMSI regardless of which way the caller decided to + * identify the subscriber by. */ + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_delete_by_id(g_hlr->dbc, subscr.id); + if (rc) { + vty_out(vty, "%% Error: Failed to remove subscriber for IMSI '%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% Deleted subscriber for IMSI '%s'%s", subscr.imsi, VTY_NEWLINE); + return CMD_SUCCESS; +} + +DEFUN(subscriber_msisdn, + subscriber_msisdn_cmd, + SUBSCR_UPDATE "msisdn MSISDN", + SUBSCR_UPDATE_HELP + "Set MSISDN (phone number) of the subscriber\n" + "New MSISDN (phone number)\n") +{ + struct hlr_subscriber subscr; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *msisdn = argv[2]; + + if (strlen(msisdn) > sizeof(subscr.msisdn) - 1) { + vty_out(vty, "%% MSISDN is too long, max. %zu characters are allowed%s", + sizeof(subscr.msisdn)-1, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!osmo_msisdn_str_valid(msisdn)) { + vty_out(vty, "%% MSISDN invalid: '%s'%s", msisdn, VTY_NEWLINE); + return CMD_WARNING; + } + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + if (db_subscr_update_msisdn_by_imsi(g_hlr->dbc, subscr.imsi, msisdn)) { + vty_out(vty, "%% Error: cannot update MSISDN for subscriber IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% Updated subscriber IMSI='%s' to MSISDN='%s'%s", + subscr.imsi, msisdn, VTY_NEWLINE); + return CMD_SUCCESS; +} + +static bool is_hexkey_valid(struct vty *vty, const char *label, + const char *hex_str, int minlen, int maxlen) +{ + if (osmo_is_hexstr(hex_str, minlen * 2, maxlen * 2, true)) + return true; + vty_out(vty, "%% Invalid value for %s: '%s'%s", label, hex_str, VTY_NEWLINE); + return false; +} + +#define AUTH_ALG_TYPES_2G "(comp128v1|comp128v2|comp128v3|xor)" +#define AUTH_ALG_TYPES_2G_HELP \ + "Use COMP128v1 algorithm\n" \ + "Use COMP128v2 algorithm\n" \ + "Use COMP128v3 algorithm\n" \ + "Use XOR algorithm\n" + +#define AUTH_ALG_TYPES_3G "milenage" +#define AUTH_ALG_TYPES_3G_HELP \ + "Use Milenage algorithm\n" + +#define A38_XOR_MIN_KEY_LEN 12 +#define A38_XOR_MAX_KEY_LEN 16 +#define A38_COMP128_KEY_LEN 16 + +#define MILENAGE_KEY_LEN 16 + +static bool auth_algo_parse(const char *alg_str, enum osmo_auth_algo *algo, + int *minlen, int *maxlen) +{ + if (!strcasecmp(alg_str, "none")) { + *algo = OSMO_AUTH_ALG_NONE; + *minlen = *maxlen = 0; + } else if (!strcasecmp(alg_str, "comp128v1")) { + *algo = OSMO_AUTH_ALG_COMP128v1; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v2")) { + *algo = OSMO_AUTH_ALG_COMP128v2; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v3")) { + *algo = OSMO_AUTH_ALG_COMP128v3; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "xor")) { + *algo = OSMO_AUTH_ALG_XOR; + *minlen = A38_XOR_MIN_KEY_LEN; + *maxlen = A38_XOR_MAX_KEY_LEN; + } else if (!strcasecmp(alg_str, "milenage")) { + *algo = OSMO_AUTH_ALG_MILENAGE; + *minlen = *maxlen = MILENAGE_KEY_LEN; + } else + return false; + return true; +} + +DEFUN(subscriber_no_aud2g, + subscriber_no_aud2g_cmd, + SUBSCR_UPDATE "aud2g none", + SUBSCR_UPDATE_HELP + "Set 2G authentication data\n" + "Delete 2G authentication data\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + struct sub_auth_data_str aud = { + .type = OSMO_AUTH_TYPE_GSM, + .algo = OSMO_AUTH_ALG_NONE, + }; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud); + + if (rc) { + vty_out(vty, "%% Error: cannot disable 2G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_aud2g, + subscriber_aud2g_cmd, + SUBSCR_UPDATE "aud2g " AUTH_ALG_TYPES_2G " ki KI", + SUBSCR_UPDATE_HELP + "Set 2G authentication data\n" + AUTH_ALG_TYPES_2G_HELP + "Set Ki Encryption Key\n" "Ki as 32 hexadecimal characters\n") +{ + struct hlr_subscriber subscr; + int rc; + int minlen = 0; + int maxlen = 0; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *alg_type = argv[2]; + const char *ki = argv[3]; + struct sub_auth_data_str aud2g = { + .type = OSMO_AUTH_TYPE_GSM, + .u.gsm.ki = ki, + }; + + if (!auth_algo_parse(alg_type, &aud2g.algo, &minlen, &maxlen)) { + vty_out(vty, "%% Unknown auth algorithm: '%s'%s", alg_type, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!is_hexkey_valid(vty, "KI", aud2g.u.gsm.ki, minlen, maxlen)) + return CMD_WARNING; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud2g); + + if (rc) { + vty_out(vty, "%% Error: cannot set 2G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_no_aud3g, + subscriber_no_aud3g_cmd, + SUBSCR_UPDATE "aud3g none", + SUBSCR_UPDATE_HELP + "Set UMTS authentication data (3G, and 2G with UMTS AKA)\n" + "Delete 3G authentication data\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + struct sub_auth_data_str aud = { + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_NONE, + }; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud); + + if (rc) { + vty_out(vty, "%% Error: cannot disable 3G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_aud3g, + subscriber_aud3g_cmd, + SUBSCR_UPDATE "aud3g " AUTH_ALG_TYPES_3G + " k K" + " (op|opc) OP_C" + " [ind-bitlen] [<0-28>]", + SUBSCR_UPDATE_HELP + "Set UMTS authentication data (3G, and 2G with UMTS AKA)\n" + AUTH_ALG_TYPES_3G_HELP + "Set Encryption Key K\n" "K as 32 hexadecimal characters\n" + "Set OP key\n" "Set OPC key\n" "OP or OPC as 32 hexadecimal characters\n" + "Set IND bit length\n" "IND bit length value (default: 5)\n") +{ + struct hlr_subscriber subscr; + int minlen = 0; + int maxlen = 0; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *alg_type = AUTH_ALG_TYPES_3G; + const char *k = argv[2]; + bool opc_is_op = (strcasecmp("op", argv[3]) == 0); + const char *op_opc = argv[4]; + int ind_bitlen = argc > 6? atoi(argv[6]) : 5; + struct sub_auth_data_str aud3g = { + .type = OSMO_AUTH_TYPE_UMTS, + .u.umts = { + .k = k, + .opc_is_op = opc_is_op, + .opc = op_opc, + .ind_bitlen = ind_bitlen, + }, + }; + + if (!auth_algo_parse(alg_type, &aud3g.algo, &minlen, &maxlen)) { + vty_out(vty, "%% Unknown auth algorithm: '%s'%s", alg_type, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!is_hexkey_valid(vty, "K", aud3g.u.umts.k, minlen, maxlen)) + return CMD_WARNING; + + if (!is_hexkey_valid(vty, opc_is_op ? "OP" : "OPC", aud3g.u.umts.opc, + MILENAGE_KEY_LEN, MILENAGE_KEY_LEN)) + return CMD_WARNING; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud3g); + + if (rc) { + vty_out(vty, "%% Error: cannot set 3G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +void hlr_vty_subscriber_init(struct hlr *hlr) +{ + g_hlr = hlr; + + install_element_ve(&subscriber_show_cmd); + install_element(ENABLE_NODE, &subscriber_create_cmd); + install_element(ENABLE_NODE, &subscriber_delete_cmd); + install_element(ENABLE_NODE, &subscriber_msisdn_cmd); + install_element(ENABLE_NODE, &subscriber_no_aud2g_cmd); + install_element(ENABLE_NODE, &subscriber_aud2g_cmd); + install_element(ENABLE_NODE, &subscriber_no_aud3g_cmd); + install_element(ENABLE_NODE, &subscriber_aud3g_cmd); +} diff --git a/src/hlr_vty_subscr.h b/src/hlr_vty_subscr.h new file mode 100644 index 0000000..841db5a --- /dev/null +++ b/src/hlr_vty_subscr.h @@ -0,0 +1,3 @@ +#pragma once + +void hlr_vty_subscriber_init(struct hlr *hlr); diff --git a/tests/Makefile.am b/tests/Makefile.am index 0b625f5..8f1826d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,6 +26,7 @@ testsuite.at \ $(srcdir)/package.m4 \ $(TESTSUITE) \ + test_subscriber.vty \ ctrl_test_runner.py \ $(NULL) @@ -36,10 +37,26 @@ $(NULL) if ENABLE_EXT_TESTS -python-tests: $(BUILT_SOURCES) +python-tests: +# don't run vty and ctrl tests concurrently so that the ports don't conflict + $(MAKE) vty-test $(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v + +VTY_TEST_DB = hlr_vty_test.db + +# To update the VTY script from current application behavior, +# pass -u to vty_script_runner.py by doing: +# make vty-test U=-u +vty-test: + -rm -f $(VTY_TEST_DB) + sqlite3 $(VTY_TEST_DB) < $(top_srcdir)/sql/hlr.sql + osmo_verify_transcript_vty.py -v \ + -n OsmoHLR -p 4258 \ + -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_vty_test.db" \ + $(U) $(srcdir)/*.vty + -rm -f $(VTY_TEST_DB) else -python-tests: $(BUILT_SOURCES) +python-tests: echo "Not running python-based tests (determined at configure-time)" endif diff --git a/tests/test_subscriber.vty b/tests/test_subscriber.vty new file mode 100644 index 0000000..2e0bdce --- /dev/null +++ b/tests/test_subscriber.vty @@ -0,0 +1,348 @@ +OsmoHLR> enable + +OsmoHLR# list +... + subscriber (imsi|msisdn|id) IDENT show + subscriber imsi IDENT create + subscriber (imsi|msisdn|id) IDENT delete + subscriber (imsi|msisdn|id) IDENT update msisdn MSISDN + subscriber (imsi|msisdn|id) IDENT update aud2g none + subscriber (imsi|msisdn|id) IDENT update aud2g (comp128v1|comp128v2|comp128v3|xor) ki KI + subscriber (imsi|msisdn|id) IDENT update aud3g none + subscriber (imsi|msisdn|id) IDENT update aud3g milenage k K (op|opc) OP_C [ind-bitlen] [<0-28>] + +OsmoHLR# subscriber? + subscriber Subscriber management commands + +OsmoHLR# subscriber ? + imsi Identify subscriber by IMSI + msisdn Identify subscriber by MSISDN (phone number) + id Identify subscriber by database ID + +OsmoHLR# subscriber imsi ? + IDENT IMSI/MSISDN/ID of the subscriber +OsmoHLR# subscriber msisdn ? + IDENT IMSI/MSISDN/ID of the subscriber +OsmoHLR# subscriber id ? + IDENT IMSI/MSISDN/ID of the subscriber + +OsmoHLR# subscriber imsi 123456789023000 show +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber id 1 show +% No subscriber for id = '1' +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 1234567890230001 create +% Not a valid IMSI: 1234567890230001 +OsmoHLR# subscriber imsi 12345678902300x create +% Not a valid IMSI: 12345678902300x +OsmoHLR# subscriber imsi 12345 create +% Not a valid IMSI: 12345 + +OsmoHLR# subscriber imsi 123456789023000 create +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: none +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: none +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 123456789023000 update msisdn 12345 +% Updated subscriber IMSI='123456789023000' to MSISDN='12345' + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 +OsmoHLR# subscriber msisdn 12345 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 + +OsmoHLR# subscriber msisdn 12345 update msisdn 423 +% Updated subscriber IMSI='123456789023000' to MSISDN='423' +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + +OsmoHLR# subscriber imsi 123456789023000 update ? + msisdn Set MSISDN (phone number) of the subscriber + aud2g Set 2G authentication data + aud3g Set UMTS authentication data (3G, and 2G with UMTS AKA) + +OsmoHLR# subscriber imsi 123456789023000 update aud2g ? + none Delete 2G authentication data + comp128v1 Use COMP128v1 algorithm + comp128v2 Use COMP128v2 algorithm + comp128v3 Use COMP128v3 algorithm + xor Use XOR algorithm + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ? + ki Set Ki Encryption Key + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki ? + KI Ki as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki val ? + + +OsmoHLR# subscriber imsi 123456789023000 update aud2g xor ki Deaf0ff1ceD0d0DabbedD1ced1ceF00d +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: XOR + KI=deaf0ff1ced0d0dabbedd1ced1cef00d + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki BeefedCafeFaceAcedAddedDecadeFee +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee + +OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef + +OsmoHLR# subscriber msisdn 423 update aud2g comp128v3 ki C01ffedC1cadaeAc1d1f1edAcac1aB0a +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g nonsense ki BeefedCafeFaceAcedAddedDecadeFee +% Unknown command. +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g milenage ki BeefedCafeFaceAcedAddedDecadeFee +% Unknown command. +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g xor ki CoiffedCicadaeAcidifiedAcaciaBoa +% Invalid value for KI: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g xor ki C01ffedC1cadaeAc1d1f1edAcac1aB0aX +% Invalid value for KI: 'C01ffedC1cadaeAc1d1f1edAcac1aB0aX' +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g none +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + + +OsmoHLR# subscriber imsi 123456789023000 update aud3g ? + none Delete 3G authentication data + milenage Use Milenage algorithm + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage ? + k Set Encryption Key K + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k ? + K K as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d ? + op Set OP key + opc Set OPC key + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc ? + OP_C OP or OPC as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ? + [ind-bitlen] Set IND bit length + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ind-bitlen ? + [<0-28>] IND bit length value (default: 5) + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=5 + + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op DeafBeddedBabeAcceededFadedDecaf +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OP=deafbeddedbabeacceededfadeddecaf + IND-bitlen=5 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g none +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ind-bitlen 23 +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k CoiffedCicadaeAcidifiedAcaciaBoa opc CededEffacedAceFacedBadFadedBeef +% Invalid value for K: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CoiffedCicadaeAcidifiedAcaciaBoa +% Invalid value for OPC: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op CoiffedCicadaeAcidifiedAcaciaBoa +% Invalid value for OP: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 delete +% Deleted subscriber for IMSI '123456789023000' + +OsmoHLR# subscriber imsi 123456789023000 show +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber id 1 show +% No subscriber for id = '1' +OsmoHLR# subscriber msisdn 423 show +% No subscriber for msisdn = '423' + +OsmoHLR# subscriber imsi 123456789023000 create +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + +OsmoHLR# subscriber imsi 123456789023000 delete +% Deleted subscriber for IMSI '123456789023000' -- To view, visit https://gerrit.osmocom.org/4273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:09:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:09:35 +0000 Subject: [PATCH] osmo-hlr[master]: add lu_op_free(), use in luop.c Message-ID: Review at https://gerrit.osmocom.org/4306 add lu_op_free(), use in luop.c Add to luop.h, it will be used in db_hlr.c in an upcoming patch. Change-Id: Ib44d9062edc957d2e0710b7e485604f97e4d5612 --- M src/luop.c M src/luop.h 2 files changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/06/4306/1 diff --git a/src/luop.c b/src/luop.c index 1b17fe3..3bedbaa 100644 --- a/src/luop.c +++ b/src/luop.c @@ -114,6 +114,14 @@ return luop; } +void lu_op_free(struct lu_operation *luop) +{ + /* Only attempt to remove when it was ever added to a list. */ + if (luop->list.next) + llist_del(&luop->list); + talloc_free(luop); +} + struct lu_operation *lu_op_alloc_conn(struct osmo_gsup_conn *conn) { uint8_t *peer_addr; @@ -183,8 +191,7 @@ _luop_tx_gsup(luop, &gsup); - llist_del(&luop->list); - talloc_free(luop); + lu_op_free(luop); } /*! Transmit UPD_LOC_RESULT and destroy lu_operation */ @@ -197,8 +204,7 @@ _luop_tx_gsup(luop, &gsup); - llist_del(&luop->list); - talloc_free(luop); + lu_op_free(luop); } /*! Send Cancel Location to old VLR/SGSN */ diff --git a/src/luop.h b/src/luop.h index ab1bc24..053a025 100644 --- a/src/luop.h +++ b/src/luop.h @@ -79,3 +79,5 @@ void lu_op_tx_cancel_old(struct lu_operation *luop); void lu_op_tx_insert_subscr_data(struct lu_operation *luop); void lu_op_tx_del_subscr_data(struct lu_operation *luop); + +void lu_op_free(struct lu_operation *luop); -- To view, visit https://gerrit.osmocom.org/4306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib44d9062edc957d2e0710b7e485604f97e4d5612 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:09:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:09:35 +0000 Subject: [PATCH] osmo-hlr[master]: luop: fix mem leak upon error in lu_op_alloc_conn() Message-ID: Review at https://gerrit.osmocom.org/4307 luop: fix mem leak upon error in lu_op_alloc_conn() Free allocated luop if osmo_gsup_conn_ccm_get() fails. Change-Id: I3ebd5fb5e313be452de893248dd58b2bb73ba94a --- M src/luop.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/07/4307/1 diff --git a/src/luop.c b/src/luop.c index 3bedbaa..ef416ac 100644 --- a/src/luop.c +++ b/src/luop.c @@ -127,8 +127,10 @@ uint8_t *peer_addr; struct lu_operation *luop = lu_op_alloc(conn->server); int rc = osmo_gsup_conn_ccm_get(conn, &peer_addr, IPAC_IDTAG_SERNR); - if (rc < 0) + if (rc < 0) { + lu_op_free(luop); return NULL; + } luop->peer = talloc_memdup(luop, peer_addr, rc); -- To view, visit https://gerrit.osmocom.org/4307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ebd5fb5e313be452de893248dd58b2bb73ba94a Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:09:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:09:35 +0000 Subject: [PATCH] osmo-hlr[master]: fix mem leak in handle_cmd_ps(): free luop Message-ID: Review at https://gerrit.osmocom.org/4308 fix mem leak in handle_cmd_ps(): free luop Each GSUP client creates a luop, but since lu_op_tx_del_subscr_data() doesn't free the luop, each allocated luop leaks memory. Change-Id: If912dc992bc7f18c49d22ec0436d9679c1cd04f6 --- M src/ctrl.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/08/4308/1 diff --git a/src/ctrl.c b/src/ctrl.c index 8682e14..74172c4 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -54,6 +54,7 @@ luop = lu_op_alloc_conn(co); lu_op_fill_subscr(luop, ctx->dbc, cmd->value); lu_op_tx_del_subscr_data(luop); + lu_op_free(luop); } } -- To view, visit https://gerrit.osmocom.org/4308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If912dc992bc7f18c49d22ec0436d9679c1cd04f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:09:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:09:35 +0000 Subject: [PATCH] osmo-hlr[master]: api doc: say that lu_op_tx_del_subscr_data() doesn't free Message-ID: Review at https://gerrit.osmocom.org/4309 api doc: say that lu_op_tx_del_subscr_data() doesn't free Change-Id: Ia341d8e5bfc6eb0dc59945281ce88eecfaab057e --- M src/luop.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/09/4309/1 diff --git a/src/luop.c b/src/luop.c index ef416ac..2966380 100644 --- a/src/luop.c +++ b/src/luop.c @@ -275,7 +275,8 @@ osmo_timer_schedule(&luop->timer, ISD_TIMEOUT_SECS, 0); } -/*! Transmit Delete Subscriber Data to new VLR/SGSN */ +/*! Transmit Delete Subscriber Data to new VLR/SGSN. + * The luop is not freed. */ void lu_op_tx_del_subscr_data(struct lu_operation *luop) { struct osmo_gsup_message gsup; -- To view, visit https://gerrit.osmocom.org/4309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia341d8e5bfc6eb0dc59945281ce88eecfaab057e Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:09:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:09:36 +0000 Subject: [PATCH] osmo-hlr[master]: add hlr_subsrc_nam to put GSUP client notification in proper... Message-ID: Review at https://gerrit.osmocom.org/4310 add hlr_subsrc_nam to put GSUP client notification in proper API This code should not live in a CTRL interface function but be proper hlr_* API. Change-Id: I4c9b8f9ad51d49517474e8b51afc3cc2e1c9299a --- M src/ctrl.c M src/db.h M src/db_hlr.c 3 files changed, 53 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/10/4310/1 diff --git a/src/ctrl.c b/src/ctrl.c index 74172c4..3bd4d8f 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -35,31 +35,19 @@ static int handle_cmd_ps(struct hlr *ctx, struct ctrl_cmd *cmd, bool enable) { - struct lu_operation *luop = NULL; - struct osmo_gsup_conn *co; + struct hlr_subscriber subscr; - if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, NULL) < 0) { + if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, &subscr) < 0) { cmd->reply = "Subscriber Unknown in HLR"; return CTRL_CMD_ERROR; } - if (db_subscr_nam(ctx->dbc, cmd->value, enable, true) < 0) { + if (hlr_subscr_nam(ctx, &subscr, enable, true) < 0) { cmd->reply = "Error updating DB"; return CTRL_CMD_ERROR; } - /* FIXME: only send to single SGSN where latest update for IMSI came from */ - if (!enable) { - llist_for_each_entry(co, &ctx->gs->clients, list) { - luop = lu_op_alloc_conn(co); - lu_op_fill_subscr(luop, ctx->dbc, cmd->value); - lu_op_tx_del_subscr_data(luop); - lu_op_free(luop); - } - } - cmd->reply = "OK"; - return CTRL_CMD_REPLY; } diff --git a/src/db.h b/src/db.h index f6aaa58..dcffe5a 100644 --- a/src/db.h +++ b/src/db.h @@ -125,3 +125,5 @@ int db_subscr_purge(struct db_context *dbc, const char *by_imsi, bool purge_val, bool is_ps); + +int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps); diff --git a/src/db_hlr.c b/src/db_hlr.c index cf6e4f8..088a0ee 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -609,3 +609,51 @@ return ret; } + +/*! Update subscriber database and trigger notifications to GSUP clients. + * \param hlr Global hlr context. + * \param subscr Subscriber from a fresh db_subscr_get_by_*() call. + * \param nam_val True to enable CS/PS, false to disable. + * \param is_ps True to enable/disable PS, false for CS. + * \returns 0 on success, ENOEXEC if there is no need to change, a negative + * value on error. + */ +int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps) +{ + int rc; + struct lu_operation *luop; + struct osmo_gsup_conn *co; + bool is_val = is_ps? subscr->nam_ps : subscr->nam_cs; + + if (is_val == nam_val) { + LOGHLR(subscr->imsi, LOGL_DEBUG, "Already the requested value when asked to %s %s\n", + nam_val ? "enable" : "disable", is_ps ? "PS" : "CS"); + return ENOEXEC; + } + + rc = db_subscr_nam(hlr->dbc, subscr->imsi, nam_val, is_ps); + if (rc) + return rc > 0? -rc : rc; + + /* If we're disabling, send a notice out to the GSUP client that is + * responsible. Otherwise no need. */ + if (nam_val) + return 0; + + /* FIXME: only send to single SGSN where latest update for IMSI came from */ + llist_for_each_entry(co, &hlr->gs->clients, list) { + luop = lu_op_alloc_conn(co); + if (!luop) { + LOGHLR(subscr->imsi, LOGL_ERROR, + "Cannot notify GSUP client, cannot allocate lu_operation," + " for %s:%u\n", + co && co->conn && co->conn->server? co->conn->server->addr : "unset", + co && co->conn && co->conn->server? co->conn->server->port : 0); + continue; + } + lu_op_fill_subscr(luop, ctx->dbc, cmd->value); + lu_op_tx_del_subscr_data(luop); + lu_op_free(luop); + } + return 0; +} -- To view, visit https://gerrit.osmocom.org/4310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4c9b8f9ad51d49517474e8b51afc3cc2e1c9299a Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:09:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:09:36 +0000 Subject: [PATCH] osmo-hlr[master]: ctrl: completely replace all CTRL commands Message-ID: Review at https://gerrit.osmocom.org/4311 ctrl: completely replace all CTRL commands The previous commands are not conforming to how the CTRL interface is intended to work: SET enable-ps SET disable-ps SET status-ps 'status-ps' is a write-only command even though it returns the status. 'enable-ps' / 'disable-ps' indicate the value instead of a variable name of an entity. The entity takes the place of the variable value. See also https://lists.osmocom.org/pipermail/openbsc/2017-September/011236.html Instead, replace with SET subscriber.by-imsi-123456.ps-enabled {0,1} GET subscriber.by-imsi-123456.ps-enabled and also provide further CTRL functions while at it: {SET,GET} subscriber.by-{imsi,msisdn,id}-123456.{cs,ps}-enabled {0,1} GET subscriber.by-{imsi,msisdn,id}-123456.{info,info-aud,info-all} Provide CTRL tests in the form of transcripts. This is the first time an application uses CTRL_NODE ids that are defined outside of libosmocore, see 'Depends' below. Implementation choice: the first idea was to have a '.' between the 'by-xxx' and the value, like: subscriber.by-xxx.123456.function but the difficulty with subscribers is that they are not in RAM, and I can't just point node_data at a struct instance that is always there (like, say, a global bts[0] struct in osmo-bsc). Instead, I want to store the selector and later decide whether to read from the DB or whatever. With a '.' separating things, the only way in a ctrl function to obtain both 'by-xxx' and '123456' for picking a subscriber record would be to parse the entire variable path string elements, including 'subscriber' and 'function', which would then also clumsily fix at which node level we hook these commands; there could have been separate CTRL_NODE_SUBSCR_BY_{IMSI,MSISDN,ID} parent nodes, but we cannot introspect the current parent node dynamically within a ctrl function handler (plus I'm not sure whether it's possible and a good idea to have the same command under multiple parent nodes). Rather than that, I store the 'by-foo-123' token in the node_data pointer to have both bits of information pointed at by a single pointer; I use the incoming command parsing to get this token pre-separated from surrounding node names, and no need to re-allocate it, since the vector of tokens lives until after command execution is complete. Each leaf command obtains this token from cmd->node (aka node_data), and feeds this token to a common static function to parse selector and value from it and to retrieve a subscriber record as needed. (BTW, I have mentioned on the mailing list that this way might be necessary to avoid numeric-only CTRL node names, but we don't need to, and that is not at all related to this choice of structure.) Depends: libosmocore I1bd62ae0d4eefde7e1517db15a2155640a1bab58 Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 --- M src/ctrl.c M src/ctrl.h M src/hlr.c M tests/test_subscriber.ctrl M tests/test_subscriber.sql A tests/test_subscriber_errors.ctrl 6 files changed, 874 insertions(+), 74 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/11/4311/1 diff --git a/src/ctrl.c b/src/ctrl.c index 3bd4d8f..a0dbc2f 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -21,87 +21,390 @@ */ #include +#include +#include +#include -#include -#include +#include #include -#include "gsup_server.h" -#include "logging.h" -#include "db.h" #include "hlr.h" -#include "luop.h" #include "ctrl.h" +#include "db.h" -static int handle_cmd_ps(struct hlr *ctx, struct ctrl_cmd *cmd, bool enable) +#define SEL_BY "by-" +#define SEL_BY_IMSI SEL_BY "imsi-" +#define SEL_BY_MSISDN SEL_BY "msisdn-" +#define SEL_BY_ID SEL_BY "id-" + +#define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) + +static bool startswith(const char *str, const char *start) +{ + return strncmp(str, start, strlen(start)) == 0; +} + +static int _get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr) +{ + const char *val; + if (startswith(by_selector, SEL_BY_IMSI)) { + val = by_selector + strlen(SEL_BY_IMSI); + if (!osmo_imsi_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_imsi(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_MSISDN)) { + val = by_selector + strlen(SEL_BY_MSISDN); + if (!osmo_msisdn_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_msisdn(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_ID)) { + int64_t id; + char *endptr; + val = by_selector + strlen(SEL_BY_ID); + if (*val == '+') + return -EINVAL; + errno = 0; + id = strtoll(val, &endptr, 10); + if (errno || *endptr) + return -EINVAL; + return db_subscr_get_by_id(dbc, id, subscr); + } + return -ENOTSUP; +} + +static bool get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr, + struct ctrl_cmd *cmd) +{ + int rc = _get_subscriber(dbc, by_selector, subscr); + switch (rc) { + case 0: + return true; + case -ENOTSUP: + cmd->reply = "Not a known subscriber 'by-xxx-' selector."; + return false; + case -EINVAL: + cmd->reply = "Invalid value part of 'by-xxx-value' selector."; + return false; + case -ENOENT: + cmd->reply = "No such subscriber."; + return false; + default: + cmd->reply = NULL; + return false; + } +} + +/* Optimization: if a subscriber operation is requested by-imsi, just return + * the IMSI right back. */ +static const char *get_subscriber_imsi(struct db_context *dbc, + const char *by_selector, + struct ctrl_cmd *cmd) +{ + static struct hlr_subscriber subscr; + + if (startswith(by_selector, SEL_BY_IMSI)) + return by_selector + strlen(SEL_BY_IMSI); + if (!get_subscriber(dbc, by_selector, &subscr, cmd)) + return NULL; + return subscr.imsi; +} + +#define reply_printf(cmd, fmt, args ...) \ + do { \ + if (!cmd->reply) \ + cmd->reply = talloc_asprintf(cmd, fmt, ## args); \ + else \ + cmd->reply = talloc_asprintf_append((char*)cmd->reply, fmt, ## args); \ + } while (0) + +/* printf fmt and arg to completely omit a string if it is empty. */ +#define FMT_S "%s%s%s%s" +#define ARG_S(name, val) \ + (val) && *(val) ? "\n" : "", \ + (val) && *(val) ? name : "", \ + (val) && *(val) ? "\t" : "", \ + (val) && *(val) ? (val) : "" \ + +/* printf fmt and arg to completely omit bool of given value. */ +#define FMT_BOOL "%s" +#define ARG_BOOL_OMIT_TRUE(name, val) \ + val ? "" : "\n" name "\t0" +#define ARG_BOOL_OMIT_FALSE(name, val) \ + val ? "\n" name "\t1" : "" +#define ARG_BOOL(name, val) \ + val ? "\n" name "\t1" : "\n" name "\t0" + +static void print_subscr_info(struct ctrl_cmd *cmd, + struct hlr_subscriber *subscr) +{ + reply_printf(cmd, + "\nid\t%"PRIu64 + FMT_S + FMT_S + FMT_BOOL + FMT_BOOL + FMT_S + FMT_S + FMT_S +#if 0 +/* not used yet */ + FMT_BOOL + FMT_BOOL + "\nperiodic_lu_timer\t%u" + "\nperiodic_rau_tau_timer\t%u" + "\nlmsi\t%08x" +#endif + , + subscr->id, + ARG_S("imsi", subscr->imsi), + ARG_S("msisdn", subscr->msisdn), + ARG_BOOL_OMIT_TRUE("nam_cs", subscr->nam_cs), + ARG_BOOL_OMIT_TRUE("nam_ps", subscr->nam_ps), + ARG_S("vlr_number", subscr->vlr_number), + ARG_S("sgsn_number", subscr->sgsn_number), + ARG_S("sgsn_address", subscr->sgsn_address) +#if 0 + , + ARG_BOOL_OMIT_FALSE("ms_purged_cs", subscr->ms_purged_cs), + ARG_BOOL_OMIT_FALSE("ms_purged_ps", subscr->ms_purged_ps), + subscr->periodic_lu_timer, + subscr->periodic_rau_tau_timer, + subscr->lmsi +#endif + ); +} + +static void print_subscr_info_aud2g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + reply_printf(cmd, + "\naud2g.algo\t%s" + "\naud2g.ki\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.gsm.ki)); +} + +static void print_subscr_info_aud3g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + reply_printf(cmd, + "\naud3g.algo\t%s" + "\naud3g.k\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.umts.k)); + /* hexdump uses a static string buffer, hence only one hexdump per + * printf(). */ + reply_printf(cmd, + "\naud3g.%s\t%s" + "\naud3g.ind_bitlen\t%u" + "\naud3g.sqn\t%"PRIu64 + , + aud->u.umts.opc_is_op? "op" : "opc", + hexdump_buf(aud->u.umts.opc), + aud->u.umts.ind_bitlen, + aud->u.umts.sqn); +} + +CTRL_CMD_DEFINE_RO(subscr_info, "info"); +static int get_subscr_info(struct ctrl_cmd *cmd, void *data) { struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; - if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, &subscr) < 0) { - cmd->reply = "Subscriber Unknown in HLR"; + print_subscr_info(cmd, &subscr); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_aud, "info-aud"); +static int get_subscr_info_aud(struct ctrl_cmd *cmd, void *data) +{ + const char *imsi; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } - if (hlr_subscr_nam(ctx, &subscr, enable, true) < 0) { - cmd->reply = "Error updating DB"; + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_all, "info-all"); +static int get_subscr_info_all(struct ctrl_cmd *cmd, void *data) +{ + struct hlr_subscriber subscr; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, subscr.imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } + print_subscr_info(cmd, &subscr); + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +static int verify_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) +{ + if (!value || !*value + || (strcmp(value, "0") && strcmp(value, "1"))) + return 1; + return 0; +} + +static int get_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + cmd->reply = (is_ps ? subscr.nam_ps : subscr.nam_cs) + ? "1" : "0"; + return CTRL_CMD_REPLY; +} + +static int set_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + const char *imsi; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + if (db_subscr_nam(hlr->dbc, imsi, strcmp(cmd->value, "1") == 0, is_ps)) + return CTRL_CMD_ERROR; cmd->reply = "OK"; return CTRL_CMD_REPLY; } -CTRL_CMD_DEFINE_WO_NOVRF(enable_ps, "enable-ps"); -static int set_enable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_ps_enabled, "ps-enabled"); +static int verify_subscr_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, true); + return verify_subscr_cs_ps_enabled(cmd, value, data); +} +static int get_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return get_subscr_cs_ps_enabled(cmd, data, true); +} +static int set_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, true); } -CTRL_CMD_DEFINE_WO_NOVRF(disable_ps, "disable-ps"); -static int set_disable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_cs_enabled, "cs-enabled"); +static int verify_subscr_cs_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, false); + return verify_subscr_cs_ps_enabled(cmd, value, data); } - -CTRL_CMD_DEFINE_WO_NOVRF(status_ps, "status-ps"); -static int set_status_ps(struct ctrl_cmd *cmd, void *data) +static int get_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) { - struct hlr *ctx = data; - struct lu_operation *luop = lu_op_alloc(ctx->gs); - if (!luop) { - cmd->reply = "Internal HLR error"; - return CTRL_CMD_ERROR; - } - - if (!lu_op_fill_subscr(luop, ctx->dbc, cmd->value)) { - cmd->reply = "Subscriber Unknown in HLR"; - return CTRL_CMD_ERROR; - } - - cmd->reply = luop->subscr.nam_ps ? "1" : "0"; - - return CTRL_CMD_REPLY; + return get_subscr_cs_ps_enabled(cmd, data, false); +} +static int set_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, false); } int hlr_ctrl_cmds_install() { int rc = 0; - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_enable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_disable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_status_ps); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_aud); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_all); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_ps_enabled); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_cs_enabled); return rc; } -struct ctrl_handle *hlr_controlif_setup(struct hlr *ctx, - struct osmo_gsup_server *gs) +static int hlr_ctrl_node_lookup(void *data, vector vline, int *node_type, + void **node_data, int *i) +{ + const char *token = vector_slot(vline, *i); + + switch (*node_type) { + case CTRL_NODE_ROOT: + if (strcmp(token, "subscriber") != 0) + return 0; + *node_data = NULL; + *node_type = CTRL_NODE_SUBSCR; + break; + case CTRL_NODE_SUBSCR: + if (!startswith(token, "by-")) + return 0; + *node_data = (void*)token; + *node_type = CTRL_NODE_SUBSCR_BY; + break; + default: + return 0; + } + + return 1; +} + +struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr) { int rc; - struct ctrl_handle *hdl = ctrl_interface_setup_dynip(ctx, - ctx->ctrl_bind_addr, - OSMO_CTRL_PORT_HLR, - NULL); + struct ctrl_handle *hdl; + + hdl = ctrl_interface_setup_dynip2(hlr, + hlr->ctrl_bind_addr, + OSMO_CTRL_PORT_HLR, + hlr_ctrl_node_lookup, + _LAST_CTRL_NODE_HLR); if (!hdl) return NULL; diff --git a/src/ctrl.h b/src/ctrl.h index 663de30..3f9ba3f 100644 --- a/src/ctrl.h +++ b/src/ctrl.h @@ -24,8 +24,11 @@ #include -#include "gsup_server.h" +enum hlr_ctrl_node { + CTRL_NODE_SUBSCR = _LAST_CTRL_NODE, + CTRL_NODE_SUBSCR_BY, + _LAST_CTRL_NODE_HLR +}; int hlr_ctrl_cmds_install(); -struct ctrl_handle *hlr_controlif_setup(struct hlr *ctx, - struct osmo_gsup_server *gs); +struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr); diff --git a/src/hlr.c b/src/hlr.c index b32f709..6310526 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -474,7 +474,7 @@ } g_hlr->ctrl_bind_addr = ctrl_vty_get_bind_addr(); - g_hlr->ctrl = hlr_controlif_setup(g_hlr, g_hlr->gs); + g_hlr->ctrl = hlr_controlif_setup(g_hlr); osmo_init_ignore_signals(); signal(SIGINT, &signal_hdlr); diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl index 3284ae5..30dae00 100644 --- a/tests/test_subscriber.ctrl +++ b/tests/test_subscriber.ctrl @@ -1,27 +1,414 @@ -GET 1 invalid -ERROR 1 Command not found -SET 2 invalid nonsense -ERROR 2 Command not found +GET 1 subscriber.by-imsi-901990000000001.info +GET_REPLY 1 subscriber.by-imsi-901990000000001.info +id 1 +imsi 901990000000001 +msisdn 1 -SET 3 enable-ps 901990000000001 -SET_REPLY 3 enable-ps OK -SET 4 status-ps 901990000000001 -SET_REPLY 4 status-ps 1 -SET 5 enable-ps 901990000000001 -SET_REPLY 5 enable-ps OK -SET 6 status-ps 901990000000001 -SET_REPLY 6 status-ps 1 +GET 2 subscriber.by-imsi-901990000000001.info-aud +GET_REPLY 2 subscriber.by-imsi-901990000000001.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 7 disable-ps 901990000000001 -SET_REPLY 7 disable-ps OK -SET 8 status-ps 901990000000001 -SET_REPLY 8 status-ps 0 -SET 9 disable-ps 901990000000001 -SET_REPLY 9 disable-ps OK -SET 10 status-ps 901990000000001 -SET_REPLY 10 status-ps 0 +GET 3 subscriber.by-imsi-901990000000001.info-all +GET_REPLY 3 subscriber.by-imsi-901990000000001.info-all +id 1 +imsi 901990000000001 +msisdn 1 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 11 enable-ps 901990000000001 -SET_REPLY 11 enable-ps OK -SET 12 status-ps 901990000000001 -SET_REPLY 12 status-ps 1 +GET 4 subscriber.by-imsi-901990000000002.info +GET_REPLY 4 subscriber.by-imsi-901990000000002.info +id 2 +imsi 901990000000002 + +GET 5 subscriber.by-imsi-901990000000002.info-aud +GET_REPLY 5 subscriber.by-imsi-901990000000002.info-aud +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 6 subscriber.by-imsi-901990000000002.info-all +GET_REPLY 6 subscriber.by-imsi-901990000000002.info-all +id 2 +imsi 901990000000002 +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 7 subscriber.by-imsi-901990000000003.info +GET_REPLY 7 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 8 subscriber.by-imsi-901990000000003.info-aud +GET_REPLY 8 subscriber.by-imsi-901990000000003.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 9 subscriber.by-imsi-901990000000003.info-all +GET_REPLY 9 subscriber.by-imsi-901990000000003.info-all +id 3 +imsi 901990000000003 +msisdn 103 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 10 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 10 subscriber.by-imsi-901990000000003.ps-enabled 1 + +SET 11 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 11 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 12 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 12 subscriber.by-imsi-901990000000003.ps-enabled 0 + +GET 13 subscriber.by-imsi-901990000000003.info +GET_REPLY 13 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_ps 0 + +SET 14 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 14 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 15 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 15 subscriber.by-imsi-901990000000003.ps-enabled 0 + +SET 16 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 16 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 17 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 17 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 18 subscriber.by-imsi-901990000000003.info +GET_REPLY 18 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 19 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 19 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 20 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 20 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 21 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 21 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 22 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 22 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 23 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 23 subscriber.by-imsi-901990000000003.cs-enabled 0 + +GET 24 subscriber.by-imsi-901990000000003.info +GET_REPLY 24 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 + +SET 25 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 25 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 26 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 26 subscriber.by-imsi-901990000000003.cs-enabled 0 + +SET 27 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 27 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 28 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 28 subscriber.by-imsi-901990000000003.cs-enabled 1 + +GET 29 subscriber.by-imsi-901990000000003.info +GET_REPLY 29 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 30 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 30 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 31 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 31 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 32 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 32 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 33 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 33 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 34 subscriber.by-imsi-901990000000003.info +GET_REPLY 34 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 + +SET 35 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 35 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 36 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 36 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 37 subscriber.by-imsi-901990000000003.info +GET_REPLY 37 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 + + + +GET 38 subscriber.by-msisdn-103.info +GET_REPLY 38 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 39 subscriber.by-msisdn-103.info-aud +GET_REPLY 39 subscriber.by-msisdn-103.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 40 subscriber.by-msisdn-103.info-all +GET_REPLY 40 subscriber.by-msisdn-103.info-all +id 3 +imsi 901990000000003 +msisdn 103 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 41 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 41 subscriber.by-msisdn-103.ps-enabled 1 + +SET 42 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 42 subscriber.by-msisdn-103.ps-enabled OK +GET 43 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 43 subscriber.by-msisdn-103.ps-enabled 0 + +GET 44 subscriber.by-msisdn-103.info +GET_REPLY 44 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_ps 0 + +SET 45 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 45 subscriber.by-msisdn-103.ps-enabled OK +GET 46 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 46 subscriber.by-msisdn-103.ps-enabled 0 + +SET 47 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 47 subscriber.by-msisdn-103.ps-enabled OK +GET 48 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 48 subscriber.by-msisdn-103.ps-enabled 1 + +GET 49 subscriber.by-msisdn-103.info +GET_REPLY 49 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 50 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 50 subscriber.by-msisdn-103.ps-enabled OK +GET 51 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 51 subscriber.by-msisdn-103.ps-enabled 1 + +GET 52 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 52 subscriber.by-msisdn-103.cs-enabled 1 + +SET 53 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 53 subscriber.by-msisdn-103.cs-enabled OK +GET 54 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 54 subscriber.by-msisdn-103.cs-enabled 0 + +GET 55 subscriber.by-msisdn-103.info +GET_REPLY 55 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 + +SET 56 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 56 subscriber.by-msisdn-103.cs-enabled OK +GET 57 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 57 subscriber.by-msisdn-103.cs-enabled 0 + +SET 58 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 58 subscriber.by-msisdn-103.cs-enabled OK +GET 59 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 59 subscriber.by-msisdn-103.cs-enabled 1 + +GET 60 subscriber.by-msisdn-103.info +GET_REPLY 60 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 61 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 61 subscriber.by-msisdn-103.cs-enabled OK +GET 62 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 62 subscriber.by-msisdn-103.cs-enabled 1 + +SET 63 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 63 subscriber.by-msisdn-103.ps-enabled OK +SET 64 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 64 subscriber.by-msisdn-103.cs-enabled OK +GET 65 subscriber.by-msisdn-103.info +GET_REPLY 65 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 + +SET 66 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 66 subscriber.by-msisdn-103.ps-enabled OK +SET 67 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 67 subscriber.by-msisdn-103.cs-enabled OK +GET 68 subscriber.by-msisdn-103.info +GET_REPLY 68 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 + + + +GET 69 subscriber.by-id-3.info +GET_REPLY 69 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 70 subscriber.by-id-3.info-aud +GET_REPLY 70 subscriber.by-id-3.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 71 subscriber.by-id-3.info-all +GET_REPLY 71 subscriber.by-id-3.info-all +id 3 +imsi 901990000000003 +msisdn 103 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 72 subscriber.by-id-3.ps-enabled +GET_REPLY 72 subscriber.by-id-3.ps-enabled 1 + +SET 73 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 73 subscriber.by-id-3.ps-enabled OK +GET 74 subscriber.by-id-3.ps-enabled +GET_REPLY 74 subscriber.by-id-3.ps-enabled 0 + +GET 75 subscriber.by-id-3.info +GET_REPLY 75 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_ps 0 + +SET 76 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 76 subscriber.by-id-3.ps-enabled OK +GET 77 subscriber.by-id-3.ps-enabled +GET_REPLY 77 subscriber.by-id-3.ps-enabled 0 + +SET 78 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 78 subscriber.by-id-3.ps-enabled OK +GET 79 subscriber.by-id-3.ps-enabled +GET_REPLY 79 subscriber.by-id-3.ps-enabled 1 + +GET 80 subscriber.by-id-3.info +GET_REPLY 80 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 81 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 81 subscriber.by-id-3.ps-enabled OK +GET 82 subscriber.by-id-3.ps-enabled +GET_REPLY 82 subscriber.by-id-3.ps-enabled 1 + +GET 83 subscriber.by-id-3.cs-enabled +GET_REPLY 83 subscriber.by-id-3.cs-enabled 1 + +SET 84 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 84 subscriber.by-id-3.cs-enabled OK +GET 85 subscriber.by-id-3.cs-enabled +GET_REPLY 85 subscriber.by-id-3.cs-enabled 0 + +GET 86 subscriber.by-id-3.info +GET_REPLY 86 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 + +SET 87 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 87 subscriber.by-id-3.cs-enabled OK +GET 88 subscriber.by-id-3.cs-enabled +GET_REPLY 88 subscriber.by-id-3.cs-enabled 0 + +SET 89 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 89 subscriber.by-id-3.cs-enabled OK +GET 90 subscriber.by-id-3.cs-enabled +GET_REPLY 90 subscriber.by-id-3.cs-enabled 1 + +GET 91 subscriber.by-id-3.info +GET_REPLY 91 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 92 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 92 subscriber.by-id-3.cs-enabled OK +GET 93 subscriber.by-id-3.cs-enabled +GET_REPLY 93 subscriber.by-id-3.cs-enabled 1 + +SET 94 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 94 subscriber.by-id-3.ps-enabled OK +SET 95 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 95 subscriber.by-id-3.cs-enabled OK +GET 96 subscriber.by-id-3.info +GET_REPLY 96 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 + +SET 97 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 97 subscriber.by-id-3.ps-enabled OK +SET 98 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 98 subscriber.by-id-3.cs-enabled OK +GET 99 subscriber.by-id-3.info +GET_REPLY 99 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql index 0767d48..decd7d2 100644 --- a/tests/test_subscriber.sql +++ b/tests/test_subscriber.sql @@ -1,6 +1,6 @@ -- 2G only subscriber -INSERT INTO subscriber (id, imsi) VALUES (1, '901990000000001'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (1, '901990000000001', '1'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (1, 1, '000102030405060708090a0b0c0d0e0f'); -- 3G only subscriber @@ -8,6 +8,6 @@ INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); -- 2G + 3G subscriber -INSERT INTO subscriber (id, imsi) VALUES (3, '901990000000003'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (3, '901990000000003', '103'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); diff --git a/tests/test_subscriber_errors.ctrl b/tests/test_subscriber_errors.ctrl new file mode 100644 index 0000000..2f64fdb --- /dev/null +++ b/tests/test_subscriber_errors.ctrl @@ -0,0 +1,107 @@ +GET 1 invalid +ERROR 1 Command not found +SET 2 invalid nonsense +ERROR 2 Command not found + +GET 3 subscriber.by-imsi-nonsense.info +ERROR 3 Invalid value part of 'by-xxx-value' selector. +GET 4 subscriber.by-msisdn-nonsense.info +ERROR 4 Invalid value part of 'by-xxx-value' selector. +GET 5 subscriber.by-id-nonsense.info +ERROR 5 Invalid value part of 'by-xxx-value' selector. + +GET 6 subscriber +ERROR 6 Command not present. +GET 7 subscriber. +ERROR 7 Command not present. +GET 8 subscriber.by-nonsense +ERROR 8 Command not present. +GET 9 subscriber.by-nonsense- +ERROR 9 Command not present. +GET 10 subscriber.by-nonsense-123456 +ERROR 10 Command not present. +GET 11 subscriber.by-nonsense-123456. +ERROR 11 Command not present. +GET 12 subscriber.by-imsi- +ERROR 12 Command not present. +GET 13 subscriber.by-imsi-. +ERROR 13 Command not present. +GET 14 subscriber.by-imsi-901990000000003 +ERROR 14 Command not present. +GET 15 subscriber.by-imsi-901990000000003. +ERROR 15 Command not present. + +GET 16 subscriber.by-nonsense-123456.info +ERROR 16 Not a known subscriber 'by-xxx-' selector. +GET 17 subscriber.by-123456.info +ERROR 17 Not a known subscriber 'by-xxx-' selector. + +GET 18 subscriber.by-imsi-.info +ERROR 18 Invalid value part of 'by-xxx-value' selector. +GET 19 subscriber.by-imsi--.info +ERROR 19 Invalid value part of 'by-xxx-value' selector. + +GET 20 subscriber.by-imsi-12345678901234567.info +ERROR 20 Invalid value part of 'by-xxx-value' selector. +GET 21 subscriber.by-imsi-12345.info +ERROR 21 Invalid value part of 'by-xxx-value' selector. +GET 22 subscriber.by-imsi-1234567890123456.info +ERROR 22 Invalid value part of 'by-xxx-value' selector. + +GET 23 subscriber.by-id-99999999999999999999999999.info +ERROR 23 Invalid value part of 'by-xxx-value' selector. +GET 24 subscriber.by-id-9223372036854775807.info +ERROR 24 No such subscriber. +GET 25 subscriber.by-id-9223372036854775808.info +ERROR 25 Invalid value part of 'by-xxx-value' selector. +GET 26 subscriber.by-id--1.info +ERROR 26 No such subscriber. +GET 27 subscriber.by-id--9223372036854775808.info +ERROR 27 No such subscriber. +GET 28 subscriber.by-id--9223372036854775809.info +ERROR 28 Invalid value part of 'by-xxx-value' selector. + +GET 29 subscriber.by-id-1+1.info +ERROR 29 Invalid value part of 'by-xxx-value' selector. +GET 30 subscriber.by-id--.info +ERROR 30 Invalid value part of 'by-xxx-value' selector. +GET 31 subscriber.by-id-+1.info +ERROR 31 Invalid value part of 'by-xxx-value' selector. +GET 32 subscriber.by-id-+-1.info +ERROR 32 Invalid value part of 'by-xxx-value' selector. +GET 33 subscriber.by-id--+1.info +ERROR 33 Invalid value part of 'by-xxx-value' selector. +GET 34 subscriber.by-id-++1.info +ERROR 34 Invalid value part of 'by-xxx-value' selector. +GET 35 subscriber.by-id---1.info +ERROR 35 Invalid value part of 'by-xxx-value' selector. + +GET 36 subscriber.by-id- 1.info +ERROR 36 Command not present. +GET 37 subscriber.by-id-+ 1.info +ERROR 37 Command not present. +GET 38 subscriber.by-id-- 1.info +ERROR 38 Command not present. + + +SET 39 subscriber.by-imsi-901990000000001.info foo +ERROR 39 Read Only attribute +SET 40 subscriber.by-imsi-901990000000001.info-aud foo +ERROR 40 Read Only attribute +SET 41 subscriber.by-imsi-901990000000001.info-all foo +ERROR 41 Read Only attribute + +SET 42 subscriber.by-imsi-901990000000001.ps-enabled nonsense +ERROR 42 Value failed verification. +SET 43 subscriber.by-imsi-901990000000001.cs-enabled nonsense +ERROR 43 Value failed verification. + +SET 44 subscriber.by-imsi-901990000000001.ps-enabled +ERROR err Command parser error. +SET 45 subscriber.by-imsi-901990000000001.cs-enabled +ERROR err Command parser error. + +GET 46 subscriber.by-imsi-1234567890123456.ps-enabled +ERROR 46 Invalid value part of 'by-xxx-value' selector. +GET 47 subscriber.by-imsi-1234567890123456.cs-enabled +ERROR 47 Invalid value part of 'by-xxx-value' selector. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 01:30:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 01:30:56 +0000 Subject: osmo-hlr[master]: replace ctrl_test_runner.py with transcript test_subscriber.... In-Reply-To: References: Message-ID: Patch Set 2: what! for some reason setup.py replaced the python3 shebang with a python2 shebang when installing python scripts in https://jenkins.osmocom.org/jenkins/job/update-osmocom-python-on-slaves -- my scripts are good, but installation breaks it. I'm at a loss of words, how dysmally stupid is this?! It seems we need two separate setup.py for py2 and py3, or maybe just copy the scripts manually, I mean, *really*... -- To view, visit https://gerrit.osmocom.org/4275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff93abe370b8f3ecf42082d1d0eaa1fbeca5b122 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 02:07:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 02:07:57 +0000 Subject: [PATCH] python/osmo-python-tests[master]: setup.py: don't install py3 scripts with python2 Message-ID: Review at https://gerrit.osmocom.org/4312 setup.py: don't install py3 scripts with python2 If one calls 'python2 setup.py install', python replaces the script shebangs with python2 ones, regardless of the code being mint python3, and vice versa. In setup.py, name only the scripts that match the current python version. Change-Id: I84a5c8ec108a99f527b0d2fb5bf4e312df5f7403 --- M setup.py 1 file changed, 9 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/12/4312/1 diff --git a/setup.py b/setup.py index 9c25a0d..ec8654a 100755 --- a/setup.py +++ b/setup.py @@ -17,15 +17,20 @@ from distutils.core import setup from osmopy import __version__ +import sys + +if sys.version_info.major == 2: + scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py", + "osmopy/osmotestvty.py"] +elif sys.version_info.major == 3: + scripts = ["osmopy/osmo_verify_transcript_vty.py", + "osmopy/osmo_verify_transcript_ctrl.py"] setup( name = 'osmopython', version = __version__, packages = ["osmopy"], - scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py", - "osmopy/osmotestvty.py", - "osmopy/osmo_verify_transcript_vty.py", - "osmopy/osmo_verify_transcript_ctrl.py"], + scripts = scripts, license = "AGPLv3", description = "Osmopython: osmocom testing scripts", author = "Katerina Barone-Adesi", -- To view, visit https://gerrit.osmocom.org/4312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I84a5c8ec108a99f527b0d2fb5bf4e312df5f7403 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 02:08:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 02:08:14 +0000 Subject: python/osmo-python-tests[master]: setup.py: don't install py3 scripts with python2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I84a5c8ec108a99f527b0d2fb5bf4e312df5f7403 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 02:08:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 02:08:16 +0000 Subject: [MERGED] python/osmo-python-tests[master]: setup.py: don't install py3 scripts with python2 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: setup.py: don't install py3 scripts with python2 ...................................................................... setup.py: don't install py3 scripts with python2 If one calls 'python2 setup.py install', python replaces the script shebangs with python2 ones, regardless of the code being mint python3, and vice versa. In setup.py, name only the scripts that match the current python version. Change-Id: I84a5c8ec108a99f527b0d2fb5bf4e312df5f7403 --- M setup.py 1 file changed, 9 insertions(+), 4 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/setup.py b/setup.py index 9c25a0d..ec8654a 100755 --- a/setup.py +++ b/setup.py @@ -17,15 +17,20 @@ from distutils.core import setup from osmopy import __version__ +import sys + +if sys.version_info.major == 2: + scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py", + "osmopy/osmotestvty.py"] +elif sys.version_info.major == 3: + scripts = ["osmopy/osmo_verify_transcript_vty.py", + "osmopy/osmo_verify_transcript_ctrl.py"] setup( name = 'osmopython', version = __version__, packages = ["osmopy"], - scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py", - "osmopy/osmotestvty.py", - "osmopy/osmo_verify_transcript_vty.py", - "osmopy/osmo_verify_transcript_ctrl.py"], + scripts = scripts, license = "AGPLv3", description = "Osmopython: osmocom testing scripts", author = "Katerina Barone-Adesi", -- To view, visit https://gerrit.osmocom.org/4312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I84a5c8ec108a99f527b0d2fb5bf4e312df5f7403 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 02:08:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 02:08:44 +0000 Subject: [PATCH] osmo-hlr[master]: add hlr_subsrc_nam to put GSUP client notification in proper... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4310 to look at the new patch set (#2). add hlr_subsrc_nam to put GSUP client notification in proper API This code should not live in a CTRL interface function but be proper hlr_* API. Change-Id: I4c9b8f9ad51d49517474e8b51afc3cc2e1c9299a --- M src/ctrl.c M src/db.h M src/db_hlr.c M tests/db/db_test.c 4 files changed, 64 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/10/4310/2 diff --git a/src/ctrl.c b/src/ctrl.c index 74172c4..3bd4d8f 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -35,31 +35,19 @@ static int handle_cmd_ps(struct hlr *ctx, struct ctrl_cmd *cmd, bool enable) { - struct lu_operation *luop = NULL; - struct osmo_gsup_conn *co; + struct hlr_subscriber subscr; - if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, NULL) < 0) { + if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, &subscr) < 0) { cmd->reply = "Subscriber Unknown in HLR"; return CTRL_CMD_ERROR; } - if (db_subscr_nam(ctx->dbc, cmd->value, enable, true) < 0) { + if (hlr_subscr_nam(ctx, &subscr, enable, true) < 0) { cmd->reply = "Error updating DB"; return CTRL_CMD_ERROR; } - /* FIXME: only send to single SGSN where latest update for IMSI came from */ - if (!enable) { - llist_for_each_entry(co, &ctx->gs->clients, list) { - luop = lu_op_alloc_conn(co); - lu_op_fill_subscr(luop, ctx->dbc, cmd->value); - lu_op_tx_del_subscr_data(luop); - lu_op_free(luop); - } - } - cmd->reply = "OK"; - return CTRL_CMD_REPLY; } diff --git a/src/db.h b/src/db.h index f6aaa58..35e4327 100644 --- a/src/db.h +++ b/src/db.h @@ -3,6 +3,8 @@ #include #include +struct hlr; + enum stmt_idx { DB_STMT_SEL_BY_IMSI, DB_STMT_SEL_BY_MSISDN, @@ -125,3 +127,5 @@ int db_subscr_purge(struct db_context *dbc, const char *by_imsi, bool purge_val, bool is_ps); + +int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps); diff --git a/src/db_hlr.c b/src/db_hlr.c index cf6e4f8..07fcbf3 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -28,7 +28,10 @@ #include #include "logging.h" +#include "hlr.h" #include "db.h" +#include "gsup_server.h" +#include "luop.h" #define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) @@ -609,3 +612,51 @@ return ret; } + +/*! Update subscriber database and trigger notifications to GSUP clients. + * \param hlr Global hlr context. + * \param subscr Subscriber from a fresh db_subscr_get_by_*() call. + * \param nam_val True to enable CS/PS, false to disable. + * \param is_ps True to enable/disable PS, false for CS. + * \returns 0 on success, ENOEXEC if there is no need to change, a negative + * value on error. + */ +int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps) +{ + int rc; + struct lu_operation *luop; + struct osmo_gsup_conn *co; + bool is_val = is_ps? subscr->nam_ps : subscr->nam_cs; + + if (is_val == nam_val) { + LOGHLR(subscr->imsi, LOGL_DEBUG, "Already the requested value when asked to %s %s\n", + nam_val ? "enable" : "disable", is_ps ? "PS" : "CS"); + return ENOEXEC; + } + + rc = db_subscr_nam(hlr->dbc, subscr->imsi, nam_val, is_ps); + if (rc) + return rc > 0? -rc : rc; + + /* If we're disabling, send a notice out to the GSUP client that is + * responsible. Otherwise no need. */ + if (nam_val) + return 0; + + /* FIXME: only send to single SGSN where latest update for IMSI came from */ + llist_for_each_entry(co, &hlr->gs->clients, list) { + luop = lu_op_alloc_conn(co); + if (!luop) { + LOGHLR(subscr->imsi, LOGL_ERROR, + "Cannot notify GSUP client, cannot allocate lu_operation," + " for %s:%u\n", + co && co->conn && co->conn->server? co->conn->server->addr : "unset", + co && co->conn && co->conn->server? co->conn->server->port : 0); + continue; + } + luop->subscr = *subscr; + lu_op_tx_del_subscr_data(luop); + lu_op_free(luop); + } + return 0; +} diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 591418b..0a53370 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -837,3 +837,9 @@ struct osmo_sub_auth_data *aud3g, const uint8_t *rand_auts, const uint8_t *auts) { OSMO_ASSERT(false); return -1; } +void *lu_op_alloc_conn(void *conn) +{ OSMO_ASSERT(false); return NULL; } +void lu_op_tx_del_subscr_data(void *luop) +{ OSMO_ASSERT(false); } +void lu_op_free(void *luop) +{ OSMO_ASSERT(false); } -- To view, visit https://gerrit.osmocom.org/4310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4c9b8f9ad51d49517474e8b51afc3cc2e1c9299a Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 02:28:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 02:28:51 +0000 Subject: [PATCH] osmo-hlr[master]: add hlr_subsrc_nam to put GSUP client notification in proper... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4310 to look at the new patch set (#3). add hlr_subsrc_nam to put GSUP client notification in proper API This code should not live in a CTRL interface function but be proper hlr_* API. Change-Id: I4c9b8f9ad51d49517474e8b51afc3cc2e1c9299a --- M src/ctrl.c M src/db.h M src/db_hlr.c M tests/db/db_test.c 4 files changed, 64 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/10/4310/3 diff --git a/src/ctrl.c b/src/ctrl.c index 74172c4..3bd4d8f 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -35,31 +35,19 @@ static int handle_cmd_ps(struct hlr *ctx, struct ctrl_cmd *cmd, bool enable) { - struct lu_operation *luop = NULL; - struct osmo_gsup_conn *co; + struct hlr_subscriber subscr; - if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, NULL) < 0) { + if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, &subscr) < 0) { cmd->reply = "Subscriber Unknown in HLR"; return CTRL_CMD_ERROR; } - if (db_subscr_nam(ctx->dbc, cmd->value, enable, true) < 0) { + if (hlr_subscr_nam(ctx, &subscr, enable, true) < 0) { cmd->reply = "Error updating DB"; return CTRL_CMD_ERROR; } - /* FIXME: only send to single SGSN where latest update for IMSI came from */ - if (!enable) { - llist_for_each_entry(co, &ctx->gs->clients, list) { - luop = lu_op_alloc_conn(co); - lu_op_fill_subscr(luop, ctx->dbc, cmd->value); - lu_op_tx_del_subscr_data(luop); - lu_op_free(luop); - } - } - cmd->reply = "OK"; - return CTRL_CMD_REPLY; } diff --git a/src/db.h b/src/db.h index f6aaa58..35e4327 100644 --- a/src/db.h +++ b/src/db.h @@ -3,6 +3,8 @@ #include #include +struct hlr; + enum stmt_idx { DB_STMT_SEL_BY_IMSI, DB_STMT_SEL_BY_MSISDN, @@ -125,3 +127,5 @@ int db_subscr_purge(struct db_context *dbc, const char *by_imsi, bool purge_val, bool is_ps); + +int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps); diff --git a/src/db_hlr.c b/src/db_hlr.c index cf6e4f8..e8db7d2 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -28,7 +28,10 @@ #include #include "logging.h" +#include "hlr.h" #include "db.h" +#include "gsup_server.h" +#include "luop.h" #define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) @@ -609,3 +612,51 @@ return ret; } + +/*! Update nam_cs/nam_ps in the db and trigger notifications to GSUP clients. + * \param hlr Global hlr context. + * \param subscr Subscriber from a fresh db_subscr_get_by_*() call. + * \param nam_val True to enable CS/PS, false to disable. + * \param is_ps True to enable/disable PS, false for CS. + * \returns 0 on success, ENOEXEC if there is no need to change, a negative + * value on error. + */ +int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps) +{ + int rc; + struct lu_operation *luop; + struct osmo_gsup_conn *co; + bool is_val = is_ps? subscr->nam_ps : subscr->nam_cs; + + if (is_val == nam_val) { + LOGHLR(subscr->imsi, LOGL_DEBUG, "Already has the requested value when asked to %s %s\n", + nam_val ? "enable" : "disable", is_ps ? "PS" : "CS"); + return ENOEXEC; + } + + rc = db_subscr_nam(hlr->dbc, subscr->imsi, nam_val, is_ps); + if (rc) + return rc > 0? -rc : rc; + + /* If we're disabling, send a notice out to the GSUP client that is + * responsible. Otherwise no need. */ + if (nam_val) + return 0; + + /* FIXME: only send to single SGSN where latest update for IMSI came from */ + llist_for_each_entry(co, &hlr->gs->clients, list) { + luop = lu_op_alloc_conn(co); + if (!luop) { + LOGHLR(subscr->imsi, LOGL_ERROR, + "Cannot notify GSUP client, cannot allocate lu_operation," + " for %s:%u\n", + co && co->conn && co->conn->server? co->conn->server->addr : "unset", + co && co->conn && co->conn->server? co->conn->server->port : 0); + continue; + } + luop->subscr = *subscr; + lu_op_tx_del_subscr_data(luop); + lu_op_free(luop); + } + return 0; +} diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 591418b..0a53370 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -837,3 +837,9 @@ struct osmo_sub_auth_data *aud3g, const uint8_t *rand_auts, const uint8_t *auts) { OSMO_ASSERT(false); return -1; } +void *lu_op_alloc_conn(void *conn) +{ OSMO_ASSERT(false); return NULL; } +void lu_op_tx_del_subscr_data(void *luop) +{ OSMO_ASSERT(false); } +void lu_op_free(void *luop) +{ OSMO_ASSERT(false); } -- To view, visit https://gerrit.osmocom.org/4310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4c9b8f9ad51d49517474e8b51afc3cc2e1c9299a Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 02:42:15 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 17 Oct 2017 02:42:15 +0000 Subject: [PATCH] libosmocore[master]: vty logging: restore level everything for level all Message-ID: Review at https://gerrit.osmocom.org/4313 vty logging: restore level everything for level all This modifies https://gerrit.osmocom.org/#/c/3148 to allow issuing of logging level all everything. Change-Id: Idd9933e0e1c06fd217866e2d4dbe6cae63296a16 --- M src/vty/logging_vty.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/4313/1 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 9b7d10a..1c59472 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -218,17 +218,17 @@ return CMD_WARNING; } - if (strcmp(argv[1], "everything") == 0) { /* FIXME: remove this check once 'everything' is phased out */ - vty_out(vty, "%% Ignoring deprecated logging level %s%s", argv[1], VTY_NEWLINE); - return CMD_SUCCESS; - } - /* Check for special case where we want to set global log level */ if (!strcmp(argv[0], "all")) { log_set_log_level(tgt, level); return CMD_SUCCESS; } + if (strcmp(argv[1], "everything") == 0) { /* FIXME: remove this check once 'everything' is phased out */ + vty_out(vty, "%% Ignoring deprecated logging level %s%s", argv[1], VTY_NEWLINE); + return CMD_SUCCESS; + } + if (category < 0) { vty_out(vty, "Invalid category `%s'%s", argv[0], VTY_NEWLINE); return CMD_WARNING; -- To view, visit https://gerrit.osmocom.org/4313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd9933e0e1c06fd217866e2d4dbe6cae63296a16 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte From gerrit-no-reply at lists.osmocom.org Tue Oct 17 02:47:03 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 17 Oct 2017 02:47:03 +0000 Subject: [PATCH] libosmocore[master]: vty logging: restore level everything for facility all In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4313 to look at the new patch set (#2). vty logging: restore level everything for facility all This modifies https://gerrit.osmocom.org/#/c/3148 to allow issuing of logging level all everything. Change-Id: Idd9933e0e1c06fd217866e2d4dbe6cae63296a16 --- M src/vty/logging_vty.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/4313/2 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 9b7d10a..1c59472 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -218,17 +218,17 @@ return CMD_WARNING; } - if (strcmp(argv[1], "everything") == 0) { /* FIXME: remove this check once 'everything' is phased out */ - vty_out(vty, "%% Ignoring deprecated logging level %s%s", argv[1], VTY_NEWLINE); - return CMD_SUCCESS; - } - /* Check for special case where we want to set global log level */ if (!strcmp(argv[0], "all")) { log_set_log_level(tgt, level); return CMD_SUCCESS; } + if (strcmp(argv[1], "everything") == 0) { /* FIXME: remove this check once 'everything' is phased out */ + vty_out(vty, "%% Ignoring deprecated logging level %s%s", argv[1], VTY_NEWLINE); + return CMD_SUCCESS; + } + if (category < 0) { vty_out(vty, "Invalid category `%s'%s", argv[0], VTY_NEWLINE); return CMD_WARNING; -- To view, visit https://gerrit.osmocom.org/4313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idd9933e0e1c06fd217866e2d4dbe6cae63296a16 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 04:36:15 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 17 Oct 2017 04:36:15 +0000 Subject: python/osmo-python-tests[master]: setup.py: don't install py3 scripts with python2 In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4312/1/setup.py File setup.py: Line 24: "osmopy/osmotestvty.py"] what would it take to have these work with python3? -- To view, visit https://gerrit.osmocom.org/4312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I84a5c8ec108a99f527b0d2fb5bf4e312df5f7403 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:51:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:51:55 +0000 Subject: [MERGED] libosmocore[master]: [doc] Ensure stats.h is parsed properly for Doxygen In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Ensure stats.h is parsed properly for Doxygen ...................................................................... [doc] Ensure stats.h is parsed properly for Doxygen stats.h uses a rather crude '#ifdef unix' hack, which means that Doxygen will not scan the body of the file. This patch ensures 'unix' is defined to parse the stats.h body and thus have all relevant information in it is parsed. Change-Id: I65384e5cc01f2ad7783cf6b71ab78b4422902aa1 --- M Doxyfile.core.in 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Doxyfile.core.in b/Doxyfile.core.in index c47ff3c..7a3cce5 100644 --- a/Doxyfile.core.in +++ b/Doxyfile.core.in @@ -1447,7 +1447,7 @@ # undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = +PREDEFINED = "unix=1" # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. -- To view, visit https://gerrit.osmocom.org/4297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I65384e5cc01f2ad7783cf6b71ab78b4422902aa1 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:52:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:52:21 +0000 Subject: [MERGED] libosmocore[master]: [doc] Ensure include/crypt/* is part of libosmogsm documenta... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Ensure include/crypt/* is part of libosmogsm documentation ...................................................................... [doc] Ensure include/crypt/* is part of libosmogsm documentation Change-Id: Ic41f807dabb3b0d2d20b9d8963cad639e98f04dd --- M Doxyfile.gsm.in 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Doxyfile.gsm.in b/Doxyfile.gsm.in index 896765e..27d14cc 100644 --- a/Doxyfile.gsm.in +++ b/Doxyfile.gsm.in @@ -610,7 +610,7 @@ # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = @srcdir@/include/osmocom/gsm @srcdir@/src/gsm +INPUT = @srcdir@/include/osmocom/gsm @srcdir@/include/osmocom/crypt @srcdir@/src/gsm # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -- To view, visit https://gerrit.osmocom.org/4296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic41f807dabb3b0d2d20b9d8963cad639e98f04dd Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:14 +0000 Subject: [PATCH] libosmocore[master]: [doc] Provide proper name for 'auth' group In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4298 to look at the new patch set (#2). [doc] Provide proper name for 'auth' group Change-Id: I5fb1c34475ea9db36c2ec5cddc988074a72a35f7 --- M include/osmocom/crypt/auth.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/98/4298/2 diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 1b017c0..4dbc6a4 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -1,6 +1,6 @@ #pragma once -/*! \addtogroup auth +/*! \defgroup auth GSM/GPRS/3G Authentication * @{ * \file auth.h */ -- To view, visit https://gerrit.osmocom.org/4298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5fb1c34475ea9db36c2ec5cddc988074a72a35f7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:14 +0000 Subject: [PATCH] libosmocore[master]: [doc] gea has separate group; A5 is not part of crypto but a... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4299 to look at the new patch set (#2). [doc] gea has separate group; A5 is not part of crypto but a5 group Change-Id: I2fd24c86f9b52244073ec800a3287e3d38e660d9 --- M include/osmocom/gsm/a5.h M include/osmocom/gsm/gea.h M src/gsm/a5.c M src/gsm/gea.c 4 files changed, 18 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/99/4299/2 diff --git a/include/osmocom/gsm/a5.h b/include/osmocom/gsm/a5.h index fae3fdd..fa63246 100644 --- a/include/osmocom/gsm/a5.h +++ b/include/osmocom/gsm/a5.h @@ -1,5 +1,3 @@ -/*! \file gsm/a5.h - * Osmocom GSM A5 ciphering algorithm header. */ /* * Copyright (C) 2011 Sylvain Munaut * diff --git a/include/osmocom/gsm/gea.h b/include/osmocom/gsm/gea.h index 5c23d2a..fff9baa 100644 --- a/include/osmocom/gsm/gea.h +++ b/include/osmocom/gsm/gea.h @@ -1,5 +1,8 @@ -/*! \file gea.h - * GEA3 header. +/*! \defgroup gea GPRS GEA3/GEA4 ciphering algorithm + * @{ + * \file gea.h + * + * GEA3/GEA4 header. * * See gea.c for details */ @@ -15,3 +18,5 @@ int gea4(uint8_t *out, uint16_t len, uint8_t *kc, uint32_t iv, enum gprs_cipher_direction direct); + +/*! @} */ diff --git a/src/gsm/a5.c b/src/gsm/a5.c index e906b6d..ea09e17 100644 --- a/src/gsm/a5.c +++ b/src/gsm/a5.c @@ -1,10 +1,3 @@ -/*! \file a5.c - * Full reimplementation of A5/1,2 (split and threadsafe). - * - * The logic behind the algorithm is taken from "A pedagogical implementation - * of the GSM A5/1 and A5/2 "voice privacy" encryption algorithms." by - * Marc Briceno, Ian Goldberg, and David Wagner. - */ /* * Copyright (C) 2011 Sylvain Munaut * @@ -25,11 +18,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/*! \addtogroup crypto +/*! \addtogroup a5 * @{ - * Osmocom GSM/GPRS ciphering algorithm implementation + * Osmocom GSM ciphering algorithm implementation * - * \file gsm/a5.c */ + * Full reimplementation of A5/1,2,3,4 (split and threadsafe). + * + * The logic behind the algorithm is taken from "A pedagogical implementation + * of the GSM A5/1 and A5/2 "voice privacy" encryption algorithms." by + * Marc Briceno, Ian Goldberg, and David Wagner. + */ #include #include diff --git a/src/gsm/gea.c b/src/gsm/gea.c index d95c03e..70f08ad 100644 --- a/src/gsm/gea.c +++ b/src/gsm/gea.c @@ -1,5 +1,3 @@ -/*! \file gea.c - * Implementation of GEA3 and GEA4. */ /* * Copyright (C) 2016 by Sysmocom s.f.m.c. GmbH * @@ -28,9 +26,10 @@ #include #include -/*! \addtogroup crypto +/*! \addtogroup gea * @{ - * \file gsm/gea.c */ + * Implementation of GPRS Ciphers GEA3 and GEA4. + * \file gea.c */ /*! Performs the GEA4 algorithm as in 3GPP TS 55.226 V9.0.0 * \param[in,out] out Buffer for gamma for encrypted/decrypted -- To view, visit https://gerrit.osmocom.org/4299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2fd24c86f9b52244073ec800a3287e3d38e660d9 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:14 +0000 Subject: [PATCH] libosmocore[master]: [doc] make sure all SMS related code is part of the 'sms' group In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4300 to look at the new patch set (#2). [doc] make sure all SMS related code is part of the 'sms' group Change-Id: I24c56ccb56d5b39cfb887808f91b715da54c0f8b --- M include/osmocom/gsm/gsm0341.h M include/osmocom/gsm/gsm0411_smc.h M include/osmocom/gsm/gsm0411_smr.h M include/osmocom/gsm/gsm0411_utils.h M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_smr.c M src/gsm/gsm0411_utils.c 8 files changed, 27 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/4300/2 diff --git a/include/osmocom/gsm/gsm0341.h b/include/osmocom/gsm/gsm0341.h index 2fc83e4..834dbf9 100644 --- a/include/osmocom/gsm/gsm0341.h +++ b/include/osmocom/gsm/gsm0341.h @@ -1,4 +1,6 @@ -/*! \file gsm0341.h */ +/*! \defgroup sms Short Message Service (SMS) + * @{ + * \file gsm0341.h */ #pragma once @@ -9,3 +11,5 @@ uint8_t update, uint16_t msg_id, uint8_t dcs, uint8_t page_total, uint8_t page_cur, uint8_t *data, uint8_t len); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0411_smc.h b/include/osmocom/gsm/gsm0411_smc.h index 0cd1f94..7dfaa15 100644 --- a/include/osmocom/gsm/gsm0411_smc.h +++ b/include/osmocom/gsm/gsm0411_smc.h @@ -1,4 +1,6 @@ -/*! \file gsm0411_smc.h */ +/*! \addtogroup sms + * @{ + * \file gsm0411_smc.h */ #pragma once @@ -61,3 +63,5 @@ /* message from lower layer */ int gsm411_smc_recv(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg, int cp_msg_type); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0411_smr.h b/include/osmocom/gsm/gsm0411_smr.h index 19f9c5d..28f43de 100644 --- a/include/osmocom/gsm/gsm0411_smr.h +++ b/include/osmocom/gsm/gsm0411_smr.h @@ -1,4 +1,6 @@ -/*! \file gsm0411_smr.h */ +/*! \addtogroup sms + * @{ + * \file gsm0411_smr.h */ #pragma once @@ -42,3 +44,5 @@ /* message from lower layer */ int gsm411_smr_recv(struct gsm411_smr_inst *inst, int msg_type, struct msgb *msg); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0411_utils.h b/include/osmocom/gsm/gsm0411_utils.h index 1c51111..2cd87b8 100644 --- a/include/osmocom/gsm/gsm0411_utils.h +++ b/include/osmocom/gsm/gsm0411_utils.h @@ -1,4 +1,6 @@ -/*! \file gsm0411_utils.h */ +/*! \addtogroup sms + * @{ + * \file gsm0411_utils.h */ #pragma once @@ -35,3 +37,5 @@ /* Prefix msg with a 04.08/04.11 CP header */ int gsm411_push_cp_header(struct msgb *msg, uint8_t proto, uint8_t trans, uint8_t msg_type); + +/*! @} */ diff --git a/src/gsm/gsm0341.c b/src/gsm/gsm0341.c index 05a0b4a..485023f 100644 --- a/src/gsm/gsm0341.c +++ b/src/gsm/gsm0341.c @@ -1,4 +1,3 @@ -/*! \file gsm0341.c */ /* * (C) 2014 by Harald Welte * All Rights Reserved @@ -30,6 +29,7 @@ /*! \addtogroup sms * @{ + * \file gsm0341.c */ /*! Encode a 3GPP TS 03.41 SMS-CB message diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c index 7414e95..f7c536b 100644 --- a/src/gsm/gsm0411_smc.c +++ b/src/gsm/gsm0411_smc.c @@ -1,5 +1,4 @@ -/*! \file gsm0411_smc.c - * Point-to-Point (PP) Short Message Service (SMS). +/* Point-to-Point (PP) Short Message Service (SMS). * Support on Mobile Radio Interface * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ /* @@ -63,6 +62,7 @@ /*! \addtogroup sms * @{ + * \file gsm0411_smc.c * Point-to-Point (PP) Short Message Service (SMS) as per TS 04.11 */ diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c index 67bb249..0a25c7c 100644 --- a/src/gsm/gsm0411_smr.c +++ b/src/gsm/gsm0411_smr.c @@ -1,5 +1,4 @@ -/*! \file gsm0411_smr.c - * Point-to-Point (PP) Short Message Service (SMS). +/* Point-to-Point (PP) Short Message Service (SMS). * Support on Mobile Radio Interface * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0 */ /* @@ -65,6 +64,7 @@ /*! \addtogroup sms * @{ + * \file gsm0411_smr.c */ static void rp_timer_expired(void *data); diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index a4e9d0d..acf7e23 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -1,5 +1,4 @@ -/*! \file gsm0411_utils.c - * Point-to-Point (PP) Short Message Service (SMS). +/* Point-to-Point (PP) Short Message Service (SMS). * Support on Mobile Radio Interface * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ /* @@ -41,6 +40,7 @@ /*! \addtogroup sms * @{ + * \file gsm0411_utils.c */ #define GSM411_ALLOC_SIZE 1024 -- To view, visit https://gerrit.osmocom.org/4300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I24c56ccb56d5b39cfb887808f91b715da54c0f8b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:14 +0000 Subject: [PATCH] libosmocore[master]: [doc] Define 'gsup' group with proper name, add intro text In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4301 to look at the new patch set (#2). [doc] Define 'gsup' group with proper name, add intro text Change-Id: Ieee6213dc5aad082a2d439c7418b51f281b80b1a --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c 2 files changed, 20 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/4301/2 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 36e5c84..8daf460 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -1,5 +1,20 @@ -/*! \file gsup.h - * Osmocom Generic Subscriber Update Protocol message encoder/decoder. */ +/*! \defgroup gsup Generic Subscriber Update Protocol + * @{ + * + * The Generic Subscriber Update Protocol (GSUP) is an Osmocom-specific + * non-standard protocol replacing MAP as the protocol between + * MSC/VLR/SGSN and HLR in a 3GPP cellular communications network. + * + * It was designed around the same transactions and architecture as the + * MAP messages/operations, but without the complexity of TCAP and MAP, + * and without the need for ASN.1 encoding. + * + * The purpose is to keep protocol complexity out of OsmoSGSN and + * OsmoMSC, while providing a clean path to an external GSUP to MAP + * translator. + * + * \file gsup.h + * Osmocom Generic Subscriber Update Protocol message encoder/decoder. */ /* * (C) 2014 by sysmocom s.f.m.c. GmbH, Author: Jacob Erlbeck * (C) 2016 by Harald Welte @@ -163,3 +178,5 @@ int osmo_gsup_decode(const uint8_t *data, size_t data_len, struct osmo_gsup_message *gsup_msg); void osmo_gsup_encode(struct msgb *msg, const struct osmo_gsup_message *gsup_msg); + +/*! @} */ diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 685c91f..e5b0a66 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -1,5 +1,3 @@ -/*! \file gsup.c - * Osmocom Generic Subscriber Update Protocol message encoder/decoder. */ /* * (C) 2014 by sysmocom s.f.m.c. GmbH * (C) 2015 by Holger Hans Peter Freyther @@ -33,6 +31,7 @@ /*! \addtogroup gsup * @{ + * \file gsup.c * Osmocom Generic Subscriber Update Protocol */ -- To view, visit https://gerrit.osmocom.org/4301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieee6213dc5aad082a2d439c7418b51f281b80b1a Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:14 +0000 Subject: [PATCH] libosmocore[master]: [doc] Properly define 'oap' group and add introductory text In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4302 to look at the new patch set (#2). [doc] Properly define 'oap' group and add introductory text Change-Id: I1e875991ae1dd93862f850f85d40b3dac61ece72 --- M include/osmocom/gsm/oap.h M src/gsm/oap.c 2 files changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/02/4302/2 diff --git a/include/osmocom/gsm/oap.h b/include/osmocom/gsm/oap.h index ef83b79..ce1e151 100644 --- a/include/osmocom/gsm/oap.h +++ b/include/osmocom/gsm/oap.h @@ -1,5 +1,12 @@ -/*! \file oap.h - * Osmocom Authentication Protocol message encoder/decoder. */ +/*! \defgroup oap Osmocom Authentication Protocol + * @{ + * + * The Osmocom Authentication Protocol (OAP) is a way to use the 3GPP + * AKA (Authentication and Key Agreement) as cryptographic + * authentication mechanism in other protocols that don't provide + * cryptographic authentication. + * + * \file oap.h */ /* * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -71,3 +78,5 @@ int osmo_oap_decode(struct osmo_oap_message *oap_msg, const uint8_t *data, size_t data_len); void osmo_oap_encode(struct msgb *msg, const struct osmo_oap_message *oap_msg); + +/*! @} */ diff --git a/src/gsm/oap.c b/src/gsm/oap.c index b07eafc..aab5cac 100644 --- a/src/gsm/oap.c +++ b/src/gsm/oap.c @@ -1,5 +1,3 @@ -/*! \file oap.c - * Osmocom Authentication Protocol message encoder/decoder */ /* * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -31,6 +29,7 @@ /*! \addtogroup oap * @{ + * \file oap.c * Osmocom Authentication Protocol */ -- To view, visit https://gerrit.osmocom.org/4302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1e875991ae1dd93862f850f85d40b3dac61ece72 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:14 +0000 Subject: [PATCH] libosmocore[master]: [doc] Properly define gsm0800 group and move all related fil... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4303 to look at the new patch set (#2). [doc] Properly define gsm0800 group and move all related files into it Change-Id: I91920c69c86d6a1932172becacb76faff2d3eb1e --- M include/osmocom/gsm/gsm0808.h M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c 4 files changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/03/4303/2 diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index 4369cab..3deee70 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -1,4 +1,6 @@ -/*! \file gsm0808.h */ +/*! \defgroup gsm0808 GSM 08.08 / 3GPP TS 48.008 A Interface + * @{ + * \file gsm0808.h */ /* * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves @@ -75,3 +77,5 @@ const char *gsm0808_bssmap_name(uint8_t msg_type); const char *gsm0808_bssap_name(uint8_t msg_type); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 17a03f5..db15666 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -1,4 +1,6 @@ -/*! \file gsm0808_utils.h */ +/*! \addtogroup gsm0808 + * @{ + * \file gsm0808_utils.h */ /* * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -53,3 +55,5 @@ int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch); int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc, uint8_t perm_spch); + +/*! @} */ diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index a8a5e45..ee5eda4 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1,4 +1,3 @@ -/*! \file gsm0808.c */ /* * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves @@ -28,7 +27,9 @@ /*! \addtogroup gsm0808 * @{ - * Helper functions regarding the TS 08.08 / 48.008 A interface + * \file gsm0808.c + * Helper functions regarding the TS 08.08 / 48.008 A interface, primarily + * message generation/encoding. */ #define BSSMAP_MSG_SIZE 512 diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index e2cd91b..798a122 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -1,4 +1,3 @@ -/*! \file gsm0808_utils.c */ /* * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -44,6 +43,7 @@ /*! \addtogroup gsm0808 * @{ + * \file gsm0808_utils.c */ /*! Encode TS 08.08 AoIP transport address IE -- To view, visit https://gerrit.osmocom.org/4303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I91920c69c86d6a1932172becacb76faff2d3eb1e Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:30 +0000 Subject: [MERGED] libosmocore[master]: [doc] Provide proper name for 'auth' group In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Provide proper name for 'auth' group ...................................................................... [doc] Provide proper name for 'auth' group Change-Id: I5fb1c34475ea9db36c2ec5cddc988074a72a35f7 --- M include/osmocom/crypt/auth.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 1b017c0..4dbc6a4 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -1,6 +1,6 @@ #pragma once -/*! \addtogroup auth +/*! \defgroup auth GSM/GPRS/3G Authentication * @{ * \file auth.h */ -- To view, visit https://gerrit.osmocom.org/4298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5fb1c34475ea9db36c2ec5cddc988074a72a35f7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:31 +0000 Subject: [MERGED] libosmocore[master]: [doc] Properly define gsm0800 group and move all related fil... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Properly define gsm0800 group and move all related files into it ...................................................................... [doc] Properly define gsm0800 group and move all related files into it Change-Id: I91920c69c86d6a1932172becacb76faff2d3eb1e --- M include/osmocom/gsm/gsm0808.h M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c 4 files changed, 14 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index 4369cab..3deee70 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -1,4 +1,6 @@ -/*! \file gsm0808.h */ +/*! \defgroup gsm0808 GSM 08.08 / 3GPP TS 48.008 A Interface + * @{ + * \file gsm0808.h */ /* * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves @@ -75,3 +77,5 @@ const char *gsm0808_bssmap_name(uint8_t msg_type); const char *gsm0808_bssap_name(uint8_t msg_type); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 17a03f5..db15666 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -1,4 +1,6 @@ -/*! \file gsm0808_utils.h */ +/*! \addtogroup gsm0808 + * @{ + * \file gsm0808_utils.h */ /* * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -53,3 +55,5 @@ int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch); int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc, uint8_t perm_spch); + +/*! @} */ diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index a8a5e45..ee5eda4 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1,4 +1,3 @@ -/*! \file gsm0808.c */ /* * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves @@ -28,7 +27,9 @@ /*! \addtogroup gsm0808 * @{ - * Helper functions regarding the TS 08.08 / 48.008 A interface + * \file gsm0808.c + * Helper functions regarding the TS 08.08 / 48.008 A interface, primarily + * message generation/encoding. */ #define BSSMAP_MSG_SIZE 512 diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index e2cd91b..798a122 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -1,4 +1,3 @@ -/*! \file gsm0808_utils.c */ /* * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -44,6 +43,7 @@ /*! \addtogroup gsm0808 * @{ + * \file gsm0808_utils.c */ /*! Encode TS 08.08 AoIP transport address IE -- To view, visit https://gerrit.osmocom.org/4303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I91920c69c86d6a1932172becacb76faff2d3eb1e Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:31 +0000 Subject: [MERGED] libosmocore[master]: [doc] Properly define 'oap' group and add introductory text In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Properly define 'oap' group and add introductory text ...................................................................... [doc] Properly define 'oap' group and add introductory text Change-Id: I1e875991ae1dd93862f850f85d40b3dac61ece72 --- M include/osmocom/gsm/oap.h M src/gsm/oap.c 2 files changed, 12 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/oap.h b/include/osmocom/gsm/oap.h index ef83b79..ce1e151 100644 --- a/include/osmocom/gsm/oap.h +++ b/include/osmocom/gsm/oap.h @@ -1,5 +1,12 @@ -/*! \file oap.h - * Osmocom Authentication Protocol message encoder/decoder. */ +/*! \defgroup oap Osmocom Authentication Protocol + * @{ + * + * The Osmocom Authentication Protocol (OAP) is a way to use the 3GPP + * AKA (Authentication and Key Agreement) as cryptographic + * authentication mechanism in other protocols that don't provide + * cryptographic authentication. + * + * \file oap.h */ /* * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -71,3 +78,5 @@ int osmo_oap_decode(struct osmo_oap_message *oap_msg, const uint8_t *data, size_t data_len); void osmo_oap_encode(struct msgb *msg, const struct osmo_oap_message *oap_msg); + +/*! @} */ diff --git a/src/gsm/oap.c b/src/gsm/oap.c index b07eafc..aab5cac 100644 --- a/src/gsm/oap.c +++ b/src/gsm/oap.c @@ -1,5 +1,3 @@ -/*! \file oap.c - * Osmocom Authentication Protocol message encoder/decoder */ /* * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved @@ -31,6 +29,7 @@ /*! \addtogroup oap * @{ + * \file oap.c * Osmocom Authentication Protocol */ -- To view, visit https://gerrit.osmocom.org/4302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e875991ae1dd93862f850f85d40b3dac61ece72 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:31 +0000 Subject: [MERGED] libosmocore[master]: [doc] Define 'gsup' group with proper name, add intro text In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] Define 'gsup' group with proper name, add intro text ...................................................................... [doc] Define 'gsup' group with proper name, add intro text Change-Id: Ieee6213dc5aad082a2d439c7418b51f281b80b1a --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c 2 files changed, 20 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 36e5c84..8daf460 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -1,5 +1,20 @@ -/*! \file gsup.h - * Osmocom Generic Subscriber Update Protocol message encoder/decoder. */ +/*! \defgroup gsup Generic Subscriber Update Protocol + * @{ + * + * The Generic Subscriber Update Protocol (GSUP) is an Osmocom-specific + * non-standard protocol replacing MAP as the protocol between + * MSC/VLR/SGSN and HLR in a 3GPP cellular communications network. + * + * It was designed around the same transactions and architecture as the + * MAP messages/operations, but without the complexity of TCAP and MAP, + * and without the need for ASN.1 encoding. + * + * The purpose is to keep protocol complexity out of OsmoSGSN and + * OsmoMSC, while providing a clean path to an external GSUP to MAP + * translator. + * + * \file gsup.h + * Osmocom Generic Subscriber Update Protocol message encoder/decoder. */ /* * (C) 2014 by sysmocom s.f.m.c. GmbH, Author: Jacob Erlbeck * (C) 2016 by Harald Welte @@ -163,3 +178,5 @@ int osmo_gsup_decode(const uint8_t *data, size_t data_len, struct osmo_gsup_message *gsup_msg); void osmo_gsup_encode(struct msgb *msg, const struct osmo_gsup_message *gsup_msg); + +/*! @} */ diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 685c91f..e5b0a66 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -1,5 +1,3 @@ -/*! \file gsup.c - * Osmocom Generic Subscriber Update Protocol message encoder/decoder. */ /* * (C) 2014 by sysmocom s.f.m.c. GmbH * (C) 2015 by Holger Hans Peter Freyther @@ -33,6 +31,7 @@ /*! \addtogroup gsup * @{ + * \file gsup.c * Osmocom Generic Subscriber Update Protocol */ -- To view, visit https://gerrit.osmocom.org/4301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieee6213dc5aad082a2d439c7418b51f281b80b1a Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:31 +0000 Subject: [MERGED] libosmocore[master]: [doc] make sure all SMS related code is part of the 'sms' group In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] make sure all SMS related code is part of the 'sms' group ...................................................................... [doc] make sure all SMS related code is part of the 'sms' group Change-Id: I24c56ccb56d5b39cfb887808f91b715da54c0f8b --- M include/osmocom/gsm/gsm0341.h M include/osmocom/gsm/gsm0411_smc.h M include/osmocom/gsm/gsm0411_smr.h M include/osmocom/gsm/gsm0411_utils.h M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_smr.c M src/gsm/gsm0411_utils.c 8 files changed, 27 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm0341.h b/include/osmocom/gsm/gsm0341.h index 2fc83e4..834dbf9 100644 --- a/include/osmocom/gsm/gsm0341.h +++ b/include/osmocom/gsm/gsm0341.h @@ -1,4 +1,6 @@ -/*! \file gsm0341.h */ +/*! \defgroup sms Short Message Service (SMS) + * @{ + * \file gsm0341.h */ #pragma once @@ -9,3 +11,5 @@ uint8_t update, uint16_t msg_id, uint8_t dcs, uint8_t page_total, uint8_t page_cur, uint8_t *data, uint8_t len); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0411_smc.h b/include/osmocom/gsm/gsm0411_smc.h index 0cd1f94..7dfaa15 100644 --- a/include/osmocom/gsm/gsm0411_smc.h +++ b/include/osmocom/gsm/gsm0411_smc.h @@ -1,4 +1,6 @@ -/*! \file gsm0411_smc.h */ +/*! \addtogroup sms + * @{ + * \file gsm0411_smc.h */ #pragma once @@ -61,3 +63,5 @@ /* message from lower layer */ int gsm411_smc_recv(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg, int cp_msg_type); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0411_smr.h b/include/osmocom/gsm/gsm0411_smr.h index 19f9c5d..28f43de 100644 --- a/include/osmocom/gsm/gsm0411_smr.h +++ b/include/osmocom/gsm/gsm0411_smr.h @@ -1,4 +1,6 @@ -/*! \file gsm0411_smr.h */ +/*! \addtogroup sms + * @{ + * \file gsm0411_smr.h */ #pragma once @@ -42,3 +44,5 @@ /* message from lower layer */ int gsm411_smr_recv(struct gsm411_smr_inst *inst, int msg_type, struct msgb *msg); + +/*! @} */ diff --git a/include/osmocom/gsm/gsm0411_utils.h b/include/osmocom/gsm/gsm0411_utils.h index 1c51111..2cd87b8 100644 --- a/include/osmocom/gsm/gsm0411_utils.h +++ b/include/osmocom/gsm/gsm0411_utils.h @@ -1,4 +1,6 @@ -/*! \file gsm0411_utils.h */ +/*! \addtogroup sms + * @{ + * \file gsm0411_utils.h */ #pragma once @@ -35,3 +37,5 @@ /* Prefix msg with a 04.08/04.11 CP header */ int gsm411_push_cp_header(struct msgb *msg, uint8_t proto, uint8_t trans, uint8_t msg_type); + +/*! @} */ diff --git a/src/gsm/gsm0341.c b/src/gsm/gsm0341.c index 05a0b4a..485023f 100644 --- a/src/gsm/gsm0341.c +++ b/src/gsm/gsm0341.c @@ -1,4 +1,3 @@ -/*! \file gsm0341.c */ /* * (C) 2014 by Harald Welte * All Rights Reserved @@ -30,6 +29,7 @@ /*! \addtogroup sms * @{ + * \file gsm0341.c */ /*! Encode a 3GPP TS 03.41 SMS-CB message diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c index 7414e95..f7c536b 100644 --- a/src/gsm/gsm0411_smc.c +++ b/src/gsm/gsm0411_smc.c @@ -1,5 +1,4 @@ -/*! \file gsm0411_smc.c - * Point-to-Point (PP) Short Message Service (SMS). +/* Point-to-Point (PP) Short Message Service (SMS). * Support on Mobile Radio Interface * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ /* @@ -63,6 +62,7 @@ /*! \addtogroup sms * @{ + * \file gsm0411_smc.c * Point-to-Point (PP) Short Message Service (SMS) as per TS 04.11 */ diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c index 67bb249..0a25c7c 100644 --- a/src/gsm/gsm0411_smr.c +++ b/src/gsm/gsm0411_smr.c @@ -1,5 +1,4 @@ -/*! \file gsm0411_smr.c - * Point-to-Point (PP) Short Message Service (SMS). +/* Point-to-Point (PP) Short Message Service (SMS). * Support on Mobile Radio Interface * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0 */ /* @@ -65,6 +64,7 @@ /*! \addtogroup sms * @{ + * \file gsm0411_smr.c */ static void rp_timer_expired(void *data); diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index a4e9d0d..acf7e23 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -1,5 +1,4 @@ -/*! \file gsm0411_utils.c - * Point-to-Point (PP) Short Message Service (SMS). +/* Point-to-Point (PP) Short Message Service (SMS). * Support on Mobile Radio Interface * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ /* @@ -41,6 +40,7 @@ /*! \addtogroup sms * @{ + * \file gsm0411_utils.c */ #define GSM411_ALLOC_SIZE 1024 -- To view, visit https://gerrit.osmocom.org/4300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24c56ccb56d5b39cfb887808f91b715da54c0f8b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 05:53:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 05:53:32 +0000 Subject: [MERGED] libosmocore[master]: [doc] gea has separate group; A5 is not part of crypto but a... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: [doc] gea has separate group; A5 is not part of crypto but a5 group ...................................................................... [doc] gea has separate group; A5 is not part of crypto but a5 group Change-Id: I2fd24c86f9b52244073ec800a3287e3d38e660d9 --- M include/osmocom/gsm/a5.h M include/osmocom/gsm/gea.h M src/gsm/a5.c M src/gsm/gea.c 4 files changed, 18 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/a5.h b/include/osmocom/gsm/a5.h index fae3fdd..fa63246 100644 --- a/include/osmocom/gsm/a5.h +++ b/include/osmocom/gsm/a5.h @@ -1,5 +1,3 @@ -/*! \file gsm/a5.h - * Osmocom GSM A5 ciphering algorithm header. */ /* * Copyright (C) 2011 Sylvain Munaut * diff --git a/include/osmocom/gsm/gea.h b/include/osmocom/gsm/gea.h index 5c23d2a..fff9baa 100644 --- a/include/osmocom/gsm/gea.h +++ b/include/osmocom/gsm/gea.h @@ -1,5 +1,8 @@ -/*! \file gea.h - * GEA3 header. +/*! \defgroup gea GPRS GEA3/GEA4 ciphering algorithm + * @{ + * \file gea.h + * + * GEA3/GEA4 header. * * See gea.c for details */ @@ -15,3 +18,5 @@ int gea4(uint8_t *out, uint16_t len, uint8_t *kc, uint32_t iv, enum gprs_cipher_direction direct); + +/*! @} */ diff --git a/src/gsm/a5.c b/src/gsm/a5.c index e906b6d..ea09e17 100644 --- a/src/gsm/a5.c +++ b/src/gsm/a5.c @@ -1,10 +1,3 @@ -/*! \file a5.c - * Full reimplementation of A5/1,2 (split and threadsafe). - * - * The logic behind the algorithm is taken from "A pedagogical implementation - * of the GSM A5/1 and A5/2 "voice privacy" encryption algorithms." by - * Marc Briceno, Ian Goldberg, and David Wagner. - */ /* * Copyright (C) 2011 Sylvain Munaut * @@ -25,11 +18,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/*! \addtogroup crypto +/*! \addtogroup a5 * @{ - * Osmocom GSM/GPRS ciphering algorithm implementation + * Osmocom GSM ciphering algorithm implementation * - * \file gsm/a5.c */ + * Full reimplementation of A5/1,2,3,4 (split and threadsafe). + * + * The logic behind the algorithm is taken from "A pedagogical implementation + * of the GSM A5/1 and A5/2 "voice privacy" encryption algorithms." by + * Marc Briceno, Ian Goldberg, and David Wagner. + */ #include #include diff --git a/src/gsm/gea.c b/src/gsm/gea.c index d95c03e..70f08ad 100644 --- a/src/gsm/gea.c +++ b/src/gsm/gea.c @@ -1,5 +1,3 @@ -/*! \file gea.c - * Implementation of GEA3 and GEA4. */ /* * Copyright (C) 2016 by Sysmocom s.f.m.c. GmbH * @@ -28,9 +26,10 @@ #include #include -/*! \addtogroup crypto +/*! \addtogroup gea * @{ - * \file gsm/gea.c */ + * Implementation of GPRS Ciphers GEA3 and GEA4. + * \file gea.c */ /*! Performs the GEA4 algorithm as in 3GPP TS 55.226 V9.0.0 * \param[in,out] out Buffer for gamma for encrypted/decrypted -- To view, visit https://gerrit.osmocom.org/4299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2fd24c86f9b52244073ec800a3287e3d38e660d9 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 08:11:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 08:11:01 +0000 Subject: [PATCH] openbsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4277 to look at the new patch set (#2). bsc_api: Fix NULL secondary_lchan access in handle_ass_fail Related: OW#3893 Program terminated with signal SIGSEGV, Segmentation fault. 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 (gdb) bt 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 1 0x0805ab80 in lchan_release (lchan=0x0, sacch_deact=sacch_deact at entry=0, mode=mode at entry=RSL_REL_LOCAL_END) at chan_alloc.c:410 2 0x0805c1dd in handle_ass_fail (msg=0x94142b8, conn=0x9251048) at bsc_api.c:459 3 dispatch_dtap (msg=0x94142b8, link_id=0 '\000', conn=0x9251048) at bsc_api.c:598 4 gsm0408_rcvmsg (msg=msg at entry=0x94142b8, link_id=0 '\000') at bsc_api.c:658 5 0x08058ca2 in abis_rsl_rx_rll (msg=0x94142b8) at abis_rsl.c:1686 6 abis_rsl_rcvmsg (msg=0x94142b8) at abis_rsl.c:2097 7 0xb7e8cf9a in handle_ts1_read (bfd=0x94e8e08) at input/ipaccess.c:271 8 ipaccess_fd_cb (bfd=0x94e8e08, what=1) at input/ipaccess.c:386 9 0xb7ee8434 in osmo_select_main (polling=polling at entry=0) at select.c:158 10 0x0804bd7c in main (argc=6, argv=0xbfc27144) at osmo_bsc_main.c:272 (gdb) print lchan $2 = (const struct gsm_lchan *) 0x0 Possible scenario in which this crash can appear: 1- gsm0808_assign_req() calls handle_new_assignment() which sends an CHAN ACTIVATE msg and arms T10 timer. 2- ACTIVATE ACK is received (handle_chan_ack), which calls gsm48_send_rr_ass_cmd() which sends an ASSIGNMENT CMD, and doesn't disable/modify T10 timer. 3- T10 timeout is triggered (assignment_t10_timeout()), which sets conn->secondary_lchan = NULL 4- Immediately after, the ASSIGNMENT FAILURE message (which might have been already queued) is processed in handle_ass_fail, and then the crash occurs. This race condition is not an issue for handle_ass_compl() path because there's this check there which would trigger most probably if secondary_lchan is NULL: "if (conn->secondary_lchan != msg->lchan)" Change-Id: Ied5bd90b9c06f27135a2e3c46e40d49d27d9a387 --- M openbsc/src/libbsc/bsc_api.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/77/4277/2 diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index fa45421..0c16db3 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -485,8 +485,10 @@ /* stop the timer and release it */ osmo_timer_del(&conn->T10); - lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); - conn->secondary_lchan = NULL; + if (conn->secondary_lchan) { + lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); + conn->secondary_lchan = NULL; + } gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { -- To view, visit https://gerrit.osmocom.org/4277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ied5bd90b9c06f27135a2e3c46e40d49d27d9a387 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 17 08:11:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 08:11:26 +0000 Subject: [PATCH] osmo-bsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4278 to look at the new patch set (#2). bsc_api: Fix NULL secondary_lchan access in handle_ass_fail Related: OW#3893 Program terminated with signal SIGSEGV, Segmentation fault. 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 (gdb) bt 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 1 0x0805ab80 in lchan_release (lchan=0x0, sacch_deact=sacch_deact at entry=0, mode=mode at entry=RSL_REL_LOCAL_END) at chan_alloc.c:410 2 0x0805c1dd in handle_ass_fail (msg=0x94142b8, conn=0x9251048) at bsc_api.c:459 3 dispatch_dtap (msg=0x94142b8, link_id=0 '\000', conn=0x9251048) at bsc_api.c:598 4 gsm0408_rcvmsg (msg=msg at entry=0x94142b8, link_id=0 '\000') at bsc_api.c:658 5 0x08058ca2 in abis_rsl_rx_rll (msg=0x94142b8) at abis_rsl.c:1686 6 abis_rsl_rcvmsg (msg=0x94142b8) at abis_rsl.c:2097 7 0xb7e8cf9a in handle_ts1_read (bfd=0x94e8e08) at input/ipaccess.c:271 8 ipaccess_fd_cb (bfd=0x94e8e08, what=1) at input/ipaccess.c:386 9 0xb7ee8434 in osmo_select_main (polling=polling at entry=0) at select.c:158 10 0x0804bd7c in main (argc=6, argv=0xbfc27144) at osmo_bsc_main.c:272 (gdb) print lchan $2 = (const struct gsm_lchan *) 0x0 Possible scenario in which this crash can appear: 1- gsm0808_assign_req() calls handle_new_assignment() which sends an CHAN ACTIVATE msg and arms T10 timer. 2- ACTIVATE ACK is received (handle_chan_ack), which calls gsm48_send_rr_ass_cmd() which sends an ASSIGNMENT CMD, and doesn't disable/modify T10 timer. 3- T10 timeout is triggered (assignment_t10_timeout()), which sets conn->secondary_lchan = NULL 4- Immediately after, the ASSIGNMENT FAILURE message (which might have been already queued) is processed in handle_ass_fail, and then the crash occurs. This race condition is not an issue for handle_ass_compl() path because there's this check there which would trigger most probably if secondary_lchan is NULL: "if (conn->secondary_lchan != msg->lchan)" Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1 --- M src/libbsc/bsc_api.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/78/4278/2 diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index b42c382..44c50c1 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -487,8 +487,10 @@ /* stop the timer and release it */ osmo_timer_del(&conn->T10); - lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); - conn->secondary_lchan = NULL; + if (conn->secondary_lchan) { + lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); + conn->secondary_lchan = NULL; + } gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { -- To view, visit https://gerrit.osmocom.org/4278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 17 10:09:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 10:09:41 +0000 Subject: libosmocore[master]: vty logging: restore level everything for facility all In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 I think "all" category should be deprecated entirely as it's undocumented and hard to wrap your head around. See comments in https://osmocom.org/issues/71 -- To view, visit https://gerrit.osmocom.org/4313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idd9933e0e1c06fd217866e2d4dbe6cae63296a16 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 10:20:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 10:20:44 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 2: -Code-Review > No, only for repositories where: > - we need to add doxygen docs > - doc/examples are used > - such move would not cause any complications (.deb packaging does > not rely on it etc) My intention is to generally have matching structures in all of our git repositories; currently that is mostly doc/examples, right? I was thinking about it, and a reason to keep the doc/ dir would be that we also have other documentation in the doc/ dirs in some git repositories. But our tendency is to move all of those additional docs to osmo-gsm-manuals, so it should mostly be ok to have just an examples dir with config examples in it. A reason against is that some wiki pages etc may point to examples by git.osmocom.org/ URLs which would then break. And for some repositories we do install examples from debian, so we need to take care that these are still installed in prefix/share/doc. so ... I am kind of fine with it I guess, but I'd like this to be similar in all git repositories and prefer if example URLs don't break ... hmm. Would be easy to +2 without the file move. The move makes it hard for me to agree, in the line of Holger's comments to avoid cosmetic changes in general. -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:02:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 11:02:53 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 2: > currently that is mostly doc/examples, right? Wrong: it's mostly neither. Moreover, I don't know any other library in Osmocom with doc/examples. > some wiki pages etc may point to examples by git.osmocom.org/ URLs Which wiki? Let me know the URL and I'll fix it. > for some repositories we do install examples from debian That's not the case for this repo. -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:08:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 11:08:49 +0000 Subject: [PATCH] osmo-bts[master]: osmo-trx: vty: various fixes of 'write file' and doc Message-ID: Review at https://gerrit.osmocom.org/4314 osmo-trx: vty: various fixes of 'write file' and doc On 'write file': - Write 'osmotrx' before 'maxdly' and 'maxdlynb' (broken since "Introduce new phy_link and phy_instance abstraction" d784e50747b8cf0ce505489e1451f75be5ccbd4b) - Fix indenting of 'write file' output, command 'osmotrx timing-advance-loop', had a stray space in case there is not a 'no' preceding it. Add some missing instances of OSMOTRX_STR doc strings. examples/osmo-bts.cfg: - Drop 'settsc'. - Fix indenting of 'osmotrx rx-gain' command. osmo-bts does not feature VTY tests, so it is pointless to add example files to test these fixes. We should probably add VTY tests separately. However, I have briefly tested manually (and hence found all of these issues). Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000 --- M doc/examples/trx/osmo-bts.cfg M src/osmo-bts-trx/trx_vty.c 2 files changed, 10 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/14/4314/1 diff --git a/doc/examples/trx/osmo-bts.cfg b/doc/examples/trx/osmo-bts.cfg index c267fd0..805d929 100644 --- a/doc/examples/trx/osmo-bts.cfg +++ b/doc/examples/trx/osmo-bts.cfg @@ -21,14 +21,13 @@ ! phy 0 instance 0 - osmotrx rx-gain 1 + osmotrx rx-gain 1 osmotrx ip local 127.0.0.1 osmotrx ip remote 127.0.0.1 bts 0 band 1800 ipa unit-id 6969 0 oml remote-ip 192.168.122.1 - settsc gsmtap-sapi ccch gsmtap-sapi pdtch trx 0 diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index a7a433b..1dfc617 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -207,6 +207,7 @@ DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd, "osmotrx maxdly <0-31>", + OSMOTRX_STR "Set the maximum acceptable delay of an Access Burst (in GSM symbols)." " Access Burst is the first burst a mobile transmits in order to establish" " a connection and it is used to estimate Timing Advance (TA) which is" @@ -230,6 +231,7 @@ DEFUN(cfg_phyinst_maxdlynb, cfg_phyinst_maxdlynb_cmd, "osmotrx maxdlynb <0-31>", + OSMOTRX_STR "Set the maximum acceptable delay of a Normal Burst (in GSM symbols)." " USE FOR TESTING ONLY, DON'T CHANGE IN PRODUCTION USE!" " During normal operation, Normal Bursts delay are controled by a Timing" @@ -396,7 +398,8 @@ DEFUN(cfg_phyinst_no_maxdly, cfg_phyinst_no_maxdly_cmd, "no osmotrx maxdly", - NO_STR "Unset the maximum delay of GSM symbols\n") + NO_STR OSMOTRX_STR + "Unset the maximum delay of GSM symbols\n") { struct phy_instance *pinst = vty->index; struct trx_l1h *l1h = pinst->u.osmotrx.hdl; @@ -408,7 +411,8 @@ DEFUN(cfg_phyinst_no_maxdlynb, cfg_phyinst_no_maxdlynb_cmd, "no osmotrx maxdlynb", - NO_STR "Unset the maximum delay of GSM symbols\n") + NO_STR OSMOTRX_STR + "Unset the maximum delay of GSM symbols\n") { struct phy_instance *pinst = vty->index; struct trx_l1h *l1h = pinst->u.osmotrx.hdl; @@ -502,7 +506,7 @@ vty_out(vty, " osmotrx ms-power-loop %d%s", plink->u.osmotrx.trx_target_rssi, VTY_NEWLINE); else vty_out(vty, " no osmotrx ms-power-loop%s", VTY_NEWLINE); - vty_out(vty, " %s osmotrx timing-advance-loop%s", (plink->u.osmotrx.trx_ta_loop) ? "" : "no", VTY_NEWLINE); + vty_out(vty, " %sosmotrx timing-advance-loop%s", (plink->u.osmotrx.trx_ta_loop) ? "" : "no ", VTY_NEWLINE); if (plink->u.osmotrx.base_port_local) vty_out(vty, " osmotrx base-port local %"PRIu16"%s", @@ -535,9 +539,9 @@ l1h->config.power, VTY_NEWLINE); } if (l1h->config.maxdly_valid) - vty_out(vty, " maxdly %d%s", l1h->config.maxdly, VTY_NEWLINE); + vty_out(vty, " osmotrx maxdly %d%s", l1h->config.maxdly, VTY_NEWLINE); if (l1h->config.maxdlynb_valid) - vty_out(vty, " maxdlynb %d%s", l1h->config.maxdlynb, VTY_NEWLINE); + vty_out(vty, " osmotrx maxdlynb %d%s", l1h->config.maxdlynb, VTY_NEWLINE); if (l1h->config.slotmask != 0xff) vty_out(vty, " slotmask %d %d %d %d %d %d %d %d%s", l1h->config.slotmask & 1, -- To view, visit https://gerrit.osmocom.org/4314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:12:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 11:12:43 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (4 comments) https://gerrit.osmocom.org/#/c/4311/2/src/ctrl.c File src/ctrl.c: Line 119: do { \ This looks pretty generic. Would it make sense to put it into libosmoctrl instead? Line 156: /* not used yet */ Shouldn't it belong to separate patch? Line 224: whitespace Line 272: again -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:16:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 11:16:25 +0000 Subject: osmo-bts[master]: osmo-trx: vty: various fixes of 'write file' and doc In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4314/1//COMMIT_MSG Commit Message: Line 19: - Drop 'settsc'. It's better to clarify why it was dropped. -- To view, visit https://gerrit.osmocom.org/4314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:40:47 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 11:40:47 +0000 Subject: osmo-gsm-tester[master]: Improve resource requirements in suite.conf In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I10fd47f53509f04abe1e2a39036e5d97c781ddab Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:40:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 11:40:51 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Improve resource requirements in suite.conf In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Improve resource requirements in suite.conf ...................................................................... Improve resource requirements in suite.conf Change-Id: I10fd47f53509f04abe1e2a39036e5d97c781ddab --- M example/default-suites.conf M suites/aoip_encryption/suite.conf M suites/aoip_smpp/suite.conf M suites/aoip_sms/suite.conf M suites/smpp/suite.conf M suites/sms/suite.conf 6 files changed, 15 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/default-suites.conf b/example/default-suites.conf index 1e8d47a..0198486 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -6,4 +6,4 @@ - aoip_sms:trx-sysmocell5000 - smpp - aoip_smpp -- aoip_encryption:cipher-a50+cipher-a51 +- aoip_encryption diff --git a/suites/aoip_encryption/suite.conf b/suites/aoip_encryption/suite.conf index 3cdc525..d6d0eee 100644 --- a/suites/aoip_encryption/suite.conf +++ b/suites/aoip_encryption/suite.conf @@ -3,8 +3,14 @@ - times: 5 # msc, bsc, hlr, stp, mgw bts: - times: 1 + ciphers: + - a5_0 + - a5_1 modem: - times: 1 + ciphers: + - a5_0 + - a5_1 defaults: timeout: 120s diff --git a/suites/aoip_smpp/suite.conf b/suites/aoip_smpp/suite.conf index 46f8d09..688fe0a 100644 --- a/suites/aoip_smpp/suite.conf +++ b/suites/aoip_smpp/suite.conf @@ -5,6 +5,8 @@ - times: 1 modem: - times: 1 + features: + - sms defaults: timeout: 60s diff --git a/suites/aoip_sms/suite.conf b/suites/aoip_sms/suite.conf index 216d3ea..677a95e 100644 --- a/suites/aoip_sms/suite.conf +++ b/suites/aoip_sms/suite.conf @@ -5,3 +5,5 @@ - times: 1 modem: - times: 2 + features: + - sms diff --git a/suites/smpp/suite.conf b/suites/smpp/suite.conf index eb59abb..eb5dc01 100644 --- a/suites/smpp/suite.conf +++ b/suites/smpp/suite.conf @@ -5,6 +5,8 @@ - times: 1 modem: - times: 1 + features: + - sms defaults: timeout: 60s diff --git a/suites/sms/suite.conf b/suites/sms/suite.conf index 376f6cd..485402b 100644 --- a/suites/sms/suite.conf +++ b/suites/sms/suite.conf @@ -5,6 +5,8 @@ - times: 1 modem: - times: 2 + features: + - sms defaults: timeout: 60s -- To view, visit https://gerrit.osmocom.org/4261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I10fd47f53509f04abe1e2a39036e5d97c781ddab Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:53:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 11:53:29 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 2: @Max: The point of Neels is that he wants *The same* setup for all osmocom (cellular communications) git repositories. Not for all libraries or all applications, but for *all*. I agree with the latter, as it is very confusing otherwise. Also, as the project evolves, it could very well be that we decided to start putting doxygen API documentation inside e.g. OsmoBSC or OsmoBTS, to document the internal APIs used between different modules of the code. At that point, we would have doxygen in an "application" and the problem with "rm -rf doc/" would be back. So I'm all for finding a solution that avoids the global rm -rf /doc, as that would work in general, for all repositories, and be future-proof. -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:53:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 11:53:43 +0000 Subject: libosmocore[master]: api doc: fix two doxygen group closing braces In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6c1f47d13c5b7a9cb2281de9f017df4f1ed88ba7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:53:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 11:53:46 +0000 Subject: [MERGED] libosmocore[master]: api doc: fix two doxygen group closing braces In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: api doc: fix two doxygen group closing braces ...................................................................... api doc: fix two doxygen group closing braces Change-Id: I6c1f47d13c5b7a9cb2281de9f017df4f1ed88ba7 --- M include/osmocom/core/linuxlist.h M include/osmocom/gprs/gprs_ns.h 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h index cb753d1..8d0533f 100644 --- a/include/osmocom/core/linuxlist.h +++ b/include/osmocom/core/linuxlist.h @@ -397,5 +397,5 @@ } /*! - * }@ + * @} */ diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 938ad99..5aee755 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -218,4 +218,4 @@ void gprs_ns_set_log_ss(int ss); -/*! }@ */ +/*! @} */ -- To view, visit https://gerrit.osmocom.org/4304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6c1f47d13c5b7a9cb2281de9f017df4f1ed88ba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:56:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 11:56:14 +0000 Subject: openbsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied5bd90b9c06f27135a2e3c46e40d49d27d9a387 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:56:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 11:56:15 +0000 Subject: [MERGED] openbsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail ...................................................................... bsc_api: Fix NULL secondary_lchan access in handle_ass_fail Related: OW#3893 Program terminated with signal SIGSEGV, Segmentation fault. 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 (gdb) bt 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 1 0x0805ab80 in lchan_release (lchan=0x0, sacch_deact=sacch_deact at entry=0, mode=mode at entry=RSL_REL_LOCAL_END) at chan_alloc.c:410 2 0x0805c1dd in handle_ass_fail (msg=0x94142b8, conn=0x9251048) at bsc_api.c:459 3 dispatch_dtap (msg=0x94142b8, link_id=0 '\000', conn=0x9251048) at bsc_api.c:598 4 gsm0408_rcvmsg (msg=msg at entry=0x94142b8, link_id=0 '\000') at bsc_api.c:658 5 0x08058ca2 in abis_rsl_rx_rll (msg=0x94142b8) at abis_rsl.c:1686 6 abis_rsl_rcvmsg (msg=0x94142b8) at abis_rsl.c:2097 7 0xb7e8cf9a in handle_ts1_read (bfd=0x94e8e08) at input/ipaccess.c:271 8 ipaccess_fd_cb (bfd=0x94e8e08, what=1) at input/ipaccess.c:386 9 0xb7ee8434 in osmo_select_main (polling=polling at entry=0) at select.c:158 10 0x0804bd7c in main (argc=6, argv=0xbfc27144) at osmo_bsc_main.c:272 (gdb) print lchan $2 = (const struct gsm_lchan *) 0x0 Possible scenario in which this crash can appear: 1- gsm0808_assign_req() calls handle_new_assignment() which sends an CHAN ACTIVATE msg and arms T10 timer. 2- ACTIVATE ACK is received (handle_chan_ack), which calls gsm48_send_rr_ass_cmd() which sends an ASSIGNMENT CMD, and doesn't disable/modify T10 timer. 3- T10 timeout is triggered (assignment_t10_timeout()), which sets conn->secondary_lchan = NULL 4- Immediately after, the ASSIGNMENT FAILURE message (which might have been already queued) is processed in handle_ass_fail, and then the crash occurs. This race condition is not an issue for handle_ass_compl() path because there's this check there which would trigger most probably if secondary_lchan is NULL: "if (conn->secondary_lchan != msg->lchan)" Change-Id: Ied5bd90b9c06f27135a2e3c46e40d49d27d9a387 --- M openbsc/src/libbsc/bsc_api.c 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index fa45421..0c16db3 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -485,8 +485,10 @@ /* stop the timer and release it */ osmo_timer_del(&conn->T10); - lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); - conn->secondary_lchan = NULL; + if (conn->secondary_lchan) { + lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); + conn->secondary_lchan = NULL; + } gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { -- To view, visit https://gerrit.osmocom.org/4277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied5bd90b9c06f27135a2e3c46e40d49d27d9a387 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:57:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 11:57:24 +0000 Subject: osmo-bts[master]: osmo-trx: vty: various fixes of 'write file' and doc In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4314/1//COMMIT_MSG Commit Message: Line 7: osmo-trx: vty: various fixes of 'write file' and doc bts-trx. It applies to all devices using osmo-bts-trx, even those not using osmo-trx. -- To view, visit https://gerrit.osmocom.org/4314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:57:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 11:57:40 +0000 Subject: osmo-bsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 11:57:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 11:57:42 +0000 Subject: [MERGED] osmo-bsc[master]: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc_api: Fix NULL secondary_lchan access in handle_ass_fail ...................................................................... bsc_api: Fix NULL secondary_lchan access in handle_ass_fail Related: OW#3893 Program terminated with signal SIGSEGV, Segmentation fault. 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 (gdb) bt 0 gsm_lchan_name (lchan=lchan at entry=0x0) at gsm_data_shared.c:342 1 0x0805ab80 in lchan_release (lchan=0x0, sacch_deact=sacch_deact at entry=0, mode=mode at entry=RSL_REL_LOCAL_END) at chan_alloc.c:410 2 0x0805c1dd in handle_ass_fail (msg=0x94142b8, conn=0x9251048) at bsc_api.c:459 3 dispatch_dtap (msg=0x94142b8, link_id=0 '\000', conn=0x9251048) at bsc_api.c:598 4 gsm0408_rcvmsg (msg=msg at entry=0x94142b8, link_id=0 '\000') at bsc_api.c:658 5 0x08058ca2 in abis_rsl_rx_rll (msg=0x94142b8) at abis_rsl.c:1686 6 abis_rsl_rcvmsg (msg=0x94142b8) at abis_rsl.c:2097 7 0xb7e8cf9a in handle_ts1_read (bfd=0x94e8e08) at input/ipaccess.c:271 8 ipaccess_fd_cb (bfd=0x94e8e08, what=1) at input/ipaccess.c:386 9 0xb7ee8434 in osmo_select_main (polling=polling at entry=0) at select.c:158 10 0x0804bd7c in main (argc=6, argv=0xbfc27144) at osmo_bsc_main.c:272 (gdb) print lchan $2 = (const struct gsm_lchan *) 0x0 Possible scenario in which this crash can appear: 1- gsm0808_assign_req() calls handle_new_assignment() which sends an CHAN ACTIVATE msg and arms T10 timer. 2- ACTIVATE ACK is received (handle_chan_ack), which calls gsm48_send_rr_ass_cmd() which sends an ASSIGNMENT CMD, and doesn't disable/modify T10 timer. 3- T10 timeout is triggered (assignment_t10_timeout()), which sets conn->secondary_lchan = NULL 4- Immediately after, the ASSIGNMENT FAILURE message (which might have been already queued) is processed in handle_ass_fail, and then the crash occurs. This race condition is not an issue for handle_ass_compl() path because there's this check there which would trigger most probably if secondary_lchan is NULL: "if (conn->secondary_lchan != msg->lchan)" Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1 --- M src/libbsc/bsc_api.c 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index b42c382..44c50c1 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -487,8 +487,10 @@ /* stop the timer and release it */ osmo_timer_del(&conn->T10); - lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); - conn->secondary_lchan = NULL; + if (conn->secondary_lchan) { + lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); + conn->secondary_lchan = NULL; + } gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { -- To view, visit https://gerrit.osmocom.org/4278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 17 12:03:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 12:03:32 +0000 Subject: [PATCH] osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4256 to look at the new patch set (#5). ippool: Implement and use blacklist instead of blindly using IPPOOL_NOGATEWAY Commit dda21ed7d4a897c9284c69175d0da598598eae40 modified previous calls to ippool_new() removing the pass of flags to avoid allocating certain problematic IPs from the pool to MS, such as the network, gateway and broadcast IPs. Today I did some unsucessful tests with osmo-ggsn with a pool "ip prefix dynamic 176.16.222.0/24", and thus IP 176.16.222.0 was being assigned to the MS. De-capsulated DNS packets were received in the tun interface, but the Linux system in there was unable to correctly forward the packets to the gateway interface connected to the Internet. However, adding a second MS which got 176.16.222.1 had its packets forwarded correctly. However, previous implementation relies on flag IPPOOL_NOGATEWAY flag to blindly blacklist first IP after the network ip (ie, .0 and .1 are removed), which limits the IP reserved for the tun device to be .1. If a different IP in the range is assigned, it may cause issues. As a result, a blacklist is introduced in this commit to dynamically fetch the tun IP address and exlucde it from the pool of available IPs. Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 --- M ggsn/ggsn.c M lib/ippool.c M lib/ippool.h M tests/lib/ippool_test.c M tests/lib/ippool_test.err M tests/lib/ippool_test.ok 6 files changed, 365 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/56/4256/5 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index ff760cf..57642e6 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -146,10 +146,50 @@ return 0; } + +static int alloc_ippool_blacklist(struct apn_ctx *apn, const struct tun_t *tun, struct in46_prefix **blacklist, bool ipv6) +{ + + int flags, len, len2, i; + + if (ipv6) + flags = IP_TYPE_IPv6_NONLINK; + else + flags = IP_TYPE_IPv4; + + while (1) { + len = tun_ip_local_get(apn->tun.tun, NULL, 0, flags); + if (len < 1) + return len; + + *blacklist = talloc_zero_size(apn, len * sizeof(struct in46_prefix)); + len2 = tun_ip_local_get(apn->tun.tun, *blacklist, len, flags); + if (len2 < 1) { + free(*blacklist); + return len2; + } + + if (len2 > len) /* iface was added between 2 calls, repeat operation */ + free(*blacklist); + else + break; + } + + for (i = 0; i < len2; i++) + LOGPAPN(LOGL_INFO, apn, "Blacklist tun IP %s\n", + in46p_ntoa(&(*blacklist)[i])); + + return len2; +} + /* actually start the APN with its current config */ int apn_start(struct apn_ctx *apn) { + int ippool_flags = IPPOOL_NONETWORK | IPPOOL_NOBROADCAST; struct in46_prefix ipv6_tun_linklocal_ip; + struct in46_prefix *blacklist; + int blacklist_size; + if (apn->started) return 0; @@ -231,24 +271,34 @@ if (apn->v4.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if ((blacklist_size = alloc_ippool_blacklist(apn, apn->tun.tun, &blacklist, false)) < 0) + LOGPAPN(LOGL_ERROR, apn, "Failed obtaining IPv4 tun IPs\n"); if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, - &apn->v4.cfg.static_prefix, 0)) { + &apn->v4.cfg.static_prefix, ippool_flags, + blacklist, blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); + talloc_free(blacklist); apn_stop(apn, false); return -1; } + talloc_free(blacklist); } /* Create IPv6 pool */ if (apn->v6.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if ((blacklist_size = alloc_ippool_blacklist(apn, apn->tun.tun, &blacklist, true)) < 0) + LOGPAPN(LOGL_ERROR, apn, "Failed obtaining IPv6 tun IPs\n"); if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, - &apn->v6.cfg.static_prefix, 0)) { + &apn->v6.cfg.static_prefix, ippool_flags, + blacklist, blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); + talloc_free(blacklist); apn_stop(apn, false); return -1; } + talloc_free(blacklist); } LOGPAPN(LOGL_NOTICE, apn, "Successfully started\n"); diff --git a/lib/ippool.c b/lib/ippool.c index 03323e2..55a41d0 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -184,9 +184,19 @@ } } +static bool addr_in_prefix_list(struct in46_addr *addr, struct in46_prefix *list, size_t list_size) +{ + int i; + for (i = 0; i < list_size; i++) { + if (in46a_prefix_equal(addr, &list[i].addr)) + return true; + } + return false; +} + /* Create new address pool */ int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, const struct in46_prefix *stat, - int flags) + int flags, struct in46_prefix *blacklist, size_t blacklist_size) { /* Parse only first instance of pool for now */ @@ -210,18 +220,16 @@ if (addr.len == sizeof(struct in6_addr)) addr.len = 64/8; - /* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */ - if (flags & IPPOOL_NOGATEWAY) { - flags |= IPPOOL_NONETWORK; - } - dynsize = (1 << (addr.len*8 - addrprefixlen)); if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; - if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ - dynsize--; if (flags & IPPOOL_NOBROADCAST) /* Exclude broadcast address from pool */ dynsize--; + /* Exclude included blacklist addresses from pool */ + for (i = 0; i < blacklist_size; i++) { + if (in46a_within_mask(&blacklist[i].addr, &addr, addrprefixlen)) + dynsize--; + } } if (!stat || stat->addr.len == 0) { @@ -278,13 +286,17 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; - if (flags & IPPOOL_NOGATEWAY) { - in46a_inc(&addr); - in46a_inc(&addr); - } else if (flags & IPPOOL_NONETWORK) { + if (flags & IPPOOL_NONETWORK) { in46a_inc(&addr); } for (i = 0; i < dynsize; i++) { + if (addr_in_prefix_list(&addr, blacklist, blacklist_size)) { + SYS_ERR(DIP, LOGL_DEBUG, 0, + "addr blacklisted from pool: %s", in46a_ntoa(&addr)); + in46a_inc(&addr); + i--; + continue; + } (*this)->member[i].addr = addr; in46a_inc(&addr); diff --git a/lib/ippool.h b/lib/ippool.h index 56beb4e..efb274b 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -31,7 +31,6 @@ #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 -#define IPPOOL_NOGATEWAY 0x04 #define IPPOOL_STATSIZE 0x10000 @@ -72,7 +71,8 @@ /* Create new address pool */ extern int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, - const struct in46_prefix *stat, int flags); + const struct in46_prefix *stat, int flags, + struct in46_prefix *blacklist, size_t blacklist_size); /* Delete existing address pool */ extern int ippool_free(struct ippool_t *this); diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index f38c1be..ea56edd 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -13,36 +13,47 @@ #include "../../lib/syserr.h" -static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags) +static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags, char **blacklist, size_t blacklist_size) { + struct in46_prefix *blacklist_pfx; struct ippool_t *pool; struct in46_prefix pfx; size_t t; int rc; + int i; + + blacklist_pfx = calloc(blacklist_size, sizeof(struct in46_prefix)); + for (i = 0; i < blacklist_size; i++) { + rc = ippool_aton(&blacklist_pfx[i].addr, &t, blacklist[i], 0); + OSMO_ASSERT(rc == 0); + pfx.prefixlen = t; + } /* dynamic-only v4 */ - rc = ippool_aton(&pfx.addr, &t, prefix_str, flags); + rc = ippool_aton(&pfx.addr, &t, prefix_str, 0); OSMO_ASSERT(rc == 0); pfx.prefixlen = t; - rc = ippool_new(&pool, &pfx, NULL, flags); + rc = ippool_new(&pool, &pfx, NULL, flags, blacklist_pfx, blacklist_size); OSMO_ASSERT(rc == 0); //ippool_printaddr(pool); + free(blacklist_pfx); + return pool; } -static void test_pool_size(const char *pfx, unsigned int flags, unsigned int expected_size) +static void test_pool_size(const char *pfx, unsigned int flags, char **blacklist, size_t blacklist_size, unsigned int expected_size) { struct ippool_t *pool; struct ippoolm_t *member; struct in46_addr addr; int i, rc, n; - printf("testing pool for prefix %s, flags=0x%x, expected_size=%u\n", pfx, flags, expected_size); - pool = create_pool(pfx, flags); + printf("testing pool for prefix %s, flags=0x%x, blacklist_size=%lu, expected_size=%u\n", pfx, flags, blacklist_size, expected_size); + pool = create_pool(pfx, flags, blacklist, blacklist_size); OSMO_ASSERT(pool->listsize == expected_size); memset(&addr, 0, sizeof(addr)); @@ -91,19 +102,23 @@ static void test_pool_sizes(void) { /* 256 addresses [0..255] */ - test_pool_size("192.168.23.0/24", 0, 256); + test_pool_size("192.168.23.0/24", 0, NULL, 0, 256); /* 255 addresses [1..255] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, 255); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, NULL, 0, 255); /* 254 addresses [1..254] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 254); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 254); /* 65534 addresses [0.1..255.254] */ - test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 65534); + test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 65534); /* 256 prefixes of /64 each */ - test_pool_size("2001:DB8::/56", 0, 256); + test_pool_size("2001:DB8::/56", 0, NULL, 0, 256); + + /* 253 addresses [1..254] & exclude 192.168.23.1/24 */ + char *blacklist[] = {"176.16.222.10/24", "192.168.23.1/24", "192.168.38.2/24"}; + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, blacklist, 3, 253); } int main(int argc, char **argv) diff --git a/tests/lib/ippool_test.err b/tests/lib/ippool_test.err index 7dc5371..b11c12a 100644 --- a/tests/lib/ippool_test.err +++ b/tests/lib/ippool_test.err @@ -8,3 +8,5 @@ No more IP addresses available No more IP addresses available No more IP addresses available +No more IP addresses available +No more IP addresses available diff --git a/tests/lib/ippool_test.ok b/tests/lib/ippool_test.ok index a0eeb4b..263494e 100644 --- a/tests/lib/ippool_test.ok +++ b/tests/lib/ippool_test.ok @@ -1,4 +1,4 @@ -testing pool for prefix 192.168.23.0/24, flags=0x0, expected_size=256 +testing pool for prefix 192.168.23.0/24, flags=0x0, blacklist_size=0, expected_size=256 allocated address 192.168.23.0 allocated address 192.168.23.1 allocated address 192.168.23.2 @@ -255,7 +255,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x1, expected_size=255 +testing pool for prefix 192.168.23.0/24, flags=0x1, blacklist_size=0, expected_size=255 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -511,7 +511,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x3, expected_size=254 +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=0, expected_size=254 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -766,7 +766,7 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.0.0/16, flags=0x3, expected_size=65534 +testing pool for prefix 192.168.0.0/16, flags=0x3, blacklist_size=0, expected_size=65534 allocated address 192.168.0.1 allocated address 192.168.0.2 allocated address 192.168.0.3 @@ -66301,7 +66301,7 @@ allocated address 192.168.255.252 allocated address 192.168.255.253 allocated address 192.168.255.254 -testing pool for prefix 2001:DB8::/56, flags=0x0, expected_size=256 +testing pool for prefix 2001:DB8::/56, flags=0x0, blacklist_size=0, expected_size=256 allocated address 2001:db8:: allocated address 2001:db8:0:1:: allocated address 2001:db8:0:2:: @@ -66558,3 +66558,257 @@ allocated address 2001:db8:0:fd:: allocated address 2001:db8:0:fe:: allocated address 2001:db8:0:ff:: +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=3, expected_size=253 +allocated address 192.168.23.2 +allocated address 192.168.23.3 +allocated address 192.168.23.4 +allocated address 192.168.23.5 +allocated address 192.168.23.6 +allocated address 192.168.23.7 +allocated address 192.168.23.8 +allocated address 192.168.23.9 +allocated address 192.168.23.10 +allocated address 192.168.23.11 +allocated address 192.168.23.12 +allocated address 192.168.23.13 +allocated address 192.168.23.14 +allocated address 192.168.23.15 +allocated address 192.168.23.16 +allocated address 192.168.23.17 +allocated address 192.168.23.18 +allocated address 192.168.23.19 +allocated address 192.168.23.20 +allocated address 192.168.23.21 +allocated address 192.168.23.22 +allocated address 192.168.23.23 +allocated address 192.168.23.24 +allocated address 192.168.23.25 +allocated address 192.168.23.26 +allocated address 192.168.23.27 +allocated address 192.168.23.28 +allocated address 192.168.23.29 +allocated address 192.168.23.30 +allocated address 192.168.23.31 +allocated address 192.168.23.32 +allocated address 192.168.23.33 +allocated address 192.168.23.34 +allocated address 192.168.23.35 +allocated address 192.168.23.36 +allocated address 192.168.23.37 +allocated address 192.168.23.38 +allocated address 192.168.23.39 +allocated address 192.168.23.40 +allocated address 192.168.23.41 +allocated address 192.168.23.42 +allocated address 192.168.23.43 +allocated address 192.168.23.44 +allocated address 192.168.23.45 +allocated address 192.168.23.46 +allocated address 192.168.23.47 +allocated address 192.168.23.48 +allocated address 192.168.23.49 +allocated address 192.168.23.50 +allocated address 192.168.23.51 +allocated address 192.168.23.52 +allocated address 192.168.23.53 +allocated address 192.168.23.54 +allocated address 192.168.23.55 +allocated address 192.168.23.56 +allocated address 192.168.23.57 +allocated address 192.168.23.58 +allocated address 192.168.23.59 +allocated address 192.168.23.60 +allocated address 192.168.23.61 +allocated address 192.168.23.62 +allocated address 192.168.23.63 +allocated address 192.168.23.64 +allocated address 192.168.23.65 +allocated address 192.168.23.66 +allocated address 192.168.23.67 +allocated address 192.168.23.68 +allocated address 192.168.23.69 +allocated address 192.168.23.70 +allocated address 192.168.23.71 +allocated address 192.168.23.72 +allocated address 192.168.23.73 +allocated address 192.168.23.74 +allocated address 192.168.23.75 +allocated address 192.168.23.76 +allocated address 192.168.23.77 +allocated address 192.168.23.78 +allocated address 192.168.23.79 +allocated address 192.168.23.80 +allocated address 192.168.23.81 +allocated address 192.168.23.82 +allocated address 192.168.23.83 +allocated address 192.168.23.84 +allocated address 192.168.23.85 +allocated address 192.168.23.86 +allocated address 192.168.23.87 +allocated address 192.168.23.88 +allocated address 192.168.23.89 +allocated address 192.168.23.90 +allocated address 192.168.23.91 +allocated address 192.168.23.92 +allocated address 192.168.23.93 +allocated address 192.168.23.94 +allocated address 192.168.23.95 +allocated address 192.168.23.96 +allocated address 192.168.23.97 +allocated address 192.168.23.98 +allocated address 192.168.23.99 +allocated address 192.168.23.100 +allocated address 192.168.23.101 +allocated address 192.168.23.102 +allocated address 192.168.23.103 +allocated address 192.168.23.104 +allocated address 192.168.23.105 +allocated address 192.168.23.106 +allocated address 192.168.23.107 +allocated address 192.168.23.108 +allocated address 192.168.23.109 +allocated address 192.168.23.110 +allocated address 192.168.23.111 +allocated address 192.168.23.112 +allocated address 192.168.23.113 +allocated address 192.168.23.114 +allocated address 192.168.23.115 +allocated address 192.168.23.116 +allocated address 192.168.23.117 +allocated address 192.168.23.118 +allocated address 192.168.23.119 +allocated address 192.168.23.120 +allocated address 192.168.23.121 +allocated address 192.168.23.122 +allocated address 192.168.23.123 +allocated address 192.168.23.124 +allocated address 192.168.23.125 +allocated address 192.168.23.126 +allocated address 192.168.23.127 +allocated address 192.168.23.128 +allocated address 192.168.23.129 +allocated address 192.168.23.130 +allocated address 192.168.23.131 +allocated address 192.168.23.132 +allocated address 192.168.23.133 +allocated address 192.168.23.134 +allocated address 192.168.23.135 +allocated address 192.168.23.136 +allocated address 192.168.23.137 +allocated address 192.168.23.138 +allocated address 192.168.23.139 +allocated address 192.168.23.140 +allocated address 192.168.23.141 +allocated address 192.168.23.142 +allocated address 192.168.23.143 +allocated address 192.168.23.144 +allocated address 192.168.23.145 +allocated address 192.168.23.146 +allocated address 192.168.23.147 +allocated address 192.168.23.148 +allocated address 192.168.23.149 +allocated address 192.168.23.150 +allocated address 192.168.23.151 +allocated address 192.168.23.152 +allocated address 192.168.23.153 +allocated address 192.168.23.154 +allocated address 192.168.23.155 +allocated address 192.168.23.156 +allocated address 192.168.23.157 +allocated address 192.168.23.158 +allocated address 192.168.23.159 +allocated address 192.168.23.160 +allocated address 192.168.23.161 +allocated address 192.168.23.162 +allocated address 192.168.23.163 +allocated address 192.168.23.164 +allocated address 192.168.23.165 +allocated address 192.168.23.166 +allocated address 192.168.23.167 +allocated address 192.168.23.168 +allocated address 192.168.23.169 +allocated address 192.168.23.170 +allocated address 192.168.23.171 +allocated address 192.168.23.172 +allocated address 192.168.23.173 +allocated address 192.168.23.174 +allocated address 192.168.23.175 +allocated address 192.168.23.176 +allocated address 192.168.23.177 +allocated address 192.168.23.178 +allocated address 192.168.23.179 +allocated address 192.168.23.180 +allocated address 192.168.23.181 +allocated address 192.168.23.182 +allocated address 192.168.23.183 +allocated address 192.168.23.184 +allocated address 192.168.23.185 +allocated address 192.168.23.186 +allocated address 192.168.23.187 +allocated address 192.168.23.188 +allocated address 192.168.23.189 +allocated address 192.168.23.190 +allocated address 192.168.23.191 +allocated address 192.168.23.192 +allocated address 192.168.23.193 +allocated address 192.168.23.194 +allocated address 192.168.23.195 +allocated address 192.168.23.196 +allocated address 192.168.23.197 +allocated address 192.168.23.198 +allocated address 192.168.23.199 +allocated address 192.168.23.200 +allocated address 192.168.23.201 +allocated address 192.168.23.202 +allocated address 192.168.23.203 +allocated address 192.168.23.204 +allocated address 192.168.23.205 +allocated address 192.168.23.206 +allocated address 192.168.23.207 +allocated address 192.168.23.208 +allocated address 192.168.23.209 +allocated address 192.168.23.210 +allocated address 192.168.23.211 +allocated address 192.168.23.212 +allocated address 192.168.23.213 +allocated address 192.168.23.214 +allocated address 192.168.23.215 +allocated address 192.168.23.216 +allocated address 192.168.23.217 +allocated address 192.168.23.218 +allocated address 192.168.23.219 +allocated address 192.168.23.220 +allocated address 192.168.23.221 +allocated address 192.168.23.222 +allocated address 192.168.23.223 +allocated address 192.168.23.224 +allocated address 192.168.23.225 +allocated address 192.168.23.226 +allocated address 192.168.23.227 +allocated address 192.168.23.228 +allocated address 192.168.23.229 +allocated address 192.168.23.230 +allocated address 192.168.23.231 +allocated address 192.168.23.232 +allocated address 192.168.23.233 +allocated address 192.168.23.234 +allocated address 192.168.23.235 +allocated address 192.168.23.236 +allocated address 192.168.23.237 +allocated address 192.168.23.238 +allocated address 192.168.23.239 +allocated address 192.168.23.240 +allocated address 192.168.23.241 +allocated address 192.168.23.242 +allocated address 192.168.23.243 +allocated address 192.168.23.244 +allocated address 192.168.23.245 +allocated address 192.168.23.246 +allocated address 192.168.23.247 +allocated address 192.168.23.248 +allocated address 192.168.23.249 +allocated address 192.168.23.250 +allocated address 192.168.23.251 +allocated address 192.168.23.252 +allocated address 192.168.23.253 +allocated address 192.168.23.254 -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 5 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 12:13:11 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 12:13:11 +0000 Subject: osmo-gsm-tester[master]: modem: Implement voice calls in modem and add voice suite In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib402effc830db293f27a877658894e454a93a606 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 12:13:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 12:13:14 +0000 Subject: osmo-gsm-tester[master]: debug: Add voicecall related methods to interactive shell In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2df68bf4fba0fb542eebdeb515a3dac6d5e575e Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 12:18:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 12:18:54 +0000 Subject: [MERGED] osmo-gsm-tester[master]: debug: Add voicecall related methods to interactive shell In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: debug: Add voicecall related methods to interactive shell ...................................................................... debug: Add voicecall related methods to interactive shell Change-Id: Id2df68bf4fba0fb542eebdeb515a3dac6d5e575e --- M suites/aoip_debug/interactive.py M suites/debug/interactive.py 2 files changed, 120 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index d596b68..819f207 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -23,13 +23,17 @@ m.connect(msc.mcc_mnc()) while True: - cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') + cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-wait-incoming , call-answer , call-hangup ') cmd = cmd.strip().lower() if not cmd: continue + + params = cmd.split() + if 'quit'.startswith(cmd): break + elif 'wait-registered'.startswith(cmd): try: for m in modems: @@ -37,12 +41,67 @@ wait(msc.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') + elif 'get-registered'.startswith(cmd): print(msc.imsi_list_attached()) print('RESULT: %s' % ('All modems are registered.' if msc.subscriber_attached(*modems) else 'Some modem(s) not registered yet.')) + elif 'sms'.startswith(cmd): for mo in modems: for mt in modems: mo.sms_send(mt.msisdn, 'to ' + mt.name()) + + elif cmd.startswith('call-list'): + if len(params) != 1 and len(params) != 2: + print('wrong format') + continue + for ms in modems: + if len(params) == 1 or str(ms.msisdn) == params[1]: + print('call-list: %r %r' % (ms.name(), ms.call_id_list())) + + elif cmd.startswith('call-dial'): + if len(params) != 3: + print('wrong format') + continue + src_msisdn, dst_msisdn = params[1:] + for mo in modems: + if str(mo.msisdn) == src_msisdn: + print('dialing %s->%s' % (src_msisdn, dst_msisdn)) + call_id = mo.call_dial(dst_msisdn) + print('dial success: call_id=%r' % call_id) + + elif cmd.startswith('call-wait-incoming'): + if len(params) != 3: + print('wrong format') + continue + src_msisdn, dst_msisdn = params[1:] + for mt in modems: + if str(mt.msisdn) == dst_msisdn: + print('waiting for incoming %s->%s' % (src_msisdn, dst_msisdn)) + call_id = mt.call_wait_incoming(src_msisdn) + print('incoming call success: call_id=%r' % call_id) + + elif cmd.startswith('call-answer'): + if len(params) != 3: + print('wrong format') + continue + mt_msisdn, call_id = params[1:] + for mt in modems: + if str(mt.msisdn) == mt_msisdn: + print('answering %s %r' % (mt.name(), call_id)) + mt.call_answer(call_id) + + elif cmd.startswith('call-hangup'): + if len(params) != 3: + print('wrong format') + continue + ms_msisdn, call_id = params[1:] + for ms in modems: + if str(ms.msisdn) == ms_msisdn: + print('hanging up %s %r' % (ms.name(), call_id)) + ms.call_hangup(call_id) + + else: + print('Unknown command: %s' % cmd) diff --git a/suites/debug/interactive.py b/suites/debug/interactive.py index 37076dc..1b89a7d 100755 --- a/suites/debug/interactive.py +++ b/suites/debug/interactive.py @@ -16,13 +16,17 @@ m.connect(nitb.mcc_mnc()) while True: - cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') + cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-wait-incoming , call-answer , call-hangup ') cmd = cmd.strip().lower() if not cmd: continue + + params = cmd.split() + if 'quit'.startswith(cmd): break + elif 'wait-registered'.startswith(cmd): try: for m in modems: @@ -30,12 +34,67 @@ wait(nitb.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') + elif 'get-registered'.startswith(cmd): print(nitb.imsi_list_attached()) print('RESULT: %s' % ('All modems are registered.' if nitb.subscriber_attached(*modems) else 'Some modem(s) not registered yet.')) + elif 'sms'.startswith(cmd): for mo in modems: for mt in modems: mo.sms_send(mt.msisdn, 'to ' + mt.name()) + + elif cmd.startswith('call-list'): + if len(params) != 1 and len(params) != 2: + print('wrong format') + continue + for ms in modems: + if len(params) == 1 or str(ms.msisdn) == params[1]: + print('call-list: %r %r' % (ms.name(), ms.call_id_list())) + + elif cmd.startswith('call-dial'): + if len(params) != 3: + print('wrong format') + continue + src_msisdn, dst_msisdn = params[1:] + for mo in modems: + if str(mo.msisdn) == src_msisdn: + print('dialing %s->%s' % (src_msisdn, dst_msisdn)) + call_id = mo.call_dial(dst_msisdn) + print('dial success: call_id=%r' % call_id) + + elif cmd.startswith('call-wait-incoming'): + if len(params) != 3: + print('wrong format') + continue + src_msisdn, dst_msisdn = params[1:] + for mt in modems: + if str(mt.msisdn) == dst_msisdn: + print('waiting for incoming %s->%s' % (src_msisdn, dst_msisdn)) + call_id = mt.call_wait_incoming(src_msisdn) + print('incoming call success: call_id=%r' % call_id) + + elif cmd.startswith('call-answer'): + if len(params) != 3: + print('wrong format') + continue + mt_msisdn, call_id = params[1:] + for mt in modems: + if str(mt.msisdn) == mt_msisdn: + print('answering %s %r' % (mt.name(), call_id)) + mt.call_answer(call_id) + + elif cmd.startswith('call-hangup'): + if len(params) != 3: + print('wrong format') + continue + ms_msisdn, call_id = params[1:] + for ms in modems: + if str(ms.msisdn) == ms_msisdn: + print('hanging up %s %r' % (ms.name(), call_id)) + ms.call_hangup(call_id) + + else: + print('Unknown command: %s' % cmd) -- To view, visit https://gerrit.osmocom.org/4151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2df68bf4fba0fb542eebdeb515a3dac6d5e575e Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 17 12:18:55 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 12:18:55 +0000 Subject: [MERGED] osmo-gsm-tester[master]: modem: Implement voice calls in modem and add voice suite In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: modem: Implement voice calls in modem and add voice suite ...................................................................... modem: Implement voice calls in modem and add voice suite Change-Id: Ib402effc830db293f27a877658894e454a93a606 --- M example/resources.conf M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/schema.py A suites/voice/mo_mt_call.py A suites/voice/suite.conf 5 files changed, 145 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/resources.conf b/example/resources.conf index 3daf677..70c1c35 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -60,7 +60,7 @@ ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' ciphers: [a5_0, a5_1] - features: ['sms'] + features: ['sms', 'voice'] - label: sierra_2 path: '/sierra_2' @@ -68,7 +68,7 @@ ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' ciphers: [a5_0, a5_1] - features: ['sms'] + features: ['sms', 'voice'] - label: gobi_0 path: '/gobi_0' diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index e301ed6..66c0a79 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -37,6 +37,8 @@ I_MODEM = 'org.ofono.Modem' I_NETREG = 'org.ofono.NetworkRegistration' I_SMS = 'org.ofono.MessageManager' +I_CALLMGR = 'org.ofono.VoiceCallManager' +I_CALL = 'org.ofono.VoiceCall' # See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78 NETREG_ST_REGISTERED = 'registered' @@ -338,11 +340,15 @@ self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) self.register_attempts = 0 + self.call_list = [] # one Cancellable can handle several concurrent methods. self.cancellable = Gio.Cancellable.new() self.dbus.required_signals = { I_SMS: ( ('IncomingMessage', self._on_incoming_message), ), I_NETREG: ( ('PropertyChanged', self._on_netreg_property_changed), ), + I_CALLMGR: ( ('PropertyChanged', self._on_callmgr_property_changed), + ('CallAdded', self._on_callmgr_call_added), + ('CallRemoved', self._on_callmgr_call_removed), ), } self.dbus.watch_interfaces() @@ -558,6 +564,80 @@ return True return False + def call_id_list(self): + self.dbg('call_id_list: %r' % self.call_list) + return self.call_list + + def call_dial(self, to_msisdn_or_modem): + if isinstance(to_msisdn_or_modem, Modem): + to_msisdn = to_msisdn_or_modem.msisdn + else: + to_msisdn = str(to_msisdn_or_modem) + self.dbg('Dialing:', to_msisdn) + cmgr = self.dbus.interface(I_CALLMGR) + call_obj_path = cmgr.Dial(to_msisdn, 'default') + if call_obj_path not in self.call_list: + self.dbg('Adding %s to call list' % call_obj_path) + self.call_list.append(call_obj_path) + else: + self.dbg('Dial returned already existing call') + return call_obj_path + + def _find_call_msisdn_state(self, msisdn, state): + cmgr = self.dbus.interface(I_CALLMGR) + ret = cmgr.GetCalls() + for obj_path, props in ret: + if props['LineIdentification'] == msisdn and props['State'] == state: + return obj_path + return None + + def call_wait_incoming(self, caller_msisdn_or_modem, timeout=60): + if isinstance(caller_msisdn_or_modem, Modem): + caller_msisdn = caller_msisdn_or_modem.msisdn + else: + caller_msisdn = str(caller_msisdn_or_modem) + self.dbg('Waiting for incoming call from:', caller_msisdn) + event_loop.wait(self, lambda: self._find_call_msisdn_state(caller_msisdn, 'incoming') is not None, timeout=timeout) + return self._find_call_msisdn_state(caller_msisdn, 'incoming') + + def call_answer(self, call_id): + self.dbg('Answer call %s' % call_id) + assert self.call_state(call_id) == 'incoming' + call_dbus_obj = systembus_get(call_id) + call_dbus_obj.Answer() + + def call_hangup(self, call_id): + self.dbg('Hang up call %s' % call_id) + call_dbus_obj = systembus_get(call_id) + call_dbus_obj.Hangup() + + def call_is_active(self, call_id): + return self.call_state(call_id) == 'active' + + def call_state(self, call_id): + call_dbus_obj = systembus_get(call_id) + props = call_dbus_obj.GetProperties() + state = props.get('State') + self.dbg('call state: %s' % state) + return state + + def _on_callmgr_call_added(self, obj_path, properties): + self.dbg('%r.CallAdded() -> %s=%r' % (I_CALLMGR, obj_path, repr(properties))) + if obj_path not in self.call_list: + self.call_list.append(obj_path) + else: + self.dbg('Call already exists %r' % obj_path) + + def _on_callmgr_call_removed(self, obj_path): + self.dbg('%r.CallRemoved() -> %s' % (I_CALLMGR, obj_path)) + if obj_path in self.call_list: + self.call_list.remove(obj_path) + else: + self.dbg('Trying to remove non-existing call %r' % obj_path) + + def _on_callmgr_property_changed(self, name, value): + self.dbg('%r.PropertyChanged() -> %s=%s' % (I_CALLMGR, name, value)) + def info(self, keys=('Manufacturer', 'Model', 'Revision', 'Serial')): props = self.properties() return ', '.join(['%s: %r'%(k,props.get(k)) for k in keys]) diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 6d5f7ad..9b142d3 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -82,7 +82,7 @@ raise ValueError('Unknown Cipher value: %r' % val) def modem_feature(val): - if val in ('sms', 'gprs', 'voicecall', 'ussd'): + if val in ('sms', 'gprs', 'voice', 'ussd'): return raise ValueError('Unknown Modem Feature: %r' % val) diff --git a/suites/voice/mo_mt_call.py b/suites/voice/mo_mt_call.py new file mode 100755 index 0000000..f426037 --- /dev/null +++ b/suites/voice/mo_mt_call.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms_mo = suite.modem() +ms_mt = suite.modem() + +hlr.start() +stp.start() +msc.start() +mgcpgw.start() + +bsc.bts_add(bts) +bsc.start() + +bts.start() + +hlr.subscriber_add(ms_mo) +hlr.subscriber_add(ms_mt) + +ms_mo.connect(msc.mcc_mnc()) +ms_mt.connect(msc.mcc_mnc()) + +ms_mo.log_info() +ms_mt.log_info() + +print('waiting for modems to attach...') +wait(ms_mo.is_connected, msc.mcc_mnc()) +wait(ms_mt.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms_mo, ms_mt) + +assert len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0 +mo_cid = ms_mo.call_dial(ms_mt) +mt_cid = ms_mt.call_wait_incoming(ms_mo) +print('dial success') + +assert not ms_mo.call_is_active(mo_cid) and not ms_mt.call_is_active(mt_cid) +ms_mt.call_answer(mt_cid) +wait(ms_mo.call_is_active, mo_cid) +wait(ms_mt.call_is_active, mt_cid) +print('answer success, call established and ongoing') + +sleep(5) # maintain the call active for 5 seconds + +assert ms_mo.call_is_active(mo_cid) and ms_mt.call_is_active(mt_cid) +ms_mt.call_hangup(mt_cid) +wait(lambda: len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0) +print('hangup success') diff --git a/suites/voice/suite.conf b/suites/voice/suite.conf new file mode 100644 index 0000000..40d9f97 --- /dev/null +++ b/suites/voice/suite.conf @@ -0,0 +1,9 @@ +resources: + ip_address: + - times: 5 # msc, bsc, hlr, stp, mgw + bts: + - times: 1 + modem: + - times: 2 + features: + - voice -- To view, visit https://gerrit.osmocom.org/4150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib402effc830db293f27a877658894e454a93a606 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 17 12:19:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 12:19:20 +0000 Subject: osmo-gsm-tester[master]: default-suites: Enable voice suite In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4152 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I89174514b2af8909fd252ba4f694818b7353db8c Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 12:19:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 12:19:28 +0000 Subject: [MERGED] osmo-gsm-tester[master]: default-suites: Enable voice suite In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: default-suites: Enable voice suite ...................................................................... default-suites: Enable voice suite Change-Id: I89174514b2af8909fd252ba4f694818b7353db8c --- M example/default-suites.conf 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/example/default-suites.conf b/example/default-suites.conf index 0198486..3fd1322 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -1,9 +1,12 @@ - sms:sysmo - aoip_sms:sysmo +- voice:sysmo - sms:trx-b200 - aoip_sms:trx-b200 +- voice:trx-b200 - sms:trx-sysmocell5000 - aoip_sms:trx-sysmocell5000 +- voice:trx-sysmocell5000 - smpp - aoip_smpp - aoip_encryption -- To view, visit https://gerrit.osmocom.org/4152 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I89174514b2af8909fd252ba4f694818b7353db8c Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 17 12:48:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 12:48:03 +0000 Subject: [PATCH] osmo-sgsn[master]: deb: install .service files Message-ID: Review at https://gerrit.osmocom.org/4315 deb: install .service files Previously .init files were in debian/ but .service in contrib/ which resulted in only .init being installable via .deb packages. Fix this by moving all startup files into debian/ to make both installable. Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf --- R debian/osmo-gbproxy.service R debian/osmo-sgsn.service 2 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/15/4315/1 diff --git a/contrib/systemd/osmo-gbproxy.service b/debian/osmo-gbproxy.service similarity index 100% rename from contrib/systemd/osmo-gbproxy.service rename to debian/osmo-gbproxy.service diff --git a/contrib/systemd/osmo-sgsn.service b/debian/osmo-sgsn.service similarity index 100% rename from contrib/systemd/osmo-sgsn.service rename to debian/osmo-sgsn.service -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 17 13:30:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 13:30:37 +0000 Subject: [PATCH] osmo-gsm-tester[master]: contrib/jenkins-run.sh: Log and archive ofono output during ... Message-ID: Review at https://gerrit.osmocom.org/4316 contrib/jenkins-run.sh: Log and archive ofono output during test time Change-Id: Ie83b03cef4f3ca3a2d91ac4731b3ed602ab1eadf --- M contrib/jenkins-run.sh 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/16/4316/1 diff --git a/contrib/jenkins-run.sh b/contrib/jenkins-run.sh index 8c24385..7400df2 100755 --- a/contrib/jenkins-run.sh +++ b/contrib/jenkins-run.sh @@ -2,6 +2,8 @@ set -e -x base="$PWD" +time_start="$(date '+%F %T')" + # remove older trial dirs and *-run.tgz, if any trial_dir_prefix="trial-" rm -rf "$trial_dir_prefix"* || true @@ -30,5 +32,7 @@ cd "$trial_dir" tar czf "$base/${trial_dir}-run.tgz" "$(readlink last_run)" tar czf "$base/${trial_dir}-bin.tgz" *.md5 *.tgz +journalctl -u ofono -o short-precise --since "${time_start}" > "$base/${trial_dir}-ofono.log" +gzip "$base/${trial_dir}-ofono.log" exit $exit_code -- To view, visit https://gerrit.osmocom.org/4316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie83b03cef4f3ca3a2d91ac4731b3ed602ab1eadf Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 17 13:31:53 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Oct 2017 13:31:53 +0000 Subject: [PATCH] libosmocore[master]: gb: optionally allow nsip packets only from a specific host Message-ID: Review at https://gerrit.osmocom.org/4317 gb: optionally allow nsip packets only from a specific host When listening for nsip connections is enabled, then every remote host may send packets. This is useful for an SGSN that serves multiple PCUs, but contraproductive for a PCU that awaits packets from a single SGSN. Add struct members remote_ip, and remote_port to struct gprs_ns_inst, when set, then the listening end uses connect() to ensure that only the expected host may send packets. Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 --- M include/osmocom/gprs/gprs_ns.h M src/gb/gprs_ns.c 2 files changed, 33 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/4317/1 diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 938ad99..66e3d9e 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -88,6 +88,8 @@ struct osmo_fd fd; uint32_t local_ip; uint16_t local_port; + uint32_t remote_ip; + uint16_t remote_port; int dscp; } nsip; /*! NS-over-FR-over-GRE-over-IP specific bits */ diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index d20ed23..f60a2a7 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1561,15 +1561,43 @@ int gprs_ns_nsip_listen(struct gprs_ns_inst *nsi) { struct in_addr in; + struct in_addr remote; + char remote_str[INET_ADDRSTRLEN]; int ret; in.s_addr = osmo_htonl(nsi->nsip.local_ip); + remote.s_addr = osmo_htonl(nsi->nsip.remote_ip); nsi->nsip.fd.cb = nsip_fd_cb; nsi->nsip.fd.data = nsi; - ret = osmo_sock_init_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, - IPPROTO_UDP, inet_ntoa(in), - nsi->nsip.local_port, OSMO_SOCK_F_BIND); + + if (nsi->nsip.remote_ip && nsi->nsip.remote_port) { + /* Only the configured remote end may connect */ + snprintf(remote_str, sizeof(remote_str), "%s", + inet_ntoa(remote)); + ret = + osmo_sock_init2_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, + IPPROTO_UDP, inet_ntoa(in), + nsi->nsip.local_port, remote_str, + nsi->nsip.remote_port, + OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT); + + LOGP(DNS, LOGL_NOTICE, + "Listening for nsip connection from %s:%u on %s:%u\n", + remote_str, nsi->nsip.remote_port, inet_ntoa(in), + nsi->nsip.local_port); + } else { + /* Everyone may connect */ + ret = osmo_sock_init_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, + IPPROTO_UDP, inet_ntoa(in), + nsi->nsip.local_port, + OSMO_SOCK_F_BIND); + + LOGP(DNS, LOGL_NOTICE, + "Listening for nsip connection on %s:%u\n", + inet_ntoa(in), nsi->nsip.local_port); + } + if (ret < 0) return ret; -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Oct 17 13:39:08 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 13:39:08 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E0=2E7_=E2=86=92_0=2E0=2E8?= Message-ID: Review at https://gerrit.osmocom.org/4318 Bump version: 0.0.7 ? 0.0.8 Change-Id: Ifc8b9ca64edd40f96cea92388d0e2f000ee07a9d --- M TODO-RELEASE M debian/changelog M debian/control R debian/libosmonetif4.install M src/Makefile.am 5 files changed, 40 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/18/4318/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..dcac95a 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -1,9 +1,26 @@ -# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install -# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info -# In short: -# LIBVERSION=c:r:a -# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. -# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. -# If any interfaces have been added since the last public release: c:r:a + 1. -# If any interfaces have been removed or changed since the last public release: c:r:0. +# When cleaning up this file upon a release: +# +# - Note that the release version number is entirely unrelated to the API +# versions. A release version 5.2.3 may happily have an API version of 42:7:5. +# +# - Bump API version in src/lib*/Makefile.am files according to chapter +# "Library interface versions" of the libtool documentation. +# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +# +# - Iff the 'current' API version has changed, rename debian/lib*.install and adjust debian/control accordingly +# +# API version bumping for the impatient: +# LIBVERSION=c:r:a (current:revision_of_current:backwards_compat_age) +# 5:2:4 means that +# - this implements version 5 of the API; +# - this is the 2nd (compatible) revision of API version 5; +# - this is backwards compatible to all APIs since 4 versions ago, +# i.e. callers that need API versions from 1 to 5 can use this. +# +# Bumping API versions recipe: +# If the library source code has changed at all since the last update, r++; +# If any interfaces have been added, removed, or changed since the last update, c++, r=0; +# If any interfaces have been added since the last public release, a++; +# If any interfaces have been removed or changed since the last public release, a=0. +# #library what description / commit summary line diff --git a/debian/changelog b/debian/changelog index 6cd3378..0a533af 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,10 @@ -libosmo-netif (0.0.7) UNRELEASED; urgency=medium +libosmo-netif (0.0.8) unstable; urgency=medium + + * Make a new release: sync git tag with version. + + -- Max Suraev Tue, 17 Oct 2017 15:06:33 +0200 + +libosmo-netif (0.0.7) unstable; urgency=medium * Move forward toward a new release. diff --git a/debian/control b/debian/control index 11ae7d0..9f67b8e 100644 --- a/debian/control +++ b/debian/control @@ -21,11 +21,11 @@ Vcs-Git: git://git.osmocom.org/libosmo-netif.git Homepage: https://projects.osmocom.org/projects/libosmo-netif -Package: libosmonetif3 +Package: libosmonetif4 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Conflicts: libosmonetif2 +Conflicts: libosmonetif2, libosmonetif2 Multi-Arch: same Description: Common/shared code regarding network interface for OpenBSC The libosmo-netif library is one of the libraries needed by the @@ -39,7 +39,7 @@ ${misc:Depends}, libosmocore-dev, libosmocore, - libosmonetif3 (= ${binary:Version}) + libosmonetif4 (= ${binary:Version}) Multi-Arch: same Description: Development headers for Osmocom network interface The libosmo-netif library is one of the libraries needed by the @@ -53,7 +53,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmonetif3, + libosmonetif4, libjs-jquery Description: Documentation for the Osmo network interface library The libosmo-netif library is one of the libraries needed by the @@ -66,7 +66,7 @@ Section: debug Architecture: any Priority: extra -Depends: libosmonetif3 (= ${binary:Version}), ${misc:Depends} +Depends: libosmonetif4 (= ${binary:Version}), ${misc:Depends} Multi-Arch: same Description: Debug symbols for Osmocom network interface library The libosmo-netif library is one of the libraries needed by the diff --git a/debian/libosmonetif3.install b/debian/libosmonetif4.install similarity index 100% rename from debian/libosmonetif3.install rename to debian/libosmonetif4.install diff --git a/src/Makefile.am b/src/Makefile.am index 4bc481e..66576c5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,7 @@ # This is _NOT_ the library release version, it's an API version. -# Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification -LIBVERSION=3:0:0 +# Please read chapter "Library interface versions" of the libtool documentation +# before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html +LIBVERSION=4:0:1 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS) -- To view, visit https://gerrit.osmocom.org/4318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifc8b9ca64edd40f96cea92388d0e2f000ee07a9d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 17 13:40:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Oct 2017 13:40:39 +0000 Subject: [PATCH] osmo-pcu[master]: gb: allow only packste from a specific SGSN Message-ID: Review at https://gerrit.osmocom.org/4319 gb: allow only packste from a specific SGSN Each PCU has a specifically assigned SGSN, which may send packets to the PCU. Ensure that no one else except the configured SGSN can send packets to the PCU. Change-Id: Ic2009039fab7cf0fba916556239747ae5b410366 Depends: libosmocore Ifeb201d9006eec275a46708007ff342cdfc14e45 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/19/4319/1 diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index 9c78ecf..7b78e2f 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -896,6 +896,8 @@ return NULL; } gprs_ns_vty_init(bssgp_nsi); + bssgp_nsi->nsip.remote_port = sgsn_port; + bssgp_nsi->nsip.remote_ip = sgsn_ip; bssgp_nsi->nsip.local_port = local_port; rc = gprs_ns_nsip_listen(bssgp_nsi); if (rc < 0) { -- To view, visit https://gerrit.osmocom.org/4319 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic2009039fab7cf0fba916556239747ae5b410366 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Oct 17 13:40:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 13:40:49 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 This is imho debian-centric and wrong fix, as it would break OE builds for instance. I think in the worst case a symbolic link can be made from contrib/ to debian/ instead of removing them from contrib/. All other projects still have the service files in contrib/ afaik. -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 13:42:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 13:42:32 +0000 Subject: [PATCH] osmo-gsm-tester[master]: contrib/jenkins-run.sh: Log and archive ofono output during ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4316 to look at the new patch set (#2). contrib/jenkins-run.sh: Log and archive ofono output during test time Change-Id: Ie83b03cef4f3ca3a2d91ac4731b3ed602ab1eadf --- M contrib/jenkins-run.sh 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/16/4316/2 diff --git a/contrib/jenkins-run.sh b/contrib/jenkins-run.sh index 8c24385..716899e 100755 --- a/contrib/jenkins-run.sh +++ b/contrib/jenkins-run.sh @@ -2,6 +2,8 @@ set -e -x base="$PWD" +time_start="$(date '+%F %T')" + # remove older trial dirs and *-run.tgz, if any trial_dir_prefix="trial-" rm -rf "$trial_dir_prefix"* || true @@ -28,6 +30,7 @@ # tar up all results for archiving (optional) cd "$trial_dir" +journalctl -u ofono -o short-precise --since "${time_start}" > "$(readlink last_run)/ofono.log" tar czf "$base/${trial_dir}-run.tgz" "$(readlink last_run)" tar czf "$base/${trial_dir}-bin.tgz" *.md5 *.tgz -- To view, visit https://gerrit.osmocom.org/4316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie83b03cef4f3ca3a2d91ac4731b3ed602ab1eadf Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 13:54:33 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 13:54:33 +0000 Subject: osmo-gsm-tester[master]: contrib/jenkins-run.sh: Log and archive ofono output during ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie83b03cef4f3ca3a2d91ac4731b3ed602ab1eadf Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 13:54:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 13:54:35 +0000 Subject: [MERGED] osmo-gsm-tester[master]: contrib/jenkins-run.sh: Log and archive ofono output during ... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: contrib/jenkins-run.sh: Log and archive ofono output during test time ...................................................................... contrib/jenkins-run.sh: Log and archive ofono output during test time Change-Id: Ie83b03cef4f3ca3a2d91ac4731b3ed602ab1eadf --- M contrib/jenkins-run.sh 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-run.sh b/contrib/jenkins-run.sh index 8c24385..716899e 100755 --- a/contrib/jenkins-run.sh +++ b/contrib/jenkins-run.sh @@ -2,6 +2,8 @@ set -e -x base="$PWD" +time_start="$(date '+%F %T')" + # remove older trial dirs and *-run.tgz, if any trial_dir_prefix="trial-" rm -rf "$trial_dir_prefix"* || true @@ -28,6 +30,7 @@ # tar up all results for archiving (optional) cd "$trial_dir" +journalctl -u ofono -o short-precise --since "${time_start}" > "$(readlink last_run)/ofono.log" tar czf "$base/${trial_dir}-run.tgz" "$(readlink last_run)" tar czf "$base/${trial_dir}-bin.tgz" *.md5 *.tgz -- To view, visit https://gerrit.osmocom.org/4316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie83b03cef4f3ca3a2d91ac4731b3ed602ab1eadf Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 17 13:56:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 13:56:01 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 1: You're right. I still think that we should be consistent and place all init-related files into the same place. Why symlink use is "worst case"? -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 13:59:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 13:59:13 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 1: I mean it's the worst case if there's no way for debian package system to access directories other than the "debian/" one, which would mean the debian packaging system is crappy. -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 14:17:09 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Oct 2017 14:17:09 +0000 Subject: [PATCH] osmo-pcu[master]: gb: allow only packets from a specific SGSN In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4319 to look at the new patch set (#2). gb: allow only packets from a specific SGSN Each PCU has a specifically assigned SGSN, which may send packets to the PCU. Ensure that no one else except the configured SGSN can send packets to the PCU. Change-Id: Ic2009039fab7cf0fba916556239747ae5b410366 Depends: libosmocore Ifeb201d9006eec275a46708007ff342cdfc14e45 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/19/4319/2 diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index 9c78ecf..7b78e2f 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -896,6 +896,8 @@ return NULL; } gprs_ns_vty_init(bssgp_nsi); + bssgp_nsi->nsip.remote_port = sgsn_port; + bssgp_nsi->nsip.remote_ip = sgsn_ip; bssgp_nsi->nsip.local_port = local_port; rc = gprs_ns_nsip_listen(bssgp_nsi); if (rc < 0) { -- To view, visit https://gerrit.osmocom.org/4319 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic2009039fab7cf0fba916556239747ae5b410366 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 14:22:22 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Oct 2017 14:22:22 +0000 Subject: [PATCH] libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Hello Max, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4200 to look at the new patch set (#5). add function msgb_printf() to print formatted text into msg buf In ASCII string based protocols it a printf() version that prints directly to the message buffer may be useful. Add function msgb_printf(), make sure that msg buffer bounderies are not exceeded. If the end of the tail buffer is hit, return with an error code. Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 --- M include/osmocom/core/msgb.h M src/msgb.c M tests/msgb/msgb_test.c M tests/msgb/msgb_test.ok 4 files changed, 161 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/4200/5 diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 91b7ec7..9c3ccf0 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -498,5 +498,6 @@ void *msgb_talloc_ctx_init(void *root_ctx, unsigned int pool_size); void msgb_set_talloc_ctx(void *ctx) OSMO_DEPRECATED("Use msgb_talloc_ctx_init() instead"); +int msgb_printf(struct msgb *msgb, const char *format, ...); /*! @} */ diff --git a/src/msgb.c b/src/msgb.c index 2e9f4a2..6fcbe53 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -55,6 +55,9 @@ #include #include #include +#include +#include + #include //#include @@ -376,4 +379,49 @@ return buf; } + +/*! Print a string to the end of message buffer. + * \param[in] msg message buffer + * \returns 0 on success, -EINVAL on error + * + * The resulting string is printed to the msgb without a trailing nul + * character. A nul following the data tail may be written as an implementation + * detail, but a trailing nul is never part of the msgb data in terms of + * msgb_length(). + * + * Note: the tailroom must always be one byte longer than the string to be + * written. The msgb is filled only up to tailroom=1. This is an implementation + * detail that allows leaving a nul character behind the valid data. + * + * In case of error, the msgb remains unchanged, though data may have been + * written to the (unused) memory after the tail pointer. + */ +int msgb_printf(struct msgb *msgb, const char *format, ...) +{ + va_list args; + int str_len; + int rc = 0; + + OSMO_ASSERT(msgb); + OSMO_ASSERT(format); + + /* Regardless of what we plan to add to the buffer, we must at least + * be able to store a string terminator (nullstring) */ + if (msgb_tailroom(msgb) < 1) + return -EINVAL; + + va_start(args, format); + + str_len = + vsnprintf((char *)msgb->tail, msgb_tailroom(msgb), format, args); + + if (str_len >= msgb_tailroom(msgb) || str_len < 0) { + rc = -EINVAL; + } else + msgb_put(msgb, str_len); + + va_end(args); + return rc; +} + /*! @} */ diff --git a/tests/msgb/msgb_test.c b/tests/msgb/msgb_test.c index ac10382..9def87f 100644 --- a/tests/msgb/msgb_test.c +++ b/tests/msgb/msgb_test.c @@ -277,6 +277,109 @@ osmo_set_panic_handler(NULL); } +static void test_msgb_printf() +{ + struct msgb *msg; + struct msgb *msg_ref; + int rc; + int total_len; + + msg = msgb_alloc(80, "data"); + + /* Add normal text: */ + printf("Add normal text:\n"); + rc = msgb_printf(msg, "|this is a test %i, %s, %16x|", 4711, "testme", + 0x4711); + total_len = msgb_length(msg); + printf("#1: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(msgb_tailroom(msg) == 33); + + /* Add normal text: */ + rc = msgb_printf(msg, "|some more text|"); + total_len = msgb_length(msg); + printf("#2: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(msgb_tailroom(msg) == 17); + + /* Add normal text which will not fit: */ + rc = msgb_printf(msg, "|more %i %x %s|", 23, 0xfee, + "text will not fit"); + total_len = msgb_length(msg); + printf("#3: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == -EINVAL); + + /* Check if we got the right amount of characters in the message buffer + * until here, so that we can be sure that the following cornercase + * tests yield plausible results */ + OSMO_ASSERT(msgb_tailroom(msg) == 17); + + /* Add normal text which just does not fit by one character, this should not + * alter the message buffers tail pointer */ + rc = msgb_printf(msg, "|more 123456 ABC|"); + total_len = msgb_length(msg); + printf("#4: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == -EINVAL); + + /* Make sure the tailroom, nor the contained string length did change */ + OSMO_ASSERT(msgb_tailroom(msg) == 17); + OSMO_ASSERT(msgb_length(msg) == 63); + + /* Add normal text which just fits */ + rc = msgb_printf(msg, "|more 123456 AB|"); + total_len = msgb_length(msg); + printf("#5: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + + /* Make sure that the string in the bufer takes up all available Space. + * Also make sure that the available tailroom has space for one byte, + * which actually holds the string terminator */ + OSMO_ASSERT(msgb_tailroom(msg) == 1); + OSMO_ASSERT(msgb_length(msg) == 79); + + /* Try to add a nullstring to the already full buffer, this should + * be ok, since we still have one byte tailroom */ + rc = msgb_printf(msg, ""); + total_len = msgb_length(msg); + printf("#6: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + + /* Make sure that we still have the same conditions as before */ + OSMO_ASSERT(msgb_tailroom(msg) == 1); + OSMO_ASSERT(msgb_length(msg) == 79); + + msgb_free(msg); + + /* Test behaviour when a completely full buffer is passed to + * msgb_printf(). We should get rc == -EINVAL and the message + * buffer must not be changed at all */ + msg = msgb_alloc(15, "data"); + msg_ref = msgb_alloc(msgb_tailroom(msg), "data"); + memset(msg->data, 0x41, msgb_tailroom(msg)); + memset(msg_ref->data, 0x41, msgb_tailroom(msg_ref)); + msgb_put(msg, msgb_tailroom(msg)); + msgb_put(msg_ref, msgb_tailroom(msg_ref)); + + printf("#7: before: %s", msgb_hexdump(msg)); + rc = msgb_printf(msg, "ABCDEF"); + printf(" after: rc=%i, %s", rc, msgb_hexdump(msg)); + if (memcmp(msg->data, msg_ref->data, msgb_length(msg)) == 0) + printf(" ==> ok, no change\n"); + else + printf(" ==> error, change detected\n"); + OSMO_ASSERT(rc == -EINVAL); + OSMO_ASSERT(msgb_tailroom(msg) == 0); + OSMO_ASSERT(msgb_length(msg) == msgb_length(msg_ref)); + + msgb_free(msg); +} + static struct log_info info = {}; int main(int argc, char **argv) @@ -287,6 +390,7 @@ test_msgb_api_errors(); test_msgb_copy(); test_msgb_resize_area(); + test_msgb_printf(); printf("Success.\n"); diff --git a/tests/msgb/msgb_test.ok b/tests/msgb/msgb_test.ok index 6603fe7..826c809 100644 --- a/tests/msgb/msgb_test.ok +++ b/tests/msgb/msgb_test.ok @@ -32,4 +32,12 @@ Original: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Extended: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Shrinked: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f +Add normal text: +#1: rc=0, total_len=47, msg->data=|this is a test 4711, testme, 4711| +#2: rc=0, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text| +#3: rc=-22, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text||more 23 fee tex +#4: rc=-22, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 ABC +#5: rc=0, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 AB| +#6: rc=0, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 AB| +#7: before: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 after: rc=-22, 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 ==> ok, no change Success. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:26:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 17 Oct 2017 15:26:11 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 2: (5 comments) https://gerrit.osmocom.org/#/c/4311/2/src/ctrl.c File src/ctrl.c: Line 119: do { \ > This looks pretty generic. Would it make sense to put it into libosmoctrl i would indeed; shall we move it now? Line 156: /* not used yet */ > Shouldn't it belong to separate patch? I first wrote this and then figured that no-one is using these values anyway. Instead of deleting and having to figure it out again later, it would be nice to just keep it ready. ok with you? Line 224: > whitespace thx Line 272: > again thx again :) Line 307: ... -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:34:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 15:34:01 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/4311/2/src/ctrl.c File src/ctrl.c: Line 119: do { \ > would indeed; shall we move it now? If we won't do it now it might be easily forgotten. Line 156: /* not used yet */ > I first wrote this and then figured that no-one is using these values anywa Erm, could you clarify? Who's using the other part of the same function? -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:36:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 15:36:43 +0000 Subject: [PATCH] osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4315 to look at the new patch set (#2). deb: install .service files Previously .init files were in debian/ but .service in contrib/ which resulted in only .init being installable via .deb packages. Fix this by adding symlinks for .service in debian/ to make both installable. Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf --- A debian/osmo-gbproxy.service A debian/osmo-sgsn.service 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/15/4315/2 diff --git a/debian/osmo-gbproxy.service b/debian/osmo-gbproxy.service new file mode 120000 index 0000000..d23c649 --- /dev/null +++ b/debian/osmo-gbproxy.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-gbproxy.service \ No newline at end of file diff --git a/debian/osmo-sgsn.service b/debian/osmo-sgsn.service new file mode 120000 index 0000000..de22d90 --- /dev/null +++ b/debian/osmo-sgsn.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-sgsn.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:37:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 15:37:52 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: Reading docs did not reveal any relevant options so symlinks it is. On a related note: shall we also move .init out of debian/ and use symlinks for them too? Is it used by OE? -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:40:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 15:40:18 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: I don't know how this usually works in debian, but I don't think we have symlinks in our other osmo-* repositories. How does it work? -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:42:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 15:42:46 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: > How does it work? Quite fine actually. I've just built .deb locally with that patch and .service files are included as expected. I guess dh_* simply follow symlinks. -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:48:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 15:48:45 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (6 comments) Sory. Correct in principle, but missing procedural requirements (TODO-RELEASE) and misleading wording :/ https://gerrit.osmocom.org/#/c/4317/1/include/osmocom/gprs/gprs_ns.h File include/osmocom/gprs/gprs_ns.h: Line 92: uint16_t remote_port; This breaks ABI compatibility and deserves a TODO-RELEASE entry to remind us to change LIBVERSION at the next release https://gerrit.osmocom.org/#/c/4317/1/src/gb/gprs_ns.c File src/gb/gprs_ns.c: PS1, Line 1575: Only the configured remote end may connect "connect" is the system call we issue, and there's no connection on UDP anyway. better: "connect to ensure only we only accept packets from the configured remote end/peer" Line 1579: osmo_sock_init2_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, we don't really need this indent with our new rule about 120 character long lines. same above for the snprintf line. Please configure your editor in a way to avoid adding line breaks where not needed. PS1, Line 1586: connection packets Line 1590: /* Everyone may connect */ "Accept UDP packets from any source IP/Port" PS1, Line 1597: connection packets -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:50:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 15:50:11 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 1: Actually, I think we should start to avoid TODO-RELEASE and tag a new release with updated LIBVERSION every time we break ABI or API compatibility. This way, the folow-up patch to osmo-pcu can change the required libosmogb version and compiling against an old version will fail with proper autoconf error message. -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:51:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 15:51:15 +0000 Subject: =?UTF-8?Q?libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E0=2E7_=E2=86=92_0=2E0=2E8?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc8b9ca64edd40f96cea92388d0e2f000ee07a9d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:53:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 15:53:01 +0000 Subject: [PATCH] osmo-sgsn[master]: Use new FSF address in license header Message-ID: Review at https://gerrit.osmocom.org/4320 Use new FSF address in license header The issue was uncovered by lintian while checking .deb packaging. Change-Id: Idfe0e3d61f2604521647e9ef5ffb984db96aabbe --- M debian/copyright M include/osmocom/sgsn/v42bis.h M include/osmocom/sgsn/v42bis_private.h M src/gprs/v42bis.c 4 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/20/4320/1 diff --git a/debian/copyright b/debian/copyright index 97b890e..2ae974f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -185,7 +185,7 @@ . You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. . The FSF address in the above text is the old one. . @@ -268,7 +268,7 @@ . You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. . THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. Currently it performs the core compression and decompression functions OK. diff --git a/include/osmocom/sgsn/v42bis.h b/include/osmocom/sgsn/v42bis.h index 607a58e..b64c43e 100644 --- a/include/osmocom/sgsn/v42bis.h +++ b/include/osmocom/sgsn/v42bis.h @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /*! \page v42bis_page V.42bis modem data compression diff --git a/include/osmocom/sgsn/v42bis_private.h b/include/osmocom/sgsn/v42bis_private.h index daa5ea3..c6b675a 100644 --- a/include/osmocom/sgsn/v42bis_private.h +++ b/include/osmocom/sgsn/v42bis_private.h @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #if !defined(_SPANDSP_PRIVATE_V42BIS_H_) diff --git a/src/gprs/v42bis.c b/src/gprs/v42bis.c index 3bb9afc..0759cdf 100644 --- a/src/gprs/v42bis.c +++ b/src/gprs/v42bis.c @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. -- To view, visit https://gerrit.osmocom.org/4320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idfe0e3d61f2604521647e9ef5ffb984db96aabbe Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:54:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 15:54:10 +0000 Subject: =?UTF-8?Q?libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E0=2E7_=E2=86=92_0=2E0=2E8?= In-Reply-To: References: Message-ID: Patch Set 1: Please submit a patch against meta-telephony laforge/nightly bumping the PV (and setting PR=0) once this patch is merged. -- To view, visit https://gerrit.osmocom.org/4318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc8b9ca64edd40f96cea92388d0e2f000ee07a9d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:54:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 15:54:43 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: > > How does it work? > > Quite fine actually. I've just built .deb locally with that patch > and .service files are included as expected. I guess dh_* simply > follow symlinks. How does it work for our *other* packages wtih .service files? -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:55:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 15:55:59 +0000 Subject: =?UTF-8?Q?libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E0=2E7_=E2=86=92_0=2E0=2E8?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 Good point, I'll update the wiki. -- To view, visit https://gerrit.osmocom.org/4318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc8b9ca64edd40f96cea92388d0e2f000ee07a9d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 15:59:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 15:59:09 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: Ah, I think I get it now. It doesn't: AFAIK none of other .deb packages install .service files yet. I plan to fix it in follow-up patches eventually. In case of OE packages I think it's copied manually, although Pau is in better position to comment on this. -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 16:18:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 16:18:14 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: Yes, it is copied by OE because "make install" doesn't install them, which may actually be a good idea. -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 16:20:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 16:20:25 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: > doesn't install them, which may actually be a good idea You mean .init, .service or both? -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 16:23:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 16:23:15 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: Ideally through flags --enable-systemd (better check in other projects as they already have this and provide ways to pass some config paths on where to install) then install that one or the sysvint one. -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:02:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:02:37 +0000 Subject: osmo-sgsn[master]: Use new FSF address in license header In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idfe0e3d61f2604521647e9ef5ffb984db96aabbe Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:02:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:02:38 +0000 Subject: [MERGED] osmo-sgsn[master]: Use new FSF address in license header In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use new FSF address in license header ...................................................................... Use new FSF address in license header The issue was uncovered by lintian while checking .deb packaging. Change-Id: Idfe0e3d61f2604521647e9ef5ffb984db96aabbe --- M debian/copyright M include/osmocom/sgsn/v42bis.h M include/osmocom/sgsn/v42bis_private.h M src/gprs/v42bis.c 4 files changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/copyright b/debian/copyright index 97b890e..2ae974f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -185,7 +185,7 @@ . You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. . The FSF address in the above text is the old one. . @@ -268,7 +268,7 @@ . You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. . THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. Currently it performs the core compression and decompression functions OK. diff --git a/include/osmocom/sgsn/v42bis.h b/include/osmocom/sgsn/v42bis.h index 607a58e..b64c43e 100644 --- a/include/osmocom/sgsn/v42bis.h +++ b/include/osmocom/sgsn/v42bis.h @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /*! \page v42bis_page V.42bis modem data compression diff --git a/include/osmocom/sgsn/v42bis_private.h b/include/osmocom/sgsn/v42bis_private.h index daa5ea3..c6b675a 100644 --- a/include/osmocom/sgsn/v42bis_private.h +++ b/include/osmocom/sgsn/v42bis_private.h @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #if !defined(_SPANDSP_PRIVATE_V42BIS_H_) diff --git a/src/gprs/v42bis.c b/src/gprs/v42bis.c index 3bb9afc..0759cdf 100644 --- a/src/gprs/v42bis.c +++ b/src/gprs/v42bis.c @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. -- To view, visit https://gerrit.osmocom.org/4320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idfe0e3d61f2604521647e9ef5ffb984db96aabbe Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:04:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:04:15 +0000 Subject: osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Patch Set 5: Code-Review-2 (1 comment) https://gerrit.osmocom.org/#/c/4256/5/ggsn/ggsn.c File ggsn/ggsn.c: Line 168: free(*blacklist); if you talloc the memory, you also have to use talloc_free() !! -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 5 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:06:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:06:32 +0000 Subject: libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 leaving it up to neels to give +2 as he had plenty of comments before. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:07:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:07:01 +0000 Subject: osmo-hlr[master]: api doc: say that lu_op_tx_del_subscr_data() doesn't free In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia341d8e5bfc6eb0dc59945281ce88eecfaab057e Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:07:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:07:13 +0000 Subject: osmo-hlr[master]: luop: fix mem leak upon error in lu_op_alloc_conn() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ebd5fb5e313be452de893248dd58b2bb73ba94a Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:07:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:07:25 +0000 Subject: osmo-hlr[master]: add lu_op_free(), use in luop.c In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib44d9062edc957d2e0710b7e485604f97e4d5612 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:07:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:07:37 +0000 Subject: osmo-hlr[master]: add test_nodes.vty In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8dba373cee1be954504f79c3305b0111071757e7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:08:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:08:04 +0000 Subject: osmo-hlr[master]: add hlr_subsrc_nam to put GSUP client notification in proper... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4c9b8f9ad51d49517474e8b51afc3cc2e1c9299a Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:08:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:08:12 +0000 Subject: osmo-hlr[master]: fix mem leak in handle_cmd_ps(): free luop In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If912dc992bc7f18c49d22ec0436d9679c1cd04f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:08:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 17:08:35 +0000 Subject: osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Patch Set 5: (5 comments) https://gerrit.osmocom.org/#/c/4256/5/ggsn/ggsn.c File ggsn/ggsn.c: Line 168: free(*blacklist); > if you talloc the memory, you also have to use talloc_free() !! Woops sorry I changed the ones below but forgot to change these ones! https://gerrit.osmocom.org/#/c/4256/2/lib/in46_addr.c File lib/in46_addr.c: Line 198: static unsigned int ipv4_netmasklen(const struct in_addr *netmask) > the new functions should have test cases in the (newly introduced) in46a_te AFAIR I'm using the specific ipv4/ipv6 functions on each get_ipvX_local_address(), but as there's a comment to unify those too, then I can use the unified in46_addr version and move these ones to static. Summary: - Add unit tests. - Add doxygen doc. - Move to a separate patch. - Move to static if it fits. Line 234: #undef ADDRFIELD > let's call it in46a_netmasklen or the like? I don't want to have a name th I'll then move the 3 functions to {ipv4,ipv6,in46a}_netmasklen. https://gerrit.osmocom.org/#/c/4256/2/lib/tun.c File lib/tun.c: Line 755: * \param[in] tun Target device owning the IP > I think this is copy+paste style programming with the ipv6 function below, I'll create flags: IP_TYPE_IPV4 IP_TYPE_IPV6_LINKLOCAL IP_TYPE_IPV6_GLOBAL then use those to check for AF_INET(6) https://gerrit.osmocom.org/#/c/4256/2/lib/tun.h File lib/tun.h: Line 97: > the change of tun_ipv6_local_get() api with flags could be split out as sep I'll split all changes to this function into a separate patch -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 5 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:09:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 17 Oct 2017 17:09:27 +0000 Subject: [PATCH] libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4234 to look at the new patch set (#3). Add doxygen docs Make sure doxygen generates library documentation by default (can be disabled at compile time). Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Related: OS#2572 --- M .gitignore A Doxyfile.in M Makefile.am M configure.ac M debian/control 5 files changed, 1,756 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/34/4234/3 diff --git a/.gitignore b/.gitignore index c38bac1..e63e4ee 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ config.* tags +/Doxyfile diff --git a/Doxyfile.in b/Doxyfile.in new file mode 100644 index 0000000..a4e10c5 --- /dev/null +++ b/Doxyfile.in @@ -0,0 +1,1716 @@ +# Doxyfile 1.7.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = libosmo-sccp + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Osmocom SIGTRAN library" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc/sccp + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @srcdir@/include/osmocom/sigtran @srcdir@/src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +# IMAGE_PATH = images/ + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = doc/libosmo-sccp.tag + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = /usr/bin/dot + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/Makefile.am b/Makefile.am index e2c5277..7ca6fdd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc libosmo-xua.pc -EXTRA_DIST = .version doc/examples/osmo-stp.cfg +EXTRA_DIST = .version examples/osmo-stp.cfg @RELMAKE@ @@ -15,3 +15,30 @@ echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version + + +if HAVE_DOXYGEN + +html_DATA = $(top_builddir)/doc/html.tar + +doc: $(html_DATA) + +$(html_DATA): $(top_builddir)/doc/sccp/html/index.html + cd $(top_builddir)/doc/sccp && tar cf html.tar html + +$(top_builddir)/doc/sccp/html/index.html: $(SOURCES) Doxyfile + @rm -rf doc/sccp + mkdir -p doc/sccp + $(DOXYGEN) Doxyfile + +install-data-hook: + cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar + +uninstall-hook: + cd $(DESTDIR)$(htmldir) && rm -rf sccp + +DX_CLEAN = doc/sccp/html/search/* doc/sccp/{html,latex}/* doc/html.tar doc/doxygen_sqlite3.db doc/sccp/doxygen_sqlite3.db doc/*.tag + +endif + +MOSTLYCLEANFILES = $(DX_CLEAN) diff --git a/configure.ac b/configure.ac index ed761c3..5404acf 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,15 @@ CFLAGS="$CFLAGS -Wall" CPPFLAGS="$CPPFLAGS -Wall" +AC_ARG_ENABLE(doxygen, + [AS_HELP_STRING( + [--disable-doxygen], + [Disable generation of documentation using doxygen], + )], + [doxygen=$enableval], [doxygen="yes"]) +AC_PATH_PROG(DOXYGEN,doxygen,false) +AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") + AC_OUTPUT( libosmo-sigtran.pc libosmo-sccp.pc @@ -79,4 +88,5 @@ tests/ss7/Makefile examples/Makefile stp/Makefile + Doxyfile Makefile) diff --git a/debian/control b/debian/control index 60bef71..a59dede 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,7 @@ libtool, dh-autoreconf, git, + doxygen, libdpkg-perl, libosmo-netif-dev, libsctp-dev -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:09:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:09:54 +0000 Subject: osmo-hlr[master]: implement subscriber vty interface, tests In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/4273/2/src/hlr_vty_subscr.c File src/hlr_vty_subscr.c: Line 34: #define osmo_hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) > should rather not be named osmo_ ... maybe add to libosmocore? also going t what's tricky here is that it can only be used on a static buf[]. Having this in a library (header) file: What would happen if you use it on a "char *buf" ? I'm worried about adding public API that is too easy to get wrong. -- To view, visit https://gerrit.osmocom.org/4273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:10:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:10:29 +0000 Subject: osmo-pcu[master]: gb: allow only packets from a specific SGSN In-Reply-To: References: Message-ID: Patch Set 2: let's require the new bumped libosmocore version after it has been tagged. -- To view, visit https://gerrit.osmocom.org/4319 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic2009039fab7cf0fba916556239747ae5b410366 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:10:29 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 17:10:29 +0000 Subject: [PATCH] osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4256 to look at the new patch set (#6). ippool: Implement and use blacklist instead of blindly using IPPOOL_NOGATEWAY Commit dda21ed7d4a897c9284c69175d0da598598eae40 modified previous calls to ippool_new() removing the pass of flags to avoid allocating certain problematic IPs from the pool to MS, such as the network, gateway and broadcast IPs. Today I did some unsucessful tests with osmo-ggsn with a pool "ip prefix dynamic 176.16.222.0/24", and thus IP 176.16.222.0 was being assigned to the MS. De-capsulated DNS packets were received in the tun interface, but the Linux system in there was unable to correctly forward the packets to the gateway interface connected to the Internet. However, adding a second MS which got 176.16.222.1 had its packets forwarded correctly. However, previous implementation relies on flag IPPOOL_NOGATEWAY flag to blindly blacklist first IP after the network ip (ie, .0 and .1 are removed), which limits the IP reserved for the tun device to be .1. If a different IP in the range is assigned, it may cause issues. As a result, a blacklist is introduced in this commit to dynamically fetch the tun IP address and exlucde it from the pool of available IPs. Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 --- M ggsn/ggsn.c M lib/ippool.c M lib/ippool.h M tests/lib/ippool_test.c M tests/lib/ippool_test.err M tests/lib/ippool_test.ok 6 files changed, 365 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/56/4256/6 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index ff760cf..8b576ab 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -146,10 +146,50 @@ return 0; } + +static int alloc_ippool_blacklist(struct apn_ctx *apn, const struct tun_t *tun, struct in46_prefix **blacklist, bool ipv6) +{ + + int flags, len, len2, i; + + if (ipv6) + flags = IP_TYPE_IPv6_NONLINK; + else + flags = IP_TYPE_IPv4; + + while (1) { + len = tun_ip_local_get(apn->tun.tun, NULL, 0, flags); + if (len < 1) + return len; + + *blacklist = talloc_zero_size(apn, len * sizeof(struct in46_prefix)); + len2 = tun_ip_local_get(apn->tun.tun, *blacklist, len, flags); + if (len2 < 1) { + talloc_free(*blacklist); + return len2; + } + + if (len2 > len) /* iface was added between 2 calls, repeat operation */ + talloc_free(*blacklist); + else + break; + } + + for (i = 0; i < len2; i++) + LOGPAPN(LOGL_INFO, apn, "Blacklist tun IP %s\n", + in46p_ntoa(&(*blacklist)[i])); + + return len2; +} + /* actually start the APN with its current config */ int apn_start(struct apn_ctx *apn) { + int ippool_flags = IPPOOL_NONETWORK | IPPOOL_NOBROADCAST; struct in46_prefix ipv6_tun_linklocal_ip; + struct in46_prefix *blacklist; + int blacklist_size; + if (apn->started) return 0; @@ -231,24 +271,34 @@ if (apn->v4.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if ((blacklist_size = alloc_ippool_blacklist(apn, apn->tun.tun, &blacklist, false)) < 0) + LOGPAPN(LOGL_ERROR, apn, "Failed obtaining IPv4 tun IPs\n"); if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, - &apn->v4.cfg.static_prefix, 0)) { + &apn->v4.cfg.static_prefix, ippool_flags, + blacklist, blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); + talloc_free(blacklist); apn_stop(apn, false); return -1; } + talloc_free(blacklist); } /* Create IPv6 pool */ if (apn->v6.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if ((blacklist_size = alloc_ippool_blacklist(apn, apn->tun.tun, &blacklist, true)) < 0) + LOGPAPN(LOGL_ERROR, apn, "Failed obtaining IPv6 tun IPs\n"); if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, - &apn->v6.cfg.static_prefix, 0)) { + &apn->v6.cfg.static_prefix, ippool_flags, + blacklist, blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); + talloc_free(blacklist); apn_stop(apn, false); return -1; } + talloc_free(blacklist); } LOGPAPN(LOGL_NOTICE, apn, "Successfully started\n"); diff --git a/lib/ippool.c b/lib/ippool.c index 03323e2..55a41d0 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -184,9 +184,19 @@ } } +static bool addr_in_prefix_list(struct in46_addr *addr, struct in46_prefix *list, size_t list_size) +{ + int i; + for (i = 0; i < list_size; i++) { + if (in46a_prefix_equal(addr, &list[i].addr)) + return true; + } + return false; +} + /* Create new address pool */ int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, const struct in46_prefix *stat, - int flags) + int flags, struct in46_prefix *blacklist, size_t blacklist_size) { /* Parse only first instance of pool for now */ @@ -210,18 +220,16 @@ if (addr.len == sizeof(struct in6_addr)) addr.len = 64/8; - /* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */ - if (flags & IPPOOL_NOGATEWAY) { - flags |= IPPOOL_NONETWORK; - } - dynsize = (1 << (addr.len*8 - addrprefixlen)); if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; - if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ - dynsize--; if (flags & IPPOOL_NOBROADCAST) /* Exclude broadcast address from pool */ dynsize--; + /* Exclude included blacklist addresses from pool */ + for (i = 0; i < blacklist_size; i++) { + if (in46a_within_mask(&blacklist[i].addr, &addr, addrprefixlen)) + dynsize--; + } } if (!stat || stat->addr.len == 0) { @@ -278,13 +286,17 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; - if (flags & IPPOOL_NOGATEWAY) { - in46a_inc(&addr); - in46a_inc(&addr); - } else if (flags & IPPOOL_NONETWORK) { + if (flags & IPPOOL_NONETWORK) { in46a_inc(&addr); } for (i = 0; i < dynsize; i++) { + if (addr_in_prefix_list(&addr, blacklist, blacklist_size)) { + SYS_ERR(DIP, LOGL_DEBUG, 0, + "addr blacklisted from pool: %s", in46a_ntoa(&addr)); + in46a_inc(&addr); + i--; + continue; + } (*this)->member[i].addr = addr; in46a_inc(&addr); diff --git a/lib/ippool.h b/lib/ippool.h index 56beb4e..efb274b 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -31,7 +31,6 @@ #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 -#define IPPOOL_NOGATEWAY 0x04 #define IPPOOL_STATSIZE 0x10000 @@ -72,7 +71,8 @@ /* Create new address pool */ extern int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, - const struct in46_prefix *stat, int flags); + const struct in46_prefix *stat, int flags, + struct in46_prefix *blacklist, size_t blacklist_size); /* Delete existing address pool */ extern int ippool_free(struct ippool_t *this); diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index f38c1be..ea56edd 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -13,36 +13,47 @@ #include "../../lib/syserr.h" -static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags) +static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags, char **blacklist, size_t blacklist_size) { + struct in46_prefix *blacklist_pfx; struct ippool_t *pool; struct in46_prefix pfx; size_t t; int rc; + int i; + + blacklist_pfx = calloc(blacklist_size, sizeof(struct in46_prefix)); + for (i = 0; i < blacklist_size; i++) { + rc = ippool_aton(&blacklist_pfx[i].addr, &t, blacklist[i], 0); + OSMO_ASSERT(rc == 0); + pfx.prefixlen = t; + } /* dynamic-only v4 */ - rc = ippool_aton(&pfx.addr, &t, prefix_str, flags); + rc = ippool_aton(&pfx.addr, &t, prefix_str, 0); OSMO_ASSERT(rc == 0); pfx.prefixlen = t; - rc = ippool_new(&pool, &pfx, NULL, flags); + rc = ippool_new(&pool, &pfx, NULL, flags, blacklist_pfx, blacklist_size); OSMO_ASSERT(rc == 0); //ippool_printaddr(pool); + free(blacklist_pfx); + return pool; } -static void test_pool_size(const char *pfx, unsigned int flags, unsigned int expected_size) +static void test_pool_size(const char *pfx, unsigned int flags, char **blacklist, size_t blacklist_size, unsigned int expected_size) { struct ippool_t *pool; struct ippoolm_t *member; struct in46_addr addr; int i, rc, n; - printf("testing pool for prefix %s, flags=0x%x, expected_size=%u\n", pfx, flags, expected_size); - pool = create_pool(pfx, flags); + printf("testing pool for prefix %s, flags=0x%x, blacklist_size=%lu, expected_size=%u\n", pfx, flags, blacklist_size, expected_size); + pool = create_pool(pfx, flags, blacklist, blacklist_size); OSMO_ASSERT(pool->listsize == expected_size); memset(&addr, 0, sizeof(addr)); @@ -91,19 +102,23 @@ static void test_pool_sizes(void) { /* 256 addresses [0..255] */ - test_pool_size("192.168.23.0/24", 0, 256); + test_pool_size("192.168.23.0/24", 0, NULL, 0, 256); /* 255 addresses [1..255] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, 255); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, NULL, 0, 255); /* 254 addresses [1..254] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 254); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 254); /* 65534 addresses [0.1..255.254] */ - test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 65534); + test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 65534); /* 256 prefixes of /64 each */ - test_pool_size("2001:DB8::/56", 0, 256); + test_pool_size("2001:DB8::/56", 0, NULL, 0, 256); + + /* 253 addresses [1..254] & exclude 192.168.23.1/24 */ + char *blacklist[] = {"176.16.222.10/24", "192.168.23.1/24", "192.168.38.2/24"}; + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, blacklist, 3, 253); } int main(int argc, char **argv) diff --git a/tests/lib/ippool_test.err b/tests/lib/ippool_test.err index 7dc5371..b11c12a 100644 --- a/tests/lib/ippool_test.err +++ b/tests/lib/ippool_test.err @@ -8,3 +8,5 @@ No more IP addresses available No more IP addresses available No more IP addresses available +No more IP addresses available +No more IP addresses available diff --git a/tests/lib/ippool_test.ok b/tests/lib/ippool_test.ok index a0eeb4b..263494e 100644 --- a/tests/lib/ippool_test.ok +++ b/tests/lib/ippool_test.ok @@ -1,4 +1,4 @@ -testing pool for prefix 192.168.23.0/24, flags=0x0, expected_size=256 +testing pool for prefix 192.168.23.0/24, flags=0x0, blacklist_size=0, expected_size=256 allocated address 192.168.23.0 allocated address 192.168.23.1 allocated address 192.168.23.2 @@ -255,7 +255,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x1, expected_size=255 +testing pool for prefix 192.168.23.0/24, flags=0x1, blacklist_size=0, expected_size=255 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -511,7 +511,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x3, expected_size=254 +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=0, expected_size=254 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -766,7 +766,7 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.0.0/16, flags=0x3, expected_size=65534 +testing pool for prefix 192.168.0.0/16, flags=0x3, blacklist_size=0, expected_size=65534 allocated address 192.168.0.1 allocated address 192.168.0.2 allocated address 192.168.0.3 @@ -66301,7 +66301,7 @@ allocated address 192.168.255.252 allocated address 192.168.255.253 allocated address 192.168.255.254 -testing pool for prefix 2001:DB8::/56, flags=0x0, expected_size=256 +testing pool for prefix 2001:DB8::/56, flags=0x0, blacklist_size=0, expected_size=256 allocated address 2001:db8:: allocated address 2001:db8:0:1:: allocated address 2001:db8:0:2:: @@ -66558,3 +66558,257 @@ allocated address 2001:db8:0:fd:: allocated address 2001:db8:0:fe:: allocated address 2001:db8:0:ff:: +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=3, expected_size=253 +allocated address 192.168.23.2 +allocated address 192.168.23.3 +allocated address 192.168.23.4 +allocated address 192.168.23.5 +allocated address 192.168.23.6 +allocated address 192.168.23.7 +allocated address 192.168.23.8 +allocated address 192.168.23.9 +allocated address 192.168.23.10 +allocated address 192.168.23.11 +allocated address 192.168.23.12 +allocated address 192.168.23.13 +allocated address 192.168.23.14 +allocated address 192.168.23.15 +allocated address 192.168.23.16 +allocated address 192.168.23.17 +allocated address 192.168.23.18 +allocated address 192.168.23.19 +allocated address 192.168.23.20 +allocated address 192.168.23.21 +allocated address 192.168.23.22 +allocated address 192.168.23.23 +allocated address 192.168.23.24 +allocated address 192.168.23.25 +allocated address 192.168.23.26 +allocated address 192.168.23.27 +allocated address 192.168.23.28 +allocated address 192.168.23.29 +allocated address 192.168.23.30 +allocated address 192.168.23.31 +allocated address 192.168.23.32 +allocated address 192.168.23.33 +allocated address 192.168.23.34 +allocated address 192.168.23.35 +allocated address 192.168.23.36 +allocated address 192.168.23.37 +allocated address 192.168.23.38 +allocated address 192.168.23.39 +allocated address 192.168.23.40 +allocated address 192.168.23.41 +allocated address 192.168.23.42 +allocated address 192.168.23.43 +allocated address 192.168.23.44 +allocated address 192.168.23.45 +allocated address 192.168.23.46 +allocated address 192.168.23.47 +allocated address 192.168.23.48 +allocated address 192.168.23.49 +allocated address 192.168.23.50 +allocated address 192.168.23.51 +allocated address 192.168.23.52 +allocated address 192.168.23.53 +allocated address 192.168.23.54 +allocated address 192.168.23.55 +allocated address 192.168.23.56 +allocated address 192.168.23.57 +allocated address 192.168.23.58 +allocated address 192.168.23.59 +allocated address 192.168.23.60 +allocated address 192.168.23.61 +allocated address 192.168.23.62 +allocated address 192.168.23.63 +allocated address 192.168.23.64 +allocated address 192.168.23.65 +allocated address 192.168.23.66 +allocated address 192.168.23.67 +allocated address 192.168.23.68 +allocated address 192.168.23.69 +allocated address 192.168.23.70 +allocated address 192.168.23.71 +allocated address 192.168.23.72 +allocated address 192.168.23.73 +allocated address 192.168.23.74 +allocated address 192.168.23.75 +allocated address 192.168.23.76 +allocated address 192.168.23.77 +allocated address 192.168.23.78 +allocated address 192.168.23.79 +allocated address 192.168.23.80 +allocated address 192.168.23.81 +allocated address 192.168.23.82 +allocated address 192.168.23.83 +allocated address 192.168.23.84 +allocated address 192.168.23.85 +allocated address 192.168.23.86 +allocated address 192.168.23.87 +allocated address 192.168.23.88 +allocated address 192.168.23.89 +allocated address 192.168.23.90 +allocated address 192.168.23.91 +allocated address 192.168.23.92 +allocated address 192.168.23.93 +allocated address 192.168.23.94 +allocated address 192.168.23.95 +allocated address 192.168.23.96 +allocated address 192.168.23.97 +allocated address 192.168.23.98 +allocated address 192.168.23.99 +allocated address 192.168.23.100 +allocated address 192.168.23.101 +allocated address 192.168.23.102 +allocated address 192.168.23.103 +allocated address 192.168.23.104 +allocated address 192.168.23.105 +allocated address 192.168.23.106 +allocated address 192.168.23.107 +allocated address 192.168.23.108 +allocated address 192.168.23.109 +allocated address 192.168.23.110 +allocated address 192.168.23.111 +allocated address 192.168.23.112 +allocated address 192.168.23.113 +allocated address 192.168.23.114 +allocated address 192.168.23.115 +allocated address 192.168.23.116 +allocated address 192.168.23.117 +allocated address 192.168.23.118 +allocated address 192.168.23.119 +allocated address 192.168.23.120 +allocated address 192.168.23.121 +allocated address 192.168.23.122 +allocated address 192.168.23.123 +allocated address 192.168.23.124 +allocated address 192.168.23.125 +allocated address 192.168.23.126 +allocated address 192.168.23.127 +allocated address 192.168.23.128 +allocated address 192.168.23.129 +allocated address 192.168.23.130 +allocated address 192.168.23.131 +allocated address 192.168.23.132 +allocated address 192.168.23.133 +allocated address 192.168.23.134 +allocated address 192.168.23.135 +allocated address 192.168.23.136 +allocated address 192.168.23.137 +allocated address 192.168.23.138 +allocated address 192.168.23.139 +allocated address 192.168.23.140 +allocated address 192.168.23.141 +allocated address 192.168.23.142 +allocated address 192.168.23.143 +allocated address 192.168.23.144 +allocated address 192.168.23.145 +allocated address 192.168.23.146 +allocated address 192.168.23.147 +allocated address 192.168.23.148 +allocated address 192.168.23.149 +allocated address 192.168.23.150 +allocated address 192.168.23.151 +allocated address 192.168.23.152 +allocated address 192.168.23.153 +allocated address 192.168.23.154 +allocated address 192.168.23.155 +allocated address 192.168.23.156 +allocated address 192.168.23.157 +allocated address 192.168.23.158 +allocated address 192.168.23.159 +allocated address 192.168.23.160 +allocated address 192.168.23.161 +allocated address 192.168.23.162 +allocated address 192.168.23.163 +allocated address 192.168.23.164 +allocated address 192.168.23.165 +allocated address 192.168.23.166 +allocated address 192.168.23.167 +allocated address 192.168.23.168 +allocated address 192.168.23.169 +allocated address 192.168.23.170 +allocated address 192.168.23.171 +allocated address 192.168.23.172 +allocated address 192.168.23.173 +allocated address 192.168.23.174 +allocated address 192.168.23.175 +allocated address 192.168.23.176 +allocated address 192.168.23.177 +allocated address 192.168.23.178 +allocated address 192.168.23.179 +allocated address 192.168.23.180 +allocated address 192.168.23.181 +allocated address 192.168.23.182 +allocated address 192.168.23.183 +allocated address 192.168.23.184 +allocated address 192.168.23.185 +allocated address 192.168.23.186 +allocated address 192.168.23.187 +allocated address 192.168.23.188 +allocated address 192.168.23.189 +allocated address 192.168.23.190 +allocated address 192.168.23.191 +allocated address 192.168.23.192 +allocated address 192.168.23.193 +allocated address 192.168.23.194 +allocated address 192.168.23.195 +allocated address 192.168.23.196 +allocated address 192.168.23.197 +allocated address 192.168.23.198 +allocated address 192.168.23.199 +allocated address 192.168.23.200 +allocated address 192.168.23.201 +allocated address 192.168.23.202 +allocated address 192.168.23.203 +allocated address 192.168.23.204 +allocated address 192.168.23.205 +allocated address 192.168.23.206 +allocated address 192.168.23.207 +allocated address 192.168.23.208 +allocated address 192.168.23.209 +allocated address 192.168.23.210 +allocated address 192.168.23.211 +allocated address 192.168.23.212 +allocated address 192.168.23.213 +allocated address 192.168.23.214 +allocated address 192.168.23.215 +allocated address 192.168.23.216 +allocated address 192.168.23.217 +allocated address 192.168.23.218 +allocated address 192.168.23.219 +allocated address 192.168.23.220 +allocated address 192.168.23.221 +allocated address 192.168.23.222 +allocated address 192.168.23.223 +allocated address 192.168.23.224 +allocated address 192.168.23.225 +allocated address 192.168.23.226 +allocated address 192.168.23.227 +allocated address 192.168.23.228 +allocated address 192.168.23.229 +allocated address 192.168.23.230 +allocated address 192.168.23.231 +allocated address 192.168.23.232 +allocated address 192.168.23.233 +allocated address 192.168.23.234 +allocated address 192.168.23.235 +allocated address 192.168.23.236 +allocated address 192.168.23.237 +allocated address 192.168.23.238 +allocated address 192.168.23.239 +allocated address 192.168.23.240 +allocated address 192.168.23.241 +allocated address 192.168.23.242 +allocated address 192.168.23.243 +allocated address 192.168.23.244 +allocated address 192.168.23.245 +allocated address 192.168.23.246 +allocated address 192.168.23.247 +allocated address 192.168.23.248 +allocated address 192.168.23.249 +allocated address 192.168.23.250 +allocated address 192.168.23.251 +allocated address 192.168.23.252 +allocated address 192.168.23.253 +allocated address 192.168.23.254 -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 6 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:11:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Oct 2017 17:11:24 +0000 Subject: osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Patch Set 5: And all those were messages I wrote mostly for myself when looking at the first review ;) -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 5 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:12:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:12:27 +0000 Subject: osmo-mgw[master]: protocol: allow wildcarded DLCX In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736 Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:15:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:15:01 +0000 Subject: osmo-mgw[master]: sdp: refactoring sdp parser/generator In-Reply-To: References: Message-ID: Patch Set 12: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4006/12/src/libosmo-mgcp/mgcp_sdp.c File src/libosmo-mgcp/mgcp_sdp.c: Line 260: &port, &codecs[0].payload_type, I see tons of whitespace changes in this path that don't really seem neccessary. Lke this re-indenting. Makes it hard to see what was actually changed functionally in the code; also will break any other patches that people may have possibly have made due to whitespace patch hunk breakage. If at all, the whitespace changes should be a separate "cosmetics only" patch. -- To view, visit https://gerrit.osmocom.org/4006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324 Gerrit-PatchSet: 12 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 17 17:16:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Oct 2017 17:16:15 +0000 Subject: osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Patch Set 11: Code-Review+1 looks ok to me. Neels? -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 11 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 20:01:05 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 17 Oct 2017 20:01:05 +0000 Subject: libosmocore[master]: Expand bitvec_write_field() function In-Reply-To: References: Message-ID: Patch Set 1: This code looks good to me. -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 17 20:11:38 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 17 Oct 2017 20:11:38 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: > > I wrote a small test program to encode IA octets in DL IMM ASS > > Sounds like a good candidate for bitvec_write_field() test which we > don't have yet. Could you please share it? Here it is. #include extern "C" { #include #include } void *tall_pcu_ctx; uint8_t tfi = 0; uint32_t ttli = 0xdeadbeef; uint8_t gamma = 0; uint8_t ta_valid = 1; uint8_t ws_enc = 3; uint8_t usf = 1; uint32_t fn = 1234; /* This function is based implementation of bitvec_write_field_lh in old PCU code */ static int bitvec_write_field_lh(struct bitvec *bv, unsigned *write_index, uint64_t val, unsigned len) { unsigned int i; int rc; bv->cur_bit = *write_index; for (i = 0; i < len; i++) { bit_value bit = L; if (val & ((uint64_t)1 << (len - i - 1))) bit = H; rc = bitvec_set_bit(bv, bit); if (rc) return rc; } *write_index += len; return 0; } static void test_bitvec_ia_octet_encode_pkt_dl_ass(bitvec *dest) { unsigned wp = 0; printf("=== start %s ===\n", __func__); // GSM 04.08 10.5.2.16 IA Rest Octets bitvec_write_field(dest, &wp, 3, 2); // "HH" bitvec_write_field(dest, &wp, 1, 2); // "01" Packet Downlink Assignment bitvec_write_field(dest, &wp, ttli, 32); // TLLI bitvec_write_field(dest, &wp, 1, 1); // switch TFI : on bitvec_write_field(dest, &wp, tfi, 5); // TFI bitvec_write_field(dest, &wp, 0x0, 1); // RLC acknowledged mode bitvec_write_field(dest, &wp, 0x0, 1); // ALPHA = not present bitvec_write_field(dest, &wp, gamma, 5); // GAMMA power control parameter bitvec_write_field(dest, &wp, 0,1); // Polling Bit: off bitvec_write_field(dest, &wp, ta_valid, 1); // N. B: NOT related to TAI! bitvec_write_field(dest, &wp, 0, 1); // No TIMING_ADVANCE_INDEX: */ bitvec_write_field(dest, &wp, 0, 1); // TBF Starting TIME present bitvec_write_field(dest, &wp, 0, 1); // P0 not present bitvec_write_field(dest, &wp, 1, 1); // "H" - additional for R99 -> MS failed to decode following bits bitvec_write_field(dest, &wp, ws_enc, 5); // EGPRS Window Size bitvec_write_field(dest, &wp, 0, 2); // LINK_QUALITY_MEASUREMENT_MODE bitvec_write_field(dest, &wp, 0, 1); // BEP_PERIOD2 not present printf("Encoded PKT DL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); printf("=== end %s ===\n", __func__); } static void test_bitvec_lh_ia_octet_encode_pkt_dl_ass(bitvec *dest) { unsigned wp = 0; printf("=== start %s ===\n", __func__); // GSM 04.08 10.5.2.16 IA Rest Octets bitvec_write_field_lh(dest, &wp, 3, 2); // "HH" bitvec_write_field(dest, &wp, 1, 2); // "01" Packet Downlink Assignment bitvec_write_field(dest, &wp, ttli, 32); // TLLI bitvec_write_field(dest, &wp, 1, 1); // switch TFI : on bitvec_write_field(dest, &wp, tfi, 5); // TFI bitvec_write_field(dest, &wp, 0, 1); // RLC acknowledged mode bitvec_write_field(dest, &wp, 0, 1); // ALPHA = not present bitvec_write_field(dest, &wp, gamma, 5); // GAMMA power control parameter bitvec_write_field(dest, &wp, 0,1); // Polling Bit: off bitvec_write_field(dest, &wp, ta_valid, 1); // N. B: NOT related to TAI! bitvec_write_field(dest, &wp, 0, 1); // No TIMING_ADVANCE_INDEX: */ bitvec_write_field(dest, &wp, 0, 1); // TBF Starting TIME present bitvec_write_field(dest, &wp, 0, 1); // P0 not present bitvec_write_field_lh(dest, &wp, 3, 1); // "H" - additional for R99 -> MS is happy to decode following bits bitvec_write_field(dest, &wp, ws_enc, 5); // EGPRS Window Size bitvec_write_field(dest, &wp, 0, 2); // LINK_QUALITY_MEASUREMENT_MODE bitvec_write_field(dest, &wp, 0, 1); // BEP_PERIOD2 not present printf("Encoded PKT DL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); printf("=== end %s ===\n", __func__); } static void test_bitvec_ia_octet_encode_pkt_ul_ass(bitvec *dest, bool tbf) { unsigned wp = 0; printf("=== start %s ===\n", __func__); // GMS 04.08 10.5.2.37b 10.5.2.16 bitvec_write_field(dest, &wp, 3, 2); // "HH" bitvec_write_field(dest, &wp, 0, 2); // "0" Packet Uplink Assignment if (!tbf) { bitvec_write_field(dest, &wp, 0, 1); // Block Allocation : Single Block Allocation bitvec_write_field(dest, &wp, 0, 1); // ALPHA = not present bitvec_write_field(dest, &wp, gamma,5); // GAMMA power control parameter bitvec_write_field(dest, &wp, 0, 1); // No TIMING_ADVANCE_INDEX: */ bitvec_write_field(dest, &wp, 1, 1); // TBF_STARTING_TIME_FLAG bitvec_write_field(dest, &wp, (fn / (26 * 51)) % 32, 5); // T1' bitvec_write_field(dest, &wp, fn % 51, 6); // T3 bitvec_write_field(dest, &wp, fn % 26, 5); // T2 } else { bitvec_write_field(dest, &wp, 1, 1); // Block Allocation : Not Single Block Allocation bitvec_write_field(dest, &wp, tfi, 5); // TFI_ASSIGNMENT Temporary Flow Identity bitvec_write_field(dest, &wp, 0, 1); // POLLING = none bitvec_write_field(dest, &wp, 0, 1); // ALLOCATION_TYPE: dynamic bitvec_write_field(dest, &wp, usf, 3); // USF bitvec_write_field(dest, &wp, 0, 1); // USF_GRANULARITY bitvec_write_field(dest, &wp, 0, 1); // "0" power control: Not Present bitvec_write_field(dest, &wp, 0, 2); // CHANNEL_CODING_COMMAND bitvec_write_field(dest, &wp, 1, 1); // TLLI_BLOCK_CHANNEL_CODING bitvec_write_field(dest, &wp, 0, 1); // ALPHA = not present bitvec_write_field(dest, &wp, gamma,5); // GAMMA power control parameter /* note: there is no choise for TAI and no starting time */ bitvec_write_field(dest, &wp, 0, 1); // switch TIMING_ADVANCE_INDEX = off bitvec_write_field(dest, &wp, 0, 1); // TBF_STARTING_TIME_FLAG } printf("Encoded PKT UL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); printf("=== end %s ===\n", __func__); } static void test_bitvec_lh_ia_octet_encode_pkt_ul_ass(bitvec *dest, bool tbf) { unsigned wp = 0; printf("=== start %s ===\n", __func__); // GMS 04.08 10.5.2.37b 10.5.2.16 bitvec_write_field_lh(dest, &wp, 3, 2); // "HH" bitvec_write_field(dest, &wp, 0, 2); // "0" Packet Uplink Assignment if (!tbf) { bitvec_write_field(dest, &wp, 0, 1); // Block Allocation : Single Block Allocation bitvec_write_field(dest, &wp, 0, 1); // ALPHA = not present bitvec_write_field(dest, &wp, gamma,5); // GAMMA power control parameter bitvec_write_field(dest, &wp, 0, 1); // No TIMING_ADVANCE_INDEX: */ bitvec_write_field(dest, &wp, 1, 1); // TBF_STARTING_TIME_FLAG bitvec_write_field(dest, &wp, (fn / (26 * 51)) % 32, 5); // T1' bitvec_write_field(dest, &wp, fn % 51, 6); // T3 bitvec_write_field(dest, &wp, fn % 26, 5); // T2 } else { bitvec_write_field(dest, &wp, 1, 1); // Block Allocation : Not Single Block Allocation bitvec_write_field(dest, &wp, tfi, 5); // TFI_ASSIGNMENT Temporary Flow Identity bitvec_write_field(dest, &wp, 0, 1); // POLLING = none bitvec_write_field(dest, &wp, 0, 1); // ALLOCATION_TYPE: dynamic bitvec_write_field(dest, &wp, usf, 3); // USF bitvec_write_field(dest, &wp, 0, 1); // USF_GRANULARITY bitvec_write_field(dest, &wp, 0, 1); // "0" power control: Not Present bitvec_write_field(dest, &wp, 0, 2); // CHANNEL_CODING_COMMAND CS 1 bitvec_write_field(dest, &wp, 1, 1); // TLLI_BLOCK_CHANNEL_CODING bitvec_write_field(dest, &wp, 0, 1); // ALPHA = not present bitvec_write_field(dest, &wp, gamma,5); // GAMMA power control parameter /* note: there is no choise for TAI and no starting time */ bitvec_write_field(dest, &wp, 0, 1); // switch TIMING_ADVANCE_INDEX = off bitvec_write_field(dest, &wp, 0, 1); // TBF_STARTING_TIME_FLAG } printf("Encoded PKT UL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); printf("=== end %s ===\n", __func__); } static void test_bitcomp(bitvec *src1, bitvec *src2, int len) { int i, j; unsigned int bit_err = 0; uint8_t byte_err = 0; printf("=== start %s ===\n", __func__); for (i = 0; i < len; i++) { /* byte compare */ byte_err = src1->data[i] ^ src2->data[i]; if (byte_err) for (j = 0; j < 8; j++) /* count error bits */ bit_err += (byte_err >> j) & 0x01; } printf("=== total error bits %u ===\n", bit_err); printf("=== end %s ===\n", __func__); } int main(int argc, char **argv) { bitvec *dest; bitvec *dest_lh; tall_pcu_ctx = talloc_named_const(NULL, 1, "bitvecTest context"); if (!tall_pcu_ctx) abort(); dest = bitvec_alloc(22, tall_pcu_ctx); dest_lh = bitvec_alloc(22, tall_pcu_ctx); /* initialize buffer */ bitvec_unhex(dest, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); bitvec_unhex(dest_lh, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); test_bitvec_ia_octet_encode_pkt_dl_ass(dest); printf("\n\n"); test_bitvec_lh_ia_octet_encode_pkt_dl_ass(dest_lh); printf("\n\n"); test_bitcomp(dest, dest_lh, 22); printf("\n\n"); /* initialize buffer */ bitvec_unhex(dest, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); bitvec_unhex(dest_lh, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); test_bitvec_ia_octet_encode_pkt_ul_ass(dest, false); printf("\n\n"); test_bitvec_lh_ia_octet_encode_pkt_ul_ass(dest_lh, false); printf("\n\n"); test_bitcomp(dest, dest_lh, 22); printf("\n\n"); /* initialize buffer */ bitvec_unhex(dest, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); bitvec_unhex(dest_lh, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); test_bitvec_ia_octet_encode_pkt_ul_ass(dest, true); printf("\n\n"); test_bitvec_lh_ia_octet_encode_pkt_ul_ass(dest_lh, true); printf("\n\n"); test_bitcomp(dest, dest_lh, 22); bitvec_free(dest); bitvec_free(dest_lh); talloc_free(tall_pcu_ctx); return EXIT_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 01:57:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Oct 2017 01:57:48 +0000 Subject: [PATCH] python/osmo-python-tests[master]: osmo_verify_transcript: add error handling for missing port Message-ID: Review at https://gerrit.osmocom.org/4321 osmo_verify_transcript: add error handling for missing port Change-Id: I1627c36cfb627e7f3a9b4d9f087bf10875ae0690 --- M osmopy/osmo_verify_transcript_common.py 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/21/4321/1 diff --git a/osmopy/osmo_verify_transcript_common.py b/osmopy/osmo_verify_transcript_common.py index e4b5553..d8e9860 100644 --- a/osmopy/osmo_verify_transcript_common.py +++ b/osmopy/osmo_verify_transcript_common.py @@ -70,6 +70,9 @@ self.verbose = verbose self.update = update + if not port: + raise Exception("You need to provide port number to connect to") + def connect(self): assert self.socket is None retries = 30 -- To view, visit https://gerrit.osmocom.org/4321 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1627c36cfb627e7f3a9b4d9f087bf10875ae0690 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 18 01:57:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Oct 2017 01:57:48 +0000 Subject: [PATCH] python/osmo-python-tests[master]: osmo_verify_transcript_vty: automatically obtain the prompt ... Message-ID: Review at https://gerrit.osmocom.org/4322 osmo_verify_transcript_vty: automatically obtain the prompt string If -n is omitted, retrieve the proper prompt name from the initial VTY opening prompt. Change-Id: Id5d953156023fcbfc8867c1c3634d787d0b3ac57 --- M osmopy/osmo_verify_transcript_vty.py 1 file changed, 16 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/22/4322/1 diff --git a/osmopy/osmo_verify_transcript_vty.py b/osmopy/osmo_verify_transcript_vty.py index 3a4d630..636d600 100755 --- a/osmopy/osmo_verify_transcript_vty.py +++ b/osmopy/osmo_verify_transcript_vty.py @@ -99,7 +99,6 @@ def __init__(self, prompt, port, host, verbose, update): self.prompt = prompt - self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) super().__init__(InteractVty.VtyStep, port, host, verbose, update) def connect(self): @@ -110,7 +109,19 @@ super().connect() # receive the first welcome message and discard - self.socket.recv(4096) + data = self.socket.recv(4096) + if not self.prompt: + b = data + b = b[b.rfind(b'\n') + 1:] + while b and (b[0] < ord('A') or b[0] > ord('z')): + b = b[1:] + prompt_str = b.decode('utf-8') + if '>' in prompt_str: + self.prompt = prompt_str[:prompt_str.find('>')] + if not self.prompt: + raise Exception('Could not find application name; needed to decode prompts.' + ' Initial data was: %r' % data) + self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) def _command(self, command_str, timeout=10): self.socket.send(command_str.encode()) @@ -165,7 +176,9 @@ if __name__ == '__main__': parser = common_parser() parser.add_argument('-n', '--prompt-name', dest='prompt', - help="Name used in application's telnet VTY prompt.") + help="Name used in application's telnet VTY prompt." + " If omitted, will attempt to determine the name from" + " the initial VTY prompt.") args = parser.parse_args() interact = InteractVty(args.prompt, args.port, args.host, args.verbose, args.update) -- To view, visit https://gerrit.osmocom.org/4322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5d953156023fcbfc8867c1c3634d787d0b3ac57 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 18 01:57:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Oct 2017 01:57:48 +0000 Subject: [PATCH] python/osmo-python-tests[master]: osmo_verify_transcript: allow running/piping commands directly Message-ID: Review at https://gerrit.osmocom.org/4323 osmo_verify_transcript: allow running/piping commands directly To retrieve the VTY reference XML from 'show online-help', which we need for the osmo-gsm-manuals, it is useful to directly print the output of a single VTY command. I have also always wanted to be able to just type CTRL commands and get their results. Add --command and --output arguments to run specific commands and pipe to stdout instead of verifying a transcript file, in a way that works generically for both VTY and CTRL interface. The scripts' names are now a bit of a misnomer, to be tweaked separately. Change-Id: I2c31a87fa255092bcd06da239651cc50174c8faa --- M osmopy/osmo_verify_transcript_common.py M osmopy/osmo_verify_transcript_ctrl.py M osmopy/osmo_verify_transcript_vty.py 3 files changed, 107 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/23/4323/1 diff --git a/osmopy/osmo_verify_transcript_common.py b/osmopy/osmo_verify_transcript_common.py index d8e9860..71961e6 100644 --- a/osmopy/osmo_verify_transcript_common.py +++ b/osmopy/osmo_verify_transcript_common.py @@ -242,6 +242,13 @@ return 'Did not expect line %r' % got[g] return True + def feed_commands(self, output, command_strs): + for command_str in command_strs: + for command in command_str.splitlines(): + res = self.command(command) + output.write('\n'.join(res)) + output.write('\n') + def end_process(proc): if not proc: return @@ -285,30 +292,32 @@ Application._devnull = open(os.devnull, 'w') return Application._devnull - def __init__(self, command_tuple, purge_output=True): - self.command_tuple = command_tuple + def __init__(self, run_app_str, purge_output=True, quiet=False): + self.command_tuple = shlex.split(run_app_str) self.purge_output = purge_output + self.quiet = quiet def run(self): out_err = None if self.purge_output: out_err = Application.devnull() - print('Launching: cd %r; %s' % (os.getcwd(), ' '.join(self.command_tuple))) + if not self.quiet: + print('Launching: cd %r; %s' % (os.getcwd(), ' '.join(self.command_tuple))) self.proc = subprocess.Popen(self.command_tuple, stdout=out_err, stderr=out_err) def stop(self): end_process(self.proc) -def verify_application(command_tuple, interact, transcript_file, verbose): +def verify_application(run_app_str, interact, transcript_file, verbose): passed = None application = None sys.stdout.flush() sys.stderr.flush() - if command_tuple: - application = Application(command_tuple, purge_output=not verbose) + if run_app_str: + application = Application(run_app_str, purge_output=not verbose) application.run() try: @@ -330,7 +339,7 @@ def common_parser(): parser = argparse.ArgumentParser() - parser.add_argument('-r', '--run', dest='command_str', + parser.add_argument('-r', '--run', dest='run_app_str', help='command to run to launch application to test,' ' including command line arguments. If omitted, no' ' application is launched.') @@ -344,19 +353,76 @@ ' FILES.') parser.add_argument('-v', '--verbose', action='store_true', help='Print commands and application output') + parser.add_argument('-O', '--output', dest='output_path', + help="Do not verify a transcript file, but directly" + " write command results to a file, '-' means stdout." + " If input files are provided, these must not be transcript" + " files, but bare commands, one per line, without" + " prompts nor expected results." + " If neither --command nor input files are" + " provided, read commands from stdin." + " Ignore '--update'.") + parser.add_argument('-c', '--command', dest='cmd_str', + help="Run this command instead of reading from a" + " transcript file, multiple commands may be separated" + " by ';'. Implies '-O -' unless -O is passed.") parser.add_argument('transcript_files', nargs='*', help='transcript files to verify') return parser -def main(command_str, transcript_files, interact, verbose): - - if command_str: - command_tuple = shlex.split(command_str) +def run_commands(run_app_str, output_path, cmd_str, cmd_files, interact): + to_stdout = False + if output_path == '-': + to_stdout = True + output = sys.stdout else: - command_tuple = None + output = open(output_path, 'w') + application = None + + if run_app_str: + application = Application(run_app_str, quiet=to_stdout) + application.run() + + try: + interact.connect() + + if cmd_str: + interact.feed_commands(output, cmd_str.split(';')) + + for f_path in (cmd_files or []): + with open(f_path, 'r') as f: + interact.feed_commands(output, f.read().decode('utf-8').splitlines()) + + if not (cmd_str or cmd_files): + while True: + line = sys.stdin.readline() + if not line: + break; + interact.feed_commands(output, line.split(';')) + except: + traceback.print_exc() + finally: + if not to_stdout: + try: + output.close() + except: + traceback.print_exc() + + try: + interact.close() + except: + traceback.print_exc() + + if application: + try: + application.stop() + except: + traceback.print_exc() + +def verify_transcripts(run_app_str, transcript_files, interact, verbose): results = [] for t in transcript_files: - passed = verify_application(command_tuple=command_tuple, + passed = verify_application(run_app_str=run_app_str, interact=interact, transcript_file=t, verbose=verbose) @@ -372,4 +438,18 @@ if not all_passed: sys.exit(1) +def main(run_app_str, output_path, cmd_str, transcript_files, interact, verbose): + + # If there is a command to run, pipe to stdout by default. + # If there are no input files nor commands to run, read from stdin + # and write results to stdout. + if not output_path: + if cmd_str or (not cmd_str and not transcript_files): + output_path = '-' + + if output_path: + run_commands(run_app_str, output_path, cmd_str, transcript_files, interact) + else: + verify_transcripts(run_app_str, transcript_files, interact, verbose) + # vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_ctrl.py b/osmopy/osmo_verify_transcript_ctrl.py index 7afe4bf..3cf6880 100755 --- a/osmopy/osmo_verify_transcript_ctrl.py +++ b/osmopy/osmo_verify_transcript_ctrl.py @@ -112,9 +112,7 @@ interact = InteractCtrl(args.port, args.host, args.verbose, args.update, args.keep_ids) - main(command_str=args.command_str, - transcript_files=args.transcript_files, - interact=interact, - verbose=args.verbose) + main(args.run_app_str, args.output_path, args.cmd_str, + args.transcript_files, interact, args.verbose) # vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_vty.py b/osmopy/osmo_verify_transcript_vty.py index 636d600..28c83d0 100755 --- a/osmopy/osmo_verify_transcript_vty.py +++ b/osmopy/osmo_verify_transcript_vty.py @@ -179,13 +179,21 @@ help="Name used in application's telnet VTY prompt." " If omitted, will attempt to determine the name from" " the initial VTY prompt.") + parser.add_argument('-X', '--gen-xml-ref', dest='gen_xml', action='store_true', + help="Equivalent to '-c \"show online-help\" -O -'," + " can be used to generate the VTY reference file as" + " required by osmo-gsm-manuals.git.") args = parser.parse_args() + + if args.gen_xml: + if args.cmd_str: + raise Exception('It does not make sense to pass both --command and' + ' --gen-xml-ref.') + args.cmd_str = 'show online-help' interact = InteractVty(args.prompt, args.port, args.host, args.verbose, args.update) - main(command_str=args.command_str, - transcript_files=args.transcript_files, - interact=interact, - verbose=args.verbose) + main(args.run_app_str, args.output_path, args.cmd_str, + args.transcript_files, interact, args.verbose) # vim: tabstop=4 shiftwidth=4 expandtab nocin ai -- To view, visit https://gerrit.osmocom.org/4323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2c31a87fa255092bcd06da239651cc50174c8faa Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 18 01:57:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Oct 2017 01:57:49 +0000 Subject: [PATCH] python/osmo-python-tests[master]: osmo_verify_*: clarify naming to osmo_interact_* Message-ID: Review at https://gerrit.osmocom.org/4324 osmo_verify_*: clarify naming to osmo_interact_* Have common implementations in one place, and expose distinct command line argument signatures to obtain the separate tasks as separate scripts. osmo_interact_common.py implements the parts common to all VTY and CTRL interactions. osmo_interact_vty.py and osmo_interact_ctrl.py implement commands I/O but only expose command line args to directly pipe commands and responses. osmo_verify_transcript_vty.py and osmo_verify_transcript_ctrl.py act as before, now implemented by importing osmo_interact_{vty,ctrl}.py, only exposing the verifification command line arguments. Change-Id: Ie0cbd5db85ebebc893df638a07f5568632563dc9 --- M osmopy/__init__.py R osmopy/osmo_interact_common.py A osmopy/osmo_interact_ctrl.py A osmopy/osmo_interact_vty.py M osmopy/osmo_verify_transcript_ctrl.py M osmopy/osmo_verify_transcript_vty.py M setup.py 7 files changed, 320 insertions(+), 238 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/24/4324/1 diff --git a/osmopy/__init__.py b/osmopy/__init__.py index 01ff3de..1b97e33 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -4,6 +4,8 @@ __all__ = ['obscvty', 'osmodumpdoc', 'osmotestconfig', 'osmotestvty', 'osmoutil', 'osmo_ipa', - 'osmo_verify_transcript_common', + 'osmo_interact_common', + 'osmo_interact_vty', + 'osmo_interact_ctrl', 'osmo_verify_transcript_vty', 'osmo_verify_transcript_ctrl'] diff --git a/osmopy/osmo_verify_transcript_common.py b/osmopy/osmo_interact_common.py similarity index 87% rename from osmopy/osmo_verify_transcript_common.py rename to osmopy/osmo_interact_common.py index 71961e6..6107b64 100644 --- a/osmopy/osmo_verify_transcript_common.py +++ b/osmopy/osmo_interact_common.py @@ -19,7 +19,9 @@ # along with this program. If not, see . ''' -Common code for verify_transcript_vty.py and verify_transcript_ctrl.py. +Common code for osmo_interact_vty.py and osmo_interact_ctrl.py. +This implements all of application interaction, piping and verification. +osmo_interact_{vty,ctrl}.py plug VTY and CTRL interface specific bits. ''' import argparse @@ -249,13 +251,14 @@ output.write('\n'.join(res)) output.write('\n') -def end_process(proc): +def end_process(proc, quiet=False): if not proc: return rc = proc.poll() if rc is not None: - print('Process has already terminated with', rc) + if not quiet: + print('Process has already terminated with', rc) proc.wait() return @@ -277,9 +280,11 @@ if proc.poll() is None: # termination seems to be slower than that, let's just kill proc.kill() - print("Killed child process") + if not quiet: + print("Killed child process") elif waited_time > .002: - print("Terminating took %.3fs" % waited_time) + if not quiet: + print("Terminating took %.3fs" % waited_time) proc.wait() class Application: @@ -307,7 +312,7 @@ self.proc = subprocess.Popen(self.command_tuple, stdout=out_err, stderr=out_err) def stop(self): - end_process(self.proc) + end_process(self.proc, self.quiet) def verify_application(run_app_str, interact, transcript_file, verbose): passed = None @@ -347,31 +352,31 @@ help="Port that the application opens.") parser.add_argument('-H', '--host', dest='host', default='localhost', help="Host that the application opens the port on.") + return parser + +def parser_add_verify_args(parser): parser.add_argument('-u', '--update', dest='update', action='store_true', help='Do not verify, but OVERWRITE transcripts based on' ' the applications current behavior. OVERWRITES TRANSCRIPT' ' FILES.') parser.add_argument('-v', '--verbose', action='store_true', help='Print commands and application output') - parser.add_argument('-O', '--output', dest='output_path', - help="Do not verify a transcript file, but directly" - " write command results to a file, '-' means stdout." - " If input files are provided, these must not be transcript" - " files, but bare commands, one per line, without" - " prompts nor expected results." - " If neither --command nor input files are" - " provided, read commands from stdin." - " Ignore '--update'.") - parser.add_argument('-c', '--command', dest='cmd_str', - help="Run this command instead of reading from a" - " transcript file, multiple commands may be separated" - " by ';'. Implies '-O -' unless -O is passed.") - parser.add_argument('transcript_files', nargs='*', help='transcript files to verify') + parser.add_argument('transcript_files', nargs='*', help='transcript file(s) to verify') return parser -def run_commands(run_app_str, output_path, cmd_str, cmd_files, interact): +def parser_add_run_args(parser): + parser.add_argument('-O', '--output', dest='output_path', + help="Write command results to a file instead of stdout." + "('-O -' writes to stdout and is the default)") + parser.add_argument('-c', '--command', dest='cmd_str', + help="Run this command (before reading input files, if any)." + " multiple commands may be separated by ';'") + parser.add_argument('cmd_files', nargs='*', help='file(s) with plain commands to run') + return parser + +def main_run_commands(run_app_str, output_path, cmd_str, cmd_files, interact): to_stdout = False - if output_path == '-': + if not output_path or output_path == '-': to_stdout = True output = sys.stdout else: @@ -419,7 +424,7 @@ except: traceback.print_exc() -def verify_transcripts(run_app_str, transcript_files, interact, verbose): +def main_verify_transcripts(run_app_str, transcript_files, interact, verbose): results = [] for t in transcript_files: passed = verify_application(run_app_str=run_app_str, @@ -437,19 +442,5 @@ if not all_passed: sys.exit(1) - -def main(run_app_str, output_path, cmd_str, transcript_files, interact, verbose): - - # If there is a command to run, pipe to stdout by default. - # If there are no input files nor commands to run, read from stdin - # and write results to stdout. - if not output_path: - if cmd_str or (not cmd_str and not transcript_files): - output_path = '-' - - if output_path: - run_commands(run_app_str, output_path, cmd_str, transcript_files, interact) - else: - verify_transcripts(run_app_str, transcript_files, interact, verbose) # vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_interact_ctrl.py b/osmopy/osmo_interact_ctrl.py new file mode 100755 index 0000000..9b1a20b --- /dev/null +++ b/osmopy/osmo_interact_ctrl.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run CTRL commands or test transcripts against a given application. Commandline +invocation exposes only direct command piping, the transcript verification code +is exposed as commandline args by osmo_verify_transcript_ctrl.py. +''' + +import re + +from osmopy.osmo_interact_common import * +from osmopy.osmo_ipa import Ctrl, IPA + +class InteractCtrl(Interact): + next_id = 1 + keep_ids = True + re_command = re.compile('^(SET|GET) ([^ ]*) (.*)$') + + class CtrlStep(Interact.StepBase): + + @staticmethod + def is_next_step(line, interact_instance): + m = InteractCtrl.re_command.match(line) + if not m: + return None + next_step = InteractCtrl.CtrlStep() + + set_get = m.group(1) + cmd_id = m.group(2) + var_val = m.group(3) + if not interact_instance.keep_ids: + cmd_id = interact_instance.next_id + interact_instance.next_id += 1 + next_step.command = '%s %s %s' % (set_get, cmd_id, var_val) + + return next_step + + def __init__(self, port, host, verbose=False, update=False, keep_ids=True): + if not update: + keep_ids = True + self.keep_ids = keep_ids + super().__init__(InteractCtrl.CtrlStep, port=port, host=host, verbose=verbose, update=update) + + def connect(self): + self.next_id = 1 + super().connect() + + def send(self, data): + data = Ctrl().add_header(data) + return self.socket.send(data) == len(data) + + def receive(self): + responses = [] + data = self.socket.recv(4096) + while (len(data)>0): + (response_with_header, data) = IPA().split_combined(data) + response = Ctrl().rem_header(response_with_header) + responses.append(response.decode('utf-8')) + return responses + + def command(self, command): + assert self.send(command) + res = self.receive() + split_responses = [] + for r in res: + split_responses.extend(r.splitlines()) + sys.stdout.flush() + sys.stderr.flush() + return split_responses + +if __name__ == '__main__': + parser = common_parser() + parser_add_run_args(parser) + args = parser.parse_args() + + interact = InteractCtrl(args.port, args.host, verbose=False, update=False, + keep_ids=True) + + main_run_commands(args.run_app_str, args.output_path, args.cmd_str, + args.cmd_files, interact) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_interact_vty.py b/osmopy/osmo_interact_vty.py new file mode 100755 index 0000000..c484932 --- /dev/null +++ b/osmopy/osmo_interact_vty.py @@ -0,0 +1,179 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run VTY commands or test transcripts against a given application. Commandline +invocation exposes only direct command piping, the transcript verification code +is exposed as commandline args by osmo_verify_transcript_vty.py. +''' + +import re + +from osmopy.osmo_interact_common import * + +class InteractVty(Interact): + + class VtyStep(Interact.StepBase): + expect_node = None # e.g. '(config-net)' + expect_prompt_char = None # '>' or '#' + + def __init__(self, prompt): + super().__init__() + self.prompt = prompt + + def verify_interact_state(self, interact_instance): + if interact_instance.update: + return + if interact_instance.this_node != self.expect_node: + raise Exception('Mismatch: expected VTY node %r in the prompt, got %r' + % (self.expect_node, interact_instance.this_node)) + if interact_instance.this_prompt_char != self.expect_prompt_char: + raise Exception('Mismatch: expected VTY prompt character %r, got %r' + % (self.expect_prompt_char, interact_instance.this_prompt_char)) + + @staticmethod + def is_next_step(line, interact_instance): + m = interact_instance.re_prompt.match(line) + if not m: + return None + next_step = InteractVty.VtyStep(interact_instance.prompt) + next_step.expect_node = m.group(1) + next_step.expect_prompt_char = m.group(2) + next_step.command = m.group(3) + return next_step + + def command_str(self, interact_instance=None): + if interact_instance is None: + node = self.expect_node + prompt_char = self.expect_prompt_char + else: + node = interact_instance.last_node + prompt_char = interact_instance.last_prompt_char + if node: + node = '(%s)' % node + node = node or '' + return '%s%s%s %s' % (self.prompt, node, prompt_char, self.command) + + def __init__(self, prompt, port, host, verbose, update): + self.prompt = prompt + super().__init__(InteractVty.VtyStep, port, host, verbose, update) + + def connect(self): + self.this_node = None + self.this_prompt_char = '>' # slight cheat for initial prompt char + self.last_node = None + self.last_prompt_char = None + + super().connect() + # receive the first welcome message and discard + data = self.socket.recv(4096) + if not self.prompt: + b = data + b = b[b.rfind(b'\n') + 1:] + while b and (b[0] < ord('A') or b[0] > ord('z')): + b = b[1:] + prompt_str = b.decode('utf-8') + if '>' in prompt_str: + self.prompt = prompt_str[:prompt_str.find('>')] + if not self.prompt: + raise Exception('Could not find application name; needed to decode prompts.' + ' Initial data was: %r' % data) + self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) + + def _command(self, command_str, timeout=10): + self.socket.send(command_str.encode()) + + waited_since = time.time() + received_lines = [] + last_line = '' + + while True: + new_data = self.socket.recv(4096).decode('utf-8') + + last_line = "%s%s" % (last_line, new_data) + + if last_line: + lines = last_line.splitlines() + received_lines.extend(lines[:-1]) + last_line = lines[-1] + + match = self.re_prompt.match(last_line) + if not match: + if time.time() - waited_since > timeout: + raise IOError("Failed to read data (did the app crash?)") + time.sleep(.1) + continue + + self.last_node = self.this_node + self.last_prompt_char = self.this_prompt_char + self.this_node = match.group(1) or None + self.this_prompt_char = match.group(2) + break + + # expecting to have received the command we sent as echo, remove it + clean_command_str = command_str.strip() + if clean_command_str.endswith('?'): + clean_command_str = clean_command_str[:-1] + if received_lines and received_lines[0] == clean_command_str: + received_lines = received_lines[1:] + return received_lines + + def command(self, command_str, timeout=10): + command_str = command_str or '\r' + if command_str[-1] not in '?\r\t': + command_str = command_str + '\r' + + received_lines = self._command(command_str, timeout) + + if command_str[-1] == '?': + self._command('\x03', timeout) + + return received_lines + +def parser_add_vty_args(parser): + parser.add_argument('-n', '--prompt-name', dest='prompt', + help="Name used in application's telnet VTY prompt." + " If omitted, will attempt to determine the name from" + " the initial VTY prompt.") + return parser + +if __name__ == '__main__': + parser = common_parser() + parser_add_vty_args(parser) + parser_add_run_args(parser) + parser.add_argument('-X', '--gen-xml-ref', dest='gen_xml', action='store_true', + help="Equivalent to '-c \"show online-help\" -O -'," + " can be used to generate the VTY reference file as" + " required by osmo-gsm-manuals.git.") + args = parser.parse_args() + + if args.gen_xml: + if args.cmd_str: + raise Exception('It does not make sense to pass both --command and' + ' --gen-xml-ref.') + args.cmd_str = 'show online-help' + + interact = InteractVty(args.prompt, args.port, args.host, + verbose=False, update=False) + + main_run_commands(args.run_app_str, args.output_path, args.cmd_str, + args.cmd_files, interact) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_ctrl.py b/osmopy/osmo_verify_transcript_ctrl.py index 3cf6880..3afbc62 100755 --- a/osmopy/osmo_verify_transcript_ctrl.py +++ b/osmopy/osmo_verify_transcript_ctrl.py @@ -40,70 +40,11 @@ or it can be imported as a module to run more complex setups. ''' -import re - -from osmopy.osmo_verify_transcript_common import * -from osmopy.osmo_ipa import Ctrl, IPA - -class InteractCtrl(Interact): - next_id = 1 - keep_ids = True - re_command = re.compile('^(SET|GET) ([^ ]*) (.*)$') - - class CtrlStep(Interact.StepBase): - - @staticmethod - def is_next_step(line, interact_instance): - m = InteractCtrl.re_command.match(line) - if not m: - return None - next_step = InteractCtrl.CtrlStep() - - set_get = m.group(1) - cmd_id = m.group(2) - var_val = m.group(3) - if not interact_instance.keep_ids: - cmd_id = interact_instance.next_id - interact_instance.next_id += 1 - next_step.command = '%s %s %s' % (set_get, cmd_id, var_val) - - return next_step - - def __init__(self, port, host, verbose=False, update=False, keep_ids=True): - if not update: - keep_ids = True - self.keep_ids = keep_ids - super().__init__(InteractCtrl.CtrlStep, port=port, host=host, verbose=verbose, update=update) - - def connect(self): - self.next_id = 1 - super().connect() - - def send(self, data): - data = Ctrl().add_header(data) - return self.socket.send(data) == len(data) - - def receive(self): - responses = [] - data = self.socket.recv(4096) - while (len(data)>0): - (response_with_header, data) = IPA().split_combined(data) - response = Ctrl().rem_header(response_with_header) - responses.append(response.decode('utf-8')) - return responses - - def command(self, command): - assert self.send(command) - res = self.receive() - split_responses = [] - for r in res: - split_responses.extend(r.splitlines()) - sys.stdout.flush() - sys.stderr.flush() - return split_responses +from osmopy.osmo_interact_ctrl import * if __name__ == '__main__': parser = common_parser() + parser_add_verify_args(parser) parser.add_argument('-i', '--keep-ids', dest='keep_ids', action='store_true', help='With --update, default is to overwrite the command IDs' ' so that they are consecutive numbers starting from 1.' @@ -112,7 +53,6 @@ interact = InteractCtrl(args.port, args.host, args.verbose, args.update, args.keep_ids) - main(args.run_app_str, args.output_path, args.cmd_str, - args.transcript_files, interact, args.verbose) + main_verify_transcripts(args.run_app_str, args.transcript_files, interact, args.verbose) # vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_vty.py b/osmopy/osmo_verify_transcript_vty.py index 28c83d0..e70c36c 100755 --- a/osmopy/osmo_verify_transcript_vty.py +++ b/osmopy/osmo_verify_transcript_vty.py @@ -52,148 +52,16 @@ import re -from osmopy.osmo_verify_transcript_common import * - -class InteractVty(Interact): - - class VtyStep(Interact.StepBase): - expect_node = None # e.g. '(config-net)' - expect_prompt_char = None # '>' or '#' - - def __init__(self, prompt): - super().__init__() - self.prompt = prompt - - def verify_interact_state(self, interact_instance): - if interact_instance.update: - return - if interact_instance.this_node != self.expect_node: - raise Exception('Mismatch: expected VTY node %r in the prompt, got %r' - % (self.expect_node, interact_instance.this_node)) - if interact_instance.this_prompt_char != self.expect_prompt_char: - raise Exception('Mismatch: expected VTY prompt character %r, got %r' - % (self.expect_prompt_char, interact_instance.this_prompt_char)) - - @staticmethod - def is_next_step(line, interact_instance): - m = interact_instance.re_prompt.match(line) - if not m: - return None - next_step = InteractVty.VtyStep(interact_instance.prompt) - next_step.expect_node = m.group(1) - next_step.expect_prompt_char = m.group(2) - next_step.command = m.group(3) - return next_step - - def command_str(self, interact_instance=None): - if interact_instance is None: - node = self.expect_node - prompt_char = self.expect_prompt_char - else: - node = interact_instance.last_node - prompt_char = interact_instance.last_prompt_char - if node: - node = '(%s)' % node - node = node or '' - return '%s%s%s %s' % (self.prompt, node, prompt_char, self.command) - - def __init__(self, prompt, port, host, verbose, update): - self.prompt = prompt - super().__init__(InteractVty.VtyStep, port, host, verbose, update) - - def connect(self): - self.this_node = None - self.this_prompt_char = '>' # slight cheat for initial prompt char - self.last_node = None - self.last_prompt_char = None - - super().connect() - # receive the first welcome message and discard - data = self.socket.recv(4096) - if not self.prompt: - b = data - b = b[b.rfind(b'\n') + 1:] - while b and (b[0] < ord('A') or b[0] > ord('z')): - b = b[1:] - prompt_str = b.decode('utf-8') - if '>' in prompt_str: - self.prompt = prompt_str[:prompt_str.find('>')] - if not self.prompt: - raise Exception('Could not find application name; needed to decode prompts.' - ' Initial data was: %r' % data) - self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) - - def _command(self, command_str, timeout=10): - self.socket.send(command_str.encode()) - - waited_since = time.time() - received_lines = [] - last_line = '' - - while True: - new_data = self.socket.recv(4096).decode('utf-8') - - last_line = "%s%s" % (last_line, new_data) - - if last_line: - lines = last_line.splitlines() - received_lines.extend(lines[:-1]) - last_line = lines[-1] - - match = self.re_prompt.match(last_line) - if not match: - if time.time() - waited_since > timeout: - raise IOError("Failed to read data (did the app crash?)") - time.sleep(.1) - continue - - self.last_node = self.this_node - self.last_prompt_char = self.this_prompt_char - self.this_node = match.group(1) or None - self.this_prompt_char = match.group(2) - break - - # expecting to have received the command we sent as echo, remove it - clean_command_str = command_str.strip() - if clean_command_str.endswith('?'): - clean_command_str = clean_command_str[:-1] - if received_lines and received_lines[0] == clean_command_str: - received_lines = received_lines[1:] - return received_lines - - def command(self, command_str, timeout=10): - command_str = command_str or '\r' - if command_str[-1] not in '?\r\t': - command_str = command_str + '\r' - - received_lines = self._command(command_str, timeout) - - if command_str[-1] == '?': - self._command('\x03', timeout) - - return received_lines +from osmopy.osmo_interact_vty import * if __name__ == '__main__': parser = common_parser() - parser.add_argument('-n', '--prompt-name', dest='prompt', - help="Name used in application's telnet VTY prompt." - " If omitted, will attempt to determine the name from" - " the initial VTY prompt.") - parser.add_argument('-X', '--gen-xml-ref', dest='gen_xml', action='store_true', - help="Equivalent to '-c \"show online-help\" -O -'," - " can be used to generate the VTY reference file as" - " required by osmo-gsm-manuals.git.") + parser_add_vty_args(parser) + parser_add_verify_args(parser) args = parser.parse_args() - - if args.gen_xml: - if args.cmd_str: - raise Exception('It does not make sense to pass both --command and' - ' --gen-xml-ref.') - args.cmd_str = 'show online-help' interact = InteractVty(args.prompt, args.port, args.host, args.verbose, args.update) - main(args.run_app_str, args.output_path, args.cmd_str, - args.transcript_files, interact, args.verbose) + main_verify_transcripts(args.run_app_str, args.transcript_files, interact, args.verbose) # vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/setup.py b/setup.py index ec8654a..a1fad1a 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,9 @@ scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py", "osmopy/osmotestvty.py"] elif sys.version_info.major == 3: - scripts = ["osmopy/osmo_verify_transcript_vty.py", + scripts = ["osmopy/osmo_interact_vty.py", + "osmopy/osmo_interact_ctrl.py", + "osmopy/osmo_verify_transcript_vty.py", "osmopy/osmo_verify_transcript_ctrl.py"] setup( -- To view, visit https://gerrit.osmocom.org/4324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0cbd5db85ebebc893df638a07f5568632563dc9 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 18 01:57:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Oct 2017 01:57:49 +0000 Subject: [PATCH] python/osmo-python-tests[master]: cosmetic: cmdline arg doc tweaks, comment Message-ID: Review at https://gerrit.osmocom.org/4325 cosmetic: cmdline arg doc tweaks, comment Change-Id: I60dc059879dfe15cd3415ce1ed068ded28ff084e --- M osmopy/osmo_interact_common.py M osmopy/osmo_interact_vty.py 2 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/25/4325/1 diff --git a/osmopy/osmo_interact_common.py b/osmopy/osmo_interact_common.py index 6107b64..57f00bf 100644 --- a/osmopy/osmo_interact_common.py +++ b/osmopy/osmo_interact_common.py @@ -349,15 +349,15 @@ ' including command line arguments. If omitted, no' ' application is launched.') parser.add_argument('-p', '--port', dest='port', - help="Port that the application opens.") + help="Port to reach the application at.") parser.add_argument('-H', '--host', dest='host', default='localhost', - help="Host that the application opens the port on.") + help="Host to reach the application at.") return parser def parser_add_verify_args(parser): parser.add_argument('-u', '--update', dest='update', action='store_true', help='Do not verify, but OVERWRITE transcripts based on' - ' the applications current behavior. OVERWRITES TRANSCRIPT' + ' the application\'s current behavior. OVERWRITES TRANSCRIPT' ' FILES.') parser.add_argument('-v', '--verbose', action='store_true', help='Print commands and application output') diff --git a/osmopy/osmo_interact_vty.py b/osmopy/osmo_interact_vty.py index c484932..b57cd8c 100755 --- a/osmopy/osmo_interact_vty.py +++ b/osmopy/osmo_interact_vty.py @@ -142,6 +142,7 @@ received_lines = self._command(command_str, timeout) + # send escape to cancel the '?' command line if command_str[-1] == '?': self._command('\x03', timeout) -- To view, visit https://gerrit.osmocom.org/4325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I60dc059879dfe15cd3415ce1ed068ded28ff084e Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 18 08:35:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 08:35:02 +0000 Subject: [PATCH] libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4234 to look at the new patch set (#4). Add doxygen docs Make sure doxygen generates library documentation by default (can be disabled at compile time). Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Related: OS#2572 --- M .gitignore A Doxyfile.in M Makefile.am M configure.ac M debian/control 5 files changed, 1,755 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/34/4234/4 diff --git a/.gitignore b/.gitignore index c38bac1..e63e4ee 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ config.* tags +/Doxyfile diff --git a/Doxyfile.in b/Doxyfile.in new file mode 100644 index 0000000..a4e10c5 --- /dev/null +++ b/Doxyfile.in @@ -0,0 +1,1716 @@ +# Doxyfile 1.7.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = libosmo-sccp + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Osmocom SIGTRAN library" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc/sccp + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @srcdir@/include/osmocom/sigtran @srcdir@/src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +# IMAGE_PATH = images/ + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = doc/libosmo-sccp.tag + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = /usr/bin/dot + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/Makefile.am b/Makefile.am index e2c5277..68614ab 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,3 +15,30 @@ echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version + + +if HAVE_DOXYGEN + +html_DATA = $(top_builddir)/doc/html.tar + +doc: $(html_DATA) + +$(html_DATA): $(top_builddir)/doc/sccp/html/index.html + cd $(top_builddir)/doc/sccp && tar cf html.tar html + +$(top_builddir)/doc/sccp/html/index.html: $(SOURCES) Doxyfile + @rm -rf doc/sccp + mkdir -p doc/sccp + $(DOXYGEN) Doxyfile + +install-data-hook: + cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar + +uninstall-hook: + cd $(DESTDIR)$(htmldir) && rm -rf sccp + +DX_CLEAN = doc/sccp/html/search/* doc/sccp/{html,latex}/* doc/html.tar doc/doxygen_sqlite3.db doc/sccp/doxygen_sqlite3.db doc/*.tag + +endif + +MOSTLYCLEANFILES = $(DX_CLEAN) diff --git a/configure.ac b/configure.ac index ed761c3..5404acf 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,15 @@ CFLAGS="$CFLAGS -Wall" CPPFLAGS="$CPPFLAGS -Wall" +AC_ARG_ENABLE(doxygen, + [AS_HELP_STRING( + [--disable-doxygen], + [Disable generation of documentation using doxygen], + )], + [doxygen=$enableval], [doxygen="yes"]) +AC_PATH_PROG(DOXYGEN,doxygen,false) +AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") + AC_OUTPUT( libosmo-sigtran.pc libosmo-sccp.pc @@ -79,4 +88,5 @@ tests/ss7/Makefile examples/Makefile stp/Makefile + Doxyfile Makefile) diff --git a/debian/control b/debian/control index 60bef71..a59dede 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,7 @@ libtool, dh-autoreconf, git, + doxygen, libdpkg-perl, libosmo-netif-dev, libsctp-dev -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 18 08:43:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 08:43:03 +0000 Subject: [PATCH] libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4234 to look at the new patch set (#5). Add doxygen docs Make sure doxygen generates library documentation by default (can be disabled at compile time). Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Related: OS#2572 --- M .gitignore A Doxyfile.in M Makefile.am M configure.ac M debian/control 5 files changed, 1,755 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/34/4234/5 diff --git a/.gitignore b/.gitignore index c38bac1..e63e4ee 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ config.* tags +/Doxyfile diff --git a/Doxyfile.in b/Doxyfile.in new file mode 100644 index 0000000..a4e10c5 --- /dev/null +++ b/Doxyfile.in @@ -0,0 +1,1716 @@ +# Doxyfile 1.7.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = libosmo-sccp + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Osmocom SIGTRAN library" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc/sccp + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @srcdir@/include/osmocom/sigtran @srcdir@/src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +# IMAGE_PATH = images/ + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = doc/libosmo-sccp.tag + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = /usr/bin/dot + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/Makefile.am b/Makefile.am index e2c5277..3b9f6ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,3 +15,30 @@ echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version + + +if HAVE_DOXYGEN + +html_DATA = $(top_builddir)/doc/html.tar + +doc: $(html_DATA) + +$(html_DATA): $(top_builddir)/doc/sccp/html/index.html + cd $(top_builddir)/doc && tar cf html.tar */html + +$(top_builddir)/doc/sccp/html/index.html: $(SOURCES) Doxyfile + @rm -rf doc/sccp + mkdir -p doc/sccp + $(DOXYGEN) Doxyfile + +install-data-hook: + cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar + +uninstall-hook: + cd $(DESTDIR)$(htmldir) && rm -rf sccp + +DX_CLEAN = doc/sccp/html/search/* doc/sccp/{html,latex}/* doc/html.tar doc/doxygen_sqlite3.db doc/sccp/doxygen_sqlite3.db doc/*.tag + +endif + +MOSTLYCLEANFILES = $(DX_CLEAN) diff --git a/configure.ac b/configure.ac index ed761c3..5404acf 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,15 @@ CFLAGS="$CFLAGS -Wall" CPPFLAGS="$CPPFLAGS -Wall" +AC_ARG_ENABLE(doxygen, + [AS_HELP_STRING( + [--disable-doxygen], + [Disable generation of documentation using doxygen], + )], + [doxygen=$enableval], [doxygen="yes"]) +AC_PATH_PROG(DOXYGEN,doxygen,false) +AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") + AC_OUTPUT( libosmo-sigtran.pc libosmo-sccp.pc @@ -79,4 +88,5 @@ tests/ss7/Makefile examples/Makefile stp/Makefile + Doxyfile Makefile) diff --git a/debian/control b/debian/control index 60bef71..a59dede 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,7 @@ libtool, dh-autoreconf, git, + doxygen, libdpkg-perl, libosmo-netif-dev, libsctp-dev -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 5 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 18 08:54:49 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 08:54:49 +0000 Subject: [PATCH] libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4317 to look at the new patch set (#2). gb: optionally allow nsip packets only from a specific host When listening for nsip connections is enabled, then every remote host may send packets. This is useful for an SGSN that serves multiple PCUs, but contraproductive for a PCU that awaits packets from a single SGSN. Add struct members remote_ip, and remote_port to struct gprs_ns_inst, when set, then the listening end uses connect() to ensure that only the expected host may send packets. Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 --- M TODO-RELEASE M include/osmocom/gprs/gprs_ns.h M src/gb/gprs_ns.c 3 files changed, 28 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/4317/2 diff --git a/TODO-RELEASE b/TODO-RELEASE index 1964cff..e5a6f70 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -12,3 +12,4 @@ libosmogsm/oap ABI change fix AUTS length to 14, not 16 (length is implicit) osmo-auc-gen UI change fix AUTS length to 14, not 16 (length is implicit) libosmovty ABI change redefine _LAST_OSMOVTY_NODE as a high number to increase node space +libosmogb ABI change add struct members nsip.remote_ip, and nsip.remote_port to struct gprs_ns_inst \ No newline at end of file diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 938ad99..66e3d9e 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -88,6 +88,8 @@ struct osmo_fd fd; uint32_t local_ip; uint16_t local_port; + uint32_t remote_ip; + uint16_t remote_port; int dscp; } nsip; /*! NS-over-FR-over-GRE-over-IP specific bits */ diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index d20ed23..862f5b5 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1561,15 +1561,37 @@ int gprs_ns_nsip_listen(struct gprs_ns_inst *nsi) { struct in_addr in; + struct in_addr remote; + char remote_str[INET_ADDRSTRLEN]; int ret; in.s_addr = osmo_htonl(nsi->nsip.local_ip); + remote.s_addr = osmo_htonl(nsi->nsip.remote_ip); nsi->nsip.fd.cb = nsip_fd_cb; nsi->nsip.fd.data = nsi; - ret = osmo_sock_init_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, - IPPROTO_UDP, inet_ntoa(in), - nsi->nsip.local_port, OSMO_SOCK_F_BIND); + + if (nsi->nsip.remote_ip && nsi->nsip.remote_port) { + /* connect to ensure only we only accept packets from the + * configured remote end/peer */ + snprintf(remote_str, sizeof(remote_str), "%s", inet_ntoa(remote)); + ret = + osmo_sock_init2_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, + IPPROTO_UDP, inet_ntoa(in), + nsi->nsip.local_port, remote_str, + nsi->nsip.remote_port, OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT); + + LOGP(DNS, LOGL_NOTICE, + "Listening for nsip packets from %s:%u on %s:%u\n", + remote_str, nsi->nsip.remote_port, inet_ntoa(in), nsi->nsip.local_port); + } else { + /* Accept UDP packets from any source IP/Port */ + ret = osmo_sock_init_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, + IPPROTO_UDP, inet_ntoa(in), nsi->nsip.local_port, OSMO_SOCK_F_BIND); + + LOGP(DNS, LOGL_NOTICE, "Listening for nsip packets on %s:%u\n", inet_ntoa(in), nsi->nsip.local_port); + } + if (ret < 0) return ret; -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 18 09:49:24 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 09:49:24 +0000 Subject: [PATCH] osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4146 to look at the new patch set (#11). client: add unified function to generate MGCP messages currently the only way to generate MGCP messages is to use mgcp_msg_crcx(), mgcp_msg_mdcx() and mgcp_msg_dlcx(). All three function take a fixed set of parameters via their parameter list. There is no way to add or leave away optional parameters. add function mgcp_msg_gen(), this function takes a unified message struct. The struct features a presence bitmask which allows to enable and disable parameters as needed. It is also possible to add new parameters in the future without breaking the API. Depends: libosmocore I15e1af68616309555d0ed9ac5da027c9833d42e3 Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.err M tests/mgcp_client/mgcp_client_test.ok 5 files changed, 250 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/4146/11 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index efc1f76..21717e3 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include @@ -37,6 +38,36 @@ uint16_t audio_port; }; +enum mgcp_verb { + MGCP_VERB_CRCX, + MGCP_VERB_MDCX, + MGCP_VERB_DLCX, + MGCP_VERB_AUEP, + MGCP_VERB_RSIP, +}; + +#define MGCP_MSG_PRESENCE_ENDPOINT 0x0001 +#define MGCP_MSG_PRESENCE_CALL_ID 0x0002 +#define MGCP_MSG_PRESENCE_CONN_ID 0x0004 +#define MGCP_MSG_PRESENCE_AUDIO_IP 0x0008 +#define MGCP_MSG_PRESENCE_AUDIO_PORT 0x0010 +#define MGCP_MSG_PRESENCE_CONN_MODE 0x0020 + +/* See also RFC3435 section 3.2.1.3 */ +#define MGCP_ENDPOINT_MAXLEN (255*2+1+1) + +struct mgcp_msg { + enum mgcp_verb verb; + /* See MGCP_MSG_PRESENCE_* constants */ + uint32_t presence; + char endpoint[MGCP_ENDPOINT_MAXLEN]; + unsigned int call_id; + uint32_t conn_id; + uint16_t audio_port; + char *audio_ip; + enum mgcp_connection_mode conn_mode; +}; + void mgcp_client_conf_init(struct mgcp_client_conf *conf); void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf); int mgcp_client_config_write(struct vty *vty, const char *indent); @@ -65,14 +96,19 @@ struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, - enum mgcp_connection_mode mode); + enum mgcp_connection_mode mode) +OSMO_DEPRECATED("Use mgcp_msg_gen() instead"); struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, const char *rtp_conn_addr, - uint16_t rtp_port, enum mgcp_connection_mode mode); + uint16_t rtp_port, enum mgcp_connection_mode mode) +OSMO_DEPRECATED("Use mgcp_msg_gen() instead"); struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, - unsigned int call_id); + unsigned int call_id) +OSMO_DEPRECATED("Use mgcp_msg_gen() instead"); + +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg); extern const struct value_string mgcp_client_connection_mode_strs[]; static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 1cd37be..c7cc989 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -614,6 +615,109 @@ "C: %x\r\n", trans_id, rtp_endpoint, call_id); } +#define MGCP_CRCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CALL_ID | \ + MGCP_MSG_PRESENCE_CONN_ID | \ + MGCP_MSG_PRESENCE_CONN_MODE) +#define MGCP_MDCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CONN_ID) +#define MGCP_DLCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_RSIP_MANDATORY 0 /* none */ + +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg) +{ + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); + uint32_t mandatory_mask; + struct msgb *msg = msgb_alloc_headroom(4096, 128, "MGCP tx"); + int rc = 0; + + msg->l2h = msg->data; + msg->cb[MSGB_CB_MGCP_TRANS_ID] = trans_id; + + /* Add command verb */ + switch (mgcp_msg->verb) { + case MGCP_VERB_CRCX: + mandatory_mask = MGCP_CRCX_MANDATORY; + rc += msgb_printf(msg, "CRCX %u", trans_id); + break; + case MGCP_VERB_MDCX: + mandatory_mask = MGCP_MDCX_MANDATORY; + rc += msgb_printf(msg, "MDCX %u", trans_id); + break; + case MGCP_VERB_DLCX: + mandatory_mask = MGCP_DLCX_MANDATORY; + rc += msgb_printf(msg, "DLCX %u", trans_id); + break; + case MGCP_VERB_AUEP: + mandatory_mask = MGCP_AUEP_MANDATORY; + rc += msgb_printf(msg, "AUEP %u", trans_id); + break; + case MGCP_VERB_RSIP: + mandatory_mask = MGCP_RSIP_MANDATORY; + rc += msgb_printf(msg, "RSIP %u", trans_id); + break; + default: + LOGP(DLMGCP, LOGL_ERROR, + "Invalid command verb, can not generate MGCP message\n"); + msgb_free(msg); + return NULL; + } + + /* Check if mandatory fields are missing */ + if (!((mgcp_msg->presence & mandatory_mask) == mandatory_mask)) { + LOGP(DLMGCP, LOGL_ERROR, + "One or more missing mandatory fields, can not generate MGCP message\n"); + msgb_free(msg); + return NULL; + } + + /* Add endpoint name */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_ENDPOINT) + rc += msgb_printf(msg, " %s", mgcp_msg->endpoint); + + /* Add protocol version */ + rc += msgb_printf(msg, " MGCP 1.0\r\n"); + + /* Add call id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CALL_ID) + rc += msgb_printf(msg, "C: %x\r\n", mgcp_msg->call_id); + + /* Add connection id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID) + rc += msgb_printf(msg, "I: %u\r\n", mgcp_msg->conn_id); + + /* Add local connection options */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID + && mgcp_msg->verb == MGCP_VERB_CRCX) + rc += msgb_printf(msg, "L: p:20, a:AMR, nt:IN\r\n"); + + /* Add mode */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_MODE) + rc += + msgb_printf(msg, "M: %s\r\n", + mgcp_client_cmode_name(mgcp_msg->conn_mode)); + + /* Add RTP address and port (SDP) */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_IP + && mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT) { + rc += msgb_printf(msg, "\r\n"); + rc += msgb_printf(msg, "c=IN IP4 %s\r\n", mgcp_msg->audio_ip); + rc += + msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", + mgcp_msg->audio_port); + } + + if (rc != 0) { + LOGP(DLMGCP, LOGL_ERROR, + "message buffer to small, can not generate MGCP message\n"); + msgb_free(msg); + msg = NULL; + } + + return msg; +} + struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index f2f0e0f..1420959 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -149,6 +149,80 @@ "a=ptime:20\r\n"); } +void test_mgcp_msg(void) +{ + struct msgb *msg; + char audio_ip_overflow[5000]; + + /* A message struct prefilled with some arbitary values */ + struct mgcp_msg mgcp_msg = { + .audio_ip = "192.168.100.23", + .endpoint = "23 at mgw", + .audio_port = 1234, + .call_id = 47, + .conn_id = 11, + .conn_mode = MGCP_CONN_RECV_SEND + }; + + if (mgcp) + talloc_free(mgcp); + mgcp = mgcp_client_init(ctx, &conf); + + printf("\n"); + + printf("Generated CRCX message:\n"); + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Generated MDCX message:\n"); + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Generated DLCX message:\n"); + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Generated AUEP message:\n"); + mgcp_msg.verb = MGCP_VERB_AUEP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated RSIP message:\n"); + mgcp_msg.verb = MGCP_VERB_RSIP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Overfolow test:\n"); + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + memset(audio_ip_overflow, 'X', sizeof(audio_ip_overflow)); + audio_ip_overflow[sizeof(audio_ip_overflow) - 1] = '\0'; + mgcp_msg.audio_ip = audio_ip_overflow; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg == NULL); + + printf("\n"); + msgb_free(msg); +} + static const struct log_info_cat log_categories[] = { }; @@ -167,6 +241,7 @@ mgcp_client_conf_init(&conf); test_crcx(); + test_mgcp_msg(); printf("Done\n"); fprintf(stderr, "Done\n"); diff --git a/tests/mgcp_client/mgcp_client_test.err b/tests/mgcp_client/mgcp_client_test.err index a965a70..5e23799 100644 --- a/tests/mgcp_client/mgcp_client_test.err +++ b/tests/mgcp_client/mgcp_client_test.err @@ -1 +1,2 @@ -Done +<0010> mgcp_client.c:746 message buffer to small, can not generate MGCP message +Done diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index d35f2d6..e3b6113 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,4 +28,34 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + +Generated CRCX message: +CRCX 1 23 at mgw MGCP 1.0 +C: 2f +I: 11 +L: p:20, a:AMR, nt:IN +M: sendrecv + +Generated MDCX message: +MDCX 2 23 at mgw MGCP 1.0 +C: 2f +I: 11 +M: sendrecv + +c=IN IP4 192.168.100.23 +m=audio 1234 RTP/AVP 255 + +Generated DLCX message: +DLCX 3 23 at mgw MGCP 1.0 +C: 2f +I: 11 + +Generated AUEP message: +AUEP 4 23 at mgw MGCP 1.0 + +Generated RSIP message: +RSIP 5 23 at mgw MGCP 1.0 + +Overfolow test: + Done -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 11 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 18 09:49:24 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 09:49:24 +0000 Subject: [PATCH] osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4147 to look at the new patch set (#12). client: add ip address parsing to the client Some MGCP messages (CRCX, MDCX) return IP-Addresses. Make use of this information. Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 42 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/47/4147/12 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 21717e3..11680db 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -36,6 +36,7 @@ char *body; struct mgcp_response_head head; uint16_t audio_port; + char audio_ip[INET_ADDRSTRLEN]; }; enum mgcp_verb { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index c7cc989..f8c55ac 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -174,7 +174,7 @@ } /* Parse a line like "m=audio 16002 RTP/AVP 98" */ -static int mgcp_parse_audio(struct mgcp_response *r, const char *line) +static int mgcp_parse_audio_port(struct mgcp_response *r, const char *line) { if (sscanf(line, "m=audio %hu", &r->audio_port) != 1) @@ -184,7 +184,35 @@ response_parse_failure: LOGP(DLMGCP, LOGL_ERROR, - "Failed to parse MGCP response header\n"); + "Failed to parse MGCP response header (audio port)\n"); + return -EINVAL; +} + +/* Parse a line like "c=IN IP4 10.11.12.13" */ +static int mgcp_parse_audio_ip(struct mgcp_response *r, const char *line) +{ + struct in_addr ip_test; + + if (strlen(line) < 16) + goto response_parse_failure; + + /* The current implementation strictly supports IPV4 only ! */ + if (memcmp("c=IN IP4 ", line, 9) != 0) + goto response_parse_failure; + + /* Extract IP-Address */ + strncpy(r->audio_ip, line + 9, sizeof(r->audio_ip)); + r->audio_ip[sizeof(r->audio_ip) - 1] = '\0'; + + /* Check IP-Address */ + if (inet_aton(r->audio_ip, &ip_test) == 0) + goto response_parse_failure; + + return 0; + +response_parse_failure: + LOGP(DLMGCP, LOGL_ERROR, + "Failed to parse MGCP response header (audio ip)\n"); return -EINVAL; } @@ -213,7 +241,12 @@ switch (line[0]) { case 'm': - rc = mgcp_parse_audio(r, line); + rc = mgcp_parse_audio_port(r, line); + if (rc) + return rc; + break; + case 'c': + rc = mgcp_parse_audio_ip(r, line); if (rc) return rc; break; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 1420959..e99aa37 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -99,11 +99,13 @@ " head.response_code = %d\n" " head.trans_id = %u\n" " head.comment = %s\n" - " audio_port = %u\n", + " audio_port = %u\n" + " audio_ip = %s\n", response->head.response_code, response->head.trans_id, response->head.comment, - response->audio_port + response->audio_port, + response->audio_ip ); } diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index e3b6113..d4efee4 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,6 +28,7 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + audio_ip = 10.9.1.120 Generated CRCX message: CRCX 1 23 at mgw MGCP 1.0 -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 12 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 18 09:49:24 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 09:49:24 +0000 Subject: [PATCH] osmo-mgw[master]: protocol: allow wildcarded DLCX In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4227 to look at the new patch set (#7). protocol: allow wildcarded DLCX In many cases it is simpler to instruct the mgcp-gw to drop all connections at once instead of removing each connection individually. drop all connections and release the endpoint in when no connection id is supplied with the DLCX command. Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736 --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp/mgcp_protocol.c 2 files changed, 20 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/27/4227/7 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 11680db..e91b190 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -36,7 +36,7 @@ char *body; struct mgcp_response_head head; uint16_t audio_port; - char audio_ip[INET_ADDRSTRLEN]; + char audio_ip[INET_ADDRSTRLEN]; }; enum mgcp_verb { diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index c32f3d2..c5245ca 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -908,14 +908,31 @@ } } - /* find the connection */ + /* When no connection id is supplied, we will interpret this as a + * wildcarded DLCX and drop all connections at once. (See also + * RFC3435 Section F.7) */ + if (!ci) { + LOGP(DLMGCP, LOGL_NOTICE, + "DLCX: endpoint:%x missing ci (connectionIdentifier), will remove all connections at once\n", + ENDPOINT_NUMBER(endp)); + + mgcp_release_endp(endp); + + /* Note: In this case we do not return any statistics, + * as we assume that the client is not interested in + * this case. */ + return create_ok_response(endp, 200, "DLCX", p->trans); + } + + /* Parse the connection id */ if (mgcp_parse_ci(&conn_id, ci)) { LOGP(DLMGCP, LOGL_ERROR, - "DLCX: endpoint:%x insufficient parameters, missing ci (connectionIdentifier)\n", + "DLCX: endpoint:%x insufficient parameters, invalid ci (connectionIdentifier)\n", ENDPOINT_NUMBER(endp)); return create_err_response(endp, 400, "DLCX", p->trans); } + /* Find the connection */ conn = mgcp_conn_get_rtp(endp, conn_id); if (!conn) goto error3; -- To view, visit https://gerrit.osmocom.org/4227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736 Gerrit-PatchSet: 7 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 18 09:49:24 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 09:49:24 +0000 Subject: [PATCH] osmo-mgw[master]: sdp: refactoring sdp parser/generator In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4006 to look at the new patch set (#13). sdp: refactoring sdp parser/generator move SDP generator function write_response_sdp() from mgcp_protocol.c to mgcp_sdp.c move prototypes for mgcp_parse_sdp_data() and mgcp_set_audio_info() to mgcp_sdp.h change parameter list of mgcp_parse_sdp_data() so that it takes the rtp conn directly, rather than struct mgcp_rtp_end. add doxygen comments to all public functions Change-Id: I9f88c93872ff913bc211f560b26901267f577324 --- M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_sdp.h M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c 5 files changed, 147 insertions(+), 85 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/06/4006/13 diff --git a/include/osmocom/mgcp/Makefile.am b/include/osmocom/mgcp/Makefile.am index 646b887..cd8f599 100644 --- a/include/osmocom/mgcp/Makefile.am +++ b/include/osmocom/mgcp/Makefile.am @@ -4,4 +4,5 @@ mgcp_conn.h \ mgcp_stat.h \ mgcp_ep.h \ + mgcp_sdp.h \ $(NULL) diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 751aba5..d4c8dc9 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -317,9 +317,6 @@ #define DEFAULT_RTP_AUDIO_DEFAULT_CHANNELS 1 #define PTYPE_UNDEFINED (-1) -int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_rtp_end *rtp, struct mgcp_parse_data *p); -int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, - int payload_type, const char *audio_name); /*! get the ip-address where the mgw application is bound on. * \param[in] endp mgcp endpoint, that holds a copy of the VTY parameters diff --git a/include/osmocom/mgcp/mgcp_sdp.h b/include/osmocom/mgcp/mgcp_sdp.h new file mode 100644 index 0000000..0eb376d --- /dev/null +++ b/include/osmocom/mgcp/mgcp_sdp.h @@ -0,0 +1,33 @@ +/* + * SDP generation and parsing + * + * (C) 2009-2015 by Holger Hans Peter Freyther + * (C) 2009-2014 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, + struct mgcp_parse_data *p); + +int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, + int payload_type, const char *audio_name); + +int mgcp_write_response_sdp(struct mgcp_endpoint *endp, + struct mgcp_conn_rtp *conn, char *sdp_record, + size_t size, const char *addr); diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index c00cdc6..c32f3d2 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -39,6 +39,7 @@ #include #include #include +#include struct mgcp_request { char *name; @@ -191,80 +192,6 @@ return create_resp(endp, code, " FAIL", msg, trans, NULL, NULL); } -static int write_response_sdp(struct mgcp_endpoint *endp, - struct mgcp_conn_rtp *conn, - char *sdp_record, size_t size, const char *addr) -{ - const char *fmtp_extra; - const char *audio_name; - int payload_type; - int len; - int nchars; - - if (!conn) - return -1; - - endp->cfg->get_net_downlink_format_cb(endp, &payload_type, - &audio_name, &fmtp_extra, conn); - - len = snprintf(sdp_record, size, - "v=0\r\n" - "o=- %u 23 IN IP4 %s\r\n" - "s=-\r\n" - "c=IN IP4 %s\r\n" - "t=0 0\r\n", conn->conn->id, addr, addr); - - if (len < 0 || len >= size) - goto buffer_too_small; - - if (payload_type >= 0) { - nchars = snprintf(sdp_record + len, size - len, - "m=audio %d RTP/AVP %d\r\n", - conn->end.local_port, payload_type); - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - - if (audio_name && endp->tcfg->audio_send_name) { - nchars = snprintf(sdp_record + len, size - len, - "a=rtpmap:%d %s\r\n", - payload_type, audio_name); - - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - - if (fmtp_extra) { - nchars = snprintf(sdp_record + len, size - len, - "%s\r\n", fmtp_extra); - - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - } - if (conn->end.packet_duration_ms > 0 && endp->tcfg->audio_send_ptime) { - nchars = snprintf(sdp_record + len, size - len, - "a=ptime:%u\r\n", - conn->end.packet_duration_ms); - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - - return len; - -buffer_too_small: - LOGP(DLMGCP, LOGL_ERROR, "SDP buffer too small: %zu (needed %d)\n", - size, len); - return -1; -} - /* Format MGCP response string (with SDP attached) */ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, @@ -292,8 +219,8 @@ if (len < 0) return NULL; - nchars = write_response_sdp(endp, conn, sdp_record + len, - sizeof(sdp_record) - len - 1, addr); + nchars = mgcp_write_response_sdp(endp, conn, sdp_record + len, + sizeof(sdp_record) - len - 1, addr); if (nchars < 0) return NULL; @@ -689,7 +616,7 @@ /* set up RTP media parameters */ if (have_sdp) - mgcp_parse_sdp_data(endp, &conn->end, p); + mgcp_parse_sdp_data(endp, conn, p); else if (endp->local_options.codec) mgcp_set_audio_info(p->cfg, &conn->end.codec, PTYPE_UNDEFINED, endp->local_options.codec); @@ -836,7 +763,7 @@ conn->conn->mode = conn->conn->mode_orig; if (have_sdp) - mgcp_parse_sdp_data(endp, &conn->end, p); + mgcp_parse_sdp_data(endp, conn, p); set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, local_options); diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index 7568351..e08dacb 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -38,6 +38,12 @@ int channels; }; +/*! set codec configuration depending on payload type and codec name. + * \endp[in] ctx talloc context + * \endp[out] codec configuration (caller provided memory) + * \endp[in] payload_type codec type id (e.g. 3 for GSM, -1 when undefined) + * \endp[in] audio_name audio codec name (e.g. "GSM/8000/1") + * \returns 0 on success, -1 on failure */ int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, int payload_type, const char *audio_name) { @@ -107,7 +113,7 @@ return 0; } -void codecs_initialize(void *ctx, struct sdp_rtp_map *codecs, int used) +static void codecs_initialize(void *ctx, struct sdp_rtp_map *codecs, int used) { int i; @@ -137,7 +143,8 @@ } } -void codecs_update(void *ctx, struct sdp_rtp_map *codecs, int used, int payload, char *audio_name) +static void codecs_update(void *ctx, struct sdp_rtp_map *codecs, int used, + int payload, char *audio_name) { int i; @@ -163,7 +170,9 @@ LOGP(DLMGCP, LOGL_ERROR, "Unconfigured PT(%d) with %s\n", payload, audio_name); } -int is_codec_compatible(struct mgcp_endpoint *endp, struct sdp_rtp_map *codec) +/* Check if the codec matches what is set up in the trunk config */ +static int is_codec_compatible(struct mgcp_endpoint *endp, + struct sdp_rtp_map *codec) { char *bts_codec; char audio_codec[64]; @@ -182,7 +191,13 @@ return strcasecmp(audio_codec, codec->codec_name) == 0; } -int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_rtp_end *rtp, struct mgcp_parse_data *p) +/*! analyze SDP input string. + * \endp[in] endp trunk endpoint + * \endp[in] conn associated rtp connection + * \endp[in] caller provided memory to store the parsing results + * \returns 0 on success, -1 on failure */ +int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, + struct mgcp_parse_data *p) { struct sdp_rtp_map codecs[10]; int codecs_used = 0; @@ -191,7 +206,13 @@ int i; int codecs_assigned = 0; void *tmp_ctx = talloc_new(NULL); + struct mgcp_rtp_end *rtp; + OSMO_ASSERT(endp); + OSMO_ASSERT(conn); + OSMO_ASSERT(p); + + rtp = &conn->end; memset(&codecs, 0, sizeof(codecs)); for_each_line(line, p->save) { @@ -304,3 +325,86 @@ return codecs_assigned > 0; } +/*! generate SDP response string. + * \endp[in] endp trunk endpoint + * \endp[in] conn associated rtp connection + * \endp[out] sdp_record resulting SDP string + * \endp[in] size buffer size of sdp_record + * \endp[in] addr IPV4 address string (e.g. 192.168.100.1) + * \returns 0 on success, -1 on failure */ +int mgcp_write_response_sdp(struct mgcp_endpoint *endp, + struct mgcp_conn_rtp *conn, char *sdp_record, + size_t size, const char *addr) +{ + const char *fmtp_extra; + const char *audio_name; + int payload_type; + int len; + int nchars; + + OSMO_ASSERT(endp); + OSMO_ASSERT(conn); + OSMO_ASSERT(sdp_record); + OSMO_ASSERT(size > 0); + OSMO_ASSERT(addr); + + endp->cfg->get_net_downlink_format_cb(endp, &payload_type, + &audio_name, &fmtp_extra, conn); + + len = snprintf(sdp_record, size, + "v=0\r\n" + "o=- %u 23 IN IP4 %s\r\n" + "s=-\r\n" + "c=IN IP4 %s\r\n" + "t=0 0\r\n", conn->conn->id, addr, addr); + + if (len < 0 || len >= size) + goto buffer_too_small; + + if (payload_type >= 0) { + nchars = snprintf(sdp_record + len, size - len, + "m=audio %d RTP/AVP %d\r\n", + conn->end.local_port, payload_type); + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + + if (audio_name && endp->tcfg->audio_send_name) { + nchars = snprintf(sdp_record + len, size - len, + "a=rtpmap:%d %s\r\n", + payload_type, audio_name); + + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + } + + if (fmtp_extra) { + nchars = snprintf(sdp_record + len, size - len, + "%s\r\n", fmtp_extra); + + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + } + } + if (conn->end.packet_duration_ms > 0 && endp->tcfg->audio_send_ptime) { + nchars = snprintf(sdp_record + len, size - len, + "a=ptime:%u\r\n", + conn->end.packet_duration_ms); + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + } + + return len; + +buffer_too_small: + LOGP(DLMGCP, LOGL_ERROR, "SDP buffer too small: %zu (needed %d)\n", + size, len); + return -1; +} -- To view, visit https://gerrit.osmocom.org/4006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324 Gerrit-PatchSet: 13 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 18 09:49:26 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 09:49:26 +0000 Subject: [PATCH] osmo-mgw[master]: cosmetic: rename bts_codec to codec_str Message-ID: Review at https://gerrit.osmocom.org/4326 cosmetic: rename bts_codec to codec_str make variable name more meaningful e enter the commit message for your changes. Lines starting Change-Id: I4d4d5af8925d032155ca1ef8c7d7d2e496a60fb6 --- M src/libosmo-mgcp/mgcp_sdp.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/26/4326/1 diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index e08dacb..b0613ae 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -174,7 +174,7 @@ static int is_codec_compatible(struct mgcp_endpoint *endp, struct sdp_rtp_map *codec) { - char *bts_codec; + char *codec_str; char audio_codec[64]; if (!codec->codec_name) @@ -184,8 +184,8 @@ * GSM, GSM/8000 and GSM/8000/1 should all be compatible.. let's go * by name first. */ - bts_codec = endp->tcfg->audio_name; - if (sscanf(bts_codec, "%63[^/]/%*d/%*d", audio_codec) < 1) + codec_str = endp->tcfg->audio_name; + if (sscanf(codec_str, "%63[^/]/%*d/%*d", audio_codec) < 1) return 0; return strcasecmp(audio_codec, codec->codec_name) == 0; -- To view, visit https://gerrit.osmocom.org/4326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d4d5af8925d032155ca1ef8c7d7d2e496a60fb6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 18 09:49:26 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 09:49:26 +0000 Subject: [PATCH] osmo-mgw[master]: cosmetic: fix coding style for mgcp_parse_sdp_data() Message-ID: Review at https://gerrit.osmocom.org/4327 cosmetic: fix coding style for mgcp_parse_sdp_data() move variable declaration to the top remove brackets in case statement correct whitespaces Change-Id: I6dcf53ef8d3af5885b8b1f258d963949fa3ee93a --- M src/libosmo-mgcp/mgcp_sdp.c 1 file changed, 38 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/27/4327/1 diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index b0613ae..2ce09fd 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -208,6 +208,12 @@ void *tmp_ctx = talloc_new(NULL); struct mgcp_rtp_end *rtp; + int payload; + int ptime, ptime2 = 0; + char audio_name[64]; + int port, rc; + char ipv4[16]; + OSMO_ASSERT(endp); OSMO_ASSERT(conn); OSMO_ASSERT(p); @@ -223,41 +229,36 @@ case 'v': /* skip these SDP attributes */ break; - case 'a': { - int payload; - int ptime, ptime2 = 0; - char audio_name[64]; - - + case 'a': if (sscanf(line, "a=rtpmap:%d %63s", &payload, audio_name) == 2) { - codecs_update(tmp_ctx, codecs, codecs_used, payload, audio_name); - } else if (sscanf(line, "a=ptime:%d-%d", - &ptime, &ptime2) >= 1) { + codecs_update(tmp_ctx, codecs, + codecs_used, payload, audio_name); + } else + if (sscanf + (line, "a=ptime:%d-%d", &ptime, &ptime2) >= 1) { if (ptime2 > 0 && ptime2 != ptime) rtp->packet_duration_ms = 0; else rtp->packet_duration_ms = ptime; - } else if (sscanf(line, "a=maxptime:%d", &ptime2) == 1) { + } else if (sscanf(line, "a=maxptime:%d", &ptime2) + == 1) { maxptime = ptime2; } break; - } - case 'm': { - int port, rc; - - rc = sscanf(line, "m=audio %d RTP/AVP %d %d %d %d %d %d %d %d %d %d", - &port, - &codecs[0].payload_type, - &codecs[1].payload_type, - &codecs[2].payload_type, - &codecs[3].payload_type, - &codecs[4].payload_type, - &codecs[5].payload_type, - &codecs[6].payload_type, - &codecs[7].payload_type, - &codecs[8].payload_type, - &codecs[9].payload_type); + case 'm': + rc = sscanf(line, + "m=audio %d RTP/AVP %d %d %d %d %d %d %d %d %d %d", + &port, &codecs[0].payload_type, + &codecs[1].payload_type, + &codecs[2].payload_type, + &codecs[3].payload_type, + &codecs[4].payload_type, + &codecs[5].payload_type, + &codecs[6].payload_type, + &codecs[7].payload_type, + &codecs[8].payload_type, + &codecs[9].payload_type); if (rc >= 2) { rtp->rtp_port = htons(port); rtp->rtcp_port = htons(port + 1); @@ -265,20 +266,18 @@ codecs_initialize(tmp_ctx, codecs, codecs_used); } break; - } - case 'c': { - char ipv4[16]; + case 'c': if (sscanf(line, "c=IN IP4 %15s", ipv4) == 1) { inet_aton(ipv4, &rtp->addr); } break; - } default: if (p->endp) LOGP(DLMGCP, LOGL_NOTICE, "Unhandled SDP option: '%c'/%d on 0x%x\n", - line[0], line[0], ENDPOINT_NUMBER(p->endp)); + line[0], line[0], + ENDPOINT_NUMBER(p->endp)); else LOGP(DLMGCP, LOGL_NOTICE, "Unhandled SDP option: '%c'/%d\n", @@ -290,25 +289,24 @@ /* Now select the primary and alt_codec */ for (i = 0; i < codecs_used && codecs_assigned < 2; ++i) { struct mgcp_rtp_codec *codec = codecs_assigned == 0 ? - &rtp->codec : &rtp->alt_codec; + &rtp->codec : &rtp->alt_codec; if (endp->tcfg->no_audio_transcoding && - !is_codec_compatible(endp, &codecs[i])) { + !is_codec_compatible(endp, &codecs[i])) { LOGP(DLMGCP, LOGL_NOTICE, "Skipping codec %s\n", - codecs[i].codec_name); + codecs[i].codec_name); continue; } mgcp_set_audio_info(p->cfg, codec, - codecs[i].payload_type, - codecs[i].map_line); + codecs[i].payload_type, codecs[i].map_line); codecs_assigned += 1; } if (codecs_assigned > 0) { /* TODO/XXX: Store this per codec and derive it on use */ if (maxptime >= 0 && maxptime * rtp->codec.frame_duration_den > - rtp->codec.frame_duration_num * 1500) { + rtp->codec.frame_duration_num * 1500) { /* more than 1 frame */ rtp->packet_duration_ms = 0; } @@ -317,8 +315,9 @@ "Got media info via SDP: port %d, payload %d (%s), " "duration %d, addr %s\n", ntohs(rtp->rtp_port), rtp->codec.payload_type, - rtp->codec.subtype_name ? rtp->codec.subtype_name : "unknown", - rtp->packet_duration_ms, inet_ntoa(rtp->addr)); + rtp->codec.subtype_name ? rtp-> + codec.subtype_name : "unknown", rtp->packet_duration_ms, + inet_ntoa(rtp->addr)); } talloc_free(tmp_ctx); -- To view, visit https://gerrit.osmocom.org/4327 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6dcf53ef8d3af5885b8b1f258d963949fa3ee93a Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 18 09:49:26 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 09:49:26 +0000 Subject: [PATCH] osmo-mgw[master]: cosmetic: fix commenting style Message-ID: Review at https://gerrit.osmocom.org/4328 cosmetic: fix commenting style Change-Id: Ib717d9dd3b17250ef4d6c67be0463a407cb83fbe --- M src/libosmo-mgcp/mgcp_sdp.c 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/28/4328/1 diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index 2ce09fd..d1fe53d 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -180,10 +180,8 @@ if (!codec->codec_name) return 0; - /* - * GSM, GSM/8000 and GSM/8000/1 should all be compatible.. let's go - * by name first. - */ + /* GSM, GSM/8000 and GSM/8000/1 should all be compatible... + * let's go by name first. */ codec_str = endp->tcfg->audio_name; if (sscanf(codec_str, "%63[^/]/%*d/%*d", audio_codec) < 1) return 0; -- To view, visit https://gerrit.osmocom.org/4328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib717d9dd3b17250ef4d6c67be0463a407cb83fbe Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 18 09:49:27 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 09:49:27 +0000 Subject: [PATCH] osmo-mgw[master]: cosmetic: correct whitespaces Message-ID: Review at https://gerrit.osmocom.org/4329 cosmetic: correct whitespaces Change-Id: I22302ae8a48a2c776025a60267f5ef5af706e576 --- M src/libosmo-mgcp/mgcp_sdp.c 1 file changed, 21 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/29/4329/1 diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index d1fe53d..048a533 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -61,15 +61,23 @@ if (!audio_name) { switch (payload_type) { - case 0: audio_name = "PCMU/8000/1"; break; - case 3: audio_name = "GSM/8000/1"; break; - case 8: audio_name = "PCMA/8000/1"; break; - case 18: audio_name = "G729/8000/1"; break; + case 0: + audio_name = "PCMU/8000/1"; + break; + case 3: + audio_name = "GSM/8000/1"; + break; + case 8: + audio_name = "PCMA/8000/1"; + break; + case 18: + audio_name = "G729/8000/1"; + break; default: - /* Payload type is unknown, don't change rate and - * channels. */ - /* TODO: return value? */ - return 0; + /* Payload type is unknown, don't change rate and + * channels. */ + /* TODO: return value? */ + return 0; } } @@ -155,8 +163,9 @@ if (codecs[i].payload_type != payload) continue; if (sscanf(audio_name, "%63[^/]/%d/%d", - audio_codec, &rate, &channels) < 1) { - LOGP(DLMGCP, LOGL_ERROR, "Failed to parse '%s'\n", audio_name); + audio_codec, &rate, &channels) < 1) { + LOGP(DLMGCP, LOGL_ERROR, "Failed to parse '%s'\n", + audio_name); continue; } @@ -167,7 +176,8 @@ return; } - LOGP(DLMGCP, LOGL_ERROR, "Unconfigured PT(%d) with %s\n", payload, audio_name); + LOGP(DLMGCP, LOGL_ERROR, "Unconfigured PT(%d) with %s\n", payload, + audio_name); } /* Check if the codec matches what is set up in the trunk config */ -- To view, visit https://gerrit.osmocom.org/4329 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I22302ae8a48a2c776025a60267f5ef5af706e576 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:02:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 10:02:00 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-sgsn: Add missing DEPENDS libosmo-sccp Message-ID: Review at https://gerrit.osmocom.org/4330 osmo-sgsn: Add missing DEPENDS libosmo-sccp Needed as it uses libosmo-sigtran. Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 --- M recipes-osmocom/osmo-sgsn/osmo-sgsn.inc 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/30/4330/1 diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc index 3669b79..5e2fa13 100644 --- a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc @@ -3,9 +3,9 @@ LICENSE = "AGPLv3" LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" -DEPENDS = "c-ares libpcap libasn1c libosmocore libosmo-netif osmo-iuh osmo-ggsn" +DEPENDS = "c-ares libpcap libosmocore libosmo-netif libosmo-sccp osmo-ggsn" -INC_PR="r0.${META_TELEPHONY_OSMO_INC}" +INC_PR="r1.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd -- To view, visit https://gerrit.osmocom.org/4330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:02:02 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 10:02:02 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-iuh: Split into packages libosmo-ranap and osmo-hnbgw Message-ID: Review at https://gerrit.osmocom.org/4331 osmo-iuh: Split into packages libosmo-ranap and osmo-hnbgw Change-Id: Ib924a5a05c378c59dd44aed5b5b5fe897604e86b --- M recipes-osmocom/osmo-iuh/osmo-iuh.inc 1 file changed, 16 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/31/4331/1 diff --git a/recipes-osmocom/osmo-iuh/osmo-iuh.inc b/recipes-osmocom/osmo-iuh/osmo-iuh.inc index 118827e..8daa878 100644 --- a/recipes-osmocom/osmo-iuh/osmo-iuh.inc +++ b/recipes-osmocom/osmo-iuh/osmo-iuh.inc @@ -5,7 +5,7 @@ DEPENDS = "libosmocore libosmo-netif libosmo-sccp libasn1c" -INC_PR="r0.${META_TELEPHONY_OSMO_INC}" +INC_PR="r1.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd @@ -17,4 +17,18 @@ install -m 0644 ${S}/contrib/systemd/osmo-hnbgw.service ${D}${systemd_system_unitdir}/ } -SYSTEMD_SERVICE_${PN} = "osmo-hnbgw.service" +PACKAGES =+ "libosmo-ranap osmo-hnbgw" +SYSTEMD_PACKAGES = "osmo-hnbgw" +SYSTEMD_SERVICE_osmo-stp = "osmo-hnbgw.service" + +FILES_libosmo-ranap = " \ + ${libdir}/libosmo-ranap.so.* \ + " + +FILES_osmo-hnbgw = " \ + ${bindir}/osmo-hnbgw \ + ${sysconfdir}/osmocom/osmo-hnbgw.cfg \ + ${systemd_system_unitdir}/osmo-hnbgw.service \ + " + +ALLOW_EMPTY_${PN} = "1" -- To view, visit https://gerrit.osmocom.org/4331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib924a5a05c378c59dd44aed5b5b5fe897604e86b Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:02:02 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 10:02:02 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-sgsn: Enable iu support based on DISTRO_FEATURES Message-ID: Review at https://gerrit.osmocom.org/4332 osmo-sgsn: Enable iu support based on DISTRO_FEATURES Change-Id: Ifd8068d61aeea228dd24c54df6e1ce87bfcafff5 --- M recipes-osmocom/osmo-sgsn/osmo-sgsn.inc 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/32/4332/1 diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc index 5e2fa13..77029a0 100644 --- a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc @@ -5,11 +5,12 @@ DEPENDS = "c-ares libpcap libosmocore libosmo-netif libosmo-sccp osmo-ggsn" -INC_PR="r1.${META_TELEPHONY_OSMO_INC}" +INC_PR="r2.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd -EXTRA_OECONF += "--enable-iu" +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'iu', d)}" +PACKAGECONFIG[iu] = "--enable-iu,--disable-iu,libasn1c osmo-iuh," do_install_append() { install -d ${D}${systemd_system_unitdir}/ -- To view, visit https://gerrit.osmocom.org/4332 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd8068d61aeea228dd24c54df6e1ce87bfcafff5 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:02:02 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 10:02:02 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-msc: Enable iu support based on DISTRO_FEATURES Message-ID: Review at https://gerrit.osmocom.org/4333 osmo-msc: Enable iu support based on DISTRO_FEATURES Change-Id: Iaef50e96e80ef685748ddffa733ade84f5543eff --- M recipes-osmocom/osmo-msc/osmo-msc.inc 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/33/4333/1 diff --git a/recipes-osmocom/osmo-msc/osmo-msc.inc b/recipes-osmocom/osmo-msc/osmo-msc.inc index 829f947..9be747d 100644 --- a/recipes-osmocom/osmo-msc/osmo-msc.inc +++ b/recipes-osmocom/osmo-msc/osmo-msc.inc @@ -3,13 +3,15 @@ LICENSE = "AGPLv3" LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" -DEPENDS = "libdbi libasn1c osmo-iuh libosmocore libosmo-abis libosmo-sccp libosmo-netif libsmpp34 osmo-mgw" +DEPENDS = "libdbi libosmocore libosmo-abis libosmo-sccp libosmo-netif osmo-mgw" -INC_PR="r1.${META_TELEPHONY_OSMO_INC}" +INC_PR="r2.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd -EXTRA_OECONF += "--enable-smpp --enable-iu" +PACKAGECONFIG ??= "smpp ${@bb.utils.filter('DISTRO_FEATURES', 'iu', d)}" +PACKAGECONFIG[iu] = "--enable-iu,--disable-iu,libasn1c osmo-iuh," +PACKAGECONFIG[smpp] = "--enable-smpp,--disable-smpp,libsmpp34," RDEPENDS_${PN} = "libdbd-sqlite3" -- To view, visit https://gerrit.osmocom.org/4333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaef50e96e80ef685748ddffa733ade84f5543eff Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:13:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 18 Oct 2017 10:13:50 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Add missing DEPENDS libosmo-sccp In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:14:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 18 Oct 2017 10:14:42 +0000 Subject: meta-telephony[201705]: osmo-iuh: Split into packages libosmo-ranap and osmo-hnbgw In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4331/1/recipes-osmocom/osmo-iuh/osmo-iuh.inc File recipes-osmocom/osmo-iuh/osmo-iuh.inc: Line 22: SYSTEMD_SERVICE_osmo-stp = "osmo-hnbgw.service" this seems odd. why is osmo-stp getting an osmo-hnbgw.service? copy+paste error? -- To view, visit https://gerrit.osmocom.org/4331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib924a5a05c378c59dd44aed5b5b5fe897604e86b Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:14:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 10:14:57 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Add missing DEPENDS libosmo-sccp In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) Please provide justification for both in commit message. https://gerrit.osmocom.org/#/c/4330/1/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc File recipes-osmocom/osmo-sgsn/osmo-sgsn.inc: Line 6: DEPENDS = "c-ares libpcap libosmocore libosmo-netif libosmo-sccp osmo-ggsn" You not only add, you also remove. -- To view, visit https://gerrit.osmocom.org/4330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:15:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 18 Oct 2017 10:15:13 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Enable iu support based on DISTRO_FEATURES In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4332 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd8068d61aeea228dd24c54df6e1ce87bfcafff5 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:15:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 18 Oct 2017 10:15:29 +0000 Subject: meta-telephony[201705]: osmo-msc: Enable iu support based on DISTRO_FEATURES In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaef50e96e80ef685748ddffa733ade84f5543eff Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:16:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 18 Oct 2017 10:16:04 +0000 Subject: osmo-mgw[master]: cosmetic: rename bts_codec to codec_str In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4d4d5af8925d032155ca1ef8c7d7d2e496a60fb6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:18:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 18 Oct 2017 10:18:02 +0000 Subject: osmo-mgw[master]: sdp: refactoring sdp parser/generator In-Reply-To: References: Message-ID: Patch Set 13: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/4006/13/src/libosmo-mgcp/mgcp_sdp.c File src/libosmo-mgcp/mgcp_sdp.c: Line 335: int mgcp_write_response_sdp(struct mgcp_endpoint *endp, not sure if endp and/or conn could be 'const' (read-only), but this is not really critical. +2 anyway. -- To view, visit https://gerrit.osmocom.org/4006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324 Gerrit-PatchSet: 13 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:19:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 18 Oct 2017 10:19:13 +0000 Subject: osmo-mgw[master]: cosmetic: fix commenting style In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 I would prefer us not to spend paid working time on this, but well. -- To view, visit https://gerrit.osmocom.org/4328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib717d9dd3b17250ef4d6c67be0463a407cb83fbe Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:19:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 18 Oct 2017 10:19:17 +0000 Subject: osmo-mgw[master]: cosmetic: fix coding style for mgcp_parse_sdp_data() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 I would prefer us not to spend paid working time on this, but well. -- To view, visit https://gerrit.osmocom.org/4327 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dcf53ef8d3af5885b8b1f258d963949fa3ee93a Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:19:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 18 Oct 2017 10:19:33 +0000 Subject: osmo-mgw[master]: cosmetic: correct whitespaces In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 I would prefer us not to spend paid working time on this, but well. -- To view, visit https://gerrit.osmocom.org/4329 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I22302ae8a48a2c776025a60267f5ef5af706e576 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:20:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 18 Oct 2017 10:20:44 +0000 Subject: libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 5 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:22:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 18 Oct 2017 10:22:06 +0000 Subject: osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 6 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:26:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 10:26:00 +0000 Subject: [MERGED] libosmo-sccp[master]: Add doxygen docs In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add doxygen docs ...................................................................... Add doxygen docs Make sure doxygen generates library documentation by default (can be disabled at compile time). Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Related: OS#2572 --- M .gitignore A Doxyfile.in M Makefile.am M configure.ac M debian/control 5 files changed, 1,755 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index c38bac1..e63e4ee 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ config.* tags +/Doxyfile diff --git a/Doxyfile.in b/Doxyfile.in new file mode 100644 index 0000000..a4e10c5 --- /dev/null +++ b/Doxyfile.in @@ -0,0 +1,1716 @@ +# Doxyfile 1.7.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = libosmo-sccp + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Osmocom SIGTRAN library" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc/sccp + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @srcdir@/include/osmocom/sigtran @srcdir@/src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +# IMAGE_PATH = images/ + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = doc/libosmo-sccp.tag + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = /usr/bin/dot + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/Makefile.am b/Makefile.am index e2c5277..3b9f6ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,3 +15,30 @@ echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version + + +if HAVE_DOXYGEN + +html_DATA = $(top_builddir)/doc/html.tar + +doc: $(html_DATA) + +$(html_DATA): $(top_builddir)/doc/sccp/html/index.html + cd $(top_builddir)/doc && tar cf html.tar */html + +$(top_builddir)/doc/sccp/html/index.html: $(SOURCES) Doxyfile + @rm -rf doc/sccp + mkdir -p doc/sccp + $(DOXYGEN) Doxyfile + +install-data-hook: + cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar + +uninstall-hook: + cd $(DESTDIR)$(htmldir) && rm -rf sccp + +DX_CLEAN = doc/sccp/html/search/* doc/sccp/{html,latex}/* doc/html.tar doc/doxygen_sqlite3.db doc/sccp/doxygen_sqlite3.db doc/*.tag + +endif + +MOSTLYCLEANFILES = $(DX_CLEAN) diff --git a/configure.ac b/configure.ac index ed761c3..5404acf 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,15 @@ CFLAGS="$CFLAGS -Wall" CPPFLAGS="$CPPFLAGS -Wall" +AC_ARG_ENABLE(doxygen, + [AS_HELP_STRING( + [--disable-doxygen], + [Disable generation of documentation using doxygen], + )], + [doxygen=$enableval], [doxygen="yes"]) +AC_PATH_PROG(DOXYGEN,doxygen,false) +AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") + AC_OUTPUT( libosmo-sigtran.pc libosmo-sccp.pc @@ -79,4 +88,5 @@ tests/ss7/Makefile examples/Makefile stp/Makefile + Doxyfile Makefile) diff --git a/debian/control b/debian/control index 60bef71..a59dede 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,7 @@ libtool, dh-autoreconf, git, + doxygen, libdpkg-perl, libosmo-netif-dev, libsctp-dev -- To view, visit https://gerrit.osmocom.org/4234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2bf7438bcdde19dc88b9bc14c8ad9c8f49099f8a Gerrit-PatchSet: 5 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:55:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 10:55:59 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Add missing DEPENDS libosmo-sccp In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4330/1/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc File recipes-osmocom/osmo-sgsn/osmo-sgsn.inc: Line 6: DEPENDS = "c-ares libpcap libosmocore libosmo-netif libosmo-sccp osmo-ggsn" > You not only add, you also remove. Thanks for pointing out, it seems I managed to screwed it after moving stuff around during rebase interactive of changes. Those packages shouldn't been removed in here. -- To view, visit https://gerrit.osmocom.org/4330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:56:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 10:56:51 +0000 Subject: [MERGED] osmo-ggsn[master]: ippool: Implement and use blacklist instead of blindly using... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: ippool: Implement and use blacklist instead of blindly using IPPOOL_NOGATEWAY ...................................................................... ippool: Implement and use blacklist instead of blindly using IPPOOL_NOGATEWAY Commit dda21ed7d4a897c9284c69175d0da598598eae40 modified previous calls to ippool_new() removing the pass of flags to avoid allocating certain problematic IPs from the pool to MS, such as the network, gateway and broadcast IPs. Today I did some unsucessful tests with osmo-ggsn with a pool "ip prefix dynamic 176.16.222.0/24", and thus IP 176.16.222.0 was being assigned to the MS. De-capsulated DNS packets were received in the tun interface, but the Linux system in there was unable to correctly forward the packets to the gateway interface connected to the Internet. However, adding a second MS which got 176.16.222.1 had its packets forwarded correctly. However, previous implementation relies on flag IPPOOL_NOGATEWAY flag to blindly blacklist first IP after the network ip (ie, .0 and .1 are removed), which limits the IP reserved for the tun device to be .1. If a different IP in the range is assigned, it may cause issues. As a result, a blacklist is introduced in this commit to dynamically fetch the tun IP address and exlucde it from the pool of available IPs. Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 --- M ggsn/ggsn.c M lib/ippool.c M lib/ippool.h M tests/lib/ippool_test.c M tests/lib/ippool_test.err M tests/lib/ippool_test.ok 6 files changed, 365 insertions(+), 32 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index ff760cf..8b576ab 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -146,10 +146,50 @@ return 0; } + +static int alloc_ippool_blacklist(struct apn_ctx *apn, const struct tun_t *tun, struct in46_prefix **blacklist, bool ipv6) +{ + + int flags, len, len2, i; + + if (ipv6) + flags = IP_TYPE_IPv6_NONLINK; + else + flags = IP_TYPE_IPv4; + + while (1) { + len = tun_ip_local_get(apn->tun.tun, NULL, 0, flags); + if (len < 1) + return len; + + *blacklist = talloc_zero_size(apn, len * sizeof(struct in46_prefix)); + len2 = tun_ip_local_get(apn->tun.tun, *blacklist, len, flags); + if (len2 < 1) { + talloc_free(*blacklist); + return len2; + } + + if (len2 > len) /* iface was added between 2 calls, repeat operation */ + talloc_free(*blacklist); + else + break; + } + + for (i = 0; i < len2; i++) + LOGPAPN(LOGL_INFO, apn, "Blacklist tun IP %s\n", + in46p_ntoa(&(*blacklist)[i])); + + return len2; +} + /* actually start the APN with its current config */ int apn_start(struct apn_ctx *apn) { + int ippool_flags = IPPOOL_NONETWORK | IPPOOL_NOBROADCAST; struct in46_prefix ipv6_tun_linklocal_ip; + struct in46_prefix *blacklist; + int blacklist_size; + if (apn->started) return 0; @@ -231,24 +271,34 @@ if (apn->v4.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if ((blacklist_size = alloc_ippool_blacklist(apn, apn->tun.tun, &blacklist, false)) < 0) + LOGPAPN(LOGL_ERROR, apn, "Failed obtaining IPv4 tun IPs\n"); if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, - &apn->v4.cfg.static_prefix, 0)) { + &apn->v4.cfg.static_prefix, ippool_flags, + blacklist, blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); + talloc_free(blacklist); apn_stop(apn, false); return -1; } + talloc_free(blacklist); } /* Create IPv6 pool */ if (apn->v6.cfg.dynamic_prefix.addr.len) { LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if ((blacklist_size = alloc_ippool_blacklist(apn, apn->tun.tun, &blacklist, true)) < 0) + LOGPAPN(LOGL_ERROR, apn, "Failed obtaining IPv6 tun IPs\n"); if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, - &apn->v6.cfg.static_prefix, 0)) { + &apn->v6.cfg.static_prefix, ippool_flags, + blacklist, blacklist_size)) { LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); + talloc_free(blacklist); apn_stop(apn, false); return -1; } + talloc_free(blacklist); } LOGPAPN(LOGL_NOTICE, apn, "Successfully started\n"); diff --git a/lib/ippool.c b/lib/ippool.c index 03323e2..55a41d0 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -184,9 +184,19 @@ } } +static bool addr_in_prefix_list(struct in46_addr *addr, struct in46_prefix *list, size_t list_size) +{ + int i; + for (i = 0; i < list_size; i++) { + if (in46a_prefix_equal(addr, &list[i].addr)) + return true; + } + return false; +} + /* Create new address pool */ int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, const struct in46_prefix *stat, - int flags) + int flags, struct in46_prefix *blacklist, size_t blacklist_size) { /* Parse only first instance of pool for now */ @@ -210,18 +220,16 @@ if (addr.len == sizeof(struct in6_addr)) addr.len = 64/8; - /* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */ - if (flags & IPPOOL_NOGATEWAY) { - flags |= IPPOOL_NONETWORK; - } - dynsize = (1 << (addr.len*8 - addrprefixlen)); if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; - if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ - dynsize--; if (flags & IPPOOL_NOBROADCAST) /* Exclude broadcast address from pool */ dynsize--; + /* Exclude included blacklist addresses from pool */ + for (i = 0; i < blacklist_size; i++) { + if (in46a_within_mask(&blacklist[i].addr, &addr, addrprefixlen)) + dynsize--; + } } if (!stat || stat->addr.len == 0) { @@ -278,13 +286,17 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; - if (flags & IPPOOL_NOGATEWAY) { - in46a_inc(&addr); - in46a_inc(&addr); - } else if (flags & IPPOOL_NONETWORK) { + if (flags & IPPOOL_NONETWORK) { in46a_inc(&addr); } for (i = 0; i < dynsize; i++) { + if (addr_in_prefix_list(&addr, blacklist, blacklist_size)) { + SYS_ERR(DIP, LOGL_DEBUG, 0, + "addr blacklisted from pool: %s", in46a_ntoa(&addr)); + in46a_inc(&addr); + i--; + continue; + } (*this)->member[i].addr = addr; in46a_inc(&addr); diff --git a/lib/ippool.h b/lib/ippool.h index 56beb4e..efb274b 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -31,7 +31,6 @@ #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 -#define IPPOOL_NOGATEWAY 0x04 #define IPPOOL_STATSIZE 0x10000 @@ -72,7 +71,8 @@ /* Create new address pool */ extern int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, - const struct in46_prefix *stat, int flags); + const struct in46_prefix *stat, int flags, + struct in46_prefix *blacklist, size_t blacklist_size); /* Delete existing address pool */ extern int ippool_free(struct ippool_t *this); diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index f38c1be..ea56edd 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -13,36 +13,47 @@ #include "../../lib/syserr.h" -static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags) +static struct ippool_t *create_pool(const char *prefix_str, unsigned int flags, char **blacklist, size_t blacklist_size) { + struct in46_prefix *blacklist_pfx; struct ippool_t *pool; struct in46_prefix pfx; size_t t; int rc; + int i; + + blacklist_pfx = calloc(blacklist_size, sizeof(struct in46_prefix)); + for (i = 0; i < blacklist_size; i++) { + rc = ippool_aton(&blacklist_pfx[i].addr, &t, blacklist[i], 0); + OSMO_ASSERT(rc == 0); + pfx.prefixlen = t; + } /* dynamic-only v4 */ - rc = ippool_aton(&pfx.addr, &t, prefix_str, flags); + rc = ippool_aton(&pfx.addr, &t, prefix_str, 0); OSMO_ASSERT(rc == 0); pfx.prefixlen = t; - rc = ippool_new(&pool, &pfx, NULL, flags); + rc = ippool_new(&pool, &pfx, NULL, flags, blacklist_pfx, blacklist_size); OSMO_ASSERT(rc == 0); //ippool_printaddr(pool); + free(blacklist_pfx); + return pool; } -static void test_pool_size(const char *pfx, unsigned int flags, unsigned int expected_size) +static void test_pool_size(const char *pfx, unsigned int flags, char **blacklist, size_t blacklist_size, unsigned int expected_size) { struct ippool_t *pool; struct ippoolm_t *member; struct in46_addr addr; int i, rc, n; - printf("testing pool for prefix %s, flags=0x%x, expected_size=%u\n", pfx, flags, expected_size); - pool = create_pool(pfx, flags); + printf("testing pool for prefix %s, flags=0x%x, blacklist_size=%lu, expected_size=%u\n", pfx, flags, blacklist_size, expected_size); + pool = create_pool(pfx, flags, blacklist, blacklist_size); OSMO_ASSERT(pool->listsize == expected_size); memset(&addr, 0, sizeof(addr)); @@ -91,19 +102,23 @@ static void test_pool_sizes(void) { /* 256 addresses [0..255] */ - test_pool_size("192.168.23.0/24", 0, 256); + test_pool_size("192.168.23.0/24", 0, NULL, 0, 256); /* 255 addresses [1..255] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, 255); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, NULL, 0, 255); /* 254 addresses [1..254] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 254); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 254); /* 65534 addresses [0.1..255.254] */ - test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 65534); + test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 65534); /* 256 prefixes of /64 each */ - test_pool_size("2001:DB8::/56", 0, 256); + test_pool_size("2001:DB8::/56", 0, NULL, 0, 256); + + /* 253 addresses [1..254] & exclude 192.168.23.1/24 */ + char *blacklist[] = {"176.16.222.10/24", "192.168.23.1/24", "192.168.38.2/24"}; + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, blacklist, 3, 253); } int main(int argc, char **argv) diff --git a/tests/lib/ippool_test.err b/tests/lib/ippool_test.err index 7dc5371..b11c12a 100644 --- a/tests/lib/ippool_test.err +++ b/tests/lib/ippool_test.err @@ -8,3 +8,5 @@ No more IP addresses available No more IP addresses available No more IP addresses available +No more IP addresses available +No more IP addresses available diff --git a/tests/lib/ippool_test.ok b/tests/lib/ippool_test.ok index a0eeb4b..263494e 100644 --- a/tests/lib/ippool_test.ok +++ b/tests/lib/ippool_test.ok @@ -1,4 +1,4 @@ -testing pool for prefix 192.168.23.0/24, flags=0x0, expected_size=256 +testing pool for prefix 192.168.23.0/24, flags=0x0, blacklist_size=0, expected_size=256 allocated address 192.168.23.0 allocated address 192.168.23.1 allocated address 192.168.23.2 @@ -255,7 +255,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x1, expected_size=255 +testing pool for prefix 192.168.23.0/24, flags=0x1, blacklist_size=0, expected_size=255 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -511,7 +511,7 @@ allocated address 192.168.23.253 allocated address 192.168.23.254 allocated address 192.168.23.255 -testing pool for prefix 192.168.23.0/24, flags=0x3, expected_size=254 +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=0, expected_size=254 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -766,7 +766,7 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.0.0/16, flags=0x3, expected_size=65534 +testing pool for prefix 192.168.0.0/16, flags=0x3, blacklist_size=0, expected_size=65534 allocated address 192.168.0.1 allocated address 192.168.0.2 allocated address 192.168.0.3 @@ -66301,7 +66301,7 @@ allocated address 192.168.255.252 allocated address 192.168.255.253 allocated address 192.168.255.254 -testing pool for prefix 2001:DB8::/56, flags=0x0, expected_size=256 +testing pool for prefix 2001:DB8::/56, flags=0x0, blacklist_size=0, expected_size=256 allocated address 2001:db8:: allocated address 2001:db8:0:1:: allocated address 2001:db8:0:2:: @@ -66558,3 +66558,257 @@ allocated address 2001:db8:0:fd:: allocated address 2001:db8:0:fe:: allocated address 2001:db8:0:ff:: +testing pool for prefix 192.168.23.0/24, flags=0x3, blacklist_size=3, expected_size=253 +allocated address 192.168.23.2 +allocated address 192.168.23.3 +allocated address 192.168.23.4 +allocated address 192.168.23.5 +allocated address 192.168.23.6 +allocated address 192.168.23.7 +allocated address 192.168.23.8 +allocated address 192.168.23.9 +allocated address 192.168.23.10 +allocated address 192.168.23.11 +allocated address 192.168.23.12 +allocated address 192.168.23.13 +allocated address 192.168.23.14 +allocated address 192.168.23.15 +allocated address 192.168.23.16 +allocated address 192.168.23.17 +allocated address 192.168.23.18 +allocated address 192.168.23.19 +allocated address 192.168.23.20 +allocated address 192.168.23.21 +allocated address 192.168.23.22 +allocated address 192.168.23.23 +allocated address 192.168.23.24 +allocated address 192.168.23.25 +allocated address 192.168.23.26 +allocated address 192.168.23.27 +allocated address 192.168.23.28 +allocated address 192.168.23.29 +allocated address 192.168.23.30 +allocated address 192.168.23.31 +allocated address 192.168.23.32 +allocated address 192.168.23.33 +allocated address 192.168.23.34 +allocated address 192.168.23.35 +allocated address 192.168.23.36 +allocated address 192.168.23.37 +allocated address 192.168.23.38 +allocated address 192.168.23.39 +allocated address 192.168.23.40 +allocated address 192.168.23.41 +allocated address 192.168.23.42 +allocated address 192.168.23.43 +allocated address 192.168.23.44 +allocated address 192.168.23.45 +allocated address 192.168.23.46 +allocated address 192.168.23.47 +allocated address 192.168.23.48 +allocated address 192.168.23.49 +allocated address 192.168.23.50 +allocated address 192.168.23.51 +allocated address 192.168.23.52 +allocated address 192.168.23.53 +allocated address 192.168.23.54 +allocated address 192.168.23.55 +allocated address 192.168.23.56 +allocated address 192.168.23.57 +allocated address 192.168.23.58 +allocated address 192.168.23.59 +allocated address 192.168.23.60 +allocated address 192.168.23.61 +allocated address 192.168.23.62 +allocated address 192.168.23.63 +allocated address 192.168.23.64 +allocated address 192.168.23.65 +allocated address 192.168.23.66 +allocated address 192.168.23.67 +allocated address 192.168.23.68 +allocated address 192.168.23.69 +allocated address 192.168.23.70 +allocated address 192.168.23.71 +allocated address 192.168.23.72 +allocated address 192.168.23.73 +allocated address 192.168.23.74 +allocated address 192.168.23.75 +allocated address 192.168.23.76 +allocated address 192.168.23.77 +allocated address 192.168.23.78 +allocated address 192.168.23.79 +allocated address 192.168.23.80 +allocated address 192.168.23.81 +allocated address 192.168.23.82 +allocated address 192.168.23.83 +allocated address 192.168.23.84 +allocated address 192.168.23.85 +allocated address 192.168.23.86 +allocated address 192.168.23.87 +allocated address 192.168.23.88 +allocated address 192.168.23.89 +allocated address 192.168.23.90 +allocated address 192.168.23.91 +allocated address 192.168.23.92 +allocated address 192.168.23.93 +allocated address 192.168.23.94 +allocated address 192.168.23.95 +allocated address 192.168.23.96 +allocated address 192.168.23.97 +allocated address 192.168.23.98 +allocated address 192.168.23.99 +allocated address 192.168.23.100 +allocated address 192.168.23.101 +allocated address 192.168.23.102 +allocated address 192.168.23.103 +allocated address 192.168.23.104 +allocated address 192.168.23.105 +allocated address 192.168.23.106 +allocated address 192.168.23.107 +allocated address 192.168.23.108 +allocated address 192.168.23.109 +allocated address 192.168.23.110 +allocated address 192.168.23.111 +allocated address 192.168.23.112 +allocated address 192.168.23.113 +allocated address 192.168.23.114 +allocated address 192.168.23.115 +allocated address 192.168.23.116 +allocated address 192.168.23.117 +allocated address 192.168.23.118 +allocated address 192.168.23.119 +allocated address 192.168.23.120 +allocated address 192.168.23.121 +allocated address 192.168.23.122 +allocated address 192.168.23.123 +allocated address 192.168.23.124 +allocated address 192.168.23.125 +allocated address 192.168.23.126 +allocated address 192.168.23.127 +allocated address 192.168.23.128 +allocated address 192.168.23.129 +allocated address 192.168.23.130 +allocated address 192.168.23.131 +allocated address 192.168.23.132 +allocated address 192.168.23.133 +allocated address 192.168.23.134 +allocated address 192.168.23.135 +allocated address 192.168.23.136 +allocated address 192.168.23.137 +allocated address 192.168.23.138 +allocated address 192.168.23.139 +allocated address 192.168.23.140 +allocated address 192.168.23.141 +allocated address 192.168.23.142 +allocated address 192.168.23.143 +allocated address 192.168.23.144 +allocated address 192.168.23.145 +allocated address 192.168.23.146 +allocated address 192.168.23.147 +allocated address 192.168.23.148 +allocated address 192.168.23.149 +allocated address 192.168.23.150 +allocated address 192.168.23.151 +allocated address 192.168.23.152 +allocated address 192.168.23.153 +allocated address 192.168.23.154 +allocated address 192.168.23.155 +allocated address 192.168.23.156 +allocated address 192.168.23.157 +allocated address 192.168.23.158 +allocated address 192.168.23.159 +allocated address 192.168.23.160 +allocated address 192.168.23.161 +allocated address 192.168.23.162 +allocated address 192.168.23.163 +allocated address 192.168.23.164 +allocated address 192.168.23.165 +allocated address 192.168.23.166 +allocated address 192.168.23.167 +allocated address 192.168.23.168 +allocated address 192.168.23.169 +allocated address 192.168.23.170 +allocated address 192.168.23.171 +allocated address 192.168.23.172 +allocated address 192.168.23.173 +allocated address 192.168.23.174 +allocated address 192.168.23.175 +allocated address 192.168.23.176 +allocated address 192.168.23.177 +allocated address 192.168.23.178 +allocated address 192.168.23.179 +allocated address 192.168.23.180 +allocated address 192.168.23.181 +allocated address 192.168.23.182 +allocated address 192.168.23.183 +allocated address 192.168.23.184 +allocated address 192.168.23.185 +allocated address 192.168.23.186 +allocated address 192.168.23.187 +allocated address 192.168.23.188 +allocated address 192.168.23.189 +allocated address 192.168.23.190 +allocated address 192.168.23.191 +allocated address 192.168.23.192 +allocated address 192.168.23.193 +allocated address 192.168.23.194 +allocated address 192.168.23.195 +allocated address 192.168.23.196 +allocated address 192.168.23.197 +allocated address 192.168.23.198 +allocated address 192.168.23.199 +allocated address 192.168.23.200 +allocated address 192.168.23.201 +allocated address 192.168.23.202 +allocated address 192.168.23.203 +allocated address 192.168.23.204 +allocated address 192.168.23.205 +allocated address 192.168.23.206 +allocated address 192.168.23.207 +allocated address 192.168.23.208 +allocated address 192.168.23.209 +allocated address 192.168.23.210 +allocated address 192.168.23.211 +allocated address 192.168.23.212 +allocated address 192.168.23.213 +allocated address 192.168.23.214 +allocated address 192.168.23.215 +allocated address 192.168.23.216 +allocated address 192.168.23.217 +allocated address 192.168.23.218 +allocated address 192.168.23.219 +allocated address 192.168.23.220 +allocated address 192.168.23.221 +allocated address 192.168.23.222 +allocated address 192.168.23.223 +allocated address 192.168.23.224 +allocated address 192.168.23.225 +allocated address 192.168.23.226 +allocated address 192.168.23.227 +allocated address 192.168.23.228 +allocated address 192.168.23.229 +allocated address 192.168.23.230 +allocated address 192.168.23.231 +allocated address 192.168.23.232 +allocated address 192.168.23.233 +allocated address 192.168.23.234 +allocated address 192.168.23.235 +allocated address 192.168.23.236 +allocated address 192.168.23.237 +allocated address 192.168.23.238 +allocated address 192.168.23.239 +allocated address 192.168.23.240 +allocated address 192.168.23.241 +allocated address 192.168.23.242 +allocated address 192.168.23.243 +allocated address 192.168.23.244 +allocated address 192.168.23.245 +allocated address 192.168.23.246 +allocated address 192.168.23.247 +allocated address 192.168.23.248 +allocated address 192.168.23.249 +allocated address 192.168.23.250 +allocated address 192.168.23.251 +allocated address 192.168.23.252 +allocated address 192.168.23.253 +allocated address 192.168.23.254 -- To view, visit https://gerrit.osmocom.org/4256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243 Gerrit-PatchSet: 6 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:56:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 10:56:51 +0000 Subject: [MERGED] osmo-ggsn[master]: tun: Convert tun_ipv6_linklocal_get to be more generic In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: tun: Convert tun_ipv6_linklocal_get to be more generic ...................................................................... tun: Convert tun_ipv6_linklocal_get to be more generic Add support for IPv4 and IPv6 global IPs. Also return the prefix length of the IP address by using a in46_prefix. Change-Id: I277af191dc611b6bbcb83479f4ae338083740322 --- M ggsn/ggsn.c M lib/tun.c M lib/tun.h 3 files changed, 67 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 29d8473..ff760cf 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -149,6 +149,7 @@ /* actually start the APN with its current config */ int apn_start(struct apn_ctx *apn) { + struct in46_prefix ipv6_tun_linklocal_ip; if (apn->started) return 0; @@ -201,12 +202,13 @@ } if (apn->cfg.apn_type_mask & (APN_TYPE_IPv6|APN_TYPE_IPv4v6)) { - if (tun_ipv6_linklocal_get(apn->tun.tun, &apn->v6_lladdr) < 0) { + if (tun_ip_local_get(apn->tun.tun, &ipv6_tun_linklocal_ip, 1, IP_TYPE_IPv6_LINK) < 1) { LOGPAPN(LOGL_ERROR, apn, "Cannot obtain IPv6 link-local address of " "interface: %s\n", strerror(errno)); apn_stop(apn, false); return -1; } + apn->v6_lladdr = ipv6_tun_linklocal_ip.addr.v6; } /* set back-pointer from TUN device to APN */ diff --git a/lib/tun.c b/lib/tun.c index 7662146..6bcc13b 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -751,34 +751,73 @@ #include -/* obtain the link-local address of the tun device */ -int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia) +/*! Obtain the local address of the tun device. + * \param[in] tun Target device owning the IP + * \param[out] prefix_list List of prefix structures to fill with each IPv4/6 and prefix length found. + * \param[in] prefix_size Amount of elements allowed to be fill in the prefix_list array. + * \param[in] flags Specify which kind of IP to look for: IP_TYPE_IPv4, IP_TYPE_IPv6_LINK, IP_TYPE_IPv6_NONLINK + * \returns The number of ips found following the criteria specified by flags, -1 on error. + * + * This function will fill prefix_list with up to prefix_size IPs following the + * criteria specified by flags parameter. It returns the number of IPs matching + * the criteria. As a result, the number returned can be bigger than + * prefix_size. It can be used with prefix_size=0 to get an estimate of the size + * needed for prefix_list. + */ +int tun_ip_local_get(const struct tun_t *tun, struct in46_prefix *prefix_list, size_t prefix_size, int flags) { - struct ifaddrs *ifaddr, *ifa; static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; + struct ifaddrs *ifaddr, *ifa; + struct in46_addr netmask; + size_t count = 0; + bool is_ipv6_ll; if (getifaddrs(&ifaddr) == -1) { return -1; } for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; if (ifa->ifa_addr == NULL) - continue; - - if (ifa->ifa_addr->sa_family != AF_INET6) continue; if (strcmp(ifa->ifa_name, tun->devname)) continue; - if (memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix))) - continue; + if (ifa->ifa_addr->sa_family == AF_INET && (flags & IP_TYPE_IPv4)) { + struct sockaddr_in *sin4 = (struct sockaddr_in *) ifa->ifa_addr; + struct sockaddr_in *netmask4 = (struct sockaddr_in *) ifa->ifa_netmask; - *ia = sin6->sin6_addr; - freeifaddrs(ifaddr); - return 0; + if (count < prefix_size) { + netmask.len = sizeof(netmask4->sin_addr); + netmask.v4 = netmask4->sin_addr; + prefix_list[count].addr.len = sizeof(sin4->sin_addr); + prefix_list[count].addr.v4 = sin4->sin_addr; + prefix_list[count].prefixlen = in46a_netmasklen(&netmask); + } + count++; + } + + if (ifa->ifa_addr->sa_family == AF_INET6 && (flags & IP_TYPE_IPv6)) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; + struct sockaddr_in6 *netmask6 = (struct sockaddr_in6 *) ifa->ifa_netmask; + + is_ipv6_ll = !memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix)); + if ((flags & IP_TYPE_IPv6_NONLINK) && is_ipv6_ll) + continue; + if ((flags & IP_TYPE_IPv6_LINK) && !is_ipv6_ll) + continue; + + if (count < prefix_size) { + netmask.len = sizeof(netmask6->sin6_addr); + netmask.v6 = netmask6->sin6_addr; + prefix_list[count].addr.len = sizeof(sin6->sin6_addr); + prefix_list[count].addr.v6 = sin6->sin6_addr; + prefix_list[count].prefixlen = in46a_netmasklen(&netmask); + } + count++; + } } + freeifaddrs(ifaddr); - return -1; + return count; } diff --git a/lib/tun.h b/lib/tun.h index f63be50..0b960e5 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -23,6 +23,16 @@ #define TUN_NLBUFSIZE 1024 #include "config.h" + +/* ipv6 ip type flags for tun_ipv6_local_get() */ +enum { + IP_TYPE_IPv4 = 1, + IP_TYPE_IPv6_LINK = 2, + IP_TYPE_IPv6_NONLINK = 4, +}; +#define IP_TYPE_IPv6 (IP_TYPE_IPv6_LINK | IP_TYPE_IPv6_NONLINK) + + #ifndef HAVE_IPHDR struct iphdr { @@ -85,6 +95,7 @@ extern int tun_runscript(struct tun_t *tun, char *script); -int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia); +int tun_ip_local_get(const struct tun_t *tun, struct in46_prefix *prefix_list, + size_t prefix_size, int flags); #endif /* !_TUN_H */ -- To view, visit https://gerrit.osmocom.org/4291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I277af191dc611b6bbcb83479f4ae338083740322 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:56:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 10:56:52 +0000 Subject: [MERGED] osmo-ggsn[master]: lib/in46a: Introduce in46a_netmasklen API In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: lib/in46a: Introduce in46a_netmasklen API ...................................................................... lib/in46a: Introduce in46a_netmasklen API Change-Id: I06e3e038afd8f7afaec2a3fa67b1616500c8db80 --- M lib/in46_addr.c M lib/in46_addr.h M tests/lib/in46a_test.c M tests/lib/in46a_test.ok 4 files changed, 120 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 32e0f8d..36ad6af 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -195,6 +195,64 @@ } } +static unsigned int ipv4_netmasklen(const struct in_addr *netmask) +{ + uint32_t bits = netmask->s_addr; + uint8_t *b = (uint8_t*) &bits; + unsigned int i, prefix = 0; + + for (i = 0; i < 4; i++) { + while (b[i] & 0x80) { + prefix++; + b[i] = b[i] << 1; + } + } + return prefix; +} + +static unsigned int ipv6_netmasklen(const struct in6_addr *netmask) +{ + #if defined(__linux__) + #define ADDRFIELD(i) s6_addr32[i] + #else + #define ADDRFIELD(i) __u6_addr.__u6_addr32[i] + #endif + + unsigned int i, j, prefix = 0; + + for (j = 0; j < 4; j++) { + uint32_t bits = netmask->ADDRFIELD(j); + uint8_t *b = (uint8_t*) &bits; + for (i = 0; i < 4; i++) { + while (b[i] & 0x80) { + prefix++; + b[i] = b[i] << 1; + } + } + } + + #undef ADDRFIELD + + return prefix; +} + +/*! Convert netmask to prefix length representation + * \param[in] netmask in46_addr containing a netmask (consecutive list of 1-bit followed by consecutive list of 0-bit) + * \returns prefix length representation of the netmask (count of 1-bit from the start of the netmask) + */ +unsigned int in46a_netmasklen(const struct in46_addr *netmask) +{ + switch (netmask->len) { + case 4: + return ipv4_netmasklen(&netmask->v4); + case 16: + return ipv6_netmasklen(&netmask->v6); + default: + OSMO_ASSERT(0); + return 0; + } +} + /*! Convert given PDP End User Address to in46_addr * \returns 0 on success; negative on error */ int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua) diff --git a/lib/in46_addr.h b/lib/in46_addr.h index ce2df14..ff26521 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -27,6 +27,7 @@ extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); +unsigned int in46a_netmasklen(const struct in46_addr *netmask); int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua); int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst); diff --git a/tests/lib/in46a_test.c b/tests/lib/in46a_test.c index d6215e7..42a1768 100644 --- a/tests/lib/in46a_test.c +++ b/tests/lib/in46a_test.c @@ -246,6 +246,64 @@ OSMO_ASSERT(!memcmp(&ia.v6, v6_spec+2, ia.len)); } +static void test_in46a_netmasklen(void) +{ + struct in46_addr netmask; + unsigned int len; + + printf("Testing in46a_netmasklen() with IPv4 addresses\n"); + netmask.len = 4; + + netmask.v4.s_addr = 0xffffffff; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 32); + + netmask.v4.s_addr = 0x00ffffff; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 24); + + netmask.v4.s_addr = 0x00f0ffff; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 20); + + netmask.v4.s_addr = 0x000000fe; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 7); + + netmask.v4.s_addr = 0x00000000; + len = in46a_netmasklen(&netmask); + OSMO_ASSERT(len == 0); + + printf("Testing in46a_netmasklen() with IPv6 addresses\n"); + const struct in46_addr netmaskA = { + .len = 16, + .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}, + }; + len = in46a_netmasklen(&netmaskA); + OSMO_ASSERT(len == 128); + + const struct in46_addr netmaskB = { + .len = 16, + .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00}, + }; + len = in46a_netmasklen(&netmaskB); + OSMO_ASSERT(len == 104); + + const struct in46_addr netmaskC = { + .len = 16, + .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00}, + }; + len = in46a_netmasklen(&netmaskC); + OSMO_ASSERT(len == 103); + + const struct in46_addr netmaskD = { + .len = 16, + .v6.s6_addr = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + }; + len = in46a_netmasklen(&netmaskD); + OSMO_ASSERT(len == 0); +} + int main(int argc, char **argv) { osmo_init_logging(&log_info); @@ -262,4 +320,5 @@ test_in46a_within_mask(); test_in46a_to_eua(); test_in46a_from_eua(); + test_in46a_netmasklen(); } diff --git a/tests/lib/in46a_test.ok b/tests/lib/in46a_test.ok index b115444..9a0ff7a 100644 --- a/tests/lib/in46a_test.ok +++ b/tests/lib/in46a_test.ok @@ -15,3 +15,5 @@ in46a_within_mask(10.11.12.14, 10.11.12.12, 30) = 1 testing in46a_to_eua() Testing in46a_from_eua() +Testing in46a_netmasklen() with IPv4 addresses +Testing in46a_netmasklen() with IPv6 addresses -- To view, visit https://gerrit.osmocom.org/4290 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06e3e038afd8f7afaec2a3fa67b1616500c8db80 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 18 10:56:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 10:56:52 +0000 Subject: [MERGED] osmo-ggsn[master]: lib/ippool: Fix listsize calculated 1 elem too small In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: lib/ippool: Fix listsize calculated 1 elem too small ...................................................................... lib/ippool: Fix listsize calculated 1 elem too small Take the chance this commit is changing test output to also remove use of IPPOOL_NOGATEWAY which is going to be removed soon, and instead test IPPOOL_NOBROADCAST. Change-Id: I95c24bc690490155bec9e3933d678e4668d7745f --- M lib/ippool.c M tests/lib/ippool_test.c M tests/lib/ippool_test.ok 3 files changed, 21 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/ippool.c b/lib/ippool.c index d9164a3..03323e2 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -215,7 +215,7 @@ flags |= IPPOOL_NONETWORK; } - dynsize = (1 << (addr.len*8 - addrprefixlen)) -1; + dynsize = (1 << (addr.len*8 - addrprefixlen)); if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index 79e43e7..f38c1be 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -90,20 +90,20 @@ static void test_pool_sizes(void) { - /* 255 addresses [0..254] */ - test_pool_size("192.168.23.0/24", 0, 255); + /* 256 addresses [0..255] */ + test_pool_size("192.168.23.0/24", 0, 256); + + /* 255 addresses [1..255] */ + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, 255); /* 254 addresses [1..254] */ - test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK, 254); + test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 254); - /* 253 addresses [2..254] */ - test_pool_size("192.168.23.0/24", IPPOOL_NOGATEWAY, 253); + /* 65534 addresses [0.1..255.254] */ + test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, 65534); - /* 65533 addresses [3..255.254] */ - test_pool_size("192.168.0.0/16", IPPOOL_NOGATEWAY, 65533); - - /* 255 prefixes of /64 each */ - test_pool_size("2001:DB8::/56", 0, 255); + /* 256 prefixes of /64 each */ + test_pool_size("2001:DB8::/56", 0, 256); } int main(int argc, char **argv) diff --git a/tests/lib/ippool_test.ok b/tests/lib/ippool_test.ok index c1398ab..a0eeb4b 100644 --- a/tests/lib/ippool_test.ok +++ b/tests/lib/ippool_test.ok @@ -1,4 +1,4 @@ -testing pool for prefix 192.168.23.0/24, flags=0x0, expected_size=255 +testing pool for prefix 192.168.23.0/24, flags=0x0, expected_size=256 allocated address 192.168.23.0 allocated address 192.168.23.1 allocated address 192.168.23.2 @@ -254,7 +254,8 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.23.0/24, flags=0x1, expected_size=254 +allocated address 192.168.23.255 +testing pool for prefix 192.168.23.0/24, flags=0x1, expected_size=255 allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 @@ -509,7 +510,9 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.23.0/24, flags=0x4, expected_size=253 +allocated address 192.168.23.255 +testing pool for prefix 192.168.23.0/24, flags=0x3, expected_size=254 +allocated address 192.168.23.1 allocated address 192.168.23.2 allocated address 192.168.23.3 allocated address 192.168.23.4 @@ -763,7 +766,8 @@ allocated address 192.168.23.252 allocated address 192.168.23.253 allocated address 192.168.23.254 -testing pool for prefix 192.168.0.0/16, flags=0x4, expected_size=65533 +testing pool for prefix 192.168.0.0/16, flags=0x3, expected_size=65534 +allocated address 192.168.0.1 allocated address 192.168.0.2 allocated address 192.168.0.3 allocated address 192.168.0.4 @@ -66297,7 +66301,7 @@ allocated address 192.168.255.252 allocated address 192.168.255.253 allocated address 192.168.255.254 -testing pool for prefix 2001:DB8::/56, flags=0x0, expected_size=255 +testing pool for prefix 2001:DB8::/56, flags=0x0, expected_size=256 allocated address 2001:db8:: allocated address 2001:db8:0:1:: allocated address 2001:db8:0:2:: @@ -66553,3 +66557,4 @@ allocated address 2001:db8:0:fc:: allocated address 2001:db8:0:fd:: allocated address 2001:db8:0:fe:: +allocated address 2001:db8:0:ff:: -- To view, visit https://gerrit.osmocom.org/4255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95c24bc690490155bec9e3933d678e4668d7745f Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 18 11:58:36 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 11:58:36 +0000 Subject: [PATCH] osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams Message-ID: Review at https://gerrit.osmocom.org/4334 mgcp: use osmo-mgw to switch RTP streams osmo-bsc currently negotiates the RTP stream directly with the BTS and reports back the RTP IP/Port on the BTS. This works fine for a single BTS, but for Handover the port/ip pointing to the MSC side must not change, so an entity in between the BTSs and the MSC is required. Integrate the mgcp-client and use osmo-mgw to switch the RTP streams. TODO: Handover will not work yet, because there is no functionality to update the connection with the port/ip of the new BTS. Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a mgcp: Integrate osmo-mgw / mgcp --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/osmo_bsc.h A include/osmocom/bsc/osmo_bsc_mgcp.h M src/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c A src/osmo-bsc/osmo_bsc_mgcp.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c 13 files changed, 1,035 insertions(+), 67 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/34/4334/1 diff --git a/configure.ac b/configure.ac index 4edbb83..f73f33c 100644 --- a/configure.ac +++ b/configure.ac @@ -47,8 +47,9 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) +PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 1.0.0) dnl checks for header files AC_HEADER_STDC @@ -135,7 +136,6 @@ src/libfilter/Makefile src/libcommon-cs/Makefile src/osmo-bsc/Makefile - src/osmo-bsc_nat/Makefile src/ipaccess/Makefile src/utils/Makefile tests/Makefile diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 8ad2b5d..1f7cd39 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -41,6 +41,7 @@ openbscdefines.h \ osmo_bsc.h \ osmo_bsc_grace.h \ + osmo_bsc_mgcp.h \ osmo_bsc_rf.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 51b2c98..5cb7efd 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -479,6 +479,11 @@ uint8_t t3212; struct { + struct mgcp_client_conf *conf; + struct mgcp_client *client; + } mgw; + + struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; /* A list with the context information about diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h index 5ebea50..addad46 100644 --- a/include/osmocom/bsc/osmo_bsc.h +++ b/include/osmocom/bsc/osmo_bsc.h @@ -28,6 +28,21 @@ uint16_t cic; uint32_t rtp_ip; int rtp_port; + uint16_t rtp_endpoint; + + /* RTP address of the remote end (assigned by MSC through assignment + * request) */ + struct sockaddr_storage aoip_rtp_addr_remote; + + /* Local RTP address (reported back to the MSC by us with the + * assignment complete message) */ + struct sockaddr_storage aoip_rtp_addr_local; + + /* storage to keep states of the MGCP connection handler, the + * handler is created when an assignment request is received + * and is terminated when the assignment complete message is + * sent */ + struct mgcp_ctx *mgcp_ctx; /* for advanced ping/pong */ int send_ping; @@ -72,4 +87,6 @@ struct llist_head *bsc_access_lists(void); +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan); + #endif diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h new file mode 100644 index 0000000..da40fdb --- /dev/null +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -0,0 +1,44 @@ +/* (C) 2017 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +/* MGCP state handler context (fsm etc..) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* A human readable name to display in the logs */ + char name[256]; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + int chan_mode; + int full_rate; + struct gsm_lchan *lchan; + struct msgb *resp; +}; + +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct gsm_network *network, + struct osmo_bsc_sccp_con *conn, int chan_mode, int full_rate); +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan); diff --git a/src/Makefile.am b/src/Makefile.am index d04f025..dd1ad3d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,5 +33,4 @@ utils \ ipaccess \ osmo-bsc \ - osmo-bsc_nat \ $(NULL) diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index dfc4def..7db698c 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -15,6 +15,7 @@ $(COVERAGE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -30,6 +31,7 @@ osmo_bsc_vty.c \ osmo_bsc_api.c \ osmo_bsc_grace.c \ + osmo_bsc_mgcp.c \ osmo_bsc_msc.c \ osmo_bsc_sigtran.c \ osmo_bsc_filter.c \ @@ -53,4 +55,5 @@ $(COVERAGE_LDFLAGS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(NULL) diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index 94aa350..326703d 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -29,46 +29,9 @@ #include #include #include +#include #include - -/* Generate and send assignment complete message */ -static int send_aoip_ass_compl(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan) -{ - struct msgb *resp; - struct sockaddr_storage rtp_addr; - struct sockaddr_in rtp_addr_in; - struct gsm0808_speech_codec sc; - - OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); - - /* Package RTP-Address data */ - memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); - rtp_addr_in.sin_family = AF_INET; - rtp_addr_in.sin_port = htons(lchan->abis_ip.bound_port); - rtp_addr_in.sin_addr.s_addr = htonl(lchan->abis_ip.bound_ip); - memset(&rtp_addr, 0, sizeof(rtp_addr)); - memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); - - /* Extrapolate speech codec from speech mode */ - gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); - - /* Generate message */ - resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, - lchan->abis_ip.ass_compl.chosen_channel, - lchan->abis_ip.ass_compl.encr_alg_id, - lchan->abis_ip.ass_compl.speech_mode, - &rtp_addr, - &sc, - NULL); - - if (!resp) { - LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ - return -EINVAL; - } - - return osmo_bsc_sigtran_send(conn->sccp_con, resp); -} static int handle_abisip_signal(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) @@ -124,11 +87,9 @@ * IPA based base stations. See also osmo_bsc_api.c, * function bsc_assign_compl() */ LOGP(DMSC, LOGL_INFO, "Tx MSC ASSIGN COMPL (POSTPONED)\n"); - if (send_aoip_ass_compl(con, lchan) != 0) - return -EINVAL; + mgcp_ass_complete(con->sccp_con->mgcp_ctx, lchan); } break; - break; } return 0; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 4311250..320c0ef 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -24,7 +24,8 @@ #include #include #include -#include +#include +#include #include #include @@ -321,14 +322,29 @@ conn->conn = NULL; } - /* send the clear complete message */ + /* generate the clear complete message */ resp = gsm0808_create_clear_complete(); if (!resp) { LOGP(DMSC, LOGL_ERROR, "Sending clear complete failed.\n"); return -1; } - osmo_bsc_sigtran_send(conn, resp); + if (conn->mgcp_ctx) { + /* NOTE: This is the AoIP case, osmo-bsc has to negotiate with + * the MGCP-GW. For this an mgcp_ctx should be created that + * contains the FSM and some system data. When the connection + * is removed from the MGCP-GW, then osmo_bsc_sigtran_send() + * calls osmo_bsc_sigtran_send(). */ + mgcp_clear_complete(conn->mgcp_ctx, resp); + conn->mgcp_ctx = NULL; + } else { + /* NOTE: This is the SCCP-Lite case, since we do not handle + * the MGCP-GW switching ourselves, we may skip everything + * that is MGCP-GW related and sent the clear complete message + * directly */ + osmo_bsc_sigtran_send(conn, resp); + } + return 0; } @@ -426,7 +442,6 @@ int port, full_rate = -1; bool aoip = false; struct sockaddr_storage rtp_addr; - struct sockaddr_in *rtp_addr_in; struct gsm0808_channel_type ct; struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; @@ -531,29 +546,35 @@ get_value_string(gsm48_chan_mode_names, chan_mode), ct.ch_indctr, ct.ch_rate_type, osmo_hexdump(ct.perm_spch, ct.perm_spch_len)); - if (aoip == false) { - /* map it to a MGCP Endpoint and a RTP port */ + /* Forward the assingment request to lower layers */ + if (aoip) { + /* Store network side RTP connection information, we will + * process this address later after we have established an RTP + * connection to the BTS. This is just for organizational + * reasons, functional wise it would not matter when exactly + * the network side RTP connection is made, as long it is made + * before we return with the assignment complete message. */ + memcpy(&conn->aoip_rtp_addr_remote, &rtp_addr, sizeof(rtp_addr)); + + /* Create an assignment request using the MGCP fsm. This FSM + * is directly started when its created (now) and will also + * take care about the further processing (creating RTP + * endpoints, calling gsm0808_assign_req(), rsponding to + * the assignment request etc... */ + conn->mgcp_ctx = mgcp_assignm_req(conn, msc->network, conn, chan_mode, full_rate); + if (!conn->mgcp_ctx) + goto reject; + } else { + /* Note: In the sccp-lite case we to not perform any mgcp operation, + * (the MSC does that for us). We set conn->rtp_ip to 0 and check + * on this later. By this we know that we have to behave accordingly + * to sccp-lite. */ port = mgcp_timeslot_to_endpoint(multiplex, timeslot); conn->rtp_port = rtp_calculate_port(port, msc->rtp_base); conn->rtp_ip = 0; - } else { - /* use address / port supplied with the AoIP - * transport address element */ - if (rtp_addr.ss_family == AF_INET) { - rtp_addr_in = (struct sockaddr_in *)&rtp_addr; - conn->rtp_port = osmo_ntohs(rtp_addr_in->sin_port); - memcpy(&conn->rtp_ip, &rtp_addr_in->sin_addr.s_addr, - IP_V4_ADDR_LEN); - conn->rtp_ip = osmo_ntohl(conn->rtp_ip); - } else { - LOGP(DMSC, LOGL_ERROR, - "Unsopported addressing scheme. (supports only IPV4)\n"); - goto reject; - } + return gsm0808_assign_req(conn->conn, chan_mode, full_rate); } - - return gsm0808_assign_req(conn->conn, chan_mode, full_rate); - + reject: resp = gsm0808_create_assignment_failure @@ -729,3 +750,38 @@ return -1; } + +/* Generate and send assignment complete message */ +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan) +{ + struct msgb *resp; + struct gsm0808_speech_codec sc; + struct gsm_subscriber_connection *conn; + + conn = lchan->conn; + + OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); + OSMO_ASSERT(conn); + OSMO_ASSERT(conn->sccp_con); + + LOGP(DMSC, LOGL_NOTICE, "Sending assignment complete message...\n"); + + /* Extrapolate speech codec from speech mode */ + gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); + + /* Generate message */ + resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, + lchan->abis_ip.ass_compl.chosen_channel, + lchan->abis_ip.ass_compl.encr_alg_id, + lchan->abis_ip.ass_compl.speech_mode, + &conn->sccp_con->aoip_rtp_addr_local, + &sc, + NULL); + + if (!resp) { + LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ + return -EINVAL; + } + + return osmo_bsc_sigtran_send(conn->sccp_con, resp); +} diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 5e8f45e..5386bfe 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -44,6 +44,7 @@ #include #include +#include #define _GNU_SOURCE #include @@ -203,6 +204,9 @@ exit(1); } + bsc_gsmnet->mgw.conf = talloc_zero(bsc_gsmnet, struct mgcp_client_conf); + mgcp_client_conf_init(bsc_gsmnet->mgw.conf); + osmo_init_logging(&log_info); osmo_stats_init(tall_bsc_ctx); @@ -274,6 +278,13 @@ } } + bsc_gsmnet->mgw.client = mgcp_client_init(bsc_gsmnet, bsc_gsmnet->mgw.conf); + + if (mgcp_client_connect(bsc_gsmnet->mgw.client)) { + printf("MGCPGW connect failed\n"); + exit(1); + } + if (osmo_bsc_sigtran_init(&bsc_gsmnet->bsc_data->mscs) != 0) { LOGP(DNM, LOGL_ERROR, "Failed to initalize sigtran backhaul.\n"); exit(1); diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c new file mode 100644 index 0000000..d5c3cf2 --- /dev/null +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -0,0 +1,864 @@ +/* (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define CONN_ID_BTS 1 +#define CONN_ID_NET 2 + +#define MGCP_MGW_TIMEOUT 4 /* sek */ +#define MGCP_MGW_TIMEOUT_TIMER_NO 7411 +#define MGCP_BSS_TIMEOUT 4 /* sek */ +#define MGCP_BSS_TIMEOUT_TIMER_NO 7412 + +#define MGCP_ENDPOINT_FORMAT "%i at mgw" + +extern struct gsm_network *bsc_gsmnet; + +enum fsm_states { + /* Initalization state to start the FSM */ + ST_CRCX_BTS, + + /* Send CRCX for BTS and wait for response */ + ST_ASSIGN_PROC, + + /* Wait for the BSS to setup the connection */ + ST_MDCX_BTS, + + /* Send MDCX for BTS and wait for response */ + ST_CRCX_NET, + + /* Send CRCX (single phase) for NET and wait for response */ + ST_ASSIGN_COMPL, + + /* Call is now active, wait for call end */ + ST_DLCX, + + /* Send DLCX for BTS/NET and wait for response */ + ST_HALT, +}; + +static const struct value_string fsm_state_names[] = { + {ST_CRCX_BTS, "ST_CRCX_BTS (initalize FSM)"}, + {ST_ASSIGN_PROC, "ST_ASSIGN_PROC (create BTS connection)"}, + {ST_MDCX_BTS, "ST_MDCX_BTS (wait for BSS)"}, + {ST_CRCX_NET, "ST_CRCX_NET (update BTS connection)"}, + {ST_ASSIGN_COMPL, "ST_ASSIGN_COMPL (create NET connection)"}, + {ST_ASSIGN_COMPL, "ST_HALT (delete BTS/ connection)"}, + {ST_DLCX, "ST_DLCX (wait for call end)"}, + {0, NULL}, +}; + +enum fsm_evt { + /* Initial event: start off the state machine */ + EV_INIT, + + /* External event: Assignment complete, event is issued shortly before + * the assignment complete message is sent via the A-Interface */ + EV_ASS_COMPLETE, + + /* External event: Teardown event, this event is used to notify the end + * of a. It is also issued in case of errors to teardown a half open + * connection. */ + EV_TEARDOWN, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the BTS side */ + EV_CRCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the BTS side */ + EV_MDCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the NET side */ + EV_CRCX_NET_RESP, + + /* Internal event: The mgcp_gw has sent its DLCX response for + * the NET and BTS side */ + EV_DLCX_ALL_RESP, +}; + +static const struct value_string fsm_evt_names[] = { + {EV_INIT, "EV_INIT (start state machine (send CRCX for BTS)"}, + {EV_ASS_COMPLETE, "EV_ASS_COMPLETE (assignment complete)"}, + {EV_TEARDOWN, "EV_TEARDOWN (teardown all connections)"}, + {EV_CRCX_BTS_RESP, "EV_CRCX_BTS_RESP (got CRCX reponse for BTS)"}, + {EV_MDCX_BTS_RESP, "EV_MDCX_BTS_RESP (got MDCX reponse for BTS)"}, + {EV_CRCX_NET_RESP, "EV_CRCX_NET_RESP (got CRCX reponse for NET)"}, + {EV_DLCX_ALL_RESP, "EV_DLCX_ALL_RESP (got DLCX reponse for BTS/NET)"}, + {0, NULL}, +}; + +/* On error, go directly to the DLCX phase. */ +static void on_error_goto_dlcx(struct mgcp_ctx *mgcp_ctx) +{ + /* This function forces the FSM into the DLCX phase. The FSM will just + * behave like the call were ended normally. */ + + struct osmo_fsm_inst *fi; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + fi = mgcp_ctx->fsm; + OSMO_ASSERT(fi); + + LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state)); + + LOGP(DMGCP, LOGL_ERROR, "(%s) MGCPGW error proceeding request, graceful shutdown...\n", mgcp_ctx->name); + + /* Set the VM into the state where it waits for the call end */ + osmo_fsm_inst_state_chg(fi, ST_DLCX, 0, 0); + + /* Simulate the call end by sending a teardown event, so that + * the FSM proceeds directly with the DLCX */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +/* Forward declaration to keep the function in logical order */ +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_BTS: startup state machine send out CRCX for BTS side */ +static void fsm_crcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_client_next_endpoint(mgcp); + conn->rtp_endpoint = rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) creating connection for the BTS side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); + snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_BTS; + mgcp_msg.conn_mode = MGCP_CONN_LOOPBACK; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Note: if transmitting fails, receiving will also fail which eventually + * will cause the error be handled by the timeout callback */ + mgcp_client_tx(mgcp, msg, crcx_for_bts_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_PROC, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for BTS associated CRCX */ +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) CRCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse CRCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) CRCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + /* Set the connection details in the conn struct. The code that + * controls the BTS via RSL will take these values and signal them + * to the BTS via RSL/IPACC */ + conn->rtp_port = r->audio_port; + conn->rtp_ip = osmo_ntohl(inet_addr(r->audio_ip)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_BTS_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_PROC: An mgcp response has been received, proceed + * with the assignment request */ +static void fsm_proc_assignmnent_req_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + int chan_mode; + int full_rate; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + OSMO_ASSERT(conn->conn); + chan_mode = mgcp_ctx->chan_mode; + full_rate = mgcp_ctx->full_rate; + + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MGCPGW proceeding assignment request...\n", mgcp_ctx->name); + rc = gsm0808_assign_req(conn->conn, chan_mode, full_rate); + + if (rc < 0) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_BTS, MGCP_BSS_TIMEOUT, MGCP_BSS_TIMEOUT_TIMER_NO); +} + +/* Forward declaration to keep the function in logical order */ +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_BTS: When the BSS has completed the assignment, + * proceed with updating the connection for the BTS side */ +static void fsm_mdcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + struct in_addr addr; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + network = mgcp_ctx->network; + OSMO_ASSERT(network); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) MGCPGW BSS has completed the assignment, now prceed with MDCX towards BTS...\n", + mgcp_ctx->name); + + rtp_endpoint = conn->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) completing connection for the BTS side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip); + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) BTS expects RTP input on address %s:%u\n", + mgcp_ctx->name, inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_BTS; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + mgcp_msg.audio_ip = inet_ntoa(addr); + mgcp_msg.audio_port = lchan->abis_ip.bound_port; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, mdcx_for_bts_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_CRCX_NET, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for BTS associated MDCX */ +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct in_addr addr; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) MDCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse MDCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) MDCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + addr.s_addr = lchan->abis_ip.bound_ip; + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) MDCX corresponding lchan has been bound to address %s:%u\n", + mgcp_ctx->name, inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_BTS_RESP, mgcp_ctx); +} + +/* Forward declaration to keep the function in logical order */ +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_NET: An mgcp response has been received, proceed... */ +static void fsm_crcx_net_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + struct sockaddr_in *sin; + char *addr; + uint16_t port; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = conn->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) creating connection for the NET side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* Currently we only have support for IPv4 in our MGCP software, the + * AoIP part is ready to support IPv6 in theory, because the IE + * parser/generator uses sockaddr_storage for the AoIP transport + * identifier. However, the MGCP-GW does not support IPv6 yet. This is + * why we stop here in case some MSC tries to signal IPv6 AoIP + * transport identifiers */ + if (conn->aoip_rtp_addr_remote.ss_family != AF_INET) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW (%s) endpoint:%x MSC uses unsupported address format in AoIP transport identifier -- aborting...\n", + mgcp_ctx->name, rtp_endpoint); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_remote; + addr = inet_ntoa(sin->sin_addr); + port = osmo_ntohs(sin->sin_port); + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MSC expects RTP input on address %s:%u\n", mgcp_ctx->name, addr, port); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_NET; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + mgcp_msg.audio_ip = addr; + mgcp_msg.audio_port = port; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, crcx_for_net_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct sockaddr_in *sin; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) CRCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse CRCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) CRCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + /* Store address */ + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_local; + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = inet_addr(r->audio_ip); + sin->sin_port = osmo_ntohs(r->audio_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_NET_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_COMPL: Send back assignment complete and wait until the call ends */ +static void fsm_send_assignment_complete(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_lchan *lchan; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + /* Send assignment completion message via AoIP, this will complete + * the circuit. The message will also contain the port and IP-Address + * where the MGCPGW expects the RTP input from the MSC side */ + bssmap_send_aoip_ass_compl(lchan); + + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) call in progress, waiting for call end...\n", mgcp_ctx->name); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_DLCX, 0, 0); +} + +/* Forward declaration to keep the function in logical order */ +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_DLCX: Remove connection for the BTS and NET side. */ +static void fsm_dlcx_all_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = conn->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) removing connection for the BTS and NET side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* We now relase the endpoint back to the pool in order to allow + * other connections to use this endpoint */ + mgcp_client_release_endpoint(rtp_endpoint, mgcp); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, dlcx_for_all_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_HALT, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + /* Note: We check the return code, but in case of an error there is + * not much that can be done to recover. However, at least we tryed + * to remove the connection (if there was even any) */ + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) DLCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_DLCX_ALL_RESP, mgcp_ctx); +} + +/* Callback for ST_HALT: Terminate the state machine */ +static void fsm_halt_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) timeout (T%i) in state %s, state machine halted\n", + mgcp_ctx->name, fi->T, get_value_string(fsm_state_names, fi->state)); + + /* Send pending sigtran message */ + if (mgcp_ctx->resp) { + osmo_bsc_sigtran_send(conn, mgcp_ctx->resp); + mgcp_ctx->resp = NULL; + } + + /* Destroy the state machine and all context information */ + osmo_fsm_inst_free(mgcp_ctx->fsm); + memset(mgcp_ctx, 0, sizeof(*mgcp_ctx)); + talloc_free(mgcp_ctx); +} + +/* Timer callback to shut down in case of connectivity problems */ +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)fi->priv; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) timeout (T%i) in state %s, attempting graceful teardown...\n", + mgcp_ctx->name, fi->T, get_value_string(fsm_state_names, fi->state)); + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NO) { + /* Note: We were unable to communicate with the MGCP-GW, + * unfortunately there is no meaningful action we can take + * now other than giving up. */ + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) graceful teardown not possible, terminating...\n", mgcp_ctx->name); + + /* At least release the occupied endpoint ID */ + mgcp_client_release_endpoint(conn->rtp_endpoint, mgcp); + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); + } else if (fi->T == MGCP_BSS_TIMEOUT_TIMER_NO) + /* Note: If the logic that controls the BSS is unable to + * negotiate a connection, we presumably still have a + * working connection to the MGCP-GW, we will try to + * shut down gracefully. */ + on_error_goto_dlcx(mgcp_ctx); + else { + /* Note: Ther must not be any unsolicited timers + * in this FSM. If so, we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static struct osmo_fsm_state fsm_states[] = { + + /* Startup state machine, send CRCX to BTS. */ + [ST_CRCX_BTS] = { + .in_event_mask = (1 << EV_INIT), + .out_state_mask = (1 << ST_ASSIGN_PROC), + .name = "ST_CRCX_BTS", + .action = fsm_crcx_bts_cb, + }, + + /* When the CRCX response for the BTS side is received, then + * proceed the assignment on the BSS side. */ + [ST_ASSIGN_PROC] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_MDCX_BTS), + .name = "ST_ASSIGN_PROC", + .action = fsm_proc_assignmnent_req_cb, + }, + + /* When the BSS has processed the assignment request, + * then send the MDCX command for the BTS side in order to + * update the connections with the actual PORT/IP where the + * BTS expects the RTP input. */ + [ST_MDCX_BTS] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_ASS_COMPLETE), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_CRCX_NET), + .name = "ST_MDCX_BTS", + .action = fsm_mdcx_bts_cb, + }, + + /* When the MDCX response for the BTS siede is received, then + * directly proceed with sending the CRCX command to connect the + * network side. This is done in one phase (no MDCX needed). */ + [ST_CRCX_NET] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_MDCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_ASSIGN_COMPL), + .name = "ST_CRCX_NET", + .action = fsm_crcx_net_cb, + }, + + /* When the CRCX response for the NET side is received. Then + * send the assignment complete message via the A-Interface and + * enter wait state in order to wait for the end of the call. */ + [ST_ASSIGN_COMPL] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_NET_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_DLCX), + .name = "ST_ASSIGN_COMPL", + .action = fsm_send_assignment_complete, + }, + + /* When the call ends, remove all RTP connections from the + * MGCP-GW by sending a wildcarded DLCX. */ + [ST_DLCX] = { + .in_event_mask = (1 << EV_TEARDOWN), + .out_state_mask = (1 << ST_HALT), + .name = "ST_DLCX", + .action = fsm_dlcx_all_cb, + }, + + /* When the MGCP_GW confirms that the connections are terminated, + * then halt the state machine. */ + [ST_HALT] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_DLCX_ALL_RESP), + .out_state_mask = 0, + .name = "ST_HALT", + .action = fsm_halt_cb, + }, +}; + +/* State machine definition */ +static struct osmo_fsm fsm = { + .name = "FSM MGCP", + .states = fsm_states, + .num_states = ARRAY_SIZE(fsm_states), + .log_subsys = DMGCP, + .timer_cb = fsm_timeout_cb, +}; + +/* Notify that the a new call begins. This will create a connection for the + * BTS on the MGCP-GW and set up the port numbers in struct osmo_bsc_sccp_con. + * After that gsm0808_assign_req() to proceed. + * Parameter: + * ctx: talloc context + * network: associated gsm network + * conn: associated sccp connection + * chan_mode: channel mode (system data, passed through) + * full_rate: full rate flag (system data, passed through) + * Returns an mgcp_context that contains system data and the OSMO-FSM */ +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct gsm_network *network, + struct osmo_bsc_sccp_con *conn, int chan_mode, int full_rate) +{ + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(network); + OSMO_ASSERT(conn); + + /* Register the fsm description (if not already done) */ + if (osmo_fsm_find_by_name(fsm.name) != &fsm) + osmo_fsm_register(&fsm); + + /* Allocate and configure a new fsm instance */ + mgcp_ctx = talloc_zero(ctx, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + + snprintf(mgcp_ctx->name, sizeof(mgcp_ctx->name), "MGCP FSM, id=%i", conn->conn_id); + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm, NULL, ctx, LOGL_DEBUG, "FSM MGCP INST"); + OSMO_ASSERT(mgcp_ctx->fsm); + mgcp_ctx->fsm->priv = mgcp_ctx; + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MGCPGW handler fsm created\n", mgcp_ctx->name); + mgcp_ctx->network = network; + mgcp_ctx->conn = conn; + mgcp_ctx->chan_mode = chan_mode; + mgcp_ctx->full_rate = full_rate; + + /* start state machine */ + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_CRCX_BTS, 0, 0); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_INIT, mgcp_ctx); + + return mgcp_ctx; +} + +/* Notify that the call has ended, remove all connections from the MGCP-GW, + * then send the clear complete message and destroy the FSM instance + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * respmgcp_ctx: pending clear complete message to send via A-Interface */ +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(resp); + + mgcp_ctx->resp = resp; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +/* Notify that the BSS ready, send the assingnment complete message when the + * mgcp connection is completed + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * lchan: needed for sending the assignment complete message via A-Interface */ +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(lchan); + + mgcp_ctx->lchan = lchan; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASS_COMPLETE, mgcp_ctx); + + return; +} diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 48796c1..cc1f314 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -33,6 +33,7 @@ #include #include #include +#include /* A pointer to a list with all involved MSCs * (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */ diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index 0e7003f..3ee7534 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include @@ -971,6 +973,8 @@ int bsc_vty_init_extra(void) { + struct gsm_network *net = bsc_gsmnet; + install_element(CONFIG_NODE, &cfg_net_msc_cmd); install_element(CONFIG_NODE, &cfg_net_bsc_cmd); @@ -1035,5 +1039,7 @@ install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); + mgcp_client_vty_init(net, MSC_NODE, net->mgw.conf); + return 0; } -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 18 12:08:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 12:08:58 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-sgsn: Add missing DEPENDS libosmo-sccp In-Reply-To: References: Message-ID: Hello Max, Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4330 to look at the new patch set (#2). osmo-sgsn: Add missing DEPENDS libosmo-sccp Needed as it uses libosmo-sigtran. Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 --- M recipes-osmocom/osmo-sgsn/osmo-sgsn.inc 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/30/4330/2 diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc index 3669b79..382965f 100644 --- a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc @@ -3,9 +3,9 @@ LICENSE = "AGPLv3" LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" -DEPENDS = "c-ares libpcap libasn1c libosmocore libosmo-netif osmo-iuh osmo-ggsn" +DEPENDS = "c-ares libpcap libasn1c libosmocore libosmo-netif libosmo-sccp osmo-iuh osmo-ggsn" -INC_PR="r0.${META_TELEPHONY_OSMO_INC}" +INC_PR="r1.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd -- To view, visit https://gerrit.osmocom.org/4330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 18 12:08:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 12:08:58 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-iuh: Split into packages libosmo-ranap and osmo-hnbgw In-Reply-To: References: Message-ID: osmo-iuh: Split into packages libosmo-ranap and osmo-hnbgw Change-Id: Ib924a5a05c378c59dd44aed5b5b5fe897604e86b --- M recipes-osmocom/osmo-iuh/osmo-iuh.inc 1 file changed, 21 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/31/4331/2 diff --git a/recipes-osmocom/osmo-iuh/osmo-iuh.inc b/recipes-osmocom/osmo-iuh/osmo-iuh.inc index 118827e..a5f1cbc 100644 --- a/recipes-osmocom/osmo-iuh/osmo-iuh.inc +++ b/recipes-osmocom/osmo-iuh/osmo-iuh.inc @@ -5,7 +5,7 @@ DEPENDS = "libosmocore libosmo-netif libosmo-sccp libasn1c" -INC_PR="r0.${META_TELEPHONY_OSMO_INC}" +INC_PR="r1.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd @@ -17,4 +17,23 @@ install -m 0644 ${S}/contrib/systemd/osmo-hnbgw.service ${D}${systemd_system_unitdir}/ } -SYSTEMD_SERVICE_${PN} = "osmo-hnbgw.service" +PACKAGES =+ "libosmo-ranap libosmo-ranap-dev osmo-hnbgw" +SYSTEMD_PACKAGES = "osmo-hnbgw" +SYSTEMD_SERVICE_osmo-hnbgw = "osmo-hnbgw.service" + +FILES_libosmo-ranap = " \ + ${libdir}/libosmo-ranap${SOLIBS} \ + " + +FILES_libosmo-ranap-dev = " \ + ${includedir}/osmocom/ranap \ + ${libdir}/pkgconfig/libosmo-ranap.pc \ + ${libdir}/libosmo-ranap${SOLIBSDEV} \ + " + +FILES_osmo-hnbgw = " \ + ${bindir}/osmo-hnbgw \ + ${sysconfdir}/osmocom/osmo-hnbgw.cfg \ + " + +ALLOW_EMPTY_${PN} = "1" -- To view, visit https://gerrit.osmocom.org/4331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib924a5a05c378c59dd44aed5b5b5fe897604e86b Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 18 12:08:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 12:08:58 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-sgsn: Enable iu support based on DISTRO_FEATURES In-Reply-To: References: Message-ID: Hello Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4332 to look at the new patch set (#2). osmo-sgsn: Enable iu support based on DISTRO_FEATURES Change-Id: Ifd8068d61aeea228dd24c54df6e1ce87bfcafff5 --- M recipes-osmocom/osmo-sgsn/osmo-sgsn.inc 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/32/4332/2 diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc index 382965f..77029a0 100644 --- a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc @@ -3,13 +3,14 @@ LICENSE = "AGPLv3" LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" -DEPENDS = "c-ares libpcap libasn1c libosmocore libosmo-netif libosmo-sccp osmo-iuh osmo-ggsn" +DEPENDS = "c-ares libpcap libosmocore libosmo-netif libosmo-sccp osmo-ggsn" -INC_PR="r1.${META_TELEPHONY_OSMO_INC}" +INC_PR="r2.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd -EXTRA_OECONF += "--enable-iu" +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'iu', d)}" +PACKAGECONFIG[iu] = "--enable-iu,--disable-iu,libasn1c osmo-iuh," do_install_append() { install -d ${D}${systemd_system_unitdir}/ -- To view, visit https://gerrit.osmocom.org/4332 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifd8068d61aeea228dd24c54df6e1ce87bfcafff5 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 18 12:08:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 12:08:59 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-ggsn: Update SRCREV to get ippool related fixes Message-ID: Review at https://gerrit.osmocom.org/4335 osmo-ggsn: Update SRCREV to get ippool related fixes Change-Id: I631bb31b10657a8d3aa0fa40a37efdc693e98be0 --- M recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/35/4335/1 diff --git a/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb b/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb index 5a383b9..2751985 100644 --- a/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb +++ b/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb @@ -5,7 +5,7 @@ PV = "1.0.0+gitr${SRCPV}" PR = "r0" -SRCREV = "b5624c3d4838cd774c3a6df4208b709890174a25" +SRCREV = "859f9b0752419d43928d465bc96a87238c6d7940" SRC_URI = "git://git.osmocom.org/osmo-ggsn \ file://osmo-ggsn.init \ file://libgtp-queue_depth_32.patch \ -- To view, visit https://gerrit.osmocom.org/4335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I631bb31b10657a8d3aa0fa40a37efdc693e98be0 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 18 13:06:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 13:06:12 +0000 Subject: [PATCH] libosmocore[master]: Expand bitvec_write_field() function In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4292 to look at the new patch set (#2). Expand bitvec_write_field() function Previously only boolean values were allowed while in practice it's sometimes necessary to use L/H. Allow user to specify this explicitly and make old function into wrapper around extended version. Use extended function in tests and update output accordingly. Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Related: OS#1526 --- M include/osmocom/core/bitvec.h M src/bitvec.c M tests/bits/bitfield_test.c M tests/bits/bitfield_test.ok 4 files changed, 22 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/4292/2 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 3e68ddb..b7eba1f 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -72,6 +72,7 @@ unsigned int bitvec_unpack(struct bitvec *bv, const uint8_t *buffer); uint64_t bitvec_read_field(struct bitvec *bv, unsigned int *read_index, unsigned int len); int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len); +int bitvec_write_field_ext(struct bitvec *bv, uint32_t *write_index, uint64_t val, uint8_t len, bool use_lh); int bitvec_fill(struct bitvec *bv, unsigned int num_bits, enum bit_value fill); char bit_value_to_char(enum bit_value v); void bitvec_to_string_r(const struct bitvec *bv, char *str); diff --git a/src/bitvec.c b/src/bitvec.c index 0683694..ba77652 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -500,16 +500,18 @@ /*! write into the vector * \param[in] bv The boolean vector to work on * \param[in,out] write_index Where writing supposed to start in the vector + * \param[in] val value to be written to the vector * \param[in] len How many bits to write + * \param[in] use_lh whether to interpret the bits as L/H values or as 0/1 * \returns next write index or negative value on error */ -int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) +int bitvec_write_field_ext(struct bitvec *bv, uint32_t *write_index, uint64_t val, uint8_t len, bool use_lh) { int rc; bv->cur_bit = *write_index; - rc = bitvec_set_u64(bv, val, len, false); + rc = bitvec_set_u64(bv, val, len, use_lh); if (rc != 0) return rc; @@ -518,6 +520,18 @@ return 0; } +/*! write into the vector + * \param[in] bv The boolean vector to work on + * \param[in,out] write_index Where writing supposed to start in the vector + * \param[in] val value to be written to the vector + * \param[in] len How many bits to write + * \returns next write index or negative value on error + */ +int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) +{ + return bitvec_write_field_ext(bv, write_index, val, len, false); +} + /*! convert enum to corresponding character * \param v input value (bit) * \return single character, either 0, 1, L or H */ diff --git a/tests/bits/bitfield_test.c b/tests/bits/bitfield_test.c index 0a86e1f..e7023f7 100644 --- a/tests/bits/bitfield_test.c +++ b/tests/bits/bitfield_test.c @@ -19,10 +19,7 @@ INTRO(use_lh); /* GSM 04.08 10.5.2.16 IA Rest Octets */ - if (use_lh) /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ - else - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field_ext(dest, &wp, 3, 2, use_lh); /* "HH" */ bitvec_write_field(dest, &wp, 1, 2); /* "01" Packet Downlink Assignment */ bitvec_write_field(dest, &wp, ttli, 32); /* TLLI */ bitvec_write_field(dest, &wp, 1, 1); /* switch TFI: on */ @@ -35,10 +32,7 @@ bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ bitvec_write_field(dest, &wp, 0, 1); /* TBF Starting TIME present */ bitvec_write_field(dest, &wp, 0, 1); /* P0 not present */ - if (use_lh) { /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ - } else - bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + bitvec_write_field_ext(dest, &wp, 1, 1, use_lh); /* "H" - additional for R99 */ bitvec_write_field(dest, &wp, ws_enc, 5); /* EGPRS Window Size */ bitvec_write_field(dest, &wp, 0, 2); /* LINK_QUALITY_MEASUREMENT_MODE */ bitvec_write_field(dest, &wp, 0, 1); /* BEP_PERIOD2 not present */ @@ -56,10 +50,7 @@ INTRO(use_lh); /* GMS 04.08 10.5.2.37b 10.5.2.16 */ - if (use_lh) /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ - else - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field_ext(dest, &wp, 3, 2, use_lh); /* "HH" */ bitvec_write_field(dest, &wp, 0, 2); /* "0" Packet Uplink Assignment */ if (!tbf) { bitvec_write_field(dest, &wp, 0, 1); /* Block Allocation: SBA */ diff --git a/tests/bits/bitfield_test.ok b/tests/bits/bitfield_test.ok index f920a11..cd863cf 100644 --- a/tests/bits/bitfield_test.ok +++ b/tests/bits/bitfield_test.ok @@ -4,12 +4,12 @@ === start test_bitvec_ia_octet_encode_pkt_dl_ass(1) === -Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 20 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b === end test_bitvec_ia_octet_encode_pkt_dl_ass(1) === === start test_bitdiff(22) === -=== total 0 bits differ === +=== total 1 bits differ === === end test_bitdiff(22) === -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Wed Oct 18 13:06:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 13:06:13 +0000 Subject: [PATCH] libosmocore[master]: Add tests for bitvec_write_field() Message-ID: Review at https://gerrit.osmocom.org/4336 Add tests for bitvec_write_field() This function is actively used by OsmoPCU but have not been covered by tests so far. The test code is based on Minh-Quang Nguyen submission with some modifications. Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Related: OS#1526 --- M tests/Makefile.am A tests/bits/bitfield_test.c A tests/bits/bitfield_test.ok M tests/testsuite.at 4 files changed, 242 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/4336/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index dbe349f..b5049f2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -11,6 +11,7 @@ loggingrb/loggingrb_test strrb/strrb_test \ comp128/comp128_test smscb/gsm0341_test \ bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \ + bits/bitfield_test \ tlv/tlv_test gsup/gsup_test oap/oap_test fsm/fsm_test \ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ @@ -76,6 +77,9 @@ bits_bitcomp_test_SOURCES = bits/bitcomp_test.c bits_bitcomp_test_LDADD = $(top_builddir)/src/libosmocore.la + +bits_bitfield_test_SOURCES = bits/bitfield_test.c +bits_bitfield_test_LDADD = $(top_builddir)/src/libosmocore.la conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c conv_conv_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libgsmint.la @@ -232,7 +236,7 @@ vty/ok_more_spaces.cfg \ vty/ok_tabs_and_spaces.cfg \ vty/ok_tabs.cfg \ - comp128/comp128_test.ok \ + comp128/comp128_test.ok bits/bitfield_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \ diff --git a/tests/bits/bitfield_test.c b/tests/bits/bitfield_test.c new file mode 100644 index 0000000..0a86e1f --- /dev/null +++ b/tests/bits/bitfield_test.c @@ -0,0 +1,188 @@ +#include +#include +#include +#include + +#include +#include +#include + +#define INTRO(p) do { printf("=== start %s(%u) ===\n", __func__, p); } while(0) +#define OUTRO(p) do { printf("=== end %s(%u) ===\n", __func__, p); } while(0) + +static void test_bitvec_ia_octet_encode_pkt_dl_ass(struct bitvec *dest, uint32_t ttli, + uint8_t tfi, uint8_t gamma, uint8_t ta_valid, uint8_t ws_enc, + bool use_lh) +{ + unsigned wp = 0; + + INTRO(use_lh); + + /* GSM 04.08 10.5.2.16 IA Rest Octets */ + if (use_lh) /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + else + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field(dest, &wp, 1, 2); /* "01" Packet Downlink Assignment */ + bitvec_write_field(dest, &wp, ttli, 32); /* TLLI */ + bitvec_write_field(dest, &wp, 1, 1); /* switch TFI: on */ + bitvec_write_field(dest, &wp, tfi, 5); /* TFI */ + bitvec_write_field(dest, &wp, 0x0, 1); /* RLC acknowledged mode */ + bitvec_write_field(dest, &wp, 0x0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + bitvec_write_field(dest, &wp, 0,1); /* Polling Bit: off */ + bitvec_write_field(dest, &wp, ta_valid, 1); /* N. B: NOT related to TAI! */ + bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ + bitvec_write_field(dest, &wp, 0, 1); /* TBF Starting TIME present */ + bitvec_write_field(dest, &wp, 0, 1); /* P0 not present */ + if (use_lh) { /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + } else + bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + bitvec_write_field(dest, &wp, ws_enc, 5); /* EGPRS Window Size */ + bitvec_write_field(dest, &wp, 0, 2); /* LINK_QUALITY_MEASUREMENT_MODE */ + bitvec_write_field(dest, &wp, 0, 1); /* BEP_PERIOD2 not present */ + + printf("Encoded PKT DL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); + + OUTRO(use_lh); +} + +static void test_bitvec_ia_octet_encode_pkt_ul_ass(struct bitvec *dest, uint32_t fn, + uint8_t tfi, uint8_t gamma, uint8_t usf, bool tbf, bool use_lh) +{ + unsigned wp = 0; + + INTRO(use_lh); + + /* GMS 04.08 10.5.2.37b 10.5.2.16 */ + if (use_lh) /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + else + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field(dest, &wp, 0, 2); /* "0" Packet Uplink Assignment */ + if (!tbf) { + bitvec_write_field(dest, &wp, 0, 1); /* Block Allocation: SBA */ + bitvec_write_field(dest, &wp, 0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ + bitvec_write_field(dest, &wp, 1, 1); /* TBF_STARTING_TIME_FLAG */ + bitvec_write_field(dest, &wp, (fn / (26 * 51)) % 32, 5); /* T1' */ + bitvec_write_field(dest, &wp, fn % 51, 6); /* T3 */ + bitvec_write_field(dest, &wp, fn % 26, 5); /* T2 */ + } else { + bitvec_write_field(dest, &wp, 1, 1); /* Block Allocation: Not SBA */ + bitvec_write_field(dest, &wp, tfi, 5); /* TFI_ASSIGNMENT */ + bitvec_write_field(dest, &wp, 0, 1); /* POLLING = none */ + bitvec_write_field(dest, &wp, 0, 1); /* ALLOCATION_TYPE: dynamic */ + bitvec_write_field(dest, &wp, usf, 3); /* USF */ + bitvec_write_field(dest, &wp, 0, 1); /* USF_GRANULARITY */ + bitvec_write_field(dest, &wp, 0, 1); /* "0" power control: Not Present */ + bitvec_write_field(dest, &wp, 0, 2); /* CHANNEL_CODING_COMMAND */ + bitvec_write_field(dest, &wp, 1, 1); /* TLLI_BLOCK_CHANNEL_CODING */ + bitvec_write_field(dest, &wp, 0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + /* note: there is no choise for TAI and no starting time */ + bitvec_write_field(dest, &wp, 0, 1); /* switch TIMING_ADVANCE_INDEX = off */ + bitvec_write_field(dest, &wp, 0, 1); /* TBF_STARTING_TIME_FLAG */ + } + + printf("Encoded PKT UL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); + + OUTRO(use_lh); +} + +static void test_bitdiff(const struct bitvec *src1, const struct bitvec *src2, unsigned len) +{ + unsigned int bit_err = 0, i, j; + uint8_t byte_err = 0; + + INTRO(len); + + for (i = 0; i < len; i++) { + /* byte compare */ + byte_err = src1->data[i] ^ src2->data[i]; + if (byte_err) + for (j = 0; j < 8; j++) + bit_err += (byte_err >> j) & 0x01; /* count error bits */ + } + + + printf("=== total %u bits differ ===\n", bit_err); + + OUTRO(len); +} + +int main(int argc, char **argv) +{ + void *tall_pcu_ctx; + struct bitvec *dest; + struct bitvec *dest_lh; + uint8_t tfi = 0; /* Temporary Flow Identity */ + uint32_t ttli = 0xdeadbeef; + uint8_t gamma = 0; + uint8_t ta_valid = 1; + uint8_t ws_enc = 3; + uint8_t usf = 1; + uint32_t fn = 1234; + + tall_pcu_ctx = talloc_named_const(NULL, 1, "bitvecTest context"); + if (!tall_pcu_ctx) + abort(); + + dest = bitvec_alloc(22, tall_pcu_ctx); + dest_lh = bitvec_alloc(22, tall_pcu_ctx); + + /* initialize buffer */ + bitvec_unhex(dest, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + bitvec_unhex(dest_lh, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + test_bitvec_ia_octet_encode_pkt_dl_ass(dest, ttli, tfi, gamma, ta_valid, ws_enc, false); + + printf("\n\n"); + + test_bitvec_ia_octet_encode_pkt_dl_ass(dest_lh, ttli, tfi, gamma, ta_valid, ws_enc, true); + + printf("\n\n"); + + test_bitdiff(dest, dest_lh, 22); + + printf("\n\n"); + + /* initialize buffer */ + bitvec_unhex(dest, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + bitvec_unhex(dest_lh, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + test_bitvec_ia_octet_encode_pkt_ul_ass(dest, fn, tfi, gamma, usf, false, false); + + printf("\n\n"); + + test_bitvec_ia_octet_encode_pkt_ul_ass(dest_lh, fn, tfi, gamma, usf, false, true); + + printf("\n\n"); + + test_bitdiff(dest, dest_lh, 22); + + printf("\n\n"); + + /* initialize buffer */ + bitvec_unhex(dest, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + bitvec_unhex(dest_lh, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + test_bitvec_ia_octet_encode_pkt_ul_ass(dest, fn, tfi, gamma, usf, true, false); + + printf("\n\n"); + + test_bitvec_ia_octet_encode_pkt_ul_ass(dest_lh, fn, tfi, gamma, usf, true, true); + + printf("\n\n"); + + test_bitdiff(dest, dest_lh, 22); + + bitvec_free(dest); + bitvec_free(dest_lh); + + talloc_free(tall_pcu_ctx); + + return EXIT_SUCCESS; +} diff --git a/tests/bits/bitfield_test.ok b/tests/bits/bitfield_test.ok new file mode 100644 index 0000000..f920a11 --- /dev/null +++ b/tests/bits/bitfield_test.ok @@ -0,0 +1,43 @@ +=== start test_bitvec_ia_octet_encode_pkt_dl_ass(0) === +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_dl_ass(0) === + + +=== start test_bitvec_ia_octet_encode_pkt_dl_ass(1) === +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_dl_ass(1) === + + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === + + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(0) === +Encoded PKT UL ASS IA Rest Octets: c0 08 0a 63 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(0) === + + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(1) === +Encoded PKT UL ASS IA Rest Octets: c0 08 0a 63 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(1) === + + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === + + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(0) === +Encoded PKT UL ASS IA Rest Octets: c8 02 10 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(0) === + + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(1) === +Encoded PKT UL ASS IA Rest Octets: c8 02 10 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(1) === + + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === diff --git a/tests/testsuite.at b/tests/testsuite.at index 483860f..4a59b22 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -45,6 +45,12 @@ AT_CHECK([$abs_top_builddir/tests/bits/bitcomp_test], [0], [expout]) AT_CLEANUP +AT_SETUP([bitfield]) +AT_KEYWORDS([bitfield]) +cat $abs_srcdir/bits/bitfield_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/bits/bitfield_test], [0], [expout]) +AT_CLEANUP + AT_SETUP([conv]) AT_KEYWORDS([conv]) cat $abs_srcdir/conv/conv_test.ok > expout -- To view, visit https://gerrit.osmocom.org/4336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 18 13:06:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 13:06:13 +0000 Subject: [PATCH] libosmocore[master]: Replace bitvec_set_uint() with bitvec_set_u64() Message-ID: Review at https://gerrit.osmocom.org/4337 Replace bitvec_set_uint() with bitvec_set_u64() Old bitvec_set_uint() uses "unsigned int" as input parameter which length is not guaranteed. It does not allow to specify which bit_value to set and does not check for incorrect length. Overall this makes it harder to re-use and more error-prone. Let's replace it with extended implementation which uses fixed type length parameters and extra checks. The old function is left for backward compatibility as a tiny wrapper around new function. Change-Id: I1b670dacb55fb3063271d045f9faa10fccba10a6 Related: OS#1526 --- M include/osmocom/core/bitvec.h M src/bitvec.c 2 files changed, 27 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/4337/1 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index d4c7d68..19466ab 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -28,6 +28,7 @@ #include #include +#include #include /*! A single GSM bit @@ -57,6 +58,7 @@ int bitvec_set_bit(struct bitvec *bv, enum bit_value bit); int bitvec_get_bit_high(struct bitvec *bv); int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count); +int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh); int bitvec_set_uint(struct bitvec *bv, unsigned int in, unsigned int count); int bitvec_get_uint(struct bitvec *bv, unsigned int num_bits); int bitvec_find_bit_pos(const struct bitvec *bv, unsigned int n, enum bit_value val); diff --git a/src/bitvec.c b/src/bitvec.c index f07b42c..aa7bdea 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -216,23 +216,40 @@ } /*! set multiple bits (based on numeric value) at current pos - * \return 0 in case of success; negative in case of error */ -int bitvec_set_uint(struct bitvec *bv, unsigned int ui, unsigned int num_bits) + * \param[in] bv bit vector + * \param[in] v mask representing which bits needs to be set + * \param[in] num_bits number of meaningful bits in the mask + * \param[in] use_lh whether to interpret the bits as L/H values or as 0/1 + * \return 0 on success; negative in case of error */ +int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh) { - int rc; - unsigned i; + uint8_t i; + + if (num_bits > 64) + return -E2BIG; + for (i = 0; i < num_bits; i++) { - int bit = 0; - if (ui & (1u << (num_bits - i - 1))) - bit = 1; + int rc; + enum bit_value bit = use_lh ? L : 0; + + if (v & ((uint64_t)1 << (num_bits - i - 1))) + bit = use_lh ? H : 1; + rc = bitvec_set_bit(bv, bit); - if (rc) + if (rc != 0) return rc; } return 0; } +/*! set multiple bits (based on numeric value) at current pos + * \return 0 in case of success; negative in case of error */ +int bitvec_set_uint(struct bitvec *bv, unsigned int ui, unsigned int num_bits) +{ + return bitvec_set_u64(bv, ui, num_bits, false); +} + /*! get multiple bits (num_bits) from beginning of vector (MSB side) * \return 16bit signed integer retrieved from bit vector */ int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits) -- To view, visit https://gerrit.osmocom.org/4337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1b670dacb55fb3063271d045f9faa10fccba10a6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 18 13:06:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 13:06:13 +0000 Subject: [PATCH] libosmocore[master]: Deprecated bitvec_set_uint() Message-ID: Review at https://gerrit.osmocom.org/4338 Deprecated bitvec_set_uint() Use bitvec_set_u64() directly. Change-Id: I2fd8d17f9fa6c51ef51f4294882cca5944d71df2 --- M include/osmocom/core/bitvec.h M src/bitcomp.c M src/bitvec.c M src/gsm/gsm_utils.c M tests/bits/bitcomp_test.c M tests/bitvec/bitvec_test.c 6 files changed, 84 insertions(+), 84 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/4338/1 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 19466ab..3e68ddb 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -59,7 +59,7 @@ int bitvec_get_bit_high(struct bitvec *bv); int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count); int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh); -int bitvec_set_uint(struct bitvec *bv, unsigned int in, unsigned int count); +int bitvec_set_uint(struct bitvec *bv, unsigned int in, unsigned int count) OSMO_DEPRECATED("Use bitvec_set_u64() instead"); int bitvec_get_uint(struct bitvec *bv, unsigned int num_bits); int bitvec_find_bit_pos(const struct bitvec *bv, unsigned int n, enum bit_value val); int bitvec_spare_padding(struct bitvec *bv, unsigned int up_to_bit); diff --git a/src/bitcomp.c b/src/bitcomp.c index 94f60eb..db5a43e 100644 --- a/src/bitcomp.c +++ b/src/bitcomp.c @@ -227,81 +227,81 @@ static inline int t4_rle(struct bitvec *bv, unsigned len, bool b) { if (len >= 960) { - bitvec_set_uint(bv, t4_make_up[b][14], t4_make_up_length[b][14]); - return bitvec_set_uint(bv, t4_term[b][len - 960], t4_term_length[b][len - 960]); + bitvec_set_u64(bv, t4_make_up[b][14], t4_make_up_length[b][14], false); + return bitvec_set_u64(bv, t4_term[b][len - 960], t4_term_length[b][len - 960], false); } if (len >= 896) { - bitvec_set_uint(bv, t4_make_up[b][13], t4_make_up_length[b][13]); - return bitvec_set_uint(bv, t4_term[b][len - 896], t4_term_length[b][len - 896]); + bitvec_set_u64(bv, t4_make_up[b][13], t4_make_up_length[b][13], false); + return bitvec_set_u64(bv, t4_term[b][len - 896], t4_term_length[b][len - 896], false); } if (len >= 832) { - bitvec_set_uint(bv, t4_make_up[b][12], t4_make_up_length[b][12]); - return bitvec_set_uint(bv, t4_term[b][len - 832], t4_term_length[b][len - 832]); + bitvec_set_u64(bv, t4_make_up[b][12], t4_make_up_length[b][12], false); + return bitvec_set_u64(bv, t4_term[b][len - 832], t4_term_length[b][len - 832], false); } if (len >= 768) { - bitvec_set_uint(bv, t4_make_up[b][11], t4_make_up_length[b][11]); - return bitvec_set_uint(bv, t4_term[b][len - 768], t4_term_length[b][len - 768]); + bitvec_set_u64(bv, t4_make_up[b][11], t4_make_up_length[b][11], false); + return bitvec_set_u64(bv, t4_term[b][len - 768], t4_term_length[b][len - 768], false); } if (len >= 704) { - bitvec_set_uint(bv, t4_make_up[b][10], t4_make_up_length[b][10]); - return bitvec_set_uint(bv, t4_term[b][len - 704], t4_term_length[b][len - 704]); + bitvec_set_u64(bv, t4_make_up[b][10], t4_make_up_length[b][10], false); + return bitvec_set_u64(bv, t4_term[b][len - 704], t4_term_length[b][len - 704], false); } if (len >= 640) { - bitvec_set_uint(bv, t4_make_up[b][9], t4_make_up_length[b][9]); - return bitvec_set_uint(bv, t4_term[b][len - 640], t4_term_length[b][len - 640]); + bitvec_set_u64(bv, t4_make_up[b][9], t4_make_up_length[b][9], false); + return bitvec_set_u64(bv, t4_term[b][len - 640], t4_term_length[b][len - 640], false); } if (len >= 576) { - bitvec_set_uint(bv, t4_make_up[b][8], t4_make_up_length[b][8]); - return bitvec_set_uint(bv, t4_term[b][len - 576], t4_term_length[b][len - 576]); + bitvec_set_u64(bv, t4_make_up[b][8], t4_make_up_length[b][8], false); + return bitvec_set_u64(bv, t4_term[b][len - 576], t4_term_length[b][len - 576], false); } if (len >= 512) { - bitvec_set_uint(bv, t4_make_up[b][7], t4_make_up_length[b][7]); - return bitvec_set_uint(bv, t4_term[b][len - 512], t4_term_length[b][len - 512]); + bitvec_set_u64(bv, t4_make_up[b][7], t4_make_up_length[b][7], false); + return bitvec_set_u64(bv, t4_term[b][len - 512], t4_term_length[b][len - 512], false); } if (len >= 448) { - bitvec_set_uint(bv, t4_make_up[b][6], t4_make_up_length[b][6]); - return bitvec_set_uint(bv, t4_term[b][len - 448], t4_term_length[b][len - 448]); + bitvec_set_u64(bv, t4_make_up[b][6], t4_make_up_length[b][6], false); + return bitvec_set_u64(bv, t4_term[b][len - 448], t4_term_length[b][len - 448], false); } if (len >= 384) { - bitvec_set_uint(bv, t4_make_up[b][5], t4_make_up_length[b][5]); - return bitvec_set_uint(bv, t4_term[b][len - 384], t4_term_length[b][len - 384]); + bitvec_set_u64(bv, t4_make_up[b][5], t4_make_up_length[b][5], false); + return bitvec_set_u64(bv, t4_term[b][len - 384], t4_term_length[b][len - 384], false); } if (len >= 320) { - bitvec_set_uint(bv, t4_make_up[b][4], t4_make_up_length[b][4]); - return bitvec_set_uint(bv, t4_term[b][len - 320], t4_term_length[b][len - 320]); + bitvec_set_u64(bv, t4_make_up[b][4], t4_make_up_length[b][4], false); + return bitvec_set_u64(bv, t4_term[b][len - 320], t4_term_length[b][len - 320], false); } if (len >= 256) { - bitvec_set_uint(bv, t4_make_up[b][3], t4_make_up_length[b][3]); - return bitvec_set_uint(bv, t4_term[b][len - 256], t4_term_length[b][len - 256]); + bitvec_set_u64(bv, t4_make_up[b][3], t4_make_up_length[b][3], false); + return bitvec_set_u64(bv, t4_term[b][len - 256], t4_term_length[b][len - 256], false); } if (len >= 192) { - bitvec_set_uint(bv, t4_make_up[b][2], t4_make_up_length[b][2]); - return bitvec_set_uint(bv, t4_term[b][len - 192], t4_term_length[b][len - 192]); + bitvec_set_u64(bv, t4_make_up[b][2], t4_make_up_length[b][2], false); + return bitvec_set_u64(bv, t4_term[b][len - 192], t4_term_length[b][len - 192], false); } if (len >= 128) { - bitvec_set_uint(bv, t4_make_up[b][1], t4_make_up_length[b][1]); - return bitvec_set_uint(bv, t4_term[b][len - 128], t4_term_length[b][len - 128]); + bitvec_set_u64(bv, t4_make_up[b][1], t4_make_up_length[b][1], false); + return bitvec_set_u64(bv, t4_term[b][len - 128], t4_term_length[b][len - 128], false); } if (len >= 64) { - bitvec_set_uint(bv, t4_make_up[b][0], t4_make_up_length[b][0]); - return bitvec_set_uint(bv, t4_term[b][len - 64], t4_term_length[b][len - 64]); + bitvec_set_u64(bv, t4_make_up[b][0], t4_make_up_length[b][0], false); + return bitvec_set_u64(bv, t4_term[b][len - 64], t4_term_length[b][len - 64], false); } - return bitvec_set_uint(bv, t4_term[b][len], t4_term_length[b][len]); + return bitvec_set_u64(bv, t4_term[b][len], t4_term_length[b][len], false); } /*! encode bit vector in-place using T4 encoding diff --git a/src/bitvec.c b/src/bitvec.c index aa7bdea..5b742fc 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -694,7 +694,7 @@ bits += (1 + num_bits); } else { bitvec_set_bit(bv, 1); - bitvec_set_uint(bv, array[i], num_bits); + bitvec_set_u64(bv, array[i], num_bits, false); } } diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index e3f792e..6e49bb4 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -836,35 +836,35 @@ * \param[in] r Input Range1024 sructure */ void bitvec_add_range1024(struct bitvec *bv, const struct gsm48_range_1024 *r) { - bitvec_set_uint(bv, r->w1_hi, 2); - bitvec_set_uint(bv, r->w1_lo, 8); - bitvec_set_uint(bv, r->w2_hi, 8); - bitvec_set_uint(bv, r->w2_lo, 1); - bitvec_set_uint(bv, r->w3_hi, 7); - bitvec_set_uint(bv, r->w3_lo, 2); - bitvec_set_uint(bv, r->w4_hi, 6); - bitvec_set_uint(bv, r->w4_lo, 2); - bitvec_set_uint(bv, r->w5_hi, 6); - bitvec_set_uint(bv, r->w5_lo, 2); - bitvec_set_uint(bv, r->w6_hi, 6); - bitvec_set_uint(bv, r->w6_lo, 2); - bitvec_set_uint(bv, r->w7_hi, 6); - bitvec_set_uint(bv, r->w7_lo, 2); - bitvec_set_uint(bv, r->w8_hi, 6); - bitvec_set_uint(bv, r->w8_lo, 1); - bitvec_set_uint(bv, r->w9, 7); - bitvec_set_uint(bv, r->w10, 7); - bitvec_set_uint(bv, r->w11_hi, 1); - bitvec_set_uint(bv, r->w11_lo, 6); - bitvec_set_uint(bv, r->w12_hi, 2); - bitvec_set_uint(bv, r->w12_lo, 5); - bitvec_set_uint(bv, r->w13_hi, 3); - bitvec_set_uint(bv, r->w13_lo, 4); - bitvec_set_uint(bv, r->w14_hi, 4); - bitvec_set_uint(bv, r->w14_lo, 3); - bitvec_set_uint(bv, r->w15_hi, 5); - bitvec_set_uint(bv, r->w15_lo, 2); - bitvec_set_uint(bv, r->w16, 6); + bitvec_set_u64(bv, r->w1_hi, 2, false); + bitvec_set_u64(bv, r->w1_lo, 8, false); + bitvec_set_u64(bv, r->w2_hi, 8, false); + bitvec_set_u64(bv, r->w2_lo, 1, false); + bitvec_set_u64(bv, r->w3_hi, 7, false); + bitvec_set_u64(bv, r->w3_lo, 2, false); + bitvec_set_u64(bv, r->w4_hi, 6, false); + bitvec_set_u64(bv, r->w4_lo, 2, false); + bitvec_set_u64(bv, r->w5_hi, 6, false); + bitvec_set_u64(bv, r->w5_lo, 2, false); + bitvec_set_u64(bv, r->w6_hi, 6, false); + bitvec_set_u64(bv, r->w6_lo, 2, false); + bitvec_set_u64(bv, r->w7_hi, 6, false); + bitvec_set_u64(bv, r->w7_lo, 2, false); + bitvec_set_u64(bv, r->w8_hi, 6, false); + bitvec_set_u64(bv, r->w8_lo, 1, false); + bitvec_set_u64(bv, r->w9, 7, false); + bitvec_set_u64(bv, r->w10, 7, false); + bitvec_set_u64(bv, r->w11_hi, 1, false); + bitvec_set_u64(bv, r->w11_lo, 6, false); + bitvec_set_u64(bv, r->w12_hi, 2, false); + bitvec_set_u64(bv, r->w12_lo, 5, false); + bitvec_set_u64(bv, r->w13_hi, 3, false); + bitvec_set_u64(bv, r->w13_lo, 4, false); + bitvec_set_u64(bv, r->w14_hi, 4, false); + bitvec_set_u64(bv, r->w14_lo, 3, false); + bitvec_set_u64(bv, r->w15_hi, 5, false); + bitvec_set_u64(bv, r->w15_lo, 2, false); + bitvec_set_u64(bv, r->w16, 6, false); } /*! Determine GPRS TLLI Type (TS 23.003 Chapter 2.6) */ diff --git a/tests/bits/bitcomp_test.c b/tests/bits/bitcomp_test.c index 587dd72..de59aa6 100644 --- a/tests/bits/bitcomp_test.c +++ b/tests/bits/bitcomp_test.c @@ -31,22 +31,22 @@ printf("\nTEST1:\n 00110111 01000111 10000001 1111\n"); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0x374781F, 28); bitvec_to_string_r(&bv, lol); printf("%s", lol); + bitvec_set_u64(&bv, 0x374781F, 28, false); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf("\nEncoded:\n%d", osmo_t4_encode(&bv)); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf(" [%d]\nExpected:\n0 11011110 10001000 01110101 01100101 100 [35]\n", bv.cur_bit); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xDE887565, 32); - bitvec_set_uint(&bv, 4, 3); + bitvec_set_u64(&bv, 0xDE887565, 32, false); + bitvec_set_u64(&bv, 4, 3, false); bitvec_to_string_r(&bv, lol); printf(" %s [%d]\n", lol, bv.cur_bit); printf("\nTEST2:\n 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00\n"); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xFFFFFFFF, 32); - bitvec_set_uint(&bv, 0xFFFFFFFF, 32); - bitvec_set_uint(&bv, 0xFFFFFC00, 26); bitvec_to_string_r(&bv, lol); printf("%s", lol); + bitvec_set_u64(&bv, 0xFFFFFFFF, 32, false); + bitvec_set_u64(&bv, 0xFFFFFFFF, 32, false); + bitvec_set_u64(&bv, 0xFFFFFC00, 26, false); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf("\nEncoded:\n%d", osmo_t4_encode(&bv)); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf(" [%d]\nExpected:\n1 11011101 01000001 00 [18]\n", bv.cur_bit); diff --git a/tests/bitvec/bitvec_test.c b/tests/bitvec/bitvec_test.c index d0bc30c..15c0f2b 100644 --- a/tests/bitvec/bitvec_test.c +++ b/tests/bitvec/bitvec_test.c @@ -88,11 +88,11 @@ /* Write to bitvec */ memset(data, 0x00, sizeof(data)); bv.cur_bit = i; - rc = bitvec_set_uint(&bv, 0x7e, 8); + rc = bitvec_set_u64(&bv, 0x7e, 8, false); OSMO_ASSERT(rc >= 0); rc = bitvec_set_bytes(&bv, in, in_size); OSMO_ASSERT(rc >= 0); - rc = bitvec_set_uint(&bv, 0x7e, 8); + rc = bitvec_set_u64(&bv, 0x7e, 8, false); OSMO_ASSERT(rc >= 0); printf("bitvec: %s\n", osmo_hexdump(bv.data, bv.data_len)); @@ -193,29 +193,29 @@ printf("test shifting...\n"); - bitvec_set_uint(&bv, 0x0E, 7); + bitvec_set_u64(&bv, 0x0E, 7, false); test_shift(&bv, 3); test_shift(&bv, 17); - bitvec_set_uint(&bv, 0, 32); - bitvec_set_uint(&bv, 0x0A, 7); + bitvec_set_u64(&bv, 0, 32, false); + bitvec_set_u64(&bv, 0x0A, 7, false); test_shift(&bv, 24); printf("checking RL functions...\n"); bitvec_zero(&bv); test_rl(&bv); - bitvec_set_uint(&bv, 0x000F, 32); + bitvec_set_u64(&bv, 0x000F, 32, false); test_rl(&bv); bitvec_shiftl(&bv, 18); test_rl(&bv); - bitvec_set_uint(&bv, 0x0F, 8); + bitvec_set_u64(&bv, 0x0F, 8, false); test_rl(&bv); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xFF, 8); + bitvec_set_u64(&bv, 0xFF, 8, false); test_rl(&bv); - bitvec_set_uint(&bv, 0xFE, 7); + bitvec_set_u64(&bv, 0xFE, 7, false); test_rl(&bv); - bitvec_set_uint(&bv, 0, 17); + bitvec_set_u64(&bv, 0, 17, false); test_rl(&bv); bitvec_shiftl(&bv, 18); test_rl(&bv); @@ -223,7 +223,7 @@ printf("probing bit access...\n"); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0x3747817, 32); + bitvec_set_u64(&bv, 0x3747817, 32, false); bitvec_shiftl(&bv, 10); test_get(&bv, 2); @@ -260,12 +260,12 @@ printf("\nbitvec_runlength....\n"); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xff, 8); + bitvec_set_u64(&bv, 0xff, 8, false); bv.cur_bit -= 8; test_bitvec_rl_curbit(&bv, 1, 64, 8); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xfc, 8); + bitvec_set_u64(&bv, 0xfc, 8, false); bv.cur_bit -= 8; test_bitvec_rl_curbit(&bv, 1, 64, 6); @@ -273,13 +273,13 @@ test_bitvec_rl_curbit(&bv, 0, 52, 52); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xfc, 8); + bitvec_set_u64(&bv, 0xfc, 8, false); bv.cur_bit -= 2; test_bitvec_rl_curbit(&bv, 0, 64, 58); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0x07, 8); - bitvec_set_uint(&bv, 0xf8, 8); + bitvec_set_u64(&bv, 0x07, 8, false); + bitvec_set_u64(&bv, 0xf8, 8, false); bv.cur_bit -= 11; test_bitvec_rl_curbit(&bv, 1, 64, 8); -- To view, visit https://gerrit.osmocom.org/4338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2fd8d17f9fa6c51ef51f4294882cca5944d71df2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 18 13:06:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 13:06:14 +0000 Subject: [PATCH] libosmocore[master]: Simplify bitvec_write_field() Message-ID: Review at https://gerrit.osmocom.org/4339 Simplify bitvec_write_field() Use existing function instead of copy-pasted loop. Change-Id: I9fe27c06125ac52e02e63dcded056a5f1cf68f41 Related: OS#1526 --- M src/bitvec.c 1 file changed, 7 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/39/4339/1 diff --git a/src/bitvec.c b/src/bitvec.c index 5b742fc..0683694 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -505,18 +505,16 @@ */ int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) { - unsigned int i; int rc; + bv->cur_bit = *write_index; - for (i = 0; i < len; i++) { - int bit = 0; - if (val & ((uint64_t)1 << (len - i - 1))) - bit = 1; - rc = bitvec_set_bit(bv, bit); - if (rc) - return rc; - } + + rc = bitvec_set_u64(bv, val, len, false); + if (rc != 0) + return rc; + *write_index += len; + return 0; } -- To view, visit https://gerrit.osmocom.org/4339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9fe27c06125ac52e02e63dcded056a5f1cf68f41 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 18 13:14:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 13:14:26 +0000 Subject: [PATCH] libosmocore[master]: Expand bitvec_write_field() function In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4292 to look at the new patch set (#3). Expand bitvec_write_field() function Previously only boolean values were allowed while in practice it's sometimes necessary to use L/H. Allow user to specify this explicitly and make old function into wrapper around extended version. Use extended function in tests and update output accordingly. Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Related: OS#1526 --- M include/osmocom/core/bitvec.h M src/bitvec.c M tests/bits/bitfield_test.c M tests/bits/bitfield_test.ok 4 files changed, 22 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/4292/3 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 3e68ddb..b7eba1f 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -72,6 +72,7 @@ unsigned int bitvec_unpack(struct bitvec *bv, const uint8_t *buffer); uint64_t bitvec_read_field(struct bitvec *bv, unsigned int *read_index, unsigned int len); int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len); +int bitvec_write_field_ext(struct bitvec *bv, uint32_t *write_index, uint64_t val, uint8_t len, bool use_lh); int bitvec_fill(struct bitvec *bv, unsigned int num_bits, enum bit_value fill); char bit_value_to_char(enum bit_value v); void bitvec_to_string_r(const struct bitvec *bv, char *str); diff --git a/src/bitvec.c b/src/bitvec.c index 0683694..646594b 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -500,16 +500,18 @@ /*! write into the vector * \param[in] bv The boolean vector to work on * \param[in,out] write_index Where writing supposed to start in the vector + * \param[in] val value to be written to the vector * \param[in] len How many bits to write + * \param[in] use_lh whether to interpret the bits as L/H values or as 0/1 * \returns next write index or negative value on error */ -int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) +int bitvec_write_field_ext(struct bitvec *bv, uint32_t *write_index, uint64_t val, uint8_t len, bool use_lh) { int rc; bv->cur_bit = *write_index; - rc = bitvec_set_u64(bv, val, len, false); + rc = bitvec_set_u64(bv, val, len, use_lh); if (rc != 0) return rc; @@ -518,6 +520,18 @@ return 0; } +/*! write into the vector + * \param[in] bv The boolean vector to work on + * \param[in,out] write_index Where writing supposed to start in the vector + * \param[in] val value to be written to the vector + * \param[in] len How many bits to write + * \returns next write index or negative value on error + */ +int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) +{ + return bitvec_write_field_ext(bv, (uint32_t *)write_index, val, len, false); +} + /*! convert enum to corresponding character * \param v input value (bit) * \return single character, either 0, 1, L or H */ diff --git a/tests/bits/bitfield_test.c b/tests/bits/bitfield_test.c index 0a86e1f..e7023f7 100644 --- a/tests/bits/bitfield_test.c +++ b/tests/bits/bitfield_test.c @@ -19,10 +19,7 @@ INTRO(use_lh); /* GSM 04.08 10.5.2.16 IA Rest Octets */ - if (use_lh) /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ - else - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field_ext(dest, &wp, 3, 2, use_lh); /* "HH" */ bitvec_write_field(dest, &wp, 1, 2); /* "01" Packet Downlink Assignment */ bitvec_write_field(dest, &wp, ttli, 32); /* TLLI */ bitvec_write_field(dest, &wp, 1, 1); /* switch TFI: on */ @@ -35,10 +32,7 @@ bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ bitvec_write_field(dest, &wp, 0, 1); /* TBF Starting TIME present */ bitvec_write_field(dest, &wp, 0, 1); /* P0 not present */ - if (use_lh) { /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ - } else - bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + bitvec_write_field_ext(dest, &wp, 1, 1, use_lh); /* "H" - additional for R99 */ bitvec_write_field(dest, &wp, ws_enc, 5); /* EGPRS Window Size */ bitvec_write_field(dest, &wp, 0, 2); /* LINK_QUALITY_MEASUREMENT_MODE */ bitvec_write_field(dest, &wp, 0, 1); /* BEP_PERIOD2 not present */ @@ -56,10 +50,7 @@ INTRO(use_lh); /* GMS 04.08 10.5.2.37b 10.5.2.16 */ - if (use_lh) /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ - else - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field_ext(dest, &wp, 3, 2, use_lh); /* "HH" */ bitvec_write_field(dest, &wp, 0, 2); /* "0" Packet Uplink Assignment */ if (!tbf) { bitvec_write_field(dest, &wp, 0, 1); /* Block Allocation: SBA */ diff --git a/tests/bits/bitfield_test.ok b/tests/bits/bitfield_test.ok index f920a11..cd863cf 100644 --- a/tests/bits/bitfield_test.ok +++ b/tests/bits/bitfield_test.ok @@ -4,12 +4,12 @@ === start test_bitvec_ia_octet_encode_pkt_dl_ass(1) === -Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 20 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b === end test_bitvec_ia_octet_encode_pkt_dl_ass(1) === === start test_bitdiff(22) === -=== total 0 bits differ === +=== total 1 bits differ === === end test_bitdiff(22) === -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Wed Oct 18 13:15:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 13:15:22 +0000 Subject: [PATCH] libosmocore[master]: Expand bitvec_write_field() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4292 to look at the new patch set (#4). Expand bitvec_write_field() Previously only boolean values were allowed while in practice it's sometimes necessary to use L/H. Allow user to specify this explicitly and make old function into wrapper around extended version. Use extended function in tests and update output accordingly. Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Related: OS#1526 --- M include/osmocom/core/bitvec.h M src/bitvec.c M tests/bits/bitfield_test.c M tests/bits/bitfield_test.ok 4 files changed, 22 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/4292/4 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 3e68ddb..b7eba1f 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -72,6 +72,7 @@ unsigned int bitvec_unpack(struct bitvec *bv, const uint8_t *buffer); uint64_t bitvec_read_field(struct bitvec *bv, unsigned int *read_index, unsigned int len); int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len); +int bitvec_write_field_ext(struct bitvec *bv, uint32_t *write_index, uint64_t val, uint8_t len, bool use_lh); int bitvec_fill(struct bitvec *bv, unsigned int num_bits, enum bit_value fill); char bit_value_to_char(enum bit_value v); void bitvec_to_string_r(const struct bitvec *bv, char *str); diff --git a/src/bitvec.c b/src/bitvec.c index 0683694..646594b 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -500,16 +500,18 @@ /*! write into the vector * \param[in] bv The boolean vector to work on * \param[in,out] write_index Where writing supposed to start in the vector + * \param[in] val value to be written to the vector * \param[in] len How many bits to write + * \param[in] use_lh whether to interpret the bits as L/H values or as 0/1 * \returns next write index or negative value on error */ -int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) +int bitvec_write_field_ext(struct bitvec *bv, uint32_t *write_index, uint64_t val, uint8_t len, bool use_lh) { int rc; bv->cur_bit = *write_index; - rc = bitvec_set_u64(bv, val, len, false); + rc = bitvec_set_u64(bv, val, len, use_lh); if (rc != 0) return rc; @@ -518,6 +520,18 @@ return 0; } +/*! write into the vector + * \param[in] bv The boolean vector to work on + * \param[in,out] write_index Where writing supposed to start in the vector + * \param[in] val value to be written to the vector + * \param[in] len How many bits to write + * \returns next write index or negative value on error + */ +int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) +{ + return bitvec_write_field_ext(bv, (uint32_t *)write_index, val, len, false); +} + /*! convert enum to corresponding character * \param v input value (bit) * \return single character, either 0, 1, L or H */ diff --git a/tests/bits/bitfield_test.c b/tests/bits/bitfield_test.c index 0a86e1f..e7023f7 100644 --- a/tests/bits/bitfield_test.c +++ b/tests/bits/bitfield_test.c @@ -19,10 +19,7 @@ INTRO(use_lh); /* GSM 04.08 10.5.2.16 IA Rest Octets */ - if (use_lh) /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ - else - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field_ext(dest, &wp, 3, 2, use_lh); /* "HH" */ bitvec_write_field(dest, &wp, 1, 2); /* "01" Packet Downlink Assignment */ bitvec_write_field(dest, &wp, ttli, 32); /* TLLI */ bitvec_write_field(dest, &wp, 1, 1); /* switch TFI: on */ @@ -35,10 +32,7 @@ bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ bitvec_write_field(dest, &wp, 0, 1); /* TBF Starting TIME present */ bitvec_write_field(dest, &wp, 0, 1); /* P0 not present */ - if (use_lh) { /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ - } else - bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + bitvec_write_field_ext(dest, &wp, 1, 1, use_lh); /* "H" - additional for R99 */ bitvec_write_field(dest, &wp, ws_enc, 5); /* EGPRS Window Size */ bitvec_write_field(dest, &wp, 0, 2); /* LINK_QUALITY_MEASUREMENT_MODE */ bitvec_write_field(dest, &wp, 0, 1); /* BEP_PERIOD2 not present */ @@ -56,10 +50,7 @@ INTRO(use_lh); /* GMS 04.08 10.5.2.37b 10.5.2.16 */ - if (use_lh) /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ - else - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field_ext(dest, &wp, 3, 2, use_lh); /* "HH" */ bitvec_write_field(dest, &wp, 0, 2); /* "0" Packet Uplink Assignment */ if (!tbf) { bitvec_write_field(dest, &wp, 0, 1); /* Block Allocation: SBA */ diff --git a/tests/bits/bitfield_test.ok b/tests/bits/bitfield_test.ok index f920a11..cd863cf 100644 --- a/tests/bits/bitfield_test.ok +++ b/tests/bits/bitfield_test.ok @@ -4,12 +4,12 @@ === start test_bitvec_ia_octet_encode_pkt_dl_ass(1) === -Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 20 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b === end test_bitvec_ia_octet_encode_pkt_dl_ass(1) === === start test_bitdiff(22) === -=== total 0 bits differ === +=== total 1 bits differ === === end test_bitdiff(22) === -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Wed Oct 18 13:31:29 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 13:31:29 +0000 Subject: [PATCH] osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4334 to look at the new patch set (#2). mgcp: use osmo-mgw to switch RTP streams osmo-bsc currently negotiates the RTP stream directly with the BTS and reports back the RTP IP/Port on the BTS. This works fine for a single BTS, but for Handover the port/ip pointing to the MSC side must not change, so an entity in between the BTSs and the MSC is required. Integrate the mgcp-client and use osmo-mgw to switch the RTP streams. TODO: Handover will not work yet, because there is no functionality to update the connection with the port/ip of the new BTS. Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/osmo_bsc.h A include/osmocom/bsc/osmo_bsc_mgcp.h M src/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c A src/osmo-bsc/osmo_bsc_mgcp.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c 13 files changed, 1,035 insertions(+), 67 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/34/4334/2 diff --git a/configure.ac b/configure.ac index 4edbb83..f73f33c 100644 --- a/configure.ac +++ b/configure.ac @@ -47,8 +47,9 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) +PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 1.0.0) dnl checks for header files AC_HEADER_STDC @@ -135,7 +136,6 @@ src/libfilter/Makefile src/libcommon-cs/Makefile src/osmo-bsc/Makefile - src/osmo-bsc_nat/Makefile src/ipaccess/Makefile src/utils/Makefile tests/Makefile diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 8ad2b5d..1f7cd39 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -41,6 +41,7 @@ openbscdefines.h \ osmo_bsc.h \ osmo_bsc_grace.h \ + osmo_bsc_mgcp.h \ osmo_bsc_rf.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 51b2c98..5cb7efd 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -479,6 +479,11 @@ uint8_t t3212; struct { + struct mgcp_client_conf *conf; + struct mgcp_client *client; + } mgw; + + struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; /* A list with the context information about diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h index 5ebea50..addad46 100644 --- a/include/osmocom/bsc/osmo_bsc.h +++ b/include/osmocom/bsc/osmo_bsc.h @@ -28,6 +28,21 @@ uint16_t cic; uint32_t rtp_ip; int rtp_port; + uint16_t rtp_endpoint; + + /* RTP address of the remote end (assigned by MSC through assignment + * request) */ + struct sockaddr_storage aoip_rtp_addr_remote; + + /* Local RTP address (reported back to the MSC by us with the + * assignment complete message) */ + struct sockaddr_storage aoip_rtp_addr_local; + + /* storage to keep states of the MGCP connection handler, the + * handler is created when an assignment request is received + * and is terminated when the assignment complete message is + * sent */ + struct mgcp_ctx *mgcp_ctx; /* for advanced ping/pong */ int send_ping; @@ -72,4 +87,6 @@ struct llist_head *bsc_access_lists(void); +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan); + #endif diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h new file mode 100644 index 0000000..da40fdb --- /dev/null +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -0,0 +1,44 @@ +/* (C) 2017 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +/* MGCP state handler context (fsm etc..) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* A human readable name to display in the logs */ + char name[256]; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + int chan_mode; + int full_rate; + struct gsm_lchan *lchan; + struct msgb *resp; +}; + +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct gsm_network *network, + struct osmo_bsc_sccp_con *conn, int chan_mode, int full_rate); +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan); diff --git a/src/Makefile.am b/src/Makefile.am index d04f025..dd1ad3d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,5 +33,4 @@ utils \ ipaccess \ osmo-bsc \ - osmo-bsc_nat \ $(NULL) diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index dfc4def..7db698c 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -15,6 +15,7 @@ $(COVERAGE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -30,6 +31,7 @@ osmo_bsc_vty.c \ osmo_bsc_api.c \ osmo_bsc_grace.c \ + osmo_bsc_mgcp.c \ osmo_bsc_msc.c \ osmo_bsc_sigtran.c \ osmo_bsc_filter.c \ @@ -53,4 +55,5 @@ $(COVERAGE_LDFLAGS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(NULL) diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index 94aa350..326703d 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -29,46 +29,9 @@ #include #include #include +#include #include - -/* Generate and send assignment complete message */ -static int send_aoip_ass_compl(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan) -{ - struct msgb *resp; - struct sockaddr_storage rtp_addr; - struct sockaddr_in rtp_addr_in; - struct gsm0808_speech_codec sc; - - OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); - - /* Package RTP-Address data */ - memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); - rtp_addr_in.sin_family = AF_INET; - rtp_addr_in.sin_port = htons(lchan->abis_ip.bound_port); - rtp_addr_in.sin_addr.s_addr = htonl(lchan->abis_ip.bound_ip); - memset(&rtp_addr, 0, sizeof(rtp_addr)); - memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); - - /* Extrapolate speech codec from speech mode */ - gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); - - /* Generate message */ - resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, - lchan->abis_ip.ass_compl.chosen_channel, - lchan->abis_ip.ass_compl.encr_alg_id, - lchan->abis_ip.ass_compl.speech_mode, - &rtp_addr, - &sc, - NULL); - - if (!resp) { - LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ - return -EINVAL; - } - - return osmo_bsc_sigtran_send(conn->sccp_con, resp); -} static int handle_abisip_signal(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) @@ -124,11 +87,9 @@ * IPA based base stations. See also osmo_bsc_api.c, * function bsc_assign_compl() */ LOGP(DMSC, LOGL_INFO, "Tx MSC ASSIGN COMPL (POSTPONED)\n"); - if (send_aoip_ass_compl(con, lchan) != 0) - return -EINVAL; + mgcp_ass_complete(con->sccp_con->mgcp_ctx, lchan); } break; - break; } return 0; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 4311250..320c0ef 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -24,7 +24,8 @@ #include #include #include -#include +#include +#include #include #include @@ -321,14 +322,29 @@ conn->conn = NULL; } - /* send the clear complete message */ + /* generate the clear complete message */ resp = gsm0808_create_clear_complete(); if (!resp) { LOGP(DMSC, LOGL_ERROR, "Sending clear complete failed.\n"); return -1; } - osmo_bsc_sigtran_send(conn, resp); + if (conn->mgcp_ctx) { + /* NOTE: This is the AoIP case, osmo-bsc has to negotiate with + * the MGCP-GW. For this an mgcp_ctx should be created that + * contains the FSM and some system data. When the connection + * is removed from the MGCP-GW, then osmo_bsc_sigtran_send() + * calls osmo_bsc_sigtran_send(). */ + mgcp_clear_complete(conn->mgcp_ctx, resp); + conn->mgcp_ctx = NULL; + } else { + /* NOTE: This is the SCCP-Lite case, since we do not handle + * the MGCP-GW switching ourselves, we may skip everything + * that is MGCP-GW related and sent the clear complete message + * directly */ + osmo_bsc_sigtran_send(conn, resp); + } + return 0; } @@ -426,7 +442,6 @@ int port, full_rate = -1; bool aoip = false; struct sockaddr_storage rtp_addr; - struct sockaddr_in *rtp_addr_in; struct gsm0808_channel_type ct; struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; @@ -531,29 +546,35 @@ get_value_string(gsm48_chan_mode_names, chan_mode), ct.ch_indctr, ct.ch_rate_type, osmo_hexdump(ct.perm_spch, ct.perm_spch_len)); - if (aoip == false) { - /* map it to a MGCP Endpoint and a RTP port */ + /* Forward the assingment request to lower layers */ + if (aoip) { + /* Store network side RTP connection information, we will + * process this address later after we have established an RTP + * connection to the BTS. This is just for organizational + * reasons, functional wise it would not matter when exactly + * the network side RTP connection is made, as long it is made + * before we return with the assignment complete message. */ + memcpy(&conn->aoip_rtp_addr_remote, &rtp_addr, sizeof(rtp_addr)); + + /* Create an assignment request using the MGCP fsm. This FSM + * is directly started when its created (now) and will also + * take care about the further processing (creating RTP + * endpoints, calling gsm0808_assign_req(), rsponding to + * the assignment request etc... */ + conn->mgcp_ctx = mgcp_assignm_req(conn, msc->network, conn, chan_mode, full_rate); + if (!conn->mgcp_ctx) + goto reject; + } else { + /* Note: In the sccp-lite case we to not perform any mgcp operation, + * (the MSC does that for us). We set conn->rtp_ip to 0 and check + * on this later. By this we know that we have to behave accordingly + * to sccp-lite. */ port = mgcp_timeslot_to_endpoint(multiplex, timeslot); conn->rtp_port = rtp_calculate_port(port, msc->rtp_base); conn->rtp_ip = 0; - } else { - /* use address / port supplied with the AoIP - * transport address element */ - if (rtp_addr.ss_family == AF_INET) { - rtp_addr_in = (struct sockaddr_in *)&rtp_addr; - conn->rtp_port = osmo_ntohs(rtp_addr_in->sin_port); - memcpy(&conn->rtp_ip, &rtp_addr_in->sin_addr.s_addr, - IP_V4_ADDR_LEN); - conn->rtp_ip = osmo_ntohl(conn->rtp_ip); - } else { - LOGP(DMSC, LOGL_ERROR, - "Unsopported addressing scheme. (supports only IPV4)\n"); - goto reject; - } + return gsm0808_assign_req(conn->conn, chan_mode, full_rate); } - - return gsm0808_assign_req(conn->conn, chan_mode, full_rate); - + reject: resp = gsm0808_create_assignment_failure @@ -729,3 +750,38 @@ return -1; } + +/* Generate and send assignment complete message */ +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan) +{ + struct msgb *resp; + struct gsm0808_speech_codec sc; + struct gsm_subscriber_connection *conn; + + conn = lchan->conn; + + OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); + OSMO_ASSERT(conn); + OSMO_ASSERT(conn->sccp_con); + + LOGP(DMSC, LOGL_NOTICE, "Sending assignment complete message...\n"); + + /* Extrapolate speech codec from speech mode */ + gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); + + /* Generate message */ + resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, + lchan->abis_ip.ass_compl.chosen_channel, + lchan->abis_ip.ass_compl.encr_alg_id, + lchan->abis_ip.ass_compl.speech_mode, + &conn->sccp_con->aoip_rtp_addr_local, + &sc, + NULL); + + if (!resp) { + LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ + return -EINVAL; + } + + return osmo_bsc_sigtran_send(conn->sccp_con, resp); +} diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 5e8f45e..5386bfe 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -44,6 +44,7 @@ #include #include +#include #define _GNU_SOURCE #include @@ -203,6 +204,9 @@ exit(1); } + bsc_gsmnet->mgw.conf = talloc_zero(bsc_gsmnet, struct mgcp_client_conf); + mgcp_client_conf_init(bsc_gsmnet->mgw.conf); + osmo_init_logging(&log_info); osmo_stats_init(tall_bsc_ctx); @@ -274,6 +278,13 @@ } } + bsc_gsmnet->mgw.client = mgcp_client_init(bsc_gsmnet, bsc_gsmnet->mgw.conf); + + if (mgcp_client_connect(bsc_gsmnet->mgw.client)) { + printf("MGCPGW connect failed\n"); + exit(1); + } + if (osmo_bsc_sigtran_init(&bsc_gsmnet->bsc_data->mscs) != 0) { LOGP(DNM, LOGL_ERROR, "Failed to initalize sigtran backhaul.\n"); exit(1); diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c new file mode 100644 index 0000000..4d02ff0b --- /dev/null +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -0,0 +1,864 @@ +/* (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define CONN_ID_BTS 1 +#define CONN_ID_NET 2 + +#define MGCP_MGW_TIMEOUT 4 /* sek */ +#define MGCP_MGW_TIMEOUT_TIMER_NO 7411 +#define MGCP_BSS_TIMEOUT 4 /* sek */ +#define MGCP_BSS_TIMEOUT_TIMER_NO 7412 + +#define MGCP_ENDPOINT_FORMAT "%i at mgw" + +extern struct gsm_network *bsc_gsmnet; + +enum fsm_states { + /* Initalization state to start the FSM */ + ST_CRCX_BTS, + + /* Send CRCX for BTS and wait for response */ + ST_ASSIGN_PROC, + + /* Wait for the BSS to setup the connection */ + ST_MDCX_BTS, + + /* Send MDCX for BTS and wait for response */ + ST_CRCX_NET, + + /* Send CRCX (single phase) for NET and wait for response */ + ST_ASSIGN_COMPL, + + /* Call is now active, wait for call end */ + ST_DLCX, + + /* Send DLCX for BTS/NET and wait for response */ + ST_HALT, +}; + +static const struct value_string fsm_state_names[] = { + {ST_CRCX_BTS, "ST_CRCX_BTS (initalize FSM)"}, + {ST_ASSIGN_PROC, "ST_ASSIGN_PROC (create BTS connection)"}, + {ST_MDCX_BTS, "ST_MDCX_BTS (wait for BSS)"}, + {ST_CRCX_NET, "ST_CRCX_NET (update BTS connection)"}, + {ST_ASSIGN_COMPL, "ST_ASSIGN_COMPL (create NET connection)"}, + {ST_ASSIGN_COMPL, "ST_HALT (delete BTS/ connection)"}, + {ST_DLCX, "ST_DLCX (wait for call end)"}, + {0, NULL}, +}; + +enum fsm_evt { + /* Initial event: start off the state machine */ + EV_INIT, + + /* External event: Assignment complete, event is issued shortly before + * the assignment complete message is sent via the A-Interface */ + EV_ASS_COMPLETE, + + /* External event: Teardown event, this event is used to notify the end + * of a. It is also issued in case of errors to teardown a half open + * connection. */ + EV_TEARDOWN, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the BTS side */ + EV_CRCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the BTS side */ + EV_MDCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the NET side */ + EV_CRCX_NET_RESP, + + /* Internal event: The mgcp_gw has sent its DLCX response for + * the NET and BTS side */ + EV_DLCX_ALL_RESP, +}; + +static const struct value_string fsm_evt_names[] = { + {EV_INIT, "EV_INIT (start state machine (send CRCX for BTS)"}, + {EV_ASS_COMPLETE, "EV_ASS_COMPLETE (assignment complete)"}, + {EV_TEARDOWN, "EV_TEARDOWN (teardown all connections)"}, + {EV_CRCX_BTS_RESP, "EV_CRCX_BTS_RESP (got CRCX reponse for BTS)"}, + {EV_MDCX_BTS_RESP, "EV_MDCX_BTS_RESP (got MDCX reponse for BTS)"}, + {EV_CRCX_NET_RESP, "EV_CRCX_NET_RESP (got CRCX reponse for NET)"}, + {EV_DLCX_ALL_RESP, "EV_DLCX_ALL_RESP (got DLCX reponse for BTS/NET)"}, + {0, NULL}, +}; + +/* On error, go directly to the DLCX phase. */ +static void on_error_goto_dlcx(struct mgcp_ctx *mgcp_ctx) +{ + /* This function forces the FSM into the DLCX phase. The FSM will just + * behave like the call were ended normally. */ + + struct osmo_fsm_inst *fi; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + fi = mgcp_ctx->fsm; + OSMO_ASSERT(fi); + + LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state)); + + LOGP(DMGCP, LOGL_ERROR, "(%s) MGCPGW error proceeding request, graceful shutdown...\n", mgcp_ctx->name); + + /* Set the VM into the state where it waits for the call end */ + osmo_fsm_inst_state_chg(fi, ST_DLCX, 0, 0); + + /* Simulate the call end by sending a teardown event, so that + * the FSM proceeds directly with the DLCX */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +/* Forward declaration to keep the function in logical order */ +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_BTS: startup state machine send out CRCX for BTS side */ +static void fsm_crcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_client_next_endpoint(mgcp); + conn->rtp_endpoint = rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) creating connection for the BTS side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); + snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_BTS; + mgcp_msg.conn_mode = MGCP_CONN_LOOPBACK; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Note: if transmitting fails, receiving will also fail which eventually + * will cause the error be handled by the timeout callback */ + mgcp_client_tx(mgcp, msg, crcx_for_bts_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_PROC, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for BTS associated CRCX */ +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) CRCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse CRCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) CRCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + /* Set the connection details in the conn struct. The code that + * controls the BTS via RSL will take these values and signal them + * to the BTS via RSL/IPACC */ + conn->rtp_port = r->audio_port; + conn->rtp_ip = osmo_ntohl(inet_addr(r->audio_ip)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_BTS_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_PROC: An mgcp response has been received, proceed + * with the assignment request */ +static void fsm_proc_assignmnent_req_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + int chan_mode; + int full_rate; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + OSMO_ASSERT(conn->conn); + chan_mode = mgcp_ctx->chan_mode; + full_rate = mgcp_ctx->full_rate; + + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MGCPGW proceeding assignment request...\n", mgcp_ctx->name); + rc = gsm0808_assign_req(conn->conn, chan_mode, full_rate); + + if (rc < 0) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_BTS, MGCP_BSS_TIMEOUT, MGCP_BSS_TIMEOUT_TIMER_NO); +} + +/* Forward declaration to keep the function in logical order */ +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_BTS: When the BSS has completed the assignment, + * proceed with updating the connection for the BTS side */ +static void fsm_mdcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + struct in_addr addr; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + network = mgcp_ctx->network; + OSMO_ASSERT(network); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) MGCPGW BSS has completed the assignment, now prceed with MDCX towards BTS...\n", + mgcp_ctx->name); + + rtp_endpoint = conn->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) completing connection for the BTS side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip); + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) BTS expects RTP input on address %s:%u\n", + mgcp_ctx->name, inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_BTS; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + mgcp_msg.audio_ip = inet_ntoa(addr); + mgcp_msg.audio_port = lchan->abis_ip.bound_port; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, mdcx_for_bts_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_CRCX_NET, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for BTS associated MDCX */ +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct in_addr addr; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) MDCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse MDCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) MDCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + addr.s_addr = lchan->abis_ip.bound_ip; + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) MDCX corresponding lchan has been bound to address %s:%u\n", + mgcp_ctx->name, inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_BTS_RESP, mgcp_ctx); +} + +/* Forward declaration to keep the function in logical order */ +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_NET: An mgcp response has been received, proceed... */ +static void fsm_crcx_net_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + struct sockaddr_in *sin; + char *addr; + uint16_t port; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = conn->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) creating connection for the NET side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* Currently we only have support for IPv4 in our MGCP software, the + * AoIP part is ready to support IPv6 in theory, because the IE + * parser/generator uses sockaddr_storage for the AoIP transport + * identifier. However, the MGCP-GW does not support IPv6 yet. This is + * why we stop here in case some MSC tries to signal IPv6 AoIP + * transport identifiers */ + if (conn->aoip_rtp_addr_remote.ss_family != AF_INET) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW (%s) endpoint:%x MSC uses unsupported address format in AoIP transport identifier -- aborting...\n", + mgcp_ctx->name, rtp_endpoint); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_remote; + addr = inet_ntoa(sin->sin_addr); + port = osmo_ntohs(sin->sin_port); + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MSC expects RTP input on address %s:%u\n", mgcp_ctx->name, addr, port); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_NET; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + mgcp_msg.audio_ip = addr; + mgcp_msg.audio_port = port; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, crcx_for_net_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct sockaddr_in *sin; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) CRCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse CRCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) CRCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + /* Store address */ + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_local; + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = inet_addr(r->audio_ip); + sin->sin_port = osmo_ntohs(r->audio_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_NET_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_COMPL: Send back assignment complete and wait until the call ends */ +static void fsm_send_assignment_complete(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_lchan *lchan; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + /* Send assignment completion message via AoIP, this will complete + * the circuit. The message will also contain the port and IP-Address + * where the MGCPGW expects the RTP input from the MSC side */ + bssmap_send_aoip_ass_compl(lchan); + + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) call in progress, waiting for call end...\n", mgcp_ctx->name); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_DLCX, 0, 0); +} + +/* Forward declaration to keep the function in logical order */ +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_DLCX: Remove connection for the BTS and NET side. */ +static void fsm_dlcx_all_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = conn->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) removing connection for the BTS and NET side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* We now relase the endpoint back to the pool in order to allow + * other connections to use this endpoint */ + mgcp_client_release_endpoint(rtp_endpoint, mgcp); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, dlcx_for_all_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_HALT, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + /* Note: We check the return code, but in case of an error there is + * not much that can be done to recover. However, at least we tryed + * to remove the connection (if there was even any) */ + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) DLCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_DLCX_ALL_RESP, mgcp_ctx); +} + +/* Callback for ST_HALT: Terminate the state machine */ +static void fsm_halt_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) timeout (T%i) in state %s, state machine halted\n", + mgcp_ctx->name, fi->T, get_value_string(fsm_state_names, fi->state)); + + /* Send pending sigtran message */ + if (mgcp_ctx->resp) { + osmo_bsc_sigtran_send(conn, mgcp_ctx->resp); + mgcp_ctx->resp = NULL; + } + + /* Destroy the state machine and all context information */ + osmo_fsm_inst_free(mgcp_ctx->fsm); + memset(mgcp_ctx, 0, sizeof(*mgcp_ctx)); + talloc_free(mgcp_ctx); +} + +/* Timer callback to shut down in case of connectivity problems */ +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)fi->priv; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) timeout (T%i) in state %s, attempting graceful teardown...\n", + mgcp_ctx->name, fi->T, get_value_string(fsm_state_names, fi->state)); + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NO) { + /* Note: We were unable to communicate with the MGCP-GW, + * unfortunately there is no meaningful action we can take + * now other than giving up. */ + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) graceful teardown not possible, terminating...\n", mgcp_ctx->name); + + /* At least release the occupied endpoint ID */ + mgcp_client_release_endpoint(conn->rtp_endpoint, mgcp); + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); + } else if (fi->T == MGCP_BSS_TIMEOUT_TIMER_NO) + /* Note: If the logic that controls the BSS is unable to + * negotiate a connection, we presumably still have a + * working connection to the MGCP-GW, we will try to + * shut down gracefully. */ + on_error_goto_dlcx(mgcp_ctx); + else { + /* Note: Ther must not be any unsolicited timers + * in this FSM. If so, we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static struct osmo_fsm_state fsm_states[] = { + + /* Startup state machine, send CRCX to BTS. */ + [ST_CRCX_BTS] = { + .in_event_mask = (1 << EV_INIT), + .out_state_mask = (1 << ST_ASSIGN_PROC), + .name = "ST_CRCX_BTS", + .action = fsm_crcx_bts_cb, + }, + + /* When the CRCX response for the BTS side is received, then + * proceed the assignment on the BSS side. */ + [ST_ASSIGN_PROC] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_MDCX_BTS), + .name = "ST_ASSIGN_PROC", + .action = fsm_proc_assignmnent_req_cb, + }, + + /* When the BSS has processed the assignment request, + * then send the MDCX command for the BTS side in order to + * update the connections with the actual PORT/IP where the + * BTS expects the RTP input. */ + [ST_MDCX_BTS] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_ASS_COMPLETE), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_CRCX_NET), + .name = "ST_MDCX_BTS", + .action = fsm_mdcx_bts_cb, + }, + + /* When the MDCX response for the BTS siede is received, then + * directly proceed with sending the CRCX command to connect the + * network side. This is done in one phase (no MDCX needed). */ + [ST_CRCX_NET] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_MDCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_ASSIGN_COMPL), + .name = "ST_CRCX_NET", + .action = fsm_crcx_net_cb, + }, + + /* When the CRCX response for the NET side is received. Then + * send the assignment complete message via the A-Interface and + * enter wait state in order to wait for the end of the call. */ + [ST_ASSIGN_COMPL] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_NET_RESP), + .out_state_mask = (1 << ST_DLCX), + .name = "ST_ASSIGN_COMPL", + .action = fsm_send_assignment_complete, + }, + + /* When the call ends, remove all RTP connections from the + * MGCP-GW by sending a wildcarded DLCX. */ + [ST_DLCX] = { + .in_event_mask = (1 << EV_TEARDOWN), + .out_state_mask = (1 << ST_HALT), + .name = "ST_DLCX", + .action = fsm_dlcx_all_cb, + }, + + /* When the MGCP_GW confirms that the connections are terminated, + * then halt the state machine. */ + [ST_HALT] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_DLCX_ALL_RESP), + .out_state_mask = 0, + .name = "ST_HALT", + .action = fsm_halt_cb, + }, +}; + +/* State machine definition */ +static struct osmo_fsm fsm = { + .name = "FSM MGCP", + .states = fsm_states, + .num_states = ARRAY_SIZE(fsm_states), + .log_subsys = DMGCP, + .timer_cb = fsm_timeout_cb, +}; + +/* Notify that the a new call begins. This will create a connection for the + * BTS on the MGCP-GW and set up the port numbers in struct osmo_bsc_sccp_con. + * After that gsm0808_assign_req() to proceed. + * Parameter: + * ctx: talloc context + * network: associated gsm network + * conn: associated sccp connection + * chan_mode: channel mode (system data, passed through) + * full_rate: full rate flag (system data, passed through) + * Returns an mgcp_context that contains system data and the OSMO-FSM */ +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct gsm_network *network, + struct osmo_bsc_sccp_con *conn, int chan_mode, int full_rate) +{ + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(network); + OSMO_ASSERT(conn); + + /* Register the fsm description (if not already done) */ + if (osmo_fsm_find_by_name(fsm.name) != &fsm) + osmo_fsm_register(&fsm); + + /* Allocate and configure a new fsm instance */ + mgcp_ctx = talloc_zero(ctx, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + + snprintf(mgcp_ctx->name, sizeof(mgcp_ctx->name), "MGCP FSM, id=%i", conn->conn_id); + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm, NULL, ctx, LOGL_DEBUG, "FSM MGCP INST"); + OSMO_ASSERT(mgcp_ctx->fsm); + mgcp_ctx->fsm->priv = mgcp_ctx; + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MGCPGW handler fsm created\n", mgcp_ctx->name); + mgcp_ctx->network = network; + mgcp_ctx->conn = conn; + mgcp_ctx->chan_mode = chan_mode; + mgcp_ctx->full_rate = full_rate; + + /* start state machine */ + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_CRCX_BTS, 0, 0); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_INIT, mgcp_ctx); + + return mgcp_ctx; +} + +/* Notify that the call has ended, remove all connections from the MGCP-GW, + * then send the clear complete message and destroy the FSM instance + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * respmgcp_ctx: pending clear complete message to send via A-Interface */ +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(resp); + + mgcp_ctx->resp = resp; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +/* Notify that the BSS ready, send the assingnment complete message when the + * mgcp connection is completed + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * lchan: needed for sending the assignment complete message via A-Interface */ +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(lchan); + + mgcp_ctx->lchan = lchan; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASS_COMPLETE, mgcp_ctx); + + return; +} diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 48796c1..cc1f314 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -33,6 +33,7 @@ #include #include #include +#include /* A pointer to a list with all involved MSCs * (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */ diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index 0e7003f..3ee7534 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include @@ -971,6 +973,8 @@ int bsc_vty_init_extra(void) { + struct gsm_network *net = bsc_gsmnet; + install_element(CONFIG_NODE, &cfg_net_msc_cmd); install_element(CONFIG_NODE, &cfg_net_bsc_cmd); @@ -1035,5 +1039,7 @@ install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); + mgcp_client_vty_init(net, MSC_NODE, net->mgw.conf); + return 0; } -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 18 14:03:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Oct 2017 14:03:44 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: vty: various fixes of 'write file' and doc In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4314 to look at the new patch set (#2). osmo-bts-trx: vty: various fixes of 'write file' and doc On 'write file': - Write 'osmotrx' before 'maxdly' and 'maxdlynb' (broken since "Introduce new phy_link and phy_instance abstraction" d784e50747b8cf0ce505489e1451f75be5ccbd4b) - Fix indenting of 'write file' output, command 'osmotrx timing-advance-loop', had a stray space in case there is not a 'no' preceding it. Add some missing instances of OSMOTRX_STR doc strings. examples/osmo-bts.cfg: - Drop 'settsc', the command no longer exists. - Fix indenting of 'osmotrx rx-gain' command. osmo-bts does not feature VTY tests, so it is pointless to add example files to test these fixes. We should probably add VTY tests separately. However, I have briefly tested manually (and hence found all of these issues). Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000 --- M doc/examples/trx/osmo-bts.cfg M src/osmo-bts-trx/trx_vty.c 2 files changed, 10 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/14/4314/2 diff --git a/doc/examples/trx/osmo-bts.cfg b/doc/examples/trx/osmo-bts.cfg index c267fd0..805d929 100644 --- a/doc/examples/trx/osmo-bts.cfg +++ b/doc/examples/trx/osmo-bts.cfg @@ -21,14 +21,13 @@ ! phy 0 instance 0 - osmotrx rx-gain 1 + osmotrx rx-gain 1 osmotrx ip local 127.0.0.1 osmotrx ip remote 127.0.0.1 bts 0 band 1800 ipa unit-id 6969 0 oml remote-ip 192.168.122.1 - settsc gsmtap-sapi ccch gsmtap-sapi pdtch trx 0 diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index a7a433b..1dfc617 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -207,6 +207,7 @@ DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd, "osmotrx maxdly <0-31>", + OSMOTRX_STR "Set the maximum acceptable delay of an Access Burst (in GSM symbols)." " Access Burst is the first burst a mobile transmits in order to establish" " a connection and it is used to estimate Timing Advance (TA) which is" @@ -230,6 +231,7 @@ DEFUN(cfg_phyinst_maxdlynb, cfg_phyinst_maxdlynb_cmd, "osmotrx maxdlynb <0-31>", + OSMOTRX_STR "Set the maximum acceptable delay of a Normal Burst (in GSM symbols)." " USE FOR TESTING ONLY, DON'T CHANGE IN PRODUCTION USE!" " During normal operation, Normal Bursts delay are controled by a Timing" @@ -396,7 +398,8 @@ DEFUN(cfg_phyinst_no_maxdly, cfg_phyinst_no_maxdly_cmd, "no osmotrx maxdly", - NO_STR "Unset the maximum delay of GSM symbols\n") + NO_STR OSMOTRX_STR + "Unset the maximum delay of GSM symbols\n") { struct phy_instance *pinst = vty->index; struct trx_l1h *l1h = pinst->u.osmotrx.hdl; @@ -408,7 +411,8 @@ DEFUN(cfg_phyinst_no_maxdlynb, cfg_phyinst_no_maxdlynb_cmd, "no osmotrx maxdlynb", - NO_STR "Unset the maximum delay of GSM symbols\n") + NO_STR OSMOTRX_STR + "Unset the maximum delay of GSM symbols\n") { struct phy_instance *pinst = vty->index; struct trx_l1h *l1h = pinst->u.osmotrx.hdl; @@ -502,7 +506,7 @@ vty_out(vty, " osmotrx ms-power-loop %d%s", plink->u.osmotrx.trx_target_rssi, VTY_NEWLINE); else vty_out(vty, " no osmotrx ms-power-loop%s", VTY_NEWLINE); - vty_out(vty, " %s osmotrx timing-advance-loop%s", (plink->u.osmotrx.trx_ta_loop) ? "" : "no", VTY_NEWLINE); + vty_out(vty, " %sosmotrx timing-advance-loop%s", (plink->u.osmotrx.trx_ta_loop) ? "" : "no ", VTY_NEWLINE); if (plink->u.osmotrx.base_port_local) vty_out(vty, " osmotrx base-port local %"PRIu16"%s", @@ -535,9 +539,9 @@ l1h->config.power, VTY_NEWLINE); } if (l1h->config.maxdly_valid) - vty_out(vty, " maxdly %d%s", l1h->config.maxdly, VTY_NEWLINE); + vty_out(vty, " osmotrx maxdly %d%s", l1h->config.maxdly, VTY_NEWLINE); if (l1h->config.maxdlynb_valid) - vty_out(vty, " maxdlynb %d%s", l1h->config.maxdlynb, VTY_NEWLINE); + vty_out(vty, " osmotrx maxdlynb %d%s", l1h->config.maxdlynb, VTY_NEWLINE); if (l1h->config.slotmask != 0xff) vty_out(vty, " slotmask %d %d %d %d %d %d %d %d%s", l1h->config.slotmask & 1, -- To view, visit https://gerrit.osmocom.org/4314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 18 14:12:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 14:12:57 +0000 Subject: osmo-bts[master]: osmo-bts-trx: vty: various fixes of 'write file' and doc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 14:14:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 14:14:06 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Add missing DEPENDS libosmo-sccp In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 16:16:24 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Oct 2017 16:16:24 +0000 Subject: [PATCH] osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4334 to look at the new patch set (#3). mgcp: use osmo-mgw to switch RTP streams osmo-bsc currently negotiates the RTP stream directly with the BTS and reports back the RTP IP/Port on the BTS. This works fine for a single BTS, but for Handover the port/ip pointing to the MSC side must not change, so an entity in between the BTSs and the MSC is required. Integrate the mgcp-client and use osmo-mgw to switch the RTP streams. TODO: Handover will not work yet, because there is no functionality to update the connection with the port/ip of the new BTS. Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/osmo_bsc.h A include/osmocom/bsc/osmo_bsc_mgcp.h M src/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c A src/osmo-bsc/osmo_bsc_mgcp.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c 13 files changed, 1,032 insertions(+), 67 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/34/4334/3 diff --git a/configure.ac b/configure.ac index 4edbb83..f73f33c 100644 --- a/configure.ac +++ b/configure.ac @@ -47,8 +47,9 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) +PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 1.0.0) dnl checks for header files AC_HEADER_STDC @@ -135,7 +136,6 @@ src/libfilter/Makefile src/libcommon-cs/Makefile src/osmo-bsc/Makefile - src/osmo-bsc_nat/Makefile src/ipaccess/Makefile src/utils/Makefile tests/Makefile diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 8ad2b5d..1f7cd39 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -41,6 +41,7 @@ openbscdefines.h \ osmo_bsc.h \ osmo_bsc_grace.h \ + osmo_bsc_mgcp.h \ osmo_bsc_rf.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 51b2c98..5cb7efd 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -479,6 +479,11 @@ uint8_t t3212; struct { + struct mgcp_client_conf *conf; + struct mgcp_client *client; + } mgw; + + struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; /* A list with the context information about diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h index 5ebea50..8a5cd30 100644 --- a/include/osmocom/bsc/osmo_bsc.h +++ b/include/osmocom/bsc/osmo_bsc.h @@ -29,6 +29,20 @@ uint32_t rtp_ip; int rtp_port; + /* RTP address of the remote end (assigned by MSC through assignment + * request) */ + struct sockaddr_storage aoip_rtp_addr_remote; + + /* Local RTP address (reported back to the MSC by us with the + * assignment complete message) */ + struct sockaddr_storage aoip_rtp_addr_local; + + /* storage to keep states of the MGCP connection handler, the + * handler is created when an assignment request is received + * and is terminated when the assignment complete message is + * sent */ + struct mgcp_ctx *mgcp_ctx; + /* for advanced ping/pong */ int send_ping; @@ -72,4 +86,6 @@ struct llist_head *bsc_access_lists(void); +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan); + #endif diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h new file mode 100644 index 0000000..3c82f45 --- /dev/null +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -0,0 +1,47 @@ +/* (C) 2017 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +/* MGCP state handler context (fsm etc..) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* A human readable name to display in the logs */ + char name[256]; + + /* RTP endpoint number */ + uint16_t rtp_endpoint; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + int chan_mode; + int full_rate; + struct gsm_lchan *lchan; + struct msgb *resp; +}; + +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct gsm_network *network, + struct osmo_bsc_sccp_con *conn, int chan_mode, int full_rate); +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan); diff --git a/src/Makefile.am b/src/Makefile.am index d04f025..dd1ad3d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,5 +33,4 @@ utils \ ipaccess \ osmo-bsc \ - osmo-bsc_nat \ $(NULL) diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index dfc4def..7db698c 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -15,6 +15,7 @@ $(COVERAGE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -30,6 +31,7 @@ osmo_bsc_vty.c \ osmo_bsc_api.c \ osmo_bsc_grace.c \ + osmo_bsc_mgcp.c \ osmo_bsc_msc.c \ osmo_bsc_sigtran.c \ osmo_bsc_filter.c \ @@ -53,4 +55,5 @@ $(COVERAGE_LDFLAGS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(NULL) diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index 94aa350..326703d 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -29,46 +29,9 @@ #include #include #include +#include #include - -/* Generate and send assignment complete message */ -static int send_aoip_ass_compl(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan) -{ - struct msgb *resp; - struct sockaddr_storage rtp_addr; - struct sockaddr_in rtp_addr_in; - struct gsm0808_speech_codec sc; - - OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); - - /* Package RTP-Address data */ - memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); - rtp_addr_in.sin_family = AF_INET; - rtp_addr_in.sin_port = htons(lchan->abis_ip.bound_port); - rtp_addr_in.sin_addr.s_addr = htonl(lchan->abis_ip.bound_ip); - memset(&rtp_addr, 0, sizeof(rtp_addr)); - memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); - - /* Extrapolate speech codec from speech mode */ - gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); - - /* Generate message */ - resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, - lchan->abis_ip.ass_compl.chosen_channel, - lchan->abis_ip.ass_compl.encr_alg_id, - lchan->abis_ip.ass_compl.speech_mode, - &rtp_addr, - &sc, - NULL); - - if (!resp) { - LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ - return -EINVAL; - } - - return osmo_bsc_sigtran_send(conn->sccp_con, resp); -} static int handle_abisip_signal(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) @@ -124,11 +87,9 @@ * IPA based base stations. See also osmo_bsc_api.c, * function bsc_assign_compl() */ LOGP(DMSC, LOGL_INFO, "Tx MSC ASSIGN COMPL (POSTPONED)\n"); - if (send_aoip_ass_compl(con, lchan) != 0) - return -EINVAL; + mgcp_ass_complete(con->sccp_con->mgcp_ctx, lchan); } break; - break; } return 0; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 4311250..a66e803 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -24,7 +24,8 @@ #include #include #include -#include +#include +#include #include #include @@ -321,14 +322,29 @@ conn->conn = NULL; } - /* send the clear complete message */ + /* generate the clear complete message */ resp = gsm0808_create_clear_complete(); if (!resp) { LOGP(DMSC, LOGL_ERROR, "Sending clear complete failed.\n"); return -1; } - osmo_bsc_sigtran_send(conn, resp); + if (conn->mgcp_ctx) { + /* NOTE: This is the AoIP case, osmo-bsc has to negotiate with + * the MGCP-GW. For this an mgcp_ctx should be created that + * contains the FSM and some system data. When the connection + * is removed from the MGCP-GW, then osmo_bsc_sigtran_send() + * calls osmo_bsc_sigtran_send(). */ + mgcp_clear_complete(conn->mgcp_ctx, resp); + conn->mgcp_ctx = NULL; + } else { + /* NOTE: This is the SCCP-Lite case, since we do not handle + * the MGCP-GW switching ourselves, we may skip everything + * that is MGCP-GW related and sent the clear complete message + * directly */ + osmo_bsc_sigtran_send(conn, resp); + } + return 0; } @@ -426,7 +442,6 @@ int port, full_rate = -1; bool aoip = false; struct sockaddr_storage rtp_addr; - struct sockaddr_in *rtp_addr_in; struct gsm0808_channel_type ct; struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; @@ -531,29 +546,35 @@ get_value_string(gsm48_chan_mode_names, chan_mode), ct.ch_indctr, ct.ch_rate_type, osmo_hexdump(ct.perm_spch, ct.perm_spch_len)); - if (aoip == false) { - /* map it to a MGCP Endpoint and a RTP port */ + /* Forward the assingment request to lower layers */ + if (aoip) { + /* Store network side RTP connection information, we will + * process this address later after we have established an RTP + * connection to the BTS. This is just for organizational + * reasons, functional wise it would not matter when exactly + * the network side RTP connection is made, as long it is made + * before we return with the assignment complete message. */ + memcpy(&conn->aoip_rtp_addr_remote, &rtp_addr, sizeof(rtp_addr)); + + /* Create an assignment request using the MGCP fsm. This FSM + * is directly started when its created (now) and will also + * take care about the further processing (creating RTP + * endpoints, calling gsm0808_assign_req(), rsponding to + * the assignment request etc... */ + conn->mgcp_ctx = mgcp_assignm_req(NULL, msc->network, conn, chan_mode, full_rate); + if (!conn->mgcp_ctx) + goto reject; + } else { + /* Note: In the sccp-lite case we to not perform any mgcp operation, + * (the MSC does that for us). We set conn->rtp_ip to 0 and check + * on this later. By this we know that we have to behave accordingly + * to sccp-lite. */ port = mgcp_timeslot_to_endpoint(multiplex, timeslot); conn->rtp_port = rtp_calculate_port(port, msc->rtp_base); conn->rtp_ip = 0; - } else { - /* use address / port supplied with the AoIP - * transport address element */ - if (rtp_addr.ss_family == AF_INET) { - rtp_addr_in = (struct sockaddr_in *)&rtp_addr; - conn->rtp_port = osmo_ntohs(rtp_addr_in->sin_port); - memcpy(&conn->rtp_ip, &rtp_addr_in->sin_addr.s_addr, - IP_V4_ADDR_LEN); - conn->rtp_ip = osmo_ntohl(conn->rtp_ip); - } else { - LOGP(DMSC, LOGL_ERROR, - "Unsopported addressing scheme. (supports only IPV4)\n"); - goto reject; - } + return gsm0808_assign_req(conn->conn, chan_mode, full_rate); } - - return gsm0808_assign_req(conn->conn, chan_mode, full_rate); - + reject: resp = gsm0808_create_assignment_failure @@ -729,3 +750,38 @@ return -1; } + +/* Generate and send assignment complete message */ +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan) +{ + struct msgb *resp; + struct gsm0808_speech_codec sc; + struct gsm_subscriber_connection *conn; + + conn = lchan->conn; + + OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); + OSMO_ASSERT(conn); + OSMO_ASSERT(conn->sccp_con); + + LOGP(DMSC, LOGL_NOTICE, "Sending assignment complete message...\n"); + + /* Extrapolate speech codec from speech mode */ + gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); + + /* Generate message */ + resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, + lchan->abis_ip.ass_compl.chosen_channel, + lchan->abis_ip.ass_compl.encr_alg_id, + lchan->abis_ip.ass_compl.speech_mode, + &conn->sccp_con->aoip_rtp_addr_local, + &sc, + NULL); + + if (!resp) { + LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ + return -EINVAL; + } + + return osmo_bsc_sigtran_send(conn->sccp_con, resp); +} diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 5e8f45e..5386bfe 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -44,6 +44,7 @@ #include #include +#include #define _GNU_SOURCE #include @@ -203,6 +204,9 @@ exit(1); } + bsc_gsmnet->mgw.conf = talloc_zero(bsc_gsmnet, struct mgcp_client_conf); + mgcp_client_conf_init(bsc_gsmnet->mgw.conf); + osmo_init_logging(&log_info); osmo_stats_init(tall_bsc_ctx); @@ -274,6 +278,13 @@ } } + bsc_gsmnet->mgw.client = mgcp_client_init(bsc_gsmnet, bsc_gsmnet->mgw.conf); + + if (mgcp_client_connect(bsc_gsmnet->mgw.client)) { + printf("MGCPGW connect failed\n"); + exit(1); + } + if (osmo_bsc_sigtran_init(&bsc_gsmnet->bsc_data->mscs) != 0) { LOGP(DNM, LOGL_ERROR, "Failed to initalize sigtran backhaul.\n"); exit(1); diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c new file mode 100644 index 0000000..908c4ef --- /dev/null +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -0,0 +1,859 @@ +/* (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define CONN_ID_BTS 1 +#define CONN_ID_NET 2 + +#define MGCP_MGW_TIMEOUT 4 /* sek */ +#define MGCP_MGW_TIMEOUT_TIMER_NO 7411 +#define MGCP_BSS_TIMEOUT 4 /* sek */ +#define MGCP_BSS_TIMEOUT_TIMER_NO 7412 + +#define MGCP_ENDPOINT_FORMAT "%i at mgw" + +extern struct gsm_network *bsc_gsmnet; + +enum fsm_states { + /* Initalization state to start the FSM */ + ST_CRCX_BTS, + + /* Send CRCX for BTS and wait for response */ + ST_ASSIGN_PROC, + + /* Wait for the BSS to setup the connection */ + ST_MDCX_BTS, + + /* Send MDCX for BTS and wait for response */ + ST_CRCX_NET, + + /* Send CRCX (single phase) for NET and wait for response */ + ST_ASSIGN_COMPL, + + /* Call is now active, wait for call end */ + ST_DLCX, + + /* Send DLCX for BTS/NET and wait for response */ + ST_HALT, +}; + +static const struct value_string fsm_state_names[] = { + {ST_CRCX_BTS, "ST_CRCX_BTS (send CRCX for BTS)"}, + {ST_ASSIGN_PROC, "ST_ASSIGN_PROC (conntinue assingment)"}, + {ST_MDCX_BTS, "ST_MDCX_BTS (send MDCX for BTS)"}, + {ST_CRCX_NET, "ST_CRCX_NET (send CRCX for NET)"}, + {ST_ASSIGN_COMPL, "ST_ASSIGN_COMPL (complete assingment)"}, + {ST_DLCX, "ST_DLCX (delete all rtp connections)"}, + {ST_HALT, "ST_HALT (destroy state machine)"}, + {0, NULL}, +}; + +enum fsm_evt { + /* Initial event: start off the state machine */ + EV_INIT, + + /* External event: Assignment complete, event is issued shortly before + * the assignment complete message is sent via the A-Interface */ + EV_ASS_COMPLETE, + + /* External event: Teardown event, this event is used to notify the end + * of a. It is also issued in case of errors to teardown a half open + * connection. */ + EV_TEARDOWN, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the BTS side */ + EV_CRCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the BTS side */ + EV_MDCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the NET side */ + EV_CRCX_NET_RESP, + + /* Internal event: The mgcp_gw has sent its DLCX response for + * the NET and BTS side */ + EV_DLCX_ALL_RESP, +}; + +static const struct value_string fsm_evt_names[] = { + {EV_INIT, "EV_INIT (start state machine (send CRCX for BTS)"}, + {EV_ASS_COMPLETE, "EV_ASS_COMPLETE (assignment complete)"}, + {EV_TEARDOWN, "EV_TEARDOWN (teardown all connections)"}, + {EV_CRCX_BTS_RESP, "EV_CRCX_BTS_RESP (got CRCX reponse for BTS)"}, + {EV_MDCX_BTS_RESP, "EV_MDCX_BTS_RESP (got MDCX reponse for BTS)"}, + {EV_CRCX_NET_RESP, "EV_CRCX_NET_RESP (got CRCX reponse for NET)"}, + {EV_DLCX_ALL_RESP, "EV_DLCX_ALL_RESP (got DLCX reponse for BTS/NET)"}, + {0, NULL}, +}; + +/* On error, go directly to the DLCX phase. */ +static void on_error_goto_dlcx(struct mgcp_ctx *mgcp_ctx) +{ + /* This function forces the FSM into the DLCX phase. The FSM will just + * behave like the call were ended normally. */ + + struct osmo_fsm_inst *fi; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + fi = mgcp_ctx->fsm; + OSMO_ASSERT(fi); + + LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state)); + + LOGP(DMGCP, LOGL_ERROR, "(%s) MGCPGW error proceeding request, graceful shutdown...\n", mgcp_ctx->name); + + /* Set the VM into the state where it waits for the call end */ + osmo_fsm_inst_state_chg(fi, ST_DLCX, 0, 0); + + /* Simulate the call end by sending a teardown event, so that + * the FSM proceeds directly with the DLCX */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +/* Forward declaration to keep the function in logical order */ +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_BTS: startup state machine send out CRCX for BTS side */ +static void fsm_crcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_client_next_endpoint(mgcp); + mgcp_ctx->rtp_endpoint = rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) creating connection for the BTS side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); + snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_BTS; + mgcp_msg.conn_mode = MGCP_CONN_LOOPBACK; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Note: if transmitting fails, receiving will also fail which eventually + * will cause the error be handled by the timeout callback */ + mgcp_client_tx(mgcp, msg, crcx_for_bts_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_PROC, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for BTS associated CRCX */ +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) CRCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse CRCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) CRCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + /* Set the connection details in the conn struct. The code that + * controls the BTS via RSL will take these values and signal them + * to the BTS via RSL/IPACC */ + conn->rtp_port = r->audio_port; + conn->rtp_ip = osmo_ntohl(inet_addr(r->audio_ip)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_BTS_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_PROC: An mgcp response has been received, proceed + * with the assignment request */ +static void fsm_proc_assignmnent_req_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + int chan_mode; + int full_rate; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + OSMO_ASSERT(conn->conn); + chan_mode = mgcp_ctx->chan_mode; + full_rate = mgcp_ctx->full_rate; + + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MGCPGW proceeding assignment request...\n", mgcp_ctx->name); + rc = gsm0808_assign_req(conn->conn, chan_mode, full_rate); + + if (rc < 0) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_BTS, MGCP_BSS_TIMEOUT, MGCP_BSS_TIMEOUT_TIMER_NO); +} + +/* Forward declaration to keep the function in logical order */ +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_BTS: When the BSS has completed the assignment, + * proceed with updating the connection for the BTS side */ +static void fsm_mdcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + struct in_addr addr; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + network = mgcp_ctx->network; + OSMO_ASSERT(network); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) MGCPGW BSS has completed the assignment, now prceed with MDCX towards BTS...\n", + mgcp_ctx->name); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) completing connection for the BTS side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip); + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) BTS expects RTP input on address %s:%u\n", + mgcp_ctx->name, inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_BTS; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + mgcp_msg.audio_ip = inet_ntoa(addr); + mgcp_msg.audio_port = lchan->abis_ip.bound_port; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, mdcx_for_bts_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_CRCX_NET, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for BTS associated MDCX */ +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct in_addr addr; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) MDCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse MDCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) MDCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + addr.s_addr = lchan->abis_ip.bound_ip; + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) MDCX corresponding lchan has been bound to address %s:%u\n", + mgcp_ctx->name, inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_BTS_RESP, mgcp_ctx); +} + +/* Forward declaration to keep the function in logical order */ +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_NET: An mgcp response has been received, proceed... */ +static void fsm_crcx_net_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + struct sockaddr_in *sin; + char *addr; + uint16_t port; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) creating connection for the NET side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* Currently we only have support for IPv4 in our MGCP software, the + * AoIP part is ready to support IPv6 in theory, because the IE + * parser/generator uses sockaddr_storage for the AoIP transport + * identifier. However, the MGCP-GW does not support IPv6 yet. This is + * why we stop here in case some MSC tries to signal IPv6 AoIP + * transport identifiers */ + if (conn->aoip_rtp_addr_remote.ss_family != AF_INET) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW (%s) endpoint:%x MSC uses unsupported address format in AoIP transport identifier -- aborting...\n", + mgcp_ctx->name, rtp_endpoint); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_remote; + addr = inet_ntoa(sin->sin_addr); + port = osmo_ntohs(sin->sin_port); + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MSC expects RTP input on address %s:%u\n", mgcp_ctx->name, addr, port); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_NET; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + mgcp_msg.audio_ip = addr; + mgcp_msg.audio_port = port; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, crcx_for_net_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct sockaddr_in *sin; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) CRCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse CRCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) CRCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + /* Store address */ + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_local; + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = inet_addr(r->audio_ip); + sin->sin_port = osmo_ntohs(r->audio_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_NET_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_COMPL: Send back assignment complete and wait until the call ends */ +static void fsm_send_assignment_complete(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + /* Send assignment completion message via AoIP, this will complete + * the circuit. The message will also contain the port and IP-Address + * where the MGCPGW expects the RTP input from the MSC side */ + bssmap_send_aoip_ass_compl(lchan); + + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) call in progress, waiting for call end...\n", mgcp_ctx->name); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_DLCX, 0, 0); +} + +/* Forward declaration to keep the function in logical order */ +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_DLCX: Remove connection for the BTS and NET side. */ +static void fsm_dlcx_all_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) removing connection for the BTS and NET side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* We now relase the endpoint back to the pool in order to allow + * other connections to use this endpoint */ + mgcp_client_release_endpoint(rtp_endpoint, mgcp); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, dlcx_for_all_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_HALT, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + /* Note: We check the return code, but in case of an error there is + * not much that can be done to recover. However, at least we tryed + * to remove the connection (if there was even any) */ + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) DLCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_DLCX_ALL_RESP, mgcp_ctx); +} + +/* Callback for ST_HALT: Terminate the state machine */ +static void fsm_halt_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) timeout (T%i) in state %s, state machine halted\n", + mgcp_ctx->name, fi->T, get_value_string(fsm_state_names, fi->state)); + + /* Send pending sigtran message */ + if (mgcp_ctx->resp) { + osmo_bsc_sigtran_send(conn, mgcp_ctx->resp); + mgcp_ctx->resp = NULL; + } + + /* Destroy the state machine and all context information */ + osmo_fsm_inst_free(mgcp_ctx->fsm); + memset(mgcp_ctx, 0, sizeof(*mgcp_ctx)); + talloc_free(mgcp_ctx); +} + +/* Timer callback to shut down in case of connectivity problems */ +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)fi->priv; + struct gsm_network *network; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(mgcp_ctx); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) timeout (T%i) in state %s, attempting graceful teardown...\n", + mgcp_ctx->name, fi->T, get_value_string(fsm_state_names, fi->state)); + + /* Ensure that no sigtran response, is present. Otherwiese we might try + * to send a sigtran response when the sccp connection is already freed. */ + mgcp_ctx->resp = NULL; + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NO) { + /* Note: We were unable to communicate with the MGCP-GW, + * unfortunately there is no meaningful action we can take + * now other than giving up. */ + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) graceful teardown not possible, terminating...\n", mgcp_ctx->name); + + /* At least release the occupied endpoint ID */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); + } else if (fi->T == MGCP_BSS_TIMEOUT_TIMER_NO) + /* Note: If the logic that controls the BSS is unable to + * negotiate a connection, we presumably still have a + * working connection to the MGCP-GW, we will try to + * shut down gracefully. */ + on_error_goto_dlcx(mgcp_ctx); + else { + /* Note: Ther must not be any unsolicited timers + * in this FSM. If so, we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static struct osmo_fsm_state fsm_states[] = { + + /* Startup state machine, send CRCX to BTS. */ + [ST_CRCX_BTS] = { + .in_event_mask = (1 << EV_INIT), + .out_state_mask = (1 << ST_ASSIGN_PROC), + .name = "ST_CRCX_BTS", + .action = fsm_crcx_bts_cb, + }, + + /* When the CRCX response for the BTS side is received, then + * proceed the assignment on the BSS side. */ + [ST_ASSIGN_PROC] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_MDCX_BTS), + .name = "ST_ASSIGN_PROC", + .action = fsm_proc_assignmnent_req_cb, + }, + + /* When the BSS has processed the assignment request, + * then send the MDCX command for the BTS side in order to + * update the connections with the actual PORT/IP where the + * BTS expects the RTP input. */ + [ST_MDCX_BTS] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_ASS_COMPLETE), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_CRCX_NET), + .name = "ST_MDCX_BTS", + .action = fsm_mdcx_bts_cb, + }, + + /* When the MDCX response for the BTS siede is received, then + * directly proceed with sending the CRCX command to connect the + * network side. This is done in one phase (no MDCX needed). */ + [ST_CRCX_NET] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_MDCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_ASSIGN_COMPL), + .name = "ST_CRCX_NET", + .action = fsm_crcx_net_cb, + }, + + /* When the CRCX response for the NET side is received. Then + * send the assignment complete message via the A-Interface and + * enter wait state in order to wait for the end of the call. */ + [ST_ASSIGN_COMPL] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_NET_RESP), + .out_state_mask = (1 << ST_DLCX), + .name = "ST_ASSIGN_COMPL", + .action = fsm_send_assignment_complete, + }, + + /* When the call ends, remove all RTP connections from the + * MGCP-GW by sending a wildcarded DLCX. */ + [ST_DLCX] = { + .in_event_mask = (1 << EV_TEARDOWN), + .out_state_mask = (1 << ST_HALT), + .name = "ST_DLCX", + .action = fsm_dlcx_all_cb, + }, + + /* When the MGCP_GW confirms that the connections are terminated, + * then halt the state machine. */ + [ST_HALT] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_DLCX_ALL_RESP), + .out_state_mask = 0, + .name = "ST_HALT", + .action = fsm_halt_cb, + }, +}; + +/* State machine definition */ +static struct osmo_fsm fsm = { + .name = "FSM MGCP", + .states = fsm_states, + .num_states = ARRAY_SIZE(fsm_states), + .log_subsys = DMGCP, + .timer_cb = fsm_timeout_cb, +}; + +/* Notify that the a new call begins. This will create a connection for the + * BTS on the MGCP-GW and set up the port numbers in struct osmo_bsc_sccp_con. + * After that gsm0808_assign_req() to proceed. + * Parameter: + * ctx: talloc context + * network: associated gsm network + * conn: associated sccp connection + * chan_mode: channel mode (system data, passed through) + * full_rate: full rate flag (system data, passed through) + * Returns an mgcp_context that contains system data and the OSMO-FSM */ +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct gsm_network *network, + struct osmo_bsc_sccp_con *conn, int chan_mode, int full_rate) +{ + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(network); + OSMO_ASSERT(conn); + + /* Register the fsm description (if not already done) */ + if (osmo_fsm_find_by_name(fsm.name) != &fsm) + osmo_fsm_register(&fsm); + + /* Allocate and configure a new fsm instance */ + mgcp_ctx = talloc_zero(ctx, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + + snprintf(mgcp_ctx->name, sizeof(mgcp_ctx->name), "MGCP FSM, id=%i", conn->conn_id); + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm, NULL, ctx, LOGL_DEBUG, "FSM MGCP INST"); + OSMO_ASSERT(mgcp_ctx->fsm); + mgcp_ctx->fsm->priv = mgcp_ctx; + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MGCPGW handler fsm created\n", mgcp_ctx->name); + mgcp_ctx->network = network; + mgcp_ctx->conn = conn; + mgcp_ctx->chan_mode = chan_mode; + mgcp_ctx->full_rate = full_rate; + + /* start state machine */ + OSMO_ASSERT(mgcp_ctx->fsm->state == ST_CRCX_BTS) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_INIT, mgcp_ctx); + + return mgcp_ctx; +} + +/* Notify that the call has ended, remove all connections from the MGCP-GW, + * then send the clear complete message and destroy the FSM instance + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * respmgcp_ctx: pending clear complete message to send via A-Interface */ +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(resp); + + mgcp_ctx->resp = resp; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +/* Notify that the BSS ready, send the assingnment complete message when the + * mgcp connection is completed + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * lchan: needed for sending the assignment complete message via A-Interface */ +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(lchan); + + mgcp_ctx->lchan = lchan; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASS_COMPLETE, mgcp_ctx); + + return; +} diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 48796c1..cc1f314 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -33,6 +33,7 @@ #include #include #include +#include /* A pointer to a list with all involved MSCs * (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */ diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index 0e7003f..3ee7534 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include @@ -971,6 +973,8 @@ int bsc_vty_init_extra(void) { + struct gsm_network *net = bsc_gsmnet; + install_element(CONFIG_NODE, &cfg_net_msc_cmd); install_element(CONFIG_NODE, &cfg_net_bsc_cmd); @@ -1035,5 +1039,7 @@ install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); + mgcp_client_vty_init(net, MSC_NODE, net->mgw.conf); + return 0; } -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 18 16:18:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 16:18:31 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: That seems to be unnecessary complex. Placing symlinks into debian/ means that both are installed automatically. This also means that the same package will work on all .deb with and without systemd. Adding ./configure options wouldn't mean we'll get read of manual install in OE - it just means that we'll shift it into .deb packaging. -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 16:41:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Oct 2017 16:41:50 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: > That seems to be unnecessary complex. Placing symlinks into debian/ > means that both are installed automatically. This also means that > the same package will work on all .deb with and without systemd. > Adding ./configure options wouldn't mean we'll get read of manual > install in OE - it just means that we'll shift it into .deb > packaging. Why do you want to have both installed automatically? you either use sysvinit or systemd in your system, there's no sense in installing both. Your distro either works with one or another, and so the package built comes with one or the other. Adding ./configure options + stuff in Makefile.am for sure means we get read of manual install in OE, since we don't need to call "install ${S}/contrib/*.service ${D}/{systemd_system_unitdir}/" because make already does that for us. There's a good amount of projects installing systemd and OE does use that in lots of places, "grep systemd | grep with" in poky shows for instance several lines like this: > meta/recipes-graphics/xorg-xserver/xserver-xorg.inc:141:PACKAGECONFIG[systemd] = "--with-systemd-daemon,--without-systemd-daemon,systemd" > meta/recipes-extended/cups/cups.inc:32:PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd" > meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb:40:PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/, \ > meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb:41: --without-systemdsystemunitdir, \ > meta/recipes-connectivity/avahi/avahi.inc:64:EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}" > meta/recipes-connectivity/neard/neard_0.16.bb:25:PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/ --with-syste mduserunitdir=${systemd_unitdir}/user/,--disable-systemd" > meta/recipes-core/dbus/dbus_1.10.20.bb:108:PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd - -without-systemdsystemunitdir,systemd" -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 18 16:56:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 18 Oct 2017 16:56:07 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: > Why do you want to have both installed automatically? Because we have to support Debian 8 which does not have systemd. If both .init and .service are installed automatically than it works everywhere: debian 8 will ignore .service and systemd will automatically prefer .service when it's available. Otherwise we'll have to build .deb differently depending on which Debian version it's aimed for. Which, I presume, is possible but doesn't seem to provide any benefits. -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 19 00:18:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 00:18:31 +0000 Subject: libosmocore[master]: ctrl: allow more nodes than those in enum ctrl_node_type In-Reply-To: References: Message-ID: Patch Set 3: I need this one for adding CTRL commands to osmo-hlr, https://gerrit.osmocom.org/4311 -- To view, visit https://gerrit.osmocom.org/4305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bd62ae0d4eefde7e1517db15a2155640a1bab58 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 19 01:08:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 01:08:59 +0000 Subject: [PATCH] libosmocore[master]: add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() Message-ID: Review at https://gerrit.osmocom.org/4340 add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() Add macro to append to a CTRL commands' reply string, ctrl_cmd_reply_printf(). The talloc_asprintf() part of it is generic enough to qualify for a separate macro, osmo_talloc_asprintf(). The idea is to not have to decide for each bit added to a string whether the string is already allocated or not, but simply be able to issue printf commands and let the macro worry about initial allocation or reallocation. This originally came from osmo-hlr change I1bd62ae0d4eefde7e1517db15a2155640a1bab58, where it was requested to move this bit to libosmocore. Change-Id: Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 --- M include/osmocom/core/utils.h M include/osmocom/ctrl/control_cmd.h 2 files changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/4340/1 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 5f41213..793f8bb 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -85,6 +85,24 @@ *dst = talloc_strdup(ctx, newstr); } +/*! Append to a string and re-/allocate if necessary. + * \param[in] ctx Talloc context to use for initial allocation. + * \param[inout] dest char* to re-/allocate and append to. + * \param[in] fmt printf-like string format. + * \param[in] args Arguments for fmt. + * + * \a dest may be passed in NULL, or a string previously allocated by talloc. + * If an existing string is passed in, it will remain associated with whichever + * ctx it was allocated before, regardless whether it matches \a ctx or not. + */ +#define osmo_talloc_asprintf(ctx, dest, fmt, args ...) \ + do { \ + if (!dest) \ + dest = talloc_asprintf(ctx, fmt, ## args); \ + else \ + dest = talloc_asprintf_append((char*)dest, fmt, ## args); \ + } while (0) + int osmo_constant_time_cmp(const uint8_t *exp, const uint8_t *rel, const int count); uint64_t osmo_decode_big_endian(const uint8_t *data, size_t data_len); uint8_t *osmo_encode_big_endian(uint64_t value, size_t data_len); diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h index 77532e6..4372e25 100644 --- a/include/osmocom/ctrl/control_cmd.h +++ b/include/osmocom/ctrl/control_cmd.h @@ -66,6 +66,9 @@ char *reply; }; +#define ctrl_cmd_reply_printf(cmd, fmt, args ...) \ + osmo_talloc_asprintf(cmd, cmd->reply, fmt, ## args) + struct ctrl_cmd_struct { int nr_commands; char **command; -- To view, visit https://gerrit.osmocom.org/4340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 19 01:11:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 01:11:26 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/4311/2/src/ctrl.c File src/ctrl.c: Line 156: /* not used yet */ > Erm, could you clarify? Who's using the other part of the same function? This is one large printf (to avoid reallocating string memory), in the first #if 0 are the format strings and in below #if 0 are the arguments corresponding to the format strings of the first #if 0. I'm excluding these, because they are variables that already exist in the struct (modeled after HLR specs I presume) but are not of interest to any osmo-hlr user yet, because there is no code actually using these features. Does this answer your question? Or did you mean who is using print_subscr_info()? The CTRL command 'subscriber.by-*.info'. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 19 01:20:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 01:20:23 +0000 Subject: [PATCH] osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4311 to look at the new patch set (#3). ctrl: completely replace all CTRL commands The previous commands are not conforming to how the CTRL interface is intended to work: SET enable-ps SET disable-ps SET status-ps 'status-ps' is a write-only command even though it returns the status. 'enable-ps' / 'disable-ps' indicate the value instead of a variable name of an entity. The entity takes the place of the variable value. See also https://lists.osmocom.org/pipermail/openbsc/2017-September/011236.html Instead, replace with SET subscriber.by-imsi-123456.ps-enabled {0,1} GET subscriber.by-imsi-123456.ps-enabled and also provide further CTRL functions while at it: {SET,GET} subscriber.by-{imsi,msisdn,id}-123456.{cs,ps}-enabled {0,1} GET subscriber.by-{imsi,msisdn,id}-123456.{info,info-aud,info-all} Provide CTRL tests in the form of transcripts. This is the first time an application uses CTRL_NODE ids that are defined outside of libosmocore, see 'Depends' below. Implementation choice: the first idea was to have a '.' between the 'by-xxx' and the value, like: subscriber.by-xxx.123456.function but the difficulty with subscribers is that they are not in RAM, and I can't just point node_data at a struct instance that is always there (like, say, a global bts[0] struct in osmo-bsc). Instead, I want to store the selector and later decide whether to read from the DB or whatever. With a '.' separating things, the only way in a ctrl function to obtain both 'by-xxx' and '123456' for picking a subscriber record would be to parse the entire variable path string elements, including 'subscriber' and 'function', which would then also clumsily fix at which node level we hook these commands; there could have been separate CTRL_NODE_SUBSCR_BY_{IMSI,MSISDN,ID} parent nodes, but we cannot introspect the current parent node dynamically within a ctrl function handler (plus I'm not sure whether it's possible and a good idea to have the same command under multiple parent nodes). Rather than that, I store the 'by-foo-123' token in the node_data pointer to have both bits of information pointed at by a single pointer; I use the incoming command parsing to get this token pre-separated from surrounding node names, and no need to re-allocate it, since the vector of tokens lives until after command execution is complete. Each leaf command obtains this token from cmd->node (aka node_data), and feeds this token to a common static function to parse selector and value from it and to retrieve a subscriber record as needed. (BTW, I have mentioned on the mailing list that this way might be necessary to avoid numeric-only CTRL node names, but we don't need to, and that is not at all related to this choice of structure.) Depends: libosmocore I1bd62ae0d4eefde7e1517db15a2155640a1bab58 libosmocore Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 --- M src/ctrl.c M src/ctrl.h M src/hlr.c M tests/test_subscriber.ctrl M tests/test_subscriber.sql M tests/test_subscriber.vty A tests/test_subscriber_errors.ctrl 7 files changed, 871 insertions(+), 78 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/11/4311/3 diff --git a/src/ctrl.c b/src/ctrl.c index 3bd4d8f..6140a25 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -21,87 +21,382 @@ */ #include +#include +#include +#include -#include -#include +#include #include -#include "gsup_server.h" -#include "logging.h" -#include "db.h" #include "hlr.h" -#include "luop.h" #include "ctrl.h" +#include "db.h" -static int handle_cmd_ps(struct hlr *ctx, struct ctrl_cmd *cmd, bool enable) +#define SEL_BY "by-" +#define SEL_BY_IMSI SEL_BY "imsi-" +#define SEL_BY_MSISDN SEL_BY "msisdn-" +#define SEL_BY_ID SEL_BY "id-" + +#define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) + +static bool startswith(const char *str, const char *start) +{ + return strncmp(str, start, strlen(start)) == 0; +} + +static int _get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr) +{ + const char *val; + if (startswith(by_selector, SEL_BY_IMSI)) { + val = by_selector + strlen(SEL_BY_IMSI); + if (!osmo_imsi_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_imsi(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_MSISDN)) { + val = by_selector + strlen(SEL_BY_MSISDN); + if (!osmo_msisdn_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_msisdn(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_ID)) { + int64_t id; + char *endptr; + val = by_selector + strlen(SEL_BY_ID); + if (*val == '+') + return -EINVAL; + errno = 0; + id = strtoll(val, &endptr, 10); + if (errno || *endptr) + return -EINVAL; + return db_subscr_get_by_id(dbc, id, subscr); + } + return -ENOTSUP; +} + +static bool get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr, + struct ctrl_cmd *cmd) +{ + int rc = _get_subscriber(dbc, by_selector, subscr); + switch (rc) { + case 0: + return true; + case -ENOTSUP: + cmd->reply = "Not a known subscriber 'by-xxx-' selector."; + return false; + case -EINVAL: + cmd->reply = "Invalid value part of 'by-xxx-value' selector."; + return false; + case -ENOENT: + cmd->reply = "No such subscriber."; + return false; + default: + cmd->reply = NULL; + return false; + } +} + +/* Optimization: if a subscriber operation is requested by-imsi, just return + * the IMSI right back. */ +static const char *get_subscriber_imsi(struct db_context *dbc, + const char *by_selector, + struct ctrl_cmd *cmd) +{ + static struct hlr_subscriber subscr; + + if (startswith(by_selector, SEL_BY_IMSI)) + return by_selector + strlen(SEL_BY_IMSI); + if (!get_subscriber(dbc, by_selector, &subscr, cmd)) + return NULL; + return subscr.imsi; +} + +/* printf fmt and arg to completely omit a string if it is empty. */ +#define FMT_S "%s%s%s%s" +#define ARG_S(name, val) \ + (val) && *(val) ? "\n" : "", \ + (val) && *(val) ? name : "", \ + (val) && *(val) ? "\t" : "", \ + (val) && *(val) ? (val) : "" \ + +/* printf fmt and arg to completely omit bool of given value. */ +#define FMT_BOOL "%s" +#define ARG_BOOL_OMIT_TRUE(name, val) \ + val ? "" : "\n" name "\t0" +#define ARG_BOOL_OMIT_FALSE(name, val) \ + val ? "\n" name "\t1" : "" +#define ARG_BOOL(name, val) \ + val ? "\n" name "\t1" : "\n" name "\t0" + +static void print_subscr_info(struct ctrl_cmd *cmd, + struct hlr_subscriber *subscr) +{ + ctrl_cmd_reply_printf(cmd, + "\nid\t%"PRIu64 + FMT_S + FMT_S + FMT_BOOL + FMT_BOOL + FMT_S + FMT_S + FMT_S +#if 0 +/* not used yet */ + FMT_BOOL + FMT_BOOL + "\nperiodic_lu_timer\t%u" + "\nperiodic_rau_tau_timer\t%u" + "\nlmsi\t%08x" +#endif + , + subscr->id, + ARG_S("imsi", subscr->imsi), + ARG_S("msisdn", subscr->msisdn), + ARG_BOOL_OMIT_TRUE("nam_cs", subscr->nam_cs), + ARG_BOOL_OMIT_TRUE("nam_ps", subscr->nam_ps), + ARG_S("vlr_number", subscr->vlr_number), + ARG_S("sgsn_number", subscr->sgsn_number), + ARG_S("sgsn_address", subscr->sgsn_address) +#if 0 + , + ARG_BOOL_OMIT_FALSE("ms_purged_cs", subscr->ms_purged_cs), + ARG_BOOL_OMIT_FALSE("ms_purged_ps", subscr->ms_purged_ps), + subscr->periodic_lu_timer, + subscr->periodic_rau_tau_timer, + subscr->lmsi +#endif + ); +} + +static void print_subscr_info_aud2g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + ctrl_cmd_reply_printf(cmd, + "\naud2g.algo\t%s" + "\naud2g.ki\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.gsm.ki)); +} + +static void print_subscr_info_aud3g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + ctrl_cmd_reply_printf(cmd, + "\naud3g.algo\t%s" + "\naud3g.k\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.umts.k)); + /* hexdump uses a static string buffer, hence only one hexdump per + * printf(). */ + ctrl_cmd_reply_printf(cmd, + "\naud3g.%s\t%s" + "\naud3g.ind_bitlen\t%u" + "\naud3g.sqn\t%"PRIu64 + , + aud->u.umts.opc_is_op? "op" : "opc", + hexdump_buf(aud->u.umts.opc), + aud->u.umts.ind_bitlen, + aud->u.umts.sqn); +} + +CTRL_CMD_DEFINE_RO(subscr_info, "info"); +static int get_subscr_info(struct ctrl_cmd *cmd, void *data) { struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; - if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, &subscr) < 0) { - cmd->reply = "Subscriber Unknown in HLR"; + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + print_subscr_info(cmd, &subscr); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_aud, "info-aud"); +static int get_subscr_info_aud(struct ctrl_cmd *cmd, void *data) +{ + const char *imsi; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } - if (hlr_subscr_nam(ctx, &subscr, enable, true) < 0) { - cmd->reply = "Error updating DB"; + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_all, "info-all"); +static int get_subscr_info_all(struct ctrl_cmd *cmd, void *data) +{ + struct hlr_subscriber subscr; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, subscr.imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } + print_subscr_info(cmd, &subscr); + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +static int verify_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) +{ + if (!value || !*value + || (strcmp(value, "0") && strcmp(value, "1"))) + return 1; + return 0; +} + +static int get_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + cmd->reply = (is_ps ? subscr.nam_ps : subscr.nam_cs) + ? "1" : "0"; + return CTRL_CMD_REPLY; +} + +static int set_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + const char *imsi; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + if (db_subscr_nam(hlr->dbc, imsi, strcmp(cmd->value, "1") == 0, is_ps)) + return CTRL_CMD_ERROR; cmd->reply = "OK"; return CTRL_CMD_REPLY; } -CTRL_CMD_DEFINE_WO_NOVRF(enable_ps, "enable-ps"); -static int set_enable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_ps_enabled, "ps-enabled"); +static int verify_subscr_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, true); + return verify_subscr_cs_ps_enabled(cmd, value, data); +} +static int get_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return get_subscr_cs_ps_enabled(cmd, data, true); +} +static int set_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, true); } -CTRL_CMD_DEFINE_WO_NOVRF(disable_ps, "disable-ps"); -static int set_disable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_cs_enabled, "cs-enabled"); +static int verify_subscr_cs_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, false); + return verify_subscr_cs_ps_enabled(cmd, value, data); } - -CTRL_CMD_DEFINE_WO_NOVRF(status_ps, "status-ps"); -static int set_status_ps(struct ctrl_cmd *cmd, void *data) +static int get_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) { - struct hlr *ctx = data; - struct lu_operation *luop = lu_op_alloc(ctx->gs); - if (!luop) { - cmd->reply = "Internal HLR error"; - return CTRL_CMD_ERROR; - } - - if (!lu_op_fill_subscr(luop, ctx->dbc, cmd->value)) { - cmd->reply = "Subscriber Unknown in HLR"; - return CTRL_CMD_ERROR; - } - - cmd->reply = luop->subscr.nam_ps ? "1" : "0"; - - return CTRL_CMD_REPLY; + return get_subscr_cs_ps_enabled(cmd, data, false); +} +static int set_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, false); } int hlr_ctrl_cmds_install() { int rc = 0; - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_enable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_disable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_status_ps); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_aud); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_all); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_ps_enabled); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_cs_enabled); return rc; } -struct ctrl_handle *hlr_controlif_setup(struct hlr *ctx, - struct osmo_gsup_server *gs) +static int hlr_ctrl_node_lookup(void *data, vector vline, int *node_type, + void **node_data, int *i) +{ + const char *token = vector_slot(vline, *i); + + switch (*node_type) { + case CTRL_NODE_ROOT: + if (strcmp(token, "subscriber") != 0) + return 0; + *node_data = NULL; + *node_type = CTRL_NODE_SUBSCR; + break; + case CTRL_NODE_SUBSCR: + if (!startswith(token, "by-")) + return 0; + *node_data = (void*)token; + *node_type = CTRL_NODE_SUBSCR_BY; + break; + default: + return 0; + } + + return 1; +} + +struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr) { int rc; - struct ctrl_handle *hdl = ctrl_interface_setup_dynip(ctx, - ctx->ctrl_bind_addr, - OSMO_CTRL_PORT_HLR, - NULL); + struct ctrl_handle *hdl; + + hdl = ctrl_interface_setup_dynip2(hlr, + hlr->ctrl_bind_addr, + OSMO_CTRL_PORT_HLR, + hlr_ctrl_node_lookup, + _LAST_CTRL_NODE_HLR); if (!hdl) return NULL; diff --git a/src/ctrl.h b/src/ctrl.h index 663de30..3f9ba3f 100644 --- a/src/ctrl.h +++ b/src/ctrl.h @@ -24,8 +24,11 @@ #include -#include "gsup_server.h" +enum hlr_ctrl_node { + CTRL_NODE_SUBSCR = _LAST_CTRL_NODE, + CTRL_NODE_SUBSCR_BY, + _LAST_CTRL_NODE_HLR +}; int hlr_ctrl_cmds_install(); -struct ctrl_handle *hlr_controlif_setup(struct hlr *ctx, - struct osmo_gsup_server *gs); +struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr); diff --git a/src/hlr.c b/src/hlr.c index b32f709..6310526 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -474,7 +474,7 @@ } g_hlr->ctrl_bind_addr = ctrl_vty_get_bind_addr(); - g_hlr->ctrl = hlr_controlif_setup(g_hlr, g_hlr->gs); + g_hlr->ctrl = hlr_controlif_setup(g_hlr); osmo_init_ignore_signals(); signal(SIGINT, &signal_hdlr); diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl index 3284ae5..30dae00 100644 --- a/tests/test_subscriber.ctrl +++ b/tests/test_subscriber.ctrl @@ -1,27 +1,414 @@ -GET 1 invalid -ERROR 1 Command not found -SET 2 invalid nonsense -ERROR 2 Command not found +GET 1 subscriber.by-imsi-901990000000001.info +GET_REPLY 1 subscriber.by-imsi-901990000000001.info +id 1 +imsi 901990000000001 +msisdn 1 -SET 3 enable-ps 901990000000001 -SET_REPLY 3 enable-ps OK -SET 4 status-ps 901990000000001 -SET_REPLY 4 status-ps 1 -SET 5 enable-ps 901990000000001 -SET_REPLY 5 enable-ps OK -SET 6 status-ps 901990000000001 -SET_REPLY 6 status-ps 1 +GET 2 subscriber.by-imsi-901990000000001.info-aud +GET_REPLY 2 subscriber.by-imsi-901990000000001.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 7 disable-ps 901990000000001 -SET_REPLY 7 disable-ps OK -SET 8 status-ps 901990000000001 -SET_REPLY 8 status-ps 0 -SET 9 disable-ps 901990000000001 -SET_REPLY 9 disable-ps OK -SET 10 status-ps 901990000000001 -SET_REPLY 10 status-ps 0 +GET 3 subscriber.by-imsi-901990000000001.info-all +GET_REPLY 3 subscriber.by-imsi-901990000000001.info-all +id 1 +imsi 901990000000001 +msisdn 1 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 11 enable-ps 901990000000001 -SET_REPLY 11 enable-ps OK -SET 12 status-ps 901990000000001 -SET_REPLY 12 status-ps 1 +GET 4 subscriber.by-imsi-901990000000002.info +GET_REPLY 4 subscriber.by-imsi-901990000000002.info +id 2 +imsi 901990000000002 + +GET 5 subscriber.by-imsi-901990000000002.info-aud +GET_REPLY 5 subscriber.by-imsi-901990000000002.info-aud +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 6 subscriber.by-imsi-901990000000002.info-all +GET_REPLY 6 subscriber.by-imsi-901990000000002.info-all +id 2 +imsi 901990000000002 +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 7 subscriber.by-imsi-901990000000003.info +GET_REPLY 7 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 8 subscriber.by-imsi-901990000000003.info-aud +GET_REPLY 8 subscriber.by-imsi-901990000000003.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 9 subscriber.by-imsi-901990000000003.info-all +GET_REPLY 9 subscriber.by-imsi-901990000000003.info-all +id 3 +imsi 901990000000003 +msisdn 103 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 10 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 10 subscriber.by-imsi-901990000000003.ps-enabled 1 + +SET 11 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 11 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 12 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 12 subscriber.by-imsi-901990000000003.ps-enabled 0 + +GET 13 subscriber.by-imsi-901990000000003.info +GET_REPLY 13 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_ps 0 + +SET 14 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 14 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 15 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 15 subscriber.by-imsi-901990000000003.ps-enabled 0 + +SET 16 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 16 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 17 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 17 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 18 subscriber.by-imsi-901990000000003.info +GET_REPLY 18 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 19 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 19 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 20 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 20 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 21 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 21 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 22 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 22 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 23 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 23 subscriber.by-imsi-901990000000003.cs-enabled 0 + +GET 24 subscriber.by-imsi-901990000000003.info +GET_REPLY 24 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 + +SET 25 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 25 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 26 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 26 subscriber.by-imsi-901990000000003.cs-enabled 0 + +SET 27 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 27 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 28 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 28 subscriber.by-imsi-901990000000003.cs-enabled 1 + +GET 29 subscriber.by-imsi-901990000000003.info +GET_REPLY 29 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 30 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 30 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 31 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 31 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 32 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 32 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 33 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 33 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 34 subscriber.by-imsi-901990000000003.info +GET_REPLY 34 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 + +SET 35 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 35 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 36 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 36 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 37 subscriber.by-imsi-901990000000003.info +GET_REPLY 37 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 + + + +GET 38 subscriber.by-msisdn-103.info +GET_REPLY 38 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 39 subscriber.by-msisdn-103.info-aud +GET_REPLY 39 subscriber.by-msisdn-103.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 40 subscriber.by-msisdn-103.info-all +GET_REPLY 40 subscriber.by-msisdn-103.info-all +id 3 +imsi 901990000000003 +msisdn 103 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 41 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 41 subscriber.by-msisdn-103.ps-enabled 1 + +SET 42 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 42 subscriber.by-msisdn-103.ps-enabled OK +GET 43 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 43 subscriber.by-msisdn-103.ps-enabled 0 + +GET 44 subscriber.by-msisdn-103.info +GET_REPLY 44 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_ps 0 + +SET 45 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 45 subscriber.by-msisdn-103.ps-enabled OK +GET 46 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 46 subscriber.by-msisdn-103.ps-enabled 0 + +SET 47 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 47 subscriber.by-msisdn-103.ps-enabled OK +GET 48 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 48 subscriber.by-msisdn-103.ps-enabled 1 + +GET 49 subscriber.by-msisdn-103.info +GET_REPLY 49 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 50 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 50 subscriber.by-msisdn-103.ps-enabled OK +GET 51 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 51 subscriber.by-msisdn-103.ps-enabled 1 + +GET 52 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 52 subscriber.by-msisdn-103.cs-enabled 1 + +SET 53 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 53 subscriber.by-msisdn-103.cs-enabled OK +GET 54 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 54 subscriber.by-msisdn-103.cs-enabled 0 + +GET 55 subscriber.by-msisdn-103.info +GET_REPLY 55 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 + +SET 56 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 56 subscriber.by-msisdn-103.cs-enabled OK +GET 57 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 57 subscriber.by-msisdn-103.cs-enabled 0 + +SET 58 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 58 subscriber.by-msisdn-103.cs-enabled OK +GET 59 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 59 subscriber.by-msisdn-103.cs-enabled 1 + +GET 60 subscriber.by-msisdn-103.info +GET_REPLY 60 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 61 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 61 subscriber.by-msisdn-103.cs-enabled OK +GET 62 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 62 subscriber.by-msisdn-103.cs-enabled 1 + +SET 63 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 63 subscriber.by-msisdn-103.ps-enabled OK +SET 64 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 64 subscriber.by-msisdn-103.cs-enabled OK +GET 65 subscriber.by-msisdn-103.info +GET_REPLY 65 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 + +SET 66 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 66 subscriber.by-msisdn-103.ps-enabled OK +SET 67 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 67 subscriber.by-msisdn-103.cs-enabled OK +GET 68 subscriber.by-msisdn-103.info +GET_REPLY 68 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 + + + +GET 69 subscriber.by-id-3.info +GET_REPLY 69 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 70 subscriber.by-id-3.info-aud +GET_REPLY 70 subscriber.by-id-3.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 71 subscriber.by-id-3.info-all +GET_REPLY 71 subscriber.by-id-3.info-all +id 3 +imsi 901990000000003 +msisdn 103 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 72 subscriber.by-id-3.ps-enabled +GET_REPLY 72 subscriber.by-id-3.ps-enabled 1 + +SET 73 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 73 subscriber.by-id-3.ps-enabled OK +GET 74 subscriber.by-id-3.ps-enabled +GET_REPLY 74 subscriber.by-id-3.ps-enabled 0 + +GET 75 subscriber.by-id-3.info +GET_REPLY 75 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_ps 0 + +SET 76 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 76 subscriber.by-id-3.ps-enabled OK +GET 77 subscriber.by-id-3.ps-enabled +GET_REPLY 77 subscriber.by-id-3.ps-enabled 0 + +SET 78 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 78 subscriber.by-id-3.ps-enabled OK +GET 79 subscriber.by-id-3.ps-enabled +GET_REPLY 79 subscriber.by-id-3.ps-enabled 1 + +GET 80 subscriber.by-id-3.info +GET_REPLY 80 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 81 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 81 subscriber.by-id-3.ps-enabled OK +GET 82 subscriber.by-id-3.ps-enabled +GET_REPLY 82 subscriber.by-id-3.ps-enabled 1 + +GET 83 subscriber.by-id-3.cs-enabled +GET_REPLY 83 subscriber.by-id-3.cs-enabled 1 + +SET 84 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 84 subscriber.by-id-3.cs-enabled OK +GET 85 subscriber.by-id-3.cs-enabled +GET_REPLY 85 subscriber.by-id-3.cs-enabled 0 + +GET 86 subscriber.by-id-3.info +GET_REPLY 86 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 + +SET 87 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 87 subscriber.by-id-3.cs-enabled OK +GET 88 subscriber.by-id-3.cs-enabled +GET_REPLY 88 subscriber.by-id-3.cs-enabled 0 + +SET 89 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 89 subscriber.by-id-3.cs-enabled OK +GET 90 subscriber.by-id-3.cs-enabled +GET_REPLY 90 subscriber.by-id-3.cs-enabled 1 + +GET 91 subscriber.by-id-3.info +GET_REPLY 91 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 + +SET 92 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 92 subscriber.by-id-3.cs-enabled OK +GET 93 subscriber.by-id-3.cs-enabled +GET_REPLY 93 subscriber.by-id-3.cs-enabled 1 + +SET 94 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 94 subscriber.by-id-3.ps-enabled OK +SET 95 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 95 subscriber.by-id-3.cs-enabled OK +GET 96 subscriber.by-id-3.info +GET_REPLY 96 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 + +SET 97 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 97 subscriber.by-id-3.ps-enabled OK +SET 98 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 98 subscriber.by-id-3.cs-enabled OK +GET 99 subscriber.by-id-3.info +GET_REPLY 99 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql index 0767d48..decd7d2 100644 --- a/tests/test_subscriber.sql +++ b/tests/test_subscriber.sql @@ -1,6 +1,6 @@ -- 2G only subscriber -INSERT INTO subscriber (id, imsi) VALUES (1, '901990000000001'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (1, '901990000000001', '1'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (1, 1, '000102030405060708090a0b0c0d0e0f'); -- 3G only subscriber @@ -8,6 +8,6 @@ INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); -- 2G + 3G subscriber -INSERT INTO subscriber (id, imsi) VALUES (3, '901990000000003'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (3, '901990000000003', '103'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); diff --git a/tests/test_subscriber.vty b/tests/test_subscriber.vty index 2e0bdce..2da455f 100644 --- a/tests/test_subscriber.vty +++ b/tests/test_subscriber.vty @@ -305,6 +305,7 @@ OPC=cededeffacedacefacedbadfadedbeef IND-bitlen=23 +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op C01ffedC1cadaeAc1d1f1edAcac1aB0a OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op CoiffedCicadaeAcidifiedAcaciaBoa % Invalid value for OP: 'CoiffedCicadaeAcidifiedAcaciaBoa' OsmoHLR# subscriber imsi 123456789023000 show @@ -313,8 +314,8 @@ MSISDN: 423 3G auth: MILENAGE K=deaf0ff1ced0d0dabbedd1ced1cef00d - OPC=cededeffacedacefacedbadfadedbeef - IND-bitlen=23 + OP=c01ffedc1cadaeac1d1f1edacac1ab0a + IND-bitlen=5 OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef OsmoHLR# subscriber id 1 show @@ -325,8 +326,8 @@ KI=cededeffacedacefacedbadfadedbeef 3G auth: MILENAGE K=deaf0ff1ced0d0dabbedd1ced1cef00d - OPC=cededeffacedacefacedbadfadedbeef - IND-bitlen=23 + OP=c01ffedc1cadaeac1d1f1edacac1ab0a + IND-bitlen=5 OsmoHLR# subscriber imsi 123456789023000 delete % Deleted subscriber for IMSI '123456789023000' diff --git a/tests/test_subscriber_errors.ctrl b/tests/test_subscriber_errors.ctrl new file mode 100644 index 0000000..2f64fdb --- /dev/null +++ b/tests/test_subscriber_errors.ctrl @@ -0,0 +1,107 @@ +GET 1 invalid +ERROR 1 Command not found +SET 2 invalid nonsense +ERROR 2 Command not found + +GET 3 subscriber.by-imsi-nonsense.info +ERROR 3 Invalid value part of 'by-xxx-value' selector. +GET 4 subscriber.by-msisdn-nonsense.info +ERROR 4 Invalid value part of 'by-xxx-value' selector. +GET 5 subscriber.by-id-nonsense.info +ERROR 5 Invalid value part of 'by-xxx-value' selector. + +GET 6 subscriber +ERROR 6 Command not present. +GET 7 subscriber. +ERROR 7 Command not present. +GET 8 subscriber.by-nonsense +ERROR 8 Command not present. +GET 9 subscriber.by-nonsense- +ERROR 9 Command not present. +GET 10 subscriber.by-nonsense-123456 +ERROR 10 Command not present. +GET 11 subscriber.by-nonsense-123456. +ERROR 11 Command not present. +GET 12 subscriber.by-imsi- +ERROR 12 Command not present. +GET 13 subscriber.by-imsi-. +ERROR 13 Command not present. +GET 14 subscriber.by-imsi-901990000000003 +ERROR 14 Command not present. +GET 15 subscriber.by-imsi-901990000000003. +ERROR 15 Command not present. + +GET 16 subscriber.by-nonsense-123456.info +ERROR 16 Not a known subscriber 'by-xxx-' selector. +GET 17 subscriber.by-123456.info +ERROR 17 Not a known subscriber 'by-xxx-' selector. + +GET 18 subscriber.by-imsi-.info +ERROR 18 Invalid value part of 'by-xxx-value' selector. +GET 19 subscriber.by-imsi--.info +ERROR 19 Invalid value part of 'by-xxx-value' selector. + +GET 20 subscriber.by-imsi-12345678901234567.info +ERROR 20 Invalid value part of 'by-xxx-value' selector. +GET 21 subscriber.by-imsi-12345.info +ERROR 21 Invalid value part of 'by-xxx-value' selector. +GET 22 subscriber.by-imsi-1234567890123456.info +ERROR 22 Invalid value part of 'by-xxx-value' selector. + +GET 23 subscriber.by-id-99999999999999999999999999.info +ERROR 23 Invalid value part of 'by-xxx-value' selector. +GET 24 subscriber.by-id-9223372036854775807.info +ERROR 24 No such subscriber. +GET 25 subscriber.by-id-9223372036854775808.info +ERROR 25 Invalid value part of 'by-xxx-value' selector. +GET 26 subscriber.by-id--1.info +ERROR 26 No such subscriber. +GET 27 subscriber.by-id--9223372036854775808.info +ERROR 27 No such subscriber. +GET 28 subscriber.by-id--9223372036854775809.info +ERROR 28 Invalid value part of 'by-xxx-value' selector. + +GET 29 subscriber.by-id-1+1.info +ERROR 29 Invalid value part of 'by-xxx-value' selector. +GET 30 subscriber.by-id--.info +ERROR 30 Invalid value part of 'by-xxx-value' selector. +GET 31 subscriber.by-id-+1.info +ERROR 31 Invalid value part of 'by-xxx-value' selector. +GET 32 subscriber.by-id-+-1.info +ERROR 32 Invalid value part of 'by-xxx-value' selector. +GET 33 subscriber.by-id--+1.info +ERROR 33 Invalid value part of 'by-xxx-value' selector. +GET 34 subscriber.by-id-++1.info +ERROR 34 Invalid value part of 'by-xxx-value' selector. +GET 35 subscriber.by-id---1.info +ERROR 35 Invalid value part of 'by-xxx-value' selector. + +GET 36 subscriber.by-id- 1.info +ERROR 36 Command not present. +GET 37 subscriber.by-id-+ 1.info +ERROR 37 Command not present. +GET 38 subscriber.by-id-- 1.info +ERROR 38 Command not present. + + +SET 39 subscriber.by-imsi-901990000000001.info foo +ERROR 39 Read Only attribute +SET 40 subscriber.by-imsi-901990000000001.info-aud foo +ERROR 40 Read Only attribute +SET 41 subscriber.by-imsi-901990000000001.info-all foo +ERROR 41 Read Only attribute + +SET 42 subscriber.by-imsi-901990000000001.ps-enabled nonsense +ERROR 42 Value failed verification. +SET 43 subscriber.by-imsi-901990000000001.cs-enabled nonsense +ERROR 43 Value failed verification. + +SET 44 subscriber.by-imsi-901990000000001.ps-enabled +ERROR err Command parser error. +SET 45 subscriber.by-imsi-901990000000001.cs-enabled +ERROR err Command parser error. + +GET 46 subscriber.by-imsi-1234567890123456.ps-enabled +ERROR 46 Invalid value part of 'by-xxx-value' selector. +GET 47 subscriber.by-imsi-1234567890123456.cs-enabled +ERROR 47 Invalid value part of 'by-xxx-value' selector. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 19 01:20:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 01:20:23 +0000 Subject: [PATCH] osmo-hlr[master]: test_subscriber.ctrl: test against octal/hex interpretation ... Message-ID: Review at https://gerrit.osmocom.org/4343 test_subscriber.ctrl: test against octal/hex interpretation of id Add a large enough subscriber id and add a test that ensures a leading zero is not interpreted as octal, and that a leading 0x is invalid and not interpreted as hexadecimal. Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173 --- M tests/test_subscriber.ctrl M tests/test_subscriber.sql 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/43/4343/1 diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl index 30dae00..1cb9db1 100644 --- a/tests/test_subscriber.ctrl +++ b/tests/test_subscriber.ctrl @@ -412,3 +412,12 @@ id 3 imsi 901990000000003 msisdn 103 + +GET 100 subscriber.by-id-00123.info +GET_REPLY 100 subscriber.by-id-00123.info +id 123 +imsi 123123 +msisdn 123 + +GET 101 subscriber.by-id-0x0123.info +ERROR 101 Invalid value part of 'by-xxx-value' selector. diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql index decd7d2..2f0efd7 100644 --- a/tests/test_subscriber.sql +++ b/tests/test_subscriber.sql @@ -11,3 +11,7 @@ INSERT INTO subscriber (id, imsi, msisdn) VALUES (3, '901990000000003', '103'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); + +-- A subscriber id > 7 and > 15 to check against octal and hex notations +INSERT INTO subscriber (id, imsi, msisdn) VALUES (123, '123123', '123'); +INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (123, 3, 'BeefedCafeFaceAcedAddedDecadeFee'); -- To view, visit https://gerrit.osmocom.org/4343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 19 01:24:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 01:24:06 +0000 Subject: osmo-hlr[master]: implement subscriber vty interface, tests In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/4273/2/src/hlr_vty_subscr.c File src/hlr_vty_subscr.c: Line 34: #define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) > what's tricky here is that it can only be used on a static buf[]. Having t I have instead renamed to hexdump_buf() in the most recent patch set. -- To view, visit https://gerrit.osmocom.org/4273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 19 04:32:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 04:32:46 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: common/vty: "programs should not use the telnet VTY" Message-ID: Review at https://gerrit.osmocom.org/4345 common/vty: "programs should not use the telnet VTY" Change-Id: Ic7e8c3663a2bfaf8dcb5752bf55ccb822b111c31 --- M common/chapters/vty.adoc 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/45/4345/1 diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index 17150b6..995fd2f 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -1,9 +1,17 @@ [[vty]] == The Osmocom VTY Interface -All interaction with Osmocom software is typically performed via an +All human interaction with Osmocom software is typically performed via an interactive command-line interface called the _VTY_. +NOTE: Integration of your programs and scripts should *not* be done via the +telnet VTY interface, which is intended for human interaction only: the VTY +responses may arbitrarily change in ways obvious to humans, while your scripts' +parsing will likely break often. For external software to interact with Osmocom +programs (besides using the dedicated protocols), it is strongly recommended to +use the Control interface instead of the VTY, and to actively request / +implement the Control interface commands as required for your use case. + The Osmocom VTY is used to * explore the current status of the system, including its configuration -- To view, visit https://gerrit.osmocom.org/4345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7e8c3663a2bfaf8dcb5752bf55ccb822b111c31 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 19 04:32:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 04:32:46 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: common/vty: fix: CONFIG entered from ENABLE, not VIEW node Message-ID: Review at https://gerrit.osmocom.org/4344 common/vty: fix: CONFIG entered from ENABLE, not VIEW node Change-Id: I892081f9452f8923441913f978a3be542a3c53d0 --- M common/chapters/vty.adoc 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/44/4344/1 diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index d84d5cf..17150b6 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -83,7 +83,7 @@ CONFIG:: The 'CONFIG' node is entered when you enter the `configure terminal` - command from the 'VIEW' node. The config node is used to change the + command from the 'ENABLE' node. The config node is used to change the run-time configuration parameters of teh system. The prompt will indicate that you are in the config node by a `(config)#` prompt suffix. -- To view, visit https://gerrit.osmocom.org/4344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I892081f9452f8923441913f978a3be542a3c53d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 19 04:32:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 04:32:46 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: common/vty: explain difference between telnet and config file Message-ID: Review at https://gerrit.osmocom.org/4346 common/vty: explain difference between telnet and config file - Mention that the CONFIG node is used to parse config files. - Mention that it is not well defined whether CONFIG node items have immediate effect. - Add a 'telnet' here and there to clarify. Change-Id: I882346c69f12c67d0e41d563c99d4de4efd8b8f6 --- M common/chapters/vty.adoc 1 file changed, 18 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/46/4346/1 diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index 995fd2f..51fc6f4 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -12,12 +12,13 @@ use the Control interface instead of the VTY, and to actively request / implement the Control interface commands as required for your use case. -The Osmocom VTY is used to +The interactive telnet VTY is used to * explore the current status of the system, including its configuration parameters but also run-time state and statistics * review the currently active (running) configuration -* perform interactive changes to the configuration +* perform interactive changes to the configuration (for those items that do not + require a program restart) * store the current running configuration to the config file * enable or disable logging; to the VTY itself or to other targets @@ -28,6 +29,20 @@ of options. The available commands depend on the current node. there are various keyboard shortcuts to ease finding commands and the possible argument values. + +Configuration file parsing during program start is actually performed the VTY's +CONFIG node, which is also available in the telnet VTY. Apart from that, the +telnet VTY features various interactive commands to query and instruct a +running Osmocom program. A main difference is that during config file parsing, +consistent indenting of parent vs. child nodes is required, while the +interactive VTY ignores indenting and relies on the 'exit' command to return to +a parent node. + +NOTE: In the 'CONFIG' node, it is not well documented which commands take +immediate effect without requiring a program restart. To save your current +config with changes you may have made, you may use the `write file` command to +*overwrite* your config file with the current configuration, after which you +should be able to restart the program with all changes taking effect. This chapter explains the most common nodes nodes and the commands that are available within the node. @@ -47,7 +62,7 @@ |`<0-10>`|`5`|A number from a range |=============== -=== Accessing the VTY +=== Accessing the telnet VTY The VTY of a given Osmocom program is implemented as a telnet server, listening to a specific TCP port. For `osmo-nitb`, this port is `4242`. -- To view, visit https://gerrit.osmocom.org/4346 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I882346c69f12c67d0e41d563c99d4de4efd8b8f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 19 04:32:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 04:32:47 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: common/vty: minor wording tweaks and typo fixes Message-ID: Review at https://gerrit.osmocom.org/4347 common/vty: minor wording tweaks and typo fixes Change-Id: I5eb1ea0d3de883ff5e9742f77e7ef4be0482852d --- M common/chapters/vty.adoc 1 file changed, 40 insertions(+), 41 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/47/4347/1 diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index 51fc6f4..3f72718 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -15,12 +15,12 @@ The interactive telnet VTY is used to * explore the current status of the system, including its configuration - parameters but also run-time state and statistics -* review the currently active (running) configuration + parameters, but also to view run-time state and statistics, +* review the currently active (running) configuration, * perform interactive changes to the configuration (for those items that do not - require a program restart) -* store the current running configuration to the config file -* enable or disable logging; to the VTY itself or to other targets + require a program restart), +* store the current running configuration to the config file, +* enable or disable logging; to the VTY itself or to other targets. The Virtual Tele Type (VTY) has the concept of __nodes__ and __commands__. Each command has a name and arguments. The name may @@ -44,8 +44,9 @@ *overwrite* your config file with the current configuration, after which you should be able to restart the program with all changes taking effect. -This chapter explains the most common nodes nodes and the commands that -are available within the node. +This chapter explains most of the common nodes and commands. A more detailed +list is available in various programs' VTY reference manuals, e.g. see +<>. There are common patterns for the parameters, these include IPv4 addresses, number ranges, a word, a line of text and choice. The @@ -88,14 +89,14 @@ The VTY by default has the following minimal nodes: VIEW:: - The 'VIEW' node is the node you automatically enter when you connect to - a VTY. As its name implies, it can only be used to view the system + When connecting to a telnet VTY, you will be on the 'VIEW' node. + As its name implies, it can only be used to view the system status, but it does not provide commands to alter the system state or configuration. As long as you are in the non-privileged 'VIEW' node, your prompt will end in a `>` character. ENABLE:: - The 'ENABLE' node is entered as soon as you enter the `enable` command + The 'ENABLE' node is entered by the `enable` command, from the 'VIEW' node. Changing into the 'ENABLE' node will unlock all kinds of commands that allow you to alter the system state or perform any other change to it. The 'ENABLE' node and its children are @@ -105,9 +106,9 @@ the `disable` command. CONFIG:: - The 'CONFIG' node is entered when you enter the `configure terminal` + The 'CONFIG' node is entered by the `configure terminal` command from the 'ENABLE' node. The config node is used to change the - run-time configuration parameters of teh system. The prompt will + run-time configuration parameters of the system. The prompt will indicate that you are in the config node by a `(config)#` prompt suffix. + @@ -130,15 +131,15 @@ The VTY features an interactive help system, designed to help you to efficiently navigate is commands. -NOTE: The VTY is present on most Osmcoom GSM/GPRS software, thus this -chapter is present in all the relevant manuals. The detailed examples +NOTE: The VTY is present on most Osmocom GSM/UMTS/GPRS software, thus this +chapter is present in all the relevant manuals. The detailed examples below assume you are executing them on the OsmoNITB VTY. They will work -in similar fashion on the other VTY, too - but of course the output will -be different for each program. +in similar fashion on the other VTY interfaces, while the node structure will +differ in each program. ==== The question-mark (`?`) command -If you type a single `?` at the prompt, the VTY will display you +If you type a single `?` at the prompt, the VTY will display possible completions at the exact location of your currently entered command. @@ -160,14 +161,13 @@ sms SMS related commands subscriber Operations on a Subscriber ---- -<1> press `?` here at the prompt, the character will not be printed +<1> Type `?` here at the prompt, the `?` itself will not be printed. If you have already entered a partial command, `?` will help you to -review possible options of how to continue your command. Let's say you -remember that `show` is used to investigate the system status. But you -don't know exactly what the object was called that you'd like to show: -You simply press `?` after typing `show` and you will see the following -choice: +review possible options of how to continue the command. Let's say you +remember that `show` is used to investigate the system status, but you +don't remember the exact name of the object. Hitting `?` after typing `show` +will help out: .Example: Typing `?` after a partial command ---- @@ -193,10 +193,9 @@ sms-queue Display SMSqueue statistics smpp SMPP Interface ---- -<1> press `?` after the `show` command, the character will not be printed +<1> Type `?` after the `show` command, the `?` itself will not be printed. -Now you decide you want to have a look at the `network` object, so -you type network and press `?` again: +You may pick the `network` object and type `?` again: .Example: Typing `?` after `show network` ---- @@ -204,25 +203,25 @@ ---- -By presenting `` as the only option, the VTY tells you that your -command is complete and does not support any additional arguments. +By presenting `` as the only option, the VTY tells you that your command is +complete without any remaining arguments being available, and that you should +hit enter, a.k.a. "carriage return". ==== TAB completion -The VTY supports tab (tabulator) completion. Simply type any partial -command and press ``, and it will either show you a choice of -possible continuations, or complete the command if there's only one -alternative. +The VTY supports tab (tabulator) completion. Simply type any partial +command and press ``, and it will either show you a list of +possible expansions, or completes the command if there's only one +choice. .Example: Use of `` pressed after typing only `s` as command ---- OpenBSC> s<1> show sms subscriber ---- -<1> press `` here. +<1> Type `` here. -At this point you then have to decide how to continue typing your -command. Let's assume you choose `show`, and then press `` again: +At this point, you may choose `show`, and then press `` again: .Example: Use of `` pressed after typing `show` command ---- @@ -232,13 +231,13 @@ stats e1_driver e1_line e1_timeslot subscriber statistics sms-queue smpp ---- -<1> press `` here. +<1> Type `` here. ==== The `list` command -The `list` command will give you a full list of all commands available -at this node: +The `list` command will give you a full list of all commands and their +arguments available at the current node: .Example: Typing `list` at start of OsmoNITB 'VIEW' node prompt ---- @@ -294,9 +293,9 @@ ---- TIP: Remember, the list of available commands will change significantly -depending on the Osmocom program you are accessing, and the current node -you're at. Compare the above example of the OsmoNITB 'VIEW' node with -the result from the OsmoNITB 'TRX' config node: +depending on the Osmocom program you are accessing, its software version and +the current node you're at. Compare the above example of the OsmoNITB 'VIEW' +node with the list of the OsmoNITB 'TRX' config node: .Example: Typing `list` at start of OsmoNITB 'TRX' config node prompt ---- -- To view, visit https://gerrit.osmocom.org/4347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5eb1ea0d3de883ff5e9742f77e7ef4be0482852d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 19 04:33:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 04:33:02 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: add OsmoHLR manual, OsmoHLR VTY reference Message-ID: Review at https://gerrit.osmocom.org/4348 add OsmoHLR manual, OsmoHLR VTY reference Change-Id: Ieb6a362a26a7e65199f68f5cd32d9b6b0e5d0fbf --- M Makefile A OsmoHLR/Makefile A OsmoHLR/chapters/control.adoc A OsmoHLR/chapters/overview.adoc A OsmoHLR/chapters/running.adoc A OsmoHLR/chapters/subscribers.adoc A OsmoHLR/example_subscriber_add_update_delete.vty A OsmoHLR/example_subscriber_cs_ps_enabled.ctrl A OsmoHLR/example_subscriber_info.ctrl A OsmoHLR/osmohlr-usermanual-docinfo.xml A OsmoHLR/osmohlr-usermanual.adoc A OsmoHLR/osmohlr-vty-reference.xml A OsmoHLR/vty/hlr_vty_additions.xml A OsmoHLR/vty/hlr_vty_reference.xml M OsmoMSC/chapters/running.adoc 15 files changed, 1,755 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/48/4348/1 diff --git a/Makefile b/Makefile index ffa25de..7c87838 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean cd OsmoMSC; $(MAKE) clean + cd OsmoHLR; $(MAKE) clean upload: cd OsmoBTS; $(MAKE) upload @@ -33,6 +34,7 @@ cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload cd OsmoMSC; $(MAKE) upload + cd OsmoHLR; $(MAKE) upload check: cd OsmoBTS; $(MAKE) check @@ -46,6 +48,7 @@ #cd OsmoNAT; $(MAKE) check cd OsmoGSMTester; $(MAKE) check cd OsmoMSC; $(MAKE) check + cd OsmoHLR; $(MAKE) check define check_dep_bin @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; } diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile new file mode 100644 index 0000000..eba5fa3 --- /dev/null +++ b/OsmoHLR/Makefile @@ -0,0 +1,42 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +topdir = . +hlr_reference = $(topdir)/osmohlr-vty-reference.xml +manuals = $(hlr_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + +TOPDIR := .. +ASCIIDOCS := osmohlr-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmohlr-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml + +clean: + -rm -rf $(cleanfiles) + -rm osmohlr-usermanual__*.svg + -rm osmohlr-usermanual__*.png + -rm osmohlr-usermanual.check + +generated/docbook_vty.xml: osmohlr-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/hlr_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging Common BSC VTY) + $(call command,xsltproc -o generated/combined3.xml \ + --stringparam with $(PWD)/vty/hlr_vty_additions.xml \ + $(MERGE_DOC) generated/combined2.xml, \ + XSLTPROC,Merging HLR VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting HLR VTY to DocBook) diff --git a/OsmoHLR/chapters/control.adoc b/OsmoHLR/chapters/control.adoc new file mode 100644 index 0000000..89c9c08 --- /dev/null +++ b/OsmoHLR/chapters/control.adoc @@ -0,0 +1,101 @@ +[[hlr-ctrl]] +== Control interface + +The actual protocol is described in <>, the variables common +to all programs using it are described in <>. This section +describes the CTRL interface variables specific to OsmoHLR. + +All subscriber variables are available by different selectors, which are freely +interchangeable: + +.Subscriber selectors available on OsmoHLR's Control interface +[options="header",width="100%",cols="35%,65%"] +|=== +|Selector|Comment +|subscriber.*by-imsi-*'123456'.*|Subscriber selector by IMSI, replace "123456" with the actual IMSI +|subscriber.*by-msisdn-*'123456'.*|Subscriber selector by MSISDN +|subscriber.*by-id-*'123456'.*|Subscriber selector by database ID +|=== + +Each of the above selectors feature all of these control variables: + +.Subscriber variables available on OsmoHLR's Control interface +[options="header",width="100%",cols="35%,8%,8%,8%,41%"] +|=== +|Name|Access|Trap|Value|Comment +|subscriber.by-\*.*info*|R|No||List (short) subscriber information +|subscriber.by-\*.*info-aud*|R|No||List subscriber authentication tokens +|subscriber.by-\*.*info-all*|R|No||List both 'info' and 'info-aud' in one +|subscriber.by-\*.*cs-enabled*|RW|No|'1' or '0'|Enable/disable circuit-switched access +|subscriber.by-\*.*ps-enabled*|RW|No|'1' or '0'|Enable/disable packet-switched access +|=== + +=== subscriber.by-*.info, info-aud, info-all + +Query the HLR database and return current subscriber record, in multiple lines +of the format + +---- +namevalue +---- + +To keep the reply as short as possible, most values are omitted if they are +empty or reflect the default. These are the returned values and their presence +modalities; for their meaning, see <>: + +.Returned values by OsmoHLR's 'info', 'info-all' and 'info-aud' commands +[options="header",width="100%",cols="15%,15%,30%,40%"] +|=== +|Returned by 'info-all' and|Name|Format|Presence +|'info'|id|-9223372036854775808 .. 9223372036854775807 (usually not negative)|always +|'info'|imsi|6 to 15 decimal digits|always +|'info'|msisdn|1 to 15 decimal digits|when non-empty +|'info'|nam_cs|'1' or '0'|when '0' +|'info'|nam_ps|'1' or '0'|when '0' +|'info'|vlr_number|up to 15 decimal digits|when non-empty +|'info'|sgsn_number|up to 15 decimal digits|when non-empty +|'info'|sgsn_address||when non-empty +|'info-aud'|aud2g.algo|one of 'comp128v1', 'comp128v2', 'comp128v3' or 'xor'|when valid 2G auth data is set +|'info-aud'|aud2g.ki|32 hexadecimal digits|when valid 2G auth data is set +|'info-aud'|aud3g.algo|so far always 'milenage'|when valid 3G auth data is set +|'info-aud'|aud3g.k|32 hexadecimal digits|when valid 3G auth data is set +|'info-aud'|aud3g.op|32 hexadecimal digits|when valid 3G auth data is set, *not* when OPC is set +|'info-aud'|aud3g.opc|32 hexadecimal digits|when valid 3G auth data is set, *not* when OP is set +|'info-aud'|aud3g.ind_bitlen|0..28|when valid 3G auth data is set +|'info-aud'|aud3g.sqn|0 .. 18446744073709551615|when valid 3G auth data is set +|=== + +This is an example Control Interface transcript that illustrates the various +'info' commands: + +---- +include::../example_subscriber_info.ctrl[] +---- + +=== subscriber.by-*.ps-enabled, cs-enabled + +Disable or enable packet-/circuit-switched access for the given IMSI; + +* 'ps-enabled' switches access to GPRS or UMTS data services, +* 'cs-enabled' switches access to voice services. + +When disabled, the next time this subscriber attempts to do a Location Updating +GSUP operation for the given domain (i.e. from the SGSN for 'ps-enabled', from +the MSC/VLR for 'cs-enabled'), it will be rejected by OsmoHLR. Currently +connected GSUP clients will be notified via GSUP when a subscriber is being +disabled, so that the subscriber can be dropped in case it is currently +attached. + +The current 'ps-enabled'/'cs-enabled' status can be queried by 'GET' commands, +and also by looking at 'nam_ps' and 'nam_cs' in a 'subscriber.by-*.info' +response. + +A value of "1" indicates that the given domain is enabled, which is the +default; a value of "0" disables access. + +This is an example transcript that illustrates 'ps-enabled' and 'cs-enabled' +commands: + +---- +include::../example_subscriber_cs_ps_enabled.ctrl[] +---- diff --git a/OsmoHLR/chapters/overview.adoc b/OsmoHLR/chapters/overview.adoc new file mode 100644 index 0000000..45802ca --- /dev/null +++ b/OsmoHLR/chapters/overview.adoc @@ -0,0 +1,69 @@ +[[overview]] +== Overview + +This manual should help you getting started with OsmoHLR. It will cover +aspects of configuring and running the OsmoHLR. + +[[intro_overview]] +=== About OsmoHLR + +OsmoHLR is Osmocom's minimal implementation of a Home Location Register (HLR) +for 2G and 3G GSM and UMTS mobile core networks. Its interfaces are: + +- GSUP, serving towards OsmoMSC and OsmoSGSN; +- A local SQLite database; +- The Osmocom typical telnet VTY and CTRL interfaces. + +Originally, the OpenBSC project's OsmoNITB all-in-one implementation had an +integrated HLR, managing subscribers and SMS in the same local database. Along +with the separate OsmoMSC and its new VLR component, OsmoHLR was implemented +from scratch to alleviate various shortcomings of the internal HLR: + +- The separate HLR allows using centralized subscriber management for both + circuit-switched and packet-switched domains (i.e. one OsmoHLR for both + OsmoMSC and OsmoSGSN). + +- VLR and HLR brought full UMTS AKA (Authentication and Key Agreement) support, + i.e. Milenage authentication in both the full 3G variant as well as the + backwards compatible 2G variant. + +- In contrast to the OsmoNITB, the specific way the new OsmoMSC's VLR accesses + OsmoHLR brings fully asynchronous subscriber database access. + +Find the OsmoHLR issue tracker and wiki online at + +- https://osmocom.org/projects/osmo-hlr +- https://osmocom.org/projects/osmo-hlr/wiki + + +[[fig-gsm]] +.Typical GSM network architecture used with OsmoHLR +[graphviz] +---- +digraph G { + rankdir=LR; + subgraph cluster_hlr { + label = "OsmoHLR"; + GSUP [label="GSUP server"] + DB [label="SQLite DB"] + GSUP->DB + DB->CTRL [dir="back"] + DB->VTY [dir="back"] + } + + Admin [label="Admin and\nMaintenance"] + SW [label="3rd party software\nintegration"] + VTY->Admin [dir="back"] + CTRL->SW [dir="back"] + + MSC [label="MSC/VLR"] + MSC->GSUP [label="GSUP"] + SGSN->GSUP [label="GSUP"] + + BSC->MSC + HNBGW->MSC + HNBGW->SGSN + PCU->SGSN +} +---- + diff --git a/OsmoHLR/chapters/running.adoc b/OsmoHLR/chapters/running.adoc new file mode 100644 index 0000000..09388c0 --- /dev/null +++ b/OsmoHLR/chapters/running.adoc @@ -0,0 +1,90 @@ +== Running OsmoHLR + +The OsmoHLR executable (`osmo-hlr`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-hlr* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-T] [-e 'LOGLEVEL'] [-l 'DATABASE'] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-d, --debug 'DBGMASK','DBGLEVELS'*:: + Set the log subsystems and levels for logging to stderr. This + has mostly been superseded by VTY-based logging configuration, + see <> for further information. +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `openbsc.cfg` in the current + working directory. +*-s, --disable-color*:: + Disable colors for logging to stderr. This has mostly been + deprecated by VTY based logging configuration, see <> + for more information. +*-T, --timestamp*:: + Enable time-stamping of log messages to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-e, --log-level 'LOGLEVEL'*:: + Set the global log level for logging to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-l, --database 'DATABASE'*:: + Specify the file name of the SQLite3 database to use as HLR/AUC + storage + +=== Bootstrap the Database + +Before first launching OsmoHLR, you need to create a database, which can be +done with these commands: + +---- +mkdir -p /var/lib/osmocom +sqlite3 /var/lib/osmocom/hlr.db < /usr/share/doc/osmo-hlr/hlr.sql +---- + +Depending on your installation choices, you will probably find `hlr.sql` in one +of these locations: + +- `/usr/share/doc/osmo-hlr/hlr.sql` +- `/usr/local/share/doc/osmo-hlr/hlr.sql` +- in `osmo-hlr.git`'s source tree at `sql/hlr.sql` + +NOTE: At the time of writing, OsmoHLR does not create an initial empty database +automatically, like OsmoNITB did. This behavior may be added in the future. + +=== Multiple instances + +Running multiple instances of `osmo-hlr` on the same computer is possible if +all interfaces (VTY, CTRL) are separated using the appropriate configuration +options. The IP based interfaces are binding to local host by default. In order +to separate the processes, the user has to bind those services to specific but +different IP addresses and/or ports. + +The VTY and the Control interface can be bound to IP addresses from the loopback +address range, for example: + +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- + +The GSUP interface can be bound to a specific IP address by the following +configuration options: + +---- +hlr + gsup + bind ip 10.23.42.1 +---- + +NOTE: At the time of writing, OsmoHLR lacks a config option to change the GSUP +port, which is by default TCP port 4222. diff --git a/OsmoHLR/chapters/subscribers.adoc b/OsmoHLR/chapters/subscribers.adoc new file mode 100644 index 0000000..b2024d2 --- /dev/null +++ b/OsmoHLR/chapters/subscribers.adoc @@ -0,0 +1,59 @@ +== Managing Subscribers + +Subscribers are kept in a local SQLite database file and can be managed via VTY +and CTRL interfaces. + +See this section for some examples, and also refer to the OsmoHLR VTY reference +manual <> as well as the Control interface described in +<>. + +=== Example: Add/Update/Delete Subscriber via VTY + +The following telnet VTY session adds a subscriber complete with 2G and 3G +authentication tokens, and finally removes the subscriber again; it assumes +that osmo-hlr is running and listening for telnet VTY connections on localhost: + +---- +$ telnet localhost 4258 +include::../example_subscriber_add_update_delete.vty[] +---- + +[[subscriber-params]] +=== Subscriber Parameters + +The following parameters are managed for each subscriber of the HLR, modelled +roughly after 3GPP TS 23.008, version 13.3.0; note that not all of these +parameters are necessarily in active use: + +.OsmoHLR's subscriber parameters +[options="header",width="100%",cols="20%,20%,60%"] +|=== +|Name|Example|Description +|imsi|901700000014701|identity of the SIM/USIM, 3GPP TS 23.008 chapter 2.1.1.1 +|msisdn|2342123|number to dial to reach this subscriber (multiple MSISDNs can be stored per subscriber), 3GPP TS 23.008 chapter 2.1.2 +|imeisv|4234234234234275|identity of the mobile device and software version, 3GPP TS 23.008 chapter 2.2.3 +|aud2g.algo|comp128v3|Authentication algorithm ID for 2G, corresponds to enum osmo_auth_algo +|aud2g.ki||Subscriber's secret key (128bit) +|aud3g.algo|milenage|Authentication algorithm ID for 3G and UMTS AKA, corresponds to enum osmo_auth_algo +|aud3g.k|(32 hexadecimal digits)|Subscriber's secret key (128bit) +|aud3g.op|(32 hexadecimal digits)|Operator's secret key (128bit) +|aud3g.opc|(32 hexadecimal digits)|Secret key derived from OP and K (128bit), alternative to using OP which does not disclose OP to subscribers +|aud3g.sqn|123|Sequence number of last used key (64bit unsigned) +|aud3g.ind_bitlen|5|Nr of index bits at lower SQN end +|apn|| +|vlr_number||3GPP TS 23.008 chapter 2.4.5 +|hlr_number||3GPP TS 23.008 chapter 2.4.6 +|sgsn_number||3GPP TS 23.008 chapter 2.4.8.1 +|sgsn_address||3GPP TS 23.008 chapter 2.13.10 +|ggsn_number||3GPP TS 23.008 chapter 2.4.8.2 +|gmlc_number||3GPP TS 23.008 chapter 2.4.9.2 +|smsc_number||3GPP TS 23.008 chapter 2.4.23 +|periodic_lu_tmr||3GPP TS 23.008 chapter 2.4.24 +|periodic_rau_tau_tmr||3GPP TS 23.008 chapter 2.13.115 +|nam_cs|1|Enable/disable voice access (3GPP TS 23.008 chapter 2.1.1.2: network access mode) +|nam_ps|0|Enable/disable data access (3GPP TS 23.008 chapter 2.1.1.2: network access mode) +|lmsi||3GPP TS 23.008 chapter 2.1.8 +|ms_purged_cs|0|3GPP TS 23.008 chapter 2.7.5 +|ms_purged_ps|1|3GPP TS 23.008 chapter 2.7.6 +|=== + diff --git a/OsmoHLR/example_subscriber_add_update_delete.vty b/OsmoHLR/example_subscriber_add_update_delete.vty new file mode 100644 index 0000000..ca14a65 --- /dev/null +++ b/OsmoHLR/example_subscriber_add_update_delete.vty @@ -0,0 +1,34 @@ +OsmoHLR> enable +OsmoHLR# subscriber imsi 123456789023000 create +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + +OsmoHLR# subscriber imsi 123456789023000 update msisdn 423 +% Updated subscriber IMSI='123456789023000' to MSISDN='423' + +OsmoHLR# subscriber msisdn 423 update aud3g milenage k deaf0ff1ced0d0dabbedd1ced1cef00d opc cededeffacedacefacedbadfadedbeef +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=5 + +OsmoHLR# subscriber msisdn 423 update aud2g comp128v3 ki beefedcafefaceacedaddeddecadefee +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=beefedcafefaceacedaddeddecadefee + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=5 + +OsmoHLR# subscriber imsi 123456789023000 delete +% Deleted subscriber for IMSI '123456789023000' diff --git a/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl b/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl new file mode 100644 index 0000000..1a98a80 --- /dev/null +++ b/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl @@ -0,0 +1,46 @@ +GET 1 subscriber.by-msisdn-103.info +GET_REPLY 1 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 2 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 2 subscriber.by-msisdn-103.ps-enabled 1 + +SET 3 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 3 subscriber.by-msisdn-103.ps-enabled OK + +GET 4 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 4 subscriber.by-msisdn-103.ps-enabled 0 + +GET 5 subscriber.by-msisdn-103.info +GET_REPLY 5 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_ps 0 + +SET 6 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 6 subscriber.by-msisdn-103.cs-enabled OK + +GET 7 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 7 subscriber.by-msisdn-103.cs-enabled 0 + +GET 8 subscriber.by-msisdn-103.info +GET_REPLY 8 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 + +SET 9 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 9 subscriber.by-msisdn-103.cs-enabled OK +SET 10 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 10 subscriber.by-msisdn-103.ps-enabled OK + +GET 11 subscriber.by-msisdn-103.info +GET_REPLY 11 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 diff --git a/OsmoHLR/example_subscriber_info.ctrl b/OsmoHLR/example_subscriber_info.ctrl new file mode 100644 index 0000000..2020508 --- /dev/null +++ b/OsmoHLR/example_subscriber_info.ctrl @@ -0,0 +1,28 @@ +GET 1 subscriber.by-imsi-901990000000003.info +GET_REPLY 1 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 2 subscriber.by-msisdn-103.info-aud +GET_REPLY 2 subscriber.by-msisdn-103.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 3 subscriber.by-id-3.info-all +GET_REPLY 3 subscriber.by-id-3.info-all +id 3 +imsi 901990000000003 +msisdn 103 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 diff --git a/OsmoHLR/osmohlr-usermanual-docinfo.xml b/OsmoHLR/osmohlr-usermanual-docinfo.xml new file mode 100644 index 0000000..d99bba7 --- /dev/null +++ b/OsmoHLR/osmohlr-usermanual-docinfo.xml @@ -0,0 +1,47 @@ + + + 1 + September 18th, 2017 + NH + + Initial version; based on OsmoNITB manual version 2. + + + + + + + Neels + Hofmeyr + nhofmeyr at sysmocom.de + NH + + sysmocom + sysmocom - s.f.m.c. GmbH + Senior Developer + + + + + + 2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with the Invariant Sections being just 'Foreword', + 'Acknowledgements' and 'Preface', with no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoHLR/osmohlr-usermanual.adoc b/OsmoHLR/osmohlr-usermanual.adoc new file mode 100644 index 0000000..2369155 --- /dev/null +++ b/OsmoHLR/osmohlr-usermanual.adoc @@ -0,0 +1,32 @@ +:gfdl-enabled: +:program-name: OsmoHLR + +OsmoHLR User Manual +==================== +Neels Hofmeyr + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +include::chapters/subscribers.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + +include::chapters/control.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] + diff --git a/OsmoHLR/osmohlr-vty-reference.xml b/OsmoHLR/osmohlr-vty-reference.xml new file mode 100644 index 0000000..948f5f9 --- /dev/null +++ b/OsmoHLR/osmohlr-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 18th September 2017 + nh + Initial + + + + OsmoHLR VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoHLR/vty/hlr_vty_additions.xml b/OsmoHLR/vty/hlr_vty_additions.xml new file mode 100644 index 0000000..a4c675e --- /dev/null +++ b/OsmoHLR/vty/hlr_vty_additions.xml @@ -0,0 +1,2 @@ + + diff --git a/OsmoHLR/vty/hlr_vty_reference.xml b/OsmoHLR/vty/hlr_vty_reference.xml new file mode 100644 index 0000000..31b95a1 --- /dev/null +++ b/OsmoHLR/vty/hlr_vty_reference.xml @@ -0,0 +1,1159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OsmoMSC/chapters/running.adoc b/OsmoMSC/chapters/running.adoc index 5925e02..8656a58 100644 --- a/OsmoMSC/chapters/running.adoc +++ b/OsmoMSC/chapters/running.adoc @@ -49,11 +49,11 @@ === Multiple instances -Running multiple instances of `osmo-msc` is possible if all interfaces (VTY, -CTRL) are separated using the appropriate configuration options. The IP based -interfaces are binding to local host by default. In order to separate the -processes, the user has to bind those services to specific but different IP -addresses. +Running multiple instances of `osmo-msc` on the same computer is possible if all +interfaces (VTY, CTRL) are separated using the appropriate configuration +options. The IP based interfaces are binding to local host by default. In order +to separate the processes, the user has to bind those services to specific but +different IP addresses and/or ports. The VTY and the Control interface can be bound to IP addresses from the loopback address range, for example: -- To view, visit https://gerrit.osmocom.org/4348 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb6a362a26a7e65199f68f5cd32d9b6b0e5d0fbf Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 19 04:33:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 04:33:15 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: refactor Makefile build rules, don't use the FORCE In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3985 to look at the new patch set (#3). refactor Makefile build rules, don't use the FORCE The initial goal was to make sure we don't have overall FORCE rules causing unnecessary rebuilds -- annoying while writing documentation. As I looked through possible dependencies, I finally understood what's going on here. Remove code dup and nicely sort which belongs where in build/Makefile.*.inc. In each, describe in a top comment how to use it, and also unify how they are used: - Rename Makefile.inc to Makefile.docbook.inc and refactor - Add Makefile.vty-reference.inc - Add Makefile.common.inc Make sure that we accurately pick up all dependencies. Drop use of the macro called 'command', that silenced the actual command lines invoked and replaced them with short strings: it obscures what is actually going on and makes the Makefiles hard to read and understand. Each manual's makefile is greatly reduced to few definitions and a Makefile include, e.g. one for asciidoc, one for VTY reference. Move common/bsc_vty_additions.xml to OsmoBSC/vty/libbsc_vty_additions.xml, link from OsmoNITB. It applies only to OsmoBSC and OsmoNITB. Add a script that combines a VTY reference file with *all* additions files found in a manual's vty/ dir. Call this from Makefile.vty-reference.inc. Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 --- M OsmoBSC/Makefile R OsmoBSC/vty/libbsc_vty_additions.xml M OsmoBTS/Makefile M OsmoGGSN/Makefile M OsmoGSMTester/Makefile M OsmoHLR/Makefile M OsmoMGCP/Makefile M OsmoMSC/Makefile M OsmoNAT/Makefile M OsmoNITB/Makefile A OsmoNITB/vty/bsc_vty_additions.xml M OsmoPCU/Makefile M OsmoSGSN/Makefile M build/Makefile.asciidoc.inc A build/Makefile.common.inc A build/Makefile.docbook.inc D build/Makefile.inc A build/Makefile.vty-reference.inc A build/vty_reference_combine.sh 19 files changed, 203 insertions(+), 443 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/85/3985/3 diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index 35f50da..1533482 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -1,54 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. - -EXTRA_DEPS = gen-bsc-vty-docbook - -topdir = . -bsc_reference = $(topdir)/osmobsc-vty-reference.xml -manuals = $(bsc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobsc-usermanual osmux-reference aoip-mgw-options - +ASCIIDOC = osmobsc-usermanual.adoc osmux-reference.adoc aoip-mgw-options.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmobsc-usermanual.pdf: chapters/*.adoc -osmux-reference.pdf: osmux-reference.adoc -aoip-mgw-options.pdf: aoip-mgw-options.adoc +aoip-mgw-options.pdf: aoip-mgw-options.adoc mgw/*.msc -clean: - -rm -rf $(cleanfiles) - -rm osmobsc-usermanual__*.png - -rm osmobsc-usermanual__*.svg - -rm osmobsc-usermanual*.check - -rm osmux-reference*.check - -rm aoip-mgw-options*.png - -rm aoip-mgw-options*.svg - -rm aoip-mgw-options*.check - -rm osmux-reference__*.svg - -rm osmux-reference__*.png - -rm osmux-reference__*.check +VTY_REFERENCE = osmobsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bsc-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bsc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/common/bsc_vty_additions.xml b/OsmoBSC/vty/libbsc_vty_additions.xml similarity index 100% rename from common/bsc_vty_additions.xml rename to OsmoBSC/vty/libbsc_vty_additions.xml diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 58df0e3..e1ff214 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -1,50 +1,12 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-bts-vty-docbook - -topdir = . -bts_reference = $(topdir)/osmobts-vty-reference.xml -manuals = $(bts_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobts-usermanual osmobts-abis rtp-amr - +ASCIIDOC = osmobts-usermanual.adoc osmobts-abis.adoc rtp-amr.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - -osmobts-abis.pdf: abis/*.adoc abis/*.msc osmobts-usermanual.pdf: chapters/*.adoc +osmobts-abis.pdf: abis/*.adoc abis/*.msc +rtp-amr.pdf: dtx.dot -clean: - -rm -rf $(cleanfiles) - -rm osmobts-abis__*.png - -rm osmobts-abis__*.svg - -rm rtp-amr__*.png - -rm rtp-amr__*.svg - -rm osmobts-usermanual__*.png - -rm osmobts-usermanual__*.svg - -rm osmobts-abis*.check - -rm osmobts-usermanual*.check +VTY_REFERENCE = osmobts-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bts-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bts_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bts_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BTS VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BTS VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile index 2dfedb2..e809632 100644 --- a/OsmoGGSN/Makefile +++ b/OsmoGGSN/Makefile @@ -1,39 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-ggsn-vty-docbook - -topdir = . -ggsn_reference = $(topdir)/osmoggsn-vty-reference.xml -manuals = $(ggsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmoggsn-usermanual - +ASCIIDOC = osmoggsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmoggsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmoggsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmoggsn-usermanual__*.svg osmoggsn-usermanual__*.png - -rm osmoggsn-usermanual.check - -gen-ggsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/ggsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/ggsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging GGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting GGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGSMTester/Makefile b/OsmoGSMTester/Makefile index 79d414f..43c5a37 100644 --- a/OsmoGSMTester/Makefile +++ b/OsmoGSMTester/Makefile @@ -1,12 +1,7 @@ -TOPDIR := .. -ASCIIDOCS := osmo-gsm-tester-manual +TOPDIR = .. +ASCIIDOC = osmo-gsm-tester-manual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmo-gsm-tester-manual.pdf: chapters/*.adoc - -clean: - -rm -rf $(cleanfiles) - -rm osmo-gsm-tester-manual__*.svg - -rm osmo-gsm-tester-manual__*.png +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile index eba5fa3..a9dc393 100644 --- a/OsmoHLR/Makefile +++ b/OsmoHLR/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -hlr_reference = $(topdir)/osmohlr-vty-reference.xml -manuals = $(hlr_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmohlr-usermanual - +ASCIIDOC = osmohlr-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc *.vty *.ctrl include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmohlr-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmohlr-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmohlr-usermanual__*.svg - -rm osmohlr-usermanual__*.png - -rm osmohlr-usermanual.check - -generated/docbook_vty.xml: osmohlr-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/hlr_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/hlr_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging HLR VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting HLR VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMGCP/Makefile b/OsmoMGCP/Makefile index 9aff12b..e2a5e37 100644 --- a/OsmoMGCP/Makefile +++ b/OsmoMGCP/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-mgcp-vty-docbook +VTY_REFERENCE = osmomgcp-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -mgcp_reference = $(topdir)/osmomgcp-vty-reference.xml -manuals = $(mgcp_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-mgcp-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/mgcp_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/mgcp_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging MGCP VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MGCP VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile index febf7d1..c9edcef 100644 --- a/OsmoMSC/Makefile +++ b/OsmoMSC/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -msc_reference = $(topdir)/osmomsc-vty-reference.xml -manuals = $(msc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmomsc-usermanual - +ASCIIDOC = osmomsc-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmomsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmomsc-usermanual__*.svg - -rm osmomsc-usermanual__*.png - -rm osmomsc-usermanual.check - -generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/msc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/msc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging MSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNAT/Makefile b/OsmoNAT/Makefile index d7302e6..fde7132 100644 --- a/OsmoNAT/Makefile +++ b/OsmoNAT/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nat-vty-docbook +VTY_REFERENCE = osmonat-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -nat_reference = $(topdir)/osmonat-vty-reference.xml -manuals = $(nat_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-nat-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nat_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/nat_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging NAT VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NAT VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/Makefile b/OsmoNITB/Makefile index 99cd317..0cd260d 100644 --- a/OsmoNITB/Makefile +++ b/OsmoNITB/Makefile @@ -1,44 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nitb-vty-docbook - -topdir = . -nitb_reference = $(topdir)/osmonitb-vty-reference.xml -manuals = $(nitb_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmonitb-usermanual - +ASCIIDOC = osmonitb-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmonitb-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmonitb-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmonitb-usermanual__*.svg - -rm osmonitb-usermanual__*.png - -rm osmonitb-usermanual.check - -gen-nitb-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nitb_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/nitb_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging NITB VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NITB VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/vty/bsc_vty_additions.xml b/OsmoNITB/vty/bsc_vty_additions.xml new file mode 120000 index 0000000..5def5f1 --- /dev/null +++ b/OsmoNITB/vty/bsc_vty_additions.xml @@ -0,0 +1 @@ +../../OsmoBSC/vty/bsc_vty_additions.xml \ No newline at end of file diff --git a/OsmoPCU/Makefile b/OsmoPCU/Makefile index a83b909..7a1acc0 100644 --- a/OsmoPCU/Makefile +++ b/OsmoPCU/Makefile @@ -1,45 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-vty-docbook - -topdir = . -pcu_reference = $(topdir)/osmopcu-vty-reference.xml -manuals = $(bts_manual) $(pcu_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmopcu-usermanual osmopcu-gb - +ASCIIDOC = osmopcu-usermanual.adoc osmopcu-gb.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmopcu-gb.pdf: gb/*.adoc gb/*.msc osmopcu-usermanual.pdf: chapters/*.adoc -clean: - -rm -rf $(cleanfiles) - -rm -rf gen-vty-docbook - -rm osmopcu-usermanual__*.png - -rm osmopcu-usermanual__*.svg - -rm osmopcu-usermanual.check +VTY_REFERENCE = osmopcu-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/osmo-pcu_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/osmo-pcu_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging PCU VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting PCU VTY to DocBook) - - - +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoSGSN/Makefile b/OsmoSGSN/Makefile index 6f7d28d..baa1a49 100644 --- a/OsmoSGSN/Makefile +++ b/OsmoSGSN/Makefile @@ -1,43 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-sgsn-vty-docbook - -topdir = . -sgsn_reference = $(topdir)/osmosgsn-vty-reference.xml -manuals = $(sgsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmosgsn-usermanual - +ASCIIDOC = osmosgsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmosgsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmosgsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmosgsn-usermanual__*.svg osmosgsn-usermanual__*.png - -rm osmosgsn-usermanual.check - -gen-sgsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/sgsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/sgsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging SGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting SGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index e088624..a28a5bb 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -1,19 +1,38 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'ASCIIDOC' all root .adoc files, +# - optionally define in 'ASCIIDOC_DEPS' all dependencies common to all .adocs, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# ASCIIDOC = osmo_yada.adoc osmo_moo.adoc +# ASCIIDOC_DEPS = for_all/*.adoc +# include $(TOPDIR)/build/Makefile.asciidoc.inc +# osmo_yada.pdf: yada/*.adoc yada/*.msc + BUILDDIR = $(TOPDIR)/build GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags) GIT_DATE := $(shell $(TOPDIR)/build/unix-time-to-fmt.py `git log -n 1 "--pretty=%at" ../.`) # prepend the document name with the version numbe suffix -#DOCS_VER = $(foreach P, $(ASCIIDOCS), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) +#DOCS_VER = $(foreach P, $(ASCIIDOC_NAME), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) #PDFS = $(DOCS_VER:%=%.pdf) # generate list of PDFs that we're supposed to render -ASCIIDOCPDFS = $(ASCIIDOCS:%=%.pdf) -ASCIIDOC_CHECKS = $(ASCIIDOCS:%=%.check) +ASCIIDOC_NAME = $(patsubst %.adoc,%,$(ASCIIDOC)) +ASCIIDOC_PDF = $(ASCIIDOC_NAME:%=%.pdf) +ASCIIDOC_CHECKS = $(ASCIIDOC_NAME:%=%.check) ASCIIDOCSTYLE ?= $(BUILDDIR)/custom-dblatex.sty -cleanfiles += $(ASCIIDOCPDFS) +CLEAN_FILES += $(ASCIIDOC_NAME:%=%__*.png) $(ASCIIDOC_NAME:%=%__*.svg) $(ASCIIDOC_CHECKS) +CLEAN_FILES += $(ASCIIDOC_PDF) +UPLOAD_FILES += $(ASCIIDOC_PDF) ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -f $(BUILDDIR)/python2-filter.conf DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0 @@ -27,9 +46,13 @@ A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" --dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(REVNUMBER)" -a revdate="$(GIT_DATE)" -all: $(ASCIIDOCPDFS) +all: $(ASCIIDOC_PDF) -$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc +$(ASCIIDOC_PDF): %.pdf: %.adoc %-docinfo.xml \ + $(ASCIIDOC_DEPS) \ + $(ASCIIDOCSTYLE) \ + $(TOPDIR)/common/*/*.adoc \ + $(TOPDIR)/common/images/* @test -n "$(BUILD_RELEASE)" && echo -e "\n\n\ NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\ and remove three lines starting with '% \"DRAFT\" on first page'\n" \ diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc new file mode 100644 index 0000000..e624b5f --- /dev/null +++ b/build/Makefile.common.inc @@ -0,0 +1,14 @@ +# Usage: +# +# Other makefiles like Makefile.asciidoc.inc and Makefile.vty-reference.inc add +# entries to UPLOAD_FILES and CLEAN_FILES. +# +# Include this file at the end to have 'upload' and 'clean' targets. + +UPLOAD_PATH ?= generic at sysmocom-downloads:documents + +upload: $(UPLOAD_FILES) + rsync -avz $(UPLOAD_FILES) $(UPLOAD_PATH)/ + +clean: + -rm -rf $(CLEAN_FILES) diff --git a/build/Makefile.docbook.inc b/build/Makefile.docbook.inc new file mode 100644 index 0000000..70dfafa --- /dev/null +++ b/build/Makefile.docbook.inc @@ -0,0 +1,35 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'DOCBOOKS' all root .xml files, +# - optionally define in 'DOCBOOKS_DEPS' all dependencies common to all .xmls, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# DOCBOOKS = osmo_yada.xml osmo_moo.xml +# ASCIIDOC_DEPS = for_all/*.xml +# include $(TOPDIR)/build/Makefile.docbook.inc +# osmo_yada.pdf: yada/*.xml +# +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals, edited. + +DOCBOOKS_PDF = $(patsubst %.xml,%.pdf,$(DOCBOOKS)) +lint = $(patsubst %.xml,%.lint,$(DOCBOOKS)) + +CLEAN_FILES += $(DOCBOOKS_PDF) $(lint) +UPLOAD_FILES += $(DOCBOOKS_PDF) + +all: $(DOCBOOKS_PDF) + +# Lint the file +%.xml-lint: %.xml + xmllint --xinclude --postvalid --noout $< + +# Create a PDF file and lint it before +%.pdf: %.xml %.xml-lint $(DOCBOOKS_DEPS) + dblatex $(dblatex_quiet) -P draft.mode=no $< + diff --git a/build/Makefile.inc b/build/Makefile.inc deleted file mode 100644 index 3905cb0..0000000 --- a/build/Makefile.inc +++ /dev/null @@ -1,47 +0,0 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals - -LIBOSMO_DIR ?= ~/source/gsm/libosmocore -MERGE_DOC := $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl -UPLOAD_PATH ?= generic at sysmocom-downloads:documents - -pdfs = $(patsubst %.xml,%.pdf,$(manuals)) -lint = $(patsubst %.xml,%.xml-lint,$(manuals)) - -#cleanfiles = $(foreach i,$(types),$(topdir)/$(i)) -cleanfiles += $(pdfs) $(lint) - -ifdef DEBUG -dblatex_quiet = -define command - $(1) -endef -else -dblatex_quiet = -q -define command - @echo $(2) $(3) - @$(1) -endef -endif - -all: $(types) - - -$(types): FORCE - - -pdf: $(pdfs) $(manuals) - - -# Lint the file -%.xml-lint: %.xml FORCE - $(call command,xmllint --xinclude --postvalid --noout $<,XMLLINT,$<) - -# Create a PDF file and lint it before -%.pdf: %.xml %.xml-lint $(EXTRA_DEPS) FORCE - $(call command,dblatex $(dblatex_quiet) -P draft.mode=no $<,DBLATEX,$<) - -upload: $(pdfs) $(ASCIIDOCPDFS) - rsync -avz $(pdfs) $(ASCIIDOCPDFS) $(UPLOAD_PATH)/ - -FORCE: diff --git a/build/Makefile.vty-reference.inc b/build/Makefile.vty-reference.inc new file mode 100644 index 0000000..1a27068 --- /dev/null +++ b/build/Makefile.vty-reference.inc @@ -0,0 +1,40 @@ +# Usage: +# Have files: +# - osmoyada-vty-reference.xml +# A docbook root XML including a &chapter-vty; reference. +# - vty/*additions*.xml +# Manual additions to specific VTY nodes, any number of files. +# - vty/*_reference.xml +# Export from VTY 'show online-help', exactly one file. +# +# In your Makefile, +# - define 'TOPDIR' to point at the git root, +# - define the (single) name of the vty-reference source in VTY_REFERENCE, +# - include this file. +# +# e.g. +# +# TOPDIR = .. +# VTY_REFERENCE = osmofoo-vty-reference +# include $(TOPDIR)/build/Makefile.vty-reference.inc +# +# This uses the Makefile.docbook.inc, you should not mix uses of +# Makefile.vty-reference.inc and Makefile.docbook.inc. + +DOCBOOKS = $(VTY_REFERENCE) +DOCBOOKS_DEPS = generated/docbook_vty.xml +include $(TOPDIR)/build/Makefile.docbook.inc + +LIBOSMO_DIR ?= ~/source/gsm/libosmocore +MERGE_DOC = $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl + +generated/docbook_vty.xml: \ + vty/*xml \ + $(TOPDIR)/common/vty_additions.xml \ + $(TOPDIR)/common/chapters/vty.xml \ + $(TOPDIR)/vty_reference.xsl + $(TOPDIR)/build/vty_reference_combine.sh "$(MERGE_DOC)" \ + $(TOPDIR)/common/vty_additions.xml \ + vty/*additions*.xml + xsltproc $(TOPDIR)/vty_reference.xsl generated/combined.xml \ + > generated/docbook_vty.xml diff --git a/build/vty_reference_combine.sh b/build/vty_reference_combine.sh new file mode 100755 index 0000000..45d9ac6 --- /dev/null +++ b/build/vty_reference_combine.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -e + +# the first argument should point at libosmocore/doc/vty/merge_doc.xsl +MERGE_DOC="$1" +shift + +combined="generated/combined.xml" +combine_src="generated/combine_src.xml" + +reference="vty/*reference.xml" +test "$(ls -1 $reference | wc -l)" = "1" + +set -x +cp $reference "$combined" + +while [ -n "$1" ]; do + addition="$(realpath "$1")" + shift + mv "$combined" "$combine_src" + xsltproc -o "$combined" \ + --stringparam with "$addition" \ + "$MERGE_DOC" "$combine_src" +done -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 19 04:39:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 04:39:05 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: refactor Makefile build rules, don't use the FORCE In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3985 to look at the new patch set (#4). refactor Makefile build rules, don't use the FORCE The initial goal was to make sure we don't have overall FORCE rules causing unnecessary rebuilds -- annoying while writing documentation. As I looked through possible dependencies, I finally understood what's going on here. Remove code dup and nicely sort which belongs where in build/Makefile.*.inc. In each, describe in a top comment how to use it, and also unify how they are used: - Rename Makefile.inc to Makefile.docbook.inc and refactor - Add Makefile.vty-reference.inc - Add Makefile.common.inc Make sure that we accurately pick up all dependencies. Drop use of the macro called 'command', that silenced the actual command lines invoked and replaced them with short strings: it obscures what is actually going on and makes the Makefiles hard to read and understand. Each manual's makefile is greatly reduced to few definitions and a Makefile include, e.g. one for asciidoc, one for VTY reference. Move common/bsc_vty_additions.xml to OsmoBSC/vty/libbsc_vty_additions.xml, link from OsmoNITB. It applies only to OsmoBSC and OsmoNITB. Add a script that combines a VTY reference file with *all* additions files found in a manual's vty/ dir. Call this from Makefile.vty-reference.inc. Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 --- M OsmoBSC/Makefile R OsmoBSC/vty/libbsc_vty_additions.xml M OsmoBTS/Makefile M OsmoGGSN/Makefile M OsmoGSMTester/Makefile M OsmoHLR/Makefile M OsmoMGCP/Makefile M OsmoMSC/Makefile M OsmoNAT/Makefile M OsmoNITB/Makefile A OsmoNITB/vty/bsc_vty_additions.xml M OsmoPCU/Makefile M OsmoSGSN/Makefile M build/Makefile.asciidoc.inc A build/Makefile.common.inc A build/Makefile.docbook.inc D build/Makefile.inc A build/Makefile.vty-reference.inc A build/vty_reference_combine.sh 19 files changed, 206 insertions(+), 443 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/85/3985/4 diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index 35f50da..1533482 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -1,54 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. - -EXTRA_DEPS = gen-bsc-vty-docbook - -topdir = . -bsc_reference = $(topdir)/osmobsc-vty-reference.xml -manuals = $(bsc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobsc-usermanual osmux-reference aoip-mgw-options - +ASCIIDOC = osmobsc-usermanual.adoc osmux-reference.adoc aoip-mgw-options.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmobsc-usermanual.pdf: chapters/*.adoc -osmux-reference.pdf: osmux-reference.adoc -aoip-mgw-options.pdf: aoip-mgw-options.adoc +aoip-mgw-options.pdf: aoip-mgw-options.adoc mgw/*.msc -clean: - -rm -rf $(cleanfiles) - -rm osmobsc-usermanual__*.png - -rm osmobsc-usermanual__*.svg - -rm osmobsc-usermanual*.check - -rm osmux-reference*.check - -rm aoip-mgw-options*.png - -rm aoip-mgw-options*.svg - -rm aoip-mgw-options*.check - -rm osmux-reference__*.svg - -rm osmux-reference__*.png - -rm osmux-reference__*.check +VTY_REFERENCE = osmobsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bsc-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bsc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/common/bsc_vty_additions.xml b/OsmoBSC/vty/libbsc_vty_additions.xml similarity index 100% rename from common/bsc_vty_additions.xml rename to OsmoBSC/vty/libbsc_vty_additions.xml diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 58df0e3..e1ff214 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -1,50 +1,12 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-bts-vty-docbook - -topdir = . -bts_reference = $(topdir)/osmobts-vty-reference.xml -manuals = $(bts_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobts-usermanual osmobts-abis rtp-amr - +ASCIIDOC = osmobts-usermanual.adoc osmobts-abis.adoc rtp-amr.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - -osmobts-abis.pdf: abis/*.adoc abis/*.msc osmobts-usermanual.pdf: chapters/*.adoc +osmobts-abis.pdf: abis/*.adoc abis/*.msc +rtp-amr.pdf: dtx.dot -clean: - -rm -rf $(cleanfiles) - -rm osmobts-abis__*.png - -rm osmobts-abis__*.svg - -rm rtp-amr__*.png - -rm rtp-amr__*.svg - -rm osmobts-usermanual__*.png - -rm osmobts-usermanual__*.svg - -rm osmobts-abis*.check - -rm osmobts-usermanual*.check +VTY_REFERENCE = osmobts-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bts-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bts_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bts_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BTS VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BTS VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile index 2dfedb2..e809632 100644 --- a/OsmoGGSN/Makefile +++ b/OsmoGGSN/Makefile @@ -1,39 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-ggsn-vty-docbook - -topdir = . -ggsn_reference = $(topdir)/osmoggsn-vty-reference.xml -manuals = $(ggsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmoggsn-usermanual - +ASCIIDOC = osmoggsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmoggsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmoggsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmoggsn-usermanual__*.svg osmoggsn-usermanual__*.png - -rm osmoggsn-usermanual.check - -gen-ggsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/ggsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/ggsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging GGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting GGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGSMTester/Makefile b/OsmoGSMTester/Makefile index 79d414f..43c5a37 100644 --- a/OsmoGSMTester/Makefile +++ b/OsmoGSMTester/Makefile @@ -1,12 +1,7 @@ -TOPDIR := .. -ASCIIDOCS := osmo-gsm-tester-manual +TOPDIR = .. +ASCIIDOC = osmo-gsm-tester-manual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmo-gsm-tester-manual.pdf: chapters/*.adoc - -clean: - -rm -rf $(cleanfiles) - -rm osmo-gsm-tester-manual__*.svg - -rm osmo-gsm-tester-manual__*.png +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile index eba5fa3..a9dc393 100644 --- a/OsmoHLR/Makefile +++ b/OsmoHLR/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -hlr_reference = $(topdir)/osmohlr-vty-reference.xml -manuals = $(hlr_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmohlr-usermanual - +ASCIIDOC = osmohlr-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc *.vty *.ctrl include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmohlr-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmohlr-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmohlr-usermanual__*.svg - -rm osmohlr-usermanual__*.png - -rm osmohlr-usermanual.check - -generated/docbook_vty.xml: osmohlr-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/hlr_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/hlr_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging HLR VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting HLR VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMGCP/Makefile b/OsmoMGCP/Makefile index 9aff12b..e2a5e37 100644 --- a/OsmoMGCP/Makefile +++ b/OsmoMGCP/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-mgcp-vty-docbook +VTY_REFERENCE = osmomgcp-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -mgcp_reference = $(topdir)/osmomgcp-vty-reference.xml -manuals = $(mgcp_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-mgcp-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/mgcp_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/mgcp_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging MGCP VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MGCP VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile index febf7d1..c9edcef 100644 --- a/OsmoMSC/Makefile +++ b/OsmoMSC/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -msc_reference = $(topdir)/osmomsc-vty-reference.xml -manuals = $(msc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmomsc-usermanual - +ASCIIDOC = osmomsc-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmomsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmomsc-usermanual__*.svg - -rm osmomsc-usermanual__*.png - -rm osmomsc-usermanual.check - -generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/msc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/msc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging MSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNAT/Makefile b/OsmoNAT/Makefile index d7302e6..fde7132 100644 --- a/OsmoNAT/Makefile +++ b/OsmoNAT/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nat-vty-docbook +VTY_REFERENCE = osmonat-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -nat_reference = $(topdir)/osmonat-vty-reference.xml -manuals = $(nat_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-nat-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nat_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/nat_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging NAT VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NAT VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/Makefile b/OsmoNITB/Makefile index 99cd317..0cd260d 100644 --- a/OsmoNITB/Makefile +++ b/OsmoNITB/Makefile @@ -1,44 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nitb-vty-docbook - -topdir = . -nitb_reference = $(topdir)/osmonitb-vty-reference.xml -manuals = $(nitb_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmonitb-usermanual - +ASCIIDOC = osmonitb-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmonitb-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmonitb-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmonitb-usermanual__*.svg - -rm osmonitb-usermanual__*.png - -rm osmonitb-usermanual.check - -gen-nitb-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nitb_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/nitb_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging NITB VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NITB VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/vty/bsc_vty_additions.xml b/OsmoNITB/vty/bsc_vty_additions.xml new file mode 120000 index 0000000..5def5f1 --- /dev/null +++ b/OsmoNITB/vty/bsc_vty_additions.xml @@ -0,0 +1 @@ +../../OsmoBSC/vty/bsc_vty_additions.xml \ No newline at end of file diff --git a/OsmoPCU/Makefile b/OsmoPCU/Makefile index a83b909..7a1acc0 100644 --- a/OsmoPCU/Makefile +++ b/OsmoPCU/Makefile @@ -1,45 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-vty-docbook - -topdir = . -pcu_reference = $(topdir)/osmopcu-vty-reference.xml -manuals = $(bts_manual) $(pcu_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmopcu-usermanual osmopcu-gb - +ASCIIDOC = osmopcu-usermanual.adoc osmopcu-gb.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmopcu-gb.pdf: gb/*.adoc gb/*.msc osmopcu-usermanual.pdf: chapters/*.adoc -clean: - -rm -rf $(cleanfiles) - -rm -rf gen-vty-docbook - -rm osmopcu-usermanual__*.png - -rm osmopcu-usermanual__*.svg - -rm osmopcu-usermanual.check +VTY_REFERENCE = osmopcu-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/osmo-pcu_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/osmo-pcu_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging PCU VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting PCU VTY to DocBook) - - - +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoSGSN/Makefile b/OsmoSGSN/Makefile index 6f7d28d..baa1a49 100644 --- a/OsmoSGSN/Makefile +++ b/OsmoSGSN/Makefile @@ -1,43 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-sgsn-vty-docbook - -topdir = . -sgsn_reference = $(topdir)/osmosgsn-vty-reference.xml -manuals = $(sgsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmosgsn-usermanual - +ASCIIDOC = osmosgsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmosgsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmosgsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmosgsn-usermanual__*.svg osmosgsn-usermanual__*.png - -rm osmosgsn-usermanual.check - -gen-sgsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/sgsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/sgsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging SGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting SGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index e088624..a28a5bb 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -1,19 +1,38 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'ASCIIDOC' all root .adoc files, +# - optionally define in 'ASCIIDOC_DEPS' all dependencies common to all .adocs, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# ASCIIDOC = osmo_yada.adoc osmo_moo.adoc +# ASCIIDOC_DEPS = for_all/*.adoc +# include $(TOPDIR)/build/Makefile.asciidoc.inc +# osmo_yada.pdf: yada/*.adoc yada/*.msc + BUILDDIR = $(TOPDIR)/build GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags) GIT_DATE := $(shell $(TOPDIR)/build/unix-time-to-fmt.py `git log -n 1 "--pretty=%at" ../.`) # prepend the document name with the version numbe suffix -#DOCS_VER = $(foreach P, $(ASCIIDOCS), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) +#DOCS_VER = $(foreach P, $(ASCIIDOC_NAME), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) #PDFS = $(DOCS_VER:%=%.pdf) # generate list of PDFs that we're supposed to render -ASCIIDOCPDFS = $(ASCIIDOCS:%=%.pdf) -ASCIIDOC_CHECKS = $(ASCIIDOCS:%=%.check) +ASCIIDOC_NAME = $(patsubst %.adoc,%,$(ASCIIDOC)) +ASCIIDOC_PDF = $(ASCIIDOC_NAME:%=%.pdf) +ASCIIDOC_CHECKS = $(ASCIIDOC_NAME:%=%.check) ASCIIDOCSTYLE ?= $(BUILDDIR)/custom-dblatex.sty -cleanfiles += $(ASCIIDOCPDFS) +CLEAN_FILES += $(ASCIIDOC_NAME:%=%__*.png) $(ASCIIDOC_NAME:%=%__*.svg) $(ASCIIDOC_CHECKS) +CLEAN_FILES += $(ASCIIDOC_PDF) +UPLOAD_FILES += $(ASCIIDOC_PDF) ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -f $(BUILDDIR)/python2-filter.conf DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0 @@ -27,9 +46,13 @@ A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" --dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(REVNUMBER)" -a revdate="$(GIT_DATE)" -all: $(ASCIIDOCPDFS) +all: $(ASCIIDOC_PDF) -$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc +$(ASCIIDOC_PDF): %.pdf: %.adoc %-docinfo.xml \ + $(ASCIIDOC_DEPS) \ + $(ASCIIDOCSTYLE) \ + $(TOPDIR)/common/*/*.adoc \ + $(TOPDIR)/common/images/* @test -n "$(BUILD_RELEASE)" && echo -e "\n\n\ NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\ and remove three lines starting with '% \"DRAFT\" on first page'\n" \ diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc new file mode 100644 index 0000000..e624b5f --- /dev/null +++ b/build/Makefile.common.inc @@ -0,0 +1,14 @@ +# Usage: +# +# Other makefiles like Makefile.asciidoc.inc and Makefile.vty-reference.inc add +# entries to UPLOAD_FILES and CLEAN_FILES. +# +# Include this file at the end to have 'upload' and 'clean' targets. + +UPLOAD_PATH ?= generic at sysmocom-downloads:documents + +upload: $(UPLOAD_FILES) + rsync -avz $(UPLOAD_FILES) $(UPLOAD_PATH)/ + +clean: + -rm -rf $(CLEAN_FILES) diff --git a/build/Makefile.docbook.inc b/build/Makefile.docbook.inc new file mode 100644 index 0000000..70dfafa --- /dev/null +++ b/build/Makefile.docbook.inc @@ -0,0 +1,35 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'DOCBOOKS' all root .xml files, +# - optionally define in 'DOCBOOKS_DEPS' all dependencies common to all .xmls, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# DOCBOOKS = osmo_yada.xml osmo_moo.xml +# ASCIIDOC_DEPS = for_all/*.xml +# include $(TOPDIR)/build/Makefile.docbook.inc +# osmo_yada.pdf: yada/*.xml +# +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals, edited. + +DOCBOOKS_PDF = $(patsubst %.xml,%.pdf,$(DOCBOOKS)) +lint = $(patsubst %.xml,%.lint,$(DOCBOOKS)) + +CLEAN_FILES += $(DOCBOOKS_PDF) $(lint) +UPLOAD_FILES += $(DOCBOOKS_PDF) + +all: $(DOCBOOKS_PDF) + +# Lint the file +%.xml-lint: %.xml + xmllint --xinclude --postvalid --noout $< + +# Create a PDF file and lint it before +%.pdf: %.xml %.xml-lint $(DOCBOOKS_DEPS) + dblatex $(dblatex_quiet) -P draft.mode=no $< + diff --git a/build/Makefile.inc b/build/Makefile.inc deleted file mode 100644 index 3905cb0..0000000 --- a/build/Makefile.inc +++ /dev/null @@ -1,47 +0,0 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals - -LIBOSMO_DIR ?= ~/source/gsm/libosmocore -MERGE_DOC := $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl -UPLOAD_PATH ?= generic at sysmocom-downloads:documents - -pdfs = $(patsubst %.xml,%.pdf,$(manuals)) -lint = $(patsubst %.xml,%.xml-lint,$(manuals)) - -#cleanfiles = $(foreach i,$(types),$(topdir)/$(i)) -cleanfiles += $(pdfs) $(lint) - -ifdef DEBUG -dblatex_quiet = -define command - $(1) -endef -else -dblatex_quiet = -q -define command - @echo $(2) $(3) - @$(1) -endef -endif - -all: $(types) - - -$(types): FORCE - - -pdf: $(pdfs) $(manuals) - - -# Lint the file -%.xml-lint: %.xml FORCE - $(call command,xmllint --xinclude --postvalid --noout $<,XMLLINT,$<) - -# Create a PDF file and lint it before -%.pdf: %.xml %.xml-lint $(EXTRA_DEPS) FORCE - $(call command,dblatex $(dblatex_quiet) -P draft.mode=no $<,DBLATEX,$<) - -upload: $(pdfs) $(ASCIIDOCPDFS) - rsync -avz $(pdfs) $(ASCIIDOCPDFS) $(UPLOAD_PATH)/ - -FORCE: diff --git a/build/Makefile.vty-reference.inc b/build/Makefile.vty-reference.inc new file mode 100644 index 0000000..baf9cf5 --- /dev/null +++ b/build/Makefile.vty-reference.inc @@ -0,0 +1,42 @@ +# Usage: +# Have files: +# - osmoyada-vty-reference.xml +# A docbook root XML including a &chapter-vty; reference. +# - vty/*additions*.xml +# Manual additions to specific VTY nodes, any number of files. +# - vty/*_reference.xml +# Export from VTY 'show online-help', exactly one file. +# +# In your Makefile, +# - define 'TOPDIR' to point at the git root, +# - define the (single) name of the vty-reference source in VTY_REFERENCE, +# - include this file. +# +# e.g. +# +# TOPDIR = .. +# VTY_REFERENCE = osmofoo-vty-reference +# include $(TOPDIR)/build/Makefile.vty-reference.inc +# +# This uses the Makefile.docbook.inc, you should not mix uses of +# Makefile.vty-reference.inc and Makefile.docbook.inc. + +DOCBOOKS = $(VTY_REFERENCE) +DOCBOOKS_DEPS = generated/docbook_vty.xml +include $(TOPDIR)/build/Makefile.docbook.inc + +LIBOSMO_DIR ?= ~/source/gsm/libosmocore +MERGE_DOC = $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl + +CLEAN_FILES += generated + +generated/docbook_vty.xml: \ + vty/*xml \ + $(TOPDIR)/common/vty_additions.xml \ + $(TOPDIR)/common/chapters/vty.xml \ + $(TOPDIR)/vty_reference.xsl + $(TOPDIR)/build/vty_reference_combine.sh "$(MERGE_DOC)" \ + $(TOPDIR)/common/vty_additions.xml \ + vty/*additions*.xml + xsltproc $(TOPDIR)/vty_reference.xsl generated/combined.xml \ + > generated/docbook_vty.xml diff --git a/build/vty_reference_combine.sh b/build/vty_reference_combine.sh new file mode 100755 index 0000000..be234a7 --- /dev/null +++ b/build/vty_reference_combine.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +# the first argument should point at libosmocore/doc/vty/merge_doc.xsl +MERGE_DOC="$1" +shift + +combined="generated/combined.xml" +combine_src="generated/combine_src.xml" + +reference="vty/*reference.xml" +test "$(ls -1 $reference | wc -l)" = "1" + +set -x +mkdir -p generated +cp $reference "$combined" + +while [ -n "$1" ]; do + addition="$(realpath "$1")" + shift + mv "$combined" "$combine_src" + xsltproc -o "$combined" \ + --stringparam with "$addition" \ + "$MERGE_DOC" "$combine_src" +done -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 19 04:43:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 04:43:59 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: add OsmoHLR manual, OsmoHLR VTY reference In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4348 to look at the new patch set (#2). add OsmoHLR manual, OsmoHLR VTY reference Change-Id: Ieb6a362a26a7e65199f68f5cd32d9b6b0e5d0fbf --- M Makefile A OsmoHLR/Makefile A OsmoHLR/chapters/control.adoc A OsmoHLR/chapters/overview.adoc A OsmoHLR/chapters/running.adoc A OsmoHLR/chapters/subscribers.adoc A OsmoHLR/example_subscriber_add_update_delete.vty A OsmoHLR/example_subscriber_cs_ps_enabled.ctrl A OsmoHLR/example_subscriber_info.ctrl A OsmoHLR/osmohlr-usermanual-docinfo.xml A OsmoHLR/osmohlr-usermanual.adoc A OsmoHLR/osmohlr-vty-reference.xml A OsmoHLR/vty/hlr_vty_additions.xml A OsmoHLR/vty/hlr_vty_reference.xml M OsmoMSC/chapters/running.adoc 15 files changed, 1,756 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/48/4348/2 diff --git a/Makefile b/Makefile index ffa25de..8f8d9b6 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) cd OsmoMSC; $(MAKE) + cd OsmoHLR; $(MAKE) clean: cd OsmoBTS; $(MAKE) clean @@ -21,6 +22,7 @@ cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean cd OsmoMSC; $(MAKE) clean + cd OsmoHLR; $(MAKE) clean upload: cd OsmoBTS; $(MAKE) upload @@ -33,6 +35,7 @@ cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload cd OsmoMSC; $(MAKE) upload + cd OsmoHLR; $(MAKE) upload check: cd OsmoBTS; $(MAKE) check @@ -46,6 +49,7 @@ #cd OsmoNAT; $(MAKE) check cd OsmoGSMTester; $(MAKE) check cd OsmoMSC; $(MAKE) check + cd OsmoHLR; $(MAKE) check define check_dep_bin @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; } diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile new file mode 100644 index 0000000..eba5fa3 --- /dev/null +++ b/OsmoHLR/Makefile @@ -0,0 +1,42 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +topdir = . +hlr_reference = $(topdir)/osmohlr-vty-reference.xml +manuals = $(hlr_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + +TOPDIR := .. +ASCIIDOCS := osmohlr-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmohlr-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml + +clean: + -rm -rf $(cleanfiles) + -rm osmohlr-usermanual__*.svg + -rm osmohlr-usermanual__*.png + -rm osmohlr-usermanual.check + +generated/docbook_vty.xml: osmohlr-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/hlr_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging Common BSC VTY) + $(call command,xsltproc -o generated/combined3.xml \ + --stringparam with $(PWD)/vty/hlr_vty_additions.xml \ + $(MERGE_DOC) generated/combined2.xml, \ + XSLTPROC,Merging HLR VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting HLR VTY to DocBook) diff --git a/OsmoHLR/chapters/control.adoc b/OsmoHLR/chapters/control.adoc new file mode 100644 index 0000000..89c9c08 --- /dev/null +++ b/OsmoHLR/chapters/control.adoc @@ -0,0 +1,101 @@ +[[hlr-ctrl]] +== Control interface + +The actual protocol is described in <>, the variables common +to all programs using it are described in <>. This section +describes the CTRL interface variables specific to OsmoHLR. + +All subscriber variables are available by different selectors, which are freely +interchangeable: + +.Subscriber selectors available on OsmoHLR's Control interface +[options="header",width="100%",cols="35%,65%"] +|=== +|Selector|Comment +|subscriber.*by-imsi-*'123456'.*|Subscriber selector by IMSI, replace "123456" with the actual IMSI +|subscriber.*by-msisdn-*'123456'.*|Subscriber selector by MSISDN +|subscriber.*by-id-*'123456'.*|Subscriber selector by database ID +|=== + +Each of the above selectors feature all of these control variables: + +.Subscriber variables available on OsmoHLR's Control interface +[options="header",width="100%",cols="35%,8%,8%,8%,41%"] +|=== +|Name|Access|Trap|Value|Comment +|subscriber.by-\*.*info*|R|No||List (short) subscriber information +|subscriber.by-\*.*info-aud*|R|No||List subscriber authentication tokens +|subscriber.by-\*.*info-all*|R|No||List both 'info' and 'info-aud' in one +|subscriber.by-\*.*cs-enabled*|RW|No|'1' or '0'|Enable/disable circuit-switched access +|subscriber.by-\*.*ps-enabled*|RW|No|'1' or '0'|Enable/disable packet-switched access +|=== + +=== subscriber.by-*.info, info-aud, info-all + +Query the HLR database and return current subscriber record, in multiple lines +of the format + +---- +namevalue +---- + +To keep the reply as short as possible, most values are omitted if they are +empty or reflect the default. These are the returned values and their presence +modalities; for their meaning, see <>: + +.Returned values by OsmoHLR's 'info', 'info-all' and 'info-aud' commands +[options="header",width="100%",cols="15%,15%,30%,40%"] +|=== +|Returned by 'info-all' and|Name|Format|Presence +|'info'|id|-9223372036854775808 .. 9223372036854775807 (usually not negative)|always +|'info'|imsi|6 to 15 decimal digits|always +|'info'|msisdn|1 to 15 decimal digits|when non-empty +|'info'|nam_cs|'1' or '0'|when '0' +|'info'|nam_ps|'1' or '0'|when '0' +|'info'|vlr_number|up to 15 decimal digits|when non-empty +|'info'|sgsn_number|up to 15 decimal digits|when non-empty +|'info'|sgsn_address||when non-empty +|'info-aud'|aud2g.algo|one of 'comp128v1', 'comp128v2', 'comp128v3' or 'xor'|when valid 2G auth data is set +|'info-aud'|aud2g.ki|32 hexadecimal digits|when valid 2G auth data is set +|'info-aud'|aud3g.algo|so far always 'milenage'|when valid 3G auth data is set +|'info-aud'|aud3g.k|32 hexadecimal digits|when valid 3G auth data is set +|'info-aud'|aud3g.op|32 hexadecimal digits|when valid 3G auth data is set, *not* when OPC is set +|'info-aud'|aud3g.opc|32 hexadecimal digits|when valid 3G auth data is set, *not* when OP is set +|'info-aud'|aud3g.ind_bitlen|0..28|when valid 3G auth data is set +|'info-aud'|aud3g.sqn|0 .. 18446744073709551615|when valid 3G auth data is set +|=== + +This is an example Control Interface transcript that illustrates the various +'info' commands: + +---- +include::../example_subscriber_info.ctrl[] +---- + +=== subscriber.by-*.ps-enabled, cs-enabled + +Disable or enable packet-/circuit-switched access for the given IMSI; + +* 'ps-enabled' switches access to GPRS or UMTS data services, +* 'cs-enabled' switches access to voice services. + +When disabled, the next time this subscriber attempts to do a Location Updating +GSUP operation for the given domain (i.e. from the SGSN for 'ps-enabled', from +the MSC/VLR for 'cs-enabled'), it will be rejected by OsmoHLR. Currently +connected GSUP clients will be notified via GSUP when a subscriber is being +disabled, so that the subscriber can be dropped in case it is currently +attached. + +The current 'ps-enabled'/'cs-enabled' status can be queried by 'GET' commands, +and also by looking at 'nam_ps' and 'nam_cs' in a 'subscriber.by-*.info' +response. + +A value of "1" indicates that the given domain is enabled, which is the +default; a value of "0" disables access. + +This is an example transcript that illustrates 'ps-enabled' and 'cs-enabled' +commands: + +---- +include::../example_subscriber_cs_ps_enabled.ctrl[] +---- diff --git a/OsmoHLR/chapters/overview.adoc b/OsmoHLR/chapters/overview.adoc new file mode 100644 index 0000000..45802ca --- /dev/null +++ b/OsmoHLR/chapters/overview.adoc @@ -0,0 +1,69 @@ +[[overview]] +== Overview + +This manual should help you getting started with OsmoHLR. It will cover +aspects of configuring and running the OsmoHLR. + +[[intro_overview]] +=== About OsmoHLR + +OsmoHLR is Osmocom's minimal implementation of a Home Location Register (HLR) +for 2G and 3G GSM and UMTS mobile core networks. Its interfaces are: + +- GSUP, serving towards OsmoMSC and OsmoSGSN; +- A local SQLite database; +- The Osmocom typical telnet VTY and CTRL interfaces. + +Originally, the OpenBSC project's OsmoNITB all-in-one implementation had an +integrated HLR, managing subscribers and SMS in the same local database. Along +with the separate OsmoMSC and its new VLR component, OsmoHLR was implemented +from scratch to alleviate various shortcomings of the internal HLR: + +- The separate HLR allows using centralized subscriber management for both + circuit-switched and packet-switched domains (i.e. one OsmoHLR for both + OsmoMSC and OsmoSGSN). + +- VLR and HLR brought full UMTS AKA (Authentication and Key Agreement) support, + i.e. Milenage authentication in both the full 3G variant as well as the + backwards compatible 2G variant. + +- In contrast to the OsmoNITB, the specific way the new OsmoMSC's VLR accesses + OsmoHLR brings fully asynchronous subscriber database access. + +Find the OsmoHLR issue tracker and wiki online at + +- https://osmocom.org/projects/osmo-hlr +- https://osmocom.org/projects/osmo-hlr/wiki + + +[[fig-gsm]] +.Typical GSM network architecture used with OsmoHLR +[graphviz] +---- +digraph G { + rankdir=LR; + subgraph cluster_hlr { + label = "OsmoHLR"; + GSUP [label="GSUP server"] + DB [label="SQLite DB"] + GSUP->DB + DB->CTRL [dir="back"] + DB->VTY [dir="back"] + } + + Admin [label="Admin and\nMaintenance"] + SW [label="3rd party software\nintegration"] + VTY->Admin [dir="back"] + CTRL->SW [dir="back"] + + MSC [label="MSC/VLR"] + MSC->GSUP [label="GSUP"] + SGSN->GSUP [label="GSUP"] + + BSC->MSC + HNBGW->MSC + HNBGW->SGSN + PCU->SGSN +} +---- + diff --git a/OsmoHLR/chapters/running.adoc b/OsmoHLR/chapters/running.adoc new file mode 100644 index 0000000..09388c0 --- /dev/null +++ b/OsmoHLR/chapters/running.adoc @@ -0,0 +1,90 @@ +== Running OsmoHLR + +The OsmoHLR executable (`osmo-hlr`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-hlr* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-T] [-e 'LOGLEVEL'] [-l 'DATABASE'] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-d, --debug 'DBGMASK','DBGLEVELS'*:: + Set the log subsystems and levels for logging to stderr. This + has mostly been superseded by VTY-based logging configuration, + see <> for further information. +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `openbsc.cfg` in the current + working directory. +*-s, --disable-color*:: + Disable colors for logging to stderr. This has mostly been + deprecated by VTY based logging configuration, see <> + for more information. +*-T, --timestamp*:: + Enable time-stamping of log messages to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-e, --log-level 'LOGLEVEL'*:: + Set the global log level for logging to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-l, --database 'DATABASE'*:: + Specify the file name of the SQLite3 database to use as HLR/AUC + storage + +=== Bootstrap the Database + +Before first launching OsmoHLR, you need to create a database, which can be +done with these commands: + +---- +mkdir -p /var/lib/osmocom +sqlite3 /var/lib/osmocom/hlr.db < /usr/share/doc/osmo-hlr/hlr.sql +---- + +Depending on your installation choices, you will probably find `hlr.sql` in one +of these locations: + +- `/usr/share/doc/osmo-hlr/hlr.sql` +- `/usr/local/share/doc/osmo-hlr/hlr.sql` +- in `osmo-hlr.git`'s source tree at `sql/hlr.sql` + +NOTE: At the time of writing, OsmoHLR does not create an initial empty database +automatically, like OsmoNITB did. This behavior may be added in the future. + +=== Multiple instances + +Running multiple instances of `osmo-hlr` on the same computer is possible if +all interfaces (VTY, CTRL) are separated using the appropriate configuration +options. The IP based interfaces are binding to local host by default. In order +to separate the processes, the user has to bind those services to specific but +different IP addresses and/or ports. + +The VTY and the Control interface can be bound to IP addresses from the loopback +address range, for example: + +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- + +The GSUP interface can be bound to a specific IP address by the following +configuration options: + +---- +hlr + gsup + bind ip 10.23.42.1 +---- + +NOTE: At the time of writing, OsmoHLR lacks a config option to change the GSUP +port, which is by default TCP port 4222. diff --git a/OsmoHLR/chapters/subscribers.adoc b/OsmoHLR/chapters/subscribers.adoc new file mode 100644 index 0000000..b2024d2 --- /dev/null +++ b/OsmoHLR/chapters/subscribers.adoc @@ -0,0 +1,59 @@ +== Managing Subscribers + +Subscribers are kept in a local SQLite database file and can be managed via VTY +and CTRL interfaces. + +See this section for some examples, and also refer to the OsmoHLR VTY reference +manual <> as well as the Control interface described in +<>. + +=== Example: Add/Update/Delete Subscriber via VTY + +The following telnet VTY session adds a subscriber complete with 2G and 3G +authentication tokens, and finally removes the subscriber again; it assumes +that osmo-hlr is running and listening for telnet VTY connections on localhost: + +---- +$ telnet localhost 4258 +include::../example_subscriber_add_update_delete.vty[] +---- + +[[subscriber-params]] +=== Subscriber Parameters + +The following parameters are managed for each subscriber of the HLR, modelled +roughly after 3GPP TS 23.008, version 13.3.0; note that not all of these +parameters are necessarily in active use: + +.OsmoHLR's subscriber parameters +[options="header",width="100%",cols="20%,20%,60%"] +|=== +|Name|Example|Description +|imsi|901700000014701|identity of the SIM/USIM, 3GPP TS 23.008 chapter 2.1.1.1 +|msisdn|2342123|number to dial to reach this subscriber (multiple MSISDNs can be stored per subscriber), 3GPP TS 23.008 chapter 2.1.2 +|imeisv|4234234234234275|identity of the mobile device and software version, 3GPP TS 23.008 chapter 2.2.3 +|aud2g.algo|comp128v3|Authentication algorithm ID for 2G, corresponds to enum osmo_auth_algo +|aud2g.ki||Subscriber's secret key (128bit) +|aud3g.algo|milenage|Authentication algorithm ID for 3G and UMTS AKA, corresponds to enum osmo_auth_algo +|aud3g.k|(32 hexadecimal digits)|Subscriber's secret key (128bit) +|aud3g.op|(32 hexadecimal digits)|Operator's secret key (128bit) +|aud3g.opc|(32 hexadecimal digits)|Secret key derived from OP and K (128bit), alternative to using OP which does not disclose OP to subscribers +|aud3g.sqn|123|Sequence number of last used key (64bit unsigned) +|aud3g.ind_bitlen|5|Nr of index bits at lower SQN end +|apn|| +|vlr_number||3GPP TS 23.008 chapter 2.4.5 +|hlr_number||3GPP TS 23.008 chapter 2.4.6 +|sgsn_number||3GPP TS 23.008 chapter 2.4.8.1 +|sgsn_address||3GPP TS 23.008 chapter 2.13.10 +|ggsn_number||3GPP TS 23.008 chapter 2.4.8.2 +|gmlc_number||3GPP TS 23.008 chapter 2.4.9.2 +|smsc_number||3GPP TS 23.008 chapter 2.4.23 +|periodic_lu_tmr||3GPP TS 23.008 chapter 2.4.24 +|periodic_rau_tau_tmr||3GPP TS 23.008 chapter 2.13.115 +|nam_cs|1|Enable/disable voice access (3GPP TS 23.008 chapter 2.1.1.2: network access mode) +|nam_ps|0|Enable/disable data access (3GPP TS 23.008 chapter 2.1.1.2: network access mode) +|lmsi||3GPP TS 23.008 chapter 2.1.8 +|ms_purged_cs|0|3GPP TS 23.008 chapter 2.7.5 +|ms_purged_ps|1|3GPP TS 23.008 chapter 2.7.6 +|=== + diff --git a/OsmoHLR/example_subscriber_add_update_delete.vty b/OsmoHLR/example_subscriber_add_update_delete.vty new file mode 100644 index 0000000..ca14a65 --- /dev/null +++ b/OsmoHLR/example_subscriber_add_update_delete.vty @@ -0,0 +1,34 @@ +OsmoHLR> enable +OsmoHLR# subscriber imsi 123456789023000 create +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + +OsmoHLR# subscriber imsi 123456789023000 update msisdn 423 +% Updated subscriber IMSI='123456789023000' to MSISDN='423' + +OsmoHLR# subscriber msisdn 423 update aud3g milenage k deaf0ff1ced0d0dabbedd1ced1cef00d opc cededeffacedacefacedbadfadedbeef +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=5 + +OsmoHLR# subscriber msisdn 423 update aud2g comp128v3 ki beefedcafefaceacedaddeddecadefee +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=beefedcafefaceacedaddeddecadefee + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=5 + +OsmoHLR# subscriber imsi 123456789023000 delete +% Deleted subscriber for IMSI '123456789023000' diff --git a/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl b/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl new file mode 100644 index 0000000..1a98a80 --- /dev/null +++ b/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl @@ -0,0 +1,46 @@ +GET 1 subscriber.by-msisdn-103.info +GET_REPLY 1 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 2 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 2 subscriber.by-msisdn-103.ps-enabled 1 + +SET 3 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 3 subscriber.by-msisdn-103.ps-enabled OK + +GET 4 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 4 subscriber.by-msisdn-103.ps-enabled 0 + +GET 5 subscriber.by-msisdn-103.info +GET_REPLY 5 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_ps 0 + +SET 6 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 6 subscriber.by-msisdn-103.cs-enabled OK + +GET 7 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 7 subscriber.by-msisdn-103.cs-enabled 0 + +GET 8 subscriber.by-msisdn-103.info +GET_REPLY 8 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 + +SET 9 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 9 subscriber.by-msisdn-103.cs-enabled OK +SET 10 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 10 subscriber.by-msisdn-103.ps-enabled OK + +GET 11 subscriber.by-msisdn-103.info +GET_REPLY 11 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 diff --git a/OsmoHLR/example_subscriber_info.ctrl b/OsmoHLR/example_subscriber_info.ctrl new file mode 100644 index 0000000..2020508 --- /dev/null +++ b/OsmoHLR/example_subscriber_info.ctrl @@ -0,0 +1,28 @@ +GET 1 subscriber.by-imsi-901990000000003.info +GET_REPLY 1 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 2 subscriber.by-msisdn-103.info-aud +GET_REPLY 2 subscriber.by-msisdn-103.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 3 subscriber.by-id-3.info-all +GET_REPLY 3 subscriber.by-id-3.info-all +id 3 +imsi 901990000000003 +msisdn 103 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 diff --git a/OsmoHLR/osmohlr-usermanual-docinfo.xml b/OsmoHLR/osmohlr-usermanual-docinfo.xml new file mode 100644 index 0000000..d99bba7 --- /dev/null +++ b/OsmoHLR/osmohlr-usermanual-docinfo.xml @@ -0,0 +1,47 @@ + + + 1 + September 18th, 2017 + NH + + Initial version; based on OsmoNITB manual version 2. + + + + + + + Neels + Hofmeyr + nhofmeyr at sysmocom.de + NH + + sysmocom + sysmocom - s.f.m.c. GmbH + Senior Developer + + + + + + 2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with the Invariant Sections being just 'Foreword', + 'Acknowledgements' and 'Preface', with no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoHLR/osmohlr-usermanual.adoc b/OsmoHLR/osmohlr-usermanual.adoc new file mode 100644 index 0000000..2369155 --- /dev/null +++ b/OsmoHLR/osmohlr-usermanual.adoc @@ -0,0 +1,32 @@ +:gfdl-enabled: +:program-name: OsmoHLR + +OsmoHLR User Manual +==================== +Neels Hofmeyr + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +include::chapters/subscribers.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + +include::chapters/control.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] + diff --git a/OsmoHLR/osmohlr-vty-reference.xml b/OsmoHLR/osmohlr-vty-reference.xml new file mode 100644 index 0000000..948f5f9 --- /dev/null +++ b/OsmoHLR/osmohlr-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 18th September 2017 + nh + Initial + + + + OsmoHLR VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoHLR/vty/hlr_vty_additions.xml b/OsmoHLR/vty/hlr_vty_additions.xml new file mode 100644 index 0000000..a4c675e --- /dev/null +++ b/OsmoHLR/vty/hlr_vty_additions.xml @@ -0,0 +1,2 @@ + + diff --git a/OsmoHLR/vty/hlr_vty_reference.xml b/OsmoHLR/vty/hlr_vty_reference.xml new file mode 100644 index 0000000..31b95a1 --- /dev/null +++ b/OsmoHLR/vty/hlr_vty_reference.xml @@ -0,0 +1,1159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OsmoMSC/chapters/running.adoc b/OsmoMSC/chapters/running.adoc index 5925e02..8656a58 100644 --- a/OsmoMSC/chapters/running.adoc +++ b/OsmoMSC/chapters/running.adoc @@ -49,11 +49,11 @@ === Multiple instances -Running multiple instances of `osmo-msc` is possible if all interfaces (VTY, -CTRL) are separated using the appropriate configuration options. The IP based -interfaces are binding to local host by default. In order to separate the -processes, the user has to bind those services to specific but different IP -addresses. +Running multiple instances of `osmo-msc` on the same computer is possible if all +interfaces (VTY, CTRL) are separated using the appropriate configuration +options. The IP based interfaces are binding to local host by default. In order +to separate the processes, the user has to bind those services to specific but +different IP addresses and/or ports. The VTY and the Control interface can be bound to IP addresses from the loopback address range, for example: -- To view, visit https://gerrit.osmocom.org/4348 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieb6a362a26a7e65199f68f5cd32d9b6b0e5d0fbf Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 19 04:48:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 04:48:00 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: refactor Makefile build rules, don't use the FORCE In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3985 to look at the new patch set (#5). refactor Makefile build rules, don't use the FORCE The initial goal was to make sure we don't have overall FORCE rules causing unnecessary rebuilds -- annoying while writing documentation. As I looked through possible dependencies, I finally understood what's going on here. Remove code dup and nicely sort which belongs where in build/Makefile.*.inc. In each, describe in a top comment how to use it, and also unify how they are used: - Rename Makefile.inc to Makefile.docbook.inc and refactor - Add Makefile.vty-reference.inc - Add Makefile.common.inc Make sure that we accurately pick up all dependencies. Drop use of the macro called 'command', that silenced the actual command lines invoked and replaced them with short strings: it obscures what is actually going on and makes the Makefiles hard to read and understand. Each manual's makefile is greatly reduced to few definitions and a Makefile include, e.g. one for asciidoc, one for VTY reference. Move common/bsc_vty_additions.xml to OsmoBSC/vty/libbsc_vty_additions.xml, link from OsmoNITB. It applies only to OsmoBSC and OsmoNITB. Add a script that combines a VTY reference file with *all* additions files found in a manual's vty/ dir. Call this from Makefile.vty-reference.inc. Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 --- M OsmoBSC/Makefile R OsmoBSC/vty/libbsc_vty_additions.xml M OsmoBTS/Makefile M OsmoGGSN/Makefile M OsmoGSMTester/Makefile M OsmoHLR/Makefile M OsmoMGCP/Makefile M OsmoMSC/Makefile M OsmoNAT/Makefile M OsmoNITB/Makefile A OsmoNITB/vty/libbsc_vty_additions.xml M OsmoPCU/Makefile M OsmoSGSN/Makefile M build/Makefile.asciidoc.inc A build/Makefile.common.inc A build/Makefile.docbook.inc D build/Makefile.inc A build/Makefile.vty-reference.inc A build/vty_reference_combine.sh 19 files changed, 206 insertions(+), 443 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/85/3985/5 diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index 35f50da..1533482 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -1,54 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. - -EXTRA_DEPS = gen-bsc-vty-docbook - -topdir = . -bsc_reference = $(topdir)/osmobsc-vty-reference.xml -manuals = $(bsc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobsc-usermanual osmux-reference aoip-mgw-options - +ASCIIDOC = osmobsc-usermanual.adoc osmux-reference.adoc aoip-mgw-options.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmobsc-usermanual.pdf: chapters/*.adoc -osmux-reference.pdf: osmux-reference.adoc -aoip-mgw-options.pdf: aoip-mgw-options.adoc +aoip-mgw-options.pdf: aoip-mgw-options.adoc mgw/*.msc -clean: - -rm -rf $(cleanfiles) - -rm osmobsc-usermanual__*.png - -rm osmobsc-usermanual__*.svg - -rm osmobsc-usermanual*.check - -rm osmux-reference*.check - -rm aoip-mgw-options*.png - -rm aoip-mgw-options*.svg - -rm aoip-mgw-options*.check - -rm osmux-reference__*.svg - -rm osmux-reference__*.png - -rm osmux-reference__*.check +VTY_REFERENCE = osmobsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bsc-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bsc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/common/bsc_vty_additions.xml b/OsmoBSC/vty/libbsc_vty_additions.xml similarity index 100% rename from common/bsc_vty_additions.xml rename to OsmoBSC/vty/libbsc_vty_additions.xml diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 58df0e3..e1ff214 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -1,50 +1,12 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-bts-vty-docbook - -topdir = . -bts_reference = $(topdir)/osmobts-vty-reference.xml -manuals = $(bts_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobts-usermanual osmobts-abis rtp-amr - +ASCIIDOC = osmobts-usermanual.adoc osmobts-abis.adoc rtp-amr.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - -osmobts-abis.pdf: abis/*.adoc abis/*.msc osmobts-usermanual.pdf: chapters/*.adoc +osmobts-abis.pdf: abis/*.adoc abis/*.msc +rtp-amr.pdf: dtx.dot -clean: - -rm -rf $(cleanfiles) - -rm osmobts-abis__*.png - -rm osmobts-abis__*.svg - -rm rtp-amr__*.png - -rm rtp-amr__*.svg - -rm osmobts-usermanual__*.png - -rm osmobts-usermanual__*.svg - -rm osmobts-abis*.check - -rm osmobts-usermanual*.check +VTY_REFERENCE = osmobts-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bts-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bts_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bts_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BTS VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BTS VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile index 2dfedb2..e809632 100644 --- a/OsmoGGSN/Makefile +++ b/OsmoGGSN/Makefile @@ -1,39 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-ggsn-vty-docbook - -topdir = . -ggsn_reference = $(topdir)/osmoggsn-vty-reference.xml -manuals = $(ggsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmoggsn-usermanual - +ASCIIDOC = osmoggsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmoggsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmoggsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmoggsn-usermanual__*.svg osmoggsn-usermanual__*.png - -rm osmoggsn-usermanual.check - -gen-ggsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/ggsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/ggsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging GGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting GGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGSMTester/Makefile b/OsmoGSMTester/Makefile index 79d414f..43c5a37 100644 --- a/OsmoGSMTester/Makefile +++ b/OsmoGSMTester/Makefile @@ -1,12 +1,7 @@ -TOPDIR := .. -ASCIIDOCS := osmo-gsm-tester-manual +TOPDIR = .. +ASCIIDOC = osmo-gsm-tester-manual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmo-gsm-tester-manual.pdf: chapters/*.adoc - -clean: - -rm -rf $(cleanfiles) - -rm osmo-gsm-tester-manual__*.svg - -rm osmo-gsm-tester-manual__*.png +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile index eba5fa3..a9dc393 100644 --- a/OsmoHLR/Makefile +++ b/OsmoHLR/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -hlr_reference = $(topdir)/osmohlr-vty-reference.xml -manuals = $(hlr_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmohlr-usermanual - +ASCIIDOC = osmohlr-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc *.vty *.ctrl include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmohlr-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmohlr-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmohlr-usermanual__*.svg - -rm osmohlr-usermanual__*.png - -rm osmohlr-usermanual.check - -generated/docbook_vty.xml: osmohlr-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/hlr_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/hlr_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging HLR VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting HLR VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMGCP/Makefile b/OsmoMGCP/Makefile index 9aff12b..e2a5e37 100644 --- a/OsmoMGCP/Makefile +++ b/OsmoMGCP/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-mgcp-vty-docbook +VTY_REFERENCE = osmomgcp-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -mgcp_reference = $(topdir)/osmomgcp-vty-reference.xml -manuals = $(mgcp_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-mgcp-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/mgcp_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/mgcp_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging MGCP VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MGCP VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile index febf7d1..c9edcef 100644 --- a/OsmoMSC/Makefile +++ b/OsmoMSC/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -msc_reference = $(topdir)/osmomsc-vty-reference.xml -manuals = $(msc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmomsc-usermanual - +ASCIIDOC = osmomsc-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmomsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmomsc-usermanual__*.svg - -rm osmomsc-usermanual__*.png - -rm osmomsc-usermanual.check - -generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/msc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/msc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging MSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNAT/Makefile b/OsmoNAT/Makefile index d7302e6..fde7132 100644 --- a/OsmoNAT/Makefile +++ b/OsmoNAT/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nat-vty-docbook +VTY_REFERENCE = osmonat-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -nat_reference = $(topdir)/osmonat-vty-reference.xml -manuals = $(nat_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-nat-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nat_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/nat_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging NAT VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NAT VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/Makefile b/OsmoNITB/Makefile index 99cd317..0cd260d 100644 --- a/OsmoNITB/Makefile +++ b/OsmoNITB/Makefile @@ -1,44 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nitb-vty-docbook - -topdir = . -nitb_reference = $(topdir)/osmonitb-vty-reference.xml -manuals = $(nitb_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmonitb-usermanual - +ASCIIDOC = osmonitb-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmonitb-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmonitb-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmonitb-usermanual__*.svg - -rm osmonitb-usermanual__*.png - -rm osmonitb-usermanual.check - -gen-nitb-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nitb_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/nitb_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging NITB VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NITB VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/vty/libbsc_vty_additions.xml b/OsmoNITB/vty/libbsc_vty_additions.xml new file mode 120000 index 0000000..52528bb --- /dev/null +++ b/OsmoNITB/vty/libbsc_vty_additions.xml @@ -0,0 +1 @@ +../../OsmoBSC/vty/libbsc_vty_additions.xml \ No newline at end of file diff --git a/OsmoPCU/Makefile b/OsmoPCU/Makefile index a83b909..7a1acc0 100644 --- a/OsmoPCU/Makefile +++ b/OsmoPCU/Makefile @@ -1,45 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-vty-docbook - -topdir = . -pcu_reference = $(topdir)/osmopcu-vty-reference.xml -manuals = $(bts_manual) $(pcu_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmopcu-usermanual osmopcu-gb - +ASCIIDOC = osmopcu-usermanual.adoc osmopcu-gb.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmopcu-gb.pdf: gb/*.adoc gb/*.msc osmopcu-usermanual.pdf: chapters/*.adoc -clean: - -rm -rf $(cleanfiles) - -rm -rf gen-vty-docbook - -rm osmopcu-usermanual__*.png - -rm osmopcu-usermanual__*.svg - -rm osmopcu-usermanual.check +VTY_REFERENCE = osmopcu-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/osmo-pcu_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/osmo-pcu_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging PCU VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting PCU VTY to DocBook) - - - +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoSGSN/Makefile b/OsmoSGSN/Makefile index 6f7d28d..baa1a49 100644 --- a/OsmoSGSN/Makefile +++ b/OsmoSGSN/Makefile @@ -1,43 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-sgsn-vty-docbook - -topdir = . -sgsn_reference = $(topdir)/osmosgsn-vty-reference.xml -manuals = $(sgsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmosgsn-usermanual - +ASCIIDOC = osmosgsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmosgsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmosgsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmosgsn-usermanual__*.svg osmosgsn-usermanual__*.png - -rm osmosgsn-usermanual.check - -gen-sgsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/sgsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/sgsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging SGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting SGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index e088624..a28a5bb 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -1,19 +1,38 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'ASCIIDOC' all root .adoc files, +# - optionally define in 'ASCIIDOC_DEPS' all dependencies common to all .adocs, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# ASCIIDOC = osmo_yada.adoc osmo_moo.adoc +# ASCIIDOC_DEPS = for_all/*.adoc +# include $(TOPDIR)/build/Makefile.asciidoc.inc +# osmo_yada.pdf: yada/*.adoc yada/*.msc + BUILDDIR = $(TOPDIR)/build GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags) GIT_DATE := $(shell $(TOPDIR)/build/unix-time-to-fmt.py `git log -n 1 "--pretty=%at" ../.`) # prepend the document name with the version numbe suffix -#DOCS_VER = $(foreach P, $(ASCIIDOCS), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) +#DOCS_VER = $(foreach P, $(ASCIIDOC_NAME), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) #PDFS = $(DOCS_VER:%=%.pdf) # generate list of PDFs that we're supposed to render -ASCIIDOCPDFS = $(ASCIIDOCS:%=%.pdf) -ASCIIDOC_CHECKS = $(ASCIIDOCS:%=%.check) +ASCIIDOC_NAME = $(patsubst %.adoc,%,$(ASCIIDOC)) +ASCIIDOC_PDF = $(ASCIIDOC_NAME:%=%.pdf) +ASCIIDOC_CHECKS = $(ASCIIDOC_NAME:%=%.check) ASCIIDOCSTYLE ?= $(BUILDDIR)/custom-dblatex.sty -cleanfiles += $(ASCIIDOCPDFS) +CLEAN_FILES += $(ASCIIDOC_NAME:%=%__*.png) $(ASCIIDOC_NAME:%=%__*.svg) $(ASCIIDOC_CHECKS) +CLEAN_FILES += $(ASCIIDOC_PDF) +UPLOAD_FILES += $(ASCIIDOC_PDF) ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -f $(BUILDDIR)/python2-filter.conf DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0 @@ -27,9 +46,13 @@ A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" --dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(REVNUMBER)" -a revdate="$(GIT_DATE)" -all: $(ASCIIDOCPDFS) +all: $(ASCIIDOC_PDF) -$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc +$(ASCIIDOC_PDF): %.pdf: %.adoc %-docinfo.xml \ + $(ASCIIDOC_DEPS) \ + $(ASCIIDOCSTYLE) \ + $(TOPDIR)/common/*/*.adoc \ + $(TOPDIR)/common/images/* @test -n "$(BUILD_RELEASE)" && echo -e "\n\n\ NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\ and remove three lines starting with '% \"DRAFT\" on first page'\n" \ diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc new file mode 100644 index 0000000..e624b5f --- /dev/null +++ b/build/Makefile.common.inc @@ -0,0 +1,14 @@ +# Usage: +# +# Other makefiles like Makefile.asciidoc.inc and Makefile.vty-reference.inc add +# entries to UPLOAD_FILES and CLEAN_FILES. +# +# Include this file at the end to have 'upload' and 'clean' targets. + +UPLOAD_PATH ?= generic at sysmocom-downloads:documents + +upload: $(UPLOAD_FILES) + rsync -avz $(UPLOAD_FILES) $(UPLOAD_PATH)/ + +clean: + -rm -rf $(CLEAN_FILES) diff --git a/build/Makefile.docbook.inc b/build/Makefile.docbook.inc new file mode 100644 index 0000000..70dfafa --- /dev/null +++ b/build/Makefile.docbook.inc @@ -0,0 +1,35 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'DOCBOOKS' all root .xml files, +# - optionally define in 'DOCBOOKS_DEPS' all dependencies common to all .xmls, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# DOCBOOKS = osmo_yada.xml osmo_moo.xml +# ASCIIDOC_DEPS = for_all/*.xml +# include $(TOPDIR)/build/Makefile.docbook.inc +# osmo_yada.pdf: yada/*.xml +# +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals, edited. + +DOCBOOKS_PDF = $(patsubst %.xml,%.pdf,$(DOCBOOKS)) +lint = $(patsubst %.xml,%.lint,$(DOCBOOKS)) + +CLEAN_FILES += $(DOCBOOKS_PDF) $(lint) +UPLOAD_FILES += $(DOCBOOKS_PDF) + +all: $(DOCBOOKS_PDF) + +# Lint the file +%.xml-lint: %.xml + xmllint --xinclude --postvalid --noout $< + +# Create a PDF file and lint it before +%.pdf: %.xml %.xml-lint $(DOCBOOKS_DEPS) + dblatex $(dblatex_quiet) -P draft.mode=no $< + diff --git a/build/Makefile.inc b/build/Makefile.inc deleted file mode 100644 index 3905cb0..0000000 --- a/build/Makefile.inc +++ /dev/null @@ -1,47 +0,0 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals - -LIBOSMO_DIR ?= ~/source/gsm/libosmocore -MERGE_DOC := $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl -UPLOAD_PATH ?= generic at sysmocom-downloads:documents - -pdfs = $(patsubst %.xml,%.pdf,$(manuals)) -lint = $(patsubst %.xml,%.xml-lint,$(manuals)) - -#cleanfiles = $(foreach i,$(types),$(topdir)/$(i)) -cleanfiles += $(pdfs) $(lint) - -ifdef DEBUG -dblatex_quiet = -define command - $(1) -endef -else -dblatex_quiet = -q -define command - @echo $(2) $(3) - @$(1) -endef -endif - -all: $(types) - - -$(types): FORCE - - -pdf: $(pdfs) $(manuals) - - -# Lint the file -%.xml-lint: %.xml FORCE - $(call command,xmllint --xinclude --postvalid --noout $<,XMLLINT,$<) - -# Create a PDF file and lint it before -%.pdf: %.xml %.xml-lint $(EXTRA_DEPS) FORCE - $(call command,dblatex $(dblatex_quiet) -P draft.mode=no $<,DBLATEX,$<) - -upload: $(pdfs) $(ASCIIDOCPDFS) - rsync -avz $(pdfs) $(ASCIIDOCPDFS) $(UPLOAD_PATH)/ - -FORCE: diff --git a/build/Makefile.vty-reference.inc b/build/Makefile.vty-reference.inc new file mode 100644 index 0000000..baf9cf5 --- /dev/null +++ b/build/Makefile.vty-reference.inc @@ -0,0 +1,42 @@ +# Usage: +# Have files: +# - osmoyada-vty-reference.xml +# A docbook root XML including a &chapter-vty; reference. +# - vty/*additions*.xml +# Manual additions to specific VTY nodes, any number of files. +# - vty/*_reference.xml +# Export from VTY 'show online-help', exactly one file. +# +# In your Makefile, +# - define 'TOPDIR' to point at the git root, +# - define the (single) name of the vty-reference source in VTY_REFERENCE, +# - include this file. +# +# e.g. +# +# TOPDIR = .. +# VTY_REFERENCE = osmofoo-vty-reference +# include $(TOPDIR)/build/Makefile.vty-reference.inc +# +# This uses the Makefile.docbook.inc, you should not mix uses of +# Makefile.vty-reference.inc and Makefile.docbook.inc. + +DOCBOOKS = $(VTY_REFERENCE) +DOCBOOKS_DEPS = generated/docbook_vty.xml +include $(TOPDIR)/build/Makefile.docbook.inc + +LIBOSMO_DIR ?= ~/source/gsm/libosmocore +MERGE_DOC = $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl + +CLEAN_FILES += generated + +generated/docbook_vty.xml: \ + vty/*xml \ + $(TOPDIR)/common/vty_additions.xml \ + $(TOPDIR)/common/chapters/vty.xml \ + $(TOPDIR)/vty_reference.xsl + $(TOPDIR)/build/vty_reference_combine.sh "$(MERGE_DOC)" \ + $(TOPDIR)/common/vty_additions.xml \ + vty/*additions*.xml + xsltproc $(TOPDIR)/vty_reference.xsl generated/combined.xml \ + > generated/docbook_vty.xml diff --git a/build/vty_reference_combine.sh b/build/vty_reference_combine.sh new file mode 100755 index 0000000..be234a7 --- /dev/null +++ b/build/vty_reference_combine.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +# the first argument should point at libosmocore/doc/vty/merge_doc.xsl +MERGE_DOC="$1" +shift + +combined="generated/combined.xml" +combine_src="generated/combine_src.xml" + +reference="vty/*reference.xml" +test "$(ls -1 $reference | wc -l)" = "1" + +set -x +mkdir -p generated +cp $reference "$combined" + +while [ -n "$1" ]; do + addition="$(realpath "$1")" + shift + mv "$combined" "$combine_src" + xsltproc -o "$combined" \ + --stringparam with "$addition" \ + "$MERGE_DOC" "$combine_src" +done -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 19 10:13:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 19 Oct 2017 10:13:14 +0000 Subject: libosmocore[master]: add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) Would it make sense to use it in get_all_rate_ctr_in_group() for example? If so than it could be part of the same patch to illustrate the usage. https://gerrit.osmocom.org/#/c/4340/1/include/osmocom/core/utils.h File include/osmocom/core/utils.h: Line 90: * \param[inout] dest char* to re-/allocate and append to. Is comma missing? Shouldn't it be "in,out"? -- To view, visit https://gerrit.osmocom.org/4340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 19 10:23:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Oct 2017 10:23:09 +0000 Subject: [PATCH] osmo-bsc[master]: bsc_vty: Improve description of mid-call-text cmd Message-ID: Review at https://gerrit.osmocom.org/4349 bsc_vty: Improve description of mid-call-text cmd Change-Id: I367b7734390daf39160de6462e9b2210368666f4 --- M src/osmo-bsc/osmo_bsc_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/49/4349/1 diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index 0e7003f..34e020a 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -780,7 +780,7 @@ DEFUN(cfg_net_bsc_mid_call_text, cfg_net_bsc_mid_call_text_cmd, "mid-call-text .TEXT", - "Set the USSD notification to be send.\n" "Text to be sent\n") + "Set the USSD notification sent to running calls when switching from Grace to Off.\n" "Text to be sent\n") { struct osmo_bsc_data *data = osmo_bsc_data(vty); char *txt = argv_concat(argv, argc, 0); -- To view, visit https://gerrit.osmocom.org/4349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I367b7734390daf39160de6462e9b2210368666f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 19 10:23:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 19 Oct 2017 10:23:13 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 2: > are not of interest to any osmo-hlr user yet than what's the point of including it? > CTRL command 'subscriber.by-*.info' will it break if you just omit "#if 0"? I really dislike the idea of including dead code: it always raises the questions for any person reading this code later on, it silently bitrot and it doesn't serve any particular purpose. If we need it to illustrate some point than it's better to include comment which illustrate this point with words. If it's there for completeness sake than uncomment it and let the caller ignore it. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 19 10:24:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Oct 2017 10:24:38 +0000 Subject: [PATCH] osmo-bsc[master]: bsc_vty: Improve description of mid-call-text cmd In-Reply-To: References: Message-ID: bsc_vty: Improve description of mid-call-text cmd Change-Id: I367b7734390daf39160de6462e9b2210368666f4 --- M src/osmo-bsc/osmo_bsc_vty.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/49/4349/2 diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index 0e7003f..b5232c4 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -780,7 +780,8 @@ DEFUN(cfg_net_bsc_mid_call_text, cfg_net_bsc_mid_call_text_cmd, "mid-call-text .TEXT", - "Set the USSD notification to be send.\n" "Text to be sent\n") + "Set the USSD notification sent to running calls when switching from Grace to Off.\n" + "Text to be sent\n") { struct osmo_bsc_data *data = osmo_bsc_data(vty); char *txt = argv_concat(argv, argc, 0); -- To view, visit https://gerrit.osmocom.org/4349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I367b7734390daf39160de6462e9b2210368666f4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 19 13:00:18 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Oct 2017 13:00:18 +0000 Subject: [PATCH] osmo-bsc[master]: log: als output hexdump of transmitted sccp messages Message-ID: Review at https://gerrit.osmocom.org/4350 log: als output hexdump of transmitted sccp messages We output a hexdump for each sccp message we receive, but not when sending. Also log the hexdump of transmitted sccp messages Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345 --- M src/osmo-bsc/osmo_bsc_sigtran.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/4350/1 diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 48796c1..2cdeb64 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -340,8 +340,8 @@ ss7 = osmo_ss7_instance_find(msc->a.cs7_instance); OSMO_ASSERT(ss7); - LOGP(DMSC, LOGL_DEBUG, "Sending connection (id=%i) oriented data to MSC: %si\n", - conn_id, osmo_sccp_addr_name(ss7, &msc->a.msc_addr)); + LOGP(DMSC, LOGL_DEBUG, "Sending connection (id=%i) oriented data (%s) to MSC: %s\n", + conn_id, osmo_hexdump(msg->data, msg->len), osmo_sccp_addr_name(ss7, &msc->a.msc_addr)); rc = osmo_sccp_tx_data_msg(msc->a.sccp_user, conn_id, msg); -- To view, visit https://gerrit.osmocom.org/4350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 19 13:01:58 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Oct 2017 13:01:58 +0000 Subject: [PATCH] osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4334 to look at the new patch set (#4). mgcp: use osmo-mgw to switch RTP streams osmo-bsc currently negotiates the RTP stream directly with the BTS and reports back the RTP IP/Port on the BTS. This works fine for a single BTS, but for Handover the port/ip pointing to the MSC side must not change, so an entity in between the BTSs and the MSC is required. Integrate the mgcp-client and use osmo-mgw to switch the RTP streams. TODO: Handover will not work yet, because there is no functionality to update the connection with the port/ip of the new BTS. Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/osmo_bsc.h A include/osmocom/bsc/osmo_bsc_mgcp.h M src/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c A src/osmo-bsc/osmo_bsc_mgcp.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c 13 files changed, 1,038 insertions(+), 67 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/34/4334/4 diff --git a/configure.ac b/configure.ac index 4edbb83..f73f33c 100644 --- a/configure.ac +++ b/configure.ac @@ -47,8 +47,9 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) +PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 1.0.0) dnl checks for header files AC_HEADER_STDC @@ -135,7 +136,6 @@ src/libfilter/Makefile src/libcommon-cs/Makefile src/osmo-bsc/Makefile - src/osmo-bsc_nat/Makefile src/ipaccess/Makefile src/utils/Makefile tests/Makefile diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 8ad2b5d..1f7cd39 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -41,6 +41,7 @@ openbscdefines.h \ osmo_bsc.h \ osmo_bsc_grace.h \ + osmo_bsc_mgcp.h \ osmo_bsc_rf.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 51b2c98..5cb7efd 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -479,6 +479,11 @@ uint8_t t3212; struct { + struct mgcp_client_conf *conf; + struct mgcp_client *client; + } mgw; + + struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; /* A list with the context information about diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h index 5ebea50..8a5cd30 100644 --- a/include/osmocom/bsc/osmo_bsc.h +++ b/include/osmocom/bsc/osmo_bsc.h @@ -29,6 +29,20 @@ uint32_t rtp_ip; int rtp_port; + /* RTP address of the remote end (assigned by MSC through assignment + * request) */ + struct sockaddr_storage aoip_rtp_addr_remote; + + /* Local RTP address (reported back to the MSC by us with the + * assignment complete message) */ + struct sockaddr_storage aoip_rtp_addr_local; + + /* storage to keep states of the MGCP connection handler, the + * handler is created when an assignment request is received + * and is terminated when the assignment complete message is + * sent */ + struct mgcp_ctx *mgcp_ctx; + /* for advanced ping/pong */ int send_ping; @@ -72,4 +86,6 @@ struct llist_head *bsc_access_lists(void); +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan); + #endif diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h new file mode 100644 index 0000000..3c82f45 --- /dev/null +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -0,0 +1,47 @@ +/* (C) 2017 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +/* MGCP state handler context (fsm etc..) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* A human readable name to display in the logs */ + char name[256]; + + /* RTP endpoint number */ + uint16_t rtp_endpoint; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + int chan_mode; + int full_rate; + struct gsm_lchan *lchan; + struct msgb *resp; +}; + +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct gsm_network *network, + struct osmo_bsc_sccp_con *conn, int chan_mode, int full_rate); +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan); diff --git a/src/Makefile.am b/src/Makefile.am index d04f025..dd1ad3d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,5 +33,4 @@ utils \ ipaccess \ osmo-bsc \ - osmo-bsc_nat \ $(NULL) diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index dfc4def..7db698c 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -15,6 +15,7 @@ $(COVERAGE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -30,6 +31,7 @@ osmo_bsc_vty.c \ osmo_bsc_api.c \ osmo_bsc_grace.c \ + osmo_bsc_mgcp.c \ osmo_bsc_msc.c \ osmo_bsc_sigtran.c \ osmo_bsc_filter.c \ @@ -53,4 +55,5 @@ $(COVERAGE_LDFLAGS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(NULL) diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index 94aa350..326703d 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -29,46 +29,9 @@ #include #include #include +#include #include - -/* Generate and send assignment complete message */ -static int send_aoip_ass_compl(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan) -{ - struct msgb *resp; - struct sockaddr_storage rtp_addr; - struct sockaddr_in rtp_addr_in; - struct gsm0808_speech_codec sc; - - OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); - - /* Package RTP-Address data */ - memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); - rtp_addr_in.sin_family = AF_INET; - rtp_addr_in.sin_port = htons(lchan->abis_ip.bound_port); - rtp_addr_in.sin_addr.s_addr = htonl(lchan->abis_ip.bound_ip); - memset(&rtp_addr, 0, sizeof(rtp_addr)); - memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); - - /* Extrapolate speech codec from speech mode */ - gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); - - /* Generate message */ - resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, - lchan->abis_ip.ass_compl.chosen_channel, - lchan->abis_ip.ass_compl.encr_alg_id, - lchan->abis_ip.ass_compl.speech_mode, - &rtp_addr, - &sc, - NULL); - - if (!resp) { - LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ - return -EINVAL; - } - - return osmo_bsc_sigtran_send(conn->sccp_con, resp); -} static int handle_abisip_signal(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) @@ -124,11 +87,9 @@ * IPA based base stations. See also osmo_bsc_api.c, * function bsc_assign_compl() */ LOGP(DMSC, LOGL_INFO, "Tx MSC ASSIGN COMPL (POSTPONED)\n"); - if (send_aoip_ass_compl(con, lchan) != 0) - return -EINVAL; + mgcp_ass_complete(con->sccp_con->mgcp_ctx, lchan); } break; - break; } return 0; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 4311250..c10cead 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -24,7 +24,8 @@ #include #include #include -#include +#include +#include #include #include @@ -321,14 +322,29 @@ conn->conn = NULL; } - /* send the clear complete message */ + /* generate the clear complete message */ resp = gsm0808_create_clear_complete(); if (!resp) { LOGP(DMSC, LOGL_ERROR, "Sending clear complete failed.\n"); return -1; } - osmo_bsc_sigtran_send(conn, resp); + if (conn->mgcp_ctx) { + /* NOTE: This is the AoIP case, osmo-bsc has to negotiate with + * the MGCP-GW. For this an mgcp_ctx should be created that + * contains the FSM and some system data. When the connection + * is removed from the MGCP-GW, then osmo_bsc_sigtran_send() + * calls osmo_bsc_sigtran_send(). */ + mgcp_clear_complete(conn->mgcp_ctx, resp); + conn->mgcp_ctx = NULL; + } else { + /* NOTE: This is the SCCP-Lite case, since we do not handle + * the MGCP-GW switching ourselves, we may skip everything + * that is MGCP-GW related and sent the clear complete message + * directly */ + osmo_bsc_sigtran_send(conn, resp); + } + return 0; } @@ -426,7 +442,6 @@ int port, full_rate = -1; bool aoip = false; struct sockaddr_storage rtp_addr; - struct sockaddr_in *rtp_addr_in; struct gsm0808_channel_type ct; struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; @@ -531,29 +546,40 @@ get_value_string(gsm48_chan_mode_names, chan_mode), ct.ch_indctr, ct.ch_rate_type, osmo_hexdump(ct.perm_spch, ct.perm_spch_len)); - if (aoip == false) { - /* map it to a MGCP Endpoint and a RTP port */ + /* Forward the assingment request to lower layers */ + if (aoip) { + /* Store network side RTP connection information, we will + * process this address later after we have established an RTP + * connection to the BTS. This is just for organizational + * reasons, functional wise it would not matter when exactly + * the network side RTP connection is made, as long it is made + * before we return with the assignment complete message. */ + memcpy(&conn->aoip_rtp_addr_remote, &rtp_addr, sizeof(rtp_addr)); + + /* Create an assignment request using the MGCP fsm. This FSM + * is directly started when its created (now) and will also + * take care about the further processing (creating RTP + * endpoints, calling gsm0808_assign_req(), rsponding to + * the assignment request etc... */ + conn->mgcp_ctx = mgcp_assignm_req(NULL, msc->network, conn, chan_mode, full_rate); + if (!conn->mgcp_ctx) { + LOGP(DMSC, LOGL_ERROR, "MGCP GW failure, rejecting assignment...\n"); + goto reject; + } + + /* We now may return here, the FSM will do all further work */ + return 0; + } else { + /* Note: In the sccp-lite case we to not perform any mgcp operation, + * (the MSC does that for us). We set conn->rtp_ip to 0 and check + * on this later. By this we know that we have to behave accordingly + * to sccp-lite. */ port = mgcp_timeslot_to_endpoint(multiplex, timeslot); conn->rtp_port = rtp_calculate_port(port, msc->rtp_base); conn->rtp_ip = 0; - } else { - /* use address / port supplied with the AoIP - * transport address element */ - if (rtp_addr.ss_family == AF_INET) { - rtp_addr_in = (struct sockaddr_in *)&rtp_addr; - conn->rtp_port = osmo_ntohs(rtp_addr_in->sin_port); - memcpy(&conn->rtp_ip, &rtp_addr_in->sin_addr.s_addr, - IP_V4_ADDR_LEN); - conn->rtp_ip = osmo_ntohl(conn->rtp_ip); - } else { - LOGP(DMSC, LOGL_ERROR, - "Unsopported addressing scheme. (supports only IPV4)\n"); - goto reject; - } + return gsm0808_assign_req(conn->conn, chan_mode, full_rate); } - - return gsm0808_assign_req(conn->conn, chan_mode, full_rate); - + reject: resp = gsm0808_create_assignment_failure @@ -729,3 +755,38 @@ return -1; } + +/* Generate and send assignment complete message */ +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan) +{ + struct msgb *resp; + struct gsm0808_speech_codec sc; + struct gsm_subscriber_connection *conn; + + conn = lchan->conn; + + OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); + OSMO_ASSERT(conn); + OSMO_ASSERT(conn->sccp_con); + + LOGP(DMSC, LOGL_NOTICE, "Sending assignment complete message...\n"); + + /* Extrapolate speech codec from speech mode */ + gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); + + /* Generate message */ + resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, + lchan->abis_ip.ass_compl.chosen_channel, + lchan->abis_ip.ass_compl.encr_alg_id, + lchan->abis_ip.ass_compl.speech_mode, + &conn->sccp_con->aoip_rtp_addr_local, + &sc, + NULL); + + if (!resp) { + LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ + return -EINVAL; + } + + return osmo_bsc_sigtran_send(conn->sccp_con, resp); +} diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 5e8f45e..5386bfe 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -44,6 +44,7 @@ #include #include +#include #define _GNU_SOURCE #include @@ -203,6 +204,9 @@ exit(1); } + bsc_gsmnet->mgw.conf = talloc_zero(bsc_gsmnet, struct mgcp_client_conf); + mgcp_client_conf_init(bsc_gsmnet->mgw.conf); + osmo_init_logging(&log_info); osmo_stats_init(tall_bsc_ctx); @@ -274,6 +278,13 @@ } } + bsc_gsmnet->mgw.client = mgcp_client_init(bsc_gsmnet, bsc_gsmnet->mgw.conf); + + if (mgcp_client_connect(bsc_gsmnet->mgw.client)) { + printf("MGCPGW connect failed\n"); + exit(1); + } + if (osmo_bsc_sigtran_init(&bsc_gsmnet->bsc_data->mscs) != 0) { LOGP(DNM, LOGL_ERROR, "Failed to initalize sigtran backhaul.\n"); exit(1); diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c new file mode 100644 index 0000000..f2ab3c8 --- /dev/null +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -0,0 +1,860 @@ +/* (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define CONN_ID_BTS 1 +#define CONN_ID_NET 2 + +#define MGCP_MGW_TIMEOUT 4 /* sek */ +#define MGCP_MGW_TIMEOUT_TIMER_NO 7411 +#define MGCP_BSS_TIMEOUT 4 /* sek */ +#define MGCP_BSS_TIMEOUT_TIMER_NO 7412 + +#define MGCP_ENDPOINT_FORMAT "%i at mgw" + +extern struct gsm_network *bsc_gsmnet; + +enum fsm_states { + /* Initalization state to start the FSM */ + ST_CRCX_BTS, + + /* Send CRCX for BTS and wait for response */ + ST_ASSIGN_PROC, + + /* Wait for the BSS to setup the connection */ + ST_MDCX_BTS, + + /* Send MDCX for BTS and wait for response */ + ST_CRCX_NET, + + /* Send CRCX (single phase) for NET and wait for response */ + ST_ASSIGN_COMPL, + + /* Call is now active, wait for call end */ + ST_DLCX, + + /* Send DLCX for BTS/NET and wait for response */ + ST_HALT, +}; + +static const struct value_string fsm_state_names[] = { + {ST_CRCX_BTS, "ST_CRCX_BTS (send CRCX for BTS)"}, + {ST_ASSIGN_PROC, "ST_ASSIGN_PROC (conntinue assingment)"}, + {ST_MDCX_BTS, "ST_MDCX_BTS (send MDCX for BTS)"}, + {ST_CRCX_NET, "ST_CRCX_NET (send CRCX for NET)"}, + {ST_ASSIGN_COMPL, "ST_ASSIGN_COMPL (complete assingment)"}, + {ST_DLCX, "ST_DLCX (delete all rtp connections)"}, + {ST_HALT, "ST_HALT (destroy state machine)"}, + {0, NULL}, +}; + +enum fsm_evt { + /* Initial event: start off the state machine */ + EV_INIT, + + /* External event: Assignment complete, event is issued shortly before + * the assignment complete message is sent via the A-Interface */ + EV_ASS_COMPLETE, + + /* External event: Teardown event, this event is used to notify the end + * of a. It is also issued in case of errors to teardown a half open + * connection. */ + EV_TEARDOWN, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the BTS side */ + EV_CRCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the BTS side */ + EV_MDCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the NET side */ + EV_CRCX_NET_RESP, + + /* Internal event: The mgcp_gw has sent its DLCX response for + * the NET and BTS side */ + EV_DLCX_ALL_RESP, +}; + +static const struct value_string fsm_evt_names[] = { + {EV_INIT, "EV_INIT (start state machine (send CRCX for BTS)"}, + {EV_ASS_COMPLETE, "EV_ASS_COMPLETE (assignment complete)"}, + {EV_TEARDOWN, "EV_TEARDOWN (teardown all connections)"}, + {EV_CRCX_BTS_RESP, "EV_CRCX_BTS_RESP (got CRCX reponse for BTS)"}, + {EV_MDCX_BTS_RESP, "EV_MDCX_BTS_RESP (got MDCX reponse for BTS)"}, + {EV_CRCX_NET_RESP, "EV_CRCX_NET_RESP (got CRCX reponse for NET)"}, + {EV_DLCX_ALL_RESP, "EV_DLCX_ALL_RESP (got DLCX reponse for BTS/NET)"}, + {0, NULL}, +}; + +/* On error, go directly to the DLCX phase. */ +static void on_error_goto_dlcx(struct mgcp_ctx *mgcp_ctx) +{ + /* This function forces the FSM into the DLCX phase. The FSM will just + * behave like the call were ended normally. */ + + struct osmo_fsm_inst *fi; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + fi = mgcp_ctx->fsm; + OSMO_ASSERT(fi); + + LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state)); + + LOGP(DMGCP, LOGL_ERROR, "(%s) MGCPGW error proceeding request, graceful shutdown...\n", mgcp_ctx->name); + + /* Set the VM into the state where it waits for the call end */ + osmo_fsm_inst_state_chg(fi, ST_DLCX, 0, 0); + + /* Simulate the call end by sending a teardown event, so that + * the FSM proceeds directly with the DLCX */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +/* Forward declaration to keep the function in logical order */ +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_BTS: startup state machine send out CRCX for BTS side */ +static void fsm_crcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_client_next_endpoint(mgcp); + mgcp_ctx->rtp_endpoint = rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) creating connection for the BTS side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); + snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_BTS; + mgcp_msg.conn_mode = MGCP_CONN_LOOPBACK; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Note: if transmitting fails, receiving will also fail which eventually + * will cause the error be handled by the timeout callback */ + mgcp_client_tx(mgcp, msg, crcx_for_bts_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_PROC, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for BTS associated CRCX */ +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) CRCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse CRCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) CRCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + /* Set the connection details in the conn struct. The code that + * controls the BTS via RSL will take these values and signal them + * to the BTS via RSL/IPACC */ + conn->rtp_port = r->audio_port; + conn->rtp_ip = osmo_ntohl(inet_addr(r->audio_ip)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_BTS_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_PROC: An mgcp response has been received, proceed + * with the assignment request */ +static void fsm_proc_assignmnent_req_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + int chan_mode; + int full_rate; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + OSMO_ASSERT(conn->conn); + chan_mode = mgcp_ctx->chan_mode; + full_rate = mgcp_ctx->full_rate; + + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MGCPGW proceeding assignment request...\n", mgcp_ctx->name); + rc = gsm0808_assign_req(conn->conn, chan_mode, full_rate); + + if (rc < 0) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_BTS, MGCP_BSS_TIMEOUT, MGCP_BSS_TIMEOUT_TIMER_NO); +} + +/* Forward declaration to keep the function in logical order */ +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_BTS: When the BSS has completed the assignment, + * proceed with updating the connection for the BTS side */ +static void fsm_mdcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + struct in_addr addr; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + network = mgcp_ctx->network; + OSMO_ASSERT(network); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) MGCPGW BSS has completed the assignment, now prceed with MDCX towards BTS...\n", + mgcp_ctx->name); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) completing connection for the BTS side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip); + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) BTS expects RTP input on address %s:%u\n", + mgcp_ctx->name, inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_BTS; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + mgcp_msg.audio_ip = inet_ntoa(addr); + mgcp_msg.audio_port = lchan->abis_ip.bound_port; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, mdcx_for_bts_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_CRCX_NET, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for BTS associated MDCX */ +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct in_addr addr; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) MDCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse MDCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) MDCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + addr.s_addr = lchan->abis_ip.bound_ip; + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) MDCX corresponding lchan has been bound to address %s:%u\n", + mgcp_ctx->name, inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_BTS_RESP, mgcp_ctx); +} + +/* Forward declaration to keep the function in logical order */ +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_NET: An mgcp response has been received, proceed... */ +static void fsm_crcx_net_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + struct sockaddr_in *sin; + char *addr; + uint16_t port; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) creating connection for the NET side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* Currently we only have support for IPv4 in our MGCP software, the + * AoIP part is ready to support IPv6 in theory, because the IE + * parser/generator uses sockaddr_storage for the AoIP transport + * identifier. However, the MGCP-GW does not support IPv6 yet. This is + * why we stop here in case some MSC tries to signal IPv6 AoIP + * transport identifiers */ + if (conn->aoip_rtp_addr_remote.ss_family != AF_INET) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW (%s) endpoint:%x MSC uses unsupported address format in AoIP transport identifier -- aborting...\n", + mgcp_ctx->name, rtp_endpoint); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_remote; + addr = inet_ntoa(sin->sin_addr); + port = osmo_ntohs(sin->sin_port); + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MSC expects RTP input on address %s:%u\n", mgcp_ctx->name, addr, port); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + mgcp_msg.conn_id = CONN_ID_NET; + mgcp_msg.conn_mode = MGCP_CONN_RECV_SEND; + mgcp_msg.audio_ip = addr; + mgcp_msg.audio_port = port; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, crcx_for_net_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + int rc; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct sockaddr_in *sin; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) CRCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse CRCX response\n", mgcp_ctx->name); + on_error_goto_dlcx(mgcp_ctx); + return; + } + + LOGP(DMGCP, LOGL_DEBUG, + "MGCPGW: (%s) CRCX responded with address %s:%u\n", mgcp_ctx->name, r->audio_ip, r->audio_port); + + /* Store address */ + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_local; + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = inet_addr(r->audio_ip); + sin->sin_port = osmo_ntohs(r->audio_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_NET_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_COMPL: Send back assignment complete and wait until the call ends */ +static void fsm_send_assignment_complete(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + on_error_goto_dlcx(mgcp_ctx); + return; + } + + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + /* Send assignment completion message via AoIP, this will complete + * the circuit. The message will also contain the port and IP-Address + * where the MGCPGW expects the RTP input from the MSC side */ + bssmap_send_aoip_ass_compl(lchan); + + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) call in progress, waiting for call end...\n", mgcp_ctx->name); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_DLCX, 0, 0); +} + +/* Forward declaration to keep the function in logical order */ +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_DLCX: Remove connection for the BTS and NET side. */ +static void fsm_dlcx_all_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + unsigned int call_id; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + call_id = conn->conn_id; + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) removing connection for the BTS and NET side on " + "MGCPGW endpoint:%x...\n", mgcp_ctx->name, rtp_endpoint); + + /* We now relase the endpoint back to the pool in order to allow + * other connections to use this endpoint */ + mgcp_client_release_endpoint(rtp_endpoint, mgcp); + + /* Generate MGCP message string */ + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID); + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + mgcp_msg.call_id = call_id; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* See note in fsm_init_cb() */ + mgcp_client_tx(mgcp, msg, dlcx_for_all_resp_cb, mgcp_ctx); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_HALT, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NO); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; + struct gsm_network *network; + struct osmo_bsc_sccp_con *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(network); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + /* Note: We check the return code, but in case of an error there is + * not much that can be done to recover. However, at least we tryed + * to remove the connection (if there was even any) */ + if (r->head.response_code != 200) { + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) DLCX response yields error: %d %s\n", + mgcp_ctx->name, r->head.response_code, r->head.comment); + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_DLCX_ALL_RESP, mgcp_ctx); +} + +/* Callback for ST_HALT: Terminate the state machine */ +static void fsm_halt_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGP(DMSC, LOGL_NOTICE, + "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", + mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + LOGP(DMGCP, LOGL_NOTICE, + "MGCPGW: (%s) timeout (T%i) in state %s, state machine halted\n", + mgcp_ctx->name, fi->T, get_value_string(fsm_state_names, fi->state)); + + /* Send pending sigtran message */ + if (mgcp_ctx->resp) { + LOGP(DMSC, LOGL_INFO, "Tx MSC [RESPONSE]\n"); + osmo_bsc_sigtran_send(conn, mgcp_ctx->resp); + mgcp_ctx->resp = NULL; + } + + /* Destroy the state machine and all context information */ + osmo_fsm_inst_free(mgcp_ctx->fsm); + memset(mgcp_ctx, 0, sizeof(*mgcp_ctx)); + talloc_free(mgcp_ctx); +} + +/* Timer callback to shut down in case of connectivity problems */ +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)fi->priv; + struct gsm_network *network; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + network = mgcp_ctx->network; + OSMO_ASSERT(mgcp_ctx); + mgcp = network->mgw.client; + OSMO_ASSERT(mgcp); + + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) timeout (T%i) in state %s, attempting graceful teardown...\n", + mgcp_ctx->name, fi->T, get_value_string(fsm_state_names, fi->state)); + + /* Ensure that no sigtran response, is present. Otherwiese we might try + * to send a sigtran response when the sccp connection is already freed. */ + mgcp_ctx->resp = NULL; + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NO) { + /* Note: We were unable to communicate with the MGCP-GW, + * unfortunately there is no meaningful action we can take + * now other than giving up. */ + LOGP(DMGCP, LOGL_ERROR, + "MGCPGW: (%s) graceful teardown not possible, terminating...\n", mgcp_ctx->name); + + /* At least release the occupied endpoint ID */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); + } else if (fi->T == MGCP_BSS_TIMEOUT_TIMER_NO) + /* Note: If the logic that controls the BSS is unable to + * negotiate a connection, we presumably still have a + * working connection to the MGCP-GW, we will try to + * shut down gracefully. */ + on_error_goto_dlcx(mgcp_ctx); + else { + /* Note: Ther must not be any unsolicited timers + * in this FSM. If so, we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static struct osmo_fsm_state fsm_states[] = { + + /* Startup state machine, send CRCX to BTS. */ + [ST_CRCX_BTS] = { + .in_event_mask = (1 << EV_INIT), + .out_state_mask = (1 << ST_ASSIGN_PROC), + .name = "ST_CRCX_BTS", + .action = fsm_crcx_bts_cb, + }, + + /* When the CRCX response for the BTS side is received, then + * proceed the assignment on the BSS side. */ + [ST_ASSIGN_PROC] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_MDCX_BTS), + .name = "ST_ASSIGN_PROC", + .action = fsm_proc_assignmnent_req_cb, + }, + + /* When the BSS has processed the assignment request, + * then send the MDCX command for the BTS side in order to + * update the connections with the actual PORT/IP where the + * BTS expects the RTP input. */ + [ST_MDCX_BTS] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_ASS_COMPLETE), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_CRCX_NET), + .name = "ST_MDCX_BTS", + .action = fsm_mdcx_bts_cb, + }, + + /* When the MDCX response for the BTS siede is received, then + * directly proceed with sending the CRCX command to connect the + * network side. This is done in one phase (no MDCX needed). */ + [ST_CRCX_NET] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_MDCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_ASSIGN_COMPL), + .name = "ST_CRCX_NET", + .action = fsm_crcx_net_cb, + }, + + /* When the CRCX response for the NET side is received. Then + * send the assignment complete message via the A-Interface and + * enter wait state in order to wait for the end of the call. */ + [ST_ASSIGN_COMPL] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_NET_RESP), + .out_state_mask = (1 << ST_DLCX), + .name = "ST_ASSIGN_COMPL", + .action = fsm_send_assignment_complete, + }, + + /* When the call ends, remove all RTP connections from the + * MGCP-GW by sending a wildcarded DLCX. */ + [ST_DLCX] = { + .in_event_mask = (1 << EV_TEARDOWN), + .out_state_mask = (1 << ST_HALT), + .name = "ST_DLCX", + .action = fsm_dlcx_all_cb, + }, + + /* When the MGCP_GW confirms that the connections are terminated, + * then halt the state machine. */ + [ST_HALT] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_DLCX_ALL_RESP), + .out_state_mask = 0, + .name = "ST_HALT", + .action = fsm_halt_cb, + }, +}; + +/* State machine definition */ +static struct osmo_fsm fsm = { + .name = "FSM MGCP", + .states = fsm_states, + .num_states = ARRAY_SIZE(fsm_states), + .log_subsys = DMGCP, + .timer_cb = fsm_timeout_cb, +}; + +/* Notify that the a new call begins. This will create a connection for the + * BTS on the MGCP-GW and set up the port numbers in struct osmo_bsc_sccp_con. + * After that gsm0808_assign_req() to proceed. + * Parameter: + * ctx: talloc context + * network: associated gsm network + * conn: associated sccp connection + * chan_mode: channel mode (system data, passed through) + * full_rate: full rate flag (system data, passed through) + * Returns an mgcp_context that contains system data and the OSMO-FSM */ +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct gsm_network *network, + struct osmo_bsc_sccp_con *conn, int chan_mode, int full_rate) +{ + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(network); + OSMO_ASSERT(conn); + + /* Register the fsm description (if not already done) */ + if (osmo_fsm_find_by_name(fsm.name) != &fsm) + osmo_fsm_register(&fsm); + + /* Allocate and configure a new fsm instance */ + mgcp_ctx = talloc_zero(ctx, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + + snprintf(mgcp_ctx->name, sizeof(mgcp_ctx->name), "MGCP FSM, id=%i", conn->conn_id); + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm, NULL, ctx, LOGL_DEBUG, "FSM MGCP INST"); + OSMO_ASSERT(mgcp_ctx->fsm); + mgcp_ctx->fsm->priv = mgcp_ctx; + LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MGCPGW handler fsm created\n", mgcp_ctx->name); + mgcp_ctx->network = network; + mgcp_ctx->conn = conn; + mgcp_ctx->chan_mode = chan_mode; + mgcp_ctx->full_rate = full_rate; + + /* start state machine */ + OSMO_ASSERT(mgcp_ctx->fsm->state == ST_CRCX_BTS) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_INIT, mgcp_ctx); + + return mgcp_ctx; +} + +/* Notify that the call has ended, remove all connections from the MGCP-GW, + * then send the clear complete message and destroy the FSM instance + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * respmgcp_ctx: pending clear complete message to send via A-Interface */ +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(resp); + + mgcp_ctx->resp = resp; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +/* Notify that the BSS ready, send the assingnment complete message when the + * mgcp connection is completed + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * lchan: needed for sending the assignment complete message via A-Interface */ +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(lchan); + + mgcp_ctx->lchan = lchan; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASS_COMPLETE, mgcp_ctx); + + return; +} diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 2cdeb64..3b92392 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -33,6 +33,7 @@ #include #include #include +#include /* A pointer to a list with all involved MSCs * (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */ diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index 0e7003f..3ee7534 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include @@ -971,6 +973,8 @@ int bsc_vty_init_extra(void) { + struct gsm_network *net = bsc_gsmnet; + install_element(CONFIG_NODE, &cfg_net_msc_cmd); install_element(CONFIG_NODE, &cfg_net_bsc_cmd); @@ -1035,5 +1039,7 @@ install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); + mgcp_client_vty_init(net, MSC_NODE, net->mgw.conf); + return 0; } -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 19 13:02:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Oct 2017 13:02:28 +0000 Subject: [PATCH] osmo-bsc[master]: log: log the sccp message type of messages sent Message-ID: Review at https://gerrit.osmocom.org/4351 log: log the sccp message type of messages sent We already log the message type of sccp messages we receive, but for transmitting the log output is missing. Also log the message type for tramsitted sccp messages. Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/51/4351/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index c10cead..5c7bd83 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -342,6 +342,7 @@ * the MGCP-GW switching ourselves, we may skip everything * that is MGCP-GW related and sent the clear complete message * directly */ + LOGP(DMSC, LOGL_INFO, "Tx MSC CLEAR COMPLETE\n"); osmo_bsc_sigtran_send(conn, resp); } @@ -421,6 +422,7 @@ return -1; } + LOGP(DMSC, LOGL_INFO, "Tx MSC CIPTHER REJECT\n"); osmo_bsc_sigtran_send(conn, resp); return -1; } @@ -589,6 +591,7 @@ return -1; } + LOGP(DMSC, LOGL_INFO, "Tx MSC ASSIGN FAIL\n"); osmo_bsc_sigtran_send(conn, resp); return -1; } @@ -788,5 +791,6 @@ return -EINVAL; } + LOGP(DMSC, LOGL_INFO, "Tx MSC ASSIGN COMPLETE\n"); return osmo_bsc_sigtran_send(conn->sccp_con, resp); } -- To view, visit https://gerrit.osmocom.org/4351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 19 13:13:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 19 Oct 2017 13:13:11 +0000 Subject: [PATCH] osmo-sgsn[master]: SGSN: print additional GTP-related info Message-ID: Review at https://gerrit.osmocom.org/4352 SGSN: print additional GTP-related info * print libgtp version on startup * print GSN mode and addresses in 'sh sgsn' Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Related: SYS#3610 --- M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c 2 files changed, 20 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/52/4352/1 diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index d79beb3..7036bf6 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -447,7 +447,8 @@ if (rc) { LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen on GTP socket\n"); exit(2); - } + } else + LOGP(DGPRS, LOGL_NOTICE, "libGTP v%s initialized\n", gtp_version()); rc = gprs_subscr_init(&sgsn_inst); if (rc < 0) { diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 1882852..d7b1316 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -44,6 +44,7 @@ #include #include +#include #include "../../bscconfig.h" @@ -511,6 +512,23 @@ link->addr, link->port, VTY_NEWLINE); } + if (sgsn->gsn) { + const char *mode; + + switch (sgsn->gsn->mode) { + case GTP_MODE_SGSN: + mode = "SGSN"; + break; + case GTP_MODE_GGSN: + mode = "GGSN"; + break; + default: + mode = "unknown"; + } + + vty_out(vty, " GSN mode %s: signalling %s, user traffic %s%s", + mode, inet_ntoa(sgsn->gsn->gsnc), inet_ntoa(sgsn->gsn->gsnu), VTY_NEWLINE); + } /* FIXME: statistics */ return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/4352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 19 13:35:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 19 Oct 2017 13:35:24 +0000 Subject: [PATCH] osmo-sgsn[master]: SGSN: print additional GTP-related info In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4352 to look at the new patch set (#2). SGSN: print additional GTP-related info * print libgtp version on startup * print GSN mode and addresses in 'sh sgsn' Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Related: SYS#3610 --- M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M tests/vty_test_runner.py 3 files changed, 21 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/52/4352/2 diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index d79beb3..7036bf6 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -447,7 +447,8 @@ if (rc) { LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen on GTP socket\n"); exit(2); - } + } else + LOGP(DGPRS, LOGL_NOTICE, "libGTP v%s initialized\n", gtp_version()); rc = gprs_subscr_init(&sgsn_inst); if (rc < 0) { diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 1882852..d7b1316 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -44,6 +44,7 @@ #include #include +#include #include "../../bscconfig.h" @@ -511,6 +512,23 @@ link->addr, link->port, VTY_NEWLINE); } + if (sgsn->gsn) { + const char *mode; + + switch (sgsn->gsn->mode) { + case GTP_MODE_SGSN: + mode = "SGSN"; + break; + case GTP_MODE_GGSN: + mode = "GGSN"; + break; + default: + mode = "unknown"; + } + + vty_out(vty, " GSN mode %s: signalling %s, user traffic %s%s", + mode, inet_ntoa(sgsn->gsn->gsnc), inet_ntoa(sgsn->gsn->gsnu), VTY_NEWLINE); + } /* FIXME: statistics */ return CMD_SUCCESS; } diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 9be8d03..8353f2d 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -154,7 +154,7 @@ # self.assertTrue(self.vty.verify('show bssgp nsei 123', [''])) # self.assertTrue(self.vty.verify('show bssgp nsei 123 stats', [''])) - self.assertTrue(self.vty.verify('show sgsn', [''])) + self.assertTrue(self.vty.verify('show sgsn', [' GSN mode SGSN: signalling 127.0.0.1, user traffic 127.0.0.1'])) self.assertTrue(self.vty.verify('show mm-context all', [''])) self.assertTrue(self.vty.verify('show mm-context imsi 000001234567', ['No MM context for IMSI 000001234567'])) self.assertTrue(self.vty.verify('show pdp-context all', [''])) -- To view, visit https://gerrit.osmocom.org/4352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 19 13:35:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 19 Oct 2017 13:35:24 +0000 Subject: [PATCH] osmo-sgsn[master]: SGSN: uncomment BSSGP vty tests Message-ID: Review at https://gerrit.osmocom.org/4353 SGSN: uncomment BSSGP vty tests Change-Id: I9181fc0ecd91e96bf6532aa89b811552009a1b7d --- M tests/vty_test_runner.py 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/53/4353/1 diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 8353f2d..efb0b32 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -150,10 +150,8 @@ self.assert_(res.find('Encapsulation NS-UDP-IP') >= 0) self.assertTrue(self.vty.verify('show bssgp', [''])) self.assertTrue(self.vty.verify('show bssgp stats', [''])) - # TODO: uncomment when the command does not segfault anymore - # self.assertTrue(self.vty.verify('show bssgp nsei 123', [''])) - # self.assertTrue(self.vty.verify('show bssgp nsei 123 stats', [''])) - + self.assertTrue(self.vty.verify('show bssgp nsei 123', [''])) + self.assertTrue(self.vty.verify('show bssgp nsei 123 stats', [''])) self.assertTrue(self.vty.verify('show sgsn', [' GSN mode SGSN: signalling 127.0.0.1, user traffic 127.0.0.1'])) self.assertTrue(self.vty.verify('show mm-context all', [''])) self.assertTrue(self.vty.verify('show mm-context imsi 000001234567', ['No MM context for IMSI 000001234567'])) -- To view, visit https://gerrit.osmocom.org/4353 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9181fc0ecd91e96bf6532aa89b811552009a1b7d Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 19 13:52:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 19 Oct 2017 13:52:16 +0000 Subject: [PATCH] libosmocore[master]: Make osmo_apn_to_str() more robust Message-ID: Review at https://gerrit.osmocom.org/4354 Make osmo_apn_to_str() more robust Previously it would crash on NULL input. Let's handle it gracefully instead. Corresponding test case is also added. Change-Id: I587153e49d1c92128fac3ae5c124adba9592378e --- M src/gsm/apn.c M tests/gprs/gprs_test.c 2 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/4354/1 diff --git a/src/gsm/apn.c b/src/gsm/apn.c index 8d4b2bf..f8303db 100644 --- a/src/gsm/apn.c +++ b/src/gsm/apn.c @@ -53,6 +53,9 @@ char *str = out_str; size_t rest_chars = apn_enc_len; + if (!apn_enc) + return NULL; + while (rest_chars > 0 && apn_enc[0]) { size_t label_size = apn_enc[0]; if (label_size + 1 > rest_chars) diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c index be80e5c..e06761c 100644 --- a/tests/gprs/gprs_test.c +++ b/tests/gprs/gprs_test.c @@ -91,6 +91,13 @@ } { + /* NULL input */ + uint8_t input[] = { 0x1, 65 }; + const char *output = "LOL"; + OSMO_ASSERT(osmo_apn_to_str(output, NULL, ARRAY_SIZE(input) - 1) == NULL); + } + + { uint8_t input[] = { 0x3, 65, 66, 67, 0x2, 90, 122 }; const char *output = "ABC.Zz"; char tmp[strlen(output) + 1]; -- To view, visit https://gerrit.osmocom.org/4354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I587153e49d1c92128fac3ae5c124adba9592378e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 19 13:55:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 19 Oct 2017 13:55:49 +0000 Subject: [PATCH] libosmocore[master]: Make osmo_apn_to_str() more robust In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4354 to look at the new patch set (#2). Make osmo_apn_to_str() more robust Previously it would crash on NULL input. Let's handle it gracefully instead. Corresponding test case is also added. Change-Id: I587153e49d1c92128fac3ae5c124adba9592378e --- M src/gsm/apn.c M tests/gprs/gprs_test.c 2 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/4354/2 diff --git a/src/gsm/apn.c b/src/gsm/apn.c index 8d4b2bf..f8303db 100644 --- a/src/gsm/apn.c +++ b/src/gsm/apn.c @@ -53,6 +53,9 @@ char *str = out_str; size_t rest_chars = apn_enc_len; + if (!apn_enc) + return NULL; + while (rest_chars > 0 && apn_enc[0]) { size_t label_size = apn_enc[0]; if (label_size + 1 > rest_chars) diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c index be80e5c..6f16fb2 100644 --- a/tests/gprs/gprs_test.c +++ b/tests/gprs/gprs_test.c @@ -91,6 +91,13 @@ } { + /* NULL input */ + uint8_t input[] = { 0x1, 65 }; + char *output = "LOL"; + OSMO_ASSERT(osmo_apn_to_str(output, NULL, ARRAY_SIZE(input) - 1) == NULL); + } + + { uint8_t input[] = { 0x3, 65, 66, 67, 0x2, 90, 122 }; const char *output = "ABC.Zz"; char tmp[strlen(output) + 1]; -- To view, visit https://gerrit.osmocom.org/4354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I587153e49d1c92128fac3ae5c124adba9592378e Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 19 15:25:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Oct 2017 15:25:10 +0000 Subject: [PATCH] libosmocore[master]: abis_nm: Add abis_nm_admin_name() API Message-ID: Review at https://gerrit.osmocom.org/4355 abis_nm: Add abis_nm_admin_name() API Similar APIs exist for opstate and availability status. This patch does not break backward compatibility because osmo-bsc still requires direct use of the structure in get_string_value(). Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 --- M include/osmocom/gsm/abis_nm.h M src/gsm/abis_nm.c M src/gsm/libosmogsm.map 3 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/4355/1 diff --git a/include/osmocom/gsm/abis_nm.h b/include/osmocom/gsm/abis_nm.h index e031ee1..70d8134 100644 --- a/include/osmocom/gsm/abis_nm.h +++ b/include/osmocom/gsm/abis_nm.h @@ -30,6 +30,7 @@ extern const struct tlv_definition abis_nm_att_tlvdef; const char *abis_nm_opstate_name(uint8_t os); const char *abis_nm_avail_name(uint8_t avail); +const char *abis_nm_admin_name(uint8_t admin); const char *abis_nm_test_name(uint8_t test); extern const struct tlv_definition abis_nm_osmo_att_tlvdef; extern const struct tlv_definition abis_nm_att_tlvdef_ipa; diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index 7207fb9..3dab705 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -684,6 +684,12 @@ { 0, NULL } }; +/*! Get human-readable string for OML administrative state */ +const char *abis_nm_admin_name(uint8_t admin) +{ + return get_value_string(abis_nm_adm_state_names, admin); +} + static const enum abis_nm_chan_comb chcomb4pchan[] = { [GSM_PCHAN_NONE] = 0xff, [GSM_PCHAN_CCCH] = NM_CHANC_mainBCCH, diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index a72db52..c7369d8 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -1,6 +1,7 @@ LIBOSMOGSM_1.0 { global: +abis_nm_admin_name; abis_nm_adm_state_names; abis_nm_att_settable; abis_nm_avail_name; -- To view, visit https://gerrit.osmocom.org/4355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 19 15:25:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 19 Oct 2017 15:25:53 +0000 Subject: [PATCH] osmo-sgsn[master]: Fix APN printing Message-ID: Review at https://gerrit.osmocom.org/4356 Fix APN printing Previously first character of APN was omitted. Fix this by getting rid of errorneous wrapper function and using osmo_apn_to_str() directly. Change-Id: Ie13b6cd0066e0370e2adf48d12a363c2e405eaf2 Related: SYS#3610 --- M src/gprs/sgsn_vty.c 1 file changed, 2 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/56/4356/1 diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 1882852..4e58f9f 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -117,23 +117,6 @@ DECLARE_TIMER(3395, "Wait for DEACT PDP CTX ACK timer (s)") DECLARE_TIMER(3397, "Wait for DEACT AA PDP CTX ACK timer (s)") - -#define GSM48_MAX_APN_LEN 102 /* 10.5.6.1 */ -/** Copy apn to a static buffer, replacing the length octets in apn_enc with '.' - * and terminating with a '\0'. Return the static buffer. - * len: the length of the encoded APN (which has no terminating zero). - */ -static char *gprs_apn2str(uint8_t *apn, unsigned int len) -{ - static char apnbuf[GSM48_MAX_APN_LEN+1]; - - if (!apn) - return ""; - osmo_apn_to_str(apnbuf, apn, len); - - return apnbuf+1; -} - char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len) { static char str[INET6_ADDRSTRLEN + 10]; @@ -458,8 +441,9 @@ vty_out(vty, "%sPDP Context IMSI: %s, SAPI: %u, NSAPI: %u, TI: %u%s", pfx, imsi, pdp->sapi, pdp->nsapi, pdp->ti, VTY_NEWLINE); if (pdp->lib) { + char apnbuf[APN_MAXLEN + 1]; vty_out(vty, "%s APN: %s%s", pfx, - gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), + osmo_apn_to_str(apnbuf, pdp->lib->apn_use.v, pdp->lib->apn_use.l), VTY_NEWLINE); vty_out(vty, "%s PDP Address: %s%s", pfx, gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), -- To view, visit https://gerrit.osmocom.org/4356 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie13b6cd0066e0370e2adf48d12a363c2e405eaf2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 19 15:29:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 19 Oct 2017 15:29:42 +0000 Subject: osmo-bsc[master]: log: als output hexdump of transmitted sccp messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4350/1/src/osmo-bsc/osmo_bsc_sigtran.c File src/osmo-bsc/osmo_bsc_sigtran.c: Line 344: conn_id, osmo_hexdump(msg->data, msg->len), osmo_sccp_addr_name(ss7, &msc->a.msc_addr)); Why not use msgb_hexdump() instead? -- To view, visit https://gerrit.osmocom.org/4350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 19 15:30:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Oct 2017 15:30:49 +0000 Subject: [PATCH] osmo-bts[master]: oml: Use new API abis_nm_admin_name Message-ID: Review at https://gerrit.osmocom.org/4357 oml: Use new API abis_nm_admin_name Requires libosmocore Ieace734aaff3f07606113feddde65b75202d96d6 Change-Id: I3a013a924257490d9b26376d96f8e38cdf2cd971 --- M src/common/oml.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/57/4357/1 diff --git a/src/common/oml.c b/src/common/oml.c index 69a2642..adf6964 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1036,8 +1036,7 @@ /* Step 2: Do some global dependency/consistency checking */ if (mo->nm_state.administrative == adm_state) LOGP(DOML, LOGL_NOTICE, - "ADM state already was %s\n", - get_value_string(abis_nm_adm_state_names, adm_state)); + "ADM state already was %s\n", abis_nm_admin_name(adm_state)); /* Step 3: Ask BTS driver to apply the state chg */ return bts_model_chg_adm_state(bts, mo, obj, adm_state); -- To view, visit https://gerrit.osmocom.org/4357 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3a013a924257490d9b26376d96f8e38cdf2cd971 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 19 15:30:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Oct 2017 15:30:50 +0000 Subject: [PATCH] osmo-bts[master]: vty: Use new API abis_nm_admin_name Message-ID: Review at https://gerrit.osmocom.org/4358 vty: Use new API abis_nm_admin_name Requires libosmocore Ieace734aaff3f07606113feddde65b75202d96d6 Change-Id: Ie41479958d6a57708e4b50705fd85c65f02e4527 --- M src/common/vty.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/4358/1 diff --git a/src/common/vty.c b/src/common/vty.c index 77bb47d..fb5015c 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -711,8 +711,9 @@ static void net_dump_nmstate(struct vty *vty, struct gsm_nm_state *nms) { - vty_out(vty,"Oper '%s', Admin %u, Avail '%s'%s", - abis_nm_opstate_name(nms->operational), nms->administrative, + vty_out(vty,"Oper '%s', Admin '%s', Avail '%s'%s", + abis_nm_opstate_name(nms->operational), + abis_nm_admin_name(nms->administrative), abis_nm_avail_name(nms->availability), VTY_NEWLINE); } -- To view, visit https://gerrit.osmocom.org/4358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie41479958d6a57708e4b50705fd85c65f02e4527 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 19 15:37:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Oct 2017 15:37:19 +0000 Subject: [PATCH] osmo-bsc[master]: libbsc: Use abis_nm_admin_name API Message-ID: Review at https://gerrit.osmocom.org/4359 libbsc: Use abis_nm_admin_name API Requires libosmocore Ieace734aaff3f07606113feddde65b75202d96d6 Change-Id: I2dccebef2f7fc745b845a49d723f5d89fc2baa41 --- M src/libbsc/abis_nm.c M src/libbsc/bsc_vty.c 2 files changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/59/4359/1 diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index f0dfe9e..a8b1e82 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -237,9 +237,7 @@ new_state.availability = 0xff; if (TLVP_PRESENT(&tp, NM_ATT_ADM_STATE)) { new_state.administrative = *TLVP_VAL(&tp, NM_ATT_ADM_STATE); - DEBUGPC(DNM, "ADM=%2s ", - get_value_string(abis_nm_adm_state_names, - new_state.administrative)); + DEBUGPC(DNM, "ADM=%2s ", abis_nm_admin_name(new_state.administrative)); } DEBUGPC(DNM, "\n"); @@ -2824,8 +2822,8 @@ uint8_t new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Changing adm. state %s -> %s [%s]\n", trx->bts->nr, trx->nr, - get_value_string(abis_nm_adm_state_names, trx->mo.nm_state.administrative), - get_value_string(abis_nm_adm_state_names, new_state), reason); + abis_nm_admin_name(trx->mo.nm_state.administrative), + abis_nm_admin_name(new_state), reason); trx->mo.nm_state.administrative = new_state; if (!trx->bts || !trx->bts->oml_link) diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index ca29b4c..10f05af 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -136,7 +136,7 @@ { vty_out(vty,"Oper '%s', Admin '%s', Avail '%s'%s", abis_nm_opstate_name(nms->operational), - get_value_string(abis_nm_adm_state_names, nms->administrative), + abis_nm_admin_name(nms->administrative), abis_nm_avail_name(nms->availability), VTY_NEWLINE); } -- To view, visit https://gerrit.osmocom.org/4359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2dccebef2f7fc745b845a49d723f5d89fc2baa41 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 19 15:37:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Oct 2017 15:37:19 +0000 Subject: [PATCH] osmo-bsc[master]: libbsc: Fix trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/4360 libbsc: Fix trailing whitespace Change-Id: I7bfc07d2050bd9e5cac149ae097c0daf3421548a --- M src/libbsc/abis_nm.c M src/libbsc/bsc_vty.c 2 files changed, 19 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/60/4360/1 diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index a8b1e82..a2e04b8 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -218,7 +218,7 @@ } new_state = *nm_state; - + abis_nm_tlv_parse(&tp, bts, foh->data, oh->length-sizeof(*foh)); if (TLVP_PRESENT(&tp, NM_ATT_OPER_STATE)) { new_state.operational = *TLVP_VAL(&tp, NM_ATT_OPER_STATE); @@ -399,7 +399,7 @@ default: DEBUGPC(DNM, "reporting NM MT 0x%02x\n", mt); break; - + }; return 0; @@ -1009,7 +1009,7 @@ sw_add_file_id_and_ver(sw, msg); msgb_tv_put(msg, NM_ATT_WINDOW_SIZE, sw->window_size); - + return abis_nm_sendmsg(sw->bts, msg); } @@ -1220,7 +1220,7 @@ sw->file_version_len = strlen(file_version); /* rewind to start of file */ rewind(sw->stream); - break; + break; case GSM_BTS_TYPE_NANOBTS: /* TODO: extract that from the filename or content */ rc = parse_sdp_header(sw); @@ -1242,7 +1242,7 @@ return 0; } - + static void sw_close_file(struct abis_nm_sw *sw) { switch (sw->bts->type) { @@ -1278,7 +1278,7 @@ int rc = -1; struct abis_nm_sw *sw = &g_sw; enum sw_state old_state = sw->state; - + //DEBUGP(DNM, "state %u, NM MT 0x%02x\n", sw->state, foh->msg_type); switch (sw->state) { @@ -1530,7 +1530,7 @@ ch->attrib = NM_ATT_ABIS_CHANNEL; ch->bts_port = bts_port; ch->timeslot = ts_nr; - ch->subslot = subslot_nr; + ch->subslot = subslot_nr; } int abis_nm_establish_tei(struct gsm_bts *bts, uint8_t trx_nr, @@ -1545,7 +1545,7 @@ oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, len, NM_MT_ESTABLISH_TEI, NM_OC_RADIO_CARRIER, bts->bts_nr, trx_nr, 0xff); - + msgb_tv_put(msg, NM_ATT_TEI, tei); ch = (struct abis_nm_channel *) msgb_put(msg, sizeof(*ch)); @@ -1566,7 +1566,7 @@ oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, sizeof(*ch), NM_MT_CONN_TERR_SIGN, NM_OC_RADIO_CARRIER, bts->bts_nr, trx->nr, 0xff); - + ch = (struct abis_nm_channel *) msgb_put(msg, sizeof(*ch)); fill_nm_channel(ch, e1_port, e1_timeslot, e1_subslot); @@ -2286,7 +2286,7 @@ fill_om_fom_hdr(oh, 0, NM_MT_BS11_LMT_LOGOFF, NM_OC_BS11_BTSE, 0xff, 0xff, 0xff); } - + return abis_nm_sendmsg(bts, msg); } @@ -2313,7 +2313,7 @@ struct abis_om_hdr *oh; struct msgb *msg; uint8_t tlv_value; - + msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, 3, NM_MT_BS11_SET_ATTR, NM_OC_BS11, @@ -2323,9 +2323,9 @@ tlv_value = BS11_LI_PLL_LOCKED; else tlv_value = BS11_LI_PLL_STANDALONE; - + msgb_tlv_put(msg, NM_ATT_BS11_PLL_MODE, 1, &tlv_value); - + return abis_nm_sendmsg(bts, msg); } @@ -2383,7 +2383,7 @@ lh = queue->next; llist_del(lh); - + return llist_entry(lh, struct file_list_entry, list); } @@ -2412,7 +2412,7 @@ if (strlen(linebuf) < 4) continue; - + rc = sscanf(linebuf+4, "%12s:%80s\r\n", file_id, file_version); if (rc < 0) { perror("ERR parsing SWL file"); @@ -2433,7 +2433,7 @@ strncat(fle->fname, dirname(dir), sizeof(fle->fname) - 1); strcat(fle->fname, "/"); strncat(fle->fname, file_id, sizeof(fle->fname) - 1 -strlen(fle->fname)); - + llist_add_tail(&fle->list, &bs11_sw->file_list); } @@ -2535,7 +2535,7 @@ NM_ATT_FILE_VERSION, NM_ATT_OPER_STATE, 0xe8, NM_ATT_BS11_ALL_TEST_CATG, NM_ATT_SW_DESCR, NM_ATT_GET_ARI }; #endif - + static uint8_t req_attr[] = { NM_ATT_ADM_STATE, NM_ATT_AVAIL_STATUS, 0xa8, NM_ATT_OPER_STATE, 0xd5, 0xa1, NM_ATT_BS11_ESN_FW_CODE_NO, NM_ATT_BS11_ESN_HW_CODE_NO, diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 10f05af..ca1479f 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -606,7 +606,7 @@ else vty_out(vty, " radio-link-timeout %d%s", gsm_bts_get_radio_link_timeout(bts), VTY_NEWLINE); - + vty_out(vty, " channel allocator %s%s", bts->chan_alloc_reverse ? "descending" : "ascending", VTY_NEWLINE); @@ -1442,7 +1442,7 @@ } bts = gsm_bts_num(net, bts_nr); bts_paging_dump_vty(vty, bts); - + return CMD_SUCCESS; } for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { -- To view, visit https://gerrit.osmocom.org/4360 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7bfc07d2050bd9e5cac149ae097c0daf3421548a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 19 16:07:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Oct 2017 16:07:18 +0000 Subject: [PATCH] openbsc[master]: Make TRX rf locking more visible Message-ID: Review at https://gerrit.osmocom.org/4361 Make TRX rf locking more visible * log administrative state transitions * log what's caused it * while at it, mark boolean variable as such Cherry-picked from osmo-bsc be356ed32fbd28dc8d1460371d9e47511b20ac63 Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Related: SYS#3864 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/abis_nm.c M openbsc/src/libbsc/bsc_rf_ctrl.c M openbsc/src/libbsc/bsc_vty.c 4 files changed, 12 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/61/4361/1 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 4035b39..57fa301 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -578,7 +578,7 @@ void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, uint8_t e1_ts, uint8_t e1_ts_ss); -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); +void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason); bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr); int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx); diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index cf20d7c..f24f6bf 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -2791,9 +2791,13 @@ *((uint16_t *)(buf + 5)) = htons(bts->cell_identity); } -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked) +void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason) { - int new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; + uint8_t new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; + + LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Changing adm. state %s -> %s [%s]\n", trx->bts->nr, trx->nr, + get_value_string(abis_nm_adm_state_names, trx->mo.nm_state.administrative), + get_value_string(abis_nm_adm_state_names, new_state), reason); trx->mo.nm_state.administrative = new_state; if (!trx->bts || !trx->bts->oml_link) diff --git a/openbsc/src/libbsc/bsc_rf_ctrl.c b/openbsc/src/libbsc/bsc_rf_ctrl.c index b7b6fc8..0e28600 100644 --- a/openbsc/src/libbsc/bsc_rf_ctrl.c +++ b/openbsc/src/libbsc/bsc_rf_ctrl.c @@ -123,7 +123,7 @@ } } -static int lock_each_trx(struct gsm_network *net, int lock) +static int lock_each_trx(struct gsm_network *net, bool lock) { struct gsm_bts *bts; @@ -138,7 +138,7 @@ } llist_for_each_entry(trx, &bts->trx_list, list) { - gsm_trx_lock_rf(trx, lock); + gsm_trx_lock_rf(trx, lock, "ctrl"); } } @@ -245,7 +245,7 @@ static int switch_rf_off(struct osmo_bsc_rf *rf) { - lock_each_trx(rf->gsm_network, 1); + lock_each_trx(rf->gsm_network, true); send_signal(rf, S_RF_OFF); return 0; @@ -289,7 +289,7 @@ case RF_CMD_ON: rf->last_state_command = "RF Direct On"; osmo_timer_del(&rf->grace_timeout); - lock_each_trx(rf->gsm_network, 0); + lock_each_trx(rf->gsm_network, false); send_signal(rf, S_RF_ON); osmo_timer_schedule(&rf->rf_check, 3, 0); break; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 0d5377d..200f633 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -3562,7 +3562,7 @@ int locked = atoi(argv[0]); struct gsm_bts_trx *trx = vty->index; - gsm_trx_lock_rf(trx, locked); + gsm_trx_lock_rf(trx, locked, "vty"); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/4361 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 19 16:07:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Oct 2017 16:07:18 +0000 Subject: [PATCH] openbsc[master]: libbsc: Use abis_nm_admin_name API Message-ID: Review at https://gerrit.osmocom.org/4362 libbsc: Use abis_nm_admin_name API Requires libosmocore Ieace734aaff3f07606113feddde65b75202d96d6 Cherry-picked from osmo-bsc 7bf75dcfb98366b1f23d390a350faa836e00f817 Change-Id: I2dccebef2f7fc745b845a49d723f5d89fc2baa41 --- M openbsc/src/libbsc/abis_nm.c M openbsc/src/libbsc/bsc_vty.c 2 files changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/62/4362/1 diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index f24f6bf..35b58bb 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -237,9 +237,7 @@ new_state.availability = 0xff; if (TLVP_PRESENT(&tp, NM_ATT_ADM_STATE)) { new_state.administrative = *TLVP_VAL(&tp, NM_ATT_ADM_STATE); - DEBUGPC(DNM, "ADM=%2s ", - get_value_string(abis_nm_adm_state_names, - new_state.administrative)); + DEBUGPC(DNM, "ADM=%2s ", abis_nm_admin_name(new_state.administrative)); } DEBUGPC(DNM, "\n"); @@ -2796,8 +2794,8 @@ uint8_t new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Changing adm. state %s -> %s [%s]\n", trx->bts->nr, trx->nr, - get_value_string(abis_nm_adm_state_names, trx->mo.nm_state.administrative), - get_value_string(abis_nm_adm_state_names, new_state), reason); + abis_nm_admin_name(trx->mo.nm_state.administrative), + abis_nm_admin_name(new_state), reason); trx->mo.nm_state.administrative = new_state; if (!trx->bts || !trx->bts->oml_link) diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 200f633..db3759e 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -135,7 +135,7 @@ { vty_out(vty,"Oper '%s', Admin '%s', Avail '%s'%s", abis_nm_opstate_name(nms->operational), - get_value_string(abis_nm_adm_state_names, nms->administrative), + abis_nm_admin_name(nms->administrative), abis_nm_avail_name(nms->availability), VTY_NEWLINE); } -- To view, visit https://gerrit.osmocom.org/4362 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2dccebef2f7fc745b845a49d723f5d89fc2baa41 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 19 16:07:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Oct 2017 16:07:19 +0000 Subject: [PATCH] openbsc[master]: libbsc: Fix trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/4363 libbsc: Fix trailing whitespace Cherry-picked from osmo-bsc 4e8dac827a3e9e6b7b0aba816d4cec15460e5ac3 Change-Id: I9c4a6ffbf34f861ae10a09b6320ececd7c9bc7b4 --- M openbsc/src/libbsc/abis_nm.c M openbsc/src/libbsc/bsc_vty.c 2 files changed, 18 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/63/4363/1 diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 35b58bb..0ee51fd 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -218,7 +218,7 @@ } new_state = *nm_state; - + abis_nm_tlv_parse(&tp, bts, foh->data, oh->length-sizeof(*foh)); if (TLVP_PRESENT(&tp, NM_ATT_OPER_STATE)) { new_state.operational = *TLVP_VAL(&tp, NM_ATT_OPER_STATE); @@ -399,7 +399,7 @@ default: DEBUGPC(DNM, "reporting NM MT 0x%02x\n", mt); break; - + }; return 0; @@ -981,7 +981,7 @@ sw_add_file_id_and_ver(sw, msg); msgb_tv_put(msg, NM_ATT_WINDOW_SIZE, sw->window_size); - + return abis_nm_sendmsg(sw->bts, msg); } @@ -1192,7 +1192,7 @@ sw->file_version_len = strlen(file_version); /* rewind to start of file */ rewind(sw->stream); - break; + break; case GSM_BTS_TYPE_NANOBTS: /* TODO: extract that from the filename or content */ rc = parse_sdp_header(sw); @@ -1214,7 +1214,7 @@ return 0; } - + static void sw_close_file(struct abis_nm_sw *sw) { switch (sw->bts->type) { @@ -1250,7 +1250,7 @@ int rc = -1; struct abis_nm_sw *sw = &g_sw; enum sw_state old_state = sw->state; - + //DEBUGP(DNM, "state %u, NM MT 0x%02x\n", sw->state, foh->msg_type); switch (sw->state) { @@ -1502,7 +1502,7 @@ ch->attrib = NM_ATT_ABIS_CHANNEL; ch->bts_port = bts_port; ch->timeslot = ts_nr; - ch->subslot = subslot_nr; + ch->subslot = subslot_nr; } int abis_nm_establish_tei(struct gsm_bts *bts, uint8_t trx_nr, @@ -1517,7 +1517,7 @@ oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, len, NM_MT_ESTABLISH_TEI, NM_OC_RADIO_CARRIER, bts->bts_nr, trx_nr, 0xff); - + msgb_tv_put(msg, NM_ATT_TEI, tei); ch = (struct abis_nm_channel *) msgb_put(msg, sizeof(*ch)); @@ -1538,7 +1538,7 @@ oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, sizeof(*ch), NM_MT_CONN_TERR_SIGN, NM_OC_RADIO_CARRIER, bts->bts_nr, trx->nr, 0xff); - + ch = (struct abis_nm_channel *) msgb_put(msg, sizeof(*ch)); fill_nm_channel(ch, e1_port, e1_timeslot, e1_subslot); @@ -2258,7 +2258,7 @@ fill_om_fom_hdr(oh, 0, NM_MT_BS11_LMT_LOGOFF, NM_OC_BS11_BTSE, 0xff, 0xff, 0xff); } - + return abis_nm_sendmsg(bts, msg); } @@ -2285,7 +2285,7 @@ struct abis_om_hdr *oh; struct msgb *msg; uint8_t tlv_value; - + msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, 3, NM_MT_BS11_SET_ATTR, NM_OC_BS11, @@ -2295,9 +2295,9 @@ tlv_value = BS11_LI_PLL_LOCKED; else tlv_value = BS11_LI_PLL_STANDALONE; - + msgb_tlv_put(msg, NM_ATT_BS11_PLL_MODE, 1, &tlv_value); - + return abis_nm_sendmsg(bts, msg); } @@ -2355,7 +2355,7 @@ lh = queue->next; llist_del(lh); - + return llist_entry(lh, struct file_list_entry, list); } @@ -2384,7 +2384,7 @@ if (strlen(linebuf) < 4) continue; - + rc = sscanf(linebuf+4, "%12s:%80s\r\n", file_id, file_version); if (rc < 0) { perror("ERR parsing SWL file"); @@ -2405,7 +2405,7 @@ strncat(fle->fname, dirname(dir), sizeof(fle->fname) - 1); strcat(fle->fname, "/"); strncat(fle->fname, file_id, sizeof(fle->fname) - 1 -strlen(fle->fname)); - + llist_add_tail(&fle->list, &bs11_sw->file_list); } @@ -2507,7 +2507,7 @@ NM_ATT_FILE_VERSION, NM_ATT_OPER_STATE, 0xe8, NM_ATT_BS11_ALL_TEST_CATG, NM_ATT_SW_DESCR, NM_ATT_GET_ARI }; #endif - + static uint8_t req_attr[] = { NM_ATT_ADM_STATE, NM_ATT_AVAIL_STATUS, 0xa8, NM_ATT_OPER_STATE, 0xd5, 0xa1, NM_ATT_BS11_ESN_FW_CODE_NO, NM_ATT_BS11_ESN_HW_CODE_NO, diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index db3759e..b2b1162 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1395,7 +1395,7 @@ } bts = gsm_bts_num(net, bts_nr); bts_paging_dump_vty(vty, bts); - + return CMD_SUCCESS; } for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { -- To view, visit https://gerrit.osmocom.org/4363 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9c4a6ffbf34f861ae10a09b6320ececd7c9bc7b4 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 19 16:08:56 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 19 Oct 2017 16:08:56 +0000 Subject: openbsc[master]: Make TRX rf locking more visible In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4361 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 19 16:14:32 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Oct 2017 16:14:32 +0000 Subject: [PATCH] osmo-sgsn[master]: configure: fix libosmo-sigtran dependency Message-ID: Review at https://gerrit.osmocom.org/4364 configure: fix libosmo-sigtran dependency the configure script requires libosmo-sigtran even when IU is not enabled. move the line that checks for libosmo-sigtran into the conditional branch for IU Change-Id: I72819462db0b4656fabaa80731342d06ae91fcdf --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/64/4364/1 diff --git a/configure.ac b/configure.ac index c8e23e5..0daa5e2 100644 --- a/configure.ac +++ b/configure.ac @@ -46,13 +46,13 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) if test "x$osmo_ac_iu" = "xyes" ; then + PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) -- To view, visit https://gerrit.osmocom.org/4364 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72819462db0b4656fabaa80731342d06ae91fcdf Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 19 16:21:49 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Oct 2017 16:21:49 +0000 Subject: [PATCH] osmo-sgsn[master]: log: fix default loglevels Message-ID: Review at https://gerrit.osmocom.org/4365 log: fix default loglevels for some log categories the default loglevel is far to verbose. downgrade all loglevels to LOGL_NOTICE Change-Id: I3a427ce201c96338a00a84d737d090ac1a77a29f --- M src/gprs/sgsn_main.c 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/65/4365/1 diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index d79beb3..2ef077d 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -302,47 +302,47 @@ [DGPRS] = { .name = "DGPRS", .description = "GPRS Packet Service", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DNS] = { .name = "DNS", .description = "GPRS Network Service (NS)", - .enabled = 1, .loglevel = LOGL_INFO, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DBSSGP] = { .name = "DBSSGP", .description = "GPRS BSS Gateway Protocol (BSSGP)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DLLC] = { .name = "DLLC", .description = "GPRS Logical Link Control Protocol (LLC)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DSNDCP] = { .name = "DSNDCP", .description = "GPRS Sub-Network Dependent Control Protocol (SNDCP)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DRANAP] = { .name = "DRANAP", .description = "RAN Application Part (RANAP)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DSUA] = { .name = "DSUA", .description = "SCCP User Adaptation (SUA)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DSLHC] = { .name = "DSLHC", .description = "RFC1144 TCP/IP Header compression (SLHC)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DV42BIS] = { .name = "DV42BIS", .description = "V.42bis data compression (SNDCP)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, } }; -- To view, visit https://gerrit.osmocom.org/4365 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3a427ce201c96338a00a84d737d090ac1a77a29f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 19 17:06:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Oct 2017 17:06:46 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 2: > Actually, I think we should start to avoid TODO-RELEASE and tag a > new release with updated LIBVERSION every time we break ABI or API > compatibility. Let's discuss / clarify this when we next get the chance to talk; when ABI or API compat is being broken, an immediate release should happen, when we just add new things in a non-breaking way, a TODO_RELEASE entry should suffice. right? In detail, how would dexter go about this? IIUC this commit still needs to be as it is, with a TODO_RELEASE entry, and *only when this got accepted and merged* is it possible to run a 'make release', sign the tag and bump the versions, apply changelog, push the git version tag, apply depending callers' required-revision bumps. right? I guess we need a release manager hat, and every time a change to a TODO_RELEASE has been merged, there needs to be some bump to the release manager to fire a new release. Alternatively, the release manager hat makes sure that the individual developers follow up with a release after the ABI/API changes have been merged. -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 08:52:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 08:52:15 +0000 Subject: osmo-sgsn[master]: log: fix default loglevels In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4365 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3a427ce201c96338a00a84d737d090ac1a77a29f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 10:28:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 10:28:57 +0000 Subject: [PATCH] libosmocore[master]: GPRS: print remote state info for NS peer Message-ID: Review at https://gerrit.osmocom.org/4366 GPRS: print remote state info for NS peer Change-Id: I1714c68909507eae6ef2933661a085859aca3b54 Related: SYS#3610 --- M src/gb/gprs_ns_vty.c 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/4366/1 diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index f94d9c2..3b1a698 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -158,11 +158,13 @@ static void dump_nse(struct vty *vty, struct gprs_nsvc *nsvc, int stats) { - vty_out(vty, "NSEI %5u, NS-VC %5u, Remote: %-4s, %5s %9s", + vty_out(vty, "NSEI %5u, NS-VC %5u, %5s %9s, Remote: %-4s, %5s %9s", nsvc->nsei, nsvc->nsvci, - nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", nsvc->state & NSE_S_ALIVE ? "ALIVE" : "DEAD", - nsvc->state & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED"); + nsvc->state & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED", + nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", + nsvc->remote_state & NSE_S_ALIVE ? "ALIVE" : "DEAD", + nsvc->remote_state & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED"); if (nsvc->ll == GPRS_NS_LL_UDP || nsvc->ll == GPRS_NS_LL_FR_GRE) vty_out(vty, ", %s %15s:%u", nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE", -- To view, visit https://gerrit.osmocom.org/4366 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1714c68909507eae6ef2933661a085859aca3b54 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 20 10:48:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 10:48:58 +0000 Subject: [PATCH] libosmocore[master]: Expand osmo_gettimeofday() docs Message-ID: Review at https://gerrit.osmocom.org/4367 Expand osmo_gettimeofday() docs Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c Related: OS#2586 --- M src/timer_gettimeofday.c 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/4367/1 diff --git a/src/timer_gettimeofday.c b/src/timer_gettimeofday.c index 1bf714e..4298805 100644 --- a/src/timer_gettimeofday.c +++ b/src/timer_gettimeofday.c @@ -33,7 +33,13 @@ /*! shim around gettimeofday to be able to set the time manually. * To override, set osmo_gettimeofday_override == true and set the desired - * current time in osmo_gettimeofday_override_time. */ + * current time in osmo_gettimeofday_override_time. + * + * N. B: gettimeofday() is affected by discontinuous jumps in the system time + * (e.g., if the system administrator manually changes the system time). + * Hence this should NEVER be used for elapsed time computation. + * Instead, clock_gettime(CLOCK_MONOTONIC, ..) should be used for that (with similar shim if necessary). + */ int osmo_gettimeofday(struct timeval *tv, struct timezone *tz) { if (osmo_gettimeofday_override) { -- To view, visit https://gerrit.osmocom.org/4367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:04:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:04:44 +0000 Subject: libosmocore[master]: Expand osmo_gettimeofday() docs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4367/1/src/timer_gettimeofday.c File src/timer_gettimeofday.c: Line 39: * (e.g., if the system administrator manually changes the system time). I don't think that this indented formatting will survive in a meaningful way in doxygen. Did you verify that? -- To view, visit https://gerrit.osmocom.org/4367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:05:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:05:57 +0000 Subject: libosmocore[master]: GPRS: print remote state info for NS peer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4366 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1714c68909507eae6ef2933661a085859aca3b54 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:06:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:06:25 +0000 Subject: osmo-sgsn[master]: log: fix default loglevels In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4365 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3a427ce201c96338a00a84d737d090ac1a77a29f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:06:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:06:38 +0000 Subject: osmo-sgsn[master]: configure: fix libosmo-sigtran dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4364 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72819462db0b4656fabaa80731342d06ae91fcdf Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:08:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:08:25 +0000 Subject: openbsc[master]: Make TRX rf locking more visible In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4361 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:08:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:08:48 +0000 Subject: openbsc[master]: libbsc: Use abis_nm_admin_name API In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4362 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2dccebef2f7fc745b845a49d723f5d89fc2baa41 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:09:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:09:00 +0000 Subject: openbsc[master]: libbsc: Fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4363 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9c4a6ffbf34f861ae10a09b6320ececd7c9bc7b4 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:09:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:09:27 +0000 Subject: osmo-bsc[master]: libbsc: Use abis_nm_admin_name API In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2dccebef2f7fc745b845a49d723f5d89fc2baa41 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:10:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:10:11 +0000 Subject: osmo-bsc[master]: libbsc: Fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4360 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7bfc07d2050bd9e5cac149ae097c0daf3421548a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:13:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:13:37 +0000 Subject: libosmocore[master]: abis_nm: Add abis_nm_admin_name() API In-Reply-To: References: Message-ID: Patch Set 1: I think we decided quote some time ago not to introduce such helper functions anymore - and/or if at all, make them inline wrappers around the access to the respective value string array. So now there's the conflict in whether we align with current best practises or with the style that's used in the file so far. Also, this is yet another change that will break compilation with older libosmocore version. For I believe *very* questionable gain. So we spend time on writing this code, changing all the existing users, reviewing it, merging it and then it will cause more build failures. Interested in other opinions, but my gut feeling is to not merge this. -- To view, visit https://gerrit.osmocom.org/4355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:15:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:15:44 +0000 Subject: osmo-sgsn[master]: Fix APN printing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 might have been good to refer to Change-Id I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 which likely broke it? -- To view, visit https://gerrit.osmocom.org/4356 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie13b6cd0066e0370e2adf48d12a363c2e405eaf2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:15:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:15:57 +0000 Subject: osmo-sgsn[master]: SGSN: uncomment BSSGP vty tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4353 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9181fc0ecd91e96bf6532aa89b811552009a1b7d Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:17:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:17:22 +0000 Subject: osmo-sgsn[master]: SGSN: print additional GTP-related info In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4352/2//COMMIT_MSG Commit Message: PS2, Line 10: GSN mode what point is there to print the GSN mode? Would a GNS mode != SGSN ever make sense in a SGSN? If not, then OSMO_ASSERT() n the GSN mode is the correct approach, wouldn't you agree? -- To view, visit https://gerrit.osmocom.org/4352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:21:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:21:17 +0000 Subject: osmo-bsc[master]: log: log the sccp message type of messages sent In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4351/1/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 346: osmo_bsc_sigtran_send(conn, resp); I think rather than adding a hand-crafted line with a hand-crafted string of the messag type, you would want to add this ti osmo_bsc_sigtran_send() and parse/dereference the header and use a value_string array to resolve the message type. I prsume we probably have such an array of BSSAP message types alrady somewhere? -- To view, visit https://gerrit.osmocom.org/4351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:27:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 11:27:50 +0000 Subject: [PATCH] osmo-sgsn[master]: Fix APN printing In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4356 to look at the new patch set (#2). Fix APN printing 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 --- M src/gprs/sgsn_vty.c 1 file changed, 2 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/56/4356/2 diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 1882852..4e58f9f 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -117,23 +117,6 @@ DECLARE_TIMER(3395, "Wait for DEACT PDP CTX ACK timer (s)") DECLARE_TIMER(3397, "Wait for DEACT AA PDP CTX ACK timer (s)") - -#define GSM48_MAX_APN_LEN 102 /* 10.5.6.1 */ -/** Copy apn to a static buffer, replacing the length octets in apn_enc with '.' - * and terminating with a '\0'. Return the static buffer. - * len: the length of the encoded APN (which has no terminating zero). - */ -static char *gprs_apn2str(uint8_t *apn, unsigned int len) -{ - static char apnbuf[GSM48_MAX_APN_LEN+1]; - - if (!apn) - return ""; - osmo_apn_to_str(apnbuf, apn, len); - - return apnbuf+1; -} - char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len) { static char str[INET6_ADDRSTRLEN + 10]; @@ -458,8 +441,9 @@ vty_out(vty, "%sPDP Context IMSI: %s, SAPI: %u, NSAPI: %u, TI: %u%s", pfx, imsi, pdp->sapi, pdp->nsapi, pdp->ti, VTY_NEWLINE); if (pdp->lib) { + char apnbuf[APN_MAXLEN + 1]; vty_out(vty, "%s APN: %s%s", pfx, - gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), + osmo_apn_to_str(apnbuf, pdp->lib->apn_use.v, pdp->lib->apn_use.l), VTY_NEWLINE); vty_out(vty, "%s PDP Address: %s%s", pfx, gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), -- To view, visit https://gerrit.osmocom.org/4356 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie13b6cd0066e0370e2adf48d12a363c2e405eaf2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:28:08 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 11:28:08 +0000 Subject: [MERGED] libosmocore[master]: GPRS: print remote state info for NS peer In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: GPRS: print remote state info for NS peer ...................................................................... GPRS: print remote state info for NS peer Change-Id: I1714c68909507eae6ef2933661a085859aca3b54 Related: SYS#3610 --- M src/gb/gprs_ns_vty.c 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index f94d9c2..3b1a698 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -158,11 +158,13 @@ static void dump_nse(struct vty *vty, struct gprs_nsvc *nsvc, int stats) { - vty_out(vty, "NSEI %5u, NS-VC %5u, Remote: %-4s, %5s %9s", + vty_out(vty, "NSEI %5u, NS-VC %5u, %5s %9s, Remote: %-4s, %5s %9s", nsvc->nsei, nsvc->nsvci, - nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", nsvc->state & NSE_S_ALIVE ? "ALIVE" : "DEAD", - nsvc->state & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED"); + nsvc->state & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED", + nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", + nsvc->remote_state & NSE_S_ALIVE ? "ALIVE" : "DEAD", + nsvc->remote_state & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED"); if (nsvc->ll == GPRS_NS_LL_UDP || nsvc->ll == GPRS_NS_LL_FR_GRE) vty_out(vty, ", %s %15s:%u", nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE", -- To view, visit https://gerrit.osmocom.org/4366 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1714c68909507eae6ef2933661a085859aca3b54 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:40:39 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 11:40:39 +0000 Subject: [PATCH] osmo-sgsn[master]: SGSN: print additional GTP-related info In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4352 to look at the new patch set (#3). SGSN: print additional GTP-related info * print libgtp version on startup * print GSN addresses in 'sh sgsn' Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Related: SYS#3610 --- M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M tests/vty_test_runner.py 3 files changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/52/4352/3 diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index d79beb3..7036bf6 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -447,7 +447,8 @@ if (rc) { LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen on GTP socket\n"); exit(2); - } + } else + LOGP(DGPRS, LOGL_NOTICE, "libGTP v%s initialized\n", gtp_version()); rc = gprs_subscr_init(&sgsn_inst); if (rc < 0) { diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 1882852..ab02d81 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -44,6 +44,7 @@ #include #include +#include #include "../../bscconfig.h" @@ -511,6 +512,10 @@ link->addr, link->port, VTY_NEWLINE); } + if (sgsn->gsn) + vty_out(vty, " GSN: signalling %s, user traffic %s%s", + inet_ntoa(sgsn->gsn->gsnc), inet_ntoa(sgsn->gsn->gsnu), VTY_NEWLINE); + /* FIXME: statistics */ return CMD_SUCCESS; } diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 104bba4..9b8c560 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -152,7 +152,7 @@ self.assertTrue(self.vty.verify('show bssgp stats', [''])) self.assertTrue(self.vty.verify('show bssgp nsei 123', [''])) self.assertTrue(self.vty.verify('show bssgp nsei 123 stats', [''])) - self.assertTrue(self.vty.verify('show sgsn', [''])) + self.assertTrue(self.vty.verify('show sgsn', [' GSN: signalling 127.0.0.1, user traffic 127.0.0.1'])) self.assertTrue(self.vty.verify('show mm-context all', [''])) self.assertTrue(self.vty.verify('show mm-context imsi 000001234567', ['No MM context for IMSI 000001234567'])) self.assertTrue(self.vty.verify('show pdp-context all', [''])) -- To view, visit https://gerrit.osmocom.org/4352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:40:39 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 11:40:39 +0000 Subject: [PATCH] osmo-sgsn[master]: SGSN: uncomment BSSGP vty tests In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4353 to look at the new patch set (#2). SGSN: uncomment BSSGP vty tests Change-Id: I9181fc0ecd91e96bf6532aa89b811552009a1b7d --- M tests/vty_test_runner.py 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/53/4353/2 diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 9be8d03..104bba4 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -150,10 +150,8 @@ self.assert_(res.find('Encapsulation NS-UDP-IP') >= 0) self.assertTrue(self.vty.verify('show bssgp', [''])) self.assertTrue(self.vty.verify('show bssgp stats', [''])) - # TODO: uncomment when the command does not segfault anymore - # self.assertTrue(self.vty.verify('show bssgp nsei 123', [''])) - # self.assertTrue(self.vty.verify('show bssgp nsei 123 stats', [''])) - + self.assertTrue(self.vty.verify('show bssgp nsei 123', [''])) + self.assertTrue(self.vty.verify('show bssgp nsei 123 stats', [''])) self.assertTrue(self.vty.verify('show sgsn', [''])) self.assertTrue(self.vty.verify('show mm-context all', [''])) self.assertTrue(self.vty.verify('show mm-context imsi 000001234567', ['No MM context for IMSI 000001234567'])) -- To view, visit https://gerrit.osmocom.org/4353 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9181fc0ecd91e96bf6532aa89b811552009a1b7d Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:42:19 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 11:42:19 +0000 Subject: osmo-sgsn[master]: SGSN: print additional GTP-related info In-Reply-To: References: Message-ID: Patch Set 3: I agree, but putting OSMO_ASSERT() into vty code seems weird. -- To view, visit https://gerrit.osmocom.org/4352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 11:46:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 11:46:32 +0000 Subject: osmo-sgsn[master]: SGSN: print additional GTP-related info In-Reply-To: References: Message-ID: Patch Set 3: > I agree, but putting OSMO_ASSERT() into vty code seems weird. Seriously? You must be kidding. Not in the printing code, but in the code that creates the related GTP/PDP objects of libgtp. -- To view, visit https://gerrit.osmocom.org/4352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 12:00:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 12:00:51 +0000 Subject: libosmocore[master]: Expand osmo_gettimeofday() docs In-Reply-To: References: Message-ID: Patch Set 1: Formatting won't survive but I don't think it should: it looks nicer that way than you look at the comment in .c file. Doxygen will simply ignore extra newlines which will result in added comment being just another paragraph. It looks nice in both cases so ignored formatting is a feature, not a bug in this case. -- To view, visit https://gerrit.osmocom.org/4367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 12:29:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 12:29:27 +0000 Subject: [PATCH] osmo-sgsn[master]: SGSN: check that GSN is created in proper mode Message-ID: Review at https://gerrit.osmocom.org/4368 SGSN: check that GSN is created in proper mode Change-Id: Ie15364fb3c099806ce8a456ef452200305c836f6 --- M src/gprs/sgsn_libgtp.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/68/4368/1 diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 9b8fe16..04735e2 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -838,6 +838,9 @@ } gsn = sgi->gsn; + if (gsn->mode != GTP_MODE_SGSN) + return -EINVAL; + sgi->gtp_fd0.fd = gsn->fd0; sgi->gtp_fd0.priv_nr = 0; sgi->gtp_fd0.data = sgi; -- To view, visit https://gerrit.osmocom.org/4368 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie15364fb3c099806ce8a456ef452200305c836f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 20 12:30:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 12:30:41 +0000 Subject: osmo-sgsn[master]: SGSN: print additional GTP-related info In-Reply-To: References: Message-ID: Patch Set 3: I've added mode check in gerrit 4368 as it has nothing to do with vty patch. -- To view, visit https://gerrit.osmocom.org/4352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 13:05:40 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 20 Oct 2017 13:05:40 +0000 Subject: [PATCH] osmo-sgsn[master]: ifdef: fix conditional compiling Message-ID: Review at https://gerrit.osmocom.org/4369 ifdef: fix conditional compiling 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 cally with a BUILD_IU Change-Id: I1c609ef0c344ce825c313335c7e084bf97159262 --- M src/gprs/gtphub_main.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/69/4369/1 diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index 782afb3..c26a864 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -117,11 +117,9 @@ int gtphub_vty_go_parent(struct vty *vty) { - switch (vty->node) { - default: - osmo_ss7_vty_go_parent(vty); - } - +#if BUILD_IU + osmo_ss7_vty_go_parent(vty); +#endif return vty->node; } @@ -129,8 +127,10 @@ { /* Check if libosmo-sccp declares the node in * question as config node */ +#if BUILD_IU if (osmo_ss7_is_config_node(vty, node)) return 1; +#endif switch (node) { /* add items that are not config */ -- To view, visit https://gerrit.osmocom.org/4369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c609ef0c344ce825c313335c7e084bf97159262 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Oct 20 13:17:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 13:17:23 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 2: > and *only when this got accepted and merged* is it possible to run a 'make release' That's not correct. If smth in the wiki lead you to this conclusion than the wiki should be fixed. Before running "make release" in the library you're expected to update LIBVERSION manually. So release helper already deals with "unclean" repo state. This means that you can do any updates you like - add/remove files, change functions, etc. It all will just become part of signed release commit. -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 13:23:02 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Fri, 20 Oct 2017 13:23:02 +0000 Subject: libosmocore[master]: Expand bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 4: I am applying new bitvec_write_field_ext function for encoding LH bits of IA Rest OCtets of EDGE PKT DL IMM ASS in PCU. The MS has correctly received the expected encoded LH bits at his end, i.e. the MS has sucessfully decoded EGPRS windows size, LQ measurement mode, and BEP_PERIOD2. -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 13:25:36 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 13:25:36 +0000 Subject: libosmocore[master]: Expand bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 4: Nice. Don't hesitate to check '+1' if you think that the code is good-enough to be merged :) -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 13:37:06 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Fri, 20 Oct 2017 13:37:06 +0000 Subject: libosmocore[master]: Expand bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 > Nice. Don't hesitate to check '+1' if you think that the code is > good-enough to be merged :) I have just found out I forgot to select +1 ;). -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 13:41:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 13:41:40 +0000 Subject: [PATCH] libosmocore[master]: GPRS: log NS socket Message-ID: Review at https://gerrit.osmocom.org/4370 GPRS: log NS socket Let's log NS UDP socket creation similar to the way we log it for telnet and ctrl interfaces. Change-Id: Ic9d0f94ab2c1bb33f67cd4f1c9236b64108c0bb6 --- M src/gb/gprs_ns.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/70/4370/1 diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index d20ed23..d9c5f9d 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1580,6 +1580,7 @@ "Failed to set the DSCP to %d with ret(%d) errno(%d)\n", nsi->nsip.dscp, ret, errno); + LOGP(DLGLOBAL, LOGL_NOTICE, "NS UDP socket at %s:%d\n", inet_ntoa(in), nsi->nsip.local_port); return ret; } -- To view, visit https://gerrit.osmocom.org/4370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9d0f94ab2c1bb33f67cd4f1c9236b64108c0bb6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 20 14:10:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 14:10:03 +0000 Subject: [PATCH] libosmocore[master]: Cleanup jenkins build scripts In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3132 to look at the new patch set (#3). Cleanup jenkins build scripts * reorder builds to avoid rm -rf invocation * avoid useless double autoreconf * move common parts into shared helper * move common build steps into separate function Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh A contrib/jenkins_common.sh 3 files changed, 26 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/3132/3 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index ad992af..beb53da 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -1,11 +1,9 @@ #!/bin/sh -set -ex +. $(dirname "$0")/jenkins_common.sh -verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - -autoreconf --install --force -./configure --enable-static \ +build() { + $1 --enable-static \ --prefix=/usr/local/arm-none-eabi \ --host=arm-none-eabi \ --enable-embedded \ @@ -14,20 +12,13 @@ $MAKE $PARALLEL_MAKE \ || cat-testlogs.sh +} # verify build in dir other than source tree -rm -rf * -git checkout . -autoreconf --install --force -mkdir builddir +mkdir -p builddir cd builddir +build ../configure -../configure --enable-static \ - --prefix=/usr/local/arm-none-eabi \ - --host=arm-none-eabi \ - --enable-embedded \ - --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" +cd .. +build ./configure -$MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 4a26776..c397d52 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,31 +1,27 @@ #!/bin/sh # jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org -set -ex +. $(dirname "$0")/jenkins_common.sh -verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +ENABLE_SANITIZE="--enable-sanitize" if [ "x$label" = "xFreeBSD_amd64" ]; then ENABLE_SANITIZE="" -else - ENABLE_SANITIZE="--enable-sanitize" fi -autoreconf --install --force -./configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" +build() { + $1 --enable-static $2 CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ || cat-testlogs.sh +} # verify build in dir other than source tree -rm -rf * -git checkout . -autoreconf --install --force -mkdir builddir +mkdir -p builddir cd builddir -../configure --enable-static CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh +build ../configure $ENABLE_SANITIZE + +cd .. +build ./configure $ENABLE_SANITIZE + diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh new file mode 100644 index 0000000..e52a96a --- /dev/null +++ b/contrib/jenkins_common.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -ex + +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +autoreconf --install --force -- To view, visit https://gerrit.osmocom.org/3132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Oct 20 14:10:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 14:10:04 +0000 Subject: [PATCH] libosmocore[master]: Disable jenkins for embedded tests Message-ID: Review at https://gerrit.osmocom.org/4371 Disable jenkins for embedded tests There's no point in regenerating documentation with Doxygen in embedded environment. Change-Id: I6504db04445f5e9c1117379c8803e10df5634324 --- M contrib/jenkins-arm.sh 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/71/4371/1 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index beb53da..e0c75fa 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -7,6 +7,7 @@ --prefix=/usr/local/arm-none-eabi \ --host=arm-none-eabi \ --enable-embedded \ + --disable-doxygen \ --disable-shared \ CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" -- To view, visit https://gerrit.osmocom.org/4371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6504db04445f5e9c1117379c8803e10df5634324 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 20 14:10:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 14:10:54 +0000 Subject: [PATCH] libosmocore[master]: Disable doxygen in jenkins for embedded tests In-Reply-To: References: Message-ID: Disable doxygen in jenkins for embedded tests There's no point in regenerating documentation with Doxygen in embedded environment. Change-Id: I6504db04445f5e9c1117379c8803e10df5634324 --- M contrib/jenkins-arm.sh 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/71/4371/2 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index beb53da..e0c75fa 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -7,6 +7,7 @@ --prefix=/usr/local/arm-none-eabi \ --host=arm-none-eabi \ --enable-embedded \ + --disable-doxygen \ --disable-shared \ CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" -- To view, visit https://gerrit.osmocom.org/4371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6504db04445f5e9c1117379c8803e10df5634324 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 20 15:42:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 15:42:05 +0000 Subject: osmo-sgsn[master]: ifdef: fix conditional compiling In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c609ef0c344ce825c313335c7e084bf97159262 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 17:45:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 20 Oct 2017 17:45:21 +0000 Subject: [PATCH] libosmocore[master]: socket: add function osmo_sock_local_ip() to query local ip Message-ID: Review at https://gerrit.osmocom.org/4372 socket: add function osmo_sock_local_ip() to query local ip In some cases it is required to know the ip-address of the interface through that a given remote IP-Address can be reached. Add function osmo_sock_local_ip() to determine the local ip-address for a given remote ip-address Change-Id: I2988cc52b196fc8476703d1287e24cb4a48491c2 --- M include/osmocom/core/socket.h M src/socket.c 2 files changed, 50 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/4372/1 diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index ebfcab3..47d9f30 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -57,4 +57,6 @@ int osmo_sock_mcast_all_set(int fd, bool enable); int osmo_sock_mcast_subscribe(int fd, const char *grp_addr); +int osmo_sock_local_ip(char *local_ip, const char *remote_ip); + /*! @} */ diff --git a/src/socket.c b/src/socket.c index 457c991..9e3d842 100644 --- a/src/socket.c +++ b/src/socket.c @@ -786,4 +786,52 @@ #endif /* HAVE_SYS_SOCKET_H */ +/*! Determine the matching local IP-address for a given remote IP-Address. + * \param[out] local_ip caller provided memory for resulting local IP-address + * \param[in] remote_ip remote IP-address + * \param[in] fd file descriptor of related scoket */ +int osmo_sock_local_ip(char *local_ip, const char *remote_ip) +{ + int sfd; + int rc; + struct addrinfo addrinfo_hint; + struct addrinfo *addrinfo = NULL; + struct sockaddr_in local_addr; + socklen_t local_addr_len; + uint16_t family; + + /* Find out the address family (AF_INET or AF_INET6?) */ + memset(&addrinfo_hint, '\0', sizeof(addrinfo_hint)); + addrinfo_hint.ai_family = PF_UNSPEC; + addrinfo_hint.ai_flags = AI_NUMERICHOST; + rc = getaddrinfo(remote_ip, NULL, &addrinfo_hint, &addrinfo); + if (rc) + return -EINVAL; + family = addrinfo->ai_family; + freeaddrinfo(addrinfo); + + /* Connect a dummy socket to trick the kernel into determining the + * ip-address of the interface that would be used if we would send + * out an actual packet */ + sfd = osmo_sock_init2(family, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, remote_ip, 0, OSMO_SOCK_F_CONNECT); + if (sfd < 0) + return -EINVAL; + + /* Request the IP address of the interface that the kernel has + * actually choosen. */ + memset(&local_addr, 0, sizeof(local_addr)); + local_addr_len = sizeof(local_addr); + rc = getsockname(sfd, (struct sockaddr *)&local_addr, &local_addr_len); + if (rc < 0) + return -EINVAL; + if (local_addr.sin_family == AF_INET) + strncpy(local_ip, inet_ntoa(local_addr.sin_addr), INET_ADDRSTRLEN); + else if (local_addr.sin_family == AF_INET6) + strncpy(local_ip, inet_ntoa(local_addr.sin_addr), INET6_ADDRSTRLEN); + else + return -EINVAL; + + return 0; +} + /*! @} */ -- To view, visit https://gerrit.osmocom.org/4372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2988cc52b196fc8476703d1287e24cb4a48491c2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:10:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:10:41 +0000 Subject: osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 (21 comments) https://gerrit.osmocom.org/#/c/4334/4/include/osmocom/bsc/osmo_bsc_mgcp.h File include/osmocom/bsc/osmo_bsc_mgcp.h: PS4, Line 1: Sysmocom s.f.m.c. sysmocom awalys lower-case and "-" before s.f.m.c. Line 28: /* A human readable name to display in the logs */ does it make sense to have a name inside the fms, and a name here? I would think it only makes sense in cases where fsm==NULL, but is that a valid use case? Line 36: struct gsm_network *network; I don't think we want to keep an extra pointer to the network around in every mgcp_ctx? Line 38: int chan_mode; is this really an integer type, don't we have some enum for this? PS4, Line 39: f could be a bool? https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 582: new whitspace error? Line 767: new whitspace error? Line 772: LOGP(DMSC, LOGL_NOTICE, "Sending assignment complete message...\n"); sending the assignment complete is an normal event, i.e. LOGL_DEBUG seems applicable, not notice. Line 787: LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ there is no context in this message at all. In a loaded network, we may be processing dozens to hundreds of assignment complete in a second. How does the operator make sense of this log message, without any context on which call it relates to? Same applies to other log messages like the one above. https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_main.c File src/osmo-bsc/osmo_bsc_main.c: Line 284: printf("MGCPGW connect failed\n"); useful to print the connect to *where* has failed (IP/port) Line 287: new whitespace bug https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_mgcp.c File src/osmo-bsc/osmo_bsc_mgcp.c: Line 137: LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s\n", * logging inside fsm's should use LOGPFSM in order to automatically print the prefix with the fsm identity * the state of a fsm is logged at every incoming event and every state transmission by the fsm core. what does your message add to that? * LOGL_NOTICE why? because it's an error? but then, the error is logged below. Line 173: LOGP(DMSC, LOGL_NOTICE, * all this logging is implemented by the FSM core *and* it is not a NOTICE event, is it? Line 257: LOGP(DMSC, LOGL_NOTICE, LOGPFSM whenever you have a fsm_inst as context, all over this file. Line 271: LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MGCPGW proceeding assignment request...\n", mgcp_ctx->name); another NOTICE. Please be more careful when deciding on the log level. This is clearly not something that should be brought to the attention of the operator/sysadmin during normal operation. Line 499: LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) Cannot parse CRCX response\n", mgcp_ctx->name); when we encounter errors in parsing MGCP, shouldn't we always return some kind of information to the originator of the message? I don't know RFC3435 by heart, but normally most protocols require error messages on parsing erros? Maybe not because this is already a response? Line 780: .name = "FSM MGCP", I'm not sure if spaces are permitted here in the name. This will again cause problems with exporting its properties over the ctrl interface. Please follow naming of other FSMs. Also, might be good to indicate it's a FSM for the call agent side, not to be confused with the gateway side. Line 806: if (osmo_fsm_find_by_name(fsm.name) != &fsm) this is a linear list traversal over all FSMs in the program at each processing of an assignment request. I would much rather prefer the code to explicitly call osmo_fsm_register() once. Or you keep a global static variable here, which you can check if you registered the fsm before. thanks. Line 813: snprintf(mgcp_ctx->name, sizeof(mgcp_ctx->name), "MGCP FSM, id=%i", conn->conn_id); see my other comment, if we really need the FSM name and another name in the wrapper around the fsm. https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_vty.c File src/osmo-bsc/osmo_bsc_vty.c: Line 977: new whitespace bug Line 1043: new whitespace bug -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:13:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:13:57 +0000 Subject: libosmocore[master]: Cleanup jenkins build scripts In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:15:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:15:34 +0000 Subject: libosmocore[master]: socket: add function osmo_sock_local_ip() to query local ip In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (2 comments) https://gerrit.osmocom.org/#/c/4372/1/src/socket.c File src/socket.c: Line 787: #endif /* HAVE_SYS_SOCKET_H */ you're adding socket related code outside of the ifdef, which breaks the eembedded build for OsmocomBB. Line 790: * \param[out] local_ip caller provided memory for resulting local IP-address might be good to explain what the size requirements of this is. -- To view, visit https://gerrit.osmocom.org/4372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2988cc52b196fc8476703d1287e24cb4a48491c2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:17:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:17:19 +0000 Subject: libosmocore[master]: GPRS: log NS socket In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4370/1/src/gb/gprs_ns.c File src/gb/gprs_ns.c: Line 1583: LOGP(DLGLOBAL, LOGL_NOTICE, "NS UDP socket at %s:%d\n", inet_ntoa(in), nsi->nsip.local_port); The log subsystem is somewhat questionable here. It still is a NS related message. We currently only use that whenever we do not have a specific logging sub-system for the code, like e.g. in the generic socket helper, or in the logging code. I would hence make this "DNS" instead of DLGLOBAL" -- To view, visit https://gerrit.osmocom.org/4370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9d0f94ab2c1bb33f67cd4f1c9236b64108c0bb6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:17:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:17:38 +0000 Subject: libosmocore[master]: Disable doxygen in jenkins for embedded tests In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6504db04445f5e9c1117379c8803e10df5634324 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:17:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:17:42 +0000 Subject: [MERGED] libosmocore[master]: Disable doxygen in jenkins for embedded tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Disable doxygen in jenkins for embedded tests ...................................................................... Disable doxygen in jenkins for embedded tests There's no point in regenerating documentation with Doxygen in embedded environment. Change-Id: I6504db04445f5e9c1117379c8803e10df5634324 --- M contrib/jenkins-arm.sh 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index beb53da..e0c75fa 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -7,6 +7,7 @@ --prefix=/usr/local/arm-none-eabi \ --host=arm-none-eabi \ --enable-embedded \ + --disable-doxygen \ --disable-shared \ CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" -- To view, visit https://gerrit.osmocom.org/4371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6504db04445f5e9c1117379c8803e10df5634324 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:17:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:17:43 +0000 Subject: [MERGED] libosmocore[master]: Cleanup jenkins build scripts In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Cleanup jenkins build scripts ...................................................................... Cleanup jenkins build scripts * reorder builds to avoid rm -rf invocation * avoid useless double autoreconf * move common parts into shared helper * move common build steps into separate function Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh A contrib/jenkins_common.sh 3 files changed, 26 insertions(+), 32 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index ad992af..beb53da 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -1,11 +1,9 @@ #!/bin/sh -set -ex +. $(dirname "$0")/jenkins_common.sh -verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - -autoreconf --install --force -./configure --enable-static \ +build() { + $1 --enable-static \ --prefix=/usr/local/arm-none-eabi \ --host=arm-none-eabi \ --enable-embedded \ @@ -14,20 +12,13 @@ $MAKE $PARALLEL_MAKE \ || cat-testlogs.sh +} # verify build in dir other than source tree -rm -rf * -git checkout . -autoreconf --install --force -mkdir builddir +mkdir -p builddir cd builddir +build ../configure -../configure --enable-static \ - --prefix=/usr/local/arm-none-eabi \ - --host=arm-none-eabi \ - --enable-embedded \ - --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" +cd .. +build ./configure -$MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 4a26776..c397d52 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,31 +1,27 @@ #!/bin/sh # jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org -set -ex +. $(dirname "$0")/jenkins_common.sh -verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +ENABLE_SANITIZE="--enable-sanitize" if [ "x$label" = "xFreeBSD_amd64" ]; then ENABLE_SANITIZE="" -else - ENABLE_SANITIZE="--enable-sanitize" fi -autoreconf --install --force -./configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" +build() { + $1 --enable-static $2 CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ || cat-testlogs.sh +} # verify build in dir other than source tree -rm -rf * -git checkout . -autoreconf --install --force -mkdir builddir +mkdir -p builddir cd builddir -../configure --enable-static CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh +build ../configure $ENABLE_SANITIZE + +cd .. +build ./configure $ENABLE_SANITIZE + diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh new file mode 100644 index 0000000..e52a96a --- /dev/null +++ b/contrib/jenkins_common.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -ex + +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +autoreconf --install --force -- To view, visit https://gerrit.osmocom.org/3132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:18:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:18:32 +0000 Subject: osmo-sgsn[master]: SGSN: check that GSN is created in proper mode In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4368 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie15364fb3c099806ce8a456ef452200305c836f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:18:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:18:50 +0000 Subject: osmo-sgsn[master]: SGSN: print additional GTP-related info In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:19:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:19:03 +0000 Subject: osmo-sgsn[master]: SGSN: uncomment BSSGP vty tests In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4353 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9181fc0ecd91e96bf6532aa89b811552009a1b7d Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:19:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:19:05 +0000 Subject: [MERGED] osmo-sgsn[master]: SGSN: uncomment BSSGP vty tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SGSN: uncomment BSSGP vty tests ...................................................................... SGSN: uncomment BSSGP vty tests Change-Id: I9181fc0ecd91e96bf6532aa89b811552009a1b7d --- M tests/vty_test_runner.py 1 file changed, 2 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 9be8d03..104bba4 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -150,10 +150,8 @@ self.assert_(res.find('Encapsulation NS-UDP-IP') >= 0) self.assertTrue(self.vty.verify('show bssgp', [''])) self.assertTrue(self.vty.verify('show bssgp stats', [''])) - # TODO: uncomment when the command does not segfault anymore - # self.assertTrue(self.vty.verify('show bssgp nsei 123', [''])) - # self.assertTrue(self.vty.verify('show bssgp nsei 123 stats', [''])) - + self.assertTrue(self.vty.verify('show bssgp nsei 123', [''])) + self.assertTrue(self.vty.verify('show bssgp nsei 123 stats', [''])) self.assertTrue(self.vty.verify('show sgsn', [''])) self.assertTrue(self.vty.verify('show mm-context all', [''])) self.assertTrue(self.vty.verify('show mm-context imsi 000001234567', ['No MM context for IMSI 000001234567'])) -- To view, visit https://gerrit.osmocom.org/4353 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9181fc0ecd91e96bf6532aa89b811552009a1b7d Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:19:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:19:05 +0000 Subject: [MERGED] osmo-sgsn[master]: SGSN: print additional GTP-related info In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SGSN: print additional GTP-related info ...................................................................... SGSN: print additional GTP-related info * print libgtp version on startup * print GSN addresses in 'sh sgsn' Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Related: SYS#3610 --- M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M tests/vty_test_runner.py 3 files changed, 8 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index d79beb3..7036bf6 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -447,7 +447,8 @@ if (rc) { LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen on GTP socket\n"); exit(2); - } + } else + LOGP(DGPRS, LOGL_NOTICE, "libGTP v%s initialized\n", gtp_version()); rc = gprs_subscr_init(&sgsn_inst); if (rc < 0) { diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 1882852..ab02d81 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -44,6 +44,7 @@ #include #include +#include #include "../../bscconfig.h" @@ -511,6 +512,10 @@ link->addr, link->port, VTY_NEWLINE); } + if (sgsn->gsn) + vty_out(vty, " GSN: signalling %s, user traffic %s%s", + inet_ntoa(sgsn->gsn->gsnc), inet_ntoa(sgsn->gsn->gsnu), VTY_NEWLINE); + /* FIXME: statistics */ return CMD_SUCCESS; } diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 104bba4..9b8c560 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -152,7 +152,7 @@ self.assertTrue(self.vty.verify('show bssgp stats', [''])) self.assertTrue(self.vty.verify('show bssgp nsei 123', [''])) self.assertTrue(self.vty.verify('show bssgp nsei 123 stats', [''])) - self.assertTrue(self.vty.verify('show sgsn', [''])) + self.assertTrue(self.vty.verify('show sgsn', [' GSN: signalling 127.0.0.1, user traffic 127.0.0.1'])) self.assertTrue(self.vty.verify('show mm-context all', [''])) self.assertTrue(self.vty.verify('show mm-context imsi 000001234567', ['No MM context for IMSI 000001234567'])) self.assertTrue(self.vty.verify('show pdp-context all', [''])) -- To view, visit https://gerrit.osmocom.org/4352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:19:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:19:06 +0000 Subject: [MERGED] osmo-sgsn[master]: SGSN: check that GSN is created in proper mode In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SGSN: check that GSN is created in proper mode ...................................................................... SGSN: check that GSN is created in proper mode Change-Id: Ie15364fb3c099806ce8a456ef452200305c836f6 --- M src/gprs/sgsn_libgtp.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 9b8fe16..04735e2 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -838,6 +838,9 @@ } gsn = sgi->gsn; + if (gsn->mode != GTP_MODE_SGSN) + return -EINVAL; + sgi->gtp_fd0.fd = gsn->fd0; sgi->gtp_fd0.priv_nr = 0; sgi->gtp_fd0.data = sgi; -- To view, visit https://gerrit.osmocom.org/4368 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie15364fb3c099806ce8a456ef452200305c836f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:19:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:19:23 +0000 Subject: osmo-sgsn[master]: Fix APN printing In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4356 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie13b6cd0066e0370e2adf48d12a363c2e405eaf2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:19:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:19:24 +0000 Subject: [MERGED] osmo-sgsn[master]: Fix APN printing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix APN printing ...................................................................... Fix APN printing 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 --- M src/gprs/sgsn_vty.c 1 file changed, 2 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index ab02d81..faac69b 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -118,23 +118,6 @@ DECLARE_TIMER(3395, "Wait for DEACT PDP CTX ACK timer (s)") DECLARE_TIMER(3397, "Wait for DEACT AA PDP CTX ACK timer (s)") - -#define GSM48_MAX_APN_LEN 102 /* 10.5.6.1 */ -/** Copy apn to a static buffer, replacing the length octets in apn_enc with '.' - * and terminating with a '\0'. Return the static buffer. - * len: the length of the encoded APN (which has no terminating zero). - */ -static char *gprs_apn2str(uint8_t *apn, unsigned int len) -{ - static char apnbuf[GSM48_MAX_APN_LEN+1]; - - if (!apn) - return ""; - osmo_apn_to_str(apnbuf, apn, len); - - return apnbuf+1; -} - char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len) { static char str[INET6_ADDRSTRLEN + 10]; @@ -459,8 +442,9 @@ vty_out(vty, "%sPDP Context IMSI: %s, SAPI: %u, NSAPI: %u, TI: %u%s", pfx, imsi, pdp->sapi, pdp->nsapi, pdp->ti, VTY_NEWLINE); if (pdp->lib) { + char apnbuf[APN_MAXLEN + 1]; vty_out(vty, "%s APN: %s%s", pfx, - gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), + osmo_apn_to_str(apnbuf, pdp->lib->apn_use.v, pdp->lib->apn_use.l), VTY_NEWLINE); vty_out(vty, "%s PDP Address: %s%s", pfx, gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), -- To view, visit https://gerrit.osmocom.org/4356 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie13b6cd0066e0370e2adf48d12a363c2e405eaf2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:19:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:19:57 +0000 Subject: libosmocore[master]: Make osmo_apn_to_str() more robust In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I587153e49d1c92128fac3ae5c124adba9592378e Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:19:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Oct 2017 18:19:59 +0000 Subject: [MERGED] libosmocore[master]: Make osmo_apn_to_str() more robust In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Make osmo_apn_to_str() more robust ...................................................................... Make osmo_apn_to_str() more robust Previously it would crash on NULL input. Let's handle it gracefully instead. Corresponding test case is also added. Change-Id: I587153e49d1c92128fac3ae5c124adba9592378e --- M src/gsm/apn.c M tests/gprs/gprs_test.c 2 files changed, 10 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/apn.c b/src/gsm/apn.c index 8d4b2bf..f8303db 100644 --- a/src/gsm/apn.c +++ b/src/gsm/apn.c @@ -53,6 +53,9 @@ char *str = out_str; size_t rest_chars = apn_enc_len; + if (!apn_enc) + return NULL; + while (rest_chars > 0 && apn_enc[0]) { size_t label_size = apn_enc[0]; if (label_size + 1 > rest_chars) diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c index be80e5c..6f16fb2 100644 --- a/tests/gprs/gprs_test.c +++ b/tests/gprs/gprs_test.c @@ -91,6 +91,13 @@ } { + /* NULL input */ + uint8_t input[] = { 0x1, 65 }; + char *output = "LOL"; + OSMO_ASSERT(osmo_apn_to_str(output, NULL, ARRAY_SIZE(input) - 1) == NULL); + } + + { uint8_t input[] = { 0x3, 65, 66, 67, 0x2, 90, 122 }; const char *output = "ABC.Zz"; char tmp[strlen(output) + 1]; -- To view, visit https://gerrit.osmocom.org/4354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I587153e49d1c92128fac3ae5c124adba9592378e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 20 18:20:08 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 20 Oct 2017 18:20:08 +0000 Subject: [PATCH] libosmocore[master]: GPRS: log NS socket In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4370 to look at the new patch set (#2). GPRS: log NS socket Let's log NS UDP socket creation similar to the way we log it for telnet and ctrl interfaces. Change-Id: Ic9d0f94ab2c1bb33f67cd4f1c9236b64108c0bb6 --- M src/gb/gprs_ns.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/70/4370/2 diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index d20ed23..7443a8b 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1580,6 +1580,7 @@ "Failed to set the DSCP to %d with ret(%d) errno(%d)\n", nsi->nsip.dscp, ret, errno); + LOGP(DNS, LOGL_NOTICE, "NS UDP socket at %s:%d\n", inet_ntoa(in), nsi->nsip.local_port); return ret; } -- To view, visit https://gerrit.osmocom.org/4370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic9d0f94ab2c1bb33f67cd4f1c9236b64108c0bb6 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 21 14:47:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Oct 2017 14:47:00 +0000 Subject: libosmocore[master]: GPRS: log NS socket In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9d0f94ab2c1bb33f67cd4f1c9236b64108c0bb6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From admin at opensuse.org Sat Oct 21 19:55:00 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 21 Oct 2017 19:55:00 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59eba623b9c96_40867bef80789698@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.04/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 236s] | [ 236s] | This file was extended by libosmocore config.status 0.9.6.20171021, which was [ 236s] | generated by GNU Autoconf 2.69. Invocation command line was [ 236s] | [ 236s] | CONFIG_FILES = [ 236s] | CONFIG_HEADERS = [ 236s] | CONFIG_LINKS = [ 236s] | CONFIG_COMMANDS = [ 236s] | $ ./config.status Doxyfile.core [ 236s] | [ 236s] | on build34 [ 236s] | [ 236s] | config.status:1174: creating Doxyfile.core [ 236s] [ 236s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 236s] make[1]: *** [override_dh_auto_test] Error 1 [ 236s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 236s] debian/rules:15: recipe for target 'build' failed [ 236s] make: *** [build] Error 2 [ 236s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 236s] [ 236s] build34 failed "build libosmocore_0.9.6.20171021.dsc" at Sat Oct 21 19:54:37 UTC 2017. [ 236s] [ 236s] ### VM INTERACTION START ### [ 239s] [ 227.764715] reboot: Power down [ 240s] ### VM INTERACTION END ### [ 240s] [ 240s] build34 failed "build libosmocore_0.9.6.20171021.dsc" at Sat Oct 21 19:54:43 UTC 2017. [ 240s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Oct 21 23:16:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 21 Oct 2017 23:16:01 +0000 Subject: libosmocore[master]: Expand osmo_gettimeofday() docs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 > Formatting won't survive but I don't think it should: it looks > nicer that way than you look at the comment in .c file. If you don't want the indent, why add it in the .c file in the first place. My bikeshed would be N.B.: yada yada yada -- To view, visit https://gerrit.osmocom.org/4367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 21 23:30:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 21 Oct 2017 23:30:30 +0000 Subject: libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/4200/5/tests/msgb/msgb_test.c File tests/msgb/msgb_test.c: Line 380: msgb_free(msg); msgb_free(msg_ref); ... I'll just add it in a gerrit edit so we can merge the patch. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Oct 21 23:32:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 21 Oct 2017 23:32:54 +0000 Subject: [PATCH] libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Hello Max, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4200 to look at the new patch set (#6). add function msgb_printf() to print formatted text into msg buf In ASCII string based protocols it a printf() version that prints directly to the message buffer may be useful. Add function msgb_printf(), make sure that msg buffer bounderies are not exceeded. If the end of the tail buffer is hit, return with an error code. Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 --- M include/osmocom/core/msgb.h M src/msgb.c M tests/msgb/msgb_test.c M tests/msgb/msgb_test.ok 4 files changed, 162 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/4200/6 diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 91b7ec7..9c3ccf0 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -498,5 +498,6 @@ void *msgb_talloc_ctx_init(void *root_ctx, unsigned int pool_size); void msgb_set_talloc_ctx(void *ctx) OSMO_DEPRECATED("Use msgb_talloc_ctx_init() instead"); +int msgb_printf(struct msgb *msgb, const char *format, ...); /*! @} */ diff --git a/src/msgb.c b/src/msgb.c index 2e9f4a2..6fcbe53 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -55,6 +55,9 @@ #include #include #include +#include +#include + #include //#include @@ -376,4 +379,49 @@ return buf; } + +/*! Print a string to the end of message buffer. + * \param[in] msg message buffer + * \returns 0 on success, -EINVAL on error + * + * The resulting string is printed to the msgb without a trailing nul + * character. A nul following the data tail may be written as an implementation + * detail, but a trailing nul is never part of the msgb data in terms of + * msgb_length(). + * + * Note: the tailroom must always be one byte longer than the string to be + * written. The msgb is filled only up to tailroom=1. This is an implementation + * detail that allows leaving a nul character behind the valid data. + * + * In case of error, the msgb remains unchanged, though data may have been + * written to the (unused) memory after the tail pointer. + */ +int msgb_printf(struct msgb *msgb, const char *format, ...) +{ + va_list args; + int str_len; + int rc = 0; + + OSMO_ASSERT(msgb); + OSMO_ASSERT(format); + + /* Regardless of what we plan to add to the buffer, we must at least + * be able to store a string terminator (nullstring) */ + if (msgb_tailroom(msgb) < 1) + return -EINVAL; + + va_start(args, format); + + str_len = + vsnprintf((char *)msgb->tail, msgb_tailroom(msgb), format, args); + + if (str_len >= msgb_tailroom(msgb) || str_len < 0) { + rc = -EINVAL; + } else + msgb_put(msgb, str_len); + + va_end(args); + return rc; +} + /*! @} */ diff --git a/tests/msgb/msgb_test.c b/tests/msgb/msgb_test.c index ac10382..0533546 100644 --- a/tests/msgb/msgb_test.c +++ b/tests/msgb/msgb_test.c @@ -277,6 +277,110 @@ osmo_set_panic_handler(NULL); } +static void test_msgb_printf() +{ + struct msgb *msg; + struct msgb *msg_ref; + int rc; + int total_len; + + msg = msgb_alloc(80, "data"); + + /* Add normal text: */ + printf("Add normal text:\n"); + rc = msgb_printf(msg, "|this is a test %i, %s, %16x|", 4711, "testme", + 0x4711); + total_len = msgb_length(msg); + printf("#1: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(msgb_tailroom(msg) == 33); + + /* Add normal text: */ + rc = msgb_printf(msg, "|some more text|"); + total_len = msgb_length(msg); + printf("#2: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(msgb_tailroom(msg) == 17); + + /* Add normal text which will not fit: */ + rc = msgb_printf(msg, "|more %i %x %s|", 23, 0xfee, + "text will not fit"); + total_len = msgb_length(msg); + printf("#3: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == -EINVAL); + + /* Check if we got the right amount of characters in the message buffer + * until here, so that we can be sure that the following cornercase + * tests yield plausible results */ + OSMO_ASSERT(msgb_tailroom(msg) == 17); + + /* Add normal text which just does not fit by one character, this should not + * alter the message buffers tail pointer */ + rc = msgb_printf(msg, "|more 123456 ABC|"); + total_len = msgb_length(msg); + printf("#4: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == -EINVAL); + + /* Make sure the tailroom, nor the contained string length did change */ + OSMO_ASSERT(msgb_tailroom(msg) == 17); + OSMO_ASSERT(msgb_length(msg) == 63); + + /* Add normal text which just fits */ + rc = msgb_printf(msg, "|more 123456 AB|"); + total_len = msgb_length(msg); + printf("#5: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + + /* Make sure that the string in the bufer takes up all available Space. + * Also make sure that the available tailroom has space for one byte, + * which actually holds the string terminator */ + OSMO_ASSERT(msgb_tailroom(msg) == 1); + OSMO_ASSERT(msgb_length(msg) == 79); + + /* Try to add a nullstring to the already full buffer, this should + * be ok, since we still have one byte tailroom */ + rc = msgb_printf(msg, ""); + total_len = msgb_length(msg); + printf("#6: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + + /* Make sure that we still have the same conditions as before */ + OSMO_ASSERT(msgb_tailroom(msg) == 1); + OSMO_ASSERT(msgb_length(msg) == 79); + + msgb_free(msg); + + /* Test behaviour when a completely full buffer is passed to + * msgb_printf(). We should get rc == -EINVAL and the message + * buffer must not be changed at all */ + msg = msgb_alloc(15, "data"); + msg_ref = msgb_alloc(msgb_tailroom(msg), "data"); + memset(msg->data, 0x41, msgb_tailroom(msg)); + memset(msg_ref->data, 0x41, msgb_tailroom(msg_ref)); + msgb_put(msg, msgb_tailroom(msg)); + msgb_put(msg_ref, msgb_tailroom(msg_ref)); + + printf("#7: before: %s", msgb_hexdump(msg)); + rc = msgb_printf(msg, "ABCDEF"); + printf(" after: rc=%i, %s", rc, msgb_hexdump(msg)); + if (memcmp(msg->data, msg_ref->data, msgb_length(msg)) == 0) + printf(" ==> ok, no change\n"); + else + printf(" ==> error, change detected\n"); + OSMO_ASSERT(rc == -EINVAL); + OSMO_ASSERT(msgb_tailroom(msg) == 0); + OSMO_ASSERT(msgb_length(msg) == msgb_length(msg_ref)); + + msgb_free(msg); + msgb_free(msg_ref); +} + static struct log_info info = {}; int main(int argc, char **argv) @@ -287,6 +391,7 @@ test_msgb_api_errors(); test_msgb_copy(); test_msgb_resize_area(); + test_msgb_printf(); printf("Success.\n"); diff --git a/tests/msgb/msgb_test.ok b/tests/msgb/msgb_test.ok index 6603fe7..826c809 100644 --- a/tests/msgb/msgb_test.ok +++ b/tests/msgb/msgb_test.ok @@ -32,4 +32,12 @@ Original: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Extended: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Shrinked: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f +Add normal text: +#1: rc=0, total_len=47, msg->data=|this is a test 4711, testme, 4711| +#2: rc=0, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text| +#3: rc=-22, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text||more 23 fee tex +#4: rc=-22, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 ABC +#5: rc=0, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 AB| +#6: rc=0, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 AB| +#7: before: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 after: rc=-22, 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 ==> ok, no change Success. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 21 23:33:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 21 Oct 2017 23:33:39 +0000 Subject: libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/4200/6/tests/msgb/msgb_test.c File tests/msgb/msgb_test.c: Line 293: total_len = msgb_length(msg); no real need to assign to a variable first, but whatever. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Oct 21 23:36:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 21 Oct 2017 23:36:29 +0000 Subject: osmo-mgw[master]: mgcp: move port/timeslot calculator to mgcp_common.h In-Reply-To: References: Message-ID: Patch Set 6: > (1 comment) > > > (1 comment) > > > > Please clarify, does the new MGW need this at all? Is this only > for > > bsc-nat? So far I thought the new MGW allocates ports as it sees > > fit and communicates the right port numbers back to the > client(s), > > hence these functions would not be needed. > > > > Please clarify, why is it not possible to include mgcp.h when > > mgcp_client.h is already included? They should both be completely > > separate now, besides mgcp_common.h. > > I see: I have tried: > > #include > #include > > this worked so far. ok, but again, Please clarify, does the new MGW need this at all? Is this only for bsc-nat? So far I thought the new MGW allocates ports as it sees fit and communicates the right port numbers back to the client(s), hence these functions would not be needed. -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 22 19:29:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 19:29:54 +0000 Subject: libosmocore[master]: Cleanup jenkins build scripts In-Reply-To: References: Message-ID: Patch Set 4: (9 comments) https://gerrit.osmocom.org/#/c/3132/4//COMMIT_MSG Commit Message: Line 9: * reorder builds to avoid rm -rf invocation why? Line 10: * avoid useless double autoreconf the autoreconf is not useless, it only becomes so from your dropping 'rm -rf', a change with which I actually disagree. I would prefer ensuring a clean slate every time. https://gerrit.osmocom.org/#/c/3132/4/contrib/jenkins-arm.sh File contrib/jenkins-arm.sh: Line 6: $1 --enable-static \ (cosmetic: personally, I'd prefer passing ".." or "." as $1 instead of '../configure' and run "$1"/configure) Line 13: $MAKE $PARALLEL_MAKE \ indenting Line 18: mkdir -p builddir removing the rm -rf: have you checked that the jenkins build job running this cleans up the workspace? Otherwise there would be built files lying around in the workspace and we'd also rebuild over and over in the same build dirs. We should make sure it's done from scratch every time, one way or the other. An alternative if you really dislike 'rm -rf' would be 'git clean -dxf'? https://gerrit.osmocom.org/#/c/3132/4/contrib/jenkins.sh File contrib/jenkins.sh: Line 13: $1 --enable-static $2 CFLAGS="-Werror" CPPFLAGS="-Werror" (could just write $ENABLE_SANITIZE instead of passing $2. As before: preference of ".." for $1) Line 14: $MAKE $PARALLEL_MAKE check \ indenting Line 21: mkdir -p builddir again make sure we build cleanly every time. https://gerrit.osmocom.org/#/c/3132/4/contrib/jenkins_common.sh File contrib/jenkins_common.sh: Line 8 (seems a lot of trouble to add a _common script for just three lines, but ok) -- To view, visit https://gerrit.osmocom.org/3132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 22 19:38:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 19:38:32 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: > > > I wrote a small test program to encode IA octets in DL IMM ASS > > > > Sounds like a good candidate for bitvec_write_field() test which > we > > don't have yet. Could you please share it? > > Here it is. > Please don't post code in a gerrit comment. Instead share code by obviously submitting a patch that adds the file with the test code. We will not paste code from a website comment in HTML back to a C file, that is asking for encoding and indenting errors, besides being too much trouble to begin with. -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 22 19:58:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 19:58:20 +0000 Subject: osmo-mgw[master]: sdp: refactoring sdp parser/generator In-Reply-To: References: Message-ID: Patch Set 13: Code-Review-1 (10 comments) https://gerrit.osmocom.org/#/c/4006/13/src/libosmo-mgcp/mgcp_sdp.c File src/libosmo-mgcp/mgcp_sdp.c: Line 41: /*! set codec configuration depending on payload type and codec name. Nice, ends in a full stop, now all you need is to start with a capital letter :) Line 42: * \endp[in] ctx talloc context \param Line 147: int payload, char *audio_name) Let's constify all pointer args that aren't modified. Line 195: * \endp[in] endp trunk endpoint that should be '\param', not '\endp' Line 197: * \endp[in] caller provided memory to store the parsing results technically, that's an [out], then. Plus, there is no 'caller' arg in the function signature. Line 198: * \returns 0 on success, -1 on failure */ it would be good to always include a '.' at the end of each \param, each \returns and each sentence in general. In doxygen, line breaks will not be visible, adding '.' clarifies things. Line 200: struct mgcp_parse_data *p) Let's constify all pointer args that aren't modified. Line 328: /*! generate SDP response string. I wonder if this should use msgb_printf() that we added recently instead of returning to a fixed string buffer. Line 329: * \endp[in] endp trunk endpoint \param Line 335: int mgcp_write_response_sdp(struct mgcp_endpoint *endp, > not sure if endp and/or conn could be 'const' (read-only), but this is not since it's public API the good move would be to const the args now. -- To view, visit https://gerrit.osmocom.org/4006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324 Gerrit-PatchSet: 13 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 22 20:00:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 20:00:10 +0000 Subject: osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Patch Set 11: Code-Review-1 please reply to earlier comments -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 11 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 22 20:08:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 20:08:19 +0000 Subject: osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Patch Set 12: Code-Review-1 the indent comment from earlier has been ignored. Also, even though I wrote "left for you to reflect on", I'd still appreciate a reply here and there... -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 12 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 22 20:09:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 20:09:29 +0000 Subject: [MERGED] libosmocore[master]: add function msgb_printf() to print formatted text into msg buf In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add function msgb_printf() to print formatted text into msg buf ...................................................................... add function msgb_printf() to print formatted text into msg buf In ASCII string based protocols it a printf() version that prints directly to the message buffer may be useful. Add function msgb_printf(), make sure that msg buffer bounderies are not exceeded. If the end of the tail buffer is hit, return with an error code. Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 --- M include/osmocom/core/msgb.h M src/msgb.c M tests/msgb/msgb_test.c M tests/msgb/msgb_test.ok 4 files changed, 162 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 91b7ec7..9c3ccf0 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -498,5 +498,6 @@ void *msgb_talloc_ctx_init(void *root_ctx, unsigned int pool_size); void msgb_set_talloc_ctx(void *ctx) OSMO_DEPRECATED("Use msgb_talloc_ctx_init() instead"); +int msgb_printf(struct msgb *msgb, const char *format, ...); /*! @} */ diff --git a/src/msgb.c b/src/msgb.c index 2e9f4a2..6fcbe53 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -55,6 +55,9 @@ #include #include #include +#include +#include + #include //#include @@ -376,4 +379,49 @@ return buf; } + +/*! Print a string to the end of message buffer. + * \param[in] msg message buffer + * \returns 0 on success, -EINVAL on error + * + * The resulting string is printed to the msgb without a trailing nul + * character. A nul following the data tail may be written as an implementation + * detail, but a trailing nul is never part of the msgb data in terms of + * msgb_length(). + * + * Note: the tailroom must always be one byte longer than the string to be + * written. The msgb is filled only up to tailroom=1. This is an implementation + * detail that allows leaving a nul character behind the valid data. + * + * In case of error, the msgb remains unchanged, though data may have been + * written to the (unused) memory after the tail pointer. + */ +int msgb_printf(struct msgb *msgb, const char *format, ...) +{ + va_list args; + int str_len; + int rc = 0; + + OSMO_ASSERT(msgb); + OSMO_ASSERT(format); + + /* Regardless of what we plan to add to the buffer, we must at least + * be able to store a string terminator (nullstring) */ + if (msgb_tailroom(msgb) < 1) + return -EINVAL; + + va_start(args, format); + + str_len = + vsnprintf((char *)msgb->tail, msgb_tailroom(msgb), format, args); + + if (str_len >= msgb_tailroom(msgb) || str_len < 0) { + rc = -EINVAL; + } else + msgb_put(msgb, str_len); + + va_end(args); + return rc; +} + /*! @} */ diff --git a/tests/msgb/msgb_test.c b/tests/msgb/msgb_test.c index ac10382..0533546 100644 --- a/tests/msgb/msgb_test.c +++ b/tests/msgb/msgb_test.c @@ -277,6 +277,110 @@ osmo_set_panic_handler(NULL); } +static void test_msgb_printf() +{ + struct msgb *msg; + struct msgb *msg_ref; + int rc; + int total_len; + + msg = msgb_alloc(80, "data"); + + /* Add normal text: */ + printf("Add normal text:\n"); + rc = msgb_printf(msg, "|this is a test %i, %s, %16x|", 4711, "testme", + 0x4711); + total_len = msgb_length(msg); + printf("#1: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(msgb_tailroom(msg) == 33); + + /* Add normal text: */ + rc = msgb_printf(msg, "|some more text|"); + total_len = msgb_length(msg); + printf("#2: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(msgb_tailroom(msg) == 17); + + /* Add normal text which will not fit: */ + rc = msgb_printf(msg, "|more %i %x %s|", 23, 0xfee, + "text will not fit"); + total_len = msgb_length(msg); + printf("#3: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == -EINVAL); + + /* Check if we got the right amount of characters in the message buffer + * until here, so that we can be sure that the following cornercase + * tests yield plausible results */ + OSMO_ASSERT(msgb_tailroom(msg) == 17); + + /* Add normal text which just does not fit by one character, this should not + * alter the message buffers tail pointer */ + rc = msgb_printf(msg, "|more 123456 ABC|"); + total_len = msgb_length(msg); + printf("#4: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == -EINVAL); + + /* Make sure the tailroom, nor the contained string length did change */ + OSMO_ASSERT(msgb_tailroom(msg) == 17); + OSMO_ASSERT(msgb_length(msg) == 63); + + /* Add normal text which just fits */ + rc = msgb_printf(msg, "|more 123456 AB|"); + total_len = msgb_length(msg); + printf("#5: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + + /* Make sure that the string in the bufer takes up all available Space. + * Also make sure that the available tailroom has space for one byte, + * which actually holds the string terminator */ + OSMO_ASSERT(msgb_tailroom(msg) == 1); + OSMO_ASSERT(msgb_length(msg) == 79); + + /* Try to add a nullstring to the already full buffer, this should + * be ok, since we still have one byte tailroom */ + rc = msgb_printf(msg, ""); + total_len = msgb_length(msg); + printf("#6: rc=%i, total_len=%i, msg->data=%s\n", rc, total_len, + msg->data); + OSMO_ASSERT(rc == 0); + + /* Make sure that we still have the same conditions as before */ + OSMO_ASSERT(msgb_tailroom(msg) == 1); + OSMO_ASSERT(msgb_length(msg) == 79); + + msgb_free(msg); + + /* Test behaviour when a completely full buffer is passed to + * msgb_printf(). We should get rc == -EINVAL and the message + * buffer must not be changed at all */ + msg = msgb_alloc(15, "data"); + msg_ref = msgb_alloc(msgb_tailroom(msg), "data"); + memset(msg->data, 0x41, msgb_tailroom(msg)); + memset(msg_ref->data, 0x41, msgb_tailroom(msg_ref)); + msgb_put(msg, msgb_tailroom(msg)); + msgb_put(msg_ref, msgb_tailroom(msg_ref)); + + printf("#7: before: %s", msgb_hexdump(msg)); + rc = msgb_printf(msg, "ABCDEF"); + printf(" after: rc=%i, %s", rc, msgb_hexdump(msg)); + if (memcmp(msg->data, msg_ref->data, msgb_length(msg)) == 0) + printf(" ==> ok, no change\n"); + else + printf(" ==> error, change detected\n"); + OSMO_ASSERT(rc == -EINVAL); + OSMO_ASSERT(msgb_tailroom(msg) == 0); + OSMO_ASSERT(msgb_length(msg) == msgb_length(msg_ref)); + + msgb_free(msg); + msgb_free(msg_ref); +} + static struct log_info info = {}; int main(int argc, char **argv) @@ -287,6 +391,7 @@ test_msgb_api_errors(); test_msgb_copy(); test_msgb_resize_area(); + test_msgb_printf(); printf("Success.\n"); diff --git a/tests/msgb/msgb_test.ok b/tests/msgb/msgb_test.ok index 6603fe7..826c809 100644 --- a/tests/msgb/msgb_test.ok +++ b/tests/msgb/msgb_test.ok @@ -32,4 +32,12 @@ Original: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Extended: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Shrinked: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f +Add normal text: +#1: rc=0, total_len=47, msg->data=|this is a test 4711, testme, 4711| +#2: rc=0, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text| +#3: rc=-22, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text||more 23 fee tex +#4: rc=-22, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 ABC +#5: rc=0, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 AB| +#6: rc=0, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 AB| +#7: before: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 after: rc=-22, 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 ==> ok, no change Success. -- To view, visit https://gerrit.osmocom.org/4200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 22 20:12:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 20:12:20 +0000 Subject: osmo-mgw[master]: protocol: allow wildcarded DLCX In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+1 (2 comments) +2 as soon as the whitespace change is in the patch that introduced the error https://gerrit.osmocom.org/#/c/4227/7/include/osmocom/mgcp_client/mgcp_client.h File include/osmocom/mgcp_client/mgcp_client.h: Line 39: char audio_ip[INET_ADDRSTRLEN]; so this patch fixes an indenting error from the other one? Rather move that over to the other patch. https://gerrit.osmocom.org/#/c/4227/7/src/libosmo-mgcp/mgcp_protocol.c File src/libosmo-mgcp/mgcp_protocol.c: Line 913: * RFC3435 Section F.7) */ wow, was it really designed like this? :) let's hope we always have nonempty connection IDs then. -- To view, visit https://gerrit.osmocom.org/4227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736 Gerrit-PatchSet: 7 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 22 21:09:28 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 22 Oct 2017 21:09:28 +0000 Subject: [PATCH] osmocom-bb[master]: mobile/vty_interface.c: do not install default commands Message-ID: Review at https://gerrit.osmocom.org/4373 mobile/vty_interface.c: do not install default commands Since in recent version of libosmocore default commands (such as 'exit' and 'end') are being installed by default, no need to install them twice. This will crash the program. Change-Id: I82c8d04ccc7dc3f19589a79b859a2c993bd1d39c --- M src/host/layer23/src/mobile/vty_interface.c 1 file changed, 0 insertions(+), 50 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/73/4373/1 diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index b26d471..9a889e9 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -2777,50 +2777,6 @@ return vty->node; } -/* Down vty node level. */ -gDEFUN(ournode_exit, - ournode_exit_cmd, "exit", "Exit current mode and down to previous mode\n") -{ - switch (vty->node) { - case MS_NODE: - vty->node = CONFIG_NODE; - vty->index = NULL; - break; - case TESTSIM_NODE: - case SUPPORT_NODE: - vty->node = MS_NODE; - break; - default: - break; - } - return CMD_SUCCESS; -} - -/* End of configuration. */ -gDEFUN(ournode_end, - ournode_end_cmd, "end", "End current mode and change to enable mode.") -{ - switch (vty->node) { - case VIEW_NODE: - case ENABLE_NODE: - /* Nothing to do. */ - break; - case CONFIG_NODE: - case VTY_NODE: - case MS_NODE: - case TESTSIM_NODE: - case SUPPORT_NODE: - vty_config_unlock(vty); - vty->node = ENABLE_NODE; - vty->index = NULL; - vty->index_sub = NULL; - break; - default: - break; - } - return CMD_SUCCESS; -} - DEFUN(off, off_cmd, "off", "Turn mobiles off (shutdown) and exit") { @@ -2886,8 +2842,6 @@ install_element(CONFIG_NODE, &cfg_no_ms_cmd); install_node(&ms_node, config_write); install_default(MS_NODE); - install_element(MS_NODE, &ournode_exit_cmd); - install_element(MS_NODE, &ournode_end_cmd); install_element(MS_NODE, &cfg_ms_show_this_cmd); install_element(MS_NODE, &cfg_ms_layer2_cmd); install_element(MS_NODE, &cfg_ms_sap_cmd); @@ -2931,8 +2885,6 @@ install_element(MS_NODE, &cfg_ms_support_cmd); install_node(&support_node, config_write_dummy); install_default(SUPPORT_NODE); - install_element(SUPPORT_NODE, &ournode_exit_cmd); - install_element(SUPPORT_NODE, &ournode_end_cmd); install_element(SUPPORT_NODE, &cfg_ms_sup_dtmf_cmd); install_element(SUPPORT_NODE, &cfg_ms_sup_no_dtmf_cmd); install_element(SUPPORT_NODE, &cfg_ms_sup_sms_cmd); @@ -2989,8 +2941,6 @@ install_element(SUPPORT_NODE, &cfg_ms_sup_no_skip_max_per_band_cmd); install_node(&testsim_node, config_write_dummy); install_default(TESTSIM_NODE); - install_element(TESTSIM_NODE, &ournode_exit_cmd); - install_element(TESTSIM_NODE, &ournode_end_cmd); install_element(TESTSIM_NODE, &cfg_test_imsi_cmd); install_element(TESTSIM_NODE, &cfg_test_ki_xor_cmd); install_element(TESTSIM_NODE, &cfg_test_ki_comp128_cmd); -- To view, visit https://gerrit.osmocom.org/4373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I82c8d04ccc7dc3f19589a79b859a2c993bd1d39c Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Oct 22 21:09:28 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 22 Oct 2017 21:09:28 +0000 Subject: [PATCH] osmocom-bb[master]: mobile/vty_interface.c: do not write 'exit' to config Message-ID: Review at https://gerrit.osmocom.org/4374 mobile/vty_interface.c: do not write 'exit' to config Since we use indenting as means to implicitly exit child nodes, no need to write 'exit' at the end of each child node. Change-Id: I73b0f3926d766d21ca68c8e01b7fc70b2b4636c9 --- M src/host/layer23/src/mobile/vty_interface.c 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/74/4374/1 diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 9a889e9..0f321ba 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -1494,7 +1494,6 @@ if (!hide_default || set->skip_max_per_band) vty_out(vty, " %sskip-max-per-band%s", (set->skip_max_per_band) ? "" : "no ", VTY_NEWLINE); - vty_out(vty, " exit%s", VTY_NEWLINE); vty_out(vty, " test-sim%s", VTY_NEWLINE); vty_out(vty, " imsi %s%s", set->test_imsi, VTY_NEWLINE); switch (set->test_ki_type) { @@ -1530,11 +1529,9 @@ vty_out(vty, " hplmn-search %s%s", (set->test_always) ? "everywhere" : "foreign-country", VTY_NEWLINE); - vty_out(vty, " exit%s", VTY_NEWLINE); /* no shutdown must be written to config, because shutdown is default */ vty_out(vty, " %sshutdown%s", (ms->shutdown) ? "" : "no ", VTY_NEWLINE); - vty_out(vty, "exit%s", VTY_NEWLINE); vty_out(vty, "!%s", VTY_NEWLINE); } -- To view, visit https://gerrit.osmocom.org/4374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73b0f3926d766d21ca68c8e01b7fc70b2b4636c9 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Oct 22 21:16:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 21:16:46 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 3: > I really dislike the idea of including dead code: it always raises > the questions for any person reading this code later on, it > silently bitrot and it doesn't serve any particular purpose. you're right, changing it. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 22 21:17:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 21:17:34 +0000 Subject: [PATCH] osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4311 to look at the new patch set (#4). ctrl: completely replace all CTRL commands The previous commands are not conforming to how the CTRL interface is intended to work: SET enable-ps SET disable-ps SET status-ps 'status-ps' is a write-only command even though it returns the status. 'enable-ps' / 'disable-ps' indicate the value instead of a variable name of an entity. The entity takes the place of the variable value. See also https://lists.osmocom.org/pipermail/openbsc/2017-September/011236.html Instead, replace with SET subscriber.by-imsi-123456.ps-enabled {0,1} GET subscriber.by-imsi-123456.ps-enabled and also provide further CTRL functions while at it: {SET,GET} subscriber.by-{imsi,msisdn,id}-123456.{cs,ps}-enabled {0,1} GET subscriber.by-{imsi,msisdn,id}-123456.{info,info-aud,info-all} Provide CTRL tests in the form of transcripts. This is the first time an application uses CTRL_NODE ids that are defined outside of libosmocore, see 'Depends' below. Implementation choice: the first idea was to have a '.' between the 'by-xxx' and the value, like: subscriber.by-xxx.123456.function but the difficulty with subscribers is that they are not in RAM, and I can't just point node_data at a struct instance that is always there (like, say, a global bts[0] struct in osmo-bsc). Instead, I want to store the selector and later decide whether to read from the DB or whatever. With a '.' separating things, the only way in a ctrl function to obtain both 'by-xxx' and '123456' for picking a subscriber record would be to parse the entire variable path string elements, including 'subscriber' and 'function', which would then also clumsily fix at which node level we hook these commands; there could have been separate CTRL_NODE_SUBSCR_BY_{IMSI,MSISDN,ID} parent nodes, but we cannot introspect the current parent node dynamically within a ctrl function handler (plus I'm not sure whether it's possible and a good idea to have the same command under multiple parent nodes). Rather than that, I store the 'by-foo-123' token in the node_data pointer to have both bits of information pointed at by a single pointer; I use the incoming command parsing to get this token pre-separated from surrounding node names, and no need to re-allocate it, since the vector of tokens lives until after command execution is complete. Each leaf command obtains this token from cmd->node (aka node_data), and feeds this token to a common static function to parse selector and value from it and to retrieve a subscriber record as needed. (BTW, I have mentioned on the mailing list that this way might be necessary to avoid numeric-only CTRL node names, but we don't need to, and that is not at all related to this choice of structure.) Depends: libosmocore I1bd62ae0d4eefde7e1517db15a2155640a1bab58 libosmocore Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 --- M src/ctrl.c M src/ctrl.h M src/hlr.c M tests/test_subscriber.ctrl M tests/test_subscriber.sql M tests/test_subscriber.vty A tests/test_subscriber_errors.ctrl 7 files changed, 1,045 insertions(+), 78 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/11/4311/4 diff --git a/src/ctrl.c b/src/ctrl.c index 3bd4d8f..05466c8 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -21,87 +21,372 @@ */ #include +#include +#include +#include -#include -#include +#include #include -#include "gsup_server.h" -#include "logging.h" -#include "db.h" #include "hlr.h" -#include "luop.h" #include "ctrl.h" +#include "db.h" -static int handle_cmd_ps(struct hlr *ctx, struct ctrl_cmd *cmd, bool enable) +#define SEL_BY "by-" +#define SEL_BY_IMSI SEL_BY "imsi-" +#define SEL_BY_MSISDN SEL_BY "msisdn-" +#define SEL_BY_ID SEL_BY "id-" + +#define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) + +static bool startswith(const char *str, const char *start) +{ + return strncmp(str, start, strlen(start)) == 0; +} + +static int _get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr) +{ + const char *val; + if (startswith(by_selector, SEL_BY_IMSI)) { + val = by_selector + strlen(SEL_BY_IMSI); + if (!osmo_imsi_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_imsi(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_MSISDN)) { + val = by_selector + strlen(SEL_BY_MSISDN); + if (!osmo_msisdn_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_msisdn(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_ID)) { + int64_t id; + char *endptr; + val = by_selector + strlen(SEL_BY_ID); + if (*val == '+') + return -EINVAL; + errno = 0; + id = strtoll(val, &endptr, 10); + if (errno || *endptr) + return -EINVAL; + return db_subscr_get_by_id(dbc, id, subscr); + } + return -ENOTSUP; +} + +static bool get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr, + struct ctrl_cmd *cmd) +{ + int rc = _get_subscriber(dbc, by_selector, subscr); + switch (rc) { + case 0: + return true; + case -ENOTSUP: + cmd->reply = "Not a known subscriber 'by-xxx-' selector."; + return false; + case -EINVAL: + cmd->reply = "Invalid value part of 'by-xxx-value' selector."; + return false; + case -ENOENT: + cmd->reply = "No such subscriber."; + return false; + default: + cmd->reply = NULL; + return false; + } +} + +/* Optimization: if a subscriber operation is requested by-imsi, just return + * the IMSI right back. */ +static const char *get_subscriber_imsi(struct db_context *dbc, + const char *by_selector, + struct ctrl_cmd *cmd) +{ + static struct hlr_subscriber subscr; + + if (startswith(by_selector, SEL_BY_IMSI)) + return by_selector + strlen(SEL_BY_IMSI); + if (!get_subscriber(dbc, by_selector, &subscr, cmd)) + return NULL; + return subscr.imsi; +} + +/* printf fmt and arg to completely omit a string if it is empty. */ +#define FMT_S "%s%s%s%s" +#define ARG_S(name, val) \ + (val) && *(val) ? "\n" : "", \ + (val) && *(val) ? name : "", \ + (val) && *(val) ? "\t" : "", \ + (val) && *(val) ? (val) : "" \ + +/* printf fmt and arg to completely omit bool of given value. */ +#define FMT_BOOL "%s" +#define ARG_BOOL(name, val) \ + val ? "\n" name "\t1" : "\n" name "\t0" + +static void print_subscr_info(struct ctrl_cmd *cmd, + struct hlr_subscriber *subscr) +{ + ctrl_cmd_reply_printf(cmd, + "\nid\t%"PRIu64 + FMT_S + FMT_S + FMT_BOOL + FMT_BOOL + FMT_S + FMT_S + FMT_S + FMT_BOOL + FMT_BOOL + "\nperiodic_lu_timer\t%u" + "\nperiodic_rau_tau_timer\t%u" + "\nlmsi\t%08x" + , + subscr->id, + ARG_S("imsi", subscr->imsi), + ARG_S("msisdn", subscr->msisdn), + ARG_BOOL("nam_cs", subscr->nam_cs), + ARG_BOOL("nam_ps", subscr->nam_ps), + ARG_S("vlr_number", subscr->vlr_number), + ARG_S("sgsn_number", subscr->sgsn_number), + ARG_S("sgsn_address", subscr->sgsn_address), + ARG_BOOL("ms_purged_cs", subscr->ms_purged_cs), + ARG_BOOL("ms_purged_ps", subscr->ms_purged_ps), + subscr->periodic_lu_timer, + subscr->periodic_rau_tau_timer, + subscr->lmsi + ); +} + +static void print_subscr_info_aud2g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + ctrl_cmd_reply_printf(cmd, + "\naud2g.algo\t%s" + "\naud2g.ki\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.gsm.ki)); +} + +static void print_subscr_info_aud3g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + ctrl_cmd_reply_printf(cmd, + "\naud3g.algo\t%s" + "\naud3g.k\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.umts.k)); + /* hexdump uses a static string buffer, hence only one hexdump per + * printf(). */ + ctrl_cmd_reply_printf(cmd, + "\naud3g.%s\t%s" + "\naud3g.ind_bitlen\t%u" + "\naud3g.sqn\t%"PRIu64 + , + aud->u.umts.opc_is_op? "op" : "opc", + hexdump_buf(aud->u.umts.opc), + aud->u.umts.ind_bitlen, + aud->u.umts.sqn); +} + +CTRL_CMD_DEFINE_RO(subscr_info, "info"); +static int get_subscr_info(struct ctrl_cmd *cmd, void *data) { struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; - if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, &subscr) < 0) { - cmd->reply = "Subscriber Unknown in HLR"; + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + print_subscr_info(cmd, &subscr); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_aud, "info-aud"); +static int get_subscr_info_aud(struct ctrl_cmd *cmd, void *data) +{ + const char *imsi; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } - if (hlr_subscr_nam(ctx, &subscr, enable, true) < 0) { - cmd->reply = "Error updating DB"; + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_all, "info-all"); +static int get_subscr_info_all(struct ctrl_cmd *cmd, void *data) +{ + struct hlr_subscriber subscr; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, subscr.imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } + print_subscr_info(cmd, &subscr); + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +static int verify_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) +{ + if (!value || !*value + || (strcmp(value, "0") && strcmp(value, "1"))) + return 1; + return 0; +} + +static int get_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + cmd->reply = (is_ps ? subscr.nam_ps : subscr.nam_cs) + ? "1" : "0"; + return CTRL_CMD_REPLY; +} + +static int set_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + const char *imsi; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + if (db_subscr_nam(hlr->dbc, imsi, strcmp(cmd->value, "1") == 0, is_ps)) + return CTRL_CMD_ERROR; cmd->reply = "OK"; return CTRL_CMD_REPLY; } -CTRL_CMD_DEFINE_WO_NOVRF(enable_ps, "enable-ps"); -static int set_enable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_ps_enabled, "ps-enabled"); +static int verify_subscr_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, true); + return verify_subscr_cs_ps_enabled(cmd, value, data); +} +static int get_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return get_subscr_cs_ps_enabled(cmd, data, true); +} +static int set_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, true); } -CTRL_CMD_DEFINE_WO_NOVRF(disable_ps, "disable-ps"); -static int set_disable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_cs_enabled, "cs-enabled"); +static int verify_subscr_cs_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, false); + return verify_subscr_cs_ps_enabled(cmd, value, data); } - -CTRL_CMD_DEFINE_WO_NOVRF(status_ps, "status-ps"); -static int set_status_ps(struct ctrl_cmd *cmd, void *data) +static int get_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) { - struct hlr *ctx = data; - struct lu_operation *luop = lu_op_alloc(ctx->gs); - if (!luop) { - cmd->reply = "Internal HLR error"; - return CTRL_CMD_ERROR; - } - - if (!lu_op_fill_subscr(luop, ctx->dbc, cmd->value)) { - cmd->reply = "Subscriber Unknown in HLR"; - return CTRL_CMD_ERROR; - } - - cmd->reply = luop->subscr.nam_ps ? "1" : "0"; - - return CTRL_CMD_REPLY; + return get_subscr_cs_ps_enabled(cmd, data, false); +} +static int set_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, false); } int hlr_ctrl_cmds_install() { int rc = 0; - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_enable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_disable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_status_ps); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_aud); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_all); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_ps_enabled); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_cs_enabled); return rc; } -struct ctrl_handle *hlr_controlif_setup(struct hlr *ctx, - struct osmo_gsup_server *gs) +static int hlr_ctrl_node_lookup(void *data, vector vline, int *node_type, + void **node_data, int *i) +{ + const char *token = vector_slot(vline, *i); + + switch (*node_type) { + case CTRL_NODE_ROOT: + if (strcmp(token, "subscriber") != 0) + return 0; + *node_data = NULL; + *node_type = CTRL_NODE_SUBSCR; + break; + case CTRL_NODE_SUBSCR: + if (!startswith(token, "by-")) + return 0; + *node_data = (void*)token; + *node_type = CTRL_NODE_SUBSCR_BY; + break; + default: + return 0; + } + + return 1; +} + +struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr) { int rc; - struct ctrl_handle *hdl = ctrl_interface_setup_dynip(ctx, - ctx->ctrl_bind_addr, - OSMO_CTRL_PORT_HLR, - NULL); + struct ctrl_handle *hdl; + + hdl = ctrl_interface_setup_dynip2(hlr, + hlr->ctrl_bind_addr, + OSMO_CTRL_PORT_HLR, + hlr_ctrl_node_lookup, + _LAST_CTRL_NODE_HLR); if (!hdl) return NULL; diff --git a/src/ctrl.h b/src/ctrl.h index 663de30..3f9ba3f 100644 --- a/src/ctrl.h +++ b/src/ctrl.h @@ -24,8 +24,11 @@ #include -#include "gsup_server.h" +enum hlr_ctrl_node { + CTRL_NODE_SUBSCR = _LAST_CTRL_NODE, + CTRL_NODE_SUBSCR_BY, + _LAST_CTRL_NODE_HLR +}; int hlr_ctrl_cmds_install(); -struct ctrl_handle *hlr_controlif_setup(struct hlr *ctx, - struct osmo_gsup_server *gs); +struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr); diff --git a/src/hlr.c b/src/hlr.c index b32f709..6310526 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -474,7 +474,7 @@ } g_hlr->ctrl_bind_addr = ctrl_vty_get_bind_addr(); - g_hlr->ctrl = hlr_controlif_setup(g_hlr, g_hlr->gs); + g_hlr->ctrl = hlr_controlif_setup(g_hlr); osmo_init_ignore_signals(); signal(SIGINT, &signal_hdlr); diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl index 3284ae5..a88b3a5 100644 --- a/tests/test_subscriber.ctrl +++ b/tests/test_subscriber.ctrl @@ -1,27 +1,598 @@ -GET 1 invalid -ERROR 1 Command not found -SET 2 invalid nonsense -ERROR 2 Command not found +GET 1 subscriber.by-imsi-901990000000001.info +GET_REPLY 1 subscriber.by-imsi-901990000000001.info +id 1 +imsi 901990000000001 +msisdn 1 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 -SET 3 enable-ps 901990000000001 -SET_REPLY 3 enable-ps OK -SET 4 status-ps 901990000000001 -SET_REPLY 4 status-ps 1 -SET 5 enable-ps 901990000000001 -SET_REPLY 5 enable-ps OK -SET 6 status-ps 901990000000001 -SET_REPLY 6 status-ps 1 +GET 2 subscriber.by-imsi-901990000000001.info-aud +GET_REPLY 2 subscriber.by-imsi-901990000000001.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 7 disable-ps 901990000000001 -SET_REPLY 7 disable-ps OK -SET 8 status-ps 901990000000001 -SET_REPLY 8 status-ps 0 -SET 9 disable-ps 901990000000001 -SET_REPLY 9 disable-ps OK -SET 10 status-ps 901990000000001 -SET_REPLY 10 status-ps 0 +GET 3 subscriber.by-imsi-901990000000001.info-all +GET_REPLY 3 subscriber.by-imsi-901990000000001.info-all +id 1 +imsi 901990000000001 +msisdn 1 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 11 enable-ps 901990000000001 -SET_REPLY 11 enable-ps OK -SET 12 status-ps 901990000000001 -SET_REPLY 12 status-ps 1 +GET 4 subscriber.by-imsi-901990000000002.info +GET_REPLY 4 subscriber.by-imsi-901990000000002.info +id 2 +imsi 901990000000002 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 5 subscriber.by-imsi-901990000000002.info-aud +GET_REPLY 5 subscriber.by-imsi-901990000000002.info-aud +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 6 subscriber.by-imsi-901990000000002.info-all +GET_REPLY 6 subscriber.by-imsi-901990000000002.info-all +id 2 +imsi 901990000000002 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 7 subscriber.by-imsi-901990000000003.info +GET_REPLY 7 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 8 subscriber.by-imsi-901990000000003.info-aud +GET_REPLY 8 subscriber.by-imsi-901990000000003.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 9 subscriber.by-imsi-901990000000003.info-all +GET_REPLY 9 subscriber.by-imsi-901990000000003.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 10 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 10 subscriber.by-imsi-901990000000003.ps-enabled 1 + +SET 11 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 11 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 12 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 12 subscriber.by-imsi-901990000000003.ps-enabled 0 + +GET 13 subscriber.by-imsi-901990000000003.info +GET_REPLY 13 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 14 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 14 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 15 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 15 subscriber.by-imsi-901990000000003.ps-enabled 0 + +SET 16 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 16 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 17 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 17 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 18 subscriber.by-imsi-901990000000003.info +GET_REPLY 18 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 19 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 19 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 20 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 20 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 21 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 21 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 22 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 22 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 23 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 23 subscriber.by-imsi-901990000000003.cs-enabled 0 + +GET 24 subscriber.by-imsi-901990000000003.info +GET_REPLY 24 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 25 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 25 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 26 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 26 subscriber.by-imsi-901990000000003.cs-enabled 0 + +SET 27 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 27 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 28 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 28 subscriber.by-imsi-901990000000003.cs-enabled 1 + +GET 29 subscriber.by-imsi-901990000000003.info +GET_REPLY 29 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 30 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 30 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 31 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 31 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 32 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 32 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 33 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 33 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 34 subscriber.by-imsi-901990000000003.info +GET_REPLY 34 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 35 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 35 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 36 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 36 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 37 subscriber.by-imsi-901990000000003.info +GET_REPLY 37 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + + + +GET 38 subscriber.by-msisdn-103.info +GET_REPLY 38 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 39 subscriber.by-msisdn-103.info-aud +GET_REPLY 39 subscriber.by-msisdn-103.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 40 subscriber.by-msisdn-103.info-all +GET_REPLY 40 subscriber.by-msisdn-103.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 41 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 41 subscriber.by-msisdn-103.ps-enabled 1 + +SET 42 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 42 subscriber.by-msisdn-103.ps-enabled OK +GET 43 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 43 subscriber.by-msisdn-103.ps-enabled 0 + +GET 44 subscriber.by-msisdn-103.info +GET_REPLY 44 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 45 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 45 subscriber.by-msisdn-103.ps-enabled OK +GET 46 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 46 subscriber.by-msisdn-103.ps-enabled 0 + +SET 47 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 47 subscriber.by-msisdn-103.ps-enabled OK +GET 48 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 48 subscriber.by-msisdn-103.ps-enabled 1 + +GET 49 subscriber.by-msisdn-103.info +GET_REPLY 49 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 50 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 50 subscriber.by-msisdn-103.ps-enabled OK +GET 51 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 51 subscriber.by-msisdn-103.ps-enabled 1 + +GET 52 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 52 subscriber.by-msisdn-103.cs-enabled 1 + +SET 53 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 53 subscriber.by-msisdn-103.cs-enabled OK +GET 54 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 54 subscriber.by-msisdn-103.cs-enabled 0 + +GET 55 subscriber.by-msisdn-103.info +GET_REPLY 55 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 56 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 56 subscriber.by-msisdn-103.cs-enabled OK +GET 57 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 57 subscriber.by-msisdn-103.cs-enabled 0 + +SET 58 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 58 subscriber.by-msisdn-103.cs-enabled OK +GET 59 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 59 subscriber.by-msisdn-103.cs-enabled 1 + +GET 60 subscriber.by-msisdn-103.info +GET_REPLY 60 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 61 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 61 subscriber.by-msisdn-103.cs-enabled OK +GET 62 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 62 subscriber.by-msisdn-103.cs-enabled 1 + +SET 63 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 63 subscriber.by-msisdn-103.ps-enabled OK +SET 64 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 64 subscriber.by-msisdn-103.cs-enabled OK +GET 65 subscriber.by-msisdn-103.info +GET_REPLY 65 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 66 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 66 subscriber.by-msisdn-103.ps-enabled OK +SET 67 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 67 subscriber.by-msisdn-103.cs-enabled OK +GET 68 subscriber.by-msisdn-103.info +GET_REPLY 68 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + + + +GET 69 subscriber.by-id-3.info +GET_REPLY 69 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 70 subscriber.by-id-3.info-aud +GET_REPLY 70 subscriber.by-id-3.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 71 subscriber.by-id-3.info-all +GET_REPLY 71 subscriber.by-id-3.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 0 + +GET 72 subscriber.by-id-3.ps-enabled +GET_REPLY 72 subscriber.by-id-3.ps-enabled 1 + +SET 73 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 73 subscriber.by-id-3.ps-enabled OK +GET 74 subscriber.by-id-3.ps-enabled +GET_REPLY 74 subscriber.by-id-3.ps-enabled 0 + +GET 75 subscriber.by-id-3.info +GET_REPLY 75 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 76 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 76 subscriber.by-id-3.ps-enabled OK +GET 77 subscriber.by-id-3.ps-enabled +GET_REPLY 77 subscriber.by-id-3.ps-enabled 0 + +SET 78 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 78 subscriber.by-id-3.ps-enabled OK +GET 79 subscriber.by-id-3.ps-enabled +GET_REPLY 79 subscriber.by-id-3.ps-enabled 1 + +GET 80 subscriber.by-id-3.info +GET_REPLY 80 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 81 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 81 subscriber.by-id-3.ps-enabled OK +GET 82 subscriber.by-id-3.ps-enabled +GET_REPLY 82 subscriber.by-id-3.ps-enabled 1 + +GET 83 subscriber.by-id-3.cs-enabled +GET_REPLY 83 subscriber.by-id-3.cs-enabled 1 + +SET 84 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 84 subscriber.by-id-3.cs-enabled OK +GET 85 subscriber.by-id-3.cs-enabled +GET_REPLY 85 subscriber.by-id-3.cs-enabled 0 + +GET 86 subscriber.by-id-3.info +GET_REPLY 86 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 87 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 87 subscriber.by-id-3.cs-enabled OK +GET 88 subscriber.by-id-3.cs-enabled +GET_REPLY 88 subscriber.by-id-3.cs-enabled 0 + +SET 89 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 89 subscriber.by-id-3.cs-enabled OK +GET 90 subscriber.by-id-3.cs-enabled +GET_REPLY 90 subscriber.by-id-3.cs-enabled 1 + +GET 91 subscriber.by-id-3.info +GET_REPLY 91 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 92 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 92 subscriber.by-id-3.cs-enabled OK +GET 93 subscriber.by-id-3.cs-enabled +GET_REPLY 93 subscriber.by-id-3.cs-enabled 1 + +SET 94 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 94 subscriber.by-id-3.ps-enabled OK +SET 95 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 95 subscriber.by-id-3.cs-enabled OK +GET 96 subscriber.by-id-3.info +GET_REPLY 96 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 97 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 97 subscriber.by-id-3.ps-enabled OK +SET 98 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 98 subscriber.by-id-3.cs-enabled OK +GET 99 subscriber.by-id-3.info +GET_REPLY 99 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql index 0767d48..decd7d2 100644 --- a/tests/test_subscriber.sql +++ b/tests/test_subscriber.sql @@ -1,6 +1,6 @@ -- 2G only subscriber -INSERT INTO subscriber (id, imsi) VALUES (1, '901990000000001'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (1, '901990000000001', '1'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (1, 1, '000102030405060708090a0b0c0d0e0f'); -- 3G only subscriber @@ -8,6 +8,6 @@ INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); -- 2G + 3G subscriber -INSERT INTO subscriber (id, imsi) VALUES (3, '901990000000003'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (3, '901990000000003', '103'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); diff --git a/tests/test_subscriber.vty b/tests/test_subscriber.vty index 2e0bdce..2da455f 100644 --- a/tests/test_subscriber.vty +++ b/tests/test_subscriber.vty @@ -305,6 +305,7 @@ OPC=cededeffacedacefacedbadfadedbeef IND-bitlen=23 +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op C01ffedC1cadaeAc1d1f1edAcac1aB0a OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op CoiffedCicadaeAcidifiedAcaciaBoa % Invalid value for OP: 'CoiffedCicadaeAcidifiedAcaciaBoa' OsmoHLR# subscriber imsi 123456789023000 show @@ -313,8 +314,8 @@ MSISDN: 423 3G auth: MILENAGE K=deaf0ff1ced0d0dabbedd1ced1cef00d - OPC=cededeffacedacefacedbadfadedbeef - IND-bitlen=23 + OP=c01ffedc1cadaeac1d1f1edacac1ab0a + IND-bitlen=5 OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef OsmoHLR# subscriber id 1 show @@ -325,8 +326,8 @@ KI=cededeffacedacefacedbadfadedbeef 3G auth: MILENAGE K=deaf0ff1ced0d0dabbedd1ced1cef00d - OPC=cededeffacedacefacedbadfadedbeef - IND-bitlen=23 + OP=c01ffedc1cadaeac1d1f1edacac1ab0a + IND-bitlen=5 OsmoHLR# subscriber imsi 123456789023000 delete % Deleted subscriber for IMSI '123456789023000' diff --git a/tests/test_subscriber_errors.ctrl b/tests/test_subscriber_errors.ctrl new file mode 100644 index 0000000..2f64fdb --- /dev/null +++ b/tests/test_subscriber_errors.ctrl @@ -0,0 +1,107 @@ +GET 1 invalid +ERROR 1 Command not found +SET 2 invalid nonsense +ERROR 2 Command not found + +GET 3 subscriber.by-imsi-nonsense.info +ERROR 3 Invalid value part of 'by-xxx-value' selector. +GET 4 subscriber.by-msisdn-nonsense.info +ERROR 4 Invalid value part of 'by-xxx-value' selector. +GET 5 subscriber.by-id-nonsense.info +ERROR 5 Invalid value part of 'by-xxx-value' selector. + +GET 6 subscriber +ERROR 6 Command not present. +GET 7 subscriber. +ERROR 7 Command not present. +GET 8 subscriber.by-nonsense +ERROR 8 Command not present. +GET 9 subscriber.by-nonsense- +ERROR 9 Command not present. +GET 10 subscriber.by-nonsense-123456 +ERROR 10 Command not present. +GET 11 subscriber.by-nonsense-123456. +ERROR 11 Command not present. +GET 12 subscriber.by-imsi- +ERROR 12 Command not present. +GET 13 subscriber.by-imsi-. +ERROR 13 Command not present. +GET 14 subscriber.by-imsi-901990000000003 +ERROR 14 Command not present. +GET 15 subscriber.by-imsi-901990000000003. +ERROR 15 Command not present. + +GET 16 subscriber.by-nonsense-123456.info +ERROR 16 Not a known subscriber 'by-xxx-' selector. +GET 17 subscriber.by-123456.info +ERROR 17 Not a known subscriber 'by-xxx-' selector. + +GET 18 subscriber.by-imsi-.info +ERROR 18 Invalid value part of 'by-xxx-value' selector. +GET 19 subscriber.by-imsi--.info +ERROR 19 Invalid value part of 'by-xxx-value' selector. + +GET 20 subscriber.by-imsi-12345678901234567.info +ERROR 20 Invalid value part of 'by-xxx-value' selector. +GET 21 subscriber.by-imsi-12345.info +ERROR 21 Invalid value part of 'by-xxx-value' selector. +GET 22 subscriber.by-imsi-1234567890123456.info +ERROR 22 Invalid value part of 'by-xxx-value' selector. + +GET 23 subscriber.by-id-99999999999999999999999999.info +ERROR 23 Invalid value part of 'by-xxx-value' selector. +GET 24 subscriber.by-id-9223372036854775807.info +ERROR 24 No such subscriber. +GET 25 subscriber.by-id-9223372036854775808.info +ERROR 25 Invalid value part of 'by-xxx-value' selector. +GET 26 subscriber.by-id--1.info +ERROR 26 No such subscriber. +GET 27 subscriber.by-id--9223372036854775808.info +ERROR 27 No such subscriber. +GET 28 subscriber.by-id--9223372036854775809.info +ERROR 28 Invalid value part of 'by-xxx-value' selector. + +GET 29 subscriber.by-id-1+1.info +ERROR 29 Invalid value part of 'by-xxx-value' selector. +GET 30 subscriber.by-id--.info +ERROR 30 Invalid value part of 'by-xxx-value' selector. +GET 31 subscriber.by-id-+1.info +ERROR 31 Invalid value part of 'by-xxx-value' selector. +GET 32 subscriber.by-id-+-1.info +ERROR 32 Invalid value part of 'by-xxx-value' selector. +GET 33 subscriber.by-id--+1.info +ERROR 33 Invalid value part of 'by-xxx-value' selector. +GET 34 subscriber.by-id-++1.info +ERROR 34 Invalid value part of 'by-xxx-value' selector. +GET 35 subscriber.by-id---1.info +ERROR 35 Invalid value part of 'by-xxx-value' selector. + +GET 36 subscriber.by-id- 1.info +ERROR 36 Command not present. +GET 37 subscriber.by-id-+ 1.info +ERROR 37 Command not present. +GET 38 subscriber.by-id-- 1.info +ERROR 38 Command not present. + + +SET 39 subscriber.by-imsi-901990000000001.info foo +ERROR 39 Read Only attribute +SET 40 subscriber.by-imsi-901990000000001.info-aud foo +ERROR 40 Read Only attribute +SET 41 subscriber.by-imsi-901990000000001.info-all foo +ERROR 41 Read Only attribute + +SET 42 subscriber.by-imsi-901990000000001.ps-enabled nonsense +ERROR 42 Value failed verification. +SET 43 subscriber.by-imsi-901990000000001.cs-enabled nonsense +ERROR 43 Value failed verification. + +SET 44 subscriber.by-imsi-901990000000001.ps-enabled +ERROR err Command parser error. +SET 45 subscriber.by-imsi-901990000000001.cs-enabled +ERROR err Command parser error. + +GET 46 subscriber.by-imsi-1234567890123456.ps-enabled +ERROR 46 Invalid value part of 'by-xxx-value' selector. +GET 47 subscriber.by-imsi-1234567890123456.cs-enabled +ERROR 47 Invalid value part of 'by-xxx-value' selector. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 22 21:17:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 21:17:34 +0000 Subject: [PATCH] osmo-hlr[master]: test_subscriber.ctrl: test against octal/hex interpretation ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4343 to look at the new patch set (#2). test_subscriber.ctrl: test against octal/hex interpretation of id Add a large enough subscriber id and add a test that ensures a leading zero is not interpreted as octal, and that a leading 0x is invalid and not interpreted as hexadecimal. Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173 --- M tests/test_subscriber.ctrl M tests/test_subscriber.sql 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/43/4343/2 diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl index a88b3a5..e09a795 100644 --- a/tests/test_subscriber.ctrl +++ b/tests/test_subscriber.ctrl @@ -596,3 +596,19 @@ periodic_lu_timer 0 periodic_rau_tau_timer 0 lmsi 00000000 + +GET 100 subscriber.by-id-00123.info +GET_REPLY 100 subscriber.by-id-00123.info +id 123 +imsi 123123 +msisdn 123 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 101 subscriber.by-id-0x0123.info +ERROR 101 Invalid value part of 'by-xxx-value' selector. diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql index decd7d2..2f0efd7 100644 --- a/tests/test_subscriber.sql +++ b/tests/test_subscriber.sql @@ -11,3 +11,7 @@ INSERT INTO subscriber (id, imsi, msisdn) VALUES (3, '901990000000003', '103'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); + +-- A subscriber id > 7 and > 15 to check against octal and hex notations +INSERT INTO subscriber (id, imsi, msisdn) VALUES (123, '123123', '123'); +INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (123, 3, 'BeefedCafeFaceAcedAddedDecadeFee'); -- To view, visit https://gerrit.osmocom.org/4343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 22 21:26:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 21:26:42 +0000 Subject: osmo-bts[master]: osmo-bts-trx: vty: various fixes of 'write file' and doc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 lemme just... -- To view, visit https://gerrit.osmocom.org/4314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 22 21:26:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 21:26:46 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-trx: vty: various fixes of 'write file' and doc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo-bts-trx: vty: various fixes of 'write file' and doc ...................................................................... osmo-bts-trx: vty: various fixes of 'write file' and doc On 'write file': - Write 'osmotrx' before 'maxdly' and 'maxdlynb' (broken since "Introduce new phy_link and phy_instance abstraction" d784e50747b8cf0ce505489e1451f75be5ccbd4b) - Fix indenting of 'write file' output, command 'osmotrx timing-advance-loop', had a stray space in case there is not a 'no' preceding it. Add some missing instances of OSMOTRX_STR doc strings. examples/osmo-bts.cfg: - Drop 'settsc', the command no longer exists. - Fix indenting of 'osmotrx rx-gain' command. osmo-bts does not feature VTY tests, so it is pointless to add example files to test these fixes. We should probably add VTY tests separately. However, I have briefly tested manually (and hence found all of these issues). Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000 --- M doc/examples/trx/osmo-bts.cfg M src/osmo-bts-trx/trx_vty.c 2 files changed, 10 insertions(+), 7 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/trx/osmo-bts.cfg b/doc/examples/trx/osmo-bts.cfg index c267fd0..805d929 100644 --- a/doc/examples/trx/osmo-bts.cfg +++ b/doc/examples/trx/osmo-bts.cfg @@ -21,14 +21,13 @@ ! phy 0 instance 0 - osmotrx rx-gain 1 + osmotrx rx-gain 1 osmotrx ip local 127.0.0.1 osmotrx ip remote 127.0.0.1 bts 0 band 1800 ipa unit-id 6969 0 oml remote-ip 192.168.122.1 - settsc gsmtap-sapi ccch gsmtap-sapi pdtch trx 0 diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index a7a433b..1dfc617 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -207,6 +207,7 @@ DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd, "osmotrx maxdly <0-31>", + OSMOTRX_STR "Set the maximum acceptable delay of an Access Burst (in GSM symbols)." " Access Burst is the first burst a mobile transmits in order to establish" " a connection and it is used to estimate Timing Advance (TA) which is" @@ -230,6 +231,7 @@ DEFUN(cfg_phyinst_maxdlynb, cfg_phyinst_maxdlynb_cmd, "osmotrx maxdlynb <0-31>", + OSMOTRX_STR "Set the maximum acceptable delay of a Normal Burst (in GSM symbols)." " USE FOR TESTING ONLY, DON'T CHANGE IN PRODUCTION USE!" " During normal operation, Normal Bursts delay are controled by a Timing" @@ -396,7 +398,8 @@ DEFUN(cfg_phyinst_no_maxdly, cfg_phyinst_no_maxdly_cmd, "no osmotrx maxdly", - NO_STR "Unset the maximum delay of GSM symbols\n") + NO_STR OSMOTRX_STR + "Unset the maximum delay of GSM symbols\n") { struct phy_instance *pinst = vty->index; struct trx_l1h *l1h = pinst->u.osmotrx.hdl; @@ -408,7 +411,8 @@ DEFUN(cfg_phyinst_no_maxdlynb, cfg_phyinst_no_maxdlynb_cmd, "no osmotrx maxdlynb", - NO_STR "Unset the maximum delay of GSM symbols\n") + NO_STR OSMOTRX_STR + "Unset the maximum delay of GSM symbols\n") { struct phy_instance *pinst = vty->index; struct trx_l1h *l1h = pinst->u.osmotrx.hdl; @@ -502,7 +506,7 @@ vty_out(vty, " osmotrx ms-power-loop %d%s", plink->u.osmotrx.trx_target_rssi, VTY_NEWLINE); else vty_out(vty, " no osmotrx ms-power-loop%s", VTY_NEWLINE); - vty_out(vty, " %s osmotrx timing-advance-loop%s", (plink->u.osmotrx.trx_ta_loop) ? "" : "no", VTY_NEWLINE); + vty_out(vty, " %sosmotrx timing-advance-loop%s", (plink->u.osmotrx.trx_ta_loop) ? "" : "no ", VTY_NEWLINE); if (plink->u.osmotrx.base_port_local) vty_out(vty, " osmotrx base-port local %"PRIu16"%s", @@ -535,9 +539,9 @@ l1h->config.power, VTY_NEWLINE); } if (l1h->config.maxdly_valid) - vty_out(vty, " maxdly %d%s", l1h->config.maxdly, VTY_NEWLINE); + vty_out(vty, " osmotrx maxdly %d%s", l1h->config.maxdly, VTY_NEWLINE); if (l1h->config.maxdlynb_valid) - vty_out(vty, " maxdlynb %d%s", l1h->config.maxdlynb, VTY_NEWLINE); + vty_out(vty, " osmotrx maxdlynb %d%s", l1h->config.maxdlynb, VTY_NEWLINE); if (l1h->config.slotmask != 0xff) vty_out(vty, " slotmask %d %d %d %d %d %d %d %d%s", l1h->config.slotmask & 1, -- To view, visit https://gerrit.osmocom.org/4314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 22 21:34:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 21:34:58 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 2: > This means that you can do any updates you > like - add/remove files, change functions, etc. It all will just > become part of signed release commit. One point is, I wouldn't want to mix releng changes in with functional changes made to the code, for the same reason that we don't want to mix in cosmetics... More importantly, dexter can't decide on his own that his change is good, hence he has to wait for code review and final merge before he can assume that tagging the patch's git hash is worth release-tagging. I can't push a signed tag for gerrit review, can I? Even if, in case the patch is tweaked, I'd have to readjust the tag every time. IIUC the only useful way is to merge first and then do release fu when it's in. The drawback is that we still have a commit with LIBVERSION 0:0:0 that is incompatible, before a release bumps it to 1:0:0. It's a bit of a dilemma. Maybe this patch should include the LIBVERSION bump, and making a semantic release with signed tag needs to happen after the merge? -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 22 21:39:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 22 Oct 2017 21:39:31 +0000 Subject: =?UTF-8?Q?libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E0=2E7_=E2=86=92_0=2E0=2E8?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (3 comments) (I don't like mixing in large comment tweaks with the actual release bumping) https://gerrit.osmocom.org/#/c/4318/1/debian/control File debian/control: Line 28: Conflicts: libosmonetif2, libosmonetif2 libosmonetif2 twice now? https://gerrit.osmocom.org/#/c/4318/1/src/Makefile.am File src/Makefile.am: Line 3: # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html like in osmo-mgw, this should rather say "please read TODO-RELEASE"? Line 4: LIBVERSION=4:0:1 add to the commit log that LIBVERSION got bumped, and why -- To view, visit https://gerrit.osmocom.org/4318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc8b9ca64edd40f96cea92388d0e2f000ee07a9d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 00:16:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 00:16:53 +0000 Subject: osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 (35 comments) phew, that was a lot to review. I hope you're not overwhelmed by the amount of comments, after all it's just a (big) bunch of details. FYI, I made some FSM graphs for this patch using the mad libosmocore/contrib/fsm-to-dot.py script I wrote last year: http://people.osmocom.org/neels/bsc_fsms/ (I needed to tweak a few things for it to work, will submit those tweaks separately) https://gerrit.osmocom.org/#/c/4334/4/configure.ac File configure.ac: Line 52: PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 1.0.0) (would have been nicer to keep it on the same line for diff reading) Line 138: src/osmo-bsc/Makefile is removing osmo-bsc_nat intentional? I didn't read it in the commit log. https://gerrit.osmocom.org/#/c/4334/4/include/osmocom/bsc/gsm_data.h File include/osmocom/bsc/gsm_data.h: Line 484: } mgw; (your usual impulse should be to extend structs only at their end ... but since it's not public API, I guess it's fine) https://gerrit.osmocom.org/#/c/4334/4/include/osmocom/bsc/osmo_bsc.h File include/osmocom/bsc/osmo_bsc.h: Line 34: struct sockaddr_storage aoip_rtp_addr_remote; (do our previous preference of char* for IP addresses apply here as well?) https://gerrit.osmocom.org/#/c/4334/4/include/osmocom/bsc/osmo_bsc_mgcp.h File include/osmocom/bsc/osmo_bsc_mgcp.h: PS4, Line 1: Sysmocom s.f.m.c. > sysmocom awalys lower-case and "-" before s.f.m.c. oh ... I (neels) didn't know about the dash, which means that all headers I (c)'d like this have "sysmocom s.f.m.c." now. Line 36: struct gsm_network *network; > I don't think we want to keep an extra pointer to the network around in eve AFAICT all you need is network->mgcp.client, rather just place that one here, and pass it to mgcp_assignm_req() instead of a gsm_network*. https://gerrit.osmocom.org/#/c/4334/4/src/Makefile.am File src/Makefile.am: Line 35: osmo-bsc \ (remove osmo-bsc_nat?) https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_audio.c File src/osmo-bsc/osmo_bsc_audio.c: Line 94: (unrelated cosmetic fix) https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 341: /* NOTE: This is the SCCP-Lite case, since we do not handle does this version of osmo-bsc even support SCCPlite anymore? I thought the SCCPlite one has to be built from openbsc.git, since adding the new sigtran has modified libbsc. Same applies to other sccplite if cases ... have you tested them and I got something wrong? IIUC having both AoIP and SCCPlite support in the same program means that we add SCCPlite to the new SIGTRAN, before that we simply will not? Line 564: conn->mgcp_ctx = mgcp_assignm_req(NULL, msc->network, conn, chan_mode, full_rate); don't pass a NULL talloc ctx!! We don't want to create rogue root contexts, it shall be a tree structure. 'conn' might be a good ctx. Line 768: OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); ('== true' is superfluous) Line 772: LOGP(DMSC, LOGL_NOTICE, "Sending assignment complete message...\n"); > sending the assignment complete is an normal event, i.e. LOGL_DEBUG seems a (if it happens rarely and is interesting, LOGL_INFO is also available. NOTICE is almost as important as ERROR.) https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_main.c File src/osmo-bsc/osmo_bsc_main.c: Line 284: printf("MGCPGW connect failed\n"); > useful to print the connect to *where* has failed (IP/port) (maybe just "MGCP" without "GW" is better? "MGCPGW" is a term that was used elsewhere in a temporary way, now replaced by "MGW") https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_mgcp.c File src/osmo-bsc/osmo_bsc_mgcp.c: Line 37: #define MGCP_MGW_TIMEOUT 4 /* sek */ in english, it would be "sec", but rather write out "in seconds" to make it clear. Line 40: #define MGCP_BSS_TIMEOUT_TIMER_NO 7412 ("TIMER_NO" to me reads like "Timer? No!" .. make this "TIMER_NR"?) Line 46: enum fsm_states { shouldn't below fsm_state_names[] make the comments here unnecessary? At least they shouldn't mismatch with below strings, which they do. Line 71: {ST_ASSIGN_PROC, "ST_ASSIGN_PROC (conntinue assingment)"}, "continue", "assignment" Line 74: {ST_ASSIGN_COMPL, "ST_ASSIGN_COMPL (complete assingment)"}, "assignment" Line 76: {ST_HALT, "ST_HALT (destroy state machine)"}, nice, we get both the actual state constant name in the log as well as a human understandable description. Line 77: {0, NULL}, (could omit the comma, nothing should ever follow the end marker) Line 121: /* On error, go directly to the DLCX phase. */ (the comment says the identical thing that the function name already does) Line 122: static void on_error_goto_dlcx(struct mgcp_ctx *mgcp_ctx) this is called from pretty much all the code paths; it might be nice to add an error cause message arg that this function then logs in its LOGPFSM()? Line 125: * behave like the call were ended normally. */ If this comment is useful and applies to the entire function, it should go above where the API doc usually is. Line 130: OSMO_ASSERT(mgcp_ctx); (usually it makes sense to assert non-NULL once, early in the code path, instead again and again in each static utility function, which is just bloating the code; especially when NULL is never a permitted situation. Notably, it can make sense to do this in all event callback functions where we're not sure what we might be getting.) Line 143: osmo_fsm_inst_state_chg(fi, ST_DLCX, 0, 0); should this have a timeout? Line 185: /* Generate MGCP message string */ I usually like this notation: mgcp_msg = (struct mgcp_msg){ .verb = MGCP_VERB_CRCX, .presence = ... .call_id = ... }; Line 190: snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, rtp_endpoint); I think this snprintf should move into mgcp_msg_gen() and make mgcp_msg.endpoint a uint16_t? does that make sense, or can the endpoint be an arbitrary string and uint16_t is just a local limitation? Line 193: mgcp_msg.conn_mode = MGCP_CONN_LOOPBACK; (would it make sense to add thin API functions like mgcp_msg_set_foo() that do msg.foo = foo as well as presence |= MGCP_FOO? ... might end up bloaty, not sure, just an idea.) Line 199: mgcp_client_tx(mgcp, msg, crcx_for_bts_resp_cb, mgcp_ctx); admitted, we have logging in mgcp_client_tx, but would still be nice to do some LOGPFSM() to notice the important event in the FSM flow. And then we might as well go to an error state directly instead of waiting for the timeout first. Line 207: struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)priv; (is a cast from void* even necessary? I think it's not warned about, is it?) Line 250: int full_rate; (also bool according to Harald's earlier comment?) Line 282: /* Forward declaration to keep the function in logical order */ (kind of obsolete comment) Line 780: .name = "FSM MGCP", > I'm not sure if spaces are permitted here in the name. This will again caus (I'd drop the "FSM " part, we will see in logging that it is an FSM anyway) Line 814: mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm, NULL, ctx, LOGL_DEBUG, "FSM MGCP INST"); this string should also be without spaces, again for ctrl interface. https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_vty.c File src/osmo-bsc/osmo_bsc_vty.c: Line 976: struct gsm_network *net = bsc_gsmnet; why create a local var if it is used only once and also is just an alias for another short enough name? -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 00:35:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 00:35:21 +0000 Subject: libosmocore[master]: Replace bitvec_set_uint() with bitvec_set_u64() In-Reply-To: References: Message-ID: Patch Set 1: (6 comments) I'm not certain enough to + or - https://gerrit.osmocom.org/#/c/4337/1/include/osmocom/core/bitvec.h File include/osmocom/core/bitvec.h: Line 61: int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh); should this be accompanied by a bitvec_get_u64()? Line 62: int bitvec_set_uint(struct bitvec *bv, unsigned int in, unsigned int count); we could deprecate it to avoid a function call to bitvec_set_u64() ... or just leave it to the compiler's optimization. https://gerrit.osmocom.org/#/c/4337/1/src/bitvec.c File src/bitvec.c: Line 218: /*! set multiple bits (based on numeric value) at current pos (while at it, let's also add a '.' to end the sentence; best also add '.' at the end of each \param and \returns.) Line 224: int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh) this would be the first implementation to add a use_lh semantic. Why is it needed / why don't the others need it? How did adding an int with L/H work before this? Would it make sense to add such a flag in struct bitvec? Line 235: if (v & ((uint64_t)1 << (num_bits - i - 1))) '1LL' instead of cast? Line 246: /*! set multiple bits (based on numeric value) at current pos ('.' plz) -- To view, visit https://gerrit.osmocom.org/4337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b670dacb55fb3063271d045f9faa10fccba10a6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 00:56:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 00:56:20 +0000 Subject: libosmocore[master]: Add tests for bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (6 comments) I'd +2 after some feedback and that minor formatting fix https://gerrit.osmocom.org/#/c/4336/1/tests/Makefile.am File tests/Makefile.am: Line 14: bits/bitfield_test \ (though I dislike it,) the scheme here is to line up the '\', which you're breaking https://gerrit.osmocom.org/#/c/4336/1/tests/bits/bitfield_test.c File tests/bits/bitfield_test.c: Line 10: #define INTRO(p) do { printf("=== start %s(%u) ===\n", __func__, p); } while(0) heh, if it's one function call, you might as well just omit the semicolon instead of putting a do{}while around it #define FOO(x) printf("foo") Line 15: bool use_lh) this looks to me like it is imitating a "real" function from libosmocore. Is there one? Will it become one? Then we should call that "real" function instead to test it? Line 25: bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ both if paths call identical code? Is it your way of what I did in that osmo-hlr patch with those '#if 0' that I couldn't uphold against your valid arguments? :) Indeed in the test output, both invocations do the same. >From the future: if a following patch changes this, please say so in the commit log or in the fixme comment so I don't spend time trying to figure it out. Line 44: bitvec_write_field(dest, &wp, 0, 1); /* BEP_PERIOD2 not present */ sure are a lot of comments for a 'deadbeef8002231' hex result :) Line 142: printf("\n\n"); does it make sense to move the line feeds into the OUTRO macro? -- To view, visit https://gerrit.osmocom.org/4336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 00:58:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 00:58:13 +0000 Subject: libosmocore[master]: Deprecated bitvec_set_uint() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4338/1/include/osmocom/core/bitvec.h File include/osmocom/core/bitvec.h: Line 62: int bitvec_set_uint(struct bitvec *bv, unsigned int in, unsigned int count) OSMO_DEPRECATED("Use bitvec_set_u64() instead"); ah here we go. Do we really need to though? -- To view, visit https://gerrit.osmocom.org/4338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fd8d17f9fa6c51ef51f4294882cca5944d71df2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 00:59:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 00:59:12 +0000 Subject: libosmocore[master]: Deprecated bitvec_set_uint() In-Reply-To: References: Message-ID: Patch Set 1: re "do we really need to" -- as commented on the other patch, i.e. is it worth the trouble deprecating the thin wrapper, since the additional function call could be left up to the optimizer. -- To view, visit https://gerrit.osmocom.org/4338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fd8d17f9fa6c51ef51f4294882cca5944d71df2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:03:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:03:28 +0000 Subject: libosmocore[master]: Simplify bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9fe27c06125ac52e02e63dcded056a5f1cf68f41 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:05:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:05:45 +0000 Subject: libosmocore[master]: Expand bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 (2 comments) (apologies if I'm asking stupid questions, am not so familiar with this part of the code) https://gerrit.osmocom.org/#/c/4292/4/include/osmocom/core/bitvec.h File include/osmocom/core/bitvec.h: Line 75: int bitvec_write_field_ext(struct bitvec *bv, uint32_t *write_index, uint64_t val, uint8_t len, bool use_lh); can the caller use the new bitvec_set_u64() instead? https://gerrit.osmocom.org/#/c/4292/4/tests/bits/bitfield_test.ok File tests/bits/bitfield_test.ok: Line 12: === total 1 bits differ === is this ok?? -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:07:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:07:23 +0000 Subject: osmo-bsc[master]: bsc_vty: Improve description of mid-call-text cmd In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4349/2/src/osmo-bsc/osmo_bsc_vty.c File src/osmo-bsc/osmo_bsc_vty.c: Line 783: "Set the USSD notification sent to running calls when switching from Grace to Off.\n" (what's "Grace"?) -- To view, visit https://gerrit.osmocom.org/4349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I367b7734390daf39160de6462e9b2210368666f4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:12:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:12:41 +0000 Subject: osmo-bsc[master]: log: als output hexdump of transmitted sccp messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (3 comments) https://gerrit.osmocom.org/#/c/4350/1//COMMIT_MSG Commit Message: Line 7: log: als output hexdump of transmitted sccp messages "als"? Line 12: Also log the hexdump of transmitted sccp messages isn't that saying the same thing twice over? Ah yes, intentionally. https://gerrit.osmocom.org/#/c/4350/1/src/osmo-bsc/osmo_bsc_sigtran.c File src/osmo-bsc/osmo_bsc_sigtran.c: Line 343: LOGP(DMSC, LOGL_DEBUG, "Sending connection (id=%i) oriented data (%s) to MSC: %s\n", I'd prefer putting the hexdump at the end of the line, after "to MSC %s", so you don't have to read the whole line to find the target MSC. -- To view, visit https://gerrit.osmocom.org/4350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:15:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:15:28 +0000 Subject: osmo-bsc[master]: log: als output hexdump of transmitted sccp messages In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4350/1/src/osmo-bsc/osmo_bsc_sigtran.c File src/osmo-bsc/osmo_bsc_sigtran.c: Line 344: conn_id, osmo_hexdump(msg->data, msg->len), osmo_sccp_addr_name(ss7, &msc->a.msc_addr)); > Why not use msgb_hexdump() instead? (if no lNh pointers are set, msgb_hexdump is basically a less optimal version of osmo_hexdump()) -- To view, visit https://gerrit.osmocom.org/4350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:22:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:22:06 +0000 Subject: libosmocore[master]: abis_nm: Add abis_nm_admin_name() API In-Reply-To: References: Message-ID: Patch Set 1: For an example, see rsl_act_type_name() in libosmocore/include/osmocom/gsm/rsl.h > So now > there's the conflict in whether we align with current best > practises or with the style that's used in the file so far. Adding a static inline function to the header for this function alone is what I'd do. (And also publish the _names[] if it's not published yet.) And leave all the rest the way it is, for hysterical raisins. > Also, this is yet another change that will break compilation with > older libosmocore version. For I believe *very* questionable gain. What change will break anything? Aligning the rest of the file to static inline functions? Then let's not? -- To view, visit https://gerrit.osmocom.org/4355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:23:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:23:55 +0000 Subject: osmo-bts[master]: oml: Use new API abis_nm_admin_name In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4357/1/src/common/oml.c File src/common/oml.c: Line 1039: "ADM state already was %s\n", abis_nm_admin_name(adm_state)); that's very cosmetic, hardly worth the bother, is it :) -- To view, visit https://gerrit.osmocom.org/4357 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3a013a924257490d9b26376d96f8e38cdf2cd971 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:25:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:25:18 +0000 Subject: osmo-bts[master]: vty: Use new API abis_nm_admin_name In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4358/1/src/common/vty.c File src/common/vty.c: Line 716: abis_nm_admin_name(nms->administrative), this is a good improvement, write the meaningful name instead of the "arbitrary" enum number. If that other patch isn't merged, let's do it with get_value_string() instead. -- To view, visit https://gerrit.osmocom.org/4358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie41479958d6a57708e4b50705fd85c65f02e4527 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:25:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:25:33 +0000 Subject: osmo-bts[master]: vty: Use new API abis_nm_admin_name In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie41479958d6a57708e4b50705fd85c65f02e4527 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:28:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:28:20 +0000 Subject: osmo-bsc[master]: libbsc: Use abis_nm_admin_name API In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) I guess I'd just leave the existing get_value_string() calls as they are. purely cosmetic. For new patches I'd use the shorter function. https://gerrit.osmocom.org/#/c/4359/1/src/libbsc/bsc_vty.c File src/libbsc/bsc_vty.c: Line 139: abis_nm_admin_name(nms->administrative), I'm confused, didn't I just now see the same patch, only the old state printed a number? -- To view, visit https://gerrit.osmocom.org/4359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2dccebef2f7fc745b845a49d723f5d89fc2baa41 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:40:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:40:45 +0000 Subject: osmo-sgsn[master]: ifdef: fix conditional compiling In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/4369/1//COMMIT_MSG Commit Message: Line 7: ifdef: fix conditional compiling I find the summary too general. Which conditional? what parts of the code? https://gerrit.osmocom.org/#/c/4369/1/src/gprs/gtphub_main.c File src/gprs/gtphub_main.c: Line 122: #endif I'm in two minds what to say now :) In the old VTY code, this would not do. We would have to change the node like osmo_ss7_vty_go_parent() does in its 'default:' case. Since the VTY indenting patch is merged, this will actually work, since the internal vty-go-parent semantics pop a node element from the stack instead of relying on the go_parent cb. Actually the best solution would be to not even register a go_parent_cb in the first place in case of !BUILD_IU -- To view, visit https://gerrit.osmocom.org/4369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c609ef0c344ce825c313335c7e084bf97159262 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:49:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:49:57 +0000 Subject: osmocom-bb[master]: mobile/vty_interface.c: do not write 'exit' to config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73b0f3926d766d21ca68c8e01b7fc70b2b4636c9 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 01:53:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 01:53:31 +0000 Subject: osmocom-bb[master]: mobile/vty_interface.c: do not install default commands In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I82c8d04ccc7dc3f19589a79b859a2c993bd1d39c Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 02:22:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 02:22:13 +0000 Subject: [PATCH] osmo-bsc[master]: osmo-bsc MGCP and RESET FSMs: use distinct struct names Message-ID: Review at https://gerrit.osmocom.org/4375 osmo-bsc MGCP and RESET FSMs: use distinct struct names Make each file use unique struct names; e.g. not 'fsm' in both. They only exist in the static context and it works fine, but the mad fsm-to-dot.py script breaks with identical struct names. Can't hurt to have unique names either. Change-Id: I986377a74ccd83ca3b52e7f058bbc9115f05f741 --- M src/osmo-bsc/osmo_bsc_mgcp.c M src/osmo-bsc/osmo_bsc_reset.c 2 files changed, 27 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/75/4375/1 diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index f2ab3c8..73dd12d 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -43,7 +43,7 @@ extern struct gsm_network *bsc_gsmnet; -enum fsm_states { +enum fsm_bsc_mgcp_states { /* Initalization state to start the FSM */ ST_CRCX_BTS, @@ -66,7 +66,7 @@ ST_HALT, }; -static const struct value_string fsm_state_names[] = { +static const struct value_string fsm_bsc_mgcp_state_names[] = { {ST_CRCX_BTS, "ST_CRCX_BTS (send CRCX for BTS)"}, {ST_ASSIGN_PROC, "ST_ASSIGN_PROC (conntinue assingment)"}, {ST_MDCX_BTS, "ST_MDCX_BTS (send MDCX for BTS)"}, @@ -135,7 +135,7 @@ OSMO_ASSERT(fi); LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s\n", - mgcp_ctx->name, get_value_string(fsm_state_names, fi->state)); + mgcp_ctx->name, get_value_string(fsm_bsc_mgcp_state_names, fi->state)); LOGP(DMGCP, LOGL_ERROR, "(%s) MGCPGW error proceeding request, graceful shutdown...\n", mgcp_ctx->name); @@ -172,7 +172,7 @@ LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", - mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + mgcp_ctx->name, get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); rtp_endpoint = mgcp_client_next_endpoint(mgcp); mgcp_ctx->rtp_endpoint = rtp_endpoint; @@ -256,7 +256,7 @@ LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", - mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + mgcp_ctx->name, get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); /* Bail on teardown */ if (event == EV_TEARDOWN) { @@ -303,7 +303,7 @@ LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", - mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + mgcp_ctx->name, get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); /* Bail on teardown */ if (event == EV_TEARDOWN) { @@ -422,7 +422,7 @@ LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", - mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + mgcp_ctx->name, get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); rtp_endpoint = mgcp_ctx->rtp_endpoint; call_id = conn->conn_id; @@ -524,7 +524,7 @@ LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", - mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + mgcp_ctx->name, get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); /* Bail on teardown */ if (event == EV_TEARDOWN) { @@ -570,7 +570,7 @@ LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", - mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + mgcp_ctx->name, get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); rtp_endpoint = mgcp_ctx->rtp_endpoint; call_id = conn->conn_id; @@ -638,11 +638,11 @@ LOGP(DMSC, LOGL_NOTICE, "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", - mgcp_ctx->name, get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + mgcp_ctx->name, get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) timeout (T%i) in state %s, state machine halted\n", - mgcp_ctx->name, fi->T, get_value_string(fsm_state_names, fi->state)); + mgcp_ctx->name, fi->T, get_value_string(fsm_bsc_mgcp_state_names, fi->state)); /* Send pending sigtran message */ if (mgcp_ctx->resp) { @@ -672,7 +672,7 @@ LOGP(DMGCP, LOGL_ERROR, "MGCPGW: (%s) timeout (T%i) in state %s, attempting graceful teardown...\n", - mgcp_ctx->name, fi->T, get_value_string(fsm_state_names, fi->state)); + mgcp_ctx->name, fi->T, get_value_string(fsm_bsc_mgcp_state_names, fi->state)); /* Ensure that no sigtran response, is present. Otherwiese we might try * to send a sigtran response when the sccp connection is already freed. */ @@ -706,7 +706,7 @@ return 0; } -static struct osmo_fsm_state fsm_states[] = { +static struct osmo_fsm_state fsm_bsc_mgcp_states[] = { /* Startup state machine, send CRCX to BTS. */ [ST_CRCX_BTS] = { @@ -776,10 +776,10 @@ }; /* State machine definition */ -static struct osmo_fsm fsm = { +static struct osmo_fsm fsm_bsc_mgcp = { .name = "FSM MGCP", - .states = fsm_states, - .num_states = ARRAY_SIZE(fsm_states), + .states = fsm_bsc_mgcp_states, + .num_states = ARRAY_SIZE(fsm_bsc_mgcp_states), .log_subsys = DMGCP, .timer_cb = fsm_timeout_cb, }; @@ -803,15 +803,15 @@ OSMO_ASSERT(conn); /* Register the fsm description (if not already done) */ - if (osmo_fsm_find_by_name(fsm.name) != &fsm) - osmo_fsm_register(&fsm); + if (osmo_fsm_find_by_name(fsm_bsc_mgcp.name) != &fsm_bsc_mgcp) + osmo_fsm_register(&fsm_bsc_mgcp); /* Allocate and configure a new fsm instance */ mgcp_ctx = talloc_zero(ctx, struct mgcp_ctx); OSMO_ASSERT(mgcp_ctx); snprintf(mgcp_ctx->name, sizeof(mgcp_ctx->name), "MGCP FSM, id=%i", conn->conn_id); - mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm, NULL, ctx, LOGL_DEBUG, "FSM MGCP INST"); + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm_bsc_mgcp, NULL, ctx, LOGL_DEBUG, "FSM MGCP INST"); OSMO_ASSERT(mgcp_ctx->fsm); mgcp_ctx->fsm->priv = mgcp_ctx; LOGP(DMGCP, LOGL_NOTICE, "MGCPGW: (%s) MGCPGW handler fsm created\n", mgcp_ctx->name); diff --git a/src/osmo-bsc/osmo_bsc_reset.c b/src/osmo-bsc/osmo_bsc_reset.c index d28f548..ba27645 100644 --- a/src/osmo-bsc/osmo_bsc_reset.c +++ b/src/osmo-bsc/osmo_bsc_reset.c @@ -38,7 +38,7 @@ ST_CONN, /* We have a confirmed connection to the MSC */ }; -static const struct value_string fsm_state_names[] = { +static const struct value_string fsm_bsc_reset_state_names[] = { {ST_DISC, "ST_DISC (disconnected)"}, {ST_CONN, "ST_CONN (connected)"}, {0, NULL}, @@ -50,7 +50,7 @@ EV_N_CONNECT, /* made a successful connection */ }; -static const struct value_string fsm_evt_names[] = { +static const struct value_string fsm_bsc_reset_evt_names[] = { {EV_RESET_ACK, "EV_RESET_ACK"}, {EV_N_DISCONNECT, "EV_N_DISCONNECT"}, {EV_N_CONNECT, "EV_N_CONNECT"}, @@ -63,7 +63,7 @@ struct bsc_msc_data *msc = (struct bsc_msc_data *)data; LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC No.: %i\n", - get_value_string(fsm_state_names, ST_DISC), get_value_string(fsm_evt_names, event), msc->nr); + get_value_string(fsm_bsc_reset_state_names, ST_DISC), get_value_string(fsm_bsc_reset_evt_names, event), msc->nr); msc->msc_con->msc_conn_loss_count = 0; osmo_fsm_inst_state_chg(fi, ST_CONN, 0, 0); } @@ -74,7 +74,7 @@ struct bsc_msc_data *msc = (struct bsc_msc_data *)data; LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC No.: %i\n", - get_value_string(fsm_state_names, ST_CONN), get_value_string(fsm_evt_names, event), msc->nr); + get_value_string(fsm_bsc_reset_state_names, ST_CONN), get_value_string(fsm_bsc_reset_evt_names, event), msc->nr); OSMO_ASSERT(msc); @@ -98,7 +98,7 @@ struct bsc_msc_data *msc = (struct bsc_msc_data *)fi->priv; LOGP(DMSC, LOGL_NOTICE, "reset-ack timeout (T%i) in state %s, MSC No.: %i, resending...\n", fi->T, - get_value_string(fsm_state_names, fi->state), msc->nr); + get_value_string(fsm_bsc_reset_state_names, fi->state), msc->nr); osmo_bsc_sigtran_reset(msc); osmo_bsc_sigtran_tx_reset(msc); @@ -123,7 +123,7 @@ }; /* State machine definition */ -static struct osmo_fsm fsm = { +static struct osmo_fsm fsm_bsc_reset = { .name = "FSM RESET", .states = fsm_states, .num_states = ARRAY_SIZE(fsm_states), @@ -137,8 +137,8 @@ OSMO_ASSERT(msc); OSMO_ASSERT(msc->msc_con); - osmo_fsm_register(&fsm); - msc->msc_con->fsm_reset = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, "FSM RESET INST"); + osmo_fsm_register(&fsm_bsc_reset); + msc->msc_con->fsm_reset = osmo_fsm_inst_alloc(&fsm_bsc_reset, NULL, NULL, LOGL_DEBUG, "FSM RESET INST"); OSMO_ASSERT(msc->msc_con->fsm_reset); msc->msc_con->fsm_reset->priv = msc; -- To view, visit https://gerrit.osmocom.org/4375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I986377a74ccd83ca3b52e7f058bbc9115f05f741 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 02:22:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 02:22:13 +0000 Subject: [PATCH] osmo-bsc[master]: osmo-bsc MGCP FSM: catch all unexpected events Message-ID: Review at https://gerrit.osmocom.org/4376 osmo-bsc MGCP FSM: catch all unexpected events Change the error handling for some event handlers to bail on all but the expected successful event. For once this catches any event that might come along unexpectedly (though the FSM code already thwarts unallowed events), and also it fits the fsm-to-dot.py script's magic to interpret the last mentioned event as a state transition cause. Change-Id: I2aea11c476aa91ed5d508ec443ca7c992bda52d9 --- M src/osmo-bsc/osmo_bsc_mgcp.c 1 file changed, 12 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/76/4376/1 diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index 73dd12d..9d38241 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -258,10 +258,12 @@ "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", mgcp_ctx->name, get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); - /* Bail on teardown */ - if (event == EV_TEARDOWN) { + switch (event) { + default: on_error_goto_dlcx(mgcp_ctx); return; + case EV_CRCX_BTS_RESP: + break; } OSMO_ASSERT(conn->conn); @@ -305,10 +307,12 @@ "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", mgcp_ctx->name, get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); - /* Bail on teardown */ - if (event == EV_TEARDOWN) { + switch (event) { + default: on_error_goto_dlcx(mgcp_ctx); return; + case EV_ASS_COMPLETE: + break; } network = mgcp_ctx->network; @@ -526,10 +530,12 @@ "MGCPGW: (%s) fsm-state: %s, fsm-event: %s\n", mgcp_ctx->name, get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); - /* Bail on teardown */ - if (event == EV_TEARDOWN) { + switch (event) { + default: on_error_goto_dlcx(mgcp_ctx); return; + case EV_CRCX_NET_RESP: + break; } lchan = mgcp_ctx->lchan; -- To view, visit https://gerrit.osmocom.org/4376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2aea11c476aa91ed5d508ec443ca7c992bda52d9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 02:23:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 02:23:23 +0000 Subject: osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Patch Set 4: > (I needed to tweak a few things for it to work, will submit those > tweaks separately) (See 4375, 4376) -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 02:24:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 02:24:34 +0000 Subject: [PATCH] libosmocore[master]: contrib/fsm-to-dot.py: some tweaks that help with osmo-bsc's... Message-ID: Review at https://gerrit.osmocom.org/4377 contrib/fsm-to-dot.py: some tweaks that help with osmo-bsc's new FSMs Combine the C source file name and the string name into the fsm's internal name token, and use it in most places instead of the plain struct name: osmo-bsc's new FSMs have identical struct names in each static c context. Output in a file name that includes all of these more detailed name tokens. Also parse '(1 << EVENT)' as event names. Note that besides this patch, there are also some tweaks to the osmo-bsc patch that improve the fsm-to-dot experience... - call fsm-to-dot for single files to avoid name conflicts, or rename each struct as a unique name. - Add comments for the event name a callback is intended for, so that not all transitions are interpreted as TEARDOWN (because it is invoked in common error handling, which causes the script to interpret it as the causing event). (or change the event-checking if into a switch that names the valid event and has a default case for all others.) Change-Id: Ib60df7fd19efc99ba9fe797f14c0e3239c4bea20 --- M contrib/fsm-to-dot.py 1 file changed, 40 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/4377/1 diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py index 3549d1e..06d2df1 100755 --- a/contrib/fsm-to-dot.py +++ b/contrib/fsm-to-dot.py @@ -5,7 +5,7 @@ Usage: ./fsm-to-dot.py ~/openbsc/openbsc/src/libvlr/*.c - for f in *.dot ; do dot -Tpng $f > $f.png; done + for f in *.dot ; do dot -Tpng "$f" > "$f.png"; done # dot comes from 'apt-get install graphviz' Looks for osmo_fsm finite state machine definitions and madly parses .c files @@ -13,7 +13,7 @@ No proper C parsing is done here (pycparser sucked, unfortunately). ''' -import sys, re +import sys, re, os def err(msg): sys.stderr.write(msg + '\n') @@ -63,8 +63,13 @@ return ld re_state_start = re.compile(r'\[([A-Z_][A-Z_0-9]*)\]') -re_event = re.compile(r'S\(([A-Z_][A-Z_0-9]*)\)') +re_event_alternatives = [ + re.compile(r'\(1 *<< *([A-Z_][A-Z_0-9]*)\)'), + re.compile(r'S\(([A-Z_][A-Z_0-9]*)\)'), + ] re_action = re.compile(r'.action *= *([a-z_][a-z_0-9]*)') + +re_insane_dot_name_chars = re.compile('[^a-zA-Z_]') def state_starts(line): m = re_state_start.search(line) @@ -79,7 +84,10 @@ return line.find('out_state_mask') >= 0 def states_or_events(line): - return re_event.findall(line) + results = [] + for one_re in re_event_alternatives: + results.extend(one_re.findall(line)) + return results def parse_action(line): a = re_action.findall(line) @@ -224,13 +232,15 @@ return 'State(name=%r,short_name=%r,out=%d)' % (state.name, state.short_name, len(state.out_edges)) class Fsm: - def __init__(fsm, struct_name, states_struct_name, from_file=None): + def __init__(fsm, struct_name, string_name, states_struct_name, from_file=None): fsm.states = [] fsm.struct_name = struct_name + fsm.string_name = string_name fsm.states_struct_name = states_struct_name fsm.from_file = from_file fsm.action_funcs = set() fsm.event_names = set() + fsm.dot_name = fsm.all_names_sanitized() def parse_states(fsm, src): state = None @@ -462,8 +472,8 @@ edge_action = caller if calling_state.action == edge_action: edge_action = None - calling_fsm.add_special_state(calling_fsm.states, fsm.struct_name, - calling_state, kind=KIND_FSM, edge_action=edge_action, label=label) + calling_fsm.add_special_state(calling_fsm.states, fsm.dot_name, + calling_state, kind=KIND_FSM, edge_action=edge_action, label=' '.join(fsm.all_names())) label = None if calling_state.kind == KIND_STATE: @@ -471,13 +481,13 @@ edge_action = caller if state.action == edge_action: edge_action = None - fsm.add_special_state(fsm.states, calling_fsm.struct_name, None, + fsm.add_special_state(fsm.states, calling_fsm.dot_name, None, state, kind=KIND_FSM, edge_action=edge_action, label=label) # meta overview - meta_called_fsm = fsm_meta.have_state(fsm.struct_name, KIND_FSM) - meta_calling_fsm = fsm_meta.have_state(calling_fsm.struct_name, KIND_FSM) + meta_called_fsm = fsm_meta.have_state(fsm.dot_name, KIND_FSM) + meta_calling_fsm = fsm_meta.have_state(calling_fsm.dot_name, KIND_FSM) meta_calling_fsm.add_out_edge(Edge(meta_called_fsm)) @@ -519,8 +529,23 @@ return '\n'.join(out) + def all_names(fsm): + n = [] + if fsm.from_file: + n.append(os.path.basename(fsm.from_file.path)) + if fsm.struct_name: + n.append(fsm.struct_name) + if fsm.string_name: + n.append(fsm.string_name) + return n + + def all_names_sanitized(fsm, sep='_'): + n = sep.join(fsm.all_names()) + n = re_insane_dot_name_chars.sub('_', n) + return n + def write_dot_file(fsm): - dot_path = '%s.dot' % fsm.struct_name + dot_path = '%s.dot' % ('_'.join(fsm.all_names())) f = open(dot_path, 'w') f.write(fsm.to_dot()) f.close() @@ -528,6 +553,7 @@ re_fsm = re.compile(r'struct osmo_fsm ([a-z_][a-z_0-9]*) =') +re_fsm_string_name = re.compile(r'\bname = "([^"]*)"') re_fsm_states_struct_name = re.compile(r'\bstates = ([a-z_][a-z_0-9]*)\W*,') re_fsm_states = re.compile(r'struct osmo_fsm_state ([a-z_][a-z_0-9]*)\[\] =') re_func = re.compile(r'(\b[a-z_][a-z_0-9]*\b)\([^)]*\)\W*^{', re.MULTILINE) @@ -575,8 +601,9 @@ for m in re_fsm.finditer(c_file.src): struct_name = m.group(1) struct_def = c_file.extract_block('{', '}', m.start()) + string_name = (re_fsm_string_name.findall(struct_def) or [None])[0] states_struct_name = re_fsm_states_struct_name.findall(struct_def)[0] - fsm = Fsm(struct_name, states_struct_name, c_file) + fsm = Fsm(struct_name, string_name, states_struct_name, c_file) fsms.append(fsm) return fsms @@ -694,7 +721,7 @@ fsm.find_event_edges(c_files) fsm.add_fsm_alloc(c_files) -fsm_meta = Fsm("meta", "meta") +fsm_meta = Fsm("meta", None, "meta") for fsm in fsms: fsm.add_cross_fsm_links(fsms, c_files, fsm_meta) -- To view, visit https://gerrit.osmocom.org/4377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib60df7fd19efc99ba9fe797f14c0e3239c4bea20 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 02:25:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 02:25:02 +0000 Subject: osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Patch Set 4: > > (I needed to tweak a few things for it to work, will submit those > > tweaks separately) > > (See 4375, 4376) and 4377 -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 03:02:14 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 23 Oct 2017 03:02:14 +0000 Subject: [MERGED] osmocom-bb[master]: mobile/vty_interface.c: do not install default commands In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: mobile/vty_interface.c: do not install default commands ...................................................................... mobile/vty_interface.c: do not install default commands Since in recent version of libosmocore default commands (such as 'exit' and 'end') are being installed by default, no need to install them twice. This will crash the program. Change-Id: I82c8d04ccc7dc3f19589a79b859a2c993bd1d39c --- M src/host/layer23/src/mobile/vty_interface.c 1 file changed, 0 insertions(+), 50 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index b26d471..9a889e9 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -2777,50 +2777,6 @@ return vty->node; } -/* Down vty node level. */ -gDEFUN(ournode_exit, - ournode_exit_cmd, "exit", "Exit current mode and down to previous mode\n") -{ - switch (vty->node) { - case MS_NODE: - vty->node = CONFIG_NODE; - vty->index = NULL; - break; - case TESTSIM_NODE: - case SUPPORT_NODE: - vty->node = MS_NODE; - break; - default: - break; - } - return CMD_SUCCESS; -} - -/* End of configuration. */ -gDEFUN(ournode_end, - ournode_end_cmd, "end", "End current mode and change to enable mode.") -{ - switch (vty->node) { - case VIEW_NODE: - case ENABLE_NODE: - /* Nothing to do. */ - break; - case CONFIG_NODE: - case VTY_NODE: - case MS_NODE: - case TESTSIM_NODE: - case SUPPORT_NODE: - vty_config_unlock(vty); - vty->node = ENABLE_NODE; - vty->index = NULL; - vty->index_sub = NULL; - break; - default: - break; - } - return CMD_SUCCESS; -} - DEFUN(off, off_cmd, "off", "Turn mobiles off (shutdown) and exit") { @@ -2886,8 +2842,6 @@ install_element(CONFIG_NODE, &cfg_no_ms_cmd); install_node(&ms_node, config_write); install_default(MS_NODE); - install_element(MS_NODE, &ournode_exit_cmd); - install_element(MS_NODE, &ournode_end_cmd); install_element(MS_NODE, &cfg_ms_show_this_cmd); install_element(MS_NODE, &cfg_ms_layer2_cmd); install_element(MS_NODE, &cfg_ms_sap_cmd); @@ -2931,8 +2885,6 @@ install_element(MS_NODE, &cfg_ms_support_cmd); install_node(&support_node, config_write_dummy); install_default(SUPPORT_NODE); - install_element(SUPPORT_NODE, &ournode_exit_cmd); - install_element(SUPPORT_NODE, &ournode_end_cmd); install_element(SUPPORT_NODE, &cfg_ms_sup_dtmf_cmd); install_element(SUPPORT_NODE, &cfg_ms_sup_no_dtmf_cmd); install_element(SUPPORT_NODE, &cfg_ms_sup_sms_cmd); @@ -2989,8 +2941,6 @@ install_element(SUPPORT_NODE, &cfg_ms_sup_no_skip_max_per_band_cmd); install_node(&testsim_node, config_write_dummy); install_default(TESTSIM_NODE); - install_element(TESTSIM_NODE, &ournode_exit_cmd); - install_element(TESTSIM_NODE, &ournode_end_cmd); install_element(TESTSIM_NODE, &cfg_test_imsi_cmd); install_element(TESTSIM_NODE, &cfg_test_ki_xor_cmd); install_element(TESTSIM_NODE, &cfg_test_ki_comp128_cmd); -- To view, visit https://gerrit.osmocom.org/4373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I82c8d04ccc7dc3f19589a79b859a2c993bd1d39c Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Oct 23 03:02:19 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 23 Oct 2017 03:02:19 +0000 Subject: [MERGED] osmocom-bb[master]: mobile/vty_interface.c: do not write 'exit' to config In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: mobile/vty_interface.c: do not write 'exit' to config ...................................................................... mobile/vty_interface.c: do not write 'exit' to config Since we use indenting as means to implicitly exit child nodes, no need to write 'exit' at the end of each child node. Change-Id: I73b0f3926d766d21ca68c8e01b7fc70b2b4636c9 --- M src/host/layer23/src/mobile/vty_interface.c 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 9a889e9..0f321ba 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -1494,7 +1494,6 @@ if (!hide_default || set->skip_max_per_band) vty_out(vty, " %sskip-max-per-band%s", (set->skip_max_per_band) ? "" : "no ", VTY_NEWLINE); - vty_out(vty, " exit%s", VTY_NEWLINE); vty_out(vty, " test-sim%s", VTY_NEWLINE); vty_out(vty, " imsi %s%s", set->test_imsi, VTY_NEWLINE); switch (set->test_ki_type) { @@ -1530,11 +1529,9 @@ vty_out(vty, " hplmn-search %s%s", (set->test_always) ? "everywhere" : "foreign-country", VTY_NEWLINE); - vty_out(vty, " exit%s", VTY_NEWLINE); /* no shutdown must be written to config, because shutdown is default */ vty_out(vty, " %sshutdown%s", (ms->shutdown) ? "" : "no ", VTY_NEWLINE); - vty_out(vty, "exit%s", VTY_NEWLINE); vty_out(vty, "!%s", VTY_NEWLINE); } -- To view, visit https://gerrit.osmocom.org/4374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73b0f3926d766d21ca68c8e01b7fc70b2b4636c9 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Oct 23 05:13:35 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 23 Oct 2017 05:13:35 +0000 Subject: [PATCH] osmocom-bb[master]: mobile: clean up and share example configs Message-ID: Review at https://gerrit.osmocom.org/4378 mobile: clean up and share example configs It is better to have a shared example config files directory, like other Osmocom projects do. Change-Id: I903f31a8afc518ac258cdaeaf76430de07f7edea --- R doc/examples/mobile/default.cfg R doc/examples/mobile/multi_ms.cfg M src/host/layer23/src/mobile/app_mobile.c 3 files changed, 73 insertions(+), 84 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/78/4378/1 diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg b/doc/examples/mobile/default.cfg similarity index 71% rename from src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg rename to doc/examples/mobile/default.cfg index 1aeb3f5..cc81630 100644 --- a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg +++ b/doc/examples/mobile/default.cfg @@ -1,5 +1,5 @@ ! -! OsmocomBB (0.0.0) configuration saved from vty +! OsmocomBB example configuration for mobile application !! ! line vty @@ -14,12 +14,12 @@ ms 1 layer2-socket /tmp/osmocom_l2 sap-socket /tmp/osmocom_sap - sim test + sim reader network-selection-mode auto - imei 123456789012345 0 + imei 000000000000000 0 imei-fixed no emergency-imsi - sms-service-center 123123123 + no sms-service-center no call-waiting no auto-answer no force-rekey @@ -40,9 +40,9 @@ p-gsm e-gsm r-gsm - gsm-850 + no gsm-850 dcs - pcs + no pcs class-900 4 class-850 4 class-dcs 1 @@ -54,14 +54,9 @@ min-rxlev -106 dsc-max 90 no skip-max-per-band - exit test-sim - imsi 901700000000403 - ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef + imsi 001010000000000 + ki comp128 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 no barred-access - rplmn 262 42 0x0001 - hplmn-search everywhere - exit + rplmn 001 01 no shutdown -exit -! diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg b/doc/examples/mobile/multi_ms.cfg similarity index 63% rename from src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg rename to doc/examples/mobile/multi_ms.cfg index 0c9ada4..bef2406 100644 --- a/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg +++ b/doc/examples/mobile/multi_ms.cfg @@ -1,5 +1,5 @@ ! -! OsmocomBB (0.0.0) configuration saved from vty +! OsmocomBB example configuration for mobile application !! ! line vty @@ -11,15 +11,15 @@ ! no hide-default ! -ms 1 - layer2-socket /tmp/osmocom_l2 - sap-socket /tmp/osmocom_sap - sim test +ms one + layer2-socket /tmp/osmocom_l2.one + sap-socket /tmp/osmocom_sap.one + sim reader network-selection-mode auto - imei 123456789012345 0 + imei 000000000000000 0 imei-fixed no emergency-imsi - sms-service-center 123123123 + no sms-service-center no call-waiting no auto-answer no force-rekey @@ -40,9 +40,9 @@ p-gsm e-gsm r-gsm - gsm-850 + no gsm-850 dcs - pcs + no pcs class-900 4 class-850 4 class-dcs 1 @@ -54,67 +54,59 @@ min-rxlev -106 dsc-max 90 no skip-max-per-band - exit test-sim - imsi 901700000000403 - ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef - barred-access - rplmn 262 42 0x0001 - hplmn-search everywhere - exit + imsi 001010000000001 + ki comp128 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + no barred-access + rplmn 001 01 no shutdown -exit -ms 2 - layer2-socket /tmp/osmocom_l2_NR2 - sap-socket /tmp/osmocom_sap_NR2 - sim test - network-selection-mode auto - imei 123456789012346 0 - imei-fixed - no emergency-imsi - sms-service-center 123123123 - no call-waiting - no auto-answer - no force-rekey - no clip - no clir - tx-power auto - no simulated-delay - no stick - location-updating - neighbour-measurement - codec full-speed prefer - codec half-speed - no abbrev - support - sms - a5/1 - a5/2 - p-gsm - e-gsm - r-gsm - gsm-850 - dcs - pcs - class-900 4 - class-850 4 - class-dcs 1 - class-pcs 1 - channel-capability sdcch+tchf+tchh - full-speech-v1 - full-speech-v2 - half-speech-v1 - min-rxlev -106 - dsc-max 90 - no skip-max-per-band - exit - test-sim - imsi 901700000000404 - ki comp128 11 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef - barred-access - rplmn 262 42 0x0001 - hplmn-search everywhere - exit - no shutdown -exit ! +ms two + layer2-socket /tmp/osmocom_l2.two + sap-socket /tmp/osmocom_sap.two + sim reader + network-selection-mode auto + imei 000000000000000 0 + imei-fixed + no emergency-imsi + no sms-service-center + no call-waiting + no auto-answer + no force-rekey + no clip + no clir + tx-power auto + no simulated-delay + no stick + location-updating + neighbour-measurement + codec full-speed prefer + codec half-speed + no abbrev + support + sms + a5/1 + a5/2 + p-gsm + e-gsm + r-gsm + no gsm-850 + dcs + no pcs + class-900 4 + class-850 4 + class-dcs 1 + class-pcs 1 + channel-capability sdcch+tchf+tchh + full-speech-v1 + full-speech-v2 + half-speech-v1 + min-rxlev -106 + dsc-max 90 + no skip-max-per-band + test-sim + imsi 001010000000002 + ki comp128 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff + no barred-access + rplmn 001 01 + no shutdown diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index fd2c94f..f44d94c 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -407,6 +407,8 @@ " '%s'\n", config_file); fprintf(stderr, "Please check or create config file" " using: 'touch %s'\n", config_file); + fprintf(stderr, "Either use one from " + "'doc/examples/mobile/'\n"); return rc; } printf("Using configuration from %s\n", config_file); -- To view, visit https://gerrit.osmocom.org/4378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I903f31a8afc518ac258cdaeaf76430de07f7edea Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Oct 23 07:51:56 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 23 Oct 2017 07:51:56 +0000 Subject: [PATCH] libosmocore[master]: socket: add function osmo_sock_local_ip() to query local ip In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4372 to look at the new patch set (#2). socket: add function osmo_sock_local_ip() to query local ip In some cases it is required to know the ip-address of the interface through that a given remote IP-Address can be reached. Add function osmo_sock_local_ip() to determine the local ip-address for a given remote ip-address Change-Id: I2988cc52b196fc8476703d1287e24cb4a48491c2 --- M include/osmocom/core/socket.h M src/socket.c 2 files changed, 55 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/4372/2 diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index ebfcab3..47d9f30 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -57,4 +57,6 @@ int osmo_sock_mcast_all_set(int fd, bool enable); int osmo_sock_mcast_subscribe(int fd, const char *grp_addr); +int osmo_sock_local_ip(char *local_ip, const char *remote_ip); + /*! @} */ diff --git a/src/socket.c b/src/socket.c index 457c991..b516abf 100644 --- a/src/socket.c +++ b/src/socket.c @@ -784,6 +784,59 @@ } } +/*! Determine the matching local IP-address for a given remote IP-Address. + * \param[out] local_ip caller provided memory for resulting local IP-address + * \param[in] remote_ip remote IP-address + * \param[in] fd file descriptor of related scoket + * \returns 0 on success; negative otherwise + * + * The function accepts IPv4 and IPv6 address strings. The caller must provide + * at least INET6_ADDRSTRLEN bytes for local_ip if an IPv6 is expected as + * as result. For IPv4 addresses the required amount is INET_ADDRSTRLEN. */ +int osmo_sock_local_ip(char *local_ip, const char *remote_ip) +{ + int sfd; + int rc; + struct addrinfo addrinfo_hint; + struct addrinfo *addrinfo = NULL; + struct sockaddr_in local_addr; + socklen_t local_addr_len; + uint16_t family; + + /* Find out the address family (AF_INET or AF_INET6?) */ + memset(&addrinfo_hint, '\0', sizeof(addrinfo_hint)); + addrinfo_hint.ai_family = PF_UNSPEC; + addrinfo_hint.ai_flags = AI_NUMERICHOST; + rc = getaddrinfo(remote_ip, NULL, &addrinfo_hint, &addrinfo); + if (rc) + return -EINVAL; + family = addrinfo->ai_family; + freeaddrinfo(addrinfo); + + /* Connect a dummy socket to trick the kernel into determining the + * ip-address of the interface that would be used if we would send + * out an actual packet */ + sfd = osmo_sock_init2(family, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, remote_ip, 0, OSMO_SOCK_F_CONNECT); + if (sfd < 0) + return -EINVAL; + + /* Request the IP address of the interface that the kernel has + * actually choosen. */ + memset(&local_addr, 0, sizeof(local_addr)); + local_addr_len = sizeof(local_addr); + rc = getsockname(sfd, (struct sockaddr *)&local_addr, &local_addr_len); + if (rc < 0) + return -EINVAL; + if (local_addr.sin_family == AF_INET) + strncpy(local_ip, inet_ntoa(local_addr.sin_addr), INET_ADDRSTRLEN); + else if (local_addr.sin_family == AF_INET6) + strncpy(local_ip, inet_ntoa(local_addr.sin_addr), INET6_ADDRSTRLEN); + else + return -EINVAL; + + return 0; +} + #endif /* HAVE_SYS_SOCKET_H */ /*! @} */ -- To view, visit https://gerrit.osmocom.org/4372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2988cc52b196fc8476703d1287e24cb4a48491c2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 23 08:39:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 08:39:42 +0000 Subject: [MERGED] libosmocore[master]: GPRS: log NS socket In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: GPRS: log NS socket ...................................................................... GPRS: log NS socket Let's log NS UDP socket creation similar to the way we log it for telnet and ctrl interfaces. Change-Id: Ic9d0f94ab2c1bb33f67cd4f1c9236b64108c0bb6 --- M src/gb/gprs_ns.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index d20ed23..7443a8b 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1580,6 +1580,7 @@ "Failed to set the DSCP to %d with ret(%d) errno(%d)\n", nsi->nsip.dscp, ret, errno); + LOGP(DNS, LOGL_NOTICE, "NS UDP socket at %s:%d\n", inet_ntoa(in), nsi->nsip.local_port); return ret; } -- To view, visit https://gerrit.osmocom.org/4370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic9d0f94ab2c1bb33f67cd4f1c9236b64108c0bb6 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 23 08:44:34 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 08:44:34 +0000 Subject: osmo-bsc[master]: bsc_vty: Improve description of mid-call-text cmd In-Reply-To: References: Message-ID: Patch Set 2: > (1 comment) Grace period. When the BTS is set to locked through administrative means, it will delay so for for a few time for current active calls and send a USSD message with "mid-call-text" as content, which usually should specify that the call is going to be terminated soon for whatever reason. -- To view, visit https://gerrit.osmocom.org/4349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I367b7734390daf39160de6462e9b2210368666f4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 08:46:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 08:46:15 +0000 Subject: osmo-bsc[master]: libbsc: Use abis_nm_admin_name API In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4359/1/src/libbsc/bsc_vty.c File src/libbsc/bsc_vty.c: Line 139: abis_nm_admin_name(nms->administrative), > I'm confused, didn't I just now see the same patch, only the old state prin One is in BTS VTY, the other one is in BSC VTY. -- To view, visit https://gerrit.osmocom.org/4359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2dccebef2f7fc745b845a49d723f5d89fc2baa41 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 08:47:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 08:47:35 +0000 Subject: libosmocore[master]: socket: add function osmo_sock_local_ip() to query local ip In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2988cc52b196fc8476703d1287e24cb4a48491c2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 08:47:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 08:47:39 +0000 Subject: [MERGED] libosmocore[master]: socket: add function osmo_sock_local_ip() to query local ip In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: socket: add function osmo_sock_local_ip() to query local ip ...................................................................... socket: add function osmo_sock_local_ip() to query local ip In some cases it is required to know the ip-address of the interface through that a given remote IP-Address can be reached. Add function osmo_sock_local_ip() to determine the local ip-address for a given remote ip-address Change-Id: I2988cc52b196fc8476703d1287e24cb4a48491c2 --- M include/osmocom/core/socket.h M src/socket.c 2 files changed, 55 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index ebfcab3..47d9f30 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -57,4 +57,6 @@ int osmo_sock_mcast_all_set(int fd, bool enable); int osmo_sock_mcast_subscribe(int fd, const char *grp_addr); +int osmo_sock_local_ip(char *local_ip, const char *remote_ip); + /*! @} */ diff --git a/src/socket.c b/src/socket.c index 457c991..b516abf 100644 --- a/src/socket.c +++ b/src/socket.c @@ -784,6 +784,59 @@ } } +/*! Determine the matching local IP-address for a given remote IP-Address. + * \param[out] local_ip caller provided memory for resulting local IP-address + * \param[in] remote_ip remote IP-address + * \param[in] fd file descriptor of related scoket + * \returns 0 on success; negative otherwise + * + * The function accepts IPv4 and IPv6 address strings. The caller must provide + * at least INET6_ADDRSTRLEN bytes for local_ip if an IPv6 is expected as + * as result. For IPv4 addresses the required amount is INET_ADDRSTRLEN. */ +int osmo_sock_local_ip(char *local_ip, const char *remote_ip) +{ + int sfd; + int rc; + struct addrinfo addrinfo_hint; + struct addrinfo *addrinfo = NULL; + struct sockaddr_in local_addr; + socklen_t local_addr_len; + uint16_t family; + + /* Find out the address family (AF_INET or AF_INET6?) */ + memset(&addrinfo_hint, '\0', sizeof(addrinfo_hint)); + addrinfo_hint.ai_family = PF_UNSPEC; + addrinfo_hint.ai_flags = AI_NUMERICHOST; + rc = getaddrinfo(remote_ip, NULL, &addrinfo_hint, &addrinfo); + if (rc) + return -EINVAL; + family = addrinfo->ai_family; + freeaddrinfo(addrinfo); + + /* Connect a dummy socket to trick the kernel into determining the + * ip-address of the interface that would be used if we would send + * out an actual packet */ + sfd = osmo_sock_init2(family, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, remote_ip, 0, OSMO_SOCK_F_CONNECT); + if (sfd < 0) + return -EINVAL; + + /* Request the IP address of the interface that the kernel has + * actually choosen. */ + memset(&local_addr, 0, sizeof(local_addr)); + local_addr_len = sizeof(local_addr); + rc = getsockname(sfd, (struct sockaddr *)&local_addr, &local_addr_len); + if (rc < 0) + return -EINVAL; + if (local_addr.sin_family == AF_INET) + strncpy(local_ip, inet_ntoa(local_addr.sin_addr), INET_ADDRSTRLEN); + else if (local_addr.sin_family == AF_INET6) + strncpy(local_ip, inet_ntoa(local_addr.sin_addr), INET6_ADDRSTRLEN); + else + return -EINVAL; + + return 0; +} + #endif /* HAVE_SYS_SOCKET_H */ /*! @} */ -- To view, visit https://gerrit.osmocom.org/4372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2988cc52b196fc8476703d1287e24cb4a48491c2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 23 08:48:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 08:48:18 +0000 Subject: osmo-bsc[master]: bsc_vty: Improve description of mid-call-text cmd In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I367b7734390daf39160de6462e9b2210368666f4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 08:49:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 08:49:46 +0000 Subject: osmocom-bb[master]: mobile: clean up and share example configs In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4378/1/src/host/layer23/src/mobile/app_mobile.c File src/host/layer23/src/mobile/app_mobile.c: Line 410: fprintf(stderr, "Either use one from " I don't think you can use "Either" here. Let's say "or use one from ..." [in lowercase, as no new sentence starts] -- To view, visit https://gerrit.osmocom.org/4378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I903f31a8afc518ac258cdaeaf76430de07f7edea Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 08:50:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 08:50:23 +0000 Subject: libosmocore[master]: contrib/fsm-to-dot.py: some tweaks that help with osmo-bsc's... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib60df7fd19efc99ba9fe797f14c0e3239c4bea20 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 08:52:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 08:52:03 +0000 Subject: osmo-bsc[master]: osmo-bsc MGCP and RESET FSMs: use distinct struct names In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/4375/1/src/osmo-bsc/osmo_bsc_reset.c File src/osmo-bsc/osmo_bsc_reset.c: PS1, Line 127: FSM RESET there's again a space in the name. not part of this patch, i know. We have to stop this nightmare *sigh*. Guess I need to get my patches merged which would make libosmocore reject illegal names at runtime. -- To view, visit https://gerrit.osmocom.org/4375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I986377a74ccd83ca3b52e7f058bbc9115f05f741 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 08:52:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 08:52:37 +0000 Subject: osmo-bsc[master]: osmo-bsc MGCP FSM: catch all unexpected events In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2aea11c476aa91ed5d508ec443ca7c992bda52d9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 08:55:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 23 Oct 2017 08:55:21 +0000 Subject: osmo-mgw[master]: mgcp: move port/timeslot calculator to mgcp_common.h In-Reply-To: References: Message-ID: Patch Set 6: > Please clarify, does the new MGW need this at all? Is this only for > bsc-nat? So far I thought the new MGW allocates ports as it sees > fit and communicates the right port numbers back to the client(s), > hence these functions would not be needed. No, the new MGW does not make use of these functions. How do we proceed now? Remove them from mgcp_common.h again and put them into a separate file in mgcp_client? -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 09:49:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 09:49:08 +0000 Subject: libosmocore[master]: ctrl: allow more nodes than those in enum ctrl_node_type In-Reply-To: References: Message-ID: Patch Set 3: wouldn't it make more sense for the application simply to provide the number of it's onw nodes? As far as I understand your current patch, the total number of nodes including those of the library has to be specified, which may be a bit odd? -- To view, visit https://gerrit.osmocom.org/4305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bd62ae0d4eefde7e1517db15a2155640a1bab58 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 09:49:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 09:49:49 +0000 Subject: osmo-hlr[master]: implement subscriber vty interface, tests In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 09:51:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 09:51:00 +0000 Subject: osmo-hlr[master]: implement subscriber vty interface, tests In-Reply-To: References: Message-ID: Patch Set 3: > (1 comment) my point was about a non-static buffer like a malloc'ed or talloc'ed "char *" as opposed to "char buf[12] where it's not possible to know the size. -- To view, visit https://gerrit.osmocom.org/4273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 09:51:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 09:51:46 +0000 Subject: osmo-hlr[master]: implement subscriber vty interface, tests In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 so yes, this can be merged. but [osmo_]hexdump_buf cannot go to libosmocore for the reason I stated. -- To view, visit https://gerrit.osmocom.org/4273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 09:53:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 09:53:09 +0000 Subject: osmo-hlr[master]: replace ctrl_test_runner.py with transcript test_subscriber.... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff93abe370b8f3ecf42082d1d0eaa1fbeca5b122 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 09:56:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 09:56:54 +0000 Subject: [PATCH] libosmocore[master]: Add tests for bitvec_write_field() In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4336 to look at the new patch set (#2). Add tests for bitvec_write_field() This function is actively used by OsmoPCU but have not been covered by tests so far. The test code is based on Minh-Quang Nguyen submission with some modifications. The test's FIXME will be addressed in follow-up patches. Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Related: OS#1526 --- M tests/Makefile.am A tests/bits/bitfield_test.c A tests/bits/bitfield_test.ok M tests/testsuite.at 4 files changed, 211 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/4336/2 diff --git a/tests/Makefile.am b/tests/Makefile.am index dbe349f..7fb9a7b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -11,6 +11,7 @@ loggingrb/loggingrb_test strrb/strrb_test \ comp128/comp128_test smscb/gsm0341_test \ bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \ + bits/bitfield_test \ tlv/tlv_test gsup/gsup_test oap/oap_test fsm/fsm_test \ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ @@ -76,6 +77,9 @@ bits_bitcomp_test_SOURCES = bits/bitcomp_test.c bits_bitcomp_test_LDADD = $(top_builddir)/src/libosmocore.la + +bits_bitfield_test_SOURCES = bits/bitfield_test.c +bits_bitfield_test_LDADD = $(top_builddir)/src/libosmocore.la conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c conv_conv_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libgsmint.la @@ -232,7 +236,7 @@ vty/ok_more_spaces.cfg \ vty/ok_tabs_and_spaces.cfg \ vty/ok_tabs.cfg \ - comp128/comp128_test.ok \ + comp128/comp128_test.ok bits/bitfield_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \ diff --git a/tests/bits/bitfield_test.c b/tests/bits/bitfield_test.c new file mode 100644 index 0000000..e67f457 --- /dev/null +++ b/tests/bits/bitfield_test.c @@ -0,0 +1,164 @@ +#include +#include +#include +#include + +#include +#include +#include + +#define INTRO(p) printf("=== start %s(%u) ===\n", __func__, p) +#define OUTRO(p) printf("=== end %s(%u) ===\n\n", __func__, p) + +static void test_bitvec_ia_octet_encode_pkt_dl_ass(struct bitvec *dest, uint32_t ttli, + uint8_t tfi, uint8_t gamma, uint8_t ta_valid, uint8_t ws_enc, + bool use_lh) +{ + unsigned wp = 0; + + INTRO(use_lh); + + /* 3GPP TS 44.018 ?10.5.2.16 IA Rest Octets */ + if (use_lh) /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + else + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field(dest, &wp, 1, 2); /* "01" Packet Downlink Assignment */ + bitvec_write_field(dest, &wp, ttli, 32); /* TLLI */ + bitvec_write_field(dest, &wp, 1, 1); /* switch TFI: on */ + bitvec_write_field(dest, &wp, tfi, 5); /* TFI */ + bitvec_write_field(dest, &wp, 0x0, 1); /* RLC acknowledged mode */ + bitvec_write_field(dest, &wp, 0x0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + bitvec_write_field(dest, &wp, 0,1); /* Polling Bit: off */ + bitvec_write_field(dest, &wp, ta_valid, 1); /* N. B: NOT related to TAI! */ + bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ + bitvec_write_field(dest, &wp, 0, 1); /* TBF Starting TIME present */ + bitvec_write_field(dest, &wp, 0, 1); /* P0 not present */ + if (use_lh) { /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + } else + bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + bitvec_write_field(dest, &wp, ws_enc, 5); /* EGPRS Window Size */ + bitvec_write_field(dest, &wp, 0, 2); /* LINK_QUALITY_MEASUREMENT_MODE */ + bitvec_write_field(dest, &wp, 0, 1); /* BEP_PERIOD2 not present */ + + printf("Encoded PKT DL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); + + OUTRO(use_lh); +} + +static void test_bitvec_ia_octet_encode_pkt_ul_ass(struct bitvec *dest, uint32_t fn, + uint8_t tfi, uint8_t gamma, uint8_t usf, bool tbf, bool use_lh) +{ + unsigned wp = 0; + + INTRO(use_lh); + + /* 3GPP TS 44.018 ?10.5.2.37b 10.5.2.16 */ + if (use_lh) /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + else + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field(dest, &wp, 0, 2); /* "0" Packet Uplink Assignment */ + if (!tbf) { + bitvec_write_field(dest, &wp, 0, 1); /* Block Allocation: SBA */ + bitvec_write_field(dest, &wp, 0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ + bitvec_write_field(dest, &wp, 1, 1); /* TBF_STARTING_TIME_FLAG */ + bitvec_write_field(dest, &wp, (fn / (26 * 51)) % 32, 5); /* T1' */ + bitvec_write_field(dest, &wp, fn % 51, 6); /* T3 */ + bitvec_write_field(dest, &wp, fn % 26, 5); /* T2 */ + } else { + bitvec_write_field(dest, &wp, 1, 1); /* Block Allocation: Not SBA */ + bitvec_write_field(dest, &wp, tfi, 5); /* TFI_ASSIGNMENT */ + bitvec_write_field(dest, &wp, 0, 1); /* POLLING = none */ + bitvec_write_field(dest, &wp, 0, 1); /* ALLOCATION_TYPE: dynamic */ + bitvec_write_field(dest, &wp, usf, 3); /* USF */ + bitvec_write_field(dest, &wp, 0, 1); /* USF_GRANULARITY */ + bitvec_write_field(dest, &wp, 0, 1); /* "0" power control: Not Present */ + bitvec_write_field(dest, &wp, 0, 2); /* CHANNEL_CODING_COMMAND */ + bitvec_write_field(dest, &wp, 1, 1); /* TLLI_BLOCK_CHANNEL_CODING */ + bitvec_write_field(dest, &wp, 0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + /* note: there is no choise for TAI and no starting time */ + bitvec_write_field(dest, &wp, 0, 1); /* switch TIMING_ADVANCE_INDEX = off */ + bitvec_write_field(dest, &wp, 0, 1); /* TBF_STARTING_TIME_FLAG */ + } + + printf("Encoded PKT UL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); + + OUTRO(use_lh); +} + +static void test_bitdiff(const struct bitvec *src1, const struct bitvec *src2, unsigned len) +{ + unsigned int bit_err = 0, i, j; + uint8_t byte_err = 0; + + INTRO(len); + + for (i = 0; i < len; i++) { + /* byte compare */ + byte_err = src1->data[i] ^ src2->data[i]; + if (byte_err) + for (j = 0; j < 8; j++) + bit_err += (byte_err >> j) & 0x01; /* count bits which differ */ + } + + + printf("=== total %u bits differ ===\n", bit_err); + + OUTRO(len); +} + +static inline buf_init(struct bitvec *dest, struct bitvec *dest_lh) +{ + /* initialize buffer */ + bitvec_unhex(dest, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + bitvec_unhex(dest_lh, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); +} + +static inline test_enc_ul_ass(struct bitvec *dest, struct bitvec *dest_lh, uint32_t fn, + uint8_t tfi, uint8_t gamma, uint8_t usf, bool tbf) +{ + buf_init(dest, dest_lh); + + test_bitvec_ia_octet_encode_pkt_ul_ass(dest, fn, tfi, gamma, usf, tbf, false); + test_bitvec_ia_octet_encode_pkt_ul_ass(dest_lh, fn, tfi, gamma, usf, tbf, true); + + test_bitdiff(dest, dest_lh, 22); +} + +int main(int argc, char **argv) +{ + void *tall_pcu_ctx; + struct bitvec *dest, *dest_lh; + uint8_t gamma = 0, ta_valid = 1, ws_enc = 3, usf = 1, tfi = 0; /* Temporary Flow Identity */ + uint32_t ttli = 0xdeadbeef, fn = 1234; + + tall_pcu_ctx = talloc_named_const(NULL, 1, "bitvecTest context"); + if (!tall_pcu_ctx) + return EXIT_FAILURE; + + dest = bitvec_alloc(22, tall_pcu_ctx); + dest_lh = bitvec_alloc(22, tall_pcu_ctx); + + buf_init(dest, dest_lh); + + test_bitvec_ia_octet_encode_pkt_dl_ass(dest, ttli, tfi, gamma, ta_valid, ws_enc, false); + test_bitvec_ia_octet_encode_pkt_dl_ass(dest_lh, ttli, tfi, gamma, ta_valid, ws_enc, true); + + test_bitdiff(dest, dest_lh, 22); + + test_enc_ul_ass(dest, dest_lh, fn, tfi, gamma, usf, false); + test_enc_ul_ass(dest, dest_lh, fn, tfi, gamma, usf, true); + + bitvec_free(dest); + bitvec_free(dest_lh); + + talloc_free(tall_pcu_ctx); + + return EXIT_SUCCESS; +} diff --git a/tests/bits/bitfield_test.ok b/tests/bits/bitfield_test.ok new file mode 100644 index 0000000..5cb2500 --- /dev/null +++ b/tests/bits/bitfield_test.ok @@ -0,0 +1,36 @@ +=== start test_bitvec_ia_octet_encode_pkt_dl_ass(0) === +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_dl_ass(0) === + +=== start test_bitvec_ia_octet_encode_pkt_dl_ass(1) === +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_dl_ass(1) === + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(0) === +Encoded PKT UL ASS IA Rest Octets: c0 08 0a 63 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(0) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(1) === +Encoded PKT UL ASS IA Rest Octets: c0 08 0a 63 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(1) === + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(0) === +Encoded PKT UL ASS IA Rest Octets: c8 02 10 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(0) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(1) === +Encoded PKT UL ASS IA Rest Octets: c8 02 10 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(1) === + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === + diff --git a/tests/testsuite.at b/tests/testsuite.at index 483860f..4a59b22 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -45,6 +45,12 @@ AT_CHECK([$abs_top_builddir/tests/bits/bitcomp_test], [0], [expout]) AT_CLEANUP +AT_SETUP([bitfield]) +AT_KEYWORDS([bitfield]) +cat $abs_srcdir/bits/bitfield_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/bits/bitfield_test], [0], [expout]) +AT_CLEANUP + AT_SETUP([conv]) AT_KEYWORDS([conv]) cat $abs_srcdir/conv/conv_test.ok > expout -- To view, visit https://gerrit.osmocom.org/4336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 09:56:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 09:56:54 +0000 Subject: [PATCH] libosmocore[master]: Replace bitvec_set_uint() with bitvec_set_u64() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4337 to look at the new patch set (#2). Replace bitvec_set_uint() with bitvec_set_u64() Old bitvec_set_uint() uses "unsigned int" as input parameter which length is not guaranteed. It does not allow to specify which bit_value to set and does not check for incorrect length. Overall this makes it harder to re-use and more error-prone. Let's replace it with extended implementation which uses fixed type length parameters and extra checks. The additional parameter allows caller to explicitly indicate the need to use L/H instead of 0/1 for bit vector elements. It's necessary to properly encode some of the messages from 3GPP TS 44.018, for example ?10.5.2.16 IA Rest Octets. The old function is left for backward compatibility as a tiny wrapper around new function and will be deprecated in follow-up patches. Change-Id: I1b670dacb55fb3063271d045f9faa10fccba10a6 Related: OS#1526 --- M include/osmocom/core/bitvec.h M src/bitvec.c 2 files changed, 28 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/4337/2 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index d4c7d68..19466ab 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -28,6 +28,7 @@ #include #include +#include #include /*! A single GSM bit @@ -57,6 +58,7 @@ int bitvec_set_bit(struct bitvec *bv, enum bit_value bit); int bitvec_get_bit_high(struct bitvec *bv); int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count); +int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh); int bitvec_set_uint(struct bitvec *bv, unsigned int in, unsigned int count); int bitvec_get_uint(struct bitvec *bv, unsigned int num_bits); int bitvec_find_bit_pos(const struct bitvec *bv, unsigned int n, enum bit_value val); diff --git a/src/bitvec.c b/src/bitvec.c index f07b42c..24049cd 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -215,24 +215,41 @@ return 0; } -/*! set multiple bits (based on numeric value) at current pos - * \return 0 in case of success; negative in case of error */ -int bitvec_set_uint(struct bitvec *bv, unsigned int ui, unsigned int num_bits) +/*! set multiple bits (based on numeric value) at current pos. + * \param[in] bv bit vector. + * \param[in] v mask representing which bits needs to be set. + * \param[in] num_bits number of meaningful bits in the mask. + * \param[in] use_lh whether to interpret the bits as L/H values or as 0/1. + * \return 0 on success; negative in case of error. */ +int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh) { - int rc; - unsigned i; + uint8_t i; + + if (num_bits > 64) + return -E2BIG; + for (i = 0; i < num_bits; i++) { - int bit = 0; - if (ui & (1u << (num_bits - i - 1))) - bit = 1; + int rc; + enum bit_value bit = use_lh ? L : 0; + + if (v & ((uint64_t)1 << (num_bits - i - 1))) + bit = use_lh ? H : 1; + rc = bitvec_set_bit(bv, bit); - if (rc) + if (rc != 0) return rc; } return 0; } +/*! set multiple bits (based on numeric value) at current pos. + * \return 0 in case of success; negative in case of error. */ +int bitvec_set_uint(struct bitvec *bv, unsigned int ui, unsigned int num_bits) +{ + return bitvec_set_u64(bv, ui, num_bits, false); +} + /*! get multiple bits (num_bits) from beginning of vector (MSB side) * \return 16bit signed integer retrieved from bit vector */ int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits) -- To view, visit https://gerrit.osmocom.org/4337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1b670dacb55fb3063271d045f9faa10fccba10a6 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 09:56:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 09:56:54 +0000 Subject: [PATCH] libosmocore[master]: Expand bitvec_write_field() In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Minh-Quang Nguyen, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4292 to look at the new patch set (#5). Expand bitvec_write_field() Previously only boolean values were allowed while in practice it's sometimes necessary to use L/H. Allow user to specify this explicitly and make old function into wrapper around extended version. Use extended function in tests and update output accordingly. Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Related: OS#1526 --- M include/osmocom/core/bitvec.h M src/bitvec.c M tests/bits/bitfield_test.c M tests/bits/bitfield_test.ok 4 files changed, 22 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/4292/5 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 3e68ddb..b7eba1f 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -72,6 +72,7 @@ unsigned int bitvec_unpack(struct bitvec *bv, const uint8_t *buffer); uint64_t bitvec_read_field(struct bitvec *bv, unsigned int *read_index, unsigned int len); int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len); +int bitvec_write_field_ext(struct bitvec *bv, uint32_t *write_index, uint64_t val, uint8_t len, bool use_lh); int bitvec_fill(struct bitvec *bv, unsigned int num_bits, enum bit_value fill); char bit_value_to_char(enum bit_value v); void bitvec_to_string_r(const struct bitvec *bv, char *str); diff --git a/src/bitvec.c b/src/bitvec.c index 282158e..2dec4f9 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -500,16 +500,18 @@ /*! write into the vector * \param[in] bv The boolean vector to work on * \param[in,out] write_index Where writing supposed to start in the vector + * \param[in] val value to be written to the vector * \param[in] len How many bits to write + * \param[in] use_lh whether to interpret the bits as L/H values or as 0/1 * \returns next write index or negative value on error */ -int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) +int bitvec_write_field_ext(struct bitvec *bv, uint32_t *write_index, uint64_t val, uint8_t len, bool use_lh) { int rc; bv->cur_bit = *write_index; - rc = bitvec_set_u64(bv, val, len, false); + rc = bitvec_set_u64(bv, val, len, use_lh); if (rc != 0) return rc; @@ -518,6 +520,18 @@ return 0; } +/*! write into the vector + * \param[in] bv The boolean vector to work on + * \param[in,out] write_index Where writing supposed to start in the vector + * \param[in] val value to be written to the vector + * \param[in] len How many bits to write + * \returns next write index or negative value on error + */ +int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) +{ + return bitvec_write_field_ext(bv, (uint32_t *)write_index, val, len, false); +} + /*! convert enum to corresponding character * \param v input value (bit) * \return single character, either 0, 1, L or H */ diff --git a/tests/bits/bitfield_test.c b/tests/bits/bitfield_test.c index e67f457..72cc499 100644 --- a/tests/bits/bitfield_test.c +++ b/tests/bits/bitfield_test.c @@ -19,10 +19,7 @@ INTRO(use_lh); /* 3GPP TS 44.018 ?10.5.2.16 IA Rest Octets */ - if (use_lh) /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ - else - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field_ext(dest, &wp, 3, 2, use_lh); /* "HH" */ bitvec_write_field(dest, &wp, 1, 2); /* "01" Packet Downlink Assignment */ bitvec_write_field(dest, &wp, ttli, 32); /* TLLI */ bitvec_write_field(dest, &wp, 1, 1); /* switch TFI: on */ @@ -35,10 +32,7 @@ bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ bitvec_write_field(dest, &wp, 0, 1); /* TBF Starting TIME present */ bitvec_write_field(dest, &wp, 0, 1); /* P0 not present */ - if (use_lh) { /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ - } else - bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + bitvec_write_field_ext(dest, &wp, 1, 1, use_lh); /* "H" - additional for R99 */ bitvec_write_field(dest, &wp, ws_enc, 5); /* EGPRS Window Size */ bitvec_write_field(dest, &wp, 0, 2); /* LINK_QUALITY_MEASUREMENT_MODE */ bitvec_write_field(dest, &wp, 0, 1); /* BEP_PERIOD2 not present */ @@ -56,10 +50,7 @@ INTRO(use_lh); /* 3GPP TS 44.018 ?10.5.2.37b 10.5.2.16 */ - if (use_lh) /* FIXME: add function to encode LH properly */ - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ - else - bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field_ext(dest, &wp, 3, 2, use_lh); /* "HH" */ bitvec_write_field(dest, &wp, 0, 2); /* "0" Packet Uplink Assignment */ if (!tbf) { bitvec_write_field(dest, &wp, 0, 1); /* Block Allocation: SBA */ diff --git a/tests/bits/bitfield_test.ok b/tests/bits/bitfield_test.ok index 5cb2500..a86598f 100644 --- a/tests/bits/bitfield_test.ok +++ b/tests/bits/bitfield_test.ok @@ -3,11 +3,11 @@ === end test_bitvec_ia_octet_encode_pkt_dl_ass(0) === === start test_bitvec_ia_octet_encode_pkt_dl_ass(1) === -Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 20 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b === end test_bitvec_ia_octet_encode_pkt_dl_ass(1) === === start test_bitdiff(22) === -=== total 0 bits differ === +=== total 1 bits differ === === end test_bitdiff(22) === === start test_bitvec_ia_octet_encode_pkt_ul_ass(0) === -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 10:01:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 10:01:12 +0000 Subject: libosmocore[master]: abis_nm: Add abis_nm_admin_name() API In-Reply-To: References: Message-ID: Patch Set 1: > What change will break anything? Aligning the rest of the file to > static inline functions? Then let's not? This change will break building against older libosmocore versions without a good reason to do so. The new abis_nm_admin_name() function (whether inline or real function) will not be present in older libraries. We have to stop breaking API compatibility all the time for no good reason. I don't think this is one. -- To view, visit https://gerrit.osmocom.org/4355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 10:03:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 10:03:14 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 2: > Maybe this patch should include the LIBVERSION bump, and making a > semantic release with signed tag needs to happen after the merge? very good idea. Let's do it that way. -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 10:04:55 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 10:04:55 +0000 Subject: [PATCH] libosmocore[master]: Add tests for bitvec_write_field() In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4336 to look at the new patch set (#3). Add tests for bitvec_write_field() This function is actively used by OsmoPCU but have not been covered by tests so far. The test code is based on Minh-Quang Nguyen submission with some modifications. The test's FIXME will be addressed in follow-up patches. Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Related: OS#1526 --- M tests/Makefile.am A tests/bits/bitfield_test.c A tests/bits/bitfield_test.ok M tests/testsuite.at 4 files changed, 211 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/4336/3 diff --git a/tests/Makefile.am b/tests/Makefile.am index dbe349f..7fb9a7b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -11,6 +11,7 @@ loggingrb/loggingrb_test strrb/strrb_test \ comp128/comp128_test smscb/gsm0341_test \ bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \ + bits/bitfield_test \ tlv/tlv_test gsup/gsup_test oap/oap_test fsm/fsm_test \ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ @@ -76,6 +77,9 @@ bits_bitcomp_test_SOURCES = bits/bitcomp_test.c bits_bitcomp_test_LDADD = $(top_builddir)/src/libosmocore.la + +bits_bitfield_test_SOURCES = bits/bitfield_test.c +bits_bitfield_test_LDADD = $(top_builddir)/src/libosmocore.la conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c conv_conv_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libgsmint.la @@ -232,7 +236,7 @@ vty/ok_more_spaces.cfg \ vty/ok_tabs_and_spaces.cfg \ vty/ok_tabs.cfg \ - comp128/comp128_test.ok \ + comp128/comp128_test.ok bits/bitfield_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \ diff --git a/tests/bits/bitfield_test.c b/tests/bits/bitfield_test.c new file mode 100644 index 0000000..d6653e3 --- /dev/null +++ b/tests/bits/bitfield_test.c @@ -0,0 +1,164 @@ +#include +#include +#include +#include + +#include +#include +#include + +#define INTRO(p) printf("=== start %s(%u) ===\n", __func__, p) +#define OUTRO(p) printf("=== end %s(%u) ===\n\n", __func__, p) + +static void test_bitvec_ia_octet_encode_pkt_dl_ass(struct bitvec *dest, uint32_t ttli, + uint8_t tfi, uint8_t gamma, uint8_t ta_valid, uint8_t ws_enc, + bool use_lh) +{ + unsigned wp = 0; + + INTRO(use_lh); + + /* 3GPP TS 44.018 ?10.5.2.16 IA Rest Octets */ + if (use_lh) /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + else + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field(dest, &wp, 1, 2); /* "01" Packet Downlink Assignment */ + bitvec_write_field(dest, &wp, ttli, 32); /* TLLI */ + bitvec_write_field(dest, &wp, 1, 1); /* switch TFI: on */ + bitvec_write_field(dest, &wp, tfi, 5); /* TFI */ + bitvec_write_field(dest, &wp, 0x0, 1); /* RLC acknowledged mode */ + bitvec_write_field(dest, &wp, 0x0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + bitvec_write_field(dest, &wp, 0,1); /* Polling Bit: off */ + bitvec_write_field(dest, &wp, ta_valid, 1); /* N. B: NOT related to TAI! */ + bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ + bitvec_write_field(dest, &wp, 0, 1); /* TBF Starting TIME present */ + bitvec_write_field(dest, &wp, 0, 1); /* P0 not present */ + if (use_lh) { /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + } else + bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + bitvec_write_field(dest, &wp, ws_enc, 5); /* EGPRS Window Size */ + bitvec_write_field(dest, &wp, 0, 2); /* LINK_QUALITY_MEASUREMENT_MODE */ + bitvec_write_field(dest, &wp, 0, 1); /* BEP_PERIOD2 not present */ + + printf("Encoded PKT DL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); + + OUTRO(use_lh); +} + +static void test_bitvec_ia_octet_encode_pkt_ul_ass(struct bitvec *dest, uint32_t fn, + uint8_t tfi, uint8_t gamma, uint8_t usf, bool tbf, bool use_lh) +{ + unsigned wp = 0; + + INTRO(use_lh); + + /* 3GPP TS 44.018 ?10.5.2.37b 10.5.2.16 */ + if (use_lh) /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + else + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field(dest, &wp, 0, 2); /* "0" Packet Uplink Assignment */ + if (!tbf) { + bitvec_write_field(dest, &wp, 0, 1); /* Block Allocation: SBA */ + bitvec_write_field(dest, &wp, 0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ + bitvec_write_field(dest, &wp, 1, 1); /* TBF_STARTING_TIME_FLAG */ + bitvec_write_field(dest, &wp, (fn / (26 * 51)) % 32, 5); /* T1' */ + bitvec_write_field(dest, &wp, fn % 51, 6); /* T3 */ + bitvec_write_field(dest, &wp, fn % 26, 5); /* T2 */ + } else { + bitvec_write_field(dest, &wp, 1, 1); /* Block Allocation: Not SBA */ + bitvec_write_field(dest, &wp, tfi, 5); /* TFI_ASSIGNMENT */ + bitvec_write_field(dest, &wp, 0, 1); /* POLLING = none */ + bitvec_write_field(dest, &wp, 0, 1); /* ALLOCATION_TYPE: dynamic */ + bitvec_write_field(dest, &wp, usf, 3); /* USF */ + bitvec_write_field(dest, &wp, 0, 1); /* USF_GRANULARITY */ + bitvec_write_field(dest, &wp, 0, 1); /* "0" power control: Not Present */ + bitvec_write_field(dest, &wp, 0, 2); /* CHANNEL_CODING_COMMAND */ + bitvec_write_field(dest, &wp, 1, 1); /* TLLI_BLOCK_CHANNEL_CODING */ + bitvec_write_field(dest, &wp, 0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + /* note: there is no choise for TAI and no starting time */ + bitvec_write_field(dest, &wp, 0, 1); /* switch TIMING_ADVANCE_INDEX = off */ + bitvec_write_field(dest, &wp, 0, 1); /* TBF_STARTING_TIME_FLAG */ + } + + printf("Encoded PKT UL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); + + OUTRO(use_lh); +} + +static void test_bitdiff(const struct bitvec *src1, const struct bitvec *src2, unsigned len) +{ + unsigned int bit_err = 0, i, j; + uint8_t byte_err = 0; + + INTRO(len); + + for (i = 0; i < len; i++) { + /* byte compare */ + byte_err = src1->data[i] ^ src2->data[i]; + if (byte_err) + for (j = 0; j < 8; j++) + bit_err += (byte_err >> j) & 0x01; /* count bits which differ */ + } + + + printf("=== total %u bits differ ===\n", bit_err); + + OUTRO(len); +} + +static inline void buf_init(struct bitvec *dest, struct bitvec *dest_lh) +{ + /* initialize buffer */ + bitvec_unhex(dest, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + bitvec_unhex(dest_lh, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); +} + +static inline void test_enc_ul_ass(struct bitvec *dest, struct bitvec *dest_lh, uint32_t fn, + uint8_t tfi, uint8_t gamma, uint8_t usf, bool tbf) +{ + buf_init(dest, dest_lh); + + test_bitvec_ia_octet_encode_pkt_ul_ass(dest, fn, tfi, gamma, usf, tbf, false); + test_bitvec_ia_octet_encode_pkt_ul_ass(dest_lh, fn, tfi, gamma, usf, tbf, true); + + test_bitdiff(dest, dest_lh, 22); +} + +int main(int argc, char **argv) +{ + void *tall_pcu_ctx; + struct bitvec *dest, *dest_lh; + uint8_t gamma = 0, ta_valid = 1, ws_enc = 3, usf = 1, tfi = 0; /* Temporary Flow Identity */ + uint32_t ttli = 0xdeadbeef, fn = 1234; + + tall_pcu_ctx = talloc_named_const(NULL, 1, "bitvecTest context"); + if (!tall_pcu_ctx) + return EXIT_FAILURE; + + dest = bitvec_alloc(22, tall_pcu_ctx); + dest_lh = bitvec_alloc(22, tall_pcu_ctx); + + buf_init(dest, dest_lh); + + test_bitvec_ia_octet_encode_pkt_dl_ass(dest, ttli, tfi, gamma, ta_valid, ws_enc, false); + test_bitvec_ia_octet_encode_pkt_dl_ass(dest_lh, ttli, tfi, gamma, ta_valid, ws_enc, true); + + test_bitdiff(dest, dest_lh, 22); + + test_enc_ul_ass(dest, dest_lh, fn, tfi, gamma, usf, false); + test_enc_ul_ass(dest, dest_lh, fn, tfi, gamma, usf, true); + + bitvec_free(dest); + bitvec_free(dest_lh); + + talloc_free(tall_pcu_ctx); + + return EXIT_SUCCESS; +} diff --git a/tests/bits/bitfield_test.ok b/tests/bits/bitfield_test.ok new file mode 100644 index 0000000..5cb2500 --- /dev/null +++ b/tests/bits/bitfield_test.ok @@ -0,0 +1,36 @@ +=== start test_bitvec_ia_octet_encode_pkt_dl_ass(0) === +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_dl_ass(0) === + +=== start test_bitvec_ia_octet_encode_pkt_dl_ass(1) === +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_dl_ass(1) === + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(0) === +Encoded PKT UL ASS IA Rest Octets: c0 08 0a 63 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(0) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(1) === +Encoded PKT UL ASS IA Rest Octets: c0 08 0a 63 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(1) === + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(0) === +Encoded PKT UL ASS IA Rest Octets: c8 02 10 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(0) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(1) === +Encoded PKT UL ASS IA Rest Octets: c8 02 10 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(1) === + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === + diff --git a/tests/testsuite.at b/tests/testsuite.at index 483860f..4a59b22 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -45,6 +45,12 @@ AT_CHECK([$abs_top_builddir/tests/bits/bitcomp_test], [0], [expout]) AT_CLEANUP +AT_SETUP([bitfield]) +AT_KEYWORDS([bitfield]) +cat $abs_srcdir/bits/bitfield_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/bits/bitfield_test], [0], [expout]) +AT_CLEANUP + AT_SETUP([conv]) AT_KEYWORDS([conv]) cat $abs_srcdir/conv/conv_test.ok > expout -- To view, visit https://gerrit.osmocom.org/4336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 10:11:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 10:11:01 +0000 Subject: libosmocore[master]: Add tests for bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 3: > this looks to me like it is imitating a "real" function from libosmocore. It's not. There's similar code in OsmoPCU. > Is there one? No. > Will it become one? I don't see the need for it unless we'll introduce similar code somewhere besides OsmoPCU. Maybe in some distant future when we'll add GPRS support to OsmocomBB. -- To view, visit https://gerrit.osmocom.org/4336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 10:11:31 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 10:11:31 +0000 Subject: libosmocore[master]: abis_nm: Add abis_nm_admin_name() API In-Reply-To: References: Message-ID: Patch Set 1: > > What change will break anything? Aligning the rest of the file to > > static inline functions? Then let's not? > > This change will break building against older libosmocore versions > without a good reason to do so. The new abis_nm_admin_name() > function (whether inline or real function) will not be present in > older libraries. > > We have to stop breaking API compatibility all the time for no good > reason. I don't think this is one. One could argue that this patch can then be merged at some point in the future when we add/modify a new API required for osmo-bts/bsc. I'm not really for or against merging it, but I think it's confusing having an API to get names for availability and operational state but having none for administrative ones, so I bet I won't be the last one losing time with this kind of confusions. -- To view, visit https://gerrit.osmocom.org/4355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 10:15:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 10:15:15 +0000 Subject: libosmocore[master]: Replace bitvec_set_uint() with bitvec_set_u64() In-Reply-To: References: Message-ID: Patch Set 3: > should this be accompanied by a bitvec_get_u64()? I have not needed it so far, but feel free to follow-up with the patch if you feel like it. > Would it make sense to add such a flag in struct bitvec? Certainly not. The message can be a mix of 0/1/L/H. > '1LL' instead of cast? I think explicit cast is easier to read and it illustrates better what's the intention for this code. -- To view, visit https://gerrit.osmocom.org/4337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b670dacb55fb3063271d045f9faa10fccba10a6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 10:17:21 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 10:17:21 +0000 Subject: libosmocore[master]: Deprecated bitvec_set_uint() In-Reply-To: References: Message-ID: Patch Set 3: > is it worth the trouble deprecating the thin wrapper I think yes. This patch series is triggered by a subtle bug due to wrong 0/1 encoding used where L/H should have been. Deprecation might help us to revisit corresponding code and check if we have similar issues in some other place. -- To view, visit https://gerrit.osmocom.org/4338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fd8d17f9fa6c51ef51f4294882cca5944d71df2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 10:23:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 10:23:23 +0000 Subject: libosmocore[master]: Expand bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) If I understood the issue correctly, than this 1-bit difference is what's required (the absence of it caused the issue). Minh? > can the caller use the new bitvec_set_u64() instead? Yes, and I think eventually we should. But this would require massive change to OsmoPCU encoding routines which I think is better to postpone till we have better test coverage and GPRS-related test automation. https://gerrit.osmocom.org/#/c/4292/4/tests/bits/bitfield_test.ok File tests/bits/bitfield_test.ok: Line 12: === total 1 bits differ === > is this ok?? Yes, that's the whole point of this patch series. -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 10:26:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 10:26:26 +0000 Subject: libosmocore[master]: abis_nm: Add abis_nm_admin_name() API In-Reply-To: References: Message-ID: Patch Set 1: ok, then let's add it as static inline function here, but don't apply all the patches using it for the time being. -- To view, visit https://gerrit.osmocom.org/4355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 10:28:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 10:28:10 +0000 Subject: libosmocore[master]: Cleanup jenkins build scripts In-Reply-To: References: Message-ID: Patch Set 4: > have you checked that the jenkins build job running this cleans up the workspace? I've look through web-ui and it seems ok but I might have missed smth. What would be the right way to do this? > An alternative if you really dislike 'rm -rf' would be 'git clean -dxf'? Sounds good to me. -- To view, visit https://gerrit.osmocom.org/3132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 11:41:48 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 23 Oct 2017 11:41:48 +0000 Subject: [PATCH] osmocom-bb[master]: mobile: clean up and share example configs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4378 to look at the new patch set (#2). mobile: clean up and share example configs It is better to have a shared example config files directory, like other Osmocom projects do. Change-Id: I903f31a8afc518ac258cdaeaf76430de07f7edea --- R doc/examples/mobile/default.cfg R doc/examples/mobile/multi_ms.cfg M src/host/layer23/src/mobile/app_mobile.c 3 files changed, 73 insertions(+), 84 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/78/4378/2 diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg b/doc/examples/mobile/default.cfg similarity index 71% rename from src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg rename to doc/examples/mobile/default.cfg index 1aeb3f5..cc81630 100644 --- a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg +++ b/doc/examples/mobile/default.cfg @@ -1,5 +1,5 @@ ! -! OsmocomBB (0.0.0) configuration saved from vty +! OsmocomBB example configuration for mobile application !! ! line vty @@ -14,12 +14,12 @@ ms 1 layer2-socket /tmp/osmocom_l2 sap-socket /tmp/osmocom_sap - sim test + sim reader network-selection-mode auto - imei 123456789012345 0 + imei 000000000000000 0 imei-fixed no emergency-imsi - sms-service-center 123123123 + no sms-service-center no call-waiting no auto-answer no force-rekey @@ -40,9 +40,9 @@ p-gsm e-gsm r-gsm - gsm-850 + no gsm-850 dcs - pcs + no pcs class-900 4 class-850 4 class-dcs 1 @@ -54,14 +54,9 @@ min-rxlev -106 dsc-max 90 no skip-max-per-band - exit test-sim - imsi 901700000000403 - ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef + imsi 001010000000000 + ki comp128 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 no barred-access - rplmn 262 42 0x0001 - hplmn-search everywhere - exit + rplmn 001 01 no shutdown -exit -! diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg b/doc/examples/mobile/multi_ms.cfg similarity index 63% rename from src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg rename to doc/examples/mobile/multi_ms.cfg index 0c9ada4..bef2406 100644 --- a/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg +++ b/doc/examples/mobile/multi_ms.cfg @@ -1,5 +1,5 @@ ! -! OsmocomBB (0.0.0) configuration saved from vty +! OsmocomBB example configuration for mobile application !! ! line vty @@ -11,15 +11,15 @@ ! no hide-default ! -ms 1 - layer2-socket /tmp/osmocom_l2 - sap-socket /tmp/osmocom_sap - sim test +ms one + layer2-socket /tmp/osmocom_l2.one + sap-socket /tmp/osmocom_sap.one + sim reader network-selection-mode auto - imei 123456789012345 0 + imei 000000000000000 0 imei-fixed no emergency-imsi - sms-service-center 123123123 + no sms-service-center no call-waiting no auto-answer no force-rekey @@ -40,9 +40,9 @@ p-gsm e-gsm r-gsm - gsm-850 + no gsm-850 dcs - pcs + no pcs class-900 4 class-850 4 class-dcs 1 @@ -54,67 +54,59 @@ min-rxlev -106 dsc-max 90 no skip-max-per-band - exit test-sim - imsi 901700000000403 - ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef - barred-access - rplmn 262 42 0x0001 - hplmn-search everywhere - exit + imsi 001010000000001 + ki comp128 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + no barred-access + rplmn 001 01 no shutdown -exit -ms 2 - layer2-socket /tmp/osmocom_l2_NR2 - sap-socket /tmp/osmocom_sap_NR2 - sim test - network-selection-mode auto - imei 123456789012346 0 - imei-fixed - no emergency-imsi - sms-service-center 123123123 - no call-waiting - no auto-answer - no force-rekey - no clip - no clir - tx-power auto - no simulated-delay - no stick - location-updating - neighbour-measurement - codec full-speed prefer - codec half-speed - no abbrev - support - sms - a5/1 - a5/2 - p-gsm - e-gsm - r-gsm - gsm-850 - dcs - pcs - class-900 4 - class-850 4 - class-dcs 1 - class-pcs 1 - channel-capability sdcch+tchf+tchh - full-speech-v1 - full-speech-v2 - half-speech-v1 - min-rxlev -106 - dsc-max 90 - no skip-max-per-band - exit - test-sim - imsi 901700000000404 - ki comp128 11 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef - barred-access - rplmn 262 42 0x0001 - hplmn-search everywhere - exit - no shutdown -exit ! +ms two + layer2-socket /tmp/osmocom_l2.two + sap-socket /tmp/osmocom_sap.two + sim reader + network-selection-mode auto + imei 000000000000000 0 + imei-fixed + no emergency-imsi + no sms-service-center + no call-waiting + no auto-answer + no force-rekey + no clip + no clir + tx-power auto + no simulated-delay + no stick + location-updating + neighbour-measurement + codec full-speed prefer + codec half-speed + no abbrev + support + sms + a5/1 + a5/2 + p-gsm + e-gsm + r-gsm + no gsm-850 + dcs + no pcs + class-900 4 + class-850 4 + class-dcs 1 + class-pcs 1 + channel-capability sdcch+tchf+tchh + full-speech-v1 + full-speech-v2 + half-speech-v1 + min-rxlev -106 + dsc-max 90 + no skip-max-per-band + test-sim + imsi 001010000000002 + ki comp128 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff + no barred-access + rplmn 001 01 + no shutdown diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index fd2c94f..ecf9820 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -407,6 +407,8 @@ " '%s'\n", config_file); fprintf(stderr, "Please check or create config file" " using: 'touch %s'\n", config_file); + fprintf(stderr, "or use one from " + "'doc/examples/mobile/'\n"); return rc; } printf("Using configuration from %s\n", config_file); -- To view, visit https://gerrit.osmocom.org/4378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I903f31a8afc518ac258cdaeaf76430de07f7edea Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 23 11:42:18 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 23 Oct 2017 11:42:18 +0000 Subject: osmocom-bb[master]: mobile: clean up and share example configs In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) Thanks! https://gerrit.osmocom.org/#/c/4378/1/src/host/layer23/src/mobile/app_mobile.c File src/host/layer23/src/mobile/app_mobile.c: Line 410: fprintf(stderr, "Either use one from " > I don't think you can use "Either" here. Let's say "or use one from ..." [ Done -- To view, visit https://gerrit.osmocom.org/4378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I903f31a8afc518ac258cdaeaf76430de07f7edea Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:17:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:17:00 +0000 Subject: osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Patch Set 4: (if you agree, we could merge 4375 and 4376 into this patch) -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:18:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:18:21 +0000 Subject: osmo-bsc[master]: osmo-bsc MGCP and RESET FSMs: use distinct struct names In-Reply-To: References: Message-ID: Patch Set 1: > space in the name I think it would be nice to merge this patch into dexter's 4334, submitted this mostly to share code I guess. -- To view, visit https://gerrit.osmocom.org/4375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I986377a74ccd83ca3b52e7f058bbc9115f05f741 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:19:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:19:59 +0000 Subject: osmo-hlr[master]: implement subscriber vty interface, tests In-Reply-To: References: Message-ID: Patch Set 3: > so yes, this can be merged. but [osmo_]hexdump_buf cannot go to > libosmocore for the reason I stated. yes, exactly / agreed -- To view, visit https://gerrit.osmocom.org/4273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:20:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:20:05 +0000 Subject: [MERGED] osmo-hlr[master]: implement subscriber vty interface, tests In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: implement subscriber vty interface, tests ...................................................................... implement subscriber vty interface, tests Implement VTY commands for subscriber manipulation: - create / delete subscriber - modify MSISDN - add/edit/remove 2G and 3G authentication data - show by IMSI, MSISDN or DB ID. (enable/disable CS/PS and purge/unpurge to follow later.) Implement VTY unit tests for the new commands using new osmo_verify_transcript_vty.py from osmo-python-tests. Depends: libosmocore I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 osmo-python-tests Id47331009910e651372b9c9c76e12f2e8964cc2c Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 --- M src/Makefile.am M src/hlr_vty.c A src/hlr_vty_subscr.c A src/hlr_vty_subscr.h M tests/Makefile.am A tests/test_subscriber.vty 6 files changed, 859 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/Makefile.am b/src/Makefile.am index b410ff3..fc7c653 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,6 +23,7 @@ rand.h \ ctrl.h \ hlr_vty.h \ + hlr_vty_subscr.h \ $(NULL) bin_PROGRAMS = \ @@ -46,6 +47,7 @@ logging.c \ rand_urandom.c \ hlr_vty.c \ + hlr_vty_subscr.c \ $(NULL) osmo_hlr_LDADD = \ diff --git a/src/hlr_vty.c b/src/hlr_vty.c index 946117e..a5eb26f 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -26,6 +26,7 @@ #include #include "hlr_vty.h" +#include "hlr_vty_subscr.h" static struct hlr *g_hlr = NULL; @@ -135,4 +136,6 @@ install_default(GSUP_NODE); install_element(GSUP_NODE, &cfg_hlr_gsup_bind_ip_cmd); + + hlr_vty_subscriber_init(hlr); } diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c new file mode 100644 index 0000000..5704922 --- /dev/null +++ b/src/hlr_vty_subscr.c @@ -0,0 +1,484 @@ +/* OsmoHLR subscriber management VTY implementation */ +/* (C) 2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "hlr.h" +#include "db.h" + +struct vty; + +#define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) + +static struct hlr *g_hlr = NULL; + +static void subscr_dump_full_vty(struct vty *vty, struct hlr_subscriber *subscr) +{ + int rc; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + + vty_out(vty, " ID: %"PRIu64"%s", subscr->id, VTY_NEWLINE); + + vty_out(vty, " IMSI: %s%s", subscr->imsi ? subscr->imsi : "none", VTY_NEWLINE); + vty_out(vty, " MSISDN: %s%s", *subscr->msisdn ? subscr->msisdn : "none", VTY_NEWLINE); + if (*subscr->vlr_number) + vty_out(vty, " VLR number: %s%s", subscr->vlr_number, VTY_NEWLINE); + if (*subscr->sgsn_number) + vty_out(vty, " SGSN number: %s%s", subscr->sgsn_number, VTY_NEWLINE); + if (*subscr->sgsn_address) + vty_out(vty, " SGSN address: %s%s", subscr->sgsn_address, VTY_NEWLINE); + if (subscr->periodic_lu_timer) + vty_out(vty, " Periodic LU timer: %u%s", subscr->periodic_lu_timer, VTY_NEWLINE); + if (subscr->periodic_rau_tau_timer) + vty_out(vty, " Periodic RAU/TAU timer: %u%s", subscr->periodic_rau_tau_timer, VTY_NEWLINE); + if (subscr->lmsi) + vty_out(vty, " LMSI: %x%s", subscr->lmsi, VTY_NEWLINE); + if (!subscr->nam_cs) + vty_out(vty, " CS disabled%s", VTY_NEWLINE); + if (subscr->ms_purged_cs) + vty_out(vty, " CS purged%s", VTY_NEWLINE); + if (!subscr->nam_ps) + vty_out(vty, " PS disabled%s", VTY_NEWLINE); + if (subscr->ms_purged_ps) + vty_out(vty, " PS purged%s", VTY_NEWLINE); + + if (!*subscr->imsi) + return; + + OSMO_ASSERT(g_hlr); + rc = db_get_auth_data(g_hlr->dbc, subscr->imsi, &aud2g, &aud3g, NULL); + + if (rc) { + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else { + vty_out(vty, "%% Error retrieving data from database (%d)%s", rc, VTY_NEWLINE); + return; + } + } + + if (aud2g.type != OSMO_AUTH_TYPE_NONE && aud2g.type != OSMO_AUTH_TYPE_GSM) { + vty_out(vty, "%% Error: 2G auth data is not of type 'GSM'%s", VTY_NEWLINE); + aud2g = (struct osmo_sub_auth_data){}; + } + + if (aud3g.type != OSMO_AUTH_TYPE_NONE && aud3g.type != OSMO_AUTH_TYPE_UMTS) { + vty_out(vty, "%% Error: 3G auth data is not of type 'UMTS'%s", VTY_NEWLINE); + aud3g = (struct osmo_sub_auth_data){}; + } + + if (aud2g.algo != OSMO_AUTH_ALG_NONE && aud2g.type != OSMO_AUTH_TYPE_NONE) { + vty_out(vty, " 2G auth: %s%s", + osmo_auth_alg_name(aud2g.algo), VTY_NEWLINE); + vty_out(vty, " KI=%s%s", + hexdump_buf(aud2g.u.gsm.ki), VTY_NEWLINE); + } + + if (aud3g.algo != OSMO_AUTH_ALG_NONE && aud3g.type != OSMO_AUTH_TYPE_NONE) { + vty_out(vty, " 3G auth: %s%s", osmo_auth_alg_name(aud3g.algo), VTY_NEWLINE); + vty_out(vty, " K=%s%s", hexdump_buf(aud3g.u.umts.k), VTY_NEWLINE); + vty_out(vty, " %s=%s%s", aud3g.u.umts.opc_is_op? "OP" : "OPC", + hexdump_buf(aud3g.u.umts.opc), VTY_NEWLINE); + vty_out(vty, " IND-bitlen=%u", aud3g.u.umts.ind_bitlen); + if (aud3g.u.umts.sqn) + vty_out(vty, " last-SQN=%"PRIu64, aud3g.u.umts.sqn); + vty_out(vty, VTY_NEWLINE); + } +} + +static int get_subscr_by_argv(struct vty *vty, const char *type, const char *id, struct hlr_subscriber *subscr) +{ + int rc = -1; + if (strcmp(type, "imsi") == 0) + rc = db_subscr_get_by_imsi(g_hlr->dbc, id, subscr); + else if (strcmp(type, "msisdn") == 0) + rc = db_subscr_get_by_msisdn(g_hlr->dbc, id, subscr); + else if (strcmp(type, "id") == 0) + rc = db_subscr_get_by_id(g_hlr->dbc, atoll(id), subscr); + if (rc) + vty_out(vty, "%% No subscriber for %s = '%s'%s", + type, id, VTY_NEWLINE); + return rc; +} + +#define SUBSCR_CMD "subscriber " +#define SUBSCR_CMD_HELP "Subscriber management commands\n" + +#define SUBSCR_ID "(imsi|msisdn|id) IDENT " +#define SUBSCR_ID_HELP \ + "Identify subscriber by IMSI\n" \ + "Identify subscriber by MSISDN (phone number)\n" \ + "Identify subscriber by database ID\n" \ + "IMSI/MSISDN/ID of the subscriber\n" + +#define SUBSCR SUBSCR_CMD SUBSCR_ID +#define SUBSCR_HELP SUBSCR_CMD_HELP SUBSCR_ID_HELP + +#define SUBSCR_UPDATE SUBSCR "update " +#define SUBSCR_UPDATE_HELP SUBSCR_HELP "Set or update subscriber data\n" + +DEFUN(subscriber_show, + subscriber_show_cmd, + SUBSCR "show", + SUBSCR_HELP "Show subscriber information\n") +{ + struct hlr_subscriber subscr; + const char *id_type = argv[0]; + const char *id = argv[1]; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + subscr_dump_full_vty(vty, &subscr); + return CMD_SUCCESS; +} + +DEFUN(subscriber_create, + subscriber_create_cmd, + SUBSCR_CMD "imsi IDENT create", + SUBSCR_CMD_HELP + "Create subscriber by IMSI\n" + "IMSI/MSISDN/ID of the subscriber\n") +{ + int rc; + struct hlr_subscriber subscr; + const char *imsi = argv[0]; + + if (!osmo_imsi_str_valid(imsi)) { + vty_out(vty, "%% Not a valid IMSI: %s%s", imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + rc = db_subscr_create(g_hlr->dbc, imsi); + + if (rc) { + if (rc == -EEXIST) + vty_out(vty, "%% Subscriber already exists for IMSI = %s%s", + imsi, VTY_NEWLINE); + else + vty_out(vty, "%% Error (rc=%d): cannot create subscriber for IMSI = %s%s", + rc, imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + rc = db_subscr_get_by_imsi(g_hlr->dbc, imsi, &subscr); + vty_out(vty, "%% Created subscriber %s%s", imsi, VTY_NEWLINE); + + subscr_dump_full_vty(vty, &subscr); + + return CMD_SUCCESS; +} + +DEFUN(subscriber_delete, + subscriber_delete_cmd, + SUBSCR "delete", + SUBSCR_HELP "Delete subscriber from database\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + + /* Find out the IMSI regardless of which way the caller decided to + * identify the subscriber by. */ + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_delete_by_id(g_hlr->dbc, subscr.id); + if (rc) { + vty_out(vty, "%% Error: Failed to remove subscriber for IMSI '%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% Deleted subscriber for IMSI '%s'%s", subscr.imsi, VTY_NEWLINE); + return CMD_SUCCESS; +} + +DEFUN(subscriber_msisdn, + subscriber_msisdn_cmd, + SUBSCR_UPDATE "msisdn MSISDN", + SUBSCR_UPDATE_HELP + "Set MSISDN (phone number) of the subscriber\n" + "New MSISDN (phone number)\n") +{ + struct hlr_subscriber subscr; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *msisdn = argv[2]; + + if (strlen(msisdn) > sizeof(subscr.msisdn) - 1) { + vty_out(vty, "%% MSISDN is too long, max. %zu characters are allowed%s", + sizeof(subscr.msisdn)-1, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!osmo_msisdn_str_valid(msisdn)) { + vty_out(vty, "%% MSISDN invalid: '%s'%s", msisdn, VTY_NEWLINE); + return CMD_WARNING; + } + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + if (db_subscr_update_msisdn_by_imsi(g_hlr->dbc, subscr.imsi, msisdn)) { + vty_out(vty, "%% Error: cannot update MSISDN for subscriber IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% Updated subscriber IMSI='%s' to MSISDN='%s'%s", + subscr.imsi, msisdn, VTY_NEWLINE); + return CMD_SUCCESS; +} + +static bool is_hexkey_valid(struct vty *vty, const char *label, + const char *hex_str, int minlen, int maxlen) +{ + if (osmo_is_hexstr(hex_str, minlen * 2, maxlen * 2, true)) + return true; + vty_out(vty, "%% Invalid value for %s: '%s'%s", label, hex_str, VTY_NEWLINE); + return false; +} + +#define AUTH_ALG_TYPES_2G "(comp128v1|comp128v2|comp128v3|xor)" +#define AUTH_ALG_TYPES_2G_HELP \ + "Use COMP128v1 algorithm\n" \ + "Use COMP128v2 algorithm\n" \ + "Use COMP128v3 algorithm\n" \ + "Use XOR algorithm\n" + +#define AUTH_ALG_TYPES_3G "milenage" +#define AUTH_ALG_TYPES_3G_HELP \ + "Use Milenage algorithm\n" + +#define A38_XOR_MIN_KEY_LEN 12 +#define A38_XOR_MAX_KEY_LEN 16 +#define A38_COMP128_KEY_LEN 16 + +#define MILENAGE_KEY_LEN 16 + +static bool auth_algo_parse(const char *alg_str, enum osmo_auth_algo *algo, + int *minlen, int *maxlen) +{ + if (!strcasecmp(alg_str, "none")) { + *algo = OSMO_AUTH_ALG_NONE; + *minlen = *maxlen = 0; + } else if (!strcasecmp(alg_str, "comp128v1")) { + *algo = OSMO_AUTH_ALG_COMP128v1; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v2")) { + *algo = OSMO_AUTH_ALG_COMP128v2; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v3")) { + *algo = OSMO_AUTH_ALG_COMP128v3; + *minlen = *maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "xor")) { + *algo = OSMO_AUTH_ALG_XOR; + *minlen = A38_XOR_MIN_KEY_LEN; + *maxlen = A38_XOR_MAX_KEY_LEN; + } else if (!strcasecmp(alg_str, "milenage")) { + *algo = OSMO_AUTH_ALG_MILENAGE; + *minlen = *maxlen = MILENAGE_KEY_LEN; + } else + return false; + return true; +} + +DEFUN(subscriber_no_aud2g, + subscriber_no_aud2g_cmd, + SUBSCR_UPDATE "aud2g none", + SUBSCR_UPDATE_HELP + "Set 2G authentication data\n" + "Delete 2G authentication data\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + struct sub_auth_data_str aud = { + .type = OSMO_AUTH_TYPE_GSM, + .algo = OSMO_AUTH_ALG_NONE, + }; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud); + + if (rc) { + vty_out(vty, "%% Error: cannot disable 2G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_aud2g, + subscriber_aud2g_cmd, + SUBSCR_UPDATE "aud2g " AUTH_ALG_TYPES_2G " ki KI", + SUBSCR_UPDATE_HELP + "Set 2G authentication data\n" + AUTH_ALG_TYPES_2G_HELP + "Set Ki Encryption Key\n" "Ki as 32 hexadecimal characters\n") +{ + struct hlr_subscriber subscr; + int rc; + int minlen = 0; + int maxlen = 0; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *alg_type = argv[2]; + const char *ki = argv[3]; + struct sub_auth_data_str aud2g = { + .type = OSMO_AUTH_TYPE_GSM, + .u.gsm.ki = ki, + }; + + if (!auth_algo_parse(alg_type, &aud2g.algo, &minlen, &maxlen)) { + vty_out(vty, "%% Unknown auth algorithm: '%s'%s", alg_type, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!is_hexkey_valid(vty, "KI", aud2g.u.gsm.ki, minlen, maxlen)) + return CMD_WARNING; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud2g); + + if (rc) { + vty_out(vty, "%% Error: cannot set 2G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_no_aud3g, + subscriber_no_aud3g_cmd, + SUBSCR_UPDATE "aud3g none", + SUBSCR_UPDATE_HELP + "Set UMTS authentication data (3G, and 2G with UMTS AKA)\n" + "Delete 3G authentication data\n") +{ + struct hlr_subscriber subscr; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + struct sub_auth_data_str aud = { + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_NONE, + }; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud); + + if (rc) { + vty_out(vty, "%% Error: cannot disable 3G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(subscriber_aud3g, + subscriber_aud3g_cmd, + SUBSCR_UPDATE "aud3g " AUTH_ALG_TYPES_3G + " k K" + " (op|opc) OP_C" + " [ind-bitlen] [<0-28>]", + SUBSCR_UPDATE_HELP + "Set UMTS authentication data (3G, and 2G with UMTS AKA)\n" + AUTH_ALG_TYPES_3G_HELP + "Set Encryption Key K\n" "K as 32 hexadecimal characters\n" + "Set OP key\n" "Set OPC key\n" "OP or OPC as 32 hexadecimal characters\n" + "Set IND bit length\n" "IND bit length value (default: 5)\n") +{ + struct hlr_subscriber subscr; + int minlen = 0; + int maxlen = 0; + int rc; + const char *id_type = argv[0]; + const char *id = argv[1]; + const char *alg_type = AUTH_ALG_TYPES_3G; + const char *k = argv[2]; + bool opc_is_op = (strcasecmp("op", argv[3]) == 0); + const char *op_opc = argv[4]; + int ind_bitlen = argc > 6? atoi(argv[6]) : 5; + struct sub_auth_data_str aud3g = { + .type = OSMO_AUTH_TYPE_UMTS, + .u.umts = { + .k = k, + .opc_is_op = opc_is_op, + .opc = op_opc, + .ind_bitlen = ind_bitlen, + }, + }; + + if (!auth_algo_parse(alg_type, &aud3g.algo, &minlen, &maxlen)) { + vty_out(vty, "%% Unknown auth algorithm: '%s'%s", alg_type, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!is_hexkey_valid(vty, "K", aud3g.u.umts.k, minlen, maxlen)) + return CMD_WARNING; + + if (!is_hexkey_valid(vty, opc_is_op ? "OP" : "OPC", aud3g.u.umts.opc, + MILENAGE_KEY_LEN, MILENAGE_KEY_LEN)) + return CMD_WARNING; + + if (get_subscr_by_argv(vty, id_type, id, &subscr)) + return CMD_WARNING; + + rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud3g); + + if (rc) { + vty_out(vty, "%% Error: cannot set 3G auth data for IMSI='%s'%s", + subscr.imsi, VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +void hlr_vty_subscriber_init(struct hlr *hlr) +{ + g_hlr = hlr; + + install_element_ve(&subscriber_show_cmd); + install_element(ENABLE_NODE, &subscriber_create_cmd); + install_element(ENABLE_NODE, &subscriber_delete_cmd); + install_element(ENABLE_NODE, &subscriber_msisdn_cmd); + install_element(ENABLE_NODE, &subscriber_no_aud2g_cmd); + install_element(ENABLE_NODE, &subscriber_aud2g_cmd); + install_element(ENABLE_NODE, &subscriber_no_aud3g_cmd); + install_element(ENABLE_NODE, &subscriber_aud3g_cmd); +} diff --git a/src/hlr_vty_subscr.h b/src/hlr_vty_subscr.h new file mode 100644 index 0000000..841db5a --- /dev/null +++ b/src/hlr_vty_subscr.h @@ -0,0 +1,3 @@ +#pragma once + +void hlr_vty_subscriber_init(struct hlr *hlr); diff --git a/tests/Makefile.am b/tests/Makefile.am index 0b625f5..8f1826d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,6 +26,7 @@ testsuite.at \ $(srcdir)/package.m4 \ $(TESTSUITE) \ + test_subscriber.vty \ ctrl_test_runner.py \ $(NULL) @@ -36,10 +37,26 @@ $(NULL) if ENABLE_EXT_TESTS -python-tests: $(BUILT_SOURCES) +python-tests: +# don't run vty and ctrl tests concurrently so that the ports don't conflict + $(MAKE) vty-test $(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v + +VTY_TEST_DB = hlr_vty_test.db + +# To update the VTY script from current application behavior, +# pass -u to vty_script_runner.py by doing: +# make vty-test U=-u +vty-test: + -rm -f $(VTY_TEST_DB) + sqlite3 $(VTY_TEST_DB) < $(top_srcdir)/sql/hlr.sql + osmo_verify_transcript_vty.py -v \ + -n OsmoHLR -p 4258 \ + -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_vty_test.db" \ + $(U) $(srcdir)/*.vty + -rm -f $(VTY_TEST_DB) else -python-tests: $(BUILT_SOURCES) +python-tests: echo "Not running python-based tests (determined at configure-time)" endif diff --git a/tests/test_subscriber.vty b/tests/test_subscriber.vty new file mode 100644 index 0000000..2e0bdce --- /dev/null +++ b/tests/test_subscriber.vty @@ -0,0 +1,348 @@ +OsmoHLR> enable + +OsmoHLR# list +... + subscriber (imsi|msisdn|id) IDENT show + subscriber imsi IDENT create + subscriber (imsi|msisdn|id) IDENT delete + subscriber (imsi|msisdn|id) IDENT update msisdn MSISDN + subscriber (imsi|msisdn|id) IDENT update aud2g none + subscriber (imsi|msisdn|id) IDENT update aud2g (comp128v1|comp128v2|comp128v3|xor) ki KI + subscriber (imsi|msisdn|id) IDENT update aud3g none + subscriber (imsi|msisdn|id) IDENT update aud3g milenage k K (op|opc) OP_C [ind-bitlen] [<0-28>] + +OsmoHLR# subscriber? + subscriber Subscriber management commands + +OsmoHLR# subscriber ? + imsi Identify subscriber by IMSI + msisdn Identify subscriber by MSISDN (phone number) + id Identify subscriber by database ID + +OsmoHLR# subscriber imsi ? + IDENT IMSI/MSISDN/ID of the subscriber +OsmoHLR# subscriber msisdn ? + IDENT IMSI/MSISDN/ID of the subscriber +OsmoHLR# subscriber id ? + IDENT IMSI/MSISDN/ID of the subscriber + +OsmoHLR# subscriber imsi 123456789023000 show +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber id 1 show +% No subscriber for id = '1' +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 1234567890230001 create +% Not a valid IMSI: 1234567890230001 +OsmoHLR# subscriber imsi 12345678902300x create +% Not a valid IMSI: 12345678902300x +OsmoHLR# subscriber imsi 12345 create +% Not a valid IMSI: 12345 + +OsmoHLR# subscriber imsi 123456789023000 create +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: none +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: none +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 123456789023000 update msisdn 12345 +% Updated subscriber IMSI='123456789023000' to MSISDN='12345' + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 +OsmoHLR# subscriber msisdn 12345 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 12345 + +OsmoHLR# subscriber msisdn 12345 update msisdn 423 +% Updated subscriber IMSI='123456789023000' to MSISDN='423' +OsmoHLR# subscriber msisdn 12345 show +% No subscriber for msisdn = '12345' + +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + +OsmoHLR# subscriber imsi 123456789023000 update ? + msisdn Set MSISDN (phone number) of the subscriber + aud2g Set 2G authentication data + aud3g Set UMTS authentication data (3G, and 2G with UMTS AKA) + +OsmoHLR# subscriber imsi 123456789023000 update aud2g ? + none Delete 2G authentication data + comp128v1 Use COMP128v1 algorithm + comp128v2 Use COMP128v2 algorithm + comp128v3 Use COMP128v3 algorithm + xor Use XOR algorithm + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ? + ki Set Ki Encryption Key + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki ? + KI Ki as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki val ? + + +OsmoHLR# subscriber imsi 123456789023000 update aud2g xor ki Deaf0ff1ceD0d0DabbedD1ced1ceF00d +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: XOR + KI=deaf0ff1ced0d0dabbedd1ced1cef00d + +OsmoHLR# subscriber imsi 123456789023000 update aud2g comp128v1 ki BeefedCafeFaceAcedAddedDecadeFee +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v1 + KI=beefedcafefaceacedaddeddecadefee + +OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef + +OsmoHLR# subscriber msisdn 423 update aud2g comp128v3 ki C01ffedC1cadaeAc1d1f1edAcac1aB0a +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g nonsense ki BeefedCafeFaceAcedAddedDecadeFee +% Unknown command. +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g milenage ki BeefedCafeFaceAcedAddedDecadeFee +% Unknown command. +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g xor ki CoiffedCicadaeAcidifiedAcaciaBoa +% Invalid value for KI: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g xor ki C01ffedC1cadaeAc1d1f1edAcac1aB0aX +% Invalid value for KI: 'C01ffedC1cadaeAc1d1f1edAcac1aB0aX' +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=c01ffedc1cadaeac1d1f1edacac1ab0a + +OsmoHLR# subscriber id 1 update aud2g none +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + + +OsmoHLR# subscriber imsi 123456789023000 update aud3g ? + none Delete 3G authentication data + milenage Use Milenage algorithm + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage ? + k Set Encryption Key K + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k ? + K K as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d ? + op Set OP key + opc Set OPC key + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc ? + OP_C OP or OPC as 32 hexadecimal characters + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ? + [ind-bitlen] Set IND bit length + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ind-bitlen ? + [<0-28>] IND bit length value (default: 5) + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=5 + + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op DeafBeddedBabeAcceededFadedDecaf +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OP=deafbeddedbabeacceededfadeddecaf + IND-bitlen=5 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g none +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CededEffacedAceFacedBadFadedBeef ind-bitlen 23 +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k CoiffedCicadaeAcidifiedAcaciaBoa opc CededEffacedAceFacedBadFadedBeef +% Invalid value for K: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d opc CoiffedCicadaeAcidifiedAcaciaBoa +% Invalid value for OPC: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op CoiffedCicadaeAcidifiedAcaciaBoa +% Invalid value for OP: 'CoiffedCicadaeAcidifiedAcaciaBoa' +OsmoHLR# subscriber imsi 123456789023000 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef +OsmoHLR# subscriber id 1 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v2 + KI=cededeffacedacefacedbadfadedbeef + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=23 + +OsmoHLR# subscriber imsi 123456789023000 delete +% Deleted subscriber for IMSI '123456789023000' + +OsmoHLR# subscriber imsi 123456789023000 show +% No subscriber for imsi = '123456789023000' +OsmoHLR# subscriber id 1 show +% No subscriber for id = '1' +OsmoHLR# subscriber msisdn 423 show +% No subscriber for msisdn = '423' + +OsmoHLR# subscriber imsi 123456789023000 create +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + +OsmoHLR# subscriber imsi 123456789023000 delete +% Deleted subscriber for IMSI '123456789023000' -- To view, visit https://gerrit.osmocom.org/4273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:20:30 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 23 Oct 2017 12:20:30 +0000 Subject: osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Patch Set 4: > (if you agree, we could merge 4375 and 4376 into this patch) We should do that. Shall I do this on my side and push the changes than within the original patch? -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:20:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:20:50 +0000 Subject: [MERGED] osmo-hlr[master]: replace ctrl_test_runner.py with transcript test_subscriber.... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: replace ctrl_test_runner.py with transcript test_subscriber.ctrl ...................................................................... replace ctrl_test_runner.py with transcript test_subscriber.ctrl Use the new osmo_verify_transcript_ctrl.py from osmo-python-tests to completely replace current ctrl_test_runner.py with a CTRL interaction transcript. Add missing EXTRA_DIST entry of test_subscriber.sql. Depends: osmo-python-tests Id47331009910e651372b9c9c76e12f2e8964cc2c Change-Id: Iff93abe370b8f3ecf42082d1d0eaa1fbeca5b122 --- M tests/Makefile.am D tests/ctrl_test_runner.py A tests/test_subscriber.ctrl 3 files changed, 46 insertions(+), 243 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/Makefile.am b/tests/Makefile.am index cddea0b..e71a250 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -28,7 +28,8 @@ $(TESTSUITE) \ test_nodes.vty \ test_subscriber.vty \ - ctrl_test_runner.py \ + test_subscriber.sql \ + test_subscriber.ctrl \ $(NULL) TESTSUITE = $(srcdir)/testsuite @@ -41,7 +42,7 @@ python-tests: # don't run vty and ctrl tests concurrently so that the ports don't conflict $(MAKE) vty-test - $(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v + $(MAKE) ctrl-test VTY_TEST_DB = hlr_vty_test.db @@ -56,6 +57,22 @@ -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_vty_test.db" \ $(U) $(srcdir)/*.vty -rm -f $(VTY_TEST_DB) + +CTRL_TEST_DB = hlr_ctrl_test.db + +# To update the CTRL script from current application behavior, +# pass -u to ctrl_script_runner.py by doing: +# make ctrl-test U=-u +ctrl-test: + -rm -f $(CTRL_TEST_DB) + sqlite3 $(CTRL_TEST_DB) < $(top_srcdir)/sql/hlr.sql + sqlite3 $(CTRL_TEST_DB) < $(srcdir)/test_subscriber.sql + osmo_verify_transcript_ctrl.py -v \ + -p 4259 \ + -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_ctrl_test.db" \ + $(U) $(srcdir)/*.ctrl + -rm -f $(CTRL_TEST_DB) + else python-tests: echo "Not running python-based tests (determined at configure-time)" diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py deleted file mode 100644 index 1c5ec2a..0000000 --- a/tests/ctrl_test_runner.py +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/env python - -# (C) 2013 by Jacob Erlbeck -# (C) 2014 by Holger Hans Peter Freyther -# based on vty_test_runner.py: -# (C) 2013 by Katerina Barone-Adesi -# (C) 2013 by Holger Hans Peter Freyther -# based on bsc_control.py. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -import os -import time -import unittest -import socket -import sys -import struct -import subprocess - -import osmopy.osmoutil as osmoutil - -# add $top_srcdir/contrib to find ipa.py -sys.path.append(os.path.join(sys.path[0], '..', 'contrib')) - -from ipa import Ctrl, IPA - -# to be able to find $top_srcdir/doc/... -confpath = os.path.join(sys.path[0], '..') -verbose = False - -class TestCtrlBase(unittest.TestCase): - - def ctrl_command(self): - raise Exception("Needs to be implemented by a subclass") - - def ctrl_app(self): - raise Exception("Needs to be implemented by a subclass") - - def setUp(self): - osmo_ctrl_cmd = self.ctrl_command()[:] - config_index = osmo_ctrl_cmd.index('-c') - if config_index: - cfi = config_index + 1 - osmo_ctrl_cmd[cfi] = os.path.join(confpath, osmo_ctrl_cmd[cfi]) - - try: - self.proc = osmoutil.popen_devnull(osmo_ctrl_cmd) - except OSError: - print >> sys.stderr, "Current directory: %s" % os.getcwd() - print >> sys.stderr, "Consider setting -b" - time.sleep(2) - - appstring = self.ctrl_app()[2] - appport = self.ctrl_app()[0] - self.connect("127.0.0.1", appport) - self.next_id = 1000 - - def tearDown(self): - self.disconnect() - osmoutil.end_proc(self.proc) - - def disconnect(self): - if not (self.sock is None): - self.sock.close() - - def connect(self, host, port): - if verbose: - print "Connecting to host %s:%i" % (host, port) - - retries = 30 - while True: - try: - sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sck.setblocking(1) - sck.connect((host, port)) - except IOError: - retries -= 1 - if retries <= 0: - raise - time.sleep(.1) - continue - break - self.sock = sck - return sck - - def send(self, data): - if verbose: - print "Sending \"%s\"" %(data) - data = Ctrl().add_header(data) - return self.sock.send(data) == len(data) - - def send_set(self, var, value, id): - setmsg = "SET %s %s %s" %(id, var, value) - return self.send(setmsg) - - def send_get(self, var, id): - getmsg = "GET %s %s" %(id, var) - return self.send(getmsg) - - def do_set(self, var, value): - id = self.next_id - self.next_id += 1 - self.send_set(var, value, id) - return self.recv_msgs()[id] - - def do_get(self, var): - id = self.next_id - self.next_id += 1 - self.send_get(var, id) - return self.recv_msgs()[id] - - def assert_reply(self, r, mtype, var, val): - expect = dict(mtype=mtype, var=var, value=val) - result_matches = all([r.get(k) == expect.get(k) for k in expect.keys()]) - if not result_matches: - print('\nError details:\nGot reply: %r\nExpected reply: %r\n' % (r, expect)) - self.assertTrue(result_matches) - - def assert_set(self, var, val, result_val): - r = self.do_set(var, val) - self.assert_reply(r, 'SET_REPLY', var, result_val) - - def assert_get(self, var, result_val): - r = self.do_get(var) - self.assert_reply(r, 'GET_REPLY', var, result_val) - - def recv_msgs(self): - responses = {} - data = self.sock.recv(4096) - while (len(data)>0): - (head, data) = IPA().split_combined(data) - answer = Ctrl().rem_header(head) - if verbose: - print "Got message:", answer - (mtype, id, msg) = answer.split(None, 2) - id = int(id) - rsp = {'mtype': mtype, 'id': id} - if mtype == "ERROR": - rsp['error'] = msg - else: - split = msg.split(None, 1) - rsp['var'] = split[0] - if len(split) > 1: - rsp['value'] = split[1] - else: - rsp['value'] = None - responses[id] = rsp - - if verbose: - print "Decoded replies: ", responses - - return responses - - -class TestCtrlHLR(TestCtrlBase): - - HLR_DB = 'hlr_ctrl_test.db' - HLR_SQL = '%s/sql/hlr.sql' % confpath - HLR_TEST_SQL = '%s/tests/test_subscriber.sql' % confpath - - def setUp(self): - print('\n') - print(os.getcwd()) - assert subprocess.call('sqlite3 %s < %s' % (self.HLR_DB, self.HLR_SQL), shell=True) == 0 - assert subprocess.call('sqlite3 %s < %s' % (self.HLR_DB, self.HLR_TEST_SQL), shell=True) == 0 - super(TestCtrlHLR, self).setUp() - - def tearDown(self): - super(TestCtrlHLR, self).tearDown() - os.unlink(self.HLR_DB) - - def ctrl_command(self): - return ["./src/osmo-hlr", "-c", "doc/examples/osmo-hlr.cfg", '-l', 'hlr_ctrl_test.db'] - - def ctrl_app(self): - return (4259, "./src/osmo-hlr", "OsmoHLR", "hlr") - - def testCtrlErrs(self): - r = self.do_get('invalid') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Command not found') - - def testEnableDisablePs(self): - self.assert_set('enable-ps', '901990000000001', 'OK') - self.assert_set('status-ps', '901990000000001', '1') - self.assert_set('enable-ps', '901990000000001', 'OK') - self.assert_set('status-ps', '901990000000001', '1') - self.assert_set('disable-ps', '901990000000001', 'OK') - self.assert_set('status-ps', '901990000000001', '0') - self.assert_set('disable-ps', '901990000000001', 'OK') - self.assert_set('status-ps', '901990000000001', '0') - self.assert_set('enable-ps', '901990000000001', 'OK') - self.assert_set('status-ps', '901990000000001', '1') - -if __name__ == '__main__': - import argparse - import sys - - workdir = '.' - - parser = argparse.ArgumentParser() - parser.add_argument("-v", "--verbose", dest="verbose", - action="store_true", help="verbose mode") - parser.add_argument("-p", "--pythonconfpath", dest="p", - help="searchpath for config") - parser.add_argument("-w", "--workdir", dest="w", - help="Working directory") - args = parser.parse_args() - - verbose_level = 1 - if args.verbose: - verbose_level = 2 - verbose = True - - if args.w: - workdir = args.w - - if args.p: - confpath = args.p - - print "confpath %s, workdir %s" % (confpath, workdir) - os.chdir(workdir) - print "Running tests for specific control commands" - suite = unittest.TestSuite() - test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlHLR) - suite.addTest(test) - res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) - sys.exit(len(res.errors) + len(res.failures)) - -# vim: tabstop=4 shiftwidth=4 expandtab diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl new file mode 100644 index 0000000..3284ae5 --- /dev/null +++ b/tests/test_subscriber.ctrl @@ -0,0 +1,27 @@ +GET 1 invalid +ERROR 1 Command not found +SET 2 invalid nonsense +ERROR 2 Command not found + +SET 3 enable-ps 901990000000001 +SET_REPLY 3 enable-ps OK +SET 4 status-ps 901990000000001 +SET_REPLY 4 status-ps 1 +SET 5 enable-ps 901990000000001 +SET_REPLY 5 enable-ps OK +SET 6 status-ps 901990000000001 +SET_REPLY 6 status-ps 1 + +SET 7 disable-ps 901990000000001 +SET_REPLY 7 disable-ps OK +SET 8 status-ps 901990000000001 +SET_REPLY 8 status-ps 0 +SET 9 disable-ps 901990000000001 +SET_REPLY 9 disable-ps OK +SET 10 status-ps 901990000000001 +SET_REPLY 10 status-ps 0 + +SET 11 enable-ps 901990000000001 +SET_REPLY 11 enable-ps OK +SET 12 status-ps 901990000000001 +SET_REPLY 12 status-ps 1 -- To view, visit https://gerrit.osmocom.org/4275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iff93abe370b8f3ecf42082d1d0eaa1fbeca5b122 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:20:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:20:50 +0000 Subject: [MERGED] osmo-hlr[master]: fix mem leak in handle_cmd_ps(): free luop In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix mem leak in handle_cmd_ps(): free luop ...................................................................... fix mem leak in handle_cmd_ps(): free luop Each GSUP client creates a luop, but since lu_op_tx_del_subscr_data() doesn't free the luop, each allocated luop leaks memory. Change-Id: If912dc992bc7f18c49d22ec0436d9679c1cd04f6 --- M src/ctrl.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl.c b/src/ctrl.c index 8682e14..74172c4 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -54,6 +54,7 @@ luop = lu_op_alloc_conn(co); lu_op_fill_subscr(luop, ctx->dbc, cmd->value); lu_op_tx_del_subscr_data(luop); + lu_op_free(luop); } } -- To view, visit https://gerrit.osmocom.org/4308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If912dc992bc7f18c49d22ec0436d9679c1cd04f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:20:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:20:50 +0000 Subject: [MERGED] osmo-hlr[master]: add hlr_subsrc_nam to put GSUP client notification in proper... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add hlr_subsrc_nam to put GSUP client notification in proper API ...................................................................... add hlr_subsrc_nam to put GSUP client notification in proper API This code should not live in a CTRL interface function but be proper hlr_* API. Change-Id: I4c9b8f9ad51d49517474e8b51afc3cc2e1c9299a --- M src/ctrl.c M src/db.h M src/db_hlr.c M tests/db/db_test.c 4 files changed, 64 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl.c b/src/ctrl.c index 74172c4..3bd4d8f 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -35,31 +35,19 @@ static int handle_cmd_ps(struct hlr *ctx, struct ctrl_cmd *cmd, bool enable) { - struct lu_operation *luop = NULL; - struct osmo_gsup_conn *co; + struct hlr_subscriber subscr; - if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, NULL) < 0) { + if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, &subscr) < 0) { cmd->reply = "Subscriber Unknown in HLR"; return CTRL_CMD_ERROR; } - if (db_subscr_nam(ctx->dbc, cmd->value, enable, true) < 0) { + if (hlr_subscr_nam(ctx, &subscr, enable, true) < 0) { cmd->reply = "Error updating DB"; return CTRL_CMD_ERROR; } - /* FIXME: only send to single SGSN where latest update for IMSI came from */ - if (!enable) { - llist_for_each_entry(co, &ctx->gs->clients, list) { - luop = lu_op_alloc_conn(co); - lu_op_fill_subscr(luop, ctx->dbc, cmd->value); - lu_op_tx_del_subscr_data(luop); - lu_op_free(luop); - } - } - cmd->reply = "OK"; - return CTRL_CMD_REPLY; } diff --git a/src/db.h b/src/db.h index f6aaa58..35e4327 100644 --- a/src/db.h +++ b/src/db.h @@ -3,6 +3,8 @@ #include #include +struct hlr; + enum stmt_idx { DB_STMT_SEL_BY_IMSI, DB_STMT_SEL_BY_MSISDN, @@ -125,3 +127,5 @@ int db_subscr_purge(struct db_context *dbc, const char *by_imsi, bool purge_val, bool is_ps); + +int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps); diff --git a/src/db_hlr.c b/src/db_hlr.c index cf6e4f8..e8db7d2 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -28,7 +28,10 @@ #include #include "logging.h" +#include "hlr.h" #include "db.h" +#include "gsup_server.h" +#include "luop.h" #define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) @@ -609,3 +612,51 @@ return ret; } + +/*! Update nam_cs/nam_ps in the db and trigger notifications to GSUP clients. + * \param hlr Global hlr context. + * \param subscr Subscriber from a fresh db_subscr_get_by_*() call. + * \param nam_val True to enable CS/PS, false to disable. + * \param is_ps True to enable/disable PS, false for CS. + * \returns 0 on success, ENOEXEC if there is no need to change, a negative + * value on error. + */ +int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps) +{ + int rc; + struct lu_operation *luop; + struct osmo_gsup_conn *co; + bool is_val = is_ps? subscr->nam_ps : subscr->nam_cs; + + if (is_val == nam_val) { + LOGHLR(subscr->imsi, LOGL_DEBUG, "Already has the requested value when asked to %s %s\n", + nam_val ? "enable" : "disable", is_ps ? "PS" : "CS"); + return ENOEXEC; + } + + rc = db_subscr_nam(hlr->dbc, subscr->imsi, nam_val, is_ps); + if (rc) + return rc > 0? -rc : rc; + + /* If we're disabling, send a notice out to the GSUP client that is + * responsible. Otherwise no need. */ + if (nam_val) + return 0; + + /* FIXME: only send to single SGSN where latest update for IMSI came from */ + llist_for_each_entry(co, &hlr->gs->clients, list) { + luop = lu_op_alloc_conn(co); + if (!luop) { + LOGHLR(subscr->imsi, LOGL_ERROR, + "Cannot notify GSUP client, cannot allocate lu_operation," + " for %s:%u\n", + co && co->conn && co->conn->server? co->conn->server->addr : "unset", + co && co->conn && co->conn->server? co->conn->server->port : 0); + continue; + } + luop->subscr = *subscr; + lu_op_tx_del_subscr_data(luop); + lu_op_free(luop); + } + return 0; +} diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 591418b..0a53370 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -837,3 +837,9 @@ struct osmo_sub_auth_data *aud3g, const uint8_t *rand_auts, const uint8_t *auts) { OSMO_ASSERT(false); return -1; } +void *lu_op_alloc_conn(void *conn) +{ OSMO_ASSERT(false); return NULL; } +void lu_op_tx_del_subscr_data(void *luop) +{ OSMO_ASSERT(false); } +void lu_op_free(void *luop) +{ OSMO_ASSERT(false); } -- To view, visit https://gerrit.osmocom.org/4310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4c9b8f9ad51d49517474e8b51afc3cc2e1c9299a Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:20:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:20:50 +0000 Subject: [MERGED] osmo-hlr[master]: add test_nodes.vty In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add test_nodes.vty ...................................................................... add test_nodes.vty Automatically picked up by the vty-test target, by file name extension. Change-Id: I8dba373cee1be954504f79c3305b0111071757e7 --- M tests/Makefile.am A tests/test_nodes.vty 2 files changed, 118 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/Makefile.am b/tests/Makefile.am index 8f1826d..cddea0b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,6 +26,7 @@ testsuite.at \ $(srcdir)/package.m4 \ $(TESTSUITE) \ + test_nodes.vty \ test_subscriber.vty \ ctrl_test_runner.py \ $(NULL) diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty new file mode 100644 index 0000000..0de4ff4 --- /dev/null +++ b/tests/test_nodes.vty @@ -0,0 +1,117 @@ +OsmoHLR> list + show version + show online-help + list + exit + help + enable + terminal length <0-512> + terminal no length + who + show history + logging enable +... + show logging vty + show alarms + subscriber (imsi|msisdn|id) IDENT show + +OsmoHLR> enable +OsmoHLR# list + help + list + write terminal + write file + write memory + write + show running-config + exit + disable + configure terminal + copy running-config startup-config + show startup-config + show version + show online-help + terminal length <0-512> + terminal no length + who + show history + terminal monitor + terminal no monitor + logging enable +... + +OsmoHLR# configure terminal +OsmoHLR(config)# list + help + list + write terminal + write file + write memory + write + show running-config + exit + end +... + hlr + +OsmoHLR(config)# hlr +OsmoHLR(config-hlr)# list + help + list + write terminal + write file + write memory + write + show running-config + exit + end + gsup + +OsmoHLR(config-hlr)# gsup +OsmoHLR(config-hlr-gsup)# list + help + list + write terminal + write file + write memory + write + show running-config + exit + end + bind ip A.B.C.D + +OsmoHLR(config-hlr-gsup)# exit +OsmoHLR(config-hlr)# exit +OsmoHLR(config)# exit +OsmoHLR# configure terminal +OsmoHLR(config)# hlr +OsmoHLR(config-hlr)# gsup +OsmoHLR(config-hlr-gsup)# end +OsmoHLR# disable +OsmoHLR> enable + +OsmoHLR# show running-config + +Current configuration: +! +! +log stderr + logging filter all 1 + logging color 1 + logging print category 1 + logging print extended-timestamp 1 + logging level all debug + logging level main debug + logging level db debug + logging level auc debug +... +! +line vty + no login +! +ctrl + bind 127.0.0.1 +hlr + gsup + bind ip 127.0.0.1 +end -- To view, visit https://gerrit.osmocom.org/4274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8dba373cee1be954504f79c3305b0111071757e7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:20:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:20:51 +0000 Subject: [MERGED] osmo-hlr[master]: add lu_op_free(), use in luop.c In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add lu_op_free(), use in luop.c ...................................................................... add lu_op_free(), use in luop.c Add to luop.h, it will be used in db_hlr.c in an upcoming patch. Change-Id: Ib44d9062edc957d2e0710b7e485604f97e4d5612 --- M src/luop.c M src/luop.h 2 files changed, 12 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/luop.c b/src/luop.c index 1b17fe3..3bedbaa 100644 --- a/src/luop.c +++ b/src/luop.c @@ -114,6 +114,14 @@ return luop; } +void lu_op_free(struct lu_operation *luop) +{ + /* Only attempt to remove when it was ever added to a list. */ + if (luop->list.next) + llist_del(&luop->list); + talloc_free(luop); +} + struct lu_operation *lu_op_alloc_conn(struct osmo_gsup_conn *conn) { uint8_t *peer_addr; @@ -183,8 +191,7 @@ _luop_tx_gsup(luop, &gsup); - llist_del(&luop->list); - talloc_free(luop); + lu_op_free(luop); } /*! Transmit UPD_LOC_RESULT and destroy lu_operation */ @@ -197,8 +204,7 @@ _luop_tx_gsup(luop, &gsup); - llist_del(&luop->list); - talloc_free(luop); + lu_op_free(luop); } /*! Send Cancel Location to old VLR/SGSN */ diff --git a/src/luop.h b/src/luop.h index ab1bc24..053a025 100644 --- a/src/luop.h +++ b/src/luop.h @@ -79,3 +79,5 @@ void lu_op_tx_cancel_old(struct lu_operation *luop); void lu_op_tx_insert_subscr_data(struct lu_operation *luop); void lu_op_tx_del_subscr_data(struct lu_operation *luop); + +void lu_op_free(struct lu_operation *luop); -- To view, visit https://gerrit.osmocom.org/4306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib44d9062edc957d2e0710b7e485604f97e4d5612 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:20:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:20:51 +0000 Subject: [MERGED] osmo-hlr[master]: luop: fix mem leak upon error in lu_op_alloc_conn() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: luop: fix mem leak upon error in lu_op_alloc_conn() ...................................................................... luop: fix mem leak upon error in lu_op_alloc_conn() Free allocated luop if osmo_gsup_conn_ccm_get() fails. Change-Id: I3ebd5fb5e313be452de893248dd58b2bb73ba94a --- M src/luop.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/luop.c b/src/luop.c index 3bedbaa..ef416ac 100644 --- a/src/luop.c +++ b/src/luop.c @@ -127,8 +127,10 @@ uint8_t *peer_addr; struct lu_operation *luop = lu_op_alloc(conn->server); int rc = osmo_gsup_conn_ccm_get(conn, &peer_addr, IPAC_IDTAG_SERNR); - if (rc < 0) + if (rc < 0) { + lu_op_free(luop); return NULL; + } luop->peer = talloc_memdup(luop, peer_addr, rc); -- To view, visit https://gerrit.osmocom.org/4307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ebd5fb5e313be452de893248dd58b2bb73ba94a Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:20:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:20:51 +0000 Subject: [MERGED] osmo-hlr[master]: api doc: say that lu_op_tx_del_subscr_data() doesn't free In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: api doc: say that lu_op_tx_del_subscr_data() doesn't free ...................................................................... api doc: say that lu_op_tx_del_subscr_data() doesn't free Change-Id: Ia341d8e5bfc6eb0dc59945281ce88eecfaab057e --- M src/luop.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/luop.c b/src/luop.c index ef416ac..2966380 100644 --- a/src/luop.c +++ b/src/luop.c @@ -275,7 +275,8 @@ osmo_timer_schedule(&luop->timer, ISD_TIMEOUT_SECS, 0); } -/*! Transmit Delete Subscriber Data to new VLR/SGSN */ +/*! Transmit Delete Subscriber Data to new VLR/SGSN. + * The luop is not freed. */ void lu_op_tx_del_subscr_data(struct lu_operation *luop) { struct osmo_gsup_message gsup; -- To view, visit https://gerrit.osmocom.org/4309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia341d8e5bfc6eb0dc59945281ce88eecfaab057e Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:22:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 12:22:03 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 2: > very good idea. Let's do it that way. It contradicts recommendations from https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info It doesn't mean it's completely bad but at least we should remember to not update it again if it was updated already since the last release. Also, updating "current" component of libversion means that we'll have to update the filenames and metadata in debian/ as well which is not yet covered by release automation so it has to be done manually. -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:28:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:28:16 +0000 Subject: libosmocore[master]: ctrl: allow more nodes than those in enum ctrl_node_type In-Reply-To: References: Message-ID: Patch Set 3: > wouldn't it make more sense for the application simply to provide > the number of it's onw nodes? API wise it appears more logical, but in practical terms that would actually be more complex. All the new node IDs have to be >= _LAST_CTRL_NODE anyway: enum my_nodes { MY_FIRST = _LAST_CTRL_NODE, MORE, _MY_LAST_CTRL_NODE } Current patch: ctrl_interface_setup_dynip(_MY_LAST_CTRL_NODE) Passing the number of additional nodes: ctrl_interface_setup_dynip(caller_nodes = _MY_LAST_CTRL_NODE - _LAST_CTRL_NODE) { alloc(_LAST_CTRL_NODE + caller_nodes) } So we do two steps of math just to end up with the caller's last node again. Maybe the parameter shouldn't be called 'node_count', but 'last_node'? -- To view, visit https://gerrit.osmocom.org/4305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bd62ae0d4eefde7e1517db15a2155640a1bab58 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:38:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 12:38:00 +0000 Subject: libosmocore[master]: Cleanup jenkins build scripts In-Reply-To: References: Message-ID: Patch Set 4: > > have you checked that the jenkins build job running this cleans > up the workspace? > > I've look through web-ui and it seems ok but I might have missed > smth. What would be the right way to do this? e.g. under 'Source Code Management' choose the 'Additional Behaviors' as 'Clean before checkout'. But then again, we build twice in the script, and the second build re-uses a git checkout that is already tainted by the first build. For example, if built-sources are placed in the source tree instead of the builddir or other side effects ... are unlikely and wrong, nevertheless, the best practice for jenkins builds is to start from a clean git repos every time. -- To view, visit https://gerrit.osmocom.org/3132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:52:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 12:52:59 +0000 Subject: [PATCH] osmo-bsc[master]: libbsc: Use correct printf formatting for uint64_t Message-ID: Review at https://gerrit.osmocom.org/4379 libbsc: Use correct printf formatting for uint64_t unsigned long can be 32 bits on some arch/OS, while "current" field is always 64 bit because it's a uint64_t. Change-Id: Ibad1e4f09cf912cb654dbe3687a3f2182e2060f5 --- M src/libbsc/bsc_vty.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/79/4379/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index ca29b4c..461e3d3 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -3769,20 +3769,20 @@ void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net) { - vty_out(vty, "Channel Requests : %lu total, %lu no channel%s", + vty_out(vty, "Channel Requests : %"PRIu64" total, %"PRIu64" no channel%s", net->bsc_ctrs->ctr[BSC_CTR_CHREQ_TOTAL].current, net->bsc_ctrs->ctr[BSC_CTR_CHREQ_NO_CHANNEL].current, VTY_NEWLINE); - vty_out(vty, "Channel Failures : %lu rf_failures, %lu rll failures%s", + vty_out(vty, "Channel Failures : %"PRIu64" rf_failures, %"PRIu64" rll failures%s", net->bsc_ctrs->ctr[BSC_CTR_CHAN_RF_FAIL].current, net->bsc_ctrs->ctr[BSC_CTR_CHAN_RLL_ERR].current, VTY_NEWLINE); - vty_out(vty, "Paging : %lu attempted, %lu complete, %lu expired%s", + vty_out(vty, "Paging : %"PRIu64" attempted, %"PRIu64" complete, %"PRIu64" expired%s", net->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED].current, net->bsc_ctrs->ctr[BSC_CTR_PAGING_COMPLETED].current, net->bsc_ctrs->ctr[BSC_CTR_PAGING_EXPIRED].current, VTY_NEWLINE); - vty_out(vty, "BTS failures : %lu OML, %lu RSL%s", + vty_out(vty, "BTS failures : %"PRIu64" OML, %"PRIu64" RSL%s", net->bsc_ctrs->ctr[BSC_CTR_BTS_OML_FAIL].current, net->bsc_ctrs->ctr[BSC_CTR_BTS_RSL_FAIL].current, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/4379 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibad1e4f09cf912cb654dbe3687a3f2182e2060f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 12:56:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 12:56:28 +0000 Subject: [PATCH] openbsc[master]: libbsc: Use correct printf formatting for uint64_t Message-ID: Review at https://gerrit.osmocom.org/4380 libbsc: Use correct printf formatting for uint64_t libbsc: Use correct printf formatting for uint64_t unsigned long can be 32 bits on some arch/OS, while "current" field is always 64 bit because it's a uint64_t. Change-Id: I9719c69ef661bb46d8bb43cf8d6537c3e8d47826 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/80/4380/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 0d5377d..f50ebd8 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -3750,20 +3750,20 @@ void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net) { - vty_out(vty, "Channel Requests : %lu total, %lu no channel%s", + vty_out(vty, "Channel Requests : %"PRIu64" total, %"PRIu64" no channel%s", net->bsc_ctrs->ctr[BSC_CTR_CHREQ_TOTAL].current, net->bsc_ctrs->ctr[BSC_CTR_CHREQ_NO_CHANNEL].current, VTY_NEWLINE); - vty_out(vty, "Channel Failures : %lu rf_failures, %lu rll failures%s", + vty_out(vty, "Channel Failures : %"PRIu64" rf_failures, %"PRIu64" rll failures%s", net->bsc_ctrs->ctr[BSC_CTR_CHAN_RF_FAIL].current, net->bsc_ctrs->ctr[BSC_CTR_CHAN_RLL_ERR].current, VTY_NEWLINE); - vty_out(vty, "Paging : %lu attempted, %lu complete, %lu expired%s", + vty_out(vty, "Paging : %"PRIu64" attempted, %"PRIu64" complete, %"PRIu64" expired%s", net->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED].current, net->bsc_ctrs->ctr[BSC_CTR_PAGING_COMPLETED].current, net->bsc_ctrs->ctr[BSC_CTR_PAGING_EXPIRED].current, VTY_NEWLINE); - vty_out(vty, "BTS failures : %lu OML, %lu RSL%s", + vty_out(vty, "BTS failures : %"PRIu64" OML, %"PRIu64" RSL%s", net->bsc_ctrs->ctr[BSC_CTR_BTS_OML_FAIL].current, net->bsc_ctrs->ctr[BSC_CTR_BTS_RSL_FAIL].current, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/4380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9719c69ef661bb46d8bb43cf8d6537c3e8d47826 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 13:33:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 13:33:34 +0000 Subject: [PATCH] libosmocore[master]: GPRS: unify NS state printing Message-ID: Review at https://gerrit.osmocom.org/4381 GPRS: unify NS state printing * introduce defines with NS state names * use them for vty and tests * expand test output to print complete NS state Change-Id: I69f8d536135ae76dbca623c2f1ffba625adcb1e9 Related: SYS#3610 --- M include/osmocom/gprs/gprs_ns.h M src/gb/gprs_ns_vty.c M tests/gb/gprs_ns_test.c M tests/gb/gprs_ns_test.ok 4 files changed, 72 insertions(+), 67 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/4381/1 diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 5aee755..521714e 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -43,6 +43,10 @@ #define NSE_S_ALIVE 0x0002 #define NSE_S_RESET 0x0004 +#define NS_DESC_B(st) ((st) & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED") +#define NS_DESC_A(st) ((st) & NSE_S_ALIVE ? "ALIVE" : "DEAD") +#define NS_DESC_R(st) ((st) & NSE_S_RESET ? "RESET" : "UNRESET") + /*! Osmocom NS link layer types */ enum gprs_ns_ll { GPRS_NS_LL_UDP, /*!< NS/UDP/IP */ diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index 3b1a698..317a6a1 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -160,11 +160,11 @@ { vty_out(vty, "NSEI %5u, NS-VC %5u, %5s %9s, Remote: %-4s, %5s %9s", nsvc->nsei, nsvc->nsvci, - nsvc->state & NSE_S_ALIVE ? "ALIVE" : "DEAD", - nsvc->state & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED", + NS_DESC_A(nsvc->state), + NS_DESC_B(nsvc->state), nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", - nsvc->remote_state & NSE_S_ALIVE ? "ALIVE" : "DEAD", - nsvc->remote_state & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED"); + NS_DESC_A(nsvc->remote_state), + NS_DESC_B(nsvc->remote_state)); if (nsvc->ll == GPRS_NS_LL_UDP || nsvc->ll == GPRS_NS_LL_FR_GRE) vty_out(vty, ", %s %15s:%u", nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE", diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c index 456d8e3..0bbf943 100644 --- a/tests/gb/gprs_ns_test.c +++ b/tests/gb/gprs_ns_test.c @@ -390,11 +390,12 @@ printf("Current NS-VCIs:\n"); llist_for_each_entry(nsvc, &nsi->gprs_nsvcs, list) { struct sockaddr_in *peer = &(nsvc->ip.bts_addr); - printf(" VCI 0x%04x, NSEI 0x%04x, peer 0x%08x:%d%s%s%s\n", + printf(" VCI 0x%04x, NSEI 0x%04x, peer 0x%08x:%d, %s, %s, %s%s\n", nsvc->nsvci, nsvc->nsei, ntohl(peer->sin_addr.s_addr), ntohs(peer->sin_port), - nsvc->state & NSE_S_BLOCKED ? ", blocked" : "", - nsvc->state & NSE_S_ALIVE ? "" : ", dead", + NS_DESC_A(nsvc->state), + NS_DESC_B(nsvc->state), + NS_DESC_R(nsvc->state), nsvc->nsvci_is_valid ? "" : ", invalid VCI" ); dump_rate_ctr_group(stdout, " ", nsvc->ctrg); diff --git a/tests/gb/gprs_ns_test.ok b/tests/gb/gprs_ns_test.ok index b0c81e4..669e182 100644 --- a/tests/gb/gprs_ns_test.ok +++ b/tests/gb/gprs_ns_test.ok @@ -14,7 +14,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, BLOCKED, UNRESET --- Delete nsvc object (round 0)--- @@ -35,7 +35,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, BLOCKED, UNRESET --- Delete nsvc object (round 1)--- @@ -56,7 +56,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, BLOCKED, UNRESET --- Delete nsvc object (round 2)--- @@ -77,7 +77,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, BLOCKED, UNRESET --- Delete nsvc object (round 3)--- @@ -145,7 +145,7 @@ result (ALIVE_ACK) = 0 Current NS-VCIs: - VCI 0x1122, NSEI 0x1122, peer 0x01020304:1111 + VCI 0x1122, NSEI 0x1122, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET PROCESSING BSSGP RESET from 0x01020304:1111 00 00 00 00 22 04 82 4a 2e 07 81 08 08 88 10 20 30 40 50 60 10 00 @@ -170,7 +170,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, blocked + VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET --- Peer port changes, RESET, VCI changes --- @@ -187,8 +187,8 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, blocked - VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, blocked + VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, ALIVE, BLOCKED, UNRESET + VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET --- Peer port changes, RESET, NSEI changes --- @@ -205,8 +205,8 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, blocked - VCI 0x1122, NSEI 0x3344, peer 0x01020304:4444, blocked + VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, ALIVE, BLOCKED, UNRESET + VCI 0x1122, NSEI 0x3344, peer 0x01020304:4444, ALIVE, BLOCKED, UNRESET NS-VC changed NSEI count : 1 --- Peer port 3333, RESET, VCI is changed back --- @@ -225,8 +225,8 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, blocked - VCI 0x1122, NSEI 0x1122, peer 0x01020304:3333, blocked + VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET + VCI 0x1122, NSEI 0x1122, peer 0x01020304:3333, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 NS-VC changed NSEI count : 2 @@ -245,8 +245,8 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, blocked - VCI 0x1122, NSEI 0x1122, peer 0x01020304:4444, blocked + VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET + VCI 0x1122, NSEI 0x1122, peer 0x01020304:4444, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 NS-VC changed NSEI count : 2 @@ -289,7 +289,7 @@ result (ALIVE_ACK) = 0 Current NS-VCIs: - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET --- Setup VC 2 BSS -> SGSN --- @@ -330,8 +330,8 @@ result (ALIVE_ACK) = 0 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET --- Setup VC 1 SGSN -> BSS --- @@ -347,8 +347,8 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 --- Exchange NSEI 1 + 2 links --- @@ -368,8 +368,8 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, blocked, dead - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, DEAD, BLOCKED, RESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 2 NS-VC replaced other count: 1 @@ -389,8 +389,8 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, blocked, dead - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, DEAD, BLOCKED, RESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 1 @@ -433,8 +433,8 @@ result (ALIVE_ACK) = 0 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 1 @@ -453,8 +453,8 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 1 NS-VC changed NSEI count : 1 @@ -475,10 +475,10 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 1 NS-VC changed NSEI count : 1 @@ -499,10 +499,10 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 2 NS-VC changed NSEI count : 2 @@ -515,10 +515,10 @@ result (RESET_ACK) = 0 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 2 NS-VC changed NSEI count : 2 @@ -537,10 +537,10 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 4 NS-VC replaced other count: 2 NS-VC changed NSEI count : 3 @@ -560,11 +560,11 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VC replaced other count: 2 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, blocked, dead + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, DEAD, BLOCKED, RESET NS-VC Block count : 4 NS-VC replaced other count: 2 NS-VC changed NSEI count : 3 @@ -618,11 +618,11 @@ result (UNBLOCK_ACK) = 0 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VC replaced other count: 2 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222 + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, UNBLOCKED, UNRESET NS-VC Block count : 4 NS-VC replaced other count: 3 NS-VC changed NSEI count : 4 @@ -644,11 +644,11 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VC replaced other count: 2 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 5 NS-VC replaced other count: 3 NS-VC changed NSEI count : 4 @@ -683,7 +683,7 @@ result (UNBLOCK_ACK) = 0 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, UNBLOCKED, UNRESET NS-VC Block count : 1 --- RESET, SGSN -> BSS --- @@ -701,7 +701,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 --- RESET with invalid NSEI, SGSN -> BSS --- @@ -716,7 +716,7 @@ result (RESET) = 0 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NSEI was invalid count : 1 @@ -732,7 +732,7 @@ result (RESET) = 0 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -752,7 +752,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -765,7 +765,7 @@ result (RESET_ACK) = 0 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -782,7 +782,7 @@ result (RESET_ACK) = -22 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, DEAD, BLOCKED, RESET NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 2 @@ -799,7 +799,7 @@ result (RESET_ACK) = -22 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, DEAD, BLOCKED, RESET NS-VC Block count : 1 NS-VCI was invalid count : 2 NSEI was invalid count : 2 @@ -835,7 +835,7 @@ result (UNBLOCK_ACK) = 0 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, UNBLOCKED, UNRESET NS-VC Block count : 1 --- Time out local test procedure --- @@ -938,7 +938,7 @@ 02 00 81 01 01 82 01 01 04 82 01 00 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, DEAD, BLOCKED, RESET --- Send message to SGSN --- @@ -967,7 +967,7 @@ result (ALIVE_ACK) = 1 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 --- Send message to SGSN --- @@ -995,7 +995,7 @@ result (ALIVE) = 1 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, UNBLOCKED, UNRESET NS-VC Block count : 1 --- Send message to SGSN --- -- To view, visit https://gerrit.osmocom.org/4381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I69f8d536135ae76dbca623c2f1ffba625adcb1e9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 23 13:33:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 13:33:35 +0000 Subject: [PATCH] libosmocore[master]: GPRS: wrap NS state assignment in macro Message-ID: Review at https://gerrit.osmocom.org/4382 GPRS: wrap NS state assignment in macro This enables logging for every state transition which makes NS troubleshooting easier. Change-Id: I5d6eaef0432d9be810bf93d07e40787b9ca59142 Related: SYS#3610 --- M src/gb/gprs_ns.c 1 file changed, 33 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/4382/1 diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 7443a8b..869539d 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -84,6 +84,9 @@ #include "common_vty.h" +#define ns_set_state(ns_, st_) ns_set_state_with_log(ns_, st_, false, __BASE_FILE__, __LINE__) +#define ns_set_remote_state(ns_, st_) ns_set_state_with_log(ns_, st_, true, __BASE_FILE__, __LINE__) + static const struct tlv_definition ns_att_tlvdef = { .def = { [NS_IE_CAUSE] = { TLV_TYPE_TvLV, 0 }, @@ -174,6 +177,22 @@ return msg; } +/* FIXME: convert to osmo_fsm */ +static inline void ns_set_state_with_log(struct gprs_nsvc *nsvc, uint32_t state, bool is_remote, + const char *file, unsigned line) +{ + uint32_t old_state = is_remote ? nsvc->remote_state : nsvc->state; + + LOGPSRC(DNS, LOGL_DEBUG, file, line, "NSEI %d (NS-VCI=%u) setting %sstate [%s,%s,%s] -> [%s,%s,%s]\n", + nsvc->nsei, nsvc->nsvci, is_remote ? "remote " : "", + NS_DESC_A(old_state), NS_DESC_B(old_state), NS_DESC_R(old_state), + NS_DESC_A(state), NS_DESC_B(state), NS_DESC_R(state)); + + if (is_remote) + nsvc->remote_state = state; + else + nsvc->state = state; +} /*! Lookup struct gprs_nsvc based on NSVCI * \param[in] nsi NS instance in which to search @@ -245,7 +264,7 @@ nsvc->nsvci = nsvci; nsvc->nsvci_is_valid = 1; /* before RESET procedure: BLOCKED and DEAD */ - nsvc->state = NSE_S_BLOCKED; + ns_set_state(nsvc, NSE_S_BLOCKED); nsvc->nsi = nsi; osmo_timer_setup(&nsvc->timer, gprs_ns_timer_cb, nsvc); nsvc->ctrg = rate_ctr_group_alloc(nsvc, &nsvc_ctrg_desc, nsvci); @@ -510,7 +529,7 @@ nsvc->nsei, nsvc->nsvci, gprs_ns_cause_str(cause)); /* be conservative and mark it as blocked even now! */ - nsvc->state |= NSE_S_BLOCKED; + ns_set_state(nsvc, nsvc->state | NSE_S_BLOCKED); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]); msg->l2h = msgb_put(msg, sizeof(*nsh)); @@ -621,7 +640,7 @@ if (nsvc->alive_retries > nsvc->nsi->timeout[NS_TOUT_TNS_ALIVE_RETRIES]) { /* mark as dead and blocked */ - nsvc->state = NSE_S_BLOCKED; + ns_set_state(nsvc, NSE_S_BLOCKED); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_DEAD]); LOGP(DNS, LOGL_NOTICE, @@ -652,7 +671,7 @@ "NSEI=%u Reset timed out but RESET flag is not set\n", nsvc->nsei); /* Mark NS-VC locally as blocked and dead */ - nsvc->state = NSE_S_BLOCKED | NSE_S_RESET; + ns_set_state(nsvc, NSE_S_BLOCKED | NSE_S_RESET); /* Chapter 7.3: Re-send the RESET */ gprs_ns_tx_reset(nsvc, NS_CAUSE_OM_INTERVENTION); /* Re-start Tns-reset timer */ @@ -912,7 +931,7 @@ } /* Mark NS-VC as blocked and alive */ - (*nsvc)->state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); if (orig_nsvc) { rate_ctr_inc(&(*nsvc)->ctrg->ctr[NS_CTR_REPLACED]); @@ -1052,8 +1071,8 @@ } /* Mark NS-VC as blocked and alive */ - (*nsvc)->state = NSE_S_BLOCKED | NSE_S_ALIVE; - (*nsvc)->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); + ns_set_remote_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); rate_ctr_inc(&(*nsvc)->ctrg->ctr[NS_CTR_BLOCKED]); if ((*nsvc)->persistent || (*nsvc)->remote_end_is_sgsn) { /* stop RESET timer */ @@ -1075,7 +1094,7 @@ LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS BLOCK\n", nsvc->nsei); - nsvc->state |= NSE_S_BLOCKED; + ns_set_state(nsvc, nsvc->state | NSE_S_BLOCKED); rc = tlv_parse(&tp, &ns_att_tlvdef, nsh->data, msgb_l2len(msg) - sizeof(*nsh), 0, 0); @@ -1253,7 +1272,7 @@ get_value_string(gprs_ns_pdu_strings, nsh->pdu_type), gprs_ns_ll_str(fallback_nsvc)); fallback_nsvc->nsvci = fallback_nsvc->nsei = 0xfffe; fallback_nsvc->nsvci_is_valid = 0; - fallback_nsvc->state = NSE_S_ALIVE; + ns_set_state(fallback_nsvc, NSE_S_ALIVE); rc = gprs_ns_tx_status(fallback_nsvc, NS_CAUSE_PDU_INCOMP_PSTATE, 0, msg); @@ -1376,15 +1395,15 @@ case NS_PDUT_UNBLOCK: /* Section 7.2: unblocking procedure */ LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS UNBLOCK\n", (*nsvc)->nsei); - (*nsvc)->state &= ~NSE_S_BLOCKED; + ns_set_state(*nsvc, (*nsvc)->state & (~NSE_S_BLOCKED)); ns_osmo_signal_dispatch(*nsvc, S_NS_UNBLOCK, 0); rc = gprs_ns_tx_simple(*nsvc, NS_PDUT_UNBLOCK_ACK); break; case NS_PDUT_UNBLOCK_ACK: LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS UNBLOCK ACK\n", (*nsvc)->nsei); /* mark NS-VC as unblocked + active */ - (*nsvc)->state = NSE_S_ALIVE; - (*nsvc)->remote_state = NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_ALIVE); + ns_set_remote_state(*nsvc, NSE_S_ALIVE); ns_osmo_signal_dispatch(*nsvc, S_NS_UNBLOCK, 0); break; case NS_PDUT_BLOCK: @@ -1393,7 +1412,7 @@ case NS_PDUT_BLOCK_ACK: LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS BLOCK ACK\n", (*nsvc)->nsei); /* mark remote NS-VC as blocked + active */ - (*nsvc)->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_remote_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); break; default: LOGP(DNS, LOGL_NOTICE, "NSEI=%u Rx Unknown NS PDU type 0x%02x\n", @@ -1601,7 +1620,7 @@ nsvc->nsei); /* Mark NS-VC locally as blocked and dead */ - nsvc->state = NSE_S_BLOCKED | NSE_S_RESET; + ns_set_state(nsvc, NSE_S_BLOCKED | NSE_S_RESET); /* Send NS-RESET PDU */ rc = gprs_ns_tx_reset(nsvc, cause); -- To view, visit https://gerrit.osmocom.org/4382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5d6eaef0432d9be810bf93d07e40787b9ca59142 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 23 13:34:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 13:34:29 +0000 Subject: osmo-bsc[master]: libbsc: Use correct printf formatting for uint64_t In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4379 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibad1e4f09cf912cb654dbe3687a3f2182e2060f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 13:39:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 13:39:52 +0000 Subject: openbsc[master]: libbsc: Use correct printf formatting for uint64_t In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/4380/1//COMMIT_MSG Commit Message: Line 9: libbsc: Use correct printf formatting for uint64_t yes, I get it :) -- To view, visit https://gerrit.osmocom.org/4380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9719c69ef661bb46d8bb43cf8d6537c3e8d47826 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 13:49:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 13:49:16 +0000 Subject: [PATCH] libosmocore[master]: GPRS: wrap NS state assignment in macro In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4382 to look at the new patch set (#2). GPRS: wrap NS state assignment in macro This enables logging for every state transition which makes NS troubleshooting easier. Change-Id: I5d6eaef0432d9be810bf93d07e40787b9ca59142 Related: SYS#3610 --- M src/gb/gprs_ns.c 1 file changed, 33 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/4382/2 diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 7443a8b..3f7be69 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -84,6 +84,9 @@ #include "common_vty.h" +#define ns_set_state(ns_, st_) ns_set_state_with_log(ns_, st_, false, __BASE_FILE__, __LINE__) +#define ns_set_remote_state(ns_, st_) ns_set_state_with_log(ns_, st_, true, __BASE_FILE__, __LINE__) + static const struct tlv_definition ns_att_tlvdef = { .def = { [NS_IE_CAUSE] = { TLV_TYPE_TvLV, 0 }, @@ -174,6 +177,22 @@ return msg; } +/* FIXME: convert to osmo_fsm */ +static inline void ns_set_state_with_log(struct gprs_nsvc *nsvc, uint32_t state, bool is_remote, + const char *file, unsigned line) +{ + uint32_t old_state = is_remote ? nsvc->remote_state : nsvc->state; + + LOGPSRC(DNS, LOGL_DEBUG, file, line, "NSEI %d (NS-VCI=%u) setting %sstate [%s,%s,%s] -> [%s,%s,%s]\n", + nsvc->nsei, nsvc->nsvci, is_remote ? "remote " : "", + NS_DESC_A(old_state), NS_DESC_B(old_state), NS_DESC_R(old_state), + NS_DESC_A(state), NS_DESC_B(state), NS_DESC_R(state)); + + if (is_remote) + nsvc->remote_state = state; + else + nsvc->state = state; +} /*! Lookup struct gprs_nsvc based on NSVCI * \param[in] nsi NS instance in which to search @@ -245,7 +264,7 @@ nsvc->nsvci = nsvci; nsvc->nsvci_is_valid = 1; /* before RESET procedure: BLOCKED and DEAD */ - nsvc->state = NSE_S_BLOCKED; + ns_set_state(nsvc, NSE_S_BLOCKED); nsvc->nsi = nsi; osmo_timer_setup(&nsvc->timer, gprs_ns_timer_cb, nsvc); nsvc->ctrg = rate_ctr_group_alloc(nsvc, &nsvc_ctrg_desc, nsvci); @@ -510,7 +529,7 @@ nsvc->nsei, nsvc->nsvci, gprs_ns_cause_str(cause)); /* be conservative and mark it as blocked even now! */ - nsvc->state |= NSE_S_BLOCKED; + ns_set_state(nsvc, nsvc->state | NSE_S_BLOCKED); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]); msg->l2h = msgb_put(msg, sizeof(*nsh)); @@ -621,7 +640,7 @@ if (nsvc->alive_retries > nsvc->nsi->timeout[NS_TOUT_TNS_ALIVE_RETRIES]) { /* mark as dead and blocked */ - nsvc->state = NSE_S_BLOCKED; + ns_set_state(nsvc, NSE_S_BLOCKED); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_DEAD]); LOGP(DNS, LOGL_NOTICE, @@ -652,7 +671,7 @@ "NSEI=%u Reset timed out but RESET flag is not set\n", nsvc->nsei); /* Mark NS-VC locally as blocked and dead */ - nsvc->state = NSE_S_BLOCKED | NSE_S_RESET; + ns_set_state(nsvc, NSE_S_BLOCKED | NSE_S_RESET); /* Chapter 7.3: Re-send the RESET */ gprs_ns_tx_reset(nsvc, NS_CAUSE_OM_INTERVENTION); /* Re-start Tns-reset timer */ @@ -912,7 +931,7 @@ } /* Mark NS-VC as blocked and alive */ - (*nsvc)->state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); if (orig_nsvc) { rate_ctr_inc(&(*nsvc)->ctrg->ctr[NS_CTR_REPLACED]); @@ -1052,8 +1071,8 @@ } /* Mark NS-VC as blocked and alive */ - (*nsvc)->state = NSE_S_BLOCKED | NSE_S_ALIVE; - (*nsvc)->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); + ns_set_remote_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); rate_ctr_inc(&(*nsvc)->ctrg->ctr[NS_CTR_BLOCKED]); if ((*nsvc)->persistent || (*nsvc)->remote_end_is_sgsn) { /* stop RESET timer */ @@ -1075,7 +1094,7 @@ LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS BLOCK\n", nsvc->nsei); - nsvc->state |= NSE_S_BLOCKED; + ns_set_state(nsvc, nsvc->state | NSE_S_BLOCKED); rc = tlv_parse(&tp, &ns_att_tlvdef, nsh->data, msgb_l2len(msg) - sizeof(*nsh), 0, 0); @@ -1253,7 +1272,7 @@ get_value_string(gprs_ns_pdu_strings, nsh->pdu_type), gprs_ns_ll_str(fallback_nsvc)); fallback_nsvc->nsvci = fallback_nsvc->nsei = 0xfffe; fallback_nsvc->nsvci_is_valid = 0; - fallback_nsvc->state = NSE_S_ALIVE; + ns_set_state(fallback_nsvc, NSE_S_ALIVE); rc = gprs_ns_tx_status(fallback_nsvc, NS_CAUSE_PDU_INCOMP_PSTATE, 0, msg); @@ -1376,15 +1395,15 @@ case NS_PDUT_UNBLOCK: /* Section 7.2: unblocking procedure */ LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS UNBLOCK\n", (*nsvc)->nsei); - (*nsvc)->state &= ~NSE_S_BLOCKED; + ns_set_state(*nsvc, (*nsvc)->state & (~NSE_S_BLOCKED)); ns_osmo_signal_dispatch(*nsvc, S_NS_UNBLOCK, 0); rc = gprs_ns_tx_simple(*nsvc, NS_PDUT_UNBLOCK_ACK); break; case NS_PDUT_UNBLOCK_ACK: LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS UNBLOCK ACK\n", (*nsvc)->nsei); /* mark NS-VC as unblocked + active */ - (*nsvc)->state = NSE_S_ALIVE; - (*nsvc)->remote_state = NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_ALIVE); + ns_set_remote_state(*nsvc, NSE_S_ALIVE); ns_osmo_signal_dispatch(*nsvc, S_NS_UNBLOCK, 0); break; case NS_PDUT_BLOCK: @@ -1393,7 +1412,7 @@ case NS_PDUT_BLOCK_ACK: LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS BLOCK ACK\n", (*nsvc)->nsei); /* mark remote NS-VC as blocked + active */ - (*nsvc)->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_remote_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); break; default: LOGP(DNS, LOGL_NOTICE, "NSEI=%u Rx Unknown NS PDU type 0x%02x\n", @@ -1601,7 +1620,7 @@ nsvc->nsei); /* Mark NS-VC locally as blocked and dead */ - nsvc->state = NSE_S_BLOCKED | NSE_S_RESET; + ns_set_state(nsvc, NSE_S_BLOCKED | NSE_S_RESET); /* Send NS-RESET PDU */ rc = gprs_ns_tx_reset(nsvc, cause); -- To view, visit https://gerrit.osmocom.org/4382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5d6eaef0432d9be810bf93d07e40787b9ca59142 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 23 13:49:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 13:49:39 +0000 Subject: osmo-mgw[master]: mgcp: move port/timeslot calculator to mgcp_common.h In-Reply-To: References: Message-ID: Patch Set 6: > No, the new MGW does not make use of these functions. Anything that's not used by the new osmo-mgw shouldn't be part of libosmo-mgcp. Either remain in libosmo-legacy-mgcp if only used by old programs, or, if they are still used/going to be used by other binaries after they moved to the new libosmo-sigtran, they can go into libosmo-mgcp-client. But I hope I'm not missing anything, particularly, I haven't wrapped my head around the future of osmo-bsc_nat or whether/how we will replace osmo-bsc_mgcp. Anyway, it seems good to keep legacy ways in the legacy library as much as possible; anything using the new libosmo-mgcp should use the port numbers returned upon CRCX, right? Hence we need no magic port calculation for libosmo-mgcp and neither for libosmo-mgcp-client? How did this patch come about? For which caller? -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 13:52:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 13:52:01 +0000 Subject: openbsc[master]: libbsc: Use correct printf formatting for uint64_t In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4380/1//COMMIT_MSG Commit Message: Line 9: libbsc: Use correct printf formatting for uint64_t > yes, I get it :) Damn backporting to openbsc! -- To view, visit https://gerrit.osmocom.org/4380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9719c69ef661bb46d8bb43cf8d6537c3e8d47826 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 13:52:46 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 23 Oct 2017 13:52:46 +0000 Subject: [PATCH] osmo-sgsn[master]: non-iu-build: gurd vty libosmo-sigtran function calls. In-Reply-To: References: Message-ID: Hello Max, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4369 to look at the new patch set (#2). non-iu-build: gurd vty libosmo-sigtran function calls. 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 --- M src/gprs/gtphub_main.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/69/4369/2 diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index 782afb3..c3e25d5 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -115,6 +115,7 @@ } } +#if BUILD_IU int gtphub_vty_go_parent(struct vty *vty) { switch (vty->node) { @@ -124,13 +125,16 @@ return vty->node; } +#endif int gtphub_vty_is_config_node(struct vty *vty, int node) { /* Check if libosmo-sccp declares the node in * question as config node */ +#if BUILD_IU if (osmo_ss7_is_config_node(vty, node)) return 1; +#endif switch (node) { /* add items that are not config */ @@ -145,7 +149,9 @@ static struct vty_app_info vty_info = { .name = "OsmoGTPhub", .version = PACKAGE_VERSION, +#if BUILD_IU .go_parent_cb = gtphub_vty_go_parent, +#endif .is_config_node = gtphub_vty_is_config_node, }; -- To view, visit https://gerrit.osmocom.org/4369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1c609ef0c344ce825c313335c7e084bf97159262 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Oct 23 13:53:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 13:53:16 +0000 Subject: [PATCH] openbsc[master]: libbsc: Use correct printf formatting for uint64_t In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4380 to look at the new patch set (#2). libbsc: Use correct printf formatting for uint64_t unsigned long can be 32 bits on some arch/OS, while "current" field is always 64 bit because it's a uint64_t. Change-Id: I9719c69ef661bb46d8bb43cf8d6537c3e8d47826 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/80/4380/2 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 0d5377d..f50ebd8 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -3750,20 +3750,20 @@ void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net) { - vty_out(vty, "Channel Requests : %lu total, %lu no channel%s", + vty_out(vty, "Channel Requests : %"PRIu64" total, %"PRIu64" no channel%s", net->bsc_ctrs->ctr[BSC_CTR_CHREQ_TOTAL].current, net->bsc_ctrs->ctr[BSC_CTR_CHREQ_NO_CHANNEL].current, VTY_NEWLINE); - vty_out(vty, "Channel Failures : %lu rf_failures, %lu rll failures%s", + vty_out(vty, "Channel Failures : %"PRIu64" rf_failures, %"PRIu64" rll failures%s", net->bsc_ctrs->ctr[BSC_CTR_CHAN_RF_FAIL].current, net->bsc_ctrs->ctr[BSC_CTR_CHAN_RLL_ERR].current, VTY_NEWLINE); - vty_out(vty, "Paging : %lu attempted, %lu complete, %lu expired%s", + vty_out(vty, "Paging : %"PRIu64" attempted, %"PRIu64" complete, %"PRIu64" expired%s", net->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED].current, net->bsc_ctrs->ctr[BSC_CTR_PAGING_COMPLETED].current, net->bsc_ctrs->ctr[BSC_CTR_PAGING_EXPIRED].current, VTY_NEWLINE); - vty_out(vty, "BTS failures : %lu OML, %lu RSL%s", + vty_out(vty, "BTS failures : %"PRIu64" OML, %"PRIu64" RSL%s", net->bsc_ctrs->ctr[BSC_CTR_BTS_OML_FAIL].current, net->bsc_ctrs->ctr[BSC_CTR_BTS_RSL_FAIL].current, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/4380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9719c69ef661bb46d8bb43cf8d6537c3e8d47826 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 13:55:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 13:55:38 +0000 Subject: [PATCH] libosmocore[master]: fixups for recent "Cleanup jenkins build scripts" Message-ID: Review at https://gerrit.osmocom.org/4383 fixups for recent "Cleanup jenkins build scripts" Change I24e500e132f5c8e8133d35548cb7b4e4552331d0 was merged, but IMHO needs improvement. Fix these: - clean the git source tree before each build step, in common prep_build(). - fix indenting inside the build() macros. - change build() arg to be build_dir, to absorb cleanup steps into build(). - in jenkins.sh, use $ENABLE_SANITIZE as global env, not passed as arg. - in jenkins.sh, don't do 'make distcheck' twice. It is not necessary to do it from source tree as well as separately from source tree, since distcheck already moves to a different build dir. Change-Id: I09d306350602f21943d5bd45f7388c83ede9b524 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh M contrib/jenkins_common.sh 3 files changed, 43 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/4383/1 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index e0c75fa..ef116b1 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -2,8 +2,13 @@ . $(dirname "$0")/jenkins_common.sh +src_dir="$PWD" build() { - $1 --enable-static \ + build_dir="$1" + + prep_build "$src_dir" "$build_dir" + + "$src_dir"/configure --enable-static \ --prefix=/usr/local/arm-none-eabi \ --host=arm-none-eabi \ --enable-embedded \ @@ -11,15 +16,11 @@ --disable-shared \ CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" -$MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh + $MAKE $PARALLEL_MAKE \ + || cat-testlogs.sh } # verify build in dir other than source tree -mkdir -p builddir -cd builddir -build ../configure - -cd .. -build ./configure - +build builddir +# verify build in source tree +build . diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index c397d52..d731504 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -9,19 +9,23 @@ ENABLE_SANITIZE="" fi +src_dir="$PWD" build() { - $1 --enable-static $2 CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh + build_dir="$1" + + prep_build "$src_dir" "$build_dir" + + "$src_dir"/configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" + $MAKE $PARALLEL_MAKE check \ + || cat-testlogs.sh } # verify build in dir other than source tree -mkdir -p builddir -cd builddir -build ../configure $ENABLE_SANITIZE +build builddir +# verify build in source tree +build . -cd .. -build ./configure $ENABLE_SANITIZE - +# do distcheck only once, which is fine from built source tree, since distcheck +# is well separated from the source tree state. +$MAKE distcheck \ + || cat-testlogs.sh diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index e52a96a..6cfa334 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -4,4 +4,20 @@ verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") -autoreconf --install --force +prep_build() { + _src_dir="$1" + _build_dir="$2" + + cd "$_src_dir" + + # a failed 'make distcheck' may leave files without write permissions + chmod -R a+w . + git clean -dxf + # make absolutely sure no src files have modifications + git checkout -f HEAD + + autoreconf --install --force + + mkdir -p "$_build_dir" + cd "$_build_dir" +} -- To view, visit https://gerrit.osmocom.org/4383 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09d306350602f21943d5bd45f7388c83ede9b524 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 13:55:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 13:55:39 +0000 Subject: [PATCH] libosmocore[master]: jenkins: bail early if $MAKE env var is not set Message-ID: Review at https://gerrit.osmocom.org/4384 jenkins: bail early if $MAKE env var is not set If $MAKE is unset, it produces confusing errors, rather check explicitly. Change-Id: I59b111dfdee4e1edea04155144f01d99f5f72aa1 --- M contrib/jenkins_common.sh 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/4384/1 diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 6cfa334..bc4ac65 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -2,6 +2,12 @@ set -ex +if [ -z "$MAKE" ]; then + set +x + echo "Error: you need to set \$MAKE before invoking, e.g. MAKE=make" + exit 1 +fi + verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") prep_build() { -- To view, visit https://gerrit.osmocom.org/4384 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I59b111dfdee4e1edea04155144f01d99f5f72aa1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 14:01:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 14:01:11 +0000 Subject: [PATCH] libosmocore[master]: GPRS: wrap NS state assignment in macro In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4382 to look at the new patch set (#3). GPRS: wrap NS state assignment in macro This enables logging for every state transition which makes NS troubleshooting easier. Change-Id: I5d6eaef0432d9be810bf93d07e40787b9ca59142 Related: SYS#3610 --- M src/gb/gprs_ns.c 1 file changed, 35 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/4382/3 diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 7443a8b..a77e203 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -84,6 +84,11 @@ #include "common_vty.h" +#define ns_set_state(ns_, st_) ns_set_state_with_log(ns_, st_, false, __BASE_FILE__, __LINE__) +#define ns_set_remote_state(ns_, st_) ns_set_state_with_log(ns_, st_, true, __BASE_FILE__, __LINE__) +#define ns_mark_blocked(ns_) ns_set_state(ns_, (ns_)->state | NSE_S_BLOCKED) +#define ns_mark_unblocked(ns_) ns_set_state(ns_, (ns_)->state & (~NSE_S_BLOCKED)); + static const struct tlv_definition ns_att_tlvdef = { .def = { [NS_IE_CAUSE] = { TLV_TYPE_TvLV, 0 }, @@ -174,6 +179,22 @@ return msg; } +/* FIXME: convert to osmo_fsm */ +static inline void ns_set_state_with_log(struct gprs_nsvc *nsvc, uint32_t state, bool is_remote, + const char *file, unsigned line) +{ + uint32_t old_state = is_remote ? nsvc->remote_state : nsvc->state; + + LOGPSRC(DNS, LOGL_DEBUG, file, line, "NSEI %d (NS-VCI=%u) setting %sstate [%s,%s,%s] -> [%s,%s,%s]\n", + nsvc->nsei, nsvc->nsvci, is_remote ? "remote " : "", + NS_DESC_A(old_state), NS_DESC_B(old_state), NS_DESC_R(old_state), + NS_DESC_A(state), NS_DESC_B(state), NS_DESC_R(state)); + + if (is_remote) + nsvc->remote_state = state; + else + nsvc->state = state; +} /*! Lookup struct gprs_nsvc based on NSVCI * \param[in] nsi NS instance in which to search @@ -245,7 +266,7 @@ nsvc->nsvci = nsvci; nsvc->nsvci_is_valid = 1; /* before RESET procedure: BLOCKED and DEAD */ - nsvc->state = NSE_S_BLOCKED; + ns_set_state(nsvc, NSE_S_BLOCKED); nsvc->nsi = nsi; osmo_timer_setup(&nsvc->timer, gprs_ns_timer_cb, nsvc); nsvc->ctrg = rate_ctr_group_alloc(nsvc, &nsvc_ctrg_desc, nsvci); @@ -510,7 +531,7 @@ nsvc->nsei, nsvc->nsvci, gprs_ns_cause_str(cause)); /* be conservative and mark it as blocked even now! */ - nsvc->state |= NSE_S_BLOCKED; + ns_mark_blocked(nsvc); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]); msg->l2h = msgb_put(msg, sizeof(*nsh)); @@ -621,7 +642,7 @@ if (nsvc->alive_retries > nsvc->nsi->timeout[NS_TOUT_TNS_ALIVE_RETRIES]) { /* mark as dead and blocked */ - nsvc->state = NSE_S_BLOCKED; + ns_set_state(nsvc, NSE_S_BLOCKED); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_DEAD]); LOGP(DNS, LOGL_NOTICE, @@ -652,7 +673,7 @@ "NSEI=%u Reset timed out but RESET flag is not set\n", nsvc->nsei); /* Mark NS-VC locally as blocked and dead */ - nsvc->state = NSE_S_BLOCKED | NSE_S_RESET; + ns_set_state(nsvc, NSE_S_BLOCKED | NSE_S_RESET); /* Chapter 7.3: Re-send the RESET */ gprs_ns_tx_reset(nsvc, NS_CAUSE_OM_INTERVENTION); /* Re-start Tns-reset timer */ @@ -912,7 +933,7 @@ } /* Mark NS-VC as blocked and alive */ - (*nsvc)->state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); if (orig_nsvc) { rate_ctr_inc(&(*nsvc)->ctrg->ctr[NS_CTR_REPLACED]); @@ -1052,8 +1073,8 @@ } /* Mark NS-VC as blocked and alive */ - (*nsvc)->state = NSE_S_BLOCKED | NSE_S_ALIVE; - (*nsvc)->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); + ns_set_remote_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); rate_ctr_inc(&(*nsvc)->ctrg->ctr[NS_CTR_BLOCKED]); if ((*nsvc)->persistent || (*nsvc)->remote_end_is_sgsn) { /* stop RESET timer */ @@ -1075,7 +1096,7 @@ LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS BLOCK\n", nsvc->nsei); - nsvc->state |= NSE_S_BLOCKED; + ns_mark_blocked(nsvc); rc = tlv_parse(&tp, &ns_att_tlvdef, nsh->data, msgb_l2len(msg) - sizeof(*nsh), 0, 0); @@ -1253,7 +1274,7 @@ get_value_string(gprs_ns_pdu_strings, nsh->pdu_type), gprs_ns_ll_str(fallback_nsvc)); fallback_nsvc->nsvci = fallback_nsvc->nsei = 0xfffe; fallback_nsvc->nsvci_is_valid = 0; - fallback_nsvc->state = NSE_S_ALIVE; + ns_set_state(fallback_nsvc, NSE_S_ALIVE); rc = gprs_ns_tx_status(fallback_nsvc, NS_CAUSE_PDU_INCOMP_PSTATE, 0, msg); @@ -1376,15 +1397,15 @@ case NS_PDUT_UNBLOCK: /* Section 7.2: unblocking procedure */ LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS UNBLOCK\n", (*nsvc)->nsei); - (*nsvc)->state &= ~NSE_S_BLOCKED; + ns_mark_unblocked(*nsvc); ns_osmo_signal_dispatch(*nsvc, S_NS_UNBLOCK, 0); rc = gprs_ns_tx_simple(*nsvc, NS_PDUT_UNBLOCK_ACK); break; case NS_PDUT_UNBLOCK_ACK: LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS UNBLOCK ACK\n", (*nsvc)->nsei); /* mark NS-VC as unblocked + active */ - (*nsvc)->state = NSE_S_ALIVE; - (*nsvc)->remote_state = NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_ALIVE); + ns_set_remote_state(*nsvc, NSE_S_ALIVE); ns_osmo_signal_dispatch(*nsvc, S_NS_UNBLOCK, 0); break; case NS_PDUT_BLOCK: @@ -1393,7 +1414,7 @@ case NS_PDUT_BLOCK_ACK: LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS BLOCK ACK\n", (*nsvc)->nsei); /* mark remote NS-VC as blocked + active */ - (*nsvc)->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_remote_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); break; default: LOGP(DNS, LOGL_NOTICE, "NSEI=%u Rx Unknown NS PDU type 0x%02x\n", @@ -1601,7 +1622,7 @@ nsvc->nsei); /* Mark NS-VC locally as blocked and dead */ - nsvc->state = NSE_S_BLOCKED | NSE_S_RESET; + ns_set_state(nsvc, NSE_S_BLOCKED | NSE_S_RESET); /* Send NS-RESET PDU */ rc = gprs_ns_tx_reset(nsvc, cause); -- To view, visit https://gerrit.osmocom.org/4382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5d6eaef0432d9be810bf93d07e40787b9ca59142 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 23 14:13:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 23 Oct 2017 14:13:39 +0000 Subject: osmo-mgw[master]: mgcp: move port/timeslot calculator to mgcp_common.h In-Reply-To: References: Message-ID: Patch Set 6: > > No, the new MGW does not make use of these functions. > > Anything that's not used by the new osmo-mgw shouldn't be part of > libosmo-mgcp. Either remain in libosmo-legacy-mgcp if only used by > old programs, or, if they are still used/going to be used by other > binaries after they moved to the new libosmo-sigtran, they can go > into libosmo-mgcp-client. > > But I hope I'm not missing anything, particularly, I haven't > wrapped my head around the future of osmo-bsc_nat or whether/how we > will replace osmo-bsc_mgcp. > > Anyway, it seems good to keep legacy ways in the legacy library as > much as possible; anything using the new libosmo-mgcp should use > the port numbers returned upon CRCX, right? Hence we need no magic > port calculation for libosmo-mgcp and neither for libosmo-mgcp-client? > > How did this patch come about? For which caller? I have to be able to call the functions here: https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_bssap.c (caller is bssmap_handle_clear_command()) If its now no problem anymore to use libosmo-mgcp-client and the libosmo-legacy-mgcp at the same time we can keep the functions in libosmo-legacy-mgcp. Is it save to include mgcp.h from legacy? I am not so sure about this. Moving the functions to libosmo-mgcp-client is probably the best we can do. -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 14:27:51 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 23 Oct 2017 14:27:51 +0000 Subject: [PATCH] osmo-sgsn[master]: non-iu-build: guard vty libosmo-sigtran function calls. In-Reply-To: References: Message-ID: Hello Max, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4369 to look at the new patch set (#3). non-iu-build: guard vty libosmo-sigtran function calls. 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 --- M src/gprs/gtphub_main.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/69/4369/3 diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index 782afb3..c3e25d5 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -115,6 +115,7 @@ } } +#if BUILD_IU int gtphub_vty_go_parent(struct vty *vty) { switch (vty->node) { @@ -124,13 +125,16 @@ return vty->node; } +#endif int gtphub_vty_is_config_node(struct vty *vty, int node) { /* Check if libosmo-sccp declares the node in * question as config node */ +#if BUILD_IU if (osmo_ss7_is_config_node(vty, node)) return 1; +#endif switch (node) { /* add items that are not config */ @@ -145,7 +149,9 @@ static struct vty_app_info vty_info = { .name = "OsmoGTPhub", .version = PACKAGE_VERSION, +#if BUILD_IU .go_parent_cb = gtphub_vty_go_parent, +#endif .is_config_node = gtphub_vty_is_config_node, }; -- To view, visit https://gerrit.osmocom.org/4369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1c609ef0c344ce825c313335c7e084bf97159262 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Oct 23 14:39:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 14:39:24 +0000 Subject: osmo-mgw[master]: mgcp: move port/timeslot calculator to mgcp_common.h In-Reply-To: References: Message-ID: Patch Set 6: Code-Review-2 > I have to be able to call the functions here: https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_bssap.c > (caller is bssmap_handle_clear_command()) Nope, the caller is bssmap_handle_assignm_req(). Right? Let's take a look at the general situation. If I'm not missing anything, your only caller is inside an 'if' path that is for SCCPlite, and we are also discussing whether having SCCPlite paths in the new osmo-bsc is even possible. If the AoIP osmo-bsc can do SCCPlite, it should be by adding SCCPlite to libosmo-sigtran, according to Harald. IIUC your changes to include AoIP in osmo-bsc have disconnected SCCPlite beyond a working state, so it makes no sense to move things into libosmo-mgcp just to accomodate legacy code that we should drop instead. Let me know if I'm missing anything here. All other callers are in osmo-bsc_nat, which still needs a separate close look. I still don't know / keep forgetting what its precise use is and, more importantly, how it relates to our new libosmo-mgcp and -client. Maybe it should just remain using libosmo-legacy-mgcp for the time being? Any "weird" port calculation functions should then go directly to the program using them or remain in libosmo-legacy-mgcp. Marking -2 for now until these questions are resolved. -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 14:49:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 14:49:21 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 2: > > > Maybe this patch should include the LIBVERSION bump, and making a semantic release with signed tag needs to happen after the merge? > > It contradicts recommendations from https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info I don't see it, which part contradicts? > It doesn't mean it's completely bad but at least we should remember > to not update it again if it was updated already since the last > release. Yes, if we do it this way, each code change does a LIBVERSION bump, and such bump must no longer be part of the release process. > Also, updating "current" component of libversion means that we'll > have to update the filenames and metadata in debian/ as well which > is not yet covered by release automation so it has to be done > manually. Having to adjust the debian package names is a really cumbersome part of this. I wish we could do this automatically from interpreting LIBVERSION somehow..... I guess worst is the 'Conflicts' part (BTW, is it really necessary to conflict with earlier LIBVERSIONs?). As it is now, a software change breaking API/ABI also needs, besides the LIBVERSION bump, some "weird" debian packaging details committed alongside with it, and every developer has to know what's going on there to do it correctly (i.e. we'll have numerous -1 by the release manager until it's gotten right). -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 14:54:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 14:54:32 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 2: > Yes, if we do it this way, each code change does a LIBVERSION bump, each API/ABI *breaking* or extending code change > Having to adjust the debian package names is a really cumbersome > part of this. Is it harmful to only adjust the debian packaging upon a semantic release? What do we get, during nightly debian packages we pack a libosmo-foo_3.so in an osmo-foo-2.deb? -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:00:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 15:00:32 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 2: one step back from the release process discussion, which we should probably have been doing on openbsc@ anyway, back to this patch: The only API/ABI break here is adding struct members, and that is only a breaking change because we have a nested struct. What would it take to make this commit *not* break compatibility in the first place? struct gprs_ns_inst { [...] /*! NS-over-IP specific bits */ struct { struct osmo_fd fd; uint32_t local_ip; uint16_t local_port; int dscp; + /* see also .nsip2 */ } nsip; /*! NS-over-FR-over-GRE-over-IP specific bits */ struct { struct osmo_fd fd; uint32_t local_ip; unsigned int enabled:1; } frgre; + + struct { + uint32_t remote_ip; + uint16_t remote_port; + } nsip2; }; Kind of similar to adding new signature to existing API functions. The end result is not particularly beautiful, but we'd not break API. -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:01:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 15:01:54 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 2: > but we'd not break API. *ABI*. -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:03:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 15:03:26 +0000 Subject: osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Patch Set 4: > We should do that. Shall I do this on my side and push the changes > than within the original patch? yes plz, and abandon my ones if gerrit allows it -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:06:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 15:06:31 +0000 Subject: libosmocore[master]: Add tests for bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 3: > > this looks to me like it is imitating a "real" function from > libosmocore. > > It's not. There's similar code in OsmoPCU. Ah, so it *is* some sort of code dup? Hmm, from another repos, that makes it harder. Maybe the test should move to, or, be copied to osmo-pcu.git as well, there using the "real" function instead of a dup? It's not super necessary, but certainly nicer to not test a duplicate that may go out of sync. -- To view, visit https://gerrit.osmocom.org/4336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:08:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 15:08:36 +0000 Subject: libosmocore[master]: abis_nm: Add abis_nm_admin_name() API In-Reply-To: References: Message-ID: Patch Set 1: > This change will break building against older libosmocore versions > without a good reason to do so. ah, the other way around, of course... -- To view, visit https://gerrit.osmocom.org/4355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:09:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 15:09:46 +0000 Subject: osmo-sgsn[master]: non-iu-build: guard vty libosmo-sigtran function calls. In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c609ef0c344ce825c313335c7e084bf97159262 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:10:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 15:10:56 +0000 Subject: osmo-bsc[master]: libbsc: Use correct printf formatting for uint64_t In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4379 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibad1e4f09cf912cb654dbe3687a3f2182e2060f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:11:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 15:11:33 +0000 Subject: openbsc[master]: libbsc: Use correct printf formatting for uint64_t In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9719c69ef661bb46d8bb43cf8d6537c3e8d47826 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:16:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 15:16:04 +0000 Subject: libosmocore[master]: GPRS: unify NS state printing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I69f8d536135ae76dbca623c2f1ffba625adcb1e9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:17:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 15:17:25 +0000 Subject: libosmocore[master]: GPRS: wrap NS state assignment in macro In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5d6eaef0432d9be810bf93d07e40787b9ca59142 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:22:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 15:22:46 +0000 Subject: libosmocore[master]: Add tests for bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 3: > certainly nicer to not test a duplicate that may go out of sync We do not test "duplicate" we test bitvec_write_field() so it does not matter if code in the test differs from code in OsmoPCU (it probably already is). As long as bitvec_write_field() works as expected, the code in OsmoPCU will continue to work. -- To view, visit https://gerrit.osmocom.org/4336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:26:45 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 15:26:45 +0000 Subject: libosmocore[master]: fixups for recent "Cleanup jenkins build scripts" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4383 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09d306350602f21943d5bd45f7388c83ede9b524 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:27:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 15:27:10 +0000 Subject: libosmocore[master]: jenkins: bail early if $MAKE env var is not set In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4384 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59b111dfdee4e1edea04155144f01d99f5f72aa1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:33:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 23 Oct 2017 15:33:18 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 2: > I don't see it, which part contradicts? Rule #2: "Update the version information only immediately before a public release of your software. More frequent updates are unnecessary, and only guarantee that the current interface number gets larger faster." -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:43:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 15:43:19 +0000 Subject: [PATCH] libosmo-netif[master]: osmux_snprintf: Split logic parsing osmux header and AMR pay... Message-ID: Review at https://gerrit.osmocom.org/4385 osmux_snprintf: Split logic parsing osmux header and AMR payload The current code still expects to parse only AMR osmux frames, but that will be fixed in following patches. Change-Id: Ic2f4d1d3cc88af912bb43c8ecd90eacc6ff7190f --- M src/osmux.c 1 file changed, 13 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/85/4385/1 diff --git a/src/osmux.c b/src/osmux.c index 7290d99..cad4c5d 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -896,10 +896,11 @@ int osmux_snprintf(char *buf, size_t size, struct msgb *msg) { unsigned int remain = size; - int this_len, msg_off = 0; + unsigned int msg_off = 0; struct osmux_hdr *osmuxh; unsigned int offset = 0; int msg_len = msg->len; + uint32_t payload_len; int ret; if (size) @@ -914,20 +915,21 @@ } osmuxh = (struct osmux_hdr *)((uint8_t *)msg->data + msg_off); + ret = osmux_snprintf_header(buf + offset, remain, osmuxh); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + + msg_off += sizeof(struct osmux_hdr); + msg_len -= sizeof(struct osmux_hdr); + if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT %d, skipping\n", osmuxh->amr_ft); return -1; } - ret = osmux_snprintf_header(buf + offset, remain, osmuxh); - SNPRINTF_BUFFER_SIZE(ret, remain, offset); + payload_len = osmux_get_payload_len(osmuxh); - this_len = sizeof(struct osmux_hdr) + - osmux_get_payload_len(osmuxh); - msg_off += this_len; - - if (msg_len < this_len) { + if (msg_len < payload_len) { LOGP(DLMIB, LOGL_ERROR, "No room for OSMUX payload: only %d bytes\n", msg_len); @@ -936,10 +938,11 @@ ret = osmux_snprintf_payload(buf + offset, remain, osmux_get_payload(osmuxh), - osmux_get_payload_len(osmuxh)); + payload_len); SNPRINTF_BUFFER_SIZE(ret, remain, offset); - msg_len -= this_len; + msg_off += payload_len; + msg_len -= payload_len; } return offset; -- To view, visit https://gerrit.osmocom.org/4385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic2f4d1d3cc88af912bb43c8ecd90eacc6ff7190f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:43:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 15:43:23 +0000 Subject: [PATCH] libosmo-netif[master]: osmux_snprintf: Support different types of Osmux frames Message-ID: Review at https://gerrit.osmocom.org/4386 osmux_snprintf: Support different types of Osmux frames Previous implementation could handle data unexpectedly if an Osmux frame other than AMR was used as input. Change-Id: I48565472b47c2a0e5db50881fbb005537af8c70d --- M src/osmux.c 1 file changed, 36 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/86/4386/1 diff --git a/src/osmux.c b/src/osmux.c index cad4c5d..47fb927 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -921,30 +921,45 @@ msg_off += sizeof(struct osmux_hdr); msg_len -= sizeof(struct osmux_hdr); - if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { - LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT %d, skipping\n", - osmuxh->amr_ft); + switch (osmuxh->ft) { + case OSMUX_FT_SIGNAL: + ret = snprintf(buf + offset, remain, "[signal]"); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + break; + case OSMUX_FT_VOICE_AMR: + if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { + LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT %d, skipping\n", + osmuxh->amr_ft); + return -1; + } + + payload_len = osmux_get_payload_len(osmuxh); + + if (msg_len < payload_len) { + LOGP(DLMIB, LOGL_ERROR, + "No room for OSMUX payload: only %d bytes\n", + msg_len); + return -1; + } + + ret = osmux_snprintf_payload(buf + offset, remain, + osmux_get_payload(osmuxh), + payload_len); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + + msg_off += payload_len; + msg_len -= payload_len; + break; + case OSMUX_FT_DUMMY: + ret = snprintf(buf + offset, remain, "[dummy]"); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + break; + default: + LOGP(DLMIB, LOGL_ERROR, "Unknown OSMUX ft value %d\n", + osmuxh->ft); return -1; } - - payload_len = osmux_get_payload_len(osmuxh); - - if (msg_len < payload_len) { - LOGP(DLMIB, LOGL_ERROR, - "No room for OSMUX payload: only %d bytes\n", - msg_len); - return -1; - } - - ret = osmux_snprintf_payload(buf + offset, remain, - osmux_get_payload(osmuxh), - payload_len); - SNPRINTF_BUFFER_SIZE(ret, remain, offset); - - msg_off += payload_len; - msg_len -= payload_len; } - return offset; } -- To view, visit https://gerrit.osmocom.org/4386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I48565472b47c2a0e5db50881fbb005537af8c70d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:43:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 15:43:24 +0000 Subject: [PATCH] libosmo-netif[master]: osmux_snprintf: Add doxygen doc Message-ID: Review at https://gerrit.osmocom.org/4387 osmux_snprintf: Add doxygen doc Change-Id: Idb3fcf25be9558bfc2f822352c07ebc2cb7d5caa --- M src/osmux.c 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/87/4387/1 diff --git a/src/osmux.c b/src/osmux.c index 47fb927..b245167 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -892,7 +892,16 @@ return offset; } - +/*! Print osmux header fields and payload from msg into buffer buf. + * \param[out] buf buffer to store the output into + * \param[in] len length of buf in bytes + * \param[in] msgb message buffer containing one or more osmux frames + * \returns the number of characters printed (excluding the null byte used to end output to strings). + * + * If the output was truncated due to this limit, then the return value is the number of characters + * (excluding the terminating null byte) which would have been written to the final string if enough + * space had been available. + */ int osmux_snprintf(char *buf, size_t size, struct msgb *msg) { unsigned int remain = size; -- To view, visit https://gerrit.osmocom.org/4387 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idb3fcf25be9558bfc2f822352c07ebc2cb7d5caa Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:50:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 15:50:09 +0000 Subject: [MERGED] openbsc[master]: libbsc: Use correct printf formatting for uint64_t In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: libbsc: Use correct printf formatting for uint64_t ...................................................................... libbsc: Use correct printf formatting for uint64_t unsigned long can be 32 bits on some arch/OS, while "current" field is always 64 bit because it's a uint64_t. Change-Id: I9719c69ef661bb46d8bb43cf8d6537c3e8d47826 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 0d5377d..f50ebd8 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -3750,20 +3750,20 @@ void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net) { - vty_out(vty, "Channel Requests : %lu total, %lu no channel%s", + vty_out(vty, "Channel Requests : %"PRIu64" total, %"PRIu64" no channel%s", net->bsc_ctrs->ctr[BSC_CTR_CHREQ_TOTAL].current, net->bsc_ctrs->ctr[BSC_CTR_CHREQ_NO_CHANNEL].current, VTY_NEWLINE); - vty_out(vty, "Channel Failures : %lu rf_failures, %lu rll failures%s", + vty_out(vty, "Channel Failures : %"PRIu64" rf_failures, %"PRIu64" rll failures%s", net->bsc_ctrs->ctr[BSC_CTR_CHAN_RF_FAIL].current, net->bsc_ctrs->ctr[BSC_CTR_CHAN_RLL_ERR].current, VTY_NEWLINE); - vty_out(vty, "Paging : %lu attempted, %lu complete, %lu expired%s", + vty_out(vty, "Paging : %"PRIu64" attempted, %"PRIu64" complete, %"PRIu64" expired%s", net->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED].current, net->bsc_ctrs->ctr[BSC_CTR_PAGING_COMPLETED].current, net->bsc_ctrs->ctr[BSC_CTR_PAGING_EXPIRED].current, VTY_NEWLINE); - vty_out(vty, "BTS failures : %lu OML, %lu RSL%s", + vty_out(vty, "BTS failures : %"PRIu64" OML, %"PRIu64" RSL%s", net->bsc_ctrs->ctr[BSC_CTR_BTS_OML_FAIL].current, net->bsc_ctrs->ctr[BSC_CTR_BTS_RSL_FAIL].current, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/4380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9719c69ef661bb46d8bb43cf8d6537c3e8d47826 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 15:50:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 15:50:26 +0000 Subject: [MERGED] osmo-bsc[master]: libbsc: Use correct printf formatting for uint64_t In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: libbsc: Use correct printf formatting for uint64_t ...................................................................... libbsc: Use correct printf formatting for uint64_t unsigned long can be 32 bits on some arch/OS, while "current" field is always 64 bit because it's a uint64_t. Change-Id: Ibad1e4f09cf912cb654dbe3687a3f2182e2060f5 --- M src/libbsc/bsc_vty.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index ca29b4c..461e3d3 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -3769,20 +3769,20 @@ void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net) { - vty_out(vty, "Channel Requests : %lu total, %lu no channel%s", + vty_out(vty, "Channel Requests : %"PRIu64" total, %"PRIu64" no channel%s", net->bsc_ctrs->ctr[BSC_CTR_CHREQ_TOTAL].current, net->bsc_ctrs->ctr[BSC_CTR_CHREQ_NO_CHANNEL].current, VTY_NEWLINE); - vty_out(vty, "Channel Failures : %lu rf_failures, %lu rll failures%s", + vty_out(vty, "Channel Failures : %"PRIu64" rf_failures, %"PRIu64" rll failures%s", net->bsc_ctrs->ctr[BSC_CTR_CHAN_RF_FAIL].current, net->bsc_ctrs->ctr[BSC_CTR_CHAN_RLL_ERR].current, VTY_NEWLINE); - vty_out(vty, "Paging : %lu attempted, %lu complete, %lu expired%s", + vty_out(vty, "Paging : %"PRIu64" attempted, %"PRIu64" complete, %"PRIu64" expired%s", net->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED].current, net->bsc_ctrs->ctr[BSC_CTR_PAGING_COMPLETED].current, net->bsc_ctrs->ctr[BSC_CTR_PAGING_EXPIRED].current, VTY_NEWLINE); - vty_out(vty, "BTS failures : %lu OML, %lu RSL%s", + vty_out(vty, "BTS failures : %"PRIu64" OML, %"PRIu64" RSL%s", net->bsc_ctrs->ctr[BSC_CTR_BTS_OML_FAIL].current, net->bsc_ctrs->ctr[BSC_CTR_BTS_RSL_FAIL].current, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/4379 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibad1e4f09cf912cb654dbe3687a3f2182e2060f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 16:24:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 16:24:13 +0000 Subject: [MERGED] osmo-bsc[master]: bsc_vty: Improve description of mid-call-text cmd In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: bsc_vty: Improve description of mid-call-text cmd ...................................................................... bsc_vty: Improve description of mid-call-text cmd Change-Id: I367b7734390daf39160de6462e9b2210368666f4 --- M src/osmo-bsc/osmo_bsc_vty.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index 0e7003f..b5232c4 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -780,7 +780,8 @@ DEFUN(cfg_net_bsc_mid_call_text, cfg_net_bsc_mid_call_text_cmd, "mid-call-text .TEXT", - "Set the USSD notification to be send.\n" "Text to be sent\n") + "Set the USSD notification sent to running calls when switching from Grace to Off.\n" + "Text to be sent\n") { struct osmo_bsc_data *data = osmo_bsc_data(vty); char *txt = argv_concat(argv, argc, 0); -- To view, visit https://gerrit.osmocom.org/4349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I367b7734390daf39160de6462e9b2210368666f4 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 16:39:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 16:39:22 +0000 Subject: [PATCH] libosmocore[master]: abis_nm: Add abis_nm_admin_name() API In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4355 to look at the new patch set (#2). abis_nm: Add abis_nm_admin_name() API Similar APIs exist for opstate and availability status. This patch does not break backward compatibility because osmo-bsc still requires direct use of the structure in get_string_value(). Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 --- M include/osmocom/gsm/abis_nm.h 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/4355/2 diff --git a/include/osmocom/gsm/abis_nm.h b/include/osmocom/gsm/abis_nm.h index e031ee1..dd7ba0d 100644 --- a/include/osmocom/gsm/abis_nm.h +++ b/include/osmocom/gsm/abis_nm.h @@ -28,9 +28,16 @@ const char *abis_nm_event_type_name(uint8_t cause); const char *abis_nm_severity_name(uint8_t cause); extern const struct tlv_definition abis_nm_att_tlvdef; + const char *abis_nm_opstate_name(uint8_t os); const char *abis_nm_avail_name(uint8_t avail); const char *abis_nm_test_name(uint8_t test); +/*! Get human-readable string for OML administrative state */ +static inline const char *abis_nm_admin_name(uint8_t admin) +{ + return get_value_string(abis_nm_adm_state_names, admin); +} + extern const struct tlv_definition abis_nm_osmo_att_tlvdef; extern const struct tlv_definition abis_nm_att_tlvdef_ipa; -- To view, visit https://gerrit.osmocom.org/4355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 16:46:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 16:46:48 +0000 Subject: [PATCH] osmo-hlr[master]: vty: fix output of empty IMSI Message-ID: Review at https://gerrit.osmocom.org/4388 vty: fix output of empty IMSI Check *subscr->imsi, not subscr->imsi, since it is a char[]; same as msisdn below already does. Fixes: coverity CID 178166 Change-Id: I72e13efefbac0495b8dd1949a39fa44ebfd46b56 --- M src/hlr_vty_subscr.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/88/4388/1 diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c index 5704922..0a9ba76 100644 --- a/src/hlr_vty_subscr.c +++ b/src/hlr_vty_subscr.c @@ -43,7 +43,7 @@ vty_out(vty, " ID: %"PRIu64"%s", subscr->id, VTY_NEWLINE); - vty_out(vty, " IMSI: %s%s", subscr->imsi ? subscr->imsi : "none", VTY_NEWLINE); + vty_out(vty, " IMSI: %s%s", *subscr->imsi ? subscr->imsi : "none", VTY_NEWLINE); vty_out(vty, " MSISDN: %s%s", *subscr->msisdn ? subscr->msisdn : "none", VTY_NEWLINE); if (*subscr->vlr_number) vty_out(vty, " VLR number: %s%s", subscr->vlr_number, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/4388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72e13efefbac0495b8dd1949a39fa44ebfd46b56 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 16:48:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 16:48:33 +0000 Subject: [PATCH] osmo-hlr[master]: vty: fix output of empty IMSI In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4388 to look at the new patch set (#2). vty: fix output of empty IMSI Check *subscr->imsi, not subscr->imsi, since it is a char[]; same as msisdn below already does. Was introduced in change I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 / commit 183e7009afc8577f0d89c99f92a5720697040494. Fixes: coverity CID 178166 Change-Id: I72e13efefbac0495b8dd1949a39fa44ebfd46b56 --- M src/hlr_vty_subscr.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/88/4388/2 diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c index 5704922..0a9ba76 100644 --- a/src/hlr_vty_subscr.c +++ b/src/hlr_vty_subscr.c @@ -43,7 +43,7 @@ vty_out(vty, " ID: %"PRIu64"%s", subscr->id, VTY_NEWLINE); - vty_out(vty, " IMSI: %s%s", subscr->imsi ? subscr->imsi : "none", VTY_NEWLINE); + vty_out(vty, " IMSI: %s%s", *subscr->imsi ? subscr->imsi : "none", VTY_NEWLINE); vty_out(vty, " MSISDN: %s%s", *subscr->msisdn ? subscr->msisdn : "none", VTY_NEWLINE); if (*subscr->vlr_number) vty_out(vty, " VLR number: %s%s", subscr->vlr_number, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/4388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I72e13efefbac0495b8dd1949a39fa44ebfd46b56 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 23 16:48:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 16:48:46 +0000 Subject: osmo-hlr[master]: vty: fix output of empty IMSI In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72e13efefbac0495b8dd1949a39fa44ebfd46b56 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 16:48:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 16:48:47 +0000 Subject: [MERGED] osmo-hlr[master]: vty: fix output of empty IMSI In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: fix output of empty IMSI ...................................................................... vty: fix output of empty IMSI Check *subscr->imsi, not subscr->imsi, since it is a char[]; same as msisdn below already does. Was introduced in change I42b3b70a0439a8f2e4964d7cc31e593c1f0d7537 / commit 183e7009afc8577f0d89c99f92a5720697040494. Fixes: coverity CID 178166 Change-Id: I72e13efefbac0495b8dd1949a39fa44ebfd46b56 --- M src/hlr_vty_subscr.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c index 5704922..0a9ba76 100644 --- a/src/hlr_vty_subscr.c +++ b/src/hlr_vty_subscr.c @@ -43,7 +43,7 @@ vty_out(vty, " ID: %"PRIu64"%s", subscr->id, VTY_NEWLINE); - vty_out(vty, " IMSI: %s%s", subscr->imsi ? subscr->imsi : "none", VTY_NEWLINE); + vty_out(vty, " IMSI: %s%s", *subscr->imsi ? subscr->imsi : "none", VTY_NEWLINE); vty_out(vty, " MSISDN: %s%s", *subscr->msisdn ? subscr->msisdn : "none", VTY_NEWLINE); if (*subscr->vlr_number) vty_out(vty, " VLR number: %s%s", subscr->vlr_number, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/4388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I72e13efefbac0495b8dd1949a39fa44ebfd46b56 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 16:50:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 16:50:19 +0000 Subject: [PATCH] osmo-bts[master]: vty: Print string for Administrative state In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4358 to look at the new patch set (#2). vty: Print string for Administrative state Change-Id: Ie41479958d6a57708e4b50705fd85c65f02e4527 --- M src/common/vty.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/4358/2 diff --git a/src/common/vty.c b/src/common/vty.c index 77bb47d..1a158db 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -711,8 +711,9 @@ static void net_dump_nmstate(struct vty *vty, struct gsm_nm_state *nms) { - vty_out(vty,"Oper '%s', Admin %u, Avail '%s'%s", - abis_nm_opstate_name(nms->operational), nms->administrative, + vty_out(vty,"Oper '%s', Admin '%s', Avail '%s'%s", + abis_nm_opstate_name(nms->operational), + get_value_string(abis_nm_adm_state_names, nms->administrative), abis_nm_avail_name(nms->availability), VTY_NEWLINE); } -- To view, visit https://gerrit.osmocom.org/4358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie41479958d6a57708e4b50705fd85c65f02e4527 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 16:51:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 16:51:48 +0000 Subject: osmo-hlr[master]: vty: fix output of empty IMSI In-Reply-To: References: Message-ID: Patch Set 2: Shouldn't you be checking against '\0' then? Or it would be more clear at least. -- To view, visit https://gerrit.osmocom.org/4388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72e13efefbac0495b8dd1949a39fa44ebfd46b56 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 16:59:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 16:59:53 +0000 Subject: libosmocore[master]: abis_nm: Add abis_nm_admin_name() API In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 16:59:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 16:59:57 +0000 Subject: [MERGED] libosmocore[master]: abis_nm: Add abis_nm_admin_name() API In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: abis_nm: Add abis_nm_admin_name() API ...................................................................... abis_nm: Add abis_nm_admin_name() API Similar APIs exist for opstate and availability status. This patch does not break backward compatibility because osmo-bsc still requires direct use of the structure in get_string_value(). Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 --- M include/osmocom/gsm/abis_nm.h 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/abis_nm.h b/include/osmocom/gsm/abis_nm.h index e031ee1..dd7ba0d 100644 --- a/include/osmocom/gsm/abis_nm.h +++ b/include/osmocom/gsm/abis_nm.h @@ -28,9 +28,16 @@ const char *abis_nm_event_type_name(uint8_t cause); const char *abis_nm_severity_name(uint8_t cause); extern const struct tlv_definition abis_nm_att_tlvdef; + const char *abis_nm_opstate_name(uint8_t os); const char *abis_nm_avail_name(uint8_t avail); const char *abis_nm_test_name(uint8_t test); +/*! Get human-readable string for OML administrative state */ +static inline const char *abis_nm_admin_name(uint8_t admin) +{ + return get_value_string(abis_nm_adm_state_names, admin); +} + extern const struct tlv_definition abis_nm_osmo_att_tlvdef; extern const struct tlv_definition abis_nm_att_tlvdef_ipa; -- To view, visit https://gerrit.osmocom.org/4355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:00:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:00:26 +0000 Subject: osmo-bts[master]: vty: Print string for Administrative state In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie41479958d6a57708e4b50705fd85c65f02e4527 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:01:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:01:05 +0000 Subject: libosmo-netif[master]: osmux_snprintf: Support different types of Osmux frames In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I48565472b47c2a0e5db50881fbb005537af8c70d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:01:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:01:32 +0000 Subject: libosmo-netif[master]: osmux_snprintf: Support different types of Osmux frames In-Reply-To: References: Message-ID: Patch Set 1: unexpectedly in which way? what are the implications? crashes? I guess thhis could be added to the changelog -- To view, visit https://gerrit.osmocom.org/4386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I48565472b47c2a0e5db50881fbb005537af8c70d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:02:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:02:01 +0000 Subject: libosmo-netif[master]: osmux_snprintf: Split logic parsing osmux header and AMR pay... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic2f4d1d3cc88af912bb43c8ecd90eacc6ff7190f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:02:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:02:19 +0000 Subject: libosmo-netif[master]: osmux_snprintf: Add doxygen doc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4387 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idb3fcf25be9558bfc2f822352c07ebc2cb7d5caa Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:02:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:02:47 +0000 Subject: [MERGED] osmo-bts[master]: vty: Print string for Administrative state In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: Print string for Administrative state ...................................................................... vty: Print string for Administrative state Change-Id: Ie41479958d6a57708e4b50705fd85c65f02e4527 --- M src/common/vty.c 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/vty.c b/src/common/vty.c index 77bb47d..1a158db 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -711,8 +711,9 @@ static void net_dump_nmstate(struct vty *vty, struct gsm_nm_state *nms) { - vty_out(vty,"Oper '%s', Admin %u, Avail '%s'%s", - abis_nm_opstate_name(nms->operational), nms->administrative, + vty_out(vty,"Oper '%s', Admin '%s', Avail '%s'%s", + abis_nm_opstate_name(nms->operational), + get_value_string(abis_nm_adm_state_names, nms->administrative), abis_nm_avail_name(nms->availability), VTY_NEWLINE); } -- To view, visit https://gerrit.osmocom.org/4358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie41479958d6a57708e4b50705fd85c65f02e4527 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:14:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:14:16 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Add missing DEPENDS libosmo-sccp In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:14:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:14:35 +0000 Subject: meta-telephony[201705]: osmo-iuh: Split into packages libosmo-ranap and osmo-hnbgw In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib924a5a05c378c59dd44aed5b5b5fe897604e86b Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:14:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:14:47 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Enable iu support based on DISTRO_FEATURES In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4332 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd8068d61aeea228dd24c54df6e1ce87bfcafff5 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:15:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:15:09 +0000 Subject: meta-telephony[201705]: osmo-ggsn: Update SRCREV to get ippool related fixes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I631bb31b10657a8d3aa0fa40a37efdc693e98be0 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:25:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 17:25:53 +0000 Subject: [PATCH] libosmocore[master]: vty: Fix bad use of vector_slot() Message-ID: Review at https://gerrit.osmocom.org/4389 vty: Fix bad use of vector_slot() Fixes the compilation warning below: git/libosmocore/src/vty/command.c: In function ?cmd_complete_command_real?: git/libosmocore/src/vty/command.c:1953:33: warning: comparison between pointer and zero character const ant [-Wpointer-compare] if (vector_slot(vline, index) == '\0') ^~ git/libosmocore/src/vty/command.c:37:0: git/libosmocore/include/osmocom/vty/vector.h:39:27: note: did you mean to dereference the pointer? #define vector_slot(V,I) ((V)->index[(I)]) ^ git/libosmocore/src/vty/command.c:1953:7: note: in expansion of macro ?vector_slot? if (vector_slot(vline, index) == '\0') ^~~~~~~~~~~ Change-Id: Iaba9e3450d68c51e16a7bda2fc0fc370992ca866 --- M src/vty/command.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/4389/1 diff --git a/src/vty/command.c b/src/vty/command.c index 21b26b4..355fb5d 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -1950,7 +1950,7 @@ /* In case of 'command \t' pattern. Do you need '?' command at the end of the line. */ - if (vector_slot(vline, index) == '\0') + if (*(char *)vector_slot(vline, index) == '\0') *status = CMD_ERR_NOTHING_TODO; else *status = CMD_ERR_NO_MATCH; -- To view, visit https://gerrit.osmocom.org/4389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaba9e3450d68c51e16a7bda2fc0fc370992ca866 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:26:30 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 17:26:30 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Add missing DEPENDS libosmo-sccp In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:26:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 17:26:32 +0000 Subject: meta-telephony[201705]: osmo-iuh: Split into packages libosmo-ranap and osmo-hnbgw In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib924a5a05c378c59dd44aed5b5b5fe897604e86b Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:26:34 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 17:26:34 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Enable iu support based on DISTRO_FEATURES In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4332 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd8068d61aeea228dd24c54df6e1ce87bfcafff5 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:26:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 17:26:36 +0000 Subject: meta-telephony[201705]: osmo-msc: Enable iu support based on DISTRO_FEATURES In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaef50e96e80ef685748ddffa733ade84f5543eff Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:26:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 17:26:38 +0000 Subject: meta-telephony[201705]: osmo-ggsn: Update SRCREV to get ippool related fixes In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I631bb31b10657a8d3aa0fa40a37efdc693e98be0 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:26:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 17:26:44 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-ggsn: Update SRCREV to get ippool related fixes In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-ggsn: Update SRCREV to get ippool related fixes ...................................................................... osmo-ggsn: Update SRCREV to get ippool related fixes Change-Id: I631bb31b10657a8d3aa0fa40a37efdc693e98be0 --- M recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb b/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb index 5a383b9..2751985 100644 --- a/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb +++ b/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb @@ -5,7 +5,7 @@ PV = "1.0.0+gitr${SRCPV}" PR = "r0" -SRCREV = "b5624c3d4838cd774c3a6df4208b709890174a25" +SRCREV = "859f9b0752419d43928d465bc96a87238c6d7940" SRC_URI = "git://git.osmocom.org/osmo-ggsn \ file://osmo-ggsn.init \ file://libgtp-queue_depth_32.patch \ -- To view, visit https://gerrit.osmocom.org/4335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I631bb31b10657a8d3aa0fa40a37efdc693e98be0 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:26:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 17:26:45 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-msc: Enable iu support based on DISTRO_FEATURES In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-msc: Enable iu support based on DISTRO_FEATURES ...................................................................... osmo-msc: Enable iu support based on DISTRO_FEATURES Change-Id: Iaef50e96e80ef685748ddffa733ade84f5543eff --- M recipes-osmocom/osmo-msc/osmo-msc.inc 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-msc/osmo-msc.inc b/recipes-osmocom/osmo-msc/osmo-msc.inc index 829f947..9be747d 100644 --- a/recipes-osmocom/osmo-msc/osmo-msc.inc +++ b/recipes-osmocom/osmo-msc/osmo-msc.inc @@ -3,13 +3,15 @@ LICENSE = "AGPLv3" LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" -DEPENDS = "libdbi libasn1c osmo-iuh libosmocore libosmo-abis libosmo-sccp libosmo-netif libsmpp34 osmo-mgw" +DEPENDS = "libdbi libosmocore libosmo-abis libosmo-sccp libosmo-netif osmo-mgw" -INC_PR="r1.${META_TELEPHONY_OSMO_INC}" +INC_PR="r2.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd -EXTRA_OECONF += "--enable-smpp --enable-iu" +PACKAGECONFIG ??= "smpp ${@bb.utils.filter('DISTRO_FEATURES', 'iu', d)}" +PACKAGECONFIG[iu] = "--enable-iu,--disable-iu,libasn1c osmo-iuh," +PACKAGECONFIG[smpp] = "--enable-smpp,--disable-smpp,libsmpp34," RDEPENDS_${PN} = "libdbd-sqlite3" -- To view, visit https://gerrit.osmocom.org/4333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaef50e96e80ef685748ddffa733ade84f5543eff Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:26:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 17:26:45 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-sgsn: Enable iu support based on DISTRO_FEATURES In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-sgsn: Enable iu support based on DISTRO_FEATURES ...................................................................... osmo-sgsn: Enable iu support based on DISTRO_FEATURES Change-Id: Ifd8068d61aeea228dd24c54df6e1ce87bfcafff5 --- M recipes-osmocom/osmo-sgsn/osmo-sgsn.inc 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc index 382965f..77029a0 100644 --- a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc @@ -3,13 +3,14 @@ LICENSE = "AGPLv3" LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" -DEPENDS = "c-ares libpcap libasn1c libosmocore libosmo-netif libosmo-sccp osmo-iuh osmo-ggsn" +DEPENDS = "c-ares libpcap libosmocore libosmo-netif libosmo-sccp osmo-ggsn" -INC_PR="r1.${META_TELEPHONY_OSMO_INC}" +INC_PR="r2.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd -EXTRA_OECONF += "--enable-iu" +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'iu', d)}" +PACKAGECONFIG[iu] = "--enable-iu,--disable-iu,libasn1c osmo-iuh," do_install_append() { install -d ${D}${systemd_system_unitdir}/ -- To view, visit https://gerrit.osmocom.org/4332 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifd8068d61aeea228dd24c54df6e1ce87bfcafff5 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:26:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 17:26:45 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-iuh: Split into packages libosmo-ranap and osmo-hnbgw In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-iuh: Split into packages libosmo-ranap and osmo-hnbgw ...................................................................... osmo-iuh: Split into packages libosmo-ranap and osmo-hnbgw Change-Id: Ib924a5a05c378c59dd44aed5b5b5fe897604e86b --- M recipes-osmocom/osmo-iuh/osmo-iuh.inc 1 file changed, 21 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-iuh/osmo-iuh.inc b/recipes-osmocom/osmo-iuh/osmo-iuh.inc index 118827e..a5f1cbc 100644 --- a/recipes-osmocom/osmo-iuh/osmo-iuh.inc +++ b/recipes-osmocom/osmo-iuh/osmo-iuh.inc @@ -5,7 +5,7 @@ DEPENDS = "libosmocore libosmo-netif libosmo-sccp libasn1c" -INC_PR="r0.${META_TELEPHONY_OSMO_INC}" +INC_PR="r1.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd @@ -17,4 +17,23 @@ install -m 0644 ${S}/contrib/systemd/osmo-hnbgw.service ${D}${systemd_system_unitdir}/ } -SYSTEMD_SERVICE_${PN} = "osmo-hnbgw.service" +PACKAGES =+ "libosmo-ranap libosmo-ranap-dev osmo-hnbgw" +SYSTEMD_PACKAGES = "osmo-hnbgw" +SYSTEMD_SERVICE_osmo-hnbgw = "osmo-hnbgw.service" + +FILES_libosmo-ranap = " \ + ${libdir}/libosmo-ranap${SOLIBS} \ + " + +FILES_libosmo-ranap-dev = " \ + ${includedir}/osmocom/ranap \ + ${libdir}/pkgconfig/libosmo-ranap.pc \ + ${libdir}/libosmo-ranap${SOLIBSDEV} \ + " + +FILES_osmo-hnbgw = " \ + ${bindir}/osmo-hnbgw \ + ${sysconfdir}/osmocom/osmo-hnbgw.cfg \ + " + +ALLOW_EMPTY_${PN} = "1" -- To view, visit https://gerrit.osmocom.org/4331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib924a5a05c378c59dd44aed5b5b5fe897604e86b Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:26:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 17:26:45 +0000 Subject: [MERGED] meta-telephony[201705]: osmo-sgsn: Add missing DEPENDS libosmo-sccp In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-sgsn: Add missing DEPENDS libosmo-sccp ...................................................................... osmo-sgsn: Add missing DEPENDS libosmo-sccp Needed as it uses libosmo-sigtran. Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 --- M recipes-osmocom/osmo-sgsn/osmo-sgsn.inc 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Verified Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc index 3669b79..382965f 100644 --- a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc @@ -3,9 +3,9 @@ LICENSE = "AGPLv3" LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" -DEPENDS = "c-ares libpcap libasn1c libosmocore libosmo-netif osmo-iuh osmo-ggsn" +DEPENDS = "c-ares libpcap libasn1c libosmocore libosmo-netif libosmo-sccp osmo-iuh osmo-ggsn" -INC_PR="r0.${META_TELEPHONY_OSMO_INC}" +INC_PR="r1.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd -- To view, visit https://gerrit.osmocom.org/4330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I70f533bc18cab7883b076b532ef9656fb3f084f2 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:37:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:37:50 +0000 Subject: libosmocore[master]: vty: Fix bad use of vector_slot() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaba9e3450d68c51e16a7bda2fc0fc370992ca866 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:38:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:38:14 +0000 Subject: libosmocore[master]: jenkins: bail early if $MAKE env var is not set In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4384 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59b111dfdee4e1edea04155144f01d99f5f72aa1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:39:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:39:23 +0000 Subject: libosmocore[master]: fixups for recent "Cleanup jenkins build scripts" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/4383/1/contrib/jenkins_common.sh File contrib/jenkins_common.sh: Line 14: chmod -R a+w . would be sufficient that the current user can write, but this is really just bikeshedding. please don't spend time on it. -- To view, visit https://gerrit.osmocom.org/4383 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09d306350602f21943d5bd45f7388c83ede9b524 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:41:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:41:35 +0000 Subject: libosmocore[master]: Add tests for bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:42:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:42:41 +0000 Subject: libosmocore[master]: Replace bitvec_set_uint() with bitvec_set_u64() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b670dacb55fb3063271d045f9faa10fccba10a6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:44:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:44:45 +0000 Subject: libosmocore[master]: Deprecated bitvec_set_uint() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 I think the general issue is that people writing CSN.1 specified protocols always have to keep in mind that 1 != H and 0 != L, and no matter what we do here will not change that fact. Also, this is unrelated on whether bitvec_set_uint is used or not. Furthermore, one can very easily find all callers of bitvec_set_uint() by a simple 'git grep'. -- To view, visit https://gerrit.osmocom.org/4338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fd8d17f9fa6c51ef51f4294882cca5944d71df2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:45:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:45:14 +0000 Subject: libosmocore[master]: Simplify bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9fe27c06125ac52e02e63dcded056a5f1cf68f41 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:47:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:47:17 +0000 Subject: libosmocore[master]: Expand bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 6: Code-Review-1 Is still think we should not abuse a function that writes an unsigned integer for writing anything else (such as LH values). the specs (correct me if I'm wrong) never express a numeric/integer value as L/H. Rather, they speak of distinct L/H values. So if you would like to append LL or LH or HL or HH, you simply call a function that works with L and H definitions, and not one that works on integers and inputting '3' -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:47:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:47:35 +0000 Subject: libosmocore[master]: ctrl: allow more nodes than those in enum ctrl_node_type In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bd62ae0d4eefde7e1517db15a2155640a1bab58 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:48:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:48:01 +0000 Subject: osmocom-bb[master]: mobile: clean up and share example configs In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I903f31a8afc518ac258cdaeaf76430de07f7edea Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:48:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:48:03 +0000 Subject: [MERGED] osmocom-bb[master]: mobile: clean up and share example configs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mobile: clean up and share example configs ...................................................................... mobile: clean up and share example configs It is better to have a shared example config files directory, like other Osmocom projects do. Change-Id: I903f31a8afc518ac258cdaeaf76430de07f7edea --- R doc/examples/mobile/default.cfg R doc/examples/mobile/multi_ms.cfg M src/host/layer23/src/mobile/app_mobile.c 3 files changed, 73 insertions(+), 84 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg b/doc/examples/mobile/default.cfg similarity index 71% rename from src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg rename to doc/examples/mobile/default.cfg index 1aeb3f5..cc81630 100644 --- a/src/host/virt_phy/example_configs/osmocom-bb-mobile.cfg +++ b/doc/examples/mobile/default.cfg @@ -1,5 +1,5 @@ ! -! OsmocomBB (0.0.0) configuration saved from vty +! OsmocomBB example configuration for mobile application !! ! line vty @@ -14,12 +14,12 @@ ms 1 layer2-socket /tmp/osmocom_l2 sap-socket /tmp/osmocom_sap - sim test + sim reader network-selection-mode auto - imei 123456789012345 0 + imei 000000000000000 0 imei-fixed no emergency-imsi - sms-service-center 123123123 + no sms-service-center no call-waiting no auto-answer no force-rekey @@ -40,9 +40,9 @@ p-gsm e-gsm r-gsm - gsm-850 + no gsm-850 dcs - pcs + no pcs class-900 4 class-850 4 class-dcs 1 @@ -54,14 +54,9 @@ min-rxlev -106 dsc-max 90 no skip-max-per-band - exit test-sim - imsi 901700000000403 - ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef + imsi 001010000000000 + ki comp128 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 no barred-access - rplmn 262 42 0x0001 - hplmn-search everywhere - exit + rplmn 001 01 no shutdown -exit -! diff --git a/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg b/doc/examples/mobile/multi_ms.cfg similarity index 63% rename from src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg rename to doc/examples/mobile/multi_ms.cfg index 0c9ada4..bef2406 100644 --- a/src/host/virt_phy/example_configs/osmocom-bb-mobilex2.cfg +++ b/doc/examples/mobile/multi_ms.cfg @@ -1,5 +1,5 @@ ! -! OsmocomBB (0.0.0) configuration saved from vty +! OsmocomBB example configuration for mobile application !! ! line vty @@ -11,15 +11,15 @@ ! no hide-default ! -ms 1 - layer2-socket /tmp/osmocom_l2 - sap-socket /tmp/osmocom_sap - sim test +ms one + layer2-socket /tmp/osmocom_l2.one + sap-socket /tmp/osmocom_sap.one + sim reader network-selection-mode auto - imei 123456789012345 0 + imei 000000000000000 0 imei-fixed no emergency-imsi - sms-service-center 123123123 + no sms-service-center no call-waiting no auto-answer no force-rekey @@ -40,9 +40,9 @@ p-gsm e-gsm r-gsm - gsm-850 + no gsm-850 dcs - pcs + no pcs class-900 4 class-850 4 class-dcs 1 @@ -54,67 +54,59 @@ min-rxlev -106 dsc-max 90 no skip-max-per-band - exit test-sim - imsi 901700000000403 - ki comp128 12 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef - barred-access - rplmn 262 42 0x0001 - hplmn-search everywhere - exit + imsi 001010000000001 + ki comp128 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + no barred-access + rplmn 001 01 no shutdown -exit -ms 2 - layer2-socket /tmp/osmocom_l2_NR2 - sap-socket /tmp/osmocom_sap_NR2 - sim test - network-selection-mode auto - imei 123456789012346 0 - imei-fixed - no emergency-imsi - sms-service-center 123123123 - no call-waiting - no auto-answer - no force-rekey - no clip - no clir - tx-power auto - no simulated-delay - no stick - location-updating - neighbour-measurement - codec full-speed prefer - codec half-speed - no abbrev - support - sms - a5/1 - a5/2 - p-gsm - e-gsm - r-gsm - gsm-850 - dcs - pcs - class-900 4 - class-850 4 - class-dcs 1 - class-pcs 1 - channel-capability sdcch+tchf+tchh - full-speech-v1 - full-speech-v2 - half-speech-v1 - min-rxlev -106 - dsc-max 90 - no skip-max-per-band - exit - test-sim - imsi 901700000000404 - ki comp128 11 34 56 78 90 1b cd ef 12 34 56 78 90 ab cd ef - barred-access - rplmn 262 42 0x0001 - hplmn-search everywhere - exit - no shutdown -exit ! +ms two + layer2-socket /tmp/osmocom_l2.two + sap-socket /tmp/osmocom_sap.two + sim reader + network-selection-mode auto + imei 000000000000000 0 + imei-fixed + no emergency-imsi + no sms-service-center + no call-waiting + no auto-answer + no force-rekey + no clip + no clir + tx-power auto + no simulated-delay + no stick + location-updating + neighbour-measurement + codec full-speed prefer + codec half-speed + no abbrev + support + sms + a5/1 + a5/2 + p-gsm + e-gsm + r-gsm + no gsm-850 + dcs + no pcs + class-900 4 + class-850 4 + class-dcs 1 + class-pcs 1 + channel-capability sdcch+tchf+tchh + full-speech-v1 + full-speech-v2 + half-speech-v1 + min-rxlev -106 + dsc-max 90 + no skip-max-per-band + test-sim + imsi 001010000000002 + ki comp128 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff + no barred-access + rplmn 001 01 + no shutdown diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index fd2c94f..ecf9820 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -407,6 +407,8 @@ " '%s'\n", config_file); fprintf(stderr, "Please check or create config file" " using: 'touch %s'\n", config_file); + fprintf(stderr, "or use one from " + "'doc/examples/mobile/'\n"); return rc; } printf("Using configuration from %s\n", config_file); -- To view, visit https://gerrit.osmocom.org/4378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I903f31a8afc518ac258cdaeaf76430de07f7edea Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:48:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:48:49 +0000 Subject: osmo-hlr[master]: test_subscriber.ctrl: test against octal/hex interpretation ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:53:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:53:08 +0000 Subject: libosmocore[master]: Expand osmo_gettimeofday() docs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:53:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:53:11 +0000 Subject: [MERGED] libosmocore[master]: Expand osmo_gettimeofday() docs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Expand osmo_gettimeofday() docs ...................................................................... Expand osmo_gettimeofday() docs Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c Related: OS#2586 --- M src/timer_gettimeofday.c 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/timer_gettimeofday.c b/src/timer_gettimeofday.c index 1bf714e..4298805 100644 --- a/src/timer_gettimeofday.c +++ b/src/timer_gettimeofday.c @@ -33,7 +33,13 @@ /*! shim around gettimeofday to be able to set the time manually. * To override, set osmo_gettimeofday_override == true and set the desired - * current time in osmo_gettimeofday_override_time. */ + * current time in osmo_gettimeofday_override_time. + * + * N. B: gettimeofday() is affected by discontinuous jumps in the system time + * (e.g., if the system administrator manually changes the system time). + * Hence this should NEVER be used for elapsed time computation. + * Instead, clock_gettime(CLOCK_MONOTONIC, ..) should be used for that (with similar shim if necessary). + */ int osmo_gettimeofday(struct timeval *tv, struct timezone *tz) { if (osmo_gettimeofday_override) { -- To view, visit https://gerrit.osmocom.org/4367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:53:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:53:49 +0000 Subject: [MERGED] openbsc[master]: Make TRX rf locking more visible In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Make TRX rf locking more visible ...................................................................... Make TRX rf locking more visible * log administrative state transitions * log what's caused it * while at it, mark boolean variable as such Cherry-picked from osmo-bsc be356ed32fbd28dc8d1460371d9e47511b20ac63 Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Related: SYS#3864 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/abis_nm.c M openbsc/src/libbsc/bsc_rf_ctrl.c M openbsc/src/libbsc/bsc_vty.c 4 files changed, 12 insertions(+), 8 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 4035b39..57fa301 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -578,7 +578,7 @@ void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, uint8_t e1_ts, uint8_t e1_ts_ss); -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); +void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason); bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr); int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx); diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index cf20d7c..f24f6bf 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -2791,9 +2791,13 @@ *((uint16_t *)(buf + 5)) = htons(bts->cell_identity); } -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked) +void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason) { - int new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; + uint8_t new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; + + LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Changing adm. state %s -> %s [%s]\n", trx->bts->nr, trx->nr, + get_value_string(abis_nm_adm_state_names, trx->mo.nm_state.administrative), + get_value_string(abis_nm_adm_state_names, new_state), reason); trx->mo.nm_state.administrative = new_state; if (!trx->bts || !trx->bts->oml_link) diff --git a/openbsc/src/libbsc/bsc_rf_ctrl.c b/openbsc/src/libbsc/bsc_rf_ctrl.c index b7b6fc8..0e28600 100644 --- a/openbsc/src/libbsc/bsc_rf_ctrl.c +++ b/openbsc/src/libbsc/bsc_rf_ctrl.c @@ -123,7 +123,7 @@ } } -static int lock_each_trx(struct gsm_network *net, int lock) +static int lock_each_trx(struct gsm_network *net, bool lock) { struct gsm_bts *bts; @@ -138,7 +138,7 @@ } llist_for_each_entry(trx, &bts->trx_list, list) { - gsm_trx_lock_rf(trx, lock); + gsm_trx_lock_rf(trx, lock, "ctrl"); } } @@ -245,7 +245,7 @@ static int switch_rf_off(struct osmo_bsc_rf *rf) { - lock_each_trx(rf->gsm_network, 1); + lock_each_trx(rf->gsm_network, true); send_signal(rf, S_RF_OFF); return 0; @@ -289,7 +289,7 @@ case RF_CMD_ON: rf->last_state_command = "RF Direct On"; osmo_timer_del(&rf->grace_timeout); - lock_each_trx(rf->gsm_network, 0); + lock_each_trx(rf->gsm_network, false); send_signal(rf, S_RF_ON); osmo_timer_schedule(&rf->rf_check, 3, 0); break; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index f50ebd8..5fb1c5d 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -3562,7 +3562,7 @@ int locked = atoi(argv[0]); struct gsm_bts_trx *trx = vty->index; - gsm_trx_lock_rf(trx, locked); + gsm_trx_lock_rf(trx, locked, "vty"); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/4361 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:57:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:57:19 +0000 Subject: [PATCH] libosmocore[master]: [doc] Fix Doxygen 'param' direction: "in, out" rather than "i... Message-ID: Review at https://gerrit.osmocom.org/4390 [doc] Fix Doxygen 'param' direction: "in,out" rather than "inout" Change-Id: Ic2de1341b37453f339f0eefde3f14e14640fe3bb --- M src/gb/gprs_ns.c M src/msgb.c M src/select.c 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/4390/1 diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 7443a8b..11aa15b 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1317,7 +1317,7 @@ /*! Process NS message independently from underlying transport layer * \param nsi NS instance to which the data belongs * \param[in] msg message buffer containing newly-received data - * \param[inout] nsvc refers to the virtual connection, may be modified when + * \param[in,out] nsvc refers to the virtual connection, may be modified when * processing a NS_RESET * \returns 0 in case of success, < 0 in case of error * diff --git a/src/msgb.c b/src/msgb.c index 6fcbe53..697f3a1 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -250,7 +250,7 @@ * the contents of the extension is undefined. The complete sub area must be a * part of [data,tail]. * - * \param[inout] msg The msgb object + * \param[in,out] msg The msgb object * \param[in] area A pointer to the sub-area * \param[in] old_size The old size of the sub-area * \param[in] new_size The new size of the sub-area diff --git a/src/select.c b/src/select.c index 4b98b62..0e29307 100644 --- a/src/select.c +++ b/src/select.c @@ -48,7 +48,7 @@ static int unregistered_count; /*! Set up an osmo-fd. Will not register it. - * \param[inout] ofd Osmo FD to be set-up + * \param[in,out] ofd Osmo FD to be set-up * \param[in] fd OS-level file descriptor number * \param[in] when bit-mask of BSC_FD_{READ,WRITE,EXECEPT} * \param[in] cb Call-back function to be called -- To view, visit https://gerrit.osmocom.org/4390 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic2de1341b37453f339f0eefde3f14e14640fe3bb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:58:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:58:14 +0000 Subject: libosmocore[master]: add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4340/1/include/osmocom/core/utils.h File include/osmocom/core/utils.h: Line 90: * \param[inout] dest char* to re-/allocate and append to. > Is comma missing? Shouldn't it be "in,out"? good catch. I actually thought it's "inout" and we most likely have other places in the code doing it wrong. -- To view, visit https://gerrit.osmocom.org/4340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:58:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:58:23 +0000 Subject: libosmocore[master]: add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/4340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:58:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:58:31 +0000 Subject: libosmocore[master]: [doc] Fix Doxygen 'param' direction: "in, out" rather than "i... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4390 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic2de1341b37453f339f0eefde3f14e14640fe3bb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:59:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:59:14 +0000 Subject: osmo-gsm-manuals[master]: common/vty: fix: CONFIG entered from ENABLE, not VIEW node In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I892081f9452f8923441913f978a3be542a3c53d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:59:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:59:24 +0000 Subject: osmo-gsm-manuals[master]: common/vty: "programs should not use the telnet VTY" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic7e8c3663a2bfaf8dcb5752bf55ccb822b111c31 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:59:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:59:39 +0000 Subject: osmo-gsm-manuals[master]: common/vty: explain difference between telnet and config file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4346 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I882346c69f12c67d0e41d563c99d4de4efd8b8f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 17:59:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 17:59:58 +0000 Subject: osmo-gsm-manuals[master]: common/vty: minor wording tweaks and typo fixes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5eb1ea0d3de883ff5e9742f77e7ef4be0482852d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:01:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:01:13 +0000 Subject: osmo-gsm-manuals[master]: add OsmoHLR manual, OsmoHLR VTY reference In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4348 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb6a362a26a7e65199f68f5cd32d9b6b0e5d0fbf Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:04:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:04:02 +0000 Subject: osmo-gsm-manuals[master]: refactor Makefile build rules, don't use the FORCE In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 need to clarify if this affects sysmcom/manuals.git -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:04:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:04:22 +0000 Subject: python/osmo-python-tests[master]: osmo_verify_transcript: add error handling for missing port In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4321 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1627c36cfb627e7f3a9b4d9f087bf10875ae0690 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:04:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:04:39 +0000 Subject: python/osmo-python-tests[master]: osmo_verify_transcript_vty: automatically obtain the prompt ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id5d953156023fcbfc8867c1c3634d787d0b3ac57 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:05:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:05:58 +0000 Subject: python/osmo-python-tests[master]: osmo_verify_transcript: allow running/piping commands directly In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c31a87fa255092bcd06da239651cc50174c8faa Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:06:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:06:38 +0000 Subject: python/osmo-python-tests[master]: osmo_verify_*: clarify naming to osmo_interact_* In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0cbd5db85ebebc893df638a07f5568632563dc9 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:06:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:06:51 +0000 Subject: python/osmo-python-tests[master]: cosmetic: cmdline arg doc tweaks, comment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I60dc059879dfe15cd3415ce1ed068ded28ff084e Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:10:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:10:49 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: I'm actually also in favor of installing the services files during "make install". I've recently done this for nextepc, see https://github.com/acetcom/nextepc/commit/ae6f1001f8b96cc51eeb79aad52f5d01c0dbeb2f not sure if there's a general trend/rule to install it from "make install", though. If anyone can find some suggestions/pointers on this, it would be helpful. OTOTH, we for sure need both systemd service files and init scripts as Max has stated. -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:12:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:12:12 +0000 Subject: osmo-msc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:12:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:12:40 +0000 Subject: osmo-bts[master]: Fix race condition in attribute reporting In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:12:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:12:45 +0000 Subject: [MERGED] osmo-bts[master]: Fix race condition in attribute reporting In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix race condition in attribute reporting ...................................................................... Fix race condition in attribute reporting Previously it could be possible that the attribute request comes from BSC before the TRX is properly initialized which would lead to SIGABRT caused by OSMO_ASSERT() in PHY instantiation. Workaround this by explicitly checking for TRX availability before handling TRX-specific attributes. This only happens with osmo-bts-trx and is hard to reproduce. Ideal fix would be to defer attribute response until we have TRX connected but that would make corresponding code more complex because we'll need to save the attribute request and properly hook response routine into TRX connection handler. Alternatively we can postpone osmo-bts-trx connection to BSC until TRX is available: it's not very useful without it anyway. Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82 Fixes: OS#2560 --- M src/common/oml.c 1 file changed, 11 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/oml.c b/src/common/oml.c index 69a2642..ff6dc41 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -214,14 +214,23 @@ return -ENOMEM; for (i = 0; i < attr_len; i++) { + bool processed = false; switch (attr[i]) { case NM_ATT_SW_CONFIG: - add_trx_attr(attr_buf, trx); + if (trx) { + add_trx_attr(attr_buf, trx); + processed = true; + } else + LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unhandled due to missing TRX.\n", + i, get_value_string(abis_nm_att_names, attr[i])); break; default: LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by TRX.\n", i, get_value_string(abis_nm_att_names, attr[i])); - out[attr_out_index] = attr[i]; /* assemble values of supported attributes and list of unsupported ones */ + } + /* assemble values of supported attributes and list of unsupported ones */ + if (!processed) { + out[attr_out_index] = attr[i]; attr_out_index++; } } -- To view, visit https://gerrit.osmocom.org/4232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:13:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:13:08 +0000 Subject: osmo-bts[master]: Move power loop to generic tests In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:14:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:14:20 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 5: deferring to neels on this one. as the patch has been sitting in the queue for quite some time: Ping? -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:15:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:15:52 +0000 Subject: osmo-gsm-manuals[master]: OsmoNITB: update vty reference In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3986 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I48edb65be94be56c4b57293d8edc1b30271acc12 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:20:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:20:58 +0000 Subject: [PATCH] osmo-ci[master]: jenkins: Follow the convention and create a jenkins.sh as well In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3676 to look at the new patch set (#2). jenkins: Follow the convention and create a jenkins.sh as well Instead of modifying the job on Jenkins, let's do it like in our other projects. Create the diretcory if it doesn't exist and use git pull origin for the Debian9 system. Change-Id: I0ecdc02e3271fe09980f370167277370c599fcfa --- A contrib/jenkins.sh 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/76/3676/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..5930c81 --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +cd ~/osmo-ci || (cd ~/ && git clone git://git.osmocom.org/osmo-ci) +git rev-parse HEAD +git status + +git fetch && git checkout -f -B master origin/master + +git rev-parse HEAD +git status -- To view, visit https://gerrit.osmocom.org/3676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0ecdc02e3271fe09980f370167277370c599fcfa Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:21:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:21:16 +0000 Subject: osmo-ci[master]: jenkins: Follow the convention and create a jenkins.sh as well In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ecdc02e3271fe09980f370167277370c599fcfa Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 18:21:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Oct 2017 18:21:50 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: @Pau: ping? -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 20:52:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 20:52:45 +0000 Subject: osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Patch Set 2: > I'm actually also in favor of installing the services files during > "make install". I've recently done this for nextepc, see > https://github.com/acetcom/nextepc/commit/ae6f1001f8b96cc51eeb79aad52f5d01c0dbeb2f > > not sure if there's a general trend/rule to install it from "make > install", though. If anyone can find some suggestions/pointers on > this, it would be helpful. > > OTOTH, we for sure need both systemd service files and init scripts > as Max has stated. Regarding the best way to do it, I'd look at configure.ac / Makefile.am of some of the projects I shared in previous comments, to make sure we support all usually required features (such as changing the systemd prefix path). -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 20:55:25 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Oct 2017 20:55:25 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: > @Pau: ping? I am aware of this patch. I'll close/drop it once I merge the 3-patch patchset I submitted today for osmux_snprintf. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 22:31:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 22:31:00 +0000 Subject: libosmocore[master]: ctrl: allow more nodes than those in enum ctrl_node_type In-Reply-To: References: Message-ID: Patch Set 3: > Maybe the parameter shouldn't be called 'node_count', but 'last_node'? Actually, 'last_node' is not accurate, just like _LAST_CTRL_NODE is in fact a slight misnomer. Actually it is the first unused ctrl node id, so 'node_count' is more accurate. -- To view, visit https://gerrit.osmocom.org/4305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bd62ae0d4eefde7e1517db15a2155640a1bab58 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 23 22:31:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 22:31:02 +0000 Subject: [MERGED] libosmocore[master]: ctrl: allow more nodes than those in enum ctrl_node_type In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: ctrl: allow more nodes than those in enum ctrl_node_type ...................................................................... ctrl: allow more nodes than those in enum ctrl_node_type Add ctrl_interface_setup_dynip2() to add a node_count parameter, which can be used to define more ctrl nodes without having to merge a patch to libosmocore. In consequence, also add ctrl_handle_alloc2(), since ctrl_interface_setup_dynip() uses ctrl_handle_alloc() to allocate the node slots, and add node_count param to static ctrl_init(). Passing zero as node_count indicates to use the default of _LAST_CTRL_NODE as before, i.e. to not define more ctrl nodes. Assert that we never allocate less than _LAST_CTRL_NODE slots. The current ctrl_interface_setup_dynip() and ctrl_handle_alloc() become simple wrappers that pass zero as node_count. Their use is still valid and they do not need to be deprecated. The API comment to ctrl_interface_setup_dynip2() explains how to define more node IDs. This patch was verified to work by osmo-hlr.git change I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 which adds two node IDs for use by osmo-hlr only. Change-Id: I1bd62ae0d4eefde7e1517db15a2155640a1bab58 --- M include/osmocom/ctrl/control_if.h M src/ctrl/control_if.c 2 files changed, 76 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/ctrl/control_if.h b/include/osmocom/ctrl/control_if.h index 6e49742..d444328 100644 --- a/include/osmocom/ctrl/control_if.h +++ b/include/osmocom/ctrl/control_if.h @@ -24,12 +24,20 @@ int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd); int ctrl_cmd_send_trap(struct ctrl_handle *ctrl, const char *name, char *value); struct ctrl_handle *ctrl_handle_alloc(void *ctx, void *data, ctrl_cmd_lookup lookup); +struct ctrl_handle *ctrl_handle_alloc2(void *ctx, void *data, + ctrl_cmd_lookup lookup, + unsigned int node_count); struct ctrl_handle *ctrl_interface_setup(void *data, uint16_t port, ctrl_cmd_lookup lookup); struct ctrl_handle *ctrl_interface_setup_dynip(void *data, const char *bind_addr, uint16_t port, ctrl_cmd_lookup lookup); +struct ctrl_handle *ctrl_interface_setup_dynip2(void *data, + const char *bind_addr, + uint16_t port, + ctrl_cmd_lookup lookup, + unsigned int node_count); struct ctrl_connection *osmo_ctrl_conn_alloc(void *ctx, void *data); int ctrl_cmd_handle(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd, void *data); struct ctrl_cmd *ctrl_cmd_exec_from_string(struct ctrl_handle *ch, const char *cmdstr); diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index d50ddd0..9b8a194 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -698,14 +698,20 @@ static int ctrl_initialized = 0; /* global ctrl initialization */ -static int ctrl_init(void) +static int ctrl_init(unsigned int node_count) { int ret; - if (ctrl_initialized) - return 0; + if (!node_count) + node_count = _LAST_CTRL_NODE; + OSMO_ASSERT(node_count >= _LAST_CTRL_NODE); - ctrl_node_vec = vector_init(_LAST_CTRL_NODE); + if (ctrl_initialized) { + OSMO_ASSERT(ctrl_initialized == node_count); + return 0; + } + + ctrl_node_vec = vector_init(node_count); if (!ctrl_node_vec) goto err; @@ -720,7 +726,7 @@ if (ret) goto err_vec; - ctrl_initialized = 1; + ctrl_initialized = node_count; return 0; err_vec: @@ -730,18 +736,24 @@ return -1; } -/*! Allocate a CTRL interface handle - * \param[in] ctx Tallo callocation context to be used +/*! Allocate a CTRL interface handle. + * \param[in] ctx Talloc allocation context to be used * \param[in] data Pointer which will be made available to each set_..() get_..() verify_..() control command function * \param[in] lookup Lookup function pointer, can be NULL + * \param[in] node_count Number of CTRL nodes to allocate, 0 for default. * \returns ctrl_handle pointer or NULL in case of errors + * + * Please see ctrl_interface_setup_dynip2() for a detailed description of \a + * node_count semantics. */ -struct ctrl_handle *ctrl_handle_alloc(void *ctx, void *data, ctrl_cmd_lookup lookup) +struct ctrl_handle *ctrl_handle_alloc2(void *ctx, void *data, + ctrl_cmd_lookup lookup, + unsigned int node_count) { struct ctrl_handle *ctrl; - ctrl_init(); + ctrl_init(node_count); ctrl = talloc_zero(ctx, struct ctrl_handle); if (!ctrl) @@ -755,23 +767,47 @@ return ctrl; } -/*! Setup CTRL interface on a given address +/*! Allocate a CTRL interface handle. + * \param[in] ctx Talloc allocation context to be used + * \param[in] data Pointer which will be made available to each + set_..() get_..() verify_..() control command function + * \param[in] lookup Lookup function pointer, can be NULL + * \returns ctrl_handle pointer or NULL in case of errors + */ +struct ctrl_handle *ctrl_handle_alloc(void *ctx, void *data, ctrl_cmd_lookup lookup) +{ + return ctrl_handle_alloc2(ctx, data, lookup, 0); +} + +/*! Setup CTRL interface on a given address. * \param[in] data Pointer which will be made available to each set_..() get_..() verify_..() control command function * \param[in] bind_addr Address on which CTRL socket shall listen * \param[in] port Port on which CTRL socket shall listen * \param[in] lookup Lookup function pointer, can be NULL + * \param[in] node_count Number of CTRL nodes to allocate, 0 for default. * \returns ctrl_handle pointer or NULL in case of errors + * + * Control interface nodes are identified by a node handle; some of these are + * defined in enum ctrl_node_type, here in libosmocore. However, applications + * defining own nodes may add own control nodes without having to extend the + * enum in libosmocore. For example, in the calling application, define an enum + * like "enum more_ctrl_nodes { CTRL_NODE_FOO = _LAST_CTRL_NODE, CTRL_NODE_BAR, + * _LAST_CTRL_NODE_EXTENDED }". In order to provide space for the additional + * control nodes, pass _LAST_CTRL_NODE_EXTENDED to the \a node_count parameter. + * Passing 0 is identical to passing _LAST_CTRL_NODE, i.e. to not define own + * control nodes apart from libosmocore ones. */ -struct ctrl_handle *ctrl_interface_setup_dynip(void *data, - const char *bind_addr, - uint16_t port, - ctrl_cmd_lookup lookup) +struct ctrl_handle *ctrl_interface_setup_dynip2(void *data, + const char *bind_addr, + uint16_t port, + ctrl_cmd_lookup lookup, + unsigned int node_count) { int ret; struct ctrl_handle *ctrl; - ctrl = ctrl_handle_alloc(data, data, lookup); + ctrl = ctrl_handle_alloc2(data, data, lookup, node_count); if (!ctrl) return NULL; @@ -789,6 +825,23 @@ return ctrl; } +/*! Setup CTRL interface on a given address. + * \param[in] data Pointer which will be made available to each + set_..() get_..() verify_..() control command function + * \param[in] bind_addr Address on which CTRL socket shall listen + * \param[in] port Port on which CTRL socket shall listen + * \param[in] lookup Lookup function pointer, can be NULL + * \returns ctrl_handle pointer or NULL in case of errors + */ +struct ctrl_handle *ctrl_interface_setup_dynip(void *data, + const char *bind_addr, + uint16_t port, + ctrl_cmd_lookup lookup) +{ + return ctrl_interface_setup_dynip2(data, bind_addr, port, lookup, 0); +} + + /*! Install a lookup helper function for control nodes * This function is used by e.g. library code to install lookup helpers * for additional nodes in the control interface. -- To view, visit https://gerrit.osmocom.org/4305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1bd62ae0d4eefde7e1517db15a2155640a1bab58 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 23 22:46:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 22:46:09 +0000 Subject: libosmocore[master]: add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4340/1/include/osmocom/core/utils.h File include/osmocom/core/utils.h: Line 90: * \param[inout] dest char* to re-/allocate and append to. > good catch. I actually thought it's "inout" and we most likely have other p I looked in https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation and it says "inout". In my currently checked out repositories, we have 35 instances of "inout" and only 17 of "in,out". But looking at http://www.stack.nl/~dimitri/doxygen/manual/docblocks.html it says "in,out". I changed the wiki page now. However, when I look at the rendered API doc for msgb_resize_area(), which says "inout" in the source, it is shown as "in,out" at http://ftp.osmocom.org/api/latest/libosmocore/core/html/group__msgb.html#gab1ffdec5c9aa14709b9b10b0c3ad3612 So, in practical terms, it seems to not matter whether we write inout or in,out. -- To view, visit https://gerrit.osmocom.org/4340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 23 22:48:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Oct 2017 22:48:32 +0000 Subject: [PATCH] libosmocore[master]: add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4340 to look at the new patch set (#2). add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() Add macro to append to a CTRL commands' reply string, ctrl_cmd_reply_printf(). The talloc_asprintf() part of it is generic enough to qualify for a separate macro, osmo_talloc_asprintf(). The idea is to not have to decide for each bit added to a string whether the string is already allocated or not, but simply be able to issue printf commands and let the macro worry about initial allocation or reallocation. This originally came from osmo-hlr change I1bd62ae0d4eefde7e1517db15a2155640a1bab58, where it was requested to move this bit to libosmocore. Change-Id: Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 --- M include/osmocom/core/utils.h M include/osmocom/ctrl/control_cmd.h 2 files changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/4340/2 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 5f41213..4b083f6 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -85,6 +85,24 @@ *dst = talloc_strdup(ctx, newstr); } +/*! Append to a string and re-/allocate if necessary. + * \param[in] ctx Talloc context to use for initial allocation. + * \param[in,out] dest char* to re-/allocate and append to. + * \param[in] fmt printf-like string format. + * \param[in] args Arguments for fmt. + * + * \a dest may be passed in NULL, or a string previously allocated by talloc. + * If an existing string is passed in, it will remain associated with whichever + * ctx it was allocated before, regardless whether it matches \a ctx or not. + */ +#define osmo_talloc_asprintf(ctx, dest, fmt, args ...) \ + do { \ + if (!dest) \ + dest = talloc_asprintf(ctx, fmt, ## args); \ + else \ + dest = talloc_asprintf_append((char*)dest, fmt, ## args); \ + } while (0) + int osmo_constant_time_cmp(const uint8_t *exp, const uint8_t *rel, const int count); uint64_t osmo_decode_big_endian(const uint8_t *data, size_t data_len); uint8_t *osmo_encode_big_endian(uint64_t value, size_t data_len); diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h index 77532e6..4372e25 100644 --- a/include/osmocom/ctrl/control_cmd.h +++ b/include/osmocom/ctrl/control_cmd.h @@ -66,6 +66,9 @@ char *reply; }; +#define ctrl_cmd_reply_printf(cmd, fmt, args ...) \ + osmo_talloc_asprintf(cmd, cmd->reply, fmt, ## args) + struct ctrl_cmd_struct { int nr_commands; char **command; -- To view, visit https://gerrit.osmocom.org/4340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 00:36:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 00:36:54 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: refactor Makefile build rules, don't use the FORCE In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3985 to look at the new patch set (#6). refactor Makefile build rules, don't use the FORCE The initial goal was to make sure we don't have overall FORCE rules causing unnecessary rebuilds -- annoying while writing documentation. As I looked through possible dependencies, I finally understood what's going on here. Remove code dup and nicely sort which belongs where in build/Makefile.*.inc. In each, describe in a top comment how to use it, and also unify how they are used: - Rename Makefile.inc to Makefile.docbook.inc and refactor - Add Makefile.vty-reference.inc - Add Makefile.common.inc Make sure that we accurately pick up all dependencies. Drop use of the macro called 'command', that silenced the actual command lines invoked and replaced them with short strings: it obscures what is actually going on and makes the Makefiles hard to read and understand. Each manual's makefile is greatly reduced to few definitions and a Makefile include, e.g. one for asciidoc, one for VTY reference. Move common/bsc_vty_additions.xml to OsmoBSC/vty/libbsc_vty_additions.xml, link from OsmoNITB. It applies only to OsmoBSC and OsmoNITB. Add a script that combines a VTY reference file with *all* additions files found in a manual's vty/ dir. Call this from Makefile.vty-reference.inc. Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 --- M OsmoBSC/Makefile R OsmoBSC/vty/libbsc_vty_additions.xml M OsmoBTS/Makefile M OsmoGGSN/Makefile M OsmoGSMTester/Makefile M OsmoHLR/Makefile M OsmoMGCP/Makefile M OsmoMSC/Makefile M OsmoNAT/Makefile M OsmoNITB/Makefile A OsmoNITB/vty/libbsc_vty_additions.xml M OsmoPCU/Makefile M OsmoSGSN/Makefile M build/Makefile.asciidoc.inc A build/Makefile.common.inc A build/Makefile.docbook.inc D build/Makefile.inc A build/Makefile.vty-reference.inc A build/vty_reference_combine.sh 19 files changed, 210 insertions(+), 443 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/85/3985/6 diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index 35f50da..1533482 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -1,54 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. - -EXTRA_DEPS = gen-bsc-vty-docbook - -topdir = . -bsc_reference = $(topdir)/osmobsc-vty-reference.xml -manuals = $(bsc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobsc-usermanual osmux-reference aoip-mgw-options - +ASCIIDOC = osmobsc-usermanual.adoc osmux-reference.adoc aoip-mgw-options.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmobsc-usermanual.pdf: chapters/*.adoc -osmux-reference.pdf: osmux-reference.adoc -aoip-mgw-options.pdf: aoip-mgw-options.adoc +aoip-mgw-options.pdf: aoip-mgw-options.adoc mgw/*.msc -clean: - -rm -rf $(cleanfiles) - -rm osmobsc-usermanual__*.png - -rm osmobsc-usermanual__*.svg - -rm osmobsc-usermanual*.check - -rm osmux-reference*.check - -rm aoip-mgw-options*.png - -rm aoip-mgw-options*.svg - -rm aoip-mgw-options*.check - -rm osmux-reference__*.svg - -rm osmux-reference__*.png - -rm osmux-reference__*.check +VTY_REFERENCE = osmobsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bsc-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bsc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/common/bsc_vty_additions.xml b/OsmoBSC/vty/libbsc_vty_additions.xml similarity index 100% rename from common/bsc_vty_additions.xml rename to OsmoBSC/vty/libbsc_vty_additions.xml diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 58df0e3..e1ff214 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -1,50 +1,12 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-bts-vty-docbook - -topdir = . -bts_reference = $(topdir)/osmobts-vty-reference.xml -manuals = $(bts_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobts-usermanual osmobts-abis rtp-amr - +ASCIIDOC = osmobts-usermanual.adoc osmobts-abis.adoc rtp-amr.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - -osmobts-abis.pdf: abis/*.adoc abis/*.msc osmobts-usermanual.pdf: chapters/*.adoc +osmobts-abis.pdf: abis/*.adoc abis/*.msc +rtp-amr.pdf: dtx.dot -clean: - -rm -rf $(cleanfiles) - -rm osmobts-abis__*.png - -rm osmobts-abis__*.svg - -rm rtp-amr__*.png - -rm rtp-amr__*.svg - -rm osmobts-usermanual__*.png - -rm osmobts-usermanual__*.svg - -rm osmobts-abis*.check - -rm osmobts-usermanual*.check +VTY_REFERENCE = osmobts-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bts-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bts_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bts_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BTS VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BTS VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile index 2dfedb2..e809632 100644 --- a/OsmoGGSN/Makefile +++ b/OsmoGGSN/Makefile @@ -1,39 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-ggsn-vty-docbook - -topdir = . -ggsn_reference = $(topdir)/osmoggsn-vty-reference.xml -manuals = $(ggsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmoggsn-usermanual - +ASCIIDOC = osmoggsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmoggsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmoggsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmoggsn-usermanual__*.svg osmoggsn-usermanual__*.png - -rm osmoggsn-usermanual.check - -gen-ggsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/ggsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/ggsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging GGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting GGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGSMTester/Makefile b/OsmoGSMTester/Makefile index 79d414f..43c5a37 100644 --- a/OsmoGSMTester/Makefile +++ b/OsmoGSMTester/Makefile @@ -1,12 +1,7 @@ -TOPDIR := .. -ASCIIDOCS := osmo-gsm-tester-manual +TOPDIR = .. +ASCIIDOC = osmo-gsm-tester-manual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmo-gsm-tester-manual.pdf: chapters/*.adoc - -clean: - -rm -rf $(cleanfiles) - -rm osmo-gsm-tester-manual__*.svg - -rm osmo-gsm-tester-manual__*.png +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile index eba5fa3..a9dc393 100644 --- a/OsmoHLR/Makefile +++ b/OsmoHLR/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -hlr_reference = $(topdir)/osmohlr-vty-reference.xml -manuals = $(hlr_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmohlr-usermanual - +ASCIIDOC = osmohlr-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc *.vty *.ctrl include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmohlr-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmohlr-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmohlr-usermanual__*.svg - -rm osmohlr-usermanual__*.png - -rm osmohlr-usermanual.check - -generated/docbook_vty.xml: osmohlr-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/hlr_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/hlr_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging HLR VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting HLR VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMGCP/Makefile b/OsmoMGCP/Makefile index 9aff12b..e2a5e37 100644 --- a/OsmoMGCP/Makefile +++ b/OsmoMGCP/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-mgcp-vty-docbook +VTY_REFERENCE = osmomgcp-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -mgcp_reference = $(topdir)/osmomgcp-vty-reference.xml -manuals = $(mgcp_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-mgcp-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/mgcp_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/mgcp_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging MGCP VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MGCP VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile index febf7d1..c9edcef 100644 --- a/OsmoMSC/Makefile +++ b/OsmoMSC/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -msc_reference = $(topdir)/osmomsc-vty-reference.xml -manuals = $(msc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmomsc-usermanual - +ASCIIDOC = osmomsc-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmomsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmomsc-usermanual__*.svg - -rm osmomsc-usermanual__*.png - -rm osmomsc-usermanual.check - -generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/msc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/msc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging MSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNAT/Makefile b/OsmoNAT/Makefile index d7302e6..fde7132 100644 --- a/OsmoNAT/Makefile +++ b/OsmoNAT/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nat-vty-docbook +VTY_REFERENCE = osmonat-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -nat_reference = $(topdir)/osmonat-vty-reference.xml -manuals = $(nat_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-nat-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nat_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/nat_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging NAT VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NAT VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/Makefile b/OsmoNITB/Makefile index 99cd317..0cd260d 100644 --- a/OsmoNITB/Makefile +++ b/OsmoNITB/Makefile @@ -1,44 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nitb-vty-docbook - -topdir = . -nitb_reference = $(topdir)/osmonitb-vty-reference.xml -manuals = $(nitb_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmonitb-usermanual - +ASCIIDOC = osmonitb-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmonitb-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmonitb-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmonitb-usermanual__*.svg - -rm osmonitb-usermanual__*.png - -rm osmonitb-usermanual.check - -gen-nitb-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nitb_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/nitb_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging NITB VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NITB VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/vty/libbsc_vty_additions.xml b/OsmoNITB/vty/libbsc_vty_additions.xml new file mode 120000 index 0000000..52528bb --- /dev/null +++ b/OsmoNITB/vty/libbsc_vty_additions.xml @@ -0,0 +1 @@ +../../OsmoBSC/vty/libbsc_vty_additions.xml \ No newline at end of file diff --git a/OsmoPCU/Makefile b/OsmoPCU/Makefile index a83b909..7a1acc0 100644 --- a/OsmoPCU/Makefile +++ b/OsmoPCU/Makefile @@ -1,45 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-vty-docbook - -topdir = . -pcu_reference = $(topdir)/osmopcu-vty-reference.xml -manuals = $(bts_manual) $(pcu_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmopcu-usermanual osmopcu-gb - +ASCIIDOC = osmopcu-usermanual.adoc osmopcu-gb.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmopcu-gb.pdf: gb/*.adoc gb/*.msc osmopcu-usermanual.pdf: chapters/*.adoc -clean: - -rm -rf $(cleanfiles) - -rm -rf gen-vty-docbook - -rm osmopcu-usermanual__*.png - -rm osmopcu-usermanual__*.svg - -rm osmopcu-usermanual.check +VTY_REFERENCE = osmopcu-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/osmo-pcu_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/osmo-pcu_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging PCU VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting PCU VTY to DocBook) - - - +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoSGSN/Makefile b/OsmoSGSN/Makefile index 6f7d28d..baa1a49 100644 --- a/OsmoSGSN/Makefile +++ b/OsmoSGSN/Makefile @@ -1,43 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-sgsn-vty-docbook - -topdir = . -sgsn_reference = $(topdir)/osmosgsn-vty-reference.xml -manuals = $(sgsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmosgsn-usermanual - +ASCIIDOC = osmosgsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmosgsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmosgsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmosgsn-usermanual__*.svg osmosgsn-usermanual__*.png - -rm osmosgsn-usermanual.check - -gen-sgsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/sgsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/sgsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging SGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting SGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index e088624..a28a5bb 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -1,19 +1,38 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'ASCIIDOC' all root .adoc files, +# - optionally define in 'ASCIIDOC_DEPS' all dependencies common to all .adocs, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# ASCIIDOC = osmo_yada.adoc osmo_moo.adoc +# ASCIIDOC_DEPS = for_all/*.adoc +# include $(TOPDIR)/build/Makefile.asciidoc.inc +# osmo_yada.pdf: yada/*.adoc yada/*.msc + BUILDDIR = $(TOPDIR)/build GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags) GIT_DATE := $(shell $(TOPDIR)/build/unix-time-to-fmt.py `git log -n 1 "--pretty=%at" ../.`) # prepend the document name with the version numbe suffix -#DOCS_VER = $(foreach P, $(ASCIIDOCS), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) +#DOCS_VER = $(foreach P, $(ASCIIDOC_NAME), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) #PDFS = $(DOCS_VER:%=%.pdf) # generate list of PDFs that we're supposed to render -ASCIIDOCPDFS = $(ASCIIDOCS:%=%.pdf) -ASCIIDOC_CHECKS = $(ASCIIDOCS:%=%.check) +ASCIIDOC_NAME = $(patsubst %.adoc,%,$(ASCIIDOC)) +ASCIIDOC_PDF = $(ASCIIDOC_NAME:%=%.pdf) +ASCIIDOC_CHECKS = $(ASCIIDOC_NAME:%=%.check) ASCIIDOCSTYLE ?= $(BUILDDIR)/custom-dblatex.sty -cleanfiles += $(ASCIIDOCPDFS) +CLEAN_FILES += $(ASCIIDOC_NAME:%=%__*.png) $(ASCIIDOC_NAME:%=%__*.svg) $(ASCIIDOC_CHECKS) +CLEAN_FILES += $(ASCIIDOC_PDF) +UPLOAD_FILES += $(ASCIIDOC_PDF) ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -f $(BUILDDIR)/python2-filter.conf DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0 @@ -27,9 +46,13 @@ A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" --dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(REVNUMBER)" -a revdate="$(GIT_DATE)" -all: $(ASCIIDOCPDFS) +all: $(ASCIIDOC_PDF) -$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc +$(ASCIIDOC_PDF): %.pdf: %.adoc %-docinfo.xml \ + $(ASCIIDOC_DEPS) \ + $(ASCIIDOCSTYLE) \ + $(TOPDIR)/common/*/*.adoc \ + $(TOPDIR)/common/images/* @test -n "$(BUILD_RELEASE)" && echo -e "\n\n\ NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\ and remove three lines starting with '% \"DRAFT\" on first page'\n" \ diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc new file mode 100644 index 0000000..e624b5f --- /dev/null +++ b/build/Makefile.common.inc @@ -0,0 +1,14 @@ +# Usage: +# +# Other makefiles like Makefile.asciidoc.inc and Makefile.vty-reference.inc add +# entries to UPLOAD_FILES and CLEAN_FILES. +# +# Include this file at the end to have 'upload' and 'clean' targets. + +UPLOAD_PATH ?= generic at sysmocom-downloads:documents + +upload: $(UPLOAD_FILES) + rsync -avz $(UPLOAD_FILES) $(UPLOAD_PATH)/ + +clean: + -rm -rf $(CLEAN_FILES) diff --git a/build/Makefile.docbook.inc b/build/Makefile.docbook.inc new file mode 100644 index 0000000..70dfafa --- /dev/null +++ b/build/Makefile.docbook.inc @@ -0,0 +1,35 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'DOCBOOKS' all root .xml files, +# - optionally define in 'DOCBOOKS_DEPS' all dependencies common to all .xmls, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# DOCBOOKS = osmo_yada.xml osmo_moo.xml +# ASCIIDOC_DEPS = for_all/*.xml +# include $(TOPDIR)/build/Makefile.docbook.inc +# osmo_yada.pdf: yada/*.xml +# +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals, edited. + +DOCBOOKS_PDF = $(patsubst %.xml,%.pdf,$(DOCBOOKS)) +lint = $(patsubst %.xml,%.lint,$(DOCBOOKS)) + +CLEAN_FILES += $(DOCBOOKS_PDF) $(lint) +UPLOAD_FILES += $(DOCBOOKS_PDF) + +all: $(DOCBOOKS_PDF) + +# Lint the file +%.xml-lint: %.xml + xmllint --xinclude --postvalid --noout $< + +# Create a PDF file and lint it before +%.pdf: %.xml %.xml-lint $(DOCBOOKS_DEPS) + dblatex $(dblatex_quiet) -P draft.mode=no $< + diff --git a/build/Makefile.inc b/build/Makefile.inc deleted file mode 100644 index 3905cb0..0000000 --- a/build/Makefile.inc +++ /dev/null @@ -1,47 +0,0 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals - -LIBOSMO_DIR ?= ~/source/gsm/libosmocore -MERGE_DOC := $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl -UPLOAD_PATH ?= generic at sysmocom-downloads:documents - -pdfs = $(patsubst %.xml,%.pdf,$(manuals)) -lint = $(patsubst %.xml,%.xml-lint,$(manuals)) - -#cleanfiles = $(foreach i,$(types),$(topdir)/$(i)) -cleanfiles += $(pdfs) $(lint) - -ifdef DEBUG -dblatex_quiet = -define command - $(1) -endef -else -dblatex_quiet = -q -define command - @echo $(2) $(3) - @$(1) -endef -endif - -all: $(types) - - -$(types): FORCE - - -pdf: $(pdfs) $(manuals) - - -# Lint the file -%.xml-lint: %.xml FORCE - $(call command,xmllint --xinclude --postvalid --noout $<,XMLLINT,$<) - -# Create a PDF file and lint it before -%.pdf: %.xml %.xml-lint $(EXTRA_DEPS) FORCE - $(call command,dblatex $(dblatex_quiet) -P draft.mode=no $<,DBLATEX,$<) - -upload: $(pdfs) $(ASCIIDOCPDFS) - rsync -avz $(pdfs) $(ASCIIDOCPDFS) $(UPLOAD_PATH)/ - -FORCE: diff --git a/build/Makefile.vty-reference.inc b/build/Makefile.vty-reference.inc new file mode 100644 index 0000000..87dda52 --- /dev/null +++ b/build/Makefile.vty-reference.inc @@ -0,0 +1,46 @@ +# Usage: +# Have files: +# - osmoyada-vty-reference.xml +# A docbook root XML including a &chapter-vty; reference. +# - vty/*additions*.xml +# Manual additions to specific VTY nodes, any number of files. +# - vty/*_reference.xml +# Export from VTY 'show online-help', exactly one file. +# +# In your Makefile, +# - define 'TOPDIR' to point at the git root, +# - define the (single) name of the vty-reference source in VTY_REFERENCE, +# - include this file. +# +# e.g. +# +# TOPDIR = .. +# VTY_REFERENCE = osmofoo-vty-reference.xml +# include $(TOPDIR)/build/Makefile.vty-reference.inc +# +# This uses the Makefile.docbook.inc, you should not mix uses of +# Makefile.vty-reference.inc and Makefile.docbook.inc. +# +# There can be only one VTY reference built per dir, because files from vty/ +# are picked up by wildcards, and identically named artifacts are built in +# subdir generated/. + +DOCBOOKS = $(VTY_REFERENCE) +DOCBOOKS_DEPS = generated/docbook_vty.xml +include $(TOPDIR)/build/Makefile.docbook.inc + +LIBOSMO_DIR ?= ~/source/gsm/libosmocore +MERGE_DOC = $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl + +CLEAN_FILES += generated + +generated/docbook_vty.xml: \ + vty/*xml \ + $(TOPDIR)/common/vty_additions.xml \ + $(TOPDIR)/common/chapters/vty.xml \ + $(TOPDIR)/vty_reference.xsl + $(TOPDIR)/build/vty_reference_combine.sh "$(MERGE_DOC)" \ + $(TOPDIR)/common/vty_additions.xml \ + vty/*additions*.xml + xsltproc $(TOPDIR)/vty_reference.xsl generated/combined.xml \ + > generated/docbook_vty.xml diff --git a/build/vty_reference_combine.sh b/build/vty_reference_combine.sh new file mode 100755 index 0000000..be234a7 --- /dev/null +++ b/build/vty_reference_combine.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +# the first argument should point at libosmocore/doc/vty/merge_doc.xsl +MERGE_DOC="$1" +shift + +combined="generated/combined.xml" +combine_src="generated/combine_src.xml" + +reference="vty/*reference.xml" +test "$(ls -1 $reference | wc -l)" = "1" + +set -x +mkdir -p generated +cp $reference "$combined" + +while [ -n "$1" ]; do + addition="$(realpath "$1")" + shift + mv "$combined" "$combine_src" + xsltproc -o "$combined" \ + --stringparam with "$addition" \ + "$MERGE_DOC" "$combine_src" +done -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 6 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 08:22:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 08:22:04 +0000 Subject: [MERGED] libosmocore[master]: Replace bitvec_set_uint() with bitvec_set_u64() In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Replace bitvec_set_uint() with bitvec_set_u64() ...................................................................... Replace bitvec_set_uint() with bitvec_set_u64() Old bitvec_set_uint() uses "unsigned int" as input parameter which length is not guaranteed. It does not allow to specify which bit_value to set and does not check for incorrect length. Overall this makes it harder to re-use and more error-prone. Let's replace it with extended implementation which uses fixed type length parameters and extra checks. The additional parameter allows caller to explicitly indicate the need to use L/H instead of 0/1 for bit vector elements. It's necessary to properly encode some of the messages from 3GPP TS 44.018, for example ?10.5.2.16 IA Rest Octets. The old function is left for backward compatibility as a tiny wrapper around new function and will be deprecated in follow-up patches. Change-Id: I1b670dacb55fb3063271d045f9faa10fccba10a6 Related: OS#1526 --- M include/osmocom/core/bitvec.h M src/bitvec.c 2 files changed, 28 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index d4c7d68..19466ab 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -28,6 +28,7 @@ #include #include +#include #include /*! A single GSM bit @@ -57,6 +58,7 @@ int bitvec_set_bit(struct bitvec *bv, enum bit_value bit); int bitvec_get_bit_high(struct bitvec *bv); int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count); +int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh); int bitvec_set_uint(struct bitvec *bv, unsigned int in, unsigned int count); int bitvec_get_uint(struct bitvec *bv, unsigned int num_bits); int bitvec_find_bit_pos(const struct bitvec *bv, unsigned int n, enum bit_value val); diff --git a/src/bitvec.c b/src/bitvec.c index f07b42c..24049cd 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -215,24 +215,41 @@ return 0; } -/*! set multiple bits (based on numeric value) at current pos - * \return 0 in case of success; negative in case of error */ -int bitvec_set_uint(struct bitvec *bv, unsigned int ui, unsigned int num_bits) +/*! set multiple bits (based on numeric value) at current pos. + * \param[in] bv bit vector. + * \param[in] v mask representing which bits needs to be set. + * \param[in] num_bits number of meaningful bits in the mask. + * \param[in] use_lh whether to interpret the bits as L/H values or as 0/1. + * \return 0 on success; negative in case of error. */ +int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh) { - int rc; - unsigned i; + uint8_t i; + + if (num_bits > 64) + return -E2BIG; + for (i = 0; i < num_bits; i++) { - int bit = 0; - if (ui & (1u << (num_bits - i - 1))) - bit = 1; + int rc; + enum bit_value bit = use_lh ? L : 0; + + if (v & ((uint64_t)1 << (num_bits - i - 1))) + bit = use_lh ? H : 1; + rc = bitvec_set_bit(bv, bit); - if (rc) + if (rc != 0) return rc; } return 0; } +/*! set multiple bits (based on numeric value) at current pos. + * \return 0 in case of success; negative in case of error. */ +int bitvec_set_uint(struct bitvec *bv, unsigned int ui, unsigned int num_bits) +{ + return bitvec_set_u64(bv, ui, num_bits, false); +} + /*! get multiple bits (num_bits) from beginning of vector (MSB side) * \return 16bit signed integer retrieved from bit vector */ int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits) -- To view, visit https://gerrit.osmocom.org/4337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1b670dacb55fb3063271d045f9faa10fccba10a6 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 08:22:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 08:22:10 +0000 Subject: [MERGED] libosmocore[master]: Add tests for bitvec_write_field() In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add tests for bitvec_write_field() ...................................................................... Add tests for bitvec_write_field() This function is actively used by OsmoPCU but have not been covered by tests so far. The test code is based on Minh-Quang Nguyen submission with some modifications. The test's FIXME will be addressed in follow-up patches. Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Related: OS#1526 --- M tests/Makefile.am A tests/bits/bitfield_test.c A tests/bits/bitfield_test.ok M tests/testsuite.at 4 files changed, 211 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/Makefile.am b/tests/Makefile.am index dbe349f..7fb9a7b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -11,6 +11,7 @@ loggingrb/loggingrb_test strrb/strrb_test \ comp128/comp128_test smscb/gsm0341_test \ bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \ + bits/bitfield_test \ tlv/tlv_test gsup/gsup_test oap/oap_test fsm/fsm_test \ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ @@ -76,6 +77,9 @@ bits_bitcomp_test_SOURCES = bits/bitcomp_test.c bits_bitcomp_test_LDADD = $(top_builddir)/src/libosmocore.la + +bits_bitfield_test_SOURCES = bits/bitfield_test.c +bits_bitfield_test_LDADD = $(top_builddir)/src/libosmocore.la conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c conv_conv_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libgsmint.la @@ -232,7 +236,7 @@ vty/ok_more_spaces.cfg \ vty/ok_tabs_and_spaces.cfg \ vty/ok_tabs.cfg \ - comp128/comp128_test.ok \ + comp128/comp128_test.ok bits/bitfield_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \ diff --git a/tests/bits/bitfield_test.c b/tests/bits/bitfield_test.c new file mode 100644 index 0000000..d6653e3 --- /dev/null +++ b/tests/bits/bitfield_test.c @@ -0,0 +1,164 @@ +#include +#include +#include +#include + +#include +#include +#include + +#define INTRO(p) printf("=== start %s(%u) ===\n", __func__, p) +#define OUTRO(p) printf("=== end %s(%u) ===\n\n", __func__, p) + +static void test_bitvec_ia_octet_encode_pkt_dl_ass(struct bitvec *dest, uint32_t ttli, + uint8_t tfi, uint8_t gamma, uint8_t ta_valid, uint8_t ws_enc, + bool use_lh) +{ + unsigned wp = 0; + + INTRO(use_lh); + + /* 3GPP TS 44.018 ?10.5.2.16 IA Rest Octets */ + if (use_lh) /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + else + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field(dest, &wp, 1, 2); /* "01" Packet Downlink Assignment */ + bitvec_write_field(dest, &wp, ttli, 32); /* TLLI */ + bitvec_write_field(dest, &wp, 1, 1); /* switch TFI: on */ + bitvec_write_field(dest, &wp, tfi, 5); /* TFI */ + bitvec_write_field(dest, &wp, 0x0, 1); /* RLC acknowledged mode */ + bitvec_write_field(dest, &wp, 0x0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + bitvec_write_field(dest, &wp, 0,1); /* Polling Bit: off */ + bitvec_write_field(dest, &wp, ta_valid, 1); /* N. B: NOT related to TAI! */ + bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ + bitvec_write_field(dest, &wp, 0, 1); /* TBF Starting TIME present */ + bitvec_write_field(dest, &wp, 0, 1); /* P0 not present */ + if (use_lh) { /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + } else + bitvec_write_field(dest, &wp, 1, 1); /* "H" - additional for R99 */ + bitvec_write_field(dest, &wp, ws_enc, 5); /* EGPRS Window Size */ + bitvec_write_field(dest, &wp, 0, 2); /* LINK_QUALITY_MEASUREMENT_MODE */ + bitvec_write_field(dest, &wp, 0, 1); /* BEP_PERIOD2 not present */ + + printf("Encoded PKT DL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); + + OUTRO(use_lh); +} + +static void test_bitvec_ia_octet_encode_pkt_ul_ass(struct bitvec *dest, uint32_t fn, + uint8_t tfi, uint8_t gamma, uint8_t usf, bool tbf, bool use_lh) +{ + unsigned wp = 0; + + INTRO(use_lh); + + /* 3GPP TS 44.018 ?10.5.2.37b 10.5.2.16 */ + if (use_lh) /* FIXME: add function to encode LH properly */ + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + else + bitvec_write_field(dest, &wp, 3, 2); /* "HH" */ + bitvec_write_field(dest, &wp, 0, 2); /* "0" Packet Uplink Assignment */ + if (!tbf) { + bitvec_write_field(dest, &wp, 0, 1); /* Block Allocation: SBA */ + bitvec_write_field(dest, &wp, 0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + bitvec_write_field(dest, &wp, 0, 1); /* No TIMING_ADVANCE_INDEX: */ + bitvec_write_field(dest, &wp, 1, 1); /* TBF_STARTING_TIME_FLAG */ + bitvec_write_field(dest, &wp, (fn / (26 * 51)) % 32, 5); /* T1' */ + bitvec_write_field(dest, &wp, fn % 51, 6); /* T3 */ + bitvec_write_field(dest, &wp, fn % 26, 5); /* T2 */ + } else { + bitvec_write_field(dest, &wp, 1, 1); /* Block Allocation: Not SBA */ + bitvec_write_field(dest, &wp, tfi, 5); /* TFI_ASSIGNMENT */ + bitvec_write_field(dest, &wp, 0, 1); /* POLLING = none */ + bitvec_write_field(dest, &wp, 0, 1); /* ALLOCATION_TYPE: dynamic */ + bitvec_write_field(dest, &wp, usf, 3); /* USF */ + bitvec_write_field(dest, &wp, 0, 1); /* USF_GRANULARITY */ + bitvec_write_field(dest, &wp, 0, 1); /* "0" power control: Not Present */ + bitvec_write_field(dest, &wp, 0, 2); /* CHANNEL_CODING_COMMAND */ + bitvec_write_field(dest, &wp, 1, 1); /* TLLI_BLOCK_CHANNEL_CODING */ + bitvec_write_field(dest, &wp, 0, 1); /* ALPHA = not present */ + bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power control parameter */ + /* note: there is no choise for TAI and no starting time */ + bitvec_write_field(dest, &wp, 0, 1); /* switch TIMING_ADVANCE_INDEX = off */ + bitvec_write_field(dest, &wp, 0, 1); /* TBF_STARTING_TIME_FLAG */ + } + + printf("Encoded PKT UL ASS IA Rest Octets: %s\n", osmo_hexdump(dest->data, dest->data_len)); + + OUTRO(use_lh); +} + +static void test_bitdiff(const struct bitvec *src1, const struct bitvec *src2, unsigned len) +{ + unsigned int bit_err = 0, i, j; + uint8_t byte_err = 0; + + INTRO(len); + + for (i = 0; i < len; i++) { + /* byte compare */ + byte_err = src1->data[i] ^ src2->data[i]; + if (byte_err) + for (j = 0; j < 8; j++) + bit_err += (byte_err >> j) & 0x01; /* count bits which differ */ + } + + + printf("=== total %u bits differ ===\n", bit_err); + + OUTRO(len); +} + +static inline void buf_init(struct bitvec *dest, struct bitvec *dest_lh) +{ + /* initialize buffer */ + bitvec_unhex(dest, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + bitvec_unhex(dest_lh, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); +} + +static inline void test_enc_ul_ass(struct bitvec *dest, struct bitvec *dest_lh, uint32_t fn, + uint8_t tfi, uint8_t gamma, uint8_t usf, bool tbf) +{ + buf_init(dest, dest_lh); + + test_bitvec_ia_octet_encode_pkt_ul_ass(dest, fn, tfi, gamma, usf, tbf, false); + test_bitvec_ia_octet_encode_pkt_ul_ass(dest_lh, fn, tfi, gamma, usf, tbf, true); + + test_bitdiff(dest, dest_lh, 22); +} + +int main(int argc, char **argv) +{ + void *tall_pcu_ctx; + struct bitvec *dest, *dest_lh; + uint8_t gamma = 0, ta_valid = 1, ws_enc = 3, usf = 1, tfi = 0; /* Temporary Flow Identity */ + uint32_t ttli = 0xdeadbeef, fn = 1234; + + tall_pcu_ctx = talloc_named_const(NULL, 1, "bitvecTest context"); + if (!tall_pcu_ctx) + return EXIT_FAILURE; + + dest = bitvec_alloc(22, tall_pcu_ctx); + dest_lh = bitvec_alloc(22, tall_pcu_ctx); + + buf_init(dest, dest_lh); + + test_bitvec_ia_octet_encode_pkt_dl_ass(dest, ttli, tfi, gamma, ta_valid, ws_enc, false); + test_bitvec_ia_octet_encode_pkt_dl_ass(dest_lh, ttli, tfi, gamma, ta_valid, ws_enc, true); + + test_bitdiff(dest, dest_lh, 22); + + test_enc_ul_ass(dest, dest_lh, fn, tfi, gamma, usf, false); + test_enc_ul_ass(dest, dest_lh, fn, tfi, gamma, usf, true); + + bitvec_free(dest); + bitvec_free(dest_lh); + + talloc_free(tall_pcu_ctx); + + return EXIT_SUCCESS; +} diff --git a/tests/bits/bitfield_test.ok b/tests/bits/bitfield_test.ok new file mode 100644 index 0000000..5cb2500 --- /dev/null +++ b/tests/bits/bitfield_test.ok @@ -0,0 +1,36 @@ +=== start test_bitvec_ia_octet_encode_pkt_dl_ass(0) === +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_dl_ass(0) === + +=== start test_bitvec_ia_octet_encode_pkt_dl_ass(1) === +Encoded PKT DL ASS IA Rest Octets: dd ea db ee f8 00 22 31 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_dl_ass(1) === + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(0) === +Encoded PKT UL ASS IA Rest Octets: c0 08 0a 63 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(0) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(1) === +Encoded PKT UL ASS IA Rest Octets: c0 08 0a 63 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(1) === + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(0) === +Encoded PKT UL ASS IA Rest Octets: c8 02 10 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(0) === + +=== start test_bitvec_ia_octet_encode_pkt_ul_ass(1) === +Encoded PKT UL ASS IA Rest Octets: c8 02 10 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_bitvec_ia_octet_encode_pkt_ul_ass(1) === + +=== start test_bitdiff(22) === +=== total 0 bits differ === +=== end test_bitdiff(22) === + diff --git a/tests/testsuite.at b/tests/testsuite.at index 483860f..4a59b22 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -45,6 +45,12 @@ AT_CHECK([$abs_top_builddir/tests/bits/bitcomp_test], [0], [expout]) AT_CLEANUP +AT_SETUP([bitfield]) +AT_KEYWORDS([bitfield]) +cat $abs_srcdir/bits/bitfield_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/bits/bitfield_test], [0], [expout]) +AT_CLEANUP + AT_SETUP([conv]) AT_KEYWORDS([conv]) cat $abs_srcdir/conv/conv_test.ok > expout -- To view, visit https://gerrit.osmocom.org/4336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2ee544256b8675bc62a42493aab66a8eeee54f90 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 08:22:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 08:22:34 +0000 Subject: [MERGED] osmo-msc[master]: Remove pkg-config file In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove pkg-config file ...................................................................... Remove pkg-config file It's an artefact of split which is unused anyway. Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 --- M Makefile.am M configure.ac M include/osmocom/msc/Makefile.am D osmo-msc.pc.in 4 files changed, 1 insertion(+), 24 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 9a92b08..690deae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,9 +16,6 @@ contrib \ $(NULL) -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = osmo-msc.pc - BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 8f468d5..64fead8 100644 --- a/configure.ac +++ b/configure.ac @@ -171,7 +171,6 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - osmo-msc.pc include/Makefile include/osmocom/Makefile include/osmocom/msc/Makefile diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 4099c9e..1419e8e 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -6,6 +6,7 @@ a_iface_bssap.h \ arfcn_range_encode.h \ auth.h \ + bsc_api.h \ bsc_msc.h \ bsc_msg_filter.h \ bsc_rll.h \ @@ -66,13 +67,3 @@ vlr.h \ vty.h \ $(NULL) - -openbsc_HEADERS = \ - bsc_api.h \ - gsm_04_08.h \ - meas_rep.h \ - $(NULL) - -# DO NOT add a newline and '$(NULL)' to this line. That would add a trailing -# space to the directory installed: $prefix/include/'openbsc ' -openbscdir = $(includedir)/openbsc diff --git a/osmo-msc.pc.in b/osmo-msc.pc.in deleted file mode 100644 index c406061..0000000 --- a/osmo-msc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/ - -Name: OsmoMSC -Description: Osmocom Mobile Switching Center -Requires: -Version: @VERSION@ -Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/4231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:03:44 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 10:03:44 +0000 Subject: [MERGED] osmo-bts[master]: Move power loop to generic tests In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Move power loop to generic tests ...................................................................... Move power loop to generic tests There's nothing sysmobts specific in this test so let's move it into separate directory and run unconditionally. The test itself is unaltered except for intro text. Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397 Related: OS#2223 --- M .gitignore M configure.ac M tests/Makefile.am A tests/power/Makefile.am A tests/power/power_test.c A tests/power/power_test.ok M tests/sysmobts/sysmobts_test.c M tests/sysmobts/sysmobts_test.ok M tests/testsuite.at 9 files changed, 114 insertions(+), 63 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index a8c0ece..2e8c884 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,4 @@ debian/osmo-bts-trx-dbg/ debian/osmo-bts-trx/ debian/tmp/ +/tests/power/power_test diff --git a/configure.ac b/configure.ac index a41f7ec..bda30b5 100644 --- a/configure.ac +++ b/configure.ac @@ -178,5 +178,6 @@ tests/misc/Makefile tests/handover/Makefile tests/tx_power/Makefile + tests/power/Makefile tests/meas/Makefile Makefile) diff --git a/tests/Makefile.am b/tests/Makefile.am index d2b4181..18b8ce6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = paging cipher agch misc handover tx_power meas +SUBDIRS = paging cipher agch misc handover tx_power power meas if ENABLE_SYSMOBTS SUBDIRS += sysmobts diff --git a/tests/power/Makefile.am b/tests/power/Makefile.am new file mode 100644 index 0000000..3cb8d15 --- /dev/null +++ b/tests/power/Makefile.am @@ -0,0 +1,9 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) + +noinst_PROGRAMS = power_test +EXTRA_DIST = power_test.ok + +power_test_SOURCES = power_test.c $(srcdir)/../stubs.c +power_test_LDADD = $(top_builddir)/src/common/libbts.a $(LIBOSMOABIS_LIBS) $(LDADD) diff --git a/tests/power/power_test.c b/tests/power/power_test.c new file mode 100644 index 0000000..c1d6a5a --- /dev/null +++ b/tests/power/power_test.c @@ -0,0 +1,93 @@ +/* + * (C) 2013,2014 by Holger Hans Peter Freyther + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#include + +static void test_power_loop(void) +{ + struct gsm_bts bts; + struct gsm_bts_role_bts btsb; + struct gsm_bts_trx trx; + struct gsm_bts_trx_ts ts; + struct gsm_lchan *lchan; + int ret; + + memset(&bts, 0, sizeof(bts)); + memset(&btsb, 0, sizeof(btsb)); + memset(&trx, 0, sizeof(trx)); + memset(&ts, 0, sizeof(ts)); + + lchan = &ts.lchan[0]; + lchan->ts = &ts; + ts.trx = &trx; + trx.bts = &bts; + bts.role = &btsb; + bts.band = GSM_BAND_1800; + trx.ms_power_control = 1; + btsb.ul_power_target = -75; + + /* Simply clamping */ + lchan->state = LCHAN_S_NONE; + lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); + OSMO_ASSERT(ret == 0); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); + + + /* + * Now 15 dB too little and we should power it up. Could be a + * power level of 7 or 8 for 15 dBm + */ + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -90); + OSMO_ASSERT(ret == 1); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 7); + + /* It should be clamped to level 0 and 30 dBm */ + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -100); + OSMO_ASSERT(ret == 1); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); + + /* Fix it and jump down */ + lchan->ms_power_ctrl.fixed = 1; + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); + OSMO_ASSERT(ret == 0); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); + + /* And leave it again */ + lchan->ms_power_ctrl.fixed = 0; + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -40); + OSMO_ASSERT(ret == 1); + OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); +} + +int main(int argc, char **argv) +{ + printf("Testing power loop...\n"); + + test_power_loop(); + + printf("Power loop test OK\n"); + + return 0; +} diff --git a/tests/power/power_test.ok b/tests/power/power_test.ok new file mode 100644 index 0000000..6bf508b --- /dev/null +++ b/tests/power/power_test.ok @@ -0,0 +1,2 @@ +Testing power loop... +Power loop test OK diff --git a/tests/sysmobts/sysmobts_test.c b/tests/sysmobts/sysmobts_test.c index 6ae7623..32d6e95 100644 --- a/tests/sysmobts/sysmobts_test.c +++ b/tests/sysmobts/sysmobts_test.c @@ -182,72 +182,12 @@ * this happens asynchronously on the other side of the l1sap queue */ } -static void test_sysmobts_loop(void) -{ - struct gsm_bts bts; - struct gsm_bts_role_bts btsb; - struct gsm_bts_trx trx; - struct gsm_bts_trx_ts ts; - struct gsm_lchan *lchan; - int ret; - - memset(&bts, 0, sizeof(bts)); - memset(&btsb, 0, sizeof(btsb)); - memset(&trx, 0, sizeof(trx)); - memset(&ts, 0, sizeof(ts)); - - lchan = &ts.lchan[0]; - lchan->ts = &ts; - ts.trx = &trx; - trx.bts = &bts; - bts.role = &btsb; - bts.band = GSM_BAND_1800; - trx.ms_power_control = 1; - btsb.ul_power_target = -75; - - printf("Testing sysmobts power control\n"); - - /* Simply clamping */ - lchan->state = LCHAN_S_NONE; - lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); - - - /* - * Now 15 dB too little and we should power it up. Could be a - * power level of 7 or 8 for 15 dBm - */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -90); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 7); - - /* It should be clamped to level 0 and 30 dBm */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -100); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); - - /* Fix it and jump down */ - lchan->ms_power_ctrl.fixed = 1; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); - - /* And leave it again */ - lchan->ms_power_ctrl.fixed = 0; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -40); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); -} - int main(int argc, char **argv) { printf("Testing sysmobts routines\n"); test_sysmobts_auto_band(); test_sysmobts_cipher(); - test_sysmobts_loop(); + return 0; } diff --git a/tests/sysmobts/sysmobts_test.ok b/tests/sysmobts/sysmobts_test.ok index 07d79fd..1f53417 100644 --- a/tests/sysmobts/sysmobts_test.ok +++ b/tests/sysmobts/sysmobts_test.ok @@ -17,4 +17,3 @@ PCS to PCS band(1) arfcn(512) want(3) got(3) PCS to PCS band(8) arfcn(128) want(0) got(0) PCS to PCS band(2) arfcn(438) want(-1) got(-1) -Testing sysmobts power control diff --git a/tests/testsuite.at b/tests/testsuite.at index 0efd333..2d1cefd 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -31,6 +31,12 @@ AT_CHECK([$abs_top_builddir/tests/handover/handover_test], [], [expout], [ignore]) AT_CLEANUP +AT_SETUP([power]) +AT_KEYWORDS([power]) +cat $abs_srcdir/power/power_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/power/power_test], [], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([tx_power]) AT_KEYWORDS([tx_power]) cat $abs_srcdir/tx_power/tx_power_test.ok > expout -- To view, visit https://gerrit.osmocom.org/4222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:14:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 10:14:18 +0000 Subject: [MERGED] osmo-bts[master]: Make power test more verbose In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Make power test more verbose ...................................................................... Make power test more verbose Power control loop test outputs next to nothing which is not very helpful. Make it more verbose. While at it, also move duplicated code into static function to make test cases less cluttered. Change-Id: I0a5e65e23e62442ef8758ecbcf8e7820b4f15d7b Related: OS#2223 --- M tests/power/power_test.c M tests/power/power_test.ok 2 files changed, 20 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/power/power_test.c b/tests/power/power_test.c index c1d6a5a..3099217 100644 --- a/tests/power/power_test.c +++ b/tests/power/power_test.c @@ -23,6 +23,15 @@ #include +static inline void apply_power_test(struct gsm_lchan *lchan, int rxlev, int exp_ret, uint8_t exp_current) +{ + int ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, rxlev); + + printf("power control [%d]: MS current power %u\n", ret, lchan->ms_power_ctrl.current); + OSMO_ASSERT(ret == exp_ret); + OSMO_ASSERT(lchan->ms_power_ctrl.current == exp_current); +} + static void test_power_loop(void) { struct gsm_bts bts; @@ -46,39 +55,29 @@ trx.ms_power_control = 1; btsb.ul_power_target = -75; - /* Simply clamping */ lchan->state = LCHAN_S_NONE; lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0); OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); + /* Simply clamping */ + apply_power_test(lchan, -60, 0, 15); /* * Now 15 dB too little and we should power it up. Could be a * power level of 7 or 8 for 15 dBm */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -90); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 7); + apply_power_test(lchan, -90, 1, 7); /* It should be clamped to level 0 and 30 dBm */ - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -100); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); + apply_power_test(lchan, -100, 1, 0); /* Fix it and jump down */ lchan->ms_power_ctrl.fixed = 1; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); - OSMO_ASSERT(ret == 0); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); + apply_power_test(lchan, -60, 0, 0); /* And leave it again */ lchan->ms_power_ctrl.fixed = 0; - ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -40); - OSMO_ASSERT(ret == 1); - OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); + apply_power_test(lchan, -40, 1, 15); } int main(int argc, char **argv) diff --git a/tests/power/power_test.ok b/tests/power/power_test.ok index 6bf508b..cf0a38b 100644 --- a/tests/power/power_test.ok +++ b/tests/power/power_test.ok @@ -1,2 +1,7 @@ Testing power loop... +power control [0]: MS current power 15 +power control [1]: MS current power 7 +power control [1]: MS current power 0 +power control [0]: MS current power 0 +power control [1]: MS current power 15 Power loop test OK -- To view, visit https://gerrit.osmocom.org/4223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a5e65e23e62442ef8758ecbcf8e7820b4f15d7b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:14:39 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 10:14:39 +0000 Subject: [PATCH] libosmocore[master]: Prefer bitvec_set_u64() over bitvec_set_uint() In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4338 to look at the new patch set (#4). Prefer bitvec_set_u64() over bitvec_set_uint() The bitvec_set_uint() is just a compatibility wrapper around bitvec_set_u64() anyway. Change-Id: I2fd8d17f9fa6c51ef51f4294882cca5944d71df2 --- M src/bitcomp.c M src/bitvec.c M src/gsm/gsm_utils.c M tests/bits/bitcomp_test.c M tests/bitvec/bitvec_test.c 5 files changed, 83 insertions(+), 83 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/4338/4 diff --git a/src/bitcomp.c b/src/bitcomp.c index 94f60eb..db5a43e 100644 --- a/src/bitcomp.c +++ b/src/bitcomp.c @@ -227,81 +227,81 @@ static inline int t4_rle(struct bitvec *bv, unsigned len, bool b) { if (len >= 960) { - bitvec_set_uint(bv, t4_make_up[b][14], t4_make_up_length[b][14]); - return bitvec_set_uint(bv, t4_term[b][len - 960], t4_term_length[b][len - 960]); + bitvec_set_u64(bv, t4_make_up[b][14], t4_make_up_length[b][14], false); + return bitvec_set_u64(bv, t4_term[b][len - 960], t4_term_length[b][len - 960], false); } if (len >= 896) { - bitvec_set_uint(bv, t4_make_up[b][13], t4_make_up_length[b][13]); - return bitvec_set_uint(bv, t4_term[b][len - 896], t4_term_length[b][len - 896]); + bitvec_set_u64(bv, t4_make_up[b][13], t4_make_up_length[b][13], false); + return bitvec_set_u64(bv, t4_term[b][len - 896], t4_term_length[b][len - 896], false); } if (len >= 832) { - bitvec_set_uint(bv, t4_make_up[b][12], t4_make_up_length[b][12]); - return bitvec_set_uint(bv, t4_term[b][len - 832], t4_term_length[b][len - 832]); + bitvec_set_u64(bv, t4_make_up[b][12], t4_make_up_length[b][12], false); + return bitvec_set_u64(bv, t4_term[b][len - 832], t4_term_length[b][len - 832], false); } if (len >= 768) { - bitvec_set_uint(bv, t4_make_up[b][11], t4_make_up_length[b][11]); - return bitvec_set_uint(bv, t4_term[b][len - 768], t4_term_length[b][len - 768]); + bitvec_set_u64(bv, t4_make_up[b][11], t4_make_up_length[b][11], false); + return bitvec_set_u64(bv, t4_term[b][len - 768], t4_term_length[b][len - 768], false); } if (len >= 704) { - bitvec_set_uint(bv, t4_make_up[b][10], t4_make_up_length[b][10]); - return bitvec_set_uint(bv, t4_term[b][len - 704], t4_term_length[b][len - 704]); + bitvec_set_u64(bv, t4_make_up[b][10], t4_make_up_length[b][10], false); + return bitvec_set_u64(bv, t4_term[b][len - 704], t4_term_length[b][len - 704], false); } if (len >= 640) { - bitvec_set_uint(bv, t4_make_up[b][9], t4_make_up_length[b][9]); - return bitvec_set_uint(bv, t4_term[b][len - 640], t4_term_length[b][len - 640]); + bitvec_set_u64(bv, t4_make_up[b][9], t4_make_up_length[b][9], false); + return bitvec_set_u64(bv, t4_term[b][len - 640], t4_term_length[b][len - 640], false); } if (len >= 576) { - bitvec_set_uint(bv, t4_make_up[b][8], t4_make_up_length[b][8]); - return bitvec_set_uint(bv, t4_term[b][len - 576], t4_term_length[b][len - 576]); + bitvec_set_u64(bv, t4_make_up[b][8], t4_make_up_length[b][8], false); + return bitvec_set_u64(bv, t4_term[b][len - 576], t4_term_length[b][len - 576], false); } if (len >= 512) { - bitvec_set_uint(bv, t4_make_up[b][7], t4_make_up_length[b][7]); - return bitvec_set_uint(bv, t4_term[b][len - 512], t4_term_length[b][len - 512]); + bitvec_set_u64(bv, t4_make_up[b][7], t4_make_up_length[b][7], false); + return bitvec_set_u64(bv, t4_term[b][len - 512], t4_term_length[b][len - 512], false); } if (len >= 448) { - bitvec_set_uint(bv, t4_make_up[b][6], t4_make_up_length[b][6]); - return bitvec_set_uint(bv, t4_term[b][len - 448], t4_term_length[b][len - 448]); + bitvec_set_u64(bv, t4_make_up[b][6], t4_make_up_length[b][6], false); + return bitvec_set_u64(bv, t4_term[b][len - 448], t4_term_length[b][len - 448], false); } if (len >= 384) { - bitvec_set_uint(bv, t4_make_up[b][5], t4_make_up_length[b][5]); - return bitvec_set_uint(bv, t4_term[b][len - 384], t4_term_length[b][len - 384]); + bitvec_set_u64(bv, t4_make_up[b][5], t4_make_up_length[b][5], false); + return bitvec_set_u64(bv, t4_term[b][len - 384], t4_term_length[b][len - 384], false); } if (len >= 320) { - bitvec_set_uint(bv, t4_make_up[b][4], t4_make_up_length[b][4]); - return bitvec_set_uint(bv, t4_term[b][len - 320], t4_term_length[b][len - 320]); + bitvec_set_u64(bv, t4_make_up[b][4], t4_make_up_length[b][4], false); + return bitvec_set_u64(bv, t4_term[b][len - 320], t4_term_length[b][len - 320], false); } if (len >= 256) { - bitvec_set_uint(bv, t4_make_up[b][3], t4_make_up_length[b][3]); - return bitvec_set_uint(bv, t4_term[b][len - 256], t4_term_length[b][len - 256]); + bitvec_set_u64(bv, t4_make_up[b][3], t4_make_up_length[b][3], false); + return bitvec_set_u64(bv, t4_term[b][len - 256], t4_term_length[b][len - 256], false); } if (len >= 192) { - bitvec_set_uint(bv, t4_make_up[b][2], t4_make_up_length[b][2]); - return bitvec_set_uint(bv, t4_term[b][len - 192], t4_term_length[b][len - 192]); + bitvec_set_u64(bv, t4_make_up[b][2], t4_make_up_length[b][2], false); + return bitvec_set_u64(bv, t4_term[b][len - 192], t4_term_length[b][len - 192], false); } if (len >= 128) { - bitvec_set_uint(bv, t4_make_up[b][1], t4_make_up_length[b][1]); - return bitvec_set_uint(bv, t4_term[b][len - 128], t4_term_length[b][len - 128]); + bitvec_set_u64(bv, t4_make_up[b][1], t4_make_up_length[b][1], false); + return bitvec_set_u64(bv, t4_term[b][len - 128], t4_term_length[b][len - 128], false); } if (len >= 64) { - bitvec_set_uint(bv, t4_make_up[b][0], t4_make_up_length[b][0]); - return bitvec_set_uint(bv, t4_term[b][len - 64], t4_term_length[b][len - 64]); + bitvec_set_u64(bv, t4_make_up[b][0], t4_make_up_length[b][0], false); + return bitvec_set_u64(bv, t4_term[b][len - 64], t4_term_length[b][len - 64], false); } - return bitvec_set_uint(bv, t4_term[b][len], t4_term_length[b][len]); + return bitvec_set_u64(bv, t4_term[b][len], t4_term_length[b][len], false); } /*! encode bit vector in-place using T4 encoding diff --git a/src/bitvec.c b/src/bitvec.c index 09aca21..2dec4f9 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -706,7 +706,7 @@ bits += (1 + num_bits); } else { bitvec_set_bit(bv, 1); - bitvec_set_uint(bv, array[i], num_bits); + bitvec_set_u64(bv, array[i], num_bits, false); } } diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index e3f792e..6e49bb4 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -836,35 +836,35 @@ * \param[in] r Input Range1024 sructure */ void bitvec_add_range1024(struct bitvec *bv, const struct gsm48_range_1024 *r) { - bitvec_set_uint(bv, r->w1_hi, 2); - bitvec_set_uint(bv, r->w1_lo, 8); - bitvec_set_uint(bv, r->w2_hi, 8); - bitvec_set_uint(bv, r->w2_lo, 1); - bitvec_set_uint(bv, r->w3_hi, 7); - bitvec_set_uint(bv, r->w3_lo, 2); - bitvec_set_uint(bv, r->w4_hi, 6); - bitvec_set_uint(bv, r->w4_lo, 2); - bitvec_set_uint(bv, r->w5_hi, 6); - bitvec_set_uint(bv, r->w5_lo, 2); - bitvec_set_uint(bv, r->w6_hi, 6); - bitvec_set_uint(bv, r->w6_lo, 2); - bitvec_set_uint(bv, r->w7_hi, 6); - bitvec_set_uint(bv, r->w7_lo, 2); - bitvec_set_uint(bv, r->w8_hi, 6); - bitvec_set_uint(bv, r->w8_lo, 1); - bitvec_set_uint(bv, r->w9, 7); - bitvec_set_uint(bv, r->w10, 7); - bitvec_set_uint(bv, r->w11_hi, 1); - bitvec_set_uint(bv, r->w11_lo, 6); - bitvec_set_uint(bv, r->w12_hi, 2); - bitvec_set_uint(bv, r->w12_lo, 5); - bitvec_set_uint(bv, r->w13_hi, 3); - bitvec_set_uint(bv, r->w13_lo, 4); - bitvec_set_uint(bv, r->w14_hi, 4); - bitvec_set_uint(bv, r->w14_lo, 3); - bitvec_set_uint(bv, r->w15_hi, 5); - bitvec_set_uint(bv, r->w15_lo, 2); - bitvec_set_uint(bv, r->w16, 6); + bitvec_set_u64(bv, r->w1_hi, 2, false); + bitvec_set_u64(bv, r->w1_lo, 8, false); + bitvec_set_u64(bv, r->w2_hi, 8, false); + bitvec_set_u64(bv, r->w2_lo, 1, false); + bitvec_set_u64(bv, r->w3_hi, 7, false); + bitvec_set_u64(bv, r->w3_lo, 2, false); + bitvec_set_u64(bv, r->w4_hi, 6, false); + bitvec_set_u64(bv, r->w4_lo, 2, false); + bitvec_set_u64(bv, r->w5_hi, 6, false); + bitvec_set_u64(bv, r->w5_lo, 2, false); + bitvec_set_u64(bv, r->w6_hi, 6, false); + bitvec_set_u64(bv, r->w6_lo, 2, false); + bitvec_set_u64(bv, r->w7_hi, 6, false); + bitvec_set_u64(bv, r->w7_lo, 2, false); + bitvec_set_u64(bv, r->w8_hi, 6, false); + bitvec_set_u64(bv, r->w8_lo, 1, false); + bitvec_set_u64(bv, r->w9, 7, false); + bitvec_set_u64(bv, r->w10, 7, false); + bitvec_set_u64(bv, r->w11_hi, 1, false); + bitvec_set_u64(bv, r->w11_lo, 6, false); + bitvec_set_u64(bv, r->w12_hi, 2, false); + bitvec_set_u64(bv, r->w12_lo, 5, false); + bitvec_set_u64(bv, r->w13_hi, 3, false); + bitvec_set_u64(bv, r->w13_lo, 4, false); + bitvec_set_u64(bv, r->w14_hi, 4, false); + bitvec_set_u64(bv, r->w14_lo, 3, false); + bitvec_set_u64(bv, r->w15_hi, 5, false); + bitvec_set_u64(bv, r->w15_lo, 2, false); + bitvec_set_u64(bv, r->w16, 6, false); } /*! Determine GPRS TLLI Type (TS 23.003 Chapter 2.6) */ diff --git a/tests/bits/bitcomp_test.c b/tests/bits/bitcomp_test.c index 587dd72..de59aa6 100644 --- a/tests/bits/bitcomp_test.c +++ b/tests/bits/bitcomp_test.c @@ -31,22 +31,22 @@ printf("\nTEST1:\n 00110111 01000111 10000001 1111\n"); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0x374781F, 28); bitvec_to_string_r(&bv, lol); printf("%s", lol); + bitvec_set_u64(&bv, 0x374781F, 28, false); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf("\nEncoded:\n%d", osmo_t4_encode(&bv)); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf(" [%d]\nExpected:\n0 11011110 10001000 01110101 01100101 100 [35]\n", bv.cur_bit); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xDE887565, 32); - bitvec_set_uint(&bv, 4, 3); + bitvec_set_u64(&bv, 0xDE887565, 32, false); + bitvec_set_u64(&bv, 4, 3, false); bitvec_to_string_r(&bv, lol); printf(" %s [%d]\n", lol, bv.cur_bit); printf("\nTEST2:\n 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00\n"); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xFFFFFFFF, 32); - bitvec_set_uint(&bv, 0xFFFFFFFF, 32); - bitvec_set_uint(&bv, 0xFFFFFC00, 26); bitvec_to_string_r(&bv, lol); printf("%s", lol); + bitvec_set_u64(&bv, 0xFFFFFFFF, 32, false); + bitvec_set_u64(&bv, 0xFFFFFFFF, 32, false); + bitvec_set_u64(&bv, 0xFFFFFC00, 26, false); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf("\nEncoded:\n%d", osmo_t4_encode(&bv)); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf(" [%d]\nExpected:\n1 11011101 01000001 00 [18]\n", bv.cur_bit); diff --git a/tests/bitvec/bitvec_test.c b/tests/bitvec/bitvec_test.c index d0bc30c..15c0f2b 100644 --- a/tests/bitvec/bitvec_test.c +++ b/tests/bitvec/bitvec_test.c @@ -88,11 +88,11 @@ /* Write to bitvec */ memset(data, 0x00, sizeof(data)); bv.cur_bit = i; - rc = bitvec_set_uint(&bv, 0x7e, 8); + rc = bitvec_set_u64(&bv, 0x7e, 8, false); OSMO_ASSERT(rc >= 0); rc = bitvec_set_bytes(&bv, in, in_size); OSMO_ASSERT(rc >= 0); - rc = bitvec_set_uint(&bv, 0x7e, 8); + rc = bitvec_set_u64(&bv, 0x7e, 8, false); OSMO_ASSERT(rc >= 0); printf("bitvec: %s\n", osmo_hexdump(bv.data, bv.data_len)); @@ -193,29 +193,29 @@ printf("test shifting...\n"); - bitvec_set_uint(&bv, 0x0E, 7); + bitvec_set_u64(&bv, 0x0E, 7, false); test_shift(&bv, 3); test_shift(&bv, 17); - bitvec_set_uint(&bv, 0, 32); - bitvec_set_uint(&bv, 0x0A, 7); + bitvec_set_u64(&bv, 0, 32, false); + bitvec_set_u64(&bv, 0x0A, 7, false); test_shift(&bv, 24); printf("checking RL functions...\n"); bitvec_zero(&bv); test_rl(&bv); - bitvec_set_uint(&bv, 0x000F, 32); + bitvec_set_u64(&bv, 0x000F, 32, false); test_rl(&bv); bitvec_shiftl(&bv, 18); test_rl(&bv); - bitvec_set_uint(&bv, 0x0F, 8); + bitvec_set_u64(&bv, 0x0F, 8, false); test_rl(&bv); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xFF, 8); + bitvec_set_u64(&bv, 0xFF, 8, false); test_rl(&bv); - bitvec_set_uint(&bv, 0xFE, 7); + bitvec_set_u64(&bv, 0xFE, 7, false); test_rl(&bv); - bitvec_set_uint(&bv, 0, 17); + bitvec_set_u64(&bv, 0, 17, false); test_rl(&bv); bitvec_shiftl(&bv, 18); test_rl(&bv); @@ -223,7 +223,7 @@ printf("probing bit access...\n"); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0x3747817, 32); + bitvec_set_u64(&bv, 0x3747817, 32, false); bitvec_shiftl(&bv, 10); test_get(&bv, 2); @@ -260,12 +260,12 @@ printf("\nbitvec_runlength....\n"); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xff, 8); + bitvec_set_u64(&bv, 0xff, 8, false); bv.cur_bit -= 8; test_bitvec_rl_curbit(&bv, 1, 64, 8); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xfc, 8); + bitvec_set_u64(&bv, 0xfc, 8, false); bv.cur_bit -= 8; test_bitvec_rl_curbit(&bv, 1, 64, 6); @@ -273,13 +273,13 @@ test_bitvec_rl_curbit(&bv, 0, 52, 52); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xfc, 8); + bitvec_set_u64(&bv, 0xfc, 8, false); bv.cur_bit -= 2; test_bitvec_rl_curbit(&bv, 0, 64, 58); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0x07, 8); - bitvec_set_uint(&bv, 0xf8, 8); + bitvec_set_u64(&bv, 0x07, 8, false); + bitvec_set_u64(&bv, 0xf8, 8, false); bv.cur_bit -= 11; test_bitvec_rl_curbit(&bv, 1, 64, 8); -- To view, visit https://gerrit.osmocom.org/4338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2fd8d17f9fa6c51ef51f4294882cca5944d71df2 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:21:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 10:21:47 +0000 Subject: libosmocore[master]: Expand bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 7: > I am applying new bitvec_write_field_ext function for encoding LH bits of IA Rest OCtets of EDGE PKT DL IMM ASS in PCU. Could you please share your patch for OsmoPCU? Let's see if we can use L/H directly as a parameter in separate function instead of extending this one. Or maybe get rid of the function altogether and manually update wp. -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:22:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 10:22:03 +0000 Subject: [MERGED] libosmocore[master]: Simplify bitvec_write_field() In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Simplify bitvec_write_field() ...................................................................... Simplify bitvec_write_field() Use existing function instead of copy-pasted loop. Change-Id: I9fe27c06125ac52e02e63dcded056a5f1cf68f41 Related: OS#1526 --- M src/bitvec.c 1 file changed, 7 insertions(+), 9 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bitvec.c b/src/bitvec.c index 24049cd..e86315c 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -505,18 +505,16 @@ */ int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) { - unsigned int i; int rc; + bv->cur_bit = *write_index; - for (i = 0; i < len; i++) { - int bit = 0; - if (val & ((uint64_t)1 << (len - i - 1))) - bit = 1; - rc = bitvec_set_bit(bv, bit); - if (rc) - return rc; - } + + rc = bitvec_set_u64(bv, val, len, false); + if (rc != 0) + return rc; + *write_index += len; + return 0; } -- To view, visit https://gerrit.osmocom.org/4339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9fe27c06125ac52e02e63dcded056a5f1cf68f41 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:36:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 10:36:24 +0000 Subject: [PATCH] libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4317 to look at the new patch set (#3). gb: optionally allow nsip packets only from a specific host When listening for nsip connections is enabled, then every remote host may send packets. This is useful for an SGSN that serves multiple PCUs, but contraproductive for a PCU that awaits packets from a single SGSN. Add struct members remote_ip, and remote_port to struct gprs_ns_inst, when set, then the listening end uses connect() to ensure that only the expected host may send packets. Related: OS#2401 Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 --- M TODO-RELEASE M include/osmocom/gprs/gprs_ns.h M src/gb/gprs_ns.c 3 files changed, 28 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/4317/3 diff --git a/TODO-RELEASE b/TODO-RELEASE index 1964cff..e5a6f70 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -12,3 +12,4 @@ libosmogsm/oap ABI change fix AUTS length to 14, not 16 (length is implicit) osmo-auc-gen UI change fix AUTS length to 14, not 16 (length is implicit) libosmovty ABI change redefine _LAST_OSMOVTY_NODE as a high number to increase node space +libosmogb ABI change add struct members nsip.remote_ip, and nsip.remote_port to struct gprs_ns_inst \ No newline at end of file diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 938ad99..66e3d9e 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -88,6 +88,8 @@ struct osmo_fd fd; uint32_t local_ip; uint16_t local_port; + uint32_t remote_ip; + uint16_t remote_port; int dscp; } nsip; /*! NS-over-FR-over-GRE-over-IP specific bits */ diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index d20ed23..862f5b5 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1561,15 +1561,37 @@ int gprs_ns_nsip_listen(struct gprs_ns_inst *nsi) { struct in_addr in; + struct in_addr remote; + char remote_str[INET_ADDRSTRLEN]; int ret; in.s_addr = osmo_htonl(nsi->nsip.local_ip); + remote.s_addr = osmo_htonl(nsi->nsip.remote_ip); nsi->nsip.fd.cb = nsip_fd_cb; nsi->nsip.fd.data = nsi; - ret = osmo_sock_init_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, - IPPROTO_UDP, inet_ntoa(in), - nsi->nsip.local_port, OSMO_SOCK_F_BIND); + + if (nsi->nsip.remote_ip && nsi->nsip.remote_port) { + /* connect to ensure only we only accept packets from the + * configured remote end/peer */ + snprintf(remote_str, sizeof(remote_str), "%s", inet_ntoa(remote)); + ret = + osmo_sock_init2_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, + IPPROTO_UDP, inet_ntoa(in), + nsi->nsip.local_port, remote_str, + nsi->nsip.remote_port, OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT); + + LOGP(DNS, LOGL_NOTICE, + "Listening for nsip packets from %s:%u on %s:%u\n", + remote_str, nsi->nsip.remote_port, inet_ntoa(in), nsi->nsip.local_port); + } else { + /* Accept UDP packets from any source IP/Port */ + ret = osmo_sock_init_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, + IPPROTO_UDP, inet_ntoa(in), nsi->nsip.local_port, OSMO_SOCK_F_BIND); + + LOGP(DNS, LOGL_NOTICE, "Listening for nsip packets on %s:%u\n", inet_ntoa(in), nsi->nsip.local_port); + } + if (ret < 0) return ret; -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:38:25 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Oct 2017 10:38:25 +0000 Subject: [PATCH] libosmo-netif[master]: osmux_snprintf: Support different types of Osmux frames In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4386 to look at the new patch set (#2). osmux_snprintf: Support different types of Osmux frames Previous implementation handled all types as if they were Osmux AMR frames. For Dummy frames, we account the padding but we don't care about the padding content. For Signalling ones, as they are not in the specification yet, it is better avoid using unespecified fields and return an error because it's still not known how extra data will be handled in the input msgb. Change-Id: I48565472b47c2a0e5db50881fbb005537af8c70d --- M src/osmux.c 1 file changed, 35 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/86/4386/2 diff --git a/src/osmux.c b/src/osmux.c index cad4c5d..0027a51 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -921,30 +921,44 @@ msg_off += sizeof(struct osmux_hdr); msg_len -= sizeof(struct osmux_hdr); - if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { - LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT %d, skipping\n", - osmuxh->amr_ft); + switch (osmuxh->ft) { + case OSMUX_FT_SIGNAL: + ret = snprintf(buf + offset, remain, "[signal]"); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + return -1; + case OSMUX_FT_DUMMY: + case OSMUX_FT_VOICE_AMR: + if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { + LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT %d, skipping\n", + osmuxh->amr_ft); + return -1; + } + + payload_len = osmux_get_payload_len(osmuxh); + + if (msg_len < payload_len) { + LOGP(DLMIB, LOGL_ERROR, + "No room for OSMUX payload: only %d bytes\n", + msg_len); + return -1; + } + + if (osmuxh->ft == OSMUX_FT_VOICE_AMR) { + ret = osmux_snprintf_payload(buf + offset, remain, + osmux_get_payload(osmuxh), + payload_len); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + } + + msg_off += payload_len; + msg_len -= payload_len; + break; + default: + LOGP(DLMIB, LOGL_ERROR, "Unknown OSMUX ft value %d\n", + osmuxh->ft); return -1; } - - payload_len = osmux_get_payload_len(osmuxh); - - if (msg_len < payload_len) { - LOGP(DLMIB, LOGL_ERROR, - "No room for OSMUX payload: only %d bytes\n", - msg_len); - return -1; - } - - ret = osmux_snprintf_payload(buf + offset, remain, - osmux_get_payload(osmuxh), - payload_len); - SNPRINTF_BUFFER_SIZE(ret, remain, offset); - - msg_off += payload_len; - msg_len -= payload_len; } - return offset; } -- To view, visit https://gerrit.osmocom.org/4386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I48565472b47c2a0e5db50881fbb005537af8c70d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:47:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 10:47:10 +0000 Subject: libosmo-netif[master]: osmux_snprintf: Support different types of Osmux frames In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I48565472b47c2a0e5db50881fbb005537af8c70d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:49:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 10:49:02 +0000 Subject: libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 > Kind of similar to adding new signature to existing API functions. > The end result is not particularly beautiful, but we'd not break > API. no, please don't. Let's merge this now as-is, and then quickly follow-up with a new release. but we still need to establish how to handle this in the future. -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:49:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 10:49:14 +0000 Subject: osmo-pcu[master]: gb: allow only packets from a specific SGSN In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4319 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic2009039fab7cf0fba916556239747ae5b410366 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:50:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 10:50:08 +0000 Subject: [MERGED] libosmocore[master]: gb: optionally allow nsip packets only from a specific host In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gb: optionally allow nsip packets only from a specific host ...................................................................... gb: optionally allow nsip packets only from a specific host When listening for nsip connections is enabled, then every remote host may send packets. This is useful for an SGSN that serves multiple PCUs, but contraproductive for a PCU that awaits packets from a single SGSN. Add struct members remote_ip, and remote_port to struct gprs_ns_inst, when set, then the listening end uses connect() to ensure that only the expected host may send packets. Related: OS#2401 Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 --- M TODO-RELEASE M include/osmocom/gprs/gprs_ns.h M src/gb/gprs_ns.c 3 files changed, 28 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index 1964cff..e5a6f70 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -12,3 +12,4 @@ libosmogsm/oap ABI change fix AUTS length to 14, not 16 (length is implicit) osmo-auc-gen UI change fix AUTS length to 14, not 16 (length is implicit) libosmovty ABI change redefine _LAST_OSMOVTY_NODE as a high number to increase node space +libosmogb ABI change add struct members nsip.remote_ip, and nsip.remote_port to struct gprs_ns_inst \ No newline at end of file diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 5aee755..d4aef82 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -88,6 +88,8 @@ struct osmo_fd fd; uint32_t local_ip; uint16_t local_port; + uint32_t remote_ip; + uint16_t remote_port; int dscp; } nsip; /*! NS-over-FR-over-GRE-over-IP specific bits */ diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 7443a8b..fd465b4 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1561,15 +1561,37 @@ int gprs_ns_nsip_listen(struct gprs_ns_inst *nsi) { struct in_addr in; + struct in_addr remote; + char remote_str[INET_ADDRSTRLEN]; int ret; in.s_addr = osmo_htonl(nsi->nsip.local_ip); + remote.s_addr = osmo_htonl(nsi->nsip.remote_ip); nsi->nsip.fd.cb = nsip_fd_cb; nsi->nsip.fd.data = nsi; - ret = osmo_sock_init_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, - IPPROTO_UDP, inet_ntoa(in), - nsi->nsip.local_port, OSMO_SOCK_F_BIND); + + if (nsi->nsip.remote_ip && nsi->nsip.remote_port) { + /* connect to ensure only we only accept packets from the + * configured remote end/peer */ + snprintf(remote_str, sizeof(remote_str), "%s", inet_ntoa(remote)); + ret = + osmo_sock_init2_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, + IPPROTO_UDP, inet_ntoa(in), + nsi->nsip.local_port, remote_str, + nsi->nsip.remote_port, OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT); + + LOGP(DNS, LOGL_NOTICE, + "Listening for nsip packets from %s:%u on %s:%u\n", + remote_str, nsi->nsip.remote_port, inet_ntoa(in), nsi->nsip.local_port); + } else { + /* Accept UDP packets from any source IP/Port */ + ret = osmo_sock_init_ofd(&nsi->nsip.fd, AF_INET, SOCK_DGRAM, + IPPROTO_UDP, inet_ntoa(in), nsi->nsip.local_port, OSMO_SOCK_F_BIND); + + LOGP(DNS, LOGL_NOTICE, "Listening for nsip packets on %s:%u\n", inet_ntoa(in), nsi->nsip.local_port); + } + if (ret < 0) return ret; -- To view, visit https://gerrit.osmocom.org/4317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:50:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Oct 2017 10:50:35 +0000 Subject: [MERGED] libosmo-netif[master]: osmux_snprintf: Add doxygen doc In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmux_snprintf: Add doxygen doc ...................................................................... osmux_snprintf: Add doxygen doc Change-Id: Idb3fcf25be9558bfc2f822352c07ebc2cb7d5caa --- M src/osmux.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmux.c b/src/osmux.c index 0027a51..7beb705 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -892,7 +892,16 @@ return offset; } - +/*! Print osmux header fields and payload from msg into buffer buf. + * \param[out] buf buffer to store the output into + * \param[in] len length of buf in bytes + * \param[in] msgb message buffer containing one or more osmux frames + * \returns the number of characters printed (excluding the null byte used to end output to strings). + * + * If the output was truncated due to this limit, then the return value is the number of characters + * (excluding the terminating null byte) which would have been written to the final string if enough + * space had been available. + */ int osmux_snprintf(char *buf, size_t size, struct msgb *msg) { unsigned int remain = size; -- To view, visit https://gerrit.osmocom.org/4387 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idb3fcf25be9558bfc2f822352c07ebc2cb7d5caa Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:50:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Oct 2017 10:50:36 +0000 Subject: [MERGED] libosmo-netif[master]: osmux_snprintf: Support different types of Osmux frames In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmux_snprintf: Support different types of Osmux frames ...................................................................... osmux_snprintf: Support different types of Osmux frames Previous implementation handled all types as if they were Osmux AMR frames. For Dummy frames, we account the padding but we don't care about the padding content. For Signalling ones, as they are not in the specification yet, it is better avoid using unespecified fields and return an error because it's still not known how extra data will be handled in the input msgb. Change-Id: I48565472b47c2a0e5db50881fbb005537af8c70d --- M src/osmux.c 1 file changed, 35 insertions(+), 21 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmux.c b/src/osmux.c index cad4c5d..0027a51 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -921,30 +921,44 @@ msg_off += sizeof(struct osmux_hdr); msg_len -= sizeof(struct osmux_hdr); - if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { - LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT %d, skipping\n", - osmuxh->amr_ft); + switch (osmuxh->ft) { + case OSMUX_FT_SIGNAL: + ret = snprintf(buf + offset, remain, "[signal]"); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + return -1; + case OSMUX_FT_DUMMY: + case OSMUX_FT_VOICE_AMR: + if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { + LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT %d, skipping\n", + osmuxh->amr_ft); + return -1; + } + + payload_len = osmux_get_payload_len(osmuxh); + + if (msg_len < payload_len) { + LOGP(DLMIB, LOGL_ERROR, + "No room for OSMUX payload: only %d bytes\n", + msg_len); + return -1; + } + + if (osmuxh->ft == OSMUX_FT_VOICE_AMR) { + ret = osmux_snprintf_payload(buf + offset, remain, + osmux_get_payload(osmuxh), + payload_len); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + } + + msg_off += payload_len; + msg_len -= payload_len; + break; + default: + LOGP(DLMIB, LOGL_ERROR, "Unknown OSMUX ft value %d\n", + osmuxh->ft); return -1; } - - payload_len = osmux_get_payload_len(osmuxh); - - if (msg_len < payload_len) { - LOGP(DLMIB, LOGL_ERROR, - "No room for OSMUX payload: only %d bytes\n", - msg_len); - return -1; - } - - ret = osmux_snprintf_payload(buf + offset, remain, - osmux_get_payload(osmuxh), - payload_len); - SNPRINTF_BUFFER_SIZE(ret, remain, offset); - - msg_off += payload_len; - msg_len -= payload_len; } - return offset; } -- To view, visit https://gerrit.osmocom.org/4386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I48565472b47c2a0e5db50881fbb005537af8c70d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:50:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Oct 2017 10:50:36 +0000 Subject: [MERGED] libosmo-netif[master]: osmux_snprintf: Split logic parsing osmux header and AMR pay... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmux_snprintf: Split logic parsing osmux header and AMR payload ...................................................................... osmux_snprintf: Split logic parsing osmux header and AMR payload The current code still expects to parse only AMR osmux frames, but that will be fixed in following patches. Change-Id: Ic2f4d1d3cc88af912bb43c8ecd90eacc6ff7190f --- M src/osmux.c 1 file changed, 13 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmux.c b/src/osmux.c index 7290d99..cad4c5d 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -896,10 +896,11 @@ int osmux_snprintf(char *buf, size_t size, struct msgb *msg) { unsigned int remain = size; - int this_len, msg_off = 0; + unsigned int msg_off = 0; struct osmux_hdr *osmuxh; unsigned int offset = 0; int msg_len = msg->len; + uint32_t payload_len; int ret; if (size) @@ -914,20 +915,21 @@ } osmuxh = (struct osmux_hdr *)((uint8_t *)msg->data + msg_off); + ret = osmux_snprintf_header(buf + offset, remain, osmuxh); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + + msg_off += sizeof(struct osmux_hdr); + msg_len -= sizeof(struct osmux_hdr); + if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT %d, skipping\n", osmuxh->amr_ft); return -1; } - ret = osmux_snprintf_header(buf + offset, remain, osmuxh); - SNPRINTF_BUFFER_SIZE(ret, remain, offset); + payload_len = osmux_get_payload_len(osmuxh); - this_len = sizeof(struct osmux_hdr) + - osmux_get_payload_len(osmuxh); - msg_off += this_len; - - if (msg_len < this_len) { + if (msg_len < payload_len) { LOGP(DLMIB, LOGL_ERROR, "No room for OSMUX payload: only %d bytes\n", msg_len); @@ -936,10 +938,11 @@ ret = osmux_snprintf_payload(buf + offset, remain, osmux_get_payload(osmuxh), - osmux_get_payload_len(osmuxh)); + payload_len); SNPRINTF_BUFFER_SIZE(ret, remain, offset); - msg_len -= this_len; + msg_off += payload_len; + msg_len -= payload_len; } return offset; -- To view, visit https://gerrit.osmocom.org/4385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic2f4d1d3cc88af912bb43c8ecd90eacc6ff7190f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:51:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 10:51:11 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: add OsmoHLR manual, OsmoHLR VTY reference In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add OsmoHLR manual, OsmoHLR VTY reference ...................................................................... add OsmoHLR manual, OsmoHLR VTY reference Change-Id: Ieb6a362a26a7e65199f68f5cd32d9b6b0e5d0fbf --- M Makefile A OsmoHLR/Makefile A OsmoHLR/chapters/control.adoc A OsmoHLR/chapters/overview.adoc A OsmoHLR/chapters/running.adoc A OsmoHLR/chapters/subscribers.adoc A OsmoHLR/example_subscriber_add_update_delete.vty A OsmoHLR/example_subscriber_cs_ps_enabled.ctrl A OsmoHLR/example_subscriber_info.ctrl A OsmoHLR/osmohlr-usermanual-docinfo.xml A OsmoHLR/osmohlr-usermanual.adoc A OsmoHLR/osmohlr-vty-reference.xml A OsmoHLR/vty/hlr_vty_additions.xml A OsmoHLR/vty/hlr_vty_reference.xml M OsmoMSC/chapters/running.adoc 15 files changed, 1,756 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile b/Makefile index ffa25de..8f8d9b6 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) cd OsmoMSC; $(MAKE) + cd OsmoHLR; $(MAKE) clean: cd OsmoBTS; $(MAKE) clean @@ -21,6 +22,7 @@ cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean cd OsmoMSC; $(MAKE) clean + cd OsmoHLR; $(MAKE) clean upload: cd OsmoBTS; $(MAKE) upload @@ -33,6 +35,7 @@ cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload cd OsmoMSC; $(MAKE) upload + cd OsmoHLR; $(MAKE) upload check: cd OsmoBTS; $(MAKE) check @@ -46,6 +49,7 @@ #cd OsmoNAT; $(MAKE) check cd OsmoGSMTester; $(MAKE) check cd OsmoMSC; $(MAKE) check + cd OsmoHLR; $(MAKE) check define check_dep_bin @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; } diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile new file mode 100644 index 0000000..eba5fa3 --- /dev/null +++ b/OsmoHLR/Makefile @@ -0,0 +1,42 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +topdir = . +hlr_reference = $(topdir)/osmohlr-vty-reference.xml +manuals = $(hlr_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + +TOPDIR := .. +ASCIIDOCS := osmohlr-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmohlr-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml + +clean: + -rm -rf $(cleanfiles) + -rm osmohlr-usermanual__*.svg + -rm osmohlr-usermanual__*.png + -rm osmohlr-usermanual.check + +generated/docbook_vty.xml: osmohlr-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/hlr_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging Common BSC VTY) + $(call command,xsltproc -o generated/combined3.xml \ + --stringparam with $(PWD)/vty/hlr_vty_additions.xml \ + $(MERGE_DOC) generated/combined2.xml, \ + XSLTPROC,Merging HLR VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting HLR VTY to DocBook) diff --git a/OsmoHLR/chapters/control.adoc b/OsmoHLR/chapters/control.adoc new file mode 100644 index 0000000..89c9c08 --- /dev/null +++ b/OsmoHLR/chapters/control.adoc @@ -0,0 +1,101 @@ +[[hlr-ctrl]] +== Control interface + +The actual protocol is described in <>, the variables common +to all programs using it are described in <>. This section +describes the CTRL interface variables specific to OsmoHLR. + +All subscriber variables are available by different selectors, which are freely +interchangeable: + +.Subscriber selectors available on OsmoHLR's Control interface +[options="header",width="100%",cols="35%,65%"] +|=== +|Selector|Comment +|subscriber.*by-imsi-*'123456'.*|Subscriber selector by IMSI, replace "123456" with the actual IMSI +|subscriber.*by-msisdn-*'123456'.*|Subscriber selector by MSISDN +|subscriber.*by-id-*'123456'.*|Subscriber selector by database ID +|=== + +Each of the above selectors feature all of these control variables: + +.Subscriber variables available on OsmoHLR's Control interface +[options="header",width="100%",cols="35%,8%,8%,8%,41%"] +|=== +|Name|Access|Trap|Value|Comment +|subscriber.by-\*.*info*|R|No||List (short) subscriber information +|subscriber.by-\*.*info-aud*|R|No||List subscriber authentication tokens +|subscriber.by-\*.*info-all*|R|No||List both 'info' and 'info-aud' in one +|subscriber.by-\*.*cs-enabled*|RW|No|'1' or '0'|Enable/disable circuit-switched access +|subscriber.by-\*.*ps-enabled*|RW|No|'1' or '0'|Enable/disable packet-switched access +|=== + +=== subscriber.by-*.info, info-aud, info-all + +Query the HLR database and return current subscriber record, in multiple lines +of the format + +---- +namevalue +---- + +To keep the reply as short as possible, most values are omitted if they are +empty or reflect the default. These are the returned values and their presence +modalities; for their meaning, see <>: + +.Returned values by OsmoHLR's 'info', 'info-all' and 'info-aud' commands +[options="header",width="100%",cols="15%,15%,30%,40%"] +|=== +|Returned by 'info-all' and|Name|Format|Presence +|'info'|id|-9223372036854775808 .. 9223372036854775807 (usually not negative)|always +|'info'|imsi|6 to 15 decimal digits|always +|'info'|msisdn|1 to 15 decimal digits|when non-empty +|'info'|nam_cs|'1' or '0'|when '0' +|'info'|nam_ps|'1' or '0'|when '0' +|'info'|vlr_number|up to 15 decimal digits|when non-empty +|'info'|sgsn_number|up to 15 decimal digits|when non-empty +|'info'|sgsn_address||when non-empty +|'info-aud'|aud2g.algo|one of 'comp128v1', 'comp128v2', 'comp128v3' or 'xor'|when valid 2G auth data is set +|'info-aud'|aud2g.ki|32 hexadecimal digits|when valid 2G auth data is set +|'info-aud'|aud3g.algo|so far always 'milenage'|when valid 3G auth data is set +|'info-aud'|aud3g.k|32 hexadecimal digits|when valid 3G auth data is set +|'info-aud'|aud3g.op|32 hexadecimal digits|when valid 3G auth data is set, *not* when OPC is set +|'info-aud'|aud3g.opc|32 hexadecimal digits|when valid 3G auth data is set, *not* when OP is set +|'info-aud'|aud3g.ind_bitlen|0..28|when valid 3G auth data is set +|'info-aud'|aud3g.sqn|0 .. 18446744073709551615|when valid 3G auth data is set +|=== + +This is an example Control Interface transcript that illustrates the various +'info' commands: + +---- +include::../example_subscriber_info.ctrl[] +---- + +=== subscriber.by-*.ps-enabled, cs-enabled + +Disable or enable packet-/circuit-switched access for the given IMSI; + +* 'ps-enabled' switches access to GPRS or UMTS data services, +* 'cs-enabled' switches access to voice services. + +When disabled, the next time this subscriber attempts to do a Location Updating +GSUP operation for the given domain (i.e. from the SGSN for 'ps-enabled', from +the MSC/VLR for 'cs-enabled'), it will be rejected by OsmoHLR. Currently +connected GSUP clients will be notified via GSUP when a subscriber is being +disabled, so that the subscriber can be dropped in case it is currently +attached. + +The current 'ps-enabled'/'cs-enabled' status can be queried by 'GET' commands, +and also by looking at 'nam_ps' and 'nam_cs' in a 'subscriber.by-*.info' +response. + +A value of "1" indicates that the given domain is enabled, which is the +default; a value of "0" disables access. + +This is an example transcript that illustrates 'ps-enabled' and 'cs-enabled' +commands: + +---- +include::../example_subscriber_cs_ps_enabled.ctrl[] +---- diff --git a/OsmoHLR/chapters/overview.adoc b/OsmoHLR/chapters/overview.adoc new file mode 100644 index 0000000..45802ca --- /dev/null +++ b/OsmoHLR/chapters/overview.adoc @@ -0,0 +1,69 @@ +[[overview]] +== Overview + +This manual should help you getting started with OsmoHLR. It will cover +aspects of configuring and running the OsmoHLR. + +[[intro_overview]] +=== About OsmoHLR + +OsmoHLR is Osmocom's minimal implementation of a Home Location Register (HLR) +for 2G and 3G GSM and UMTS mobile core networks. Its interfaces are: + +- GSUP, serving towards OsmoMSC and OsmoSGSN; +- A local SQLite database; +- The Osmocom typical telnet VTY and CTRL interfaces. + +Originally, the OpenBSC project's OsmoNITB all-in-one implementation had an +integrated HLR, managing subscribers and SMS in the same local database. Along +with the separate OsmoMSC and its new VLR component, OsmoHLR was implemented +from scratch to alleviate various shortcomings of the internal HLR: + +- The separate HLR allows using centralized subscriber management for both + circuit-switched and packet-switched domains (i.e. one OsmoHLR for both + OsmoMSC and OsmoSGSN). + +- VLR and HLR brought full UMTS AKA (Authentication and Key Agreement) support, + i.e. Milenage authentication in both the full 3G variant as well as the + backwards compatible 2G variant. + +- In contrast to the OsmoNITB, the specific way the new OsmoMSC's VLR accesses + OsmoHLR brings fully asynchronous subscriber database access. + +Find the OsmoHLR issue tracker and wiki online at + +- https://osmocom.org/projects/osmo-hlr +- https://osmocom.org/projects/osmo-hlr/wiki + + +[[fig-gsm]] +.Typical GSM network architecture used with OsmoHLR +[graphviz] +---- +digraph G { + rankdir=LR; + subgraph cluster_hlr { + label = "OsmoHLR"; + GSUP [label="GSUP server"] + DB [label="SQLite DB"] + GSUP->DB + DB->CTRL [dir="back"] + DB->VTY [dir="back"] + } + + Admin [label="Admin and\nMaintenance"] + SW [label="3rd party software\nintegration"] + VTY->Admin [dir="back"] + CTRL->SW [dir="back"] + + MSC [label="MSC/VLR"] + MSC->GSUP [label="GSUP"] + SGSN->GSUP [label="GSUP"] + + BSC->MSC + HNBGW->MSC + HNBGW->SGSN + PCU->SGSN +} +---- + diff --git a/OsmoHLR/chapters/running.adoc b/OsmoHLR/chapters/running.adoc new file mode 100644 index 0000000..09388c0 --- /dev/null +++ b/OsmoHLR/chapters/running.adoc @@ -0,0 +1,90 @@ +== Running OsmoHLR + +The OsmoHLR executable (`osmo-hlr`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-hlr* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-T] [-e 'LOGLEVEL'] [-l 'DATABASE'] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-d, --debug 'DBGMASK','DBGLEVELS'*:: + Set the log subsystems and levels for logging to stderr. This + has mostly been superseded by VTY-based logging configuration, + see <> for further information. +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `openbsc.cfg` in the current + working directory. +*-s, --disable-color*:: + Disable colors for logging to stderr. This has mostly been + deprecated by VTY based logging configuration, see <> + for more information. +*-T, --timestamp*:: + Enable time-stamping of log messages to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-e, --log-level 'LOGLEVEL'*:: + Set the global log level for logging to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-l, --database 'DATABASE'*:: + Specify the file name of the SQLite3 database to use as HLR/AUC + storage + +=== Bootstrap the Database + +Before first launching OsmoHLR, you need to create a database, which can be +done with these commands: + +---- +mkdir -p /var/lib/osmocom +sqlite3 /var/lib/osmocom/hlr.db < /usr/share/doc/osmo-hlr/hlr.sql +---- + +Depending on your installation choices, you will probably find `hlr.sql` in one +of these locations: + +- `/usr/share/doc/osmo-hlr/hlr.sql` +- `/usr/local/share/doc/osmo-hlr/hlr.sql` +- in `osmo-hlr.git`'s source tree at `sql/hlr.sql` + +NOTE: At the time of writing, OsmoHLR does not create an initial empty database +automatically, like OsmoNITB did. This behavior may be added in the future. + +=== Multiple instances + +Running multiple instances of `osmo-hlr` on the same computer is possible if +all interfaces (VTY, CTRL) are separated using the appropriate configuration +options. The IP based interfaces are binding to local host by default. In order +to separate the processes, the user has to bind those services to specific but +different IP addresses and/or ports. + +The VTY and the Control interface can be bound to IP addresses from the loopback +address range, for example: + +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- + +The GSUP interface can be bound to a specific IP address by the following +configuration options: + +---- +hlr + gsup + bind ip 10.23.42.1 +---- + +NOTE: At the time of writing, OsmoHLR lacks a config option to change the GSUP +port, which is by default TCP port 4222. diff --git a/OsmoHLR/chapters/subscribers.adoc b/OsmoHLR/chapters/subscribers.adoc new file mode 100644 index 0000000..b2024d2 --- /dev/null +++ b/OsmoHLR/chapters/subscribers.adoc @@ -0,0 +1,59 @@ +== Managing Subscribers + +Subscribers are kept in a local SQLite database file and can be managed via VTY +and CTRL interfaces. + +See this section for some examples, and also refer to the OsmoHLR VTY reference +manual <> as well as the Control interface described in +<>. + +=== Example: Add/Update/Delete Subscriber via VTY + +The following telnet VTY session adds a subscriber complete with 2G and 3G +authentication tokens, and finally removes the subscriber again; it assumes +that osmo-hlr is running and listening for telnet VTY connections on localhost: + +---- +$ telnet localhost 4258 +include::../example_subscriber_add_update_delete.vty[] +---- + +[[subscriber-params]] +=== Subscriber Parameters + +The following parameters are managed for each subscriber of the HLR, modelled +roughly after 3GPP TS 23.008, version 13.3.0; note that not all of these +parameters are necessarily in active use: + +.OsmoHLR's subscriber parameters +[options="header",width="100%",cols="20%,20%,60%"] +|=== +|Name|Example|Description +|imsi|901700000014701|identity of the SIM/USIM, 3GPP TS 23.008 chapter 2.1.1.1 +|msisdn|2342123|number to dial to reach this subscriber (multiple MSISDNs can be stored per subscriber), 3GPP TS 23.008 chapter 2.1.2 +|imeisv|4234234234234275|identity of the mobile device and software version, 3GPP TS 23.008 chapter 2.2.3 +|aud2g.algo|comp128v3|Authentication algorithm ID for 2G, corresponds to enum osmo_auth_algo +|aud2g.ki||Subscriber's secret key (128bit) +|aud3g.algo|milenage|Authentication algorithm ID for 3G and UMTS AKA, corresponds to enum osmo_auth_algo +|aud3g.k|(32 hexadecimal digits)|Subscriber's secret key (128bit) +|aud3g.op|(32 hexadecimal digits)|Operator's secret key (128bit) +|aud3g.opc|(32 hexadecimal digits)|Secret key derived from OP and K (128bit), alternative to using OP which does not disclose OP to subscribers +|aud3g.sqn|123|Sequence number of last used key (64bit unsigned) +|aud3g.ind_bitlen|5|Nr of index bits at lower SQN end +|apn|| +|vlr_number||3GPP TS 23.008 chapter 2.4.5 +|hlr_number||3GPP TS 23.008 chapter 2.4.6 +|sgsn_number||3GPP TS 23.008 chapter 2.4.8.1 +|sgsn_address||3GPP TS 23.008 chapter 2.13.10 +|ggsn_number||3GPP TS 23.008 chapter 2.4.8.2 +|gmlc_number||3GPP TS 23.008 chapter 2.4.9.2 +|smsc_number||3GPP TS 23.008 chapter 2.4.23 +|periodic_lu_tmr||3GPP TS 23.008 chapter 2.4.24 +|periodic_rau_tau_tmr||3GPP TS 23.008 chapter 2.13.115 +|nam_cs|1|Enable/disable voice access (3GPP TS 23.008 chapter 2.1.1.2: network access mode) +|nam_ps|0|Enable/disable data access (3GPP TS 23.008 chapter 2.1.1.2: network access mode) +|lmsi||3GPP TS 23.008 chapter 2.1.8 +|ms_purged_cs|0|3GPP TS 23.008 chapter 2.7.5 +|ms_purged_ps|1|3GPP TS 23.008 chapter 2.7.6 +|=== + diff --git a/OsmoHLR/example_subscriber_add_update_delete.vty b/OsmoHLR/example_subscriber_add_update_delete.vty new file mode 100644 index 0000000..ca14a65 --- /dev/null +++ b/OsmoHLR/example_subscriber_add_update_delete.vty @@ -0,0 +1,34 @@ +OsmoHLR> enable +OsmoHLR# subscriber imsi 123456789023000 create +% Created subscriber 123456789023000 + ID: 1 + IMSI: 123456789023000 + MSISDN: none + +OsmoHLR# subscriber imsi 123456789023000 update msisdn 423 +% Updated subscriber IMSI='123456789023000' to MSISDN='423' + +OsmoHLR# subscriber msisdn 423 update aud3g milenage k deaf0ff1ced0d0dabbedd1ced1cef00d opc cededeffacedacefacedbadfadedbeef +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=5 + +OsmoHLR# subscriber msisdn 423 update aud2g comp128v3 ki beefedcafefaceacedaddeddecadefee +OsmoHLR# subscriber msisdn 423 show + ID: 1 + IMSI: 123456789023000 + MSISDN: 423 + 2G auth: COMP128v3 + KI=beefedcafefaceacedaddeddecadefee + 3G auth: MILENAGE + K=deaf0ff1ced0d0dabbedd1ced1cef00d + OPC=cededeffacedacefacedbadfadedbeef + IND-bitlen=5 + +OsmoHLR# subscriber imsi 123456789023000 delete +% Deleted subscriber for IMSI '123456789023000' diff --git a/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl b/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl new file mode 100644 index 0000000..1a98a80 --- /dev/null +++ b/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl @@ -0,0 +1,46 @@ +GET 1 subscriber.by-msisdn-103.info +GET_REPLY 1 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 2 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 2 subscriber.by-msisdn-103.ps-enabled 1 + +SET 3 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 3 subscriber.by-msisdn-103.ps-enabled OK + +GET 4 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 4 subscriber.by-msisdn-103.ps-enabled 0 + +GET 5 subscriber.by-msisdn-103.info +GET_REPLY 5 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_ps 0 + +SET 6 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 6 subscriber.by-msisdn-103.cs-enabled OK + +GET 7 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 7 subscriber.by-msisdn-103.cs-enabled 0 + +GET 8 subscriber.by-msisdn-103.info +GET_REPLY 8 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 + +SET 9 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 9 subscriber.by-msisdn-103.cs-enabled OK +SET 10 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 10 subscriber.by-msisdn-103.ps-enabled OK + +GET 11 subscriber.by-msisdn-103.info +GET_REPLY 11 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 diff --git a/OsmoHLR/example_subscriber_info.ctrl b/OsmoHLR/example_subscriber_info.ctrl new file mode 100644 index 0000000..2020508 --- /dev/null +++ b/OsmoHLR/example_subscriber_info.ctrl @@ -0,0 +1,28 @@ +GET 1 subscriber.by-imsi-901990000000003.info +GET_REPLY 1 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 + +GET 2 subscriber.by-msisdn-103.info-aud +GET_REPLY 2 subscriber.by-msisdn-103.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 3 subscriber.by-id-3.info-all +GET_REPLY 3 subscriber.by-id-3.info-all +id 3 +imsi 901990000000003 +msisdn 103 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 diff --git a/OsmoHLR/osmohlr-usermanual-docinfo.xml b/OsmoHLR/osmohlr-usermanual-docinfo.xml new file mode 100644 index 0000000..d99bba7 --- /dev/null +++ b/OsmoHLR/osmohlr-usermanual-docinfo.xml @@ -0,0 +1,47 @@ + + + 1 + September 18th, 2017 + NH + + Initial version; based on OsmoNITB manual version 2. + + + + + + + Neels + Hofmeyr + nhofmeyr at sysmocom.de + NH + + sysmocom + sysmocom - s.f.m.c. GmbH + Senior Developer + + + + + + 2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with the Invariant Sections being just 'Foreword', + 'Acknowledgements' and 'Preface', with no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoHLR/osmohlr-usermanual.adoc b/OsmoHLR/osmohlr-usermanual.adoc new file mode 100644 index 0000000..2369155 --- /dev/null +++ b/OsmoHLR/osmohlr-usermanual.adoc @@ -0,0 +1,32 @@ +:gfdl-enabled: +:program-name: OsmoHLR + +OsmoHLR User Manual +==================== +Neels Hofmeyr + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +include::chapters/subscribers.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + +include::chapters/control.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] + diff --git a/OsmoHLR/osmohlr-vty-reference.xml b/OsmoHLR/osmohlr-vty-reference.xml new file mode 100644 index 0000000..948f5f9 --- /dev/null +++ b/OsmoHLR/osmohlr-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 18th September 2017 + nh + Initial + + + + OsmoHLR VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoHLR/vty/hlr_vty_additions.xml b/OsmoHLR/vty/hlr_vty_additions.xml new file mode 100644 index 0000000..a4c675e --- /dev/null +++ b/OsmoHLR/vty/hlr_vty_additions.xml @@ -0,0 +1,2 @@ + + diff --git a/OsmoHLR/vty/hlr_vty_reference.xml b/OsmoHLR/vty/hlr_vty_reference.xml new file mode 100644 index 0000000..31b95a1 --- /dev/null +++ b/OsmoHLR/vty/hlr_vty_reference.xml @@ -0,0 +1,1159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OsmoMSC/chapters/running.adoc b/OsmoMSC/chapters/running.adoc index 5925e02..8656a58 100644 --- a/OsmoMSC/chapters/running.adoc +++ b/OsmoMSC/chapters/running.adoc @@ -49,11 +49,11 @@ === Multiple instances -Running multiple instances of `osmo-msc` is possible if all interfaces (VTY, -CTRL) are separated using the appropriate configuration options. The IP based -interfaces are binding to local host by default. In order to separate the -processes, the user has to bind those services to specific but different IP -addresses. +Running multiple instances of `osmo-msc` on the same computer is possible if all +interfaces (VTY, CTRL) are separated using the appropriate configuration +options. The IP based interfaces are binding to local host by default. In order +to separate the processes, the user has to bind those services to specific but +different IP addresses and/or ports. The VTY and the Control interface can be bound to IP addresses from the loopback address range, for example: -- To view, visit https://gerrit.osmocom.org/4348 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb6a362a26a7e65199f68f5cd32d9b6b0e5d0fbf Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:51:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 10:51:12 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: common/vty: minor wording tweaks and typo fixes In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: common/vty: minor wording tweaks and typo fixes ...................................................................... common/vty: minor wording tweaks and typo fixes Change-Id: I5eb1ea0d3de883ff5e9742f77e7ef4be0482852d --- M common/chapters/vty.adoc 1 file changed, 40 insertions(+), 41 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index 51fc6f4..3f72718 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -15,12 +15,12 @@ The interactive telnet VTY is used to * explore the current status of the system, including its configuration - parameters but also run-time state and statistics -* review the currently active (running) configuration + parameters, but also to view run-time state and statistics, +* review the currently active (running) configuration, * perform interactive changes to the configuration (for those items that do not - require a program restart) -* store the current running configuration to the config file -* enable or disable logging; to the VTY itself or to other targets + require a program restart), +* store the current running configuration to the config file, +* enable or disable logging; to the VTY itself or to other targets. The Virtual Tele Type (VTY) has the concept of __nodes__ and __commands__. Each command has a name and arguments. The name may @@ -44,8 +44,9 @@ *overwrite* your config file with the current configuration, after which you should be able to restart the program with all changes taking effect. -This chapter explains the most common nodes nodes and the commands that -are available within the node. +This chapter explains most of the common nodes and commands. A more detailed +list is available in various programs' VTY reference manuals, e.g. see +<>. There are common patterns for the parameters, these include IPv4 addresses, number ranges, a word, a line of text and choice. The @@ -88,14 +89,14 @@ The VTY by default has the following minimal nodes: VIEW:: - The 'VIEW' node is the node you automatically enter when you connect to - a VTY. As its name implies, it can only be used to view the system + When connecting to a telnet VTY, you will be on the 'VIEW' node. + As its name implies, it can only be used to view the system status, but it does not provide commands to alter the system state or configuration. As long as you are in the non-privileged 'VIEW' node, your prompt will end in a `>` character. ENABLE:: - The 'ENABLE' node is entered as soon as you enter the `enable` command + The 'ENABLE' node is entered by the `enable` command, from the 'VIEW' node. Changing into the 'ENABLE' node will unlock all kinds of commands that allow you to alter the system state or perform any other change to it. The 'ENABLE' node and its children are @@ -105,9 +106,9 @@ the `disable` command. CONFIG:: - The 'CONFIG' node is entered when you enter the `configure terminal` + The 'CONFIG' node is entered by the `configure terminal` command from the 'ENABLE' node. The config node is used to change the - run-time configuration parameters of teh system. The prompt will + run-time configuration parameters of the system. The prompt will indicate that you are in the config node by a `(config)#` prompt suffix. + @@ -130,15 +131,15 @@ The VTY features an interactive help system, designed to help you to efficiently navigate is commands. -NOTE: The VTY is present on most Osmcoom GSM/GPRS software, thus this -chapter is present in all the relevant manuals. The detailed examples +NOTE: The VTY is present on most Osmocom GSM/UMTS/GPRS software, thus this +chapter is present in all the relevant manuals. The detailed examples below assume you are executing them on the OsmoNITB VTY. They will work -in similar fashion on the other VTY, too - but of course the output will -be different for each program. +in similar fashion on the other VTY interfaces, while the node structure will +differ in each program. ==== The question-mark (`?`) command -If you type a single `?` at the prompt, the VTY will display you +If you type a single `?` at the prompt, the VTY will display possible completions at the exact location of your currently entered command. @@ -160,14 +161,13 @@ sms SMS related commands subscriber Operations on a Subscriber ---- -<1> press `?` here at the prompt, the character will not be printed +<1> Type `?` here at the prompt, the `?` itself will not be printed. If you have already entered a partial command, `?` will help you to -review possible options of how to continue your command. Let's say you -remember that `show` is used to investigate the system status. But you -don't know exactly what the object was called that you'd like to show: -You simply press `?` after typing `show` and you will see the following -choice: +review possible options of how to continue the command. Let's say you +remember that `show` is used to investigate the system status, but you +don't remember the exact name of the object. Hitting `?` after typing `show` +will help out: .Example: Typing `?` after a partial command ---- @@ -193,10 +193,9 @@ sms-queue Display SMSqueue statistics smpp SMPP Interface ---- -<1> press `?` after the `show` command, the character will not be printed +<1> Type `?` after the `show` command, the `?` itself will not be printed. -Now you decide you want to have a look at the `network` object, so -you type network and press `?` again: +You may pick the `network` object and type `?` again: .Example: Typing `?` after `show network` ---- @@ -204,25 +203,25 @@ ---- -By presenting `` as the only option, the VTY tells you that your -command is complete and does not support any additional arguments. +By presenting `` as the only option, the VTY tells you that your command is +complete without any remaining arguments being available, and that you should +hit enter, a.k.a. "carriage return". ==== TAB completion -The VTY supports tab (tabulator) completion. Simply type any partial -command and press ``, and it will either show you a choice of -possible continuations, or complete the command if there's only one -alternative. +The VTY supports tab (tabulator) completion. Simply type any partial +command and press ``, and it will either show you a list of +possible expansions, or completes the command if there's only one +choice. .Example: Use of `` pressed after typing only `s` as command ---- OpenBSC> s<1> show sms subscriber ---- -<1> press `` here. +<1> Type `` here. -At this point you then have to decide how to continue typing your -command. Let's assume you choose `show`, and then press `` again: +At this point, you may choose `show`, and then press `` again: .Example: Use of `` pressed after typing `show` command ---- @@ -232,13 +231,13 @@ stats e1_driver e1_line e1_timeslot subscriber statistics sms-queue smpp ---- -<1> press `` here. +<1> Type `` here. ==== The `list` command -The `list` command will give you a full list of all commands available -at this node: +The `list` command will give you a full list of all commands and their +arguments available at the current node: .Example: Typing `list` at start of OsmoNITB 'VIEW' node prompt ---- @@ -294,9 +293,9 @@ ---- TIP: Remember, the list of available commands will change significantly -depending on the Osmocom program you are accessing, and the current node -you're at. Compare the above example of the OsmoNITB 'VIEW' node with -the result from the OsmoNITB 'TRX' config node: +depending on the Osmocom program you are accessing, its software version and +the current node you're at. Compare the above example of the OsmoNITB 'VIEW' +node with the list of the OsmoNITB 'TRX' config node: .Example: Typing `list` at start of OsmoNITB 'TRX' config node prompt ---- -- To view, visit https://gerrit.osmocom.org/4347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5eb1ea0d3de883ff5e9742f77e7ef4be0482852d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:51:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 10:51:12 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: common/vty: explain difference between telnet and config file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: common/vty: explain difference between telnet and config file ...................................................................... common/vty: explain difference between telnet and config file - Mention that the CONFIG node is used to parse config files. - Mention that it is not well defined whether CONFIG node items have immediate effect. - Add a 'telnet' here and there to clarify. Change-Id: I882346c69f12c67d0e41d563c99d4de4efd8b8f6 --- M common/chapters/vty.adoc 1 file changed, 18 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index 995fd2f..51fc6f4 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -12,12 +12,13 @@ use the Control interface instead of the VTY, and to actively request / implement the Control interface commands as required for your use case. -The Osmocom VTY is used to +The interactive telnet VTY is used to * explore the current status of the system, including its configuration parameters but also run-time state and statistics * review the currently active (running) configuration -* perform interactive changes to the configuration +* perform interactive changes to the configuration (for those items that do not + require a program restart) * store the current running configuration to the config file * enable or disable logging; to the VTY itself or to other targets @@ -28,6 +29,20 @@ of options. The available commands depend on the current node. there are various keyboard shortcuts to ease finding commands and the possible argument values. + +Configuration file parsing during program start is actually performed the VTY's +CONFIG node, which is also available in the telnet VTY. Apart from that, the +telnet VTY features various interactive commands to query and instruct a +running Osmocom program. A main difference is that during config file parsing, +consistent indenting of parent vs. child nodes is required, while the +interactive VTY ignores indenting and relies on the 'exit' command to return to +a parent node. + +NOTE: In the 'CONFIG' node, it is not well documented which commands take +immediate effect without requiring a program restart. To save your current +config with changes you may have made, you may use the `write file` command to +*overwrite* your config file with the current configuration, after which you +should be able to restart the program with all changes taking effect. This chapter explains the most common nodes nodes and the commands that are available within the node. @@ -47,7 +62,7 @@ |`<0-10>`|`5`|A number from a range |=============== -=== Accessing the VTY +=== Accessing the telnet VTY The VTY of a given Osmocom program is implemented as a telnet server, listening to a specific TCP port. For `osmo-nitb`, this port is `4242`. -- To view, visit https://gerrit.osmocom.org/4346 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I882346c69f12c67d0e41d563c99d4de4efd8b8f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:51:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 10:51:12 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: common/vty: "programs should not use the telnet VTY" In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: common/vty: "programs should not use the telnet VTY" ...................................................................... common/vty: "programs should not use the telnet VTY" Change-Id: Ic7e8c3663a2bfaf8dcb5752bf55ccb822b111c31 --- M common/chapters/vty.adoc 1 file changed, 9 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index 17150b6..995fd2f 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -1,9 +1,17 @@ [[vty]] == The Osmocom VTY Interface -All interaction with Osmocom software is typically performed via an +All human interaction with Osmocom software is typically performed via an interactive command-line interface called the _VTY_. +NOTE: Integration of your programs and scripts should *not* be done via the +telnet VTY interface, which is intended for human interaction only: the VTY +responses may arbitrarily change in ways obvious to humans, while your scripts' +parsing will likely break often. For external software to interact with Osmocom +programs (besides using the dedicated protocols), it is strongly recommended to +use the Control interface instead of the VTY, and to actively request / +implement the Control interface commands as required for your use case. + The Osmocom VTY is used to * explore the current status of the system, including its configuration -- To view, visit https://gerrit.osmocom.org/4345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic7e8c3663a2bfaf8dcb5752bf55ccb822b111c31 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:51:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 10:51:13 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: common/vty: fix: CONFIG entered from ENABLE, not VIEW node In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: common/vty: fix: CONFIG entered from ENABLE, not VIEW node ...................................................................... common/vty: fix: CONFIG entered from ENABLE, not VIEW node Change-Id: I892081f9452f8923441913f978a3be542a3c53d0 --- M common/chapters/vty.adoc 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index d84d5cf..17150b6 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -83,7 +83,7 @@ CONFIG:: The 'CONFIG' node is entered when you enter the `configure terminal` - command from the 'VIEW' node. The config node is used to change the + command from the 'ENABLE' node. The config node is used to change the run-time configuration parameters of teh system. The prompt will indicate that you are in the config node by a `(config)#` prompt suffix. -- To view, visit https://gerrit.osmocom.org/4344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I892081f9452f8923441913f978a3be542a3c53d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:51:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Oct 2017 10:51:23 +0000 Subject: [MERGED] libosmocore[master]: vty: Fix bad use of vector_slot() In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: vty: Fix bad use of vector_slot() ...................................................................... vty: Fix bad use of vector_slot() Fixes the compilation warning below: git/libosmocore/src/vty/command.c: In function ?cmd_complete_command_real?: git/libosmocore/src/vty/command.c:1953:33: warning: comparison between pointer and zero character const ant [-Wpointer-compare] if (vector_slot(vline, index) == '\0') ^~ git/libosmocore/src/vty/command.c:37:0: git/libosmocore/include/osmocom/vty/vector.h:39:27: note: did you mean to dereference the pointer? #define vector_slot(V,I) ((V)->index[(I)]) ^ git/libosmocore/src/vty/command.c:1953:7: note: in expansion of macro ?vector_slot? if (vector_slot(vline, index) == '\0') ^~~~~~~~~~~ Change-Id: Iaba9e3450d68c51e16a7bda2fc0fc370992ca866 --- M src/vty/command.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/command.c b/src/vty/command.c index 21b26b4..355fb5d 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -1950,7 +1950,7 @@ /* In case of 'command \t' pattern. Do you need '?' command at the end of the line. */ - if (vector_slot(vline, index) == '\0') + if (*(char *)vector_slot(vline, index) == '\0') *status = CMD_ERR_NOTHING_TODO; else *status = CMD_ERR_NO_MATCH; -- To view, visit https://gerrit.osmocom.org/4389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaba9e3450d68c51e16a7bda2fc0fc370992ca866 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:52:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Oct 2017 10:52:45 +0000 Subject: [ABANDON] openbsc[master]: libbsc: Fix trailing whitespace In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: libbsc: Fix trailing whitespace ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4363 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I9c4a6ffbf34f861ae10a09b6320ececd7c9bc7b4 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:52:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Oct 2017 10:52:49 +0000 Subject: [ABANDON] openbsc[master]: libbsc: Use abis_nm_admin_name API In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: libbsc: Use abis_nm_admin_name API ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4362 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I2dccebef2f7fc745b845a49d723f5d89fc2baa41 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:52:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Oct 2017 10:52:57 +0000 Subject: [ABANDON] osmo-bsc[master]: libbsc: Fix trailing whitespace In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: libbsc: Fix trailing whitespace ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4360 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I7bfc07d2050bd9e5cac149ae097c0daf3421548a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:53:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Oct 2017 10:53:00 +0000 Subject: [ABANDON] osmo-bsc[master]: libbsc: Use abis_nm_admin_name API In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: libbsc: Use abis_nm_admin_name API ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I2dccebef2f7fc745b845a49d723f5d89fc2baa41 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:54:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 10:54:04 +0000 Subject: libosmocore[master]: add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 10:54:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 10:54:07 +0000 Subject: [MERGED] libosmocore[master]: add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() ...................................................................... add osmo_talloc_asprintf() and ctrl_cmd_reply_printf() Add macro to append to a CTRL commands' reply string, ctrl_cmd_reply_printf(). The talloc_asprintf() part of it is generic enough to qualify for a separate macro, osmo_talloc_asprintf(). The idea is to not have to decide for each bit added to a string whether the string is already allocated or not, but simply be able to issue printf commands and let the macro worry about initial allocation or reallocation. This originally came from osmo-hlr change I1bd62ae0d4eefde7e1517db15a2155640a1bab58, where it was requested to move this bit to libosmocore. Change-Id: Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 --- M include/osmocom/core/utils.h M include/osmocom/ctrl/control_cmd.h 2 files changed, 21 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 5f41213..4b083f6 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -85,6 +85,24 @@ *dst = talloc_strdup(ctx, newstr); } +/*! Append to a string and re-/allocate if necessary. + * \param[in] ctx Talloc context to use for initial allocation. + * \param[in,out] dest char* to re-/allocate and append to. + * \param[in] fmt printf-like string format. + * \param[in] args Arguments for fmt. + * + * \a dest may be passed in NULL, or a string previously allocated by talloc. + * If an existing string is passed in, it will remain associated with whichever + * ctx it was allocated before, regardless whether it matches \a ctx or not. + */ +#define osmo_talloc_asprintf(ctx, dest, fmt, args ...) \ + do { \ + if (!dest) \ + dest = talloc_asprintf(ctx, fmt, ## args); \ + else \ + dest = talloc_asprintf_append((char*)dest, fmt, ## args); \ + } while (0) + int osmo_constant_time_cmp(const uint8_t *exp, const uint8_t *rel, const int count); uint64_t osmo_decode_big_endian(const uint8_t *data, size_t data_len); uint8_t *osmo_encode_big_endian(uint64_t value, size_t data_len); diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h index 77532e6..4372e25 100644 --- a/include/osmocom/ctrl/control_cmd.h +++ b/include/osmocom/ctrl/control_cmd.h @@ -66,6 +66,9 @@ char *reply; }; +#define ctrl_cmd_reply_printf(cmd, fmt, args ...) \ + osmo_talloc_asprintf(cmd, cmd->reply, fmt, ## args) + struct ctrl_cmd_struct { int nr_commands; char **command; -- To view, visit https://gerrit.osmocom.org/4340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 11:38:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 11:38:29 +0000 Subject: [MERGED] osmo-pcu[master]: gb: allow only packets from a specific SGSN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gb: allow only packets from a specific SGSN ...................................................................... gb: allow only packets from a specific SGSN Each PCU has a specifically assigned SGSN, which may send packets to the PCU. Ensure that no one else except the configured SGSN can send packets to the PCU. Change-Id: Ic2009039fab7cf0fba916556239747ae5b410366 Depends: libosmocore Ifeb201d9006eec275a46708007ff342cdfc14e45 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index 9c78ecf..7b78e2f 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -896,6 +896,8 @@ return NULL; } gprs_ns_vty_init(bssgp_nsi); + bssgp_nsi->nsip.remote_port = sgsn_port; + bssgp_nsi->nsip.remote_ip = sgsn_ip; bssgp_nsi->nsip.local_port = local_port; rc = gprs_ns_nsip_listen(bssgp_nsi); if (rc < 0) { -- To view, visit https://gerrit.osmocom.org/4319 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic2009039fab7cf0fba916556239747ae5b410366 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 24 13:26:36 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 24 Oct 2017 13:26:36 +0000 Subject: [ABANDON] osmo-mgw[master]: mgcp: move port/timeslot calculator to mgcp_common.h In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: mgcp: move port/timeslot calculator to mgcp_common.h ...................................................................... Abandoned We agreed on dropping this functionality. The functions for calculating the connection data will be removed from the new osmo-mgw. -- To view, visit https://gerrit.osmocom.org/4237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I8a553e863701d3bafa7b8dc17a503455c303546e Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Oct 24 13:50:36 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 24 Oct 2017 13:50:36 +0000 Subject: [PATCH] osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4147 to look at the new patch set (#13). client: add ip address parsing to the client Some MGCP messages (CRCX, MDCX) return IP-Addresses. Make use of this information. Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.ok 4 files changed, 42 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/47/4147/13 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 21717e3..e91b190 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -36,6 +36,7 @@ char *body; struct mgcp_response_head head; uint16_t audio_port; + char audio_ip[INET_ADDRSTRLEN]; }; enum mgcp_verb { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index c7cc989..f8c55ac 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -174,7 +174,7 @@ } /* Parse a line like "m=audio 16002 RTP/AVP 98" */ -static int mgcp_parse_audio(struct mgcp_response *r, const char *line) +static int mgcp_parse_audio_port(struct mgcp_response *r, const char *line) { if (sscanf(line, "m=audio %hu", &r->audio_port) != 1) @@ -184,7 +184,35 @@ response_parse_failure: LOGP(DLMGCP, LOGL_ERROR, - "Failed to parse MGCP response header\n"); + "Failed to parse MGCP response header (audio port)\n"); + return -EINVAL; +} + +/* Parse a line like "c=IN IP4 10.11.12.13" */ +static int mgcp_parse_audio_ip(struct mgcp_response *r, const char *line) +{ + struct in_addr ip_test; + + if (strlen(line) < 16) + goto response_parse_failure; + + /* The current implementation strictly supports IPV4 only ! */ + if (memcmp("c=IN IP4 ", line, 9) != 0) + goto response_parse_failure; + + /* Extract IP-Address */ + strncpy(r->audio_ip, line + 9, sizeof(r->audio_ip)); + r->audio_ip[sizeof(r->audio_ip) - 1] = '\0'; + + /* Check IP-Address */ + if (inet_aton(r->audio_ip, &ip_test) == 0) + goto response_parse_failure; + + return 0; + +response_parse_failure: + LOGP(DLMGCP, LOGL_ERROR, + "Failed to parse MGCP response header (audio ip)\n"); return -EINVAL; } @@ -213,7 +241,12 @@ switch (line[0]) { case 'm': - rc = mgcp_parse_audio(r, line); + rc = mgcp_parse_audio_port(r, line); + if (rc) + return rc; + break; + case 'c': + rc = mgcp_parse_audio_ip(r, line); if (rc) return rc; break; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 1420959..e99aa37 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -99,11 +99,13 @@ " head.response_code = %d\n" " head.trans_id = %u\n" " head.comment = %s\n" - " audio_port = %u\n", + " audio_port = %u\n" + " audio_ip = %s\n", response->head.response_code, response->head.trans_id, response->head.comment, - response->audio_port + response->audio_port, + response->audio_ip ); } diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index e3b6113..d4efee4 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,6 +28,7 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + audio_ip = 10.9.1.120 Generated CRCX message: CRCX 1 23 at mgw MGCP 1.0 -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 13 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 13:50:36 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 24 Oct 2017 13:50:36 +0000 Subject: [PATCH] osmo-mgw[master]: sdp: refactoring sdp parser/generator In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4006 to look at the new patch set (#14). sdp: refactoring sdp parser/generator move SDP generator function write_response_sdp() from mgcp_protocol.c to mgcp_sdp.c and use msgb_printf() instead of snprintf() move prototypes for mgcp_parse_sdp_data() and mgcp_set_audio_info() to mgcp_sdp.h change parameter list of mgcp_parse_sdp_data() so that it takes the rtp conn directly, rather than struct mgcp_rtp_end. add doxygen comments to all public functions Change-Id: I9f88c93872ff913bc211f560b26901267f577324 --- M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_sdp.h M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c 5 files changed, 165 insertions(+), 100 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/06/4006/14 diff --git a/include/osmocom/mgcp/Makefile.am b/include/osmocom/mgcp/Makefile.am index 646b887..cd8f599 100644 --- a/include/osmocom/mgcp/Makefile.am +++ b/include/osmocom/mgcp/Makefile.am @@ -4,4 +4,5 @@ mgcp_conn.h \ mgcp_stat.h \ mgcp_ep.h \ + mgcp_sdp.h \ $(NULL) diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 751aba5..d4c8dc9 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -317,9 +317,6 @@ #define DEFAULT_RTP_AUDIO_DEFAULT_CHANNELS 1 #define PTYPE_UNDEFINED (-1) -int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_rtp_end *rtp, struct mgcp_parse_data *p); -int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, - int payload_type, const char *audio_name); /*! get the ip-address where the mgw application is bound on. * \param[in] endp mgcp endpoint, that holds a copy of the VTY parameters diff --git a/include/osmocom/mgcp/mgcp_sdp.h b/include/osmocom/mgcp/mgcp_sdp.h new file mode 100644 index 0000000..da23cba --- /dev/null +++ b/include/osmocom/mgcp/mgcp_sdp.h @@ -0,0 +1,35 @@ +/* + * SDP generation and parsing + * + * (C) 2009-2015 by Holger Hans Peter Freyther + * (C) 2009-2014 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once +#include + +int mgcp_parse_sdp_data(const struct mgcp_endpoint *endp, + struct mgcp_conn_rtp *conn, + struct mgcp_parse_data *p); + +int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, + int payload_type, const char *audio_name); + +int mgcp_write_response_sdp(const struct mgcp_endpoint *endp, + const struct mgcp_conn_rtp *conn, struct msgb *sdp, + const char *addr); diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index c00cdc6..6c611f7 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -39,6 +39,7 @@ #include #include #include +#include struct mgcp_request { char *name; @@ -191,80 +192,6 @@ return create_resp(endp, code, " FAIL", msg, trans, NULL, NULL); } -static int write_response_sdp(struct mgcp_endpoint *endp, - struct mgcp_conn_rtp *conn, - char *sdp_record, size_t size, const char *addr) -{ - const char *fmtp_extra; - const char *audio_name; - int payload_type; - int len; - int nchars; - - if (!conn) - return -1; - - endp->cfg->get_net_downlink_format_cb(endp, &payload_type, - &audio_name, &fmtp_extra, conn); - - len = snprintf(sdp_record, size, - "v=0\r\n" - "o=- %u 23 IN IP4 %s\r\n" - "s=-\r\n" - "c=IN IP4 %s\r\n" - "t=0 0\r\n", conn->conn->id, addr, addr); - - if (len < 0 || len >= size) - goto buffer_too_small; - - if (payload_type >= 0) { - nchars = snprintf(sdp_record + len, size - len, - "m=audio %d RTP/AVP %d\r\n", - conn->end.local_port, payload_type); - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - - if (audio_name && endp->tcfg->audio_send_name) { - nchars = snprintf(sdp_record + len, size - len, - "a=rtpmap:%d %s\r\n", - payload_type, audio_name); - - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - - if (fmtp_extra) { - nchars = snprintf(sdp_record + len, size - len, - "%s\r\n", fmtp_extra); - - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - } - if (conn->end.packet_duration_ms > 0 && endp->tcfg->audio_send_ptime) { - nchars = snprintf(sdp_record + len, size - len, - "a=ptime:%u\r\n", - conn->end.packet_duration_ms); - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - - return len; - -buffer_too_small: - LOGP(DLMGCP, LOGL_ERROR, "SDP buffer too small: %zu (needed %d)\n", - size, len); - return -1; -} - /* Format MGCP response string (with SDP attached) */ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, @@ -272,10 +199,14 @@ const char *trans_id) { const char *addr = endp->cfg->local_ip; - char sdp_record[4096]; - int len; - int nchars; + struct msgb *sdp; + int rc; + struct msgb *result; char osmux_extension[strlen("\nX-Osmux: 255") + 1]; + + sdp = msgb_alloc_headroom(4096, 128, "sdp record"); + if (!sdp) + return NULL; if (!addr) addr = mgcp_net_src_addr(endp); @@ -287,21 +218,19 @@ osmux_extension[0] = '\0'; } - len = snprintf(sdp_record, sizeof(sdp_record), - "I: %u%s\n\n", conn->conn->id, osmux_extension); - if (len < 0) - return NULL; + rc = msgb_printf(sdp, "I: %u%s\n\n", conn->conn->id, osmux_extension); + if (rc < 0) + goto error; - nchars = write_response_sdp(endp, conn, sdp_record + len, - sizeof(sdp_record) - len - 1, addr); - if (nchars < 0) - return NULL; - - len += nchars; - - sdp_record[sizeof(sdp_record) - 1] = '\0'; - - return create_resp(endp, 200, " OK", msg, trans_id, NULL, sdp_record); + rc = mgcp_write_response_sdp(endp, conn, sdp, addr); + if (rc < 0) + goto error; + result = create_resp(endp, 200, " OK", msg, trans_id, NULL, (char*) sdp->data); + msgb_free(sdp); + return result; +error: + msgb_free(sdp); + return NULL; } /* Send out dummy packet to keep the connection open, if the connection is an @@ -689,7 +618,7 @@ /* set up RTP media parameters */ if (have_sdp) - mgcp_parse_sdp_data(endp, &conn->end, p); + mgcp_parse_sdp_data(endp, conn, p); else if (endp->local_options.codec) mgcp_set_audio_info(p->cfg, &conn->end.codec, PTYPE_UNDEFINED, endp->local_options.codec); @@ -836,7 +765,7 @@ conn->conn->mode = conn->conn->mode_orig; if (have_sdp) - mgcp_parse_sdp_data(endp, &conn->end, p); + mgcp_parse_sdp_data(endp, conn, p); set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, local_options); diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index 7568351..c57dde6 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -20,6 +20,7 @@ * */ +#include #include #include #include @@ -38,6 +39,12 @@ int channels; }; +/*! Set codec configuration depending on payload type and codec name. + * \param[in] ctx talloc context. + * \param[out] codec configuration (caller provided memory). + * \param[in] payload_type codec type id (e.g. 3 for GSM, -1 when undefined). + * \param[in] audio_name audio codec name (e.g. "GSM/8000/1"). + * \returns 0 on success, -1 on failure. */ int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, int payload_type, const char *audio_name) { @@ -107,7 +114,7 @@ return 0; } -void codecs_initialize(void *ctx, struct sdp_rtp_map *codecs, int used) +static void codecs_initialize(void *ctx, struct sdp_rtp_map *codecs, int used) { int i; @@ -137,7 +144,8 @@ } } -void codecs_update(void *ctx, struct sdp_rtp_map *codecs, int used, int payload, char *audio_name) +static void codecs_update(void *ctx, struct sdp_rtp_map *codecs, int used, + int payload, const char *audio_name) { int i; @@ -163,7 +171,9 @@ LOGP(DLMGCP, LOGL_ERROR, "Unconfigured PT(%d) with %s\n", payload, audio_name); } -int is_codec_compatible(struct mgcp_endpoint *endp, struct sdp_rtp_map *codec) +/* Check if the codec matches what is set up in the trunk config */ +static int is_codec_compatible(const struct mgcp_endpoint *endp, + const struct sdp_rtp_map *codec) { char *bts_codec; char audio_codec[64]; @@ -182,7 +192,14 @@ return strcasecmp(audio_codec, codec->codec_name) == 0; } -int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_rtp_end *rtp, struct mgcp_parse_data *p) +/*! Analyze SDP input string. + * \param[in] endp trunk endpoint. + * \param[out] conn associated rtp connection. + * \param[out] caller provided memory to store the parsing results. + * \returns 0 on success, -1 on failure. */ +int mgcp_parse_sdp_data(const struct mgcp_endpoint *endp, + struct mgcp_conn_rtp *conn, + struct mgcp_parse_data *p) { struct sdp_rtp_map codecs[10]; int codecs_used = 0; @@ -191,7 +208,13 @@ int i; int codecs_assigned = 0; void *tmp_ctx = talloc_new(NULL); + struct mgcp_rtp_end *rtp; + OSMO_ASSERT(endp); + OSMO_ASSERT(conn); + OSMO_ASSERT(p); + + rtp = &conn->end; memset(&codecs, 0, sizeof(codecs)); for_each_line(line, p->save) { @@ -304,3 +327,83 @@ return codecs_assigned > 0; } +/*! Generate SDP response string. + * \param[in] endp trunk endpoint. + * \param[in] conn associated rtp connection. + * \param[out] sdp msg buffer to append resulting SDP string data. + * \param[in] addr IPV4 address string (e.g. 192.168.100.1). + * \returns 0 on success, -1 on failure. */ +int mgcp_write_response_sdp(const struct mgcp_endpoint *endp, + const struct mgcp_conn_rtp *conn, struct msgb *sdp, + const char *addr) +{ + const char *fmtp_extra; + const char *audio_name; + int payload_type; + int len = 0; + int rc; + + OSMO_ASSERT(endp); + OSMO_ASSERT(conn); + OSMO_ASSERT(sdp); + OSMO_ASSERT(addr); + + endp->cfg->get_net_downlink_format_cb((struct mgcp_endpoint *)endp, + &payload_type, &audio_name, + &fmtp_extra, + (struct mgcp_conn_rtp *)conn); + + rc = msgb_printf(sdp, + "v=0\r\n" + "o=- %u 23 IN IP4 %s\r\n" + "s=-\r\n" + "c=IN IP4 %s\r\n" + "t=0 0\r\n", conn->conn->id, addr, addr); + + if (rc < 0) + goto buffer_too_small; + + len += rc; + + if (payload_type >= 0) { + rc = msgb_printf(sdp, "m=audio %d RTP/AVP %d\r\n", + conn->end.local_port, payload_type); + if (rc < 0) + goto buffer_too_small; + + len += rc; + + if (audio_name && endp->tcfg->audio_send_name) { + rc = msgb_printf(sdp, "a=rtpmap:%d %s\r\n", + payload_type, audio_name); + + if (rc < 0) + goto buffer_too_small; + + len += rc; + } + + if (fmtp_extra) { + rc = msgb_printf(sdp, "%s\r\n", fmtp_extra); + + if (rc < 0) + goto buffer_too_small; + + len += rc; + } + } + if (conn->end.packet_duration_ms > 0 && endp->tcfg->audio_send_ptime) { + rc = msgb_printf(sdp, "a=ptime:%u\r\n", + conn->end.packet_duration_ms); + if (rc < 0) + goto buffer_too_small; + + len += rc; + } + + return len; + +buffer_too_small: + LOGP(DLMGCP, LOGL_ERROR, "SDP messagebuffer too small\n"); + return -1; +} -- To view, visit https://gerrit.osmocom.org/4006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324 Gerrit-PatchSet: 14 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Oct 24 13:50:37 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 24 Oct 2017 13:50:37 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: remove port/timeslot calculator functions from mgcp.h Message-ID: Review at https://gerrit.osmocom.org/4391 mgcp: remove port/timeslot calculator functions from mgcp.h the functions rtp_calculate_port(), mgcp_timeslot_to_endpoint(), mgcp_endpoint_to_timeslot() were a hack to map CIC addresses to endpoints and ports. This is no longer needed. Remove the affected functions. Change-Id: I9ef14396dc9f97e570d9bcfb4d9b4a94e650ad46 --- M include/osmocom/mgcp/mgcp.h 1 file changed, 0 insertions(+), 41 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/91/4391/1 diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 7307f3c..83505a2 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -37,31 +37,6 @@ #define RTP_PORT_DEFAULT_RANGE_START 16002 #define RTP_PORT_DEFAULT_RANGE_END RTP_PORT_DEFAULT_RANGE_START + 64 -/** - * Calculate the RTP audio port for the given multiplex - * and the direction. This allows a semi static endpoint - * to port calculation removing the need for the BSC - * and the MediaGateway to communicate. - * - * Port usage explained: - * base + (multiplex * 2) + 0 == local port to wait for network packets - * base + (multiplex * 2) + 1 == local port for rtcp - * - * The above port will receive packets from the BTS that need - * to be patched and forwarded to the network. - * The above port will receive packets from the network that - * need to be patched and forwarded to the BTS. - * - * We assume to have a static BTS IP address so we can differentiate - * network and BTS. - * - */ -static inline int rtp_calculate_port(int multiplex, int base) -{ - return base + (multiplex * 2); -} - - /* * Handling of MGCP Endpoints and the MGCP Config */ @@ -236,22 +211,6 @@ */ struct msgb *mgcp_handle_message(struct mgcp_config *cfg, struct msgb *msg); -/* adc helper */ -static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot) -{ - if (timeslot == 0) { - LOGP(DLMGCP, LOGL_ERROR, "Timeslot should not be 0\n"); - timeslot = 255; - } - - return timeslot + (32 * multiplex); -} - -static inline void mgcp_endpoint_to_timeslot(int endpoint, int *multiplex, int *timeslot) -{ - *multiplex = endpoint / 32; - *timeslot = endpoint % 32; -} int mgcp_send_reset_ep(struct mgcp_endpoint *endp, int endpoint); int mgcp_send_reset_all(struct mgcp_config *cfg); -- To view, visit https://gerrit.osmocom.org/4391 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9ef14396dc9f97e570d9bcfb4d9b4a94e650ad46 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Oct 24 13:51:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 13:51:34 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: refactor Makefile build rules, don't use the FORCE In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3985 to look at the new patch set (#7). refactor Makefile build rules, don't use the FORCE The initial goal was to make sure we don't have overall FORCE rules causing unnecessary rebuilds -- annoying while writing documentation. As I looked through possible dependencies, I finally understood what's going on here. Remove code dup and nicely sort which belongs where in build/Makefile.*.inc. In each, describe in a top comment how to use it, and also unify how they are used: - Rename Makefile.inc to Makefile.docbook.inc and refactor - Add Makefile.vty-reference.inc - Add Makefile.common.inc Make sure that we accurately pick up all dependencies. Drop use of the macro called 'command', that silenced the actual command lines invoked and replaced them with short strings: it obscures what is actually going on and makes the Makefiles hard to read and understand. Each manual's makefile is greatly reduced to few definitions and a Makefile include, e.g. one for asciidoc, one for VTY reference. Move common/bsc_vty_additions.xml to OsmoBSC/vty/libbsc_vty_additions.xml, link from OsmoNITB. It applies only to OsmoBSC and OsmoNITB. Add a script that combines a VTY reference file with *all* additions files found in a manual's vty/ dir. Call this from Makefile.vty-reference.inc. Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 --- M OsmoBSC/Makefile R OsmoBSC/vty/libbsc_vty_additions.xml M OsmoBTS/Makefile M OsmoGGSN/Makefile M OsmoGSMTester/Makefile M OsmoHLR/Makefile M OsmoMGCP/Makefile M OsmoMSC/Makefile M OsmoNAT/Makefile M OsmoNITB/Makefile A OsmoNITB/vty/bsc_vty_additions.xml M OsmoPCU/Makefile M OsmoSGSN/Makefile M build/Makefile.asciidoc.inc A build/Makefile.common.inc A build/Makefile.docbook.inc D build/Makefile.inc A build/Makefile.vty-reference.inc A build/vty_reference_combine.sh 19 files changed, 206 insertions(+), 443 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/85/3985/7 diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index 35f50da..1533482 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -1,54 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. - -EXTRA_DEPS = gen-bsc-vty-docbook - -topdir = . -bsc_reference = $(topdir)/osmobsc-vty-reference.xml -manuals = $(bsc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobsc-usermanual osmux-reference aoip-mgw-options - +ASCIIDOC = osmobsc-usermanual.adoc osmux-reference.adoc aoip-mgw-options.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmobsc-usermanual.pdf: chapters/*.adoc -osmux-reference.pdf: osmux-reference.adoc -aoip-mgw-options.pdf: aoip-mgw-options.adoc +aoip-mgw-options.pdf: aoip-mgw-options.adoc mgw/*.msc -clean: - -rm -rf $(cleanfiles) - -rm osmobsc-usermanual__*.png - -rm osmobsc-usermanual__*.svg - -rm osmobsc-usermanual*.check - -rm osmux-reference*.check - -rm aoip-mgw-options*.png - -rm aoip-mgw-options*.svg - -rm aoip-mgw-options*.check - -rm osmux-reference__*.svg - -rm osmux-reference__*.png - -rm osmux-reference__*.check +VTY_REFERENCE = osmobsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bsc-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bsc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/common/bsc_vty_additions.xml b/OsmoBSC/vty/libbsc_vty_additions.xml similarity index 100% rename from common/bsc_vty_additions.xml rename to OsmoBSC/vty/libbsc_vty_additions.xml diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 58df0e3..e1ff214 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -1,50 +1,12 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-bts-vty-docbook - -topdir = . -bts_reference = $(topdir)/osmobts-vty-reference.xml -manuals = $(bts_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobts-usermanual osmobts-abis rtp-amr - +ASCIIDOC = osmobts-usermanual.adoc osmobts-abis.adoc rtp-amr.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - -osmobts-abis.pdf: abis/*.adoc abis/*.msc osmobts-usermanual.pdf: chapters/*.adoc +osmobts-abis.pdf: abis/*.adoc abis/*.msc +rtp-amr.pdf: dtx.dot -clean: - -rm -rf $(cleanfiles) - -rm osmobts-abis__*.png - -rm osmobts-abis__*.svg - -rm rtp-amr__*.png - -rm rtp-amr__*.svg - -rm osmobts-usermanual__*.png - -rm osmobts-usermanual__*.svg - -rm osmobts-abis*.check - -rm osmobts-usermanual*.check +VTY_REFERENCE = osmobts-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bts-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bts_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bts_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BTS VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BTS VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile index 2dfedb2..e809632 100644 --- a/OsmoGGSN/Makefile +++ b/OsmoGGSN/Makefile @@ -1,39 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-ggsn-vty-docbook - -topdir = . -ggsn_reference = $(topdir)/osmoggsn-vty-reference.xml -manuals = $(ggsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmoggsn-usermanual - +ASCIIDOC = osmoggsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmoggsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmoggsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmoggsn-usermanual__*.svg osmoggsn-usermanual__*.png - -rm osmoggsn-usermanual.check - -gen-ggsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/ggsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/ggsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging GGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting GGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGSMTester/Makefile b/OsmoGSMTester/Makefile index 79d414f..43c5a37 100644 --- a/OsmoGSMTester/Makefile +++ b/OsmoGSMTester/Makefile @@ -1,12 +1,7 @@ -TOPDIR := .. -ASCIIDOCS := osmo-gsm-tester-manual +TOPDIR = .. +ASCIIDOC = osmo-gsm-tester-manual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmo-gsm-tester-manual.pdf: chapters/*.adoc - -clean: - -rm -rf $(cleanfiles) - -rm osmo-gsm-tester-manual__*.svg - -rm osmo-gsm-tester-manual__*.png +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile index eba5fa3..a9dc393 100644 --- a/OsmoHLR/Makefile +++ b/OsmoHLR/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -hlr_reference = $(topdir)/osmohlr-vty-reference.xml -manuals = $(hlr_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmohlr-usermanual - +ASCIIDOC = osmohlr-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc *.vty *.ctrl include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmohlr-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmohlr-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmohlr-usermanual__*.svg - -rm osmohlr-usermanual__*.png - -rm osmohlr-usermanual.check - -generated/docbook_vty.xml: osmohlr-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/hlr_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/hlr_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging HLR VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting HLR VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMGCP/Makefile b/OsmoMGCP/Makefile index 9aff12b..e2a5e37 100644 --- a/OsmoMGCP/Makefile +++ b/OsmoMGCP/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-mgcp-vty-docbook +VTY_REFERENCE = osmomgcp-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -mgcp_reference = $(topdir)/osmomgcp-vty-reference.xml -manuals = $(mgcp_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-mgcp-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/mgcp_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/mgcp_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging MGCP VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MGCP VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile index febf7d1..c9edcef 100644 --- a/OsmoMSC/Makefile +++ b/OsmoMSC/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -msc_reference = $(topdir)/osmomsc-vty-reference.xml -manuals = $(msc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmomsc-usermanual - +ASCIIDOC = osmomsc-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmomsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmomsc-usermanual__*.svg - -rm osmomsc-usermanual__*.png - -rm osmomsc-usermanual.check - -generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/msc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/msc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging MSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNAT/Makefile b/OsmoNAT/Makefile index d7302e6..fde7132 100644 --- a/OsmoNAT/Makefile +++ b/OsmoNAT/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nat-vty-docbook +VTY_REFERENCE = osmonat-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -nat_reference = $(topdir)/osmonat-vty-reference.xml -manuals = $(nat_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-nat-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nat_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/nat_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging NAT VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NAT VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/Makefile b/OsmoNITB/Makefile index 99cd317..0cd260d 100644 --- a/OsmoNITB/Makefile +++ b/OsmoNITB/Makefile @@ -1,44 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nitb-vty-docbook - -topdir = . -nitb_reference = $(topdir)/osmonitb-vty-reference.xml -manuals = $(nitb_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmonitb-usermanual - +ASCIIDOC = osmonitb-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmonitb-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmonitb-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmonitb-usermanual__*.svg - -rm osmonitb-usermanual__*.png - -rm osmonitb-usermanual.check - -gen-nitb-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nitb_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/nitb_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging NITB VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NITB VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/vty/bsc_vty_additions.xml b/OsmoNITB/vty/bsc_vty_additions.xml new file mode 120000 index 0000000..5def5f1 --- /dev/null +++ b/OsmoNITB/vty/bsc_vty_additions.xml @@ -0,0 +1 @@ +../../OsmoBSC/vty/bsc_vty_additions.xml \ No newline at end of file diff --git a/OsmoPCU/Makefile b/OsmoPCU/Makefile index a83b909..7a1acc0 100644 --- a/OsmoPCU/Makefile +++ b/OsmoPCU/Makefile @@ -1,45 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-vty-docbook - -topdir = . -pcu_reference = $(topdir)/osmopcu-vty-reference.xml -manuals = $(bts_manual) $(pcu_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmopcu-usermanual osmopcu-gb - +ASCIIDOC = osmopcu-usermanual.adoc osmopcu-gb.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmopcu-gb.pdf: gb/*.adoc gb/*.msc osmopcu-usermanual.pdf: chapters/*.adoc -clean: - -rm -rf $(cleanfiles) - -rm -rf gen-vty-docbook - -rm osmopcu-usermanual__*.png - -rm osmopcu-usermanual__*.svg - -rm osmopcu-usermanual.check +VTY_REFERENCE = osmopcu-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/osmo-pcu_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/osmo-pcu_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging PCU VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting PCU VTY to DocBook) - - - +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoSGSN/Makefile b/OsmoSGSN/Makefile index 6f7d28d..baa1a49 100644 --- a/OsmoSGSN/Makefile +++ b/OsmoSGSN/Makefile @@ -1,43 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-sgsn-vty-docbook - -topdir = . -sgsn_reference = $(topdir)/osmosgsn-vty-reference.xml -manuals = $(sgsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmosgsn-usermanual - +ASCIIDOC = osmosgsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmosgsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmosgsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmosgsn-usermanual__*.svg osmosgsn-usermanual__*.png - -rm osmosgsn-usermanual.check - -gen-sgsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/sgsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/sgsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging SGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting SGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index e088624..a28a5bb 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -1,19 +1,38 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'ASCIIDOC' all root .adoc files, +# - optionally define in 'ASCIIDOC_DEPS' all dependencies common to all .adocs, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# ASCIIDOC = osmo_yada.adoc osmo_moo.adoc +# ASCIIDOC_DEPS = for_all/*.adoc +# include $(TOPDIR)/build/Makefile.asciidoc.inc +# osmo_yada.pdf: yada/*.adoc yada/*.msc + BUILDDIR = $(TOPDIR)/build GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags) GIT_DATE := $(shell $(TOPDIR)/build/unix-time-to-fmt.py `git log -n 1 "--pretty=%at" ../.`) # prepend the document name with the version numbe suffix -#DOCS_VER = $(foreach P, $(ASCIIDOCS), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) +#DOCS_VER = $(foreach P, $(ASCIIDOC_NAME), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) #PDFS = $(DOCS_VER:%=%.pdf) # generate list of PDFs that we're supposed to render -ASCIIDOCPDFS = $(ASCIIDOCS:%=%.pdf) -ASCIIDOC_CHECKS = $(ASCIIDOCS:%=%.check) +ASCIIDOC_NAME = $(patsubst %.adoc,%,$(ASCIIDOC)) +ASCIIDOC_PDF = $(ASCIIDOC_NAME:%=%.pdf) +ASCIIDOC_CHECKS = $(ASCIIDOC_NAME:%=%.check) ASCIIDOCSTYLE ?= $(BUILDDIR)/custom-dblatex.sty -cleanfiles += $(ASCIIDOCPDFS) +CLEAN_FILES += $(ASCIIDOC_NAME:%=%__*.png) $(ASCIIDOC_NAME:%=%__*.svg) $(ASCIIDOC_CHECKS) +CLEAN_FILES += $(ASCIIDOC_PDF) +UPLOAD_FILES += $(ASCIIDOC_PDF) ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -f $(BUILDDIR)/python2-filter.conf DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0 @@ -27,9 +46,13 @@ A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" --dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(REVNUMBER)" -a revdate="$(GIT_DATE)" -all: $(ASCIIDOCPDFS) +all: $(ASCIIDOC_PDF) -$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc +$(ASCIIDOC_PDF): %.pdf: %.adoc %-docinfo.xml \ + $(ASCIIDOC_DEPS) \ + $(ASCIIDOCSTYLE) \ + $(TOPDIR)/common/*/*.adoc \ + $(TOPDIR)/common/images/* @test -n "$(BUILD_RELEASE)" && echo -e "\n\n\ NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\ and remove three lines starting with '% \"DRAFT\" on first page'\n" \ diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc new file mode 100644 index 0000000..e624b5f --- /dev/null +++ b/build/Makefile.common.inc @@ -0,0 +1,14 @@ +# Usage: +# +# Other makefiles like Makefile.asciidoc.inc and Makefile.vty-reference.inc add +# entries to UPLOAD_FILES and CLEAN_FILES. +# +# Include this file at the end to have 'upload' and 'clean' targets. + +UPLOAD_PATH ?= generic at sysmocom-downloads:documents + +upload: $(UPLOAD_FILES) + rsync -avz $(UPLOAD_FILES) $(UPLOAD_PATH)/ + +clean: + -rm -rf $(CLEAN_FILES) diff --git a/build/Makefile.docbook.inc b/build/Makefile.docbook.inc new file mode 100644 index 0000000..70dfafa --- /dev/null +++ b/build/Makefile.docbook.inc @@ -0,0 +1,35 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'DOCBOOKS' all root .xml files, +# - optionally define in 'DOCBOOKS_DEPS' all dependencies common to all .xmls, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# DOCBOOKS = osmo_yada.xml osmo_moo.xml +# ASCIIDOC_DEPS = for_all/*.xml +# include $(TOPDIR)/build/Makefile.docbook.inc +# osmo_yada.pdf: yada/*.xml +# +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals, edited. + +DOCBOOKS_PDF = $(patsubst %.xml,%.pdf,$(DOCBOOKS)) +lint = $(patsubst %.xml,%.lint,$(DOCBOOKS)) + +CLEAN_FILES += $(DOCBOOKS_PDF) $(lint) +UPLOAD_FILES += $(DOCBOOKS_PDF) + +all: $(DOCBOOKS_PDF) + +# Lint the file +%.xml-lint: %.xml + xmllint --xinclude --postvalid --noout $< + +# Create a PDF file and lint it before +%.pdf: %.xml %.xml-lint $(DOCBOOKS_DEPS) + dblatex $(dblatex_quiet) -P draft.mode=no $< + diff --git a/build/Makefile.inc b/build/Makefile.inc deleted file mode 100644 index 3905cb0..0000000 --- a/build/Makefile.inc +++ /dev/null @@ -1,47 +0,0 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals - -LIBOSMO_DIR ?= ~/source/gsm/libosmocore -MERGE_DOC := $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl -UPLOAD_PATH ?= generic at sysmocom-downloads:documents - -pdfs = $(patsubst %.xml,%.pdf,$(manuals)) -lint = $(patsubst %.xml,%.xml-lint,$(manuals)) - -#cleanfiles = $(foreach i,$(types),$(topdir)/$(i)) -cleanfiles += $(pdfs) $(lint) - -ifdef DEBUG -dblatex_quiet = -define command - $(1) -endef -else -dblatex_quiet = -q -define command - @echo $(2) $(3) - @$(1) -endef -endif - -all: $(types) - - -$(types): FORCE - - -pdf: $(pdfs) $(manuals) - - -# Lint the file -%.xml-lint: %.xml FORCE - $(call command,xmllint --xinclude --postvalid --noout $<,XMLLINT,$<) - -# Create a PDF file and lint it before -%.pdf: %.xml %.xml-lint $(EXTRA_DEPS) FORCE - $(call command,dblatex $(dblatex_quiet) -P draft.mode=no $<,DBLATEX,$<) - -upload: $(pdfs) $(ASCIIDOCPDFS) - rsync -avz $(pdfs) $(ASCIIDOCPDFS) $(UPLOAD_PATH)/ - -FORCE: diff --git a/build/Makefile.vty-reference.inc b/build/Makefile.vty-reference.inc new file mode 100644 index 0000000..baf9cf5 --- /dev/null +++ b/build/Makefile.vty-reference.inc @@ -0,0 +1,42 @@ +# Usage: +# Have files: +# - osmoyada-vty-reference.xml +# A docbook root XML including a &chapter-vty; reference. +# - vty/*additions*.xml +# Manual additions to specific VTY nodes, any number of files. +# - vty/*_reference.xml +# Export from VTY 'show online-help', exactly one file. +# +# In your Makefile, +# - define 'TOPDIR' to point at the git root, +# - define the (single) name of the vty-reference source in VTY_REFERENCE, +# - include this file. +# +# e.g. +# +# TOPDIR = .. +# VTY_REFERENCE = osmofoo-vty-reference +# include $(TOPDIR)/build/Makefile.vty-reference.inc +# +# This uses the Makefile.docbook.inc, you should not mix uses of +# Makefile.vty-reference.inc and Makefile.docbook.inc. + +DOCBOOKS = $(VTY_REFERENCE) +DOCBOOKS_DEPS = generated/docbook_vty.xml +include $(TOPDIR)/build/Makefile.docbook.inc + +LIBOSMO_DIR ?= ~/source/gsm/libosmocore +MERGE_DOC = $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl + +CLEAN_FILES += generated + +generated/docbook_vty.xml: \ + vty/*xml \ + $(TOPDIR)/common/vty_additions.xml \ + $(TOPDIR)/common/chapters/vty.xml \ + $(TOPDIR)/vty_reference.xsl + $(TOPDIR)/build/vty_reference_combine.sh "$(MERGE_DOC)" \ + $(TOPDIR)/common/vty_additions.xml \ + vty/*additions*.xml + xsltproc $(TOPDIR)/vty_reference.xsl generated/combined.xml \ + > generated/docbook_vty.xml diff --git a/build/vty_reference_combine.sh b/build/vty_reference_combine.sh new file mode 100755 index 0000000..be234a7 --- /dev/null +++ b/build/vty_reference_combine.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +# the first argument should point at libosmocore/doc/vty/merge_doc.xsl +MERGE_DOC="$1" +shift + +combined="generated/combined.xml" +combine_src="generated/combine_src.xml" + +reference="vty/*reference.xml" +test "$(ls -1 $reference | wc -l)" = "1" + +set -x +mkdir -p generated +cp $reference "$combined" + +while [ -n "$1" ]; do + addition="$(realpath "$1")" + shift + mv "$combined" "$combine_src" + xsltproc -o "$combined" \ + --stringparam with "$addition" \ + "$MERGE_DOC" "$combine_src" +done -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 7 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 13:51:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 13:51:34 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoHLR: add make target to update the example ctrl and vty ... Message-ID: Review at https://gerrit.osmocom.org/4392 OsmoHLR: add make target to update the example ctrl and vty files Change-Id: I88027396ec15101697a79aa5e964387d47abdae2 --- M OsmoHLR/Makefile 1 file changed, 41 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/92/4392/1 diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile index a9dc393..234a48c 100644 --- a/OsmoHLR/Makefile +++ b/OsmoHLR/Makefile @@ -8,3 +8,44 @@ include $(TOPDIR)/build/Makefile.vty-reference.inc include $(TOPDIR)/build/Makefile.common.inc + +OSMO_HLR_PATH ?= ../../osmo-hlr +TMP_DB = generated/hlr.db + +update-examples: update-examples-ctrl update-examples-vty + +.PHONY: found-update-deps +found-update-deps: + @if [ ! -f "$(OSMO_HLR_PATH)/sql/hlr.sql" ]; then \ + echo "You need to define OSMO_HLR_PATH to point at an osmo-hlr.git"; \ + exit 1; \ + fi + @if [ -z "$(shell which osmo-hlr)" ]; then \ + echo "osmo-hlr needs to be installed / available in the PATH"; \ + exit 1; \ + fi + @if [ -z "$(shell which osmo_verify_transcript_ctrl.py)" ]; then \ + echo "You need to install git.osmocom.org/python/osmo-python-tests.git"; \ + exit 1; \ + fi + @if [ -z "$(shell which osmo_verify_transcript_vty.py)" ]; then \ + echo "You need to install git.osmocom.org/python/osmo-python-tests.git"; \ + exit 1; \ + fi + +update-examples-ctrl: found-update-deps + mkdir -p generated + rm -f "$(TMP_DB)" + sqlite3 "$(TMP_DB)" < "$(OSMO_HLR_PATH)/sql/hlr.sql" + sqlite3 "$(TMP_DB)" < "$(OSMO_HLR_PATH)/tests/test_subscriber.sql" + osmo_verify_transcript_ctrl.py \ + -r "osmo-hlr -l $(TMP_DB) -c /n/s/osmo/src/osmo-hlr/doc/examples/osmo-hlr.cfg" \ + -p 4259 --update *.ctrl + +update-examples-vty: found-update-deps + mkdir -p generated + rm -f "$(TMP_DB)" + sqlite3 "$(TMP_DB)" < "$(OSMO_HLR_PATH)/sql/hlr.sql" + osmo_verify_transcript_vty.py \ + -r "osmo-hlr -l $(TMP_DB) -c /n/s/osmo/src/osmo-hlr/doc/examples/osmo-hlr.cfg" \ + -p 4258 --update *.vty -- To view, visit https://gerrit.osmocom.org/4392 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88027396ec15101697a79aa5e964387d47abdae2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 13:51:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 13:51:35 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoHLR: update ctrl description and examples Message-ID: Review at https://gerrit.osmocom.org/4393 OsmoHLR: update ctrl description and examples The patch to refactor ctrl commands to osmo-hlr, change I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50, was tweaked. Adjust accordingly. Change-Id: Ie4da6115bb2eb005a9f95bf4de1bfe36468fd607 --- M OsmoHLR/chapters/control.adoc M OsmoHLR/example_subscriber_cs_ps_enabled.ctrl M OsmoHLR/example_subscriber_info.ctrl 3 files changed, 50 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/93/4393/1 diff --git a/OsmoHLR/chapters/control.adoc b/OsmoHLR/chapters/control.adoc index 89c9c08..50fd314 100644 --- a/OsmoHLR/chapters/control.adoc +++ b/OsmoHLR/chapters/control.adoc @@ -39,8 +39,8 @@ namevalue ---- -To keep the reply as short as possible, most values are omitted if they are -empty or reflect the default. These are the returned values and their presence +To keep the reply as short as possible, some values are omitted if they are +empty. These are the returned values and their presence modalities; for their meaning, see <>: .Returned values by OsmoHLR's 'info', 'info-all' and 'info-aud' commands @@ -50,11 +50,16 @@ |'info'|id|-9223372036854775808 .. 9223372036854775807 (usually not negative)|always |'info'|imsi|6 to 15 decimal digits|always |'info'|msisdn|1 to 15 decimal digits|when non-empty -|'info'|nam_cs|'1' or '0'|when '0' -|'info'|nam_ps|'1' or '0'|when '0' +|'info'|nam_cs|'1' if CS is enabled, or '0'|always +|'info'|nam_ps|'1' if PS is enabled, or '0'|always |'info'|vlr_number|up to 15 decimal digits|when non-empty |'info'|sgsn_number|up to 15 decimal digits|when non-empty |'info'|sgsn_address||when non-empty +|'info'|ms_purged_cs|'1' if CS is purged, or '0'|always +|'info'|ms_purged_ps|'1' if PS is purged, or '0'|always +|'info'|periodic_lu_timer|0..4294967295|always +|'info'|periodic_rau_tau_timer|0..4294967295|always +|'info'|lmsi|8 hex digits|always |'info-aud'|aud2g.algo|one of 'comp128v1', 'comp128v2', 'comp128v3' or 'xor'|when valid 2G auth data is set |'info-aud'|aud2g.ki|32 hexadecimal digits|when valid 2G auth data is set |'info-aud'|aud3g.algo|so far always 'milenage'|when valid 3G auth data is set diff --git a/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl b/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl index 1a98a80..a103fb8 100644 --- a/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl +++ b/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl @@ -3,6 +3,13 @@ id 3 imsi 901990000000003 msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 GET 2 subscriber.by-msisdn-103.ps-enabled GET_REPLY 2 subscriber.by-msisdn-103.ps-enabled 1 @@ -18,7 +25,13 @@ id 3 imsi 901990000000003 msisdn 103 +nam_cs 1 nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 SET 6 subscriber.by-msisdn-103.cs-enabled 0 SET_REPLY 6 subscriber.by-msisdn-103.cs-enabled OK @@ -33,6 +46,11 @@ msisdn 103 nam_cs 0 nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 SET 9 subscriber.by-msisdn-103.cs-enabled 1 SET_REPLY 9 subscriber.by-msisdn-103.cs-enabled OK @@ -44,3 +62,10 @@ id 3 imsi 901990000000003 msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 diff --git a/OsmoHLR/example_subscriber_info.ctrl b/OsmoHLR/example_subscriber_info.ctrl index 2020508..1bdf00b 100644 --- a/OsmoHLR/example_subscriber_info.ctrl +++ b/OsmoHLR/example_subscriber_info.ctrl @@ -3,6 +3,13 @@ id 3 imsi 901990000000003 msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 GET 2 subscriber.by-msisdn-103.info-aud GET_REPLY 2 subscriber.by-msisdn-103.info-aud @@ -12,17 +19,24 @@ aud3g.k 000102030405060708090a0b0c0d0e0f aud3g.opc 101112131415161718191a1b1c1d1e1f aud3g.ind_bitlen 5 -aud3g.sqn 2342 +aud3g.sqn 0 GET 3 subscriber.by-id-3.info-all GET_REPLY 3 subscriber.by-id-3.info-all id 3 imsi 901990000000003 msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 aud2g.algo COMP128v1 aud2g.ki 000102030405060708090a0b0c0d0e0f aud3g.algo MILENAGE aud3g.k 000102030405060708090a0b0c0d0e0f aud3g.opc 101112131415161718191a1b1c1d1e1f aud3g.ind_bitlen 5 -aud3g.sqn 2342 +aud3g.sqn 0 -- To view, visit https://gerrit.osmocom.org/4393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie4da6115bb2eb005a9f95bf4de1bfe36468fd607 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:26:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 14:26:11 +0000 Subject: [PATCH] libosmocore[master]: GPRS: clarify ip/frgre union use Message-ID: Review at https://gerrit.osmocom.org/4394 GPRS: clarify ip/frgre union use * add comment about underlying assumption that structs in ip/frgre union members in gprs_nsvc struct have the same memory layout * remove such assumption from gprs_ns_ll_str() * use gprs_ns_ll_str() for NSE dump Change-Id: Idcb912b7b3f7460fd2b058e16650c0bde8f757ee --- M include/osmocom/gprs/gprs_ns.h M src/gb/gprs_ns.c M src/gb/gprs_ns_vty.c 3 files changed, 22 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/94/4394/1 diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 521714e..0047825 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -138,6 +138,8 @@ /*! which link-layer are we based on? */ enum gprs_ns_ll ll; + /*! make sure to always keep bts_addr as first struct member to not break the assumption + that those structs are similar */ union { struct { struct sockaddr_in bts_addr; diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index a77e203..17486ee 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1173,9 +1173,21 @@ const char *gprs_ns_ll_str(struct gprs_nsvc *nsvc) { static char buf[80]; - snprintf(buf, sizeof(buf), "%s:%u", - inet_ntoa(nsvc->ip.bts_addr.sin_addr), - osmo_ntohs(nsvc->ip.bts_addr.sin_port)); + + switch(nsvc->ll) { + case GPRS_NS_LL_UDP: + snprintf(buf, sizeof(buf), "%s:%u", + inet_ntoa(nsvc->ip.bts_addr.sin_addr), osmo_ntohs(nsvc->ip.bts_addr.sin_port)); + break; + case GPRS_NS_LL_FR_GRE: + snprintf(buf, sizeof(buf), "%s:%u", + inet_ntoa(nsvc->frgre.bts_addr.sin_addr), osmo_ntohs(nsvc->frgre.bts_addr.sin_port)); + break; + default: + buf[0] = '\0'; + break; + } + buf[sizeof(buf) - 1] = '\0'; return buf; diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index 317a6a1..4ed4fef 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -165,12 +165,11 @@ nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", NS_DESC_A(nsvc->remote_state), NS_DESC_B(nsvc->remote_state)); - if (nsvc->ll == GPRS_NS_LL_UDP || nsvc->ll == GPRS_NS_LL_FR_GRE) - vty_out(vty, ", %s %15s:%u", - nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE", - inet_ntoa(nsvc->ip.bts_addr.sin_addr), - osmo_ntohs(nsvc->ip.bts_addr.sin_port)); - vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, ", %s %s%s", + nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE", + gprs_ns_ll_str(nsvc), VTY_NEWLINE); + if (stats) { vty_out_rate_ctr_group(vty, " ", nsvc->ctrg); vty_out_stat_item_group(vty, " ", nsvc->statg); -- To view, visit https://gerrit.osmocom.org/4394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idcb912b7b3f7460fd2b058e16650c0bde8f757ee Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:26:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 14:26:12 +0000 Subject: [PATCH] libosmocore[master]: GPRS: check and report local address used for NSE Message-ID: Review at https://gerrit.osmocom.org/4395 GPRS: check and report local address used for NSE When dumping NSE via vty: * check which local address would be used to communicate with a given NSE and print it * print link layer type last to make output more consistent Change-Id: I6932a29c7899d36bcc275f05dda9670b0e69bef0 Related: SYS#3610 --- M src/gb/gprs_ns_vty.c 1 file changed, 13 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/95/4395/1 diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index 4ed4fef..c6fb141 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -35,7 +35,7 @@ #include #include #include - +#include #include #include #include @@ -158,17 +158,23 @@ static void dump_nse(struct vty *vty, struct gprs_nsvc *nsvc, int stats) { - vty_out(vty, "NSEI %5u, NS-VC %5u, %5s %9s, Remote: %-4s, %5s %9s", + vty_out(vty, "NSEI %5u, NS-VC %5u, %5s %9s, ", nsvc->nsei, nsvc->nsvci, NS_DESC_A(nsvc->state), - NS_DESC_B(nsvc->state), + NS_DESC_B(nsvc->state)); + + if (nsvc->ll == GPRS_NS_LL_UDP) { + char local[INET6_ADDRSTRLEN + 1]; + int rc = osmo_sock_local_ip((char *)&local, inet_ntoa(nsvc->ip.bts_addr.sin_addr)); + vty_out(vty, "%s:%u ", (rc < 0) ? "unknown" : local, nsvc->nsi->nsip.local_port); + } + + vty_out(vty, "Remote: %-4s, %5s %9s, %s ", nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", NS_DESC_A(nsvc->remote_state), - NS_DESC_B(nsvc->remote_state)); + NS_DESC_B(nsvc->remote_state), gprs_ns_ll_str(nsvc)); - vty_out(vty, ", %s %s%s", - nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE", - gprs_ns_ll_str(nsvc), VTY_NEWLINE); + vty_out(vty, "%s%s", nsvc->ll == GPRS_NS_LL_UDP ? "UDP" : "FR-GRE", VTY_NEWLINE); if (stats) { vty_out_rate_ctr_group(vty, " ", nsvc->ctrg); -- To view, visit https://gerrit.osmocom.org/4395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6932a29c7899d36bcc275f05dda9670b0e69bef0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:32:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 14:32:01 +0000 Subject: libosmocore[master]: GPRS: clarify ip/frgre union use In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idcb912b7b3f7460fd2b058e16650c0bde8f757ee Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:32:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 14:32:39 +0000 Subject: libosmocore[master]: GPRS: unify NS state printing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I69f8d536135ae76dbca623c2f1ffba625adcb1e9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:33:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 14:33:04 +0000 Subject: libosmocore[master]: GPRS: wrap NS state assignment in macro In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5d6eaef0432d9be810bf93d07e40787b9ca59142 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:33:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 14:33:28 +0000 Subject: libosmocore[master]: GPRS: check and report local address used for NSE In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6932a29c7899d36bcc275f05dda9670b0e69bef0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:33:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 14:33:31 +0000 Subject: [MERGED] libosmocore[master]: GPRS: check and report local address used for NSE In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GPRS: check and report local address used for NSE ...................................................................... GPRS: check and report local address used for NSE When dumping NSE via vty: * check which local address would be used to communicate with a given NSE and print it * print link layer type last to make output more consistent Change-Id: I6932a29c7899d36bcc275f05dda9670b0e69bef0 Related: SYS#3610 --- M src/gb/gprs_ns_vty.c 1 file changed, 13 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index 4ed4fef..c6fb141 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -35,7 +35,7 @@ #include #include #include - +#include #include #include #include @@ -158,17 +158,23 @@ static void dump_nse(struct vty *vty, struct gprs_nsvc *nsvc, int stats) { - vty_out(vty, "NSEI %5u, NS-VC %5u, %5s %9s, Remote: %-4s, %5s %9s", + vty_out(vty, "NSEI %5u, NS-VC %5u, %5s %9s, ", nsvc->nsei, nsvc->nsvci, NS_DESC_A(nsvc->state), - NS_DESC_B(nsvc->state), + NS_DESC_B(nsvc->state)); + + if (nsvc->ll == GPRS_NS_LL_UDP) { + char local[INET6_ADDRSTRLEN + 1]; + int rc = osmo_sock_local_ip((char *)&local, inet_ntoa(nsvc->ip.bts_addr.sin_addr)); + vty_out(vty, "%s:%u ", (rc < 0) ? "unknown" : local, nsvc->nsi->nsip.local_port); + } + + vty_out(vty, "Remote: %-4s, %5s %9s, %s ", nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", NS_DESC_A(nsvc->remote_state), - NS_DESC_B(nsvc->remote_state)); + NS_DESC_B(nsvc->remote_state), gprs_ns_ll_str(nsvc)); - vty_out(vty, ", %s %s%s", - nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE", - gprs_ns_ll_str(nsvc), VTY_NEWLINE); + vty_out(vty, "%s%s", nsvc->ll == GPRS_NS_LL_UDP ? "UDP" : "FR-GRE", VTY_NEWLINE); if (stats) { vty_out_rate_ctr_group(vty, " ", nsvc->ctrg); -- To view, visit https://gerrit.osmocom.org/4395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6932a29c7899d36bcc275f05dda9670b0e69bef0 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:33:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 14:33:31 +0000 Subject: [MERGED] libosmocore[master]: GPRS: wrap NS state assignment in macro In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GPRS: wrap NS state assignment in macro ...................................................................... GPRS: wrap NS state assignment in macro This enables logging for every state transition which makes NS troubleshooting easier. Change-Id: I5d6eaef0432d9be810bf93d07e40787b9ca59142 Related: SYS#3610 --- M src/gb/gprs_ns.c 1 file changed, 35 insertions(+), 14 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index fd465b4..2d062cf 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -84,6 +84,11 @@ #include "common_vty.h" +#define ns_set_state(ns_, st_) ns_set_state_with_log(ns_, st_, false, __BASE_FILE__, __LINE__) +#define ns_set_remote_state(ns_, st_) ns_set_state_with_log(ns_, st_, true, __BASE_FILE__, __LINE__) +#define ns_mark_blocked(ns_) ns_set_state(ns_, (ns_)->state | NSE_S_BLOCKED) +#define ns_mark_unblocked(ns_) ns_set_state(ns_, (ns_)->state & (~NSE_S_BLOCKED)); + static const struct tlv_definition ns_att_tlvdef = { .def = { [NS_IE_CAUSE] = { TLV_TYPE_TvLV, 0 }, @@ -174,6 +179,22 @@ return msg; } +/* FIXME: convert to osmo_fsm */ +static inline void ns_set_state_with_log(struct gprs_nsvc *nsvc, uint32_t state, bool is_remote, + const char *file, unsigned line) +{ + uint32_t old_state = is_remote ? nsvc->remote_state : nsvc->state; + + LOGPSRC(DNS, LOGL_DEBUG, file, line, "NSEI %d (NS-VCI=%u) setting %sstate [%s,%s,%s] -> [%s,%s,%s]\n", + nsvc->nsei, nsvc->nsvci, is_remote ? "remote " : "", + NS_DESC_A(old_state), NS_DESC_B(old_state), NS_DESC_R(old_state), + NS_DESC_A(state), NS_DESC_B(state), NS_DESC_R(state)); + + if (is_remote) + nsvc->remote_state = state; + else + nsvc->state = state; +} /*! Lookup struct gprs_nsvc based on NSVCI * \param[in] nsi NS instance in which to search @@ -245,7 +266,7 @@ nsvc->nsvci = nsvci; nsvc->nsvci_is_valid = 1; /* before RESET procedure: BLOCKED and DEAD */ - nsvc->state = NSE_S_BLOCKED; + ns_set_state(nsvc, NSE_S_BLOCKED); nsvc->nsi = nsi; osmo_timer_setup(&nsvc->timer, gprs_ns_timer_cb, nsvc); nsvc->ctrg = rate_ctr_group_alloc(nsvc, &nsvc_ctrg_desc, nsvci); @@ -510,7 +531,7 @@ nsvc->nsei, nsvc->nsvci, gprs_ns_cause_str(cause)); /* be conservative and mark it as blocked even now! */ - nsvc->state |= NSE_S_BLOCKED; + ns_mark_blocked(nsvc); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]); msg->l2h = msgb_put(msg, sizeof(*nsh)); @@ -621,7 +642,7 @@ if (nsvc->alive_retries > nsvc->nsi->timeout[NS_TOUT_TNS_ALIVE_RETRIES]) { /* mark as dead and blocked */ - nsvc->state = NSE_S_BLOCKED; + ns_set_state(nsvc, NSE_S_BLOCKED); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]); rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_DEAD]); LOGP(DNS, LOGL_NOTICE, @@ -652,7 +673,7 @@ "NSEI=%u Reset timed out but RESET flag is not set\n", nsvc->nsei); /* Mark NS-VC locally as blocked and dead */ - nsvc->state = NSE_S_BLOCKED | NSE_S_RESET; + ns_set_state(nsvc, NSE_S_BLOCKED | NSE_S_RESET); /* Chapter 7.3: Re-send the RESET */ gprs_ns_tx_reset(nsvc, NS_CAUSE_OM_INTERVENTION); /* Re-start Tns-reset timer */ @@ -912,7 +933,7 @@ } /* Mark NS-VC as blocked and alive */ - (*nsvc)->state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); if (orig_nsvc) { rate_ctr_inc(&(*nsvc)->ctrg->ctr[NS_CTR_REPLACED]); @@ -1052,8 +1073,8 @@ } /* Mark NS-VC as blocked and alive */ - (*nsvc)->state = NSE_S_BLOCKED | NSE_S_ALIVE; - (*nsvc)->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); + ns_set_remote_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); rate_ctr_inc(&(*nsvc)->ctrg->ctr[NS_CTR_BLOCKED]); if ((*nsvc)->persistent || (*nsvc)->remote_end_is_sgsn) { /* stop RESET timer */ @@ -1075,7 +1096,7 @@ LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS BLOCK\n", nsvc->nsei); - nsvc->state |= NSE_S_BLOCKED; + ns_mark_blocked(nsvc); rc = tlv_parse(&tp, &ns_att_tlvdef, nsh->data, msgb_l2len(msg) - sizeof(*nsh), 0, 0); @@ -1253,7 +1274,7 @@ get_value_string(gprs_ns_pdu_strings, nsh->pdu_type), gprs_ns_ll_str(fallback_nsvc)); fallback_nsvc->nsvci = fallback_nsvc->nsei = 0xfffe; fallback_nsvc->nsvci_is_valid = 0; - fallback_nsvc->state = NSE_S_ALIVE; + ns_set_state(fallback_nsvc, NSE_S_ALIVE); rc = gprs_ns_tx_status(fallback_nsvc, NS_CAUSE_PDU_INCOMP_PSTATE, 0, msg); @@ -1376,15 +1397,15 @@ case NS_PDUT_UNBLOCK: /* Section 7.2: unblocking procedure */ LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS UNBLOCK\n", (*nsvc)->nsei); - (*nsvc)->state &= ~NSE_S_BLOCKED; + ns_mark_unblocked(*nsvc); ns_osmo_signal_dispatch(*nsvc, S_NS_UNBLOCK, 0); rc = gprs_ns_tx_simple(*nsvc, NS_PDUT_UNBLOCK_ACK); break; case NS_PDUT_UNBLOCK_ACK: LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS UNBLOCK ACK\n", (*nsvc)->nsei); /* mark NS-VC as unblocked + active */ - (*nsvc)->state = NSE_S_ALIVE; - (*nsvc)->remote_state = NSE_S_ALIVE; + ns_set_state(*nsvc, NSE_S_ALIVE); + ns_set_remote_state(*nsvc, NSE_S_ALIVE); ns_osmo_signal_dispatch(*nsvc, S_NS_UNBLOCK, 0); break; case NS_PDUT_BLOCK: @@ -1393,7 +1414,7 @@ case NS_PDUT_BLOCK_ACK: LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS BLOCK ACK\n", (*nsvc)->nsei); /* mark remote NS-VC as blocked + active */ - (*nsvc)->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE; + ns_set_remote_state(*nsvc, NSE_S_BLOCKED | NSE_S_ALIVE); break; default: LOGP(DNS, LOGL_NOTICE, "NSEI=%u Rx Unknown NS PDU type 0x%02x\n", @@ -1623,7 +1644,7 @@ nsvc->nsei); /* Mark NS-VC locally as blocked and dead */ - nsvc->state = NSE_S_BLOCKED | NSE_S_RESET; + ns_set_state(nsvc, NSE_S_BLOCKED | NSE_S_RESET); /* Send NS-RESET PDU */ rc = gprs_ns_tx_reset(nsvc, cause); -- To view, visit https://gerrit.osmocom.org/4382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5d6eaef0432d9be810bf93d07e40787b9ca59142 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:33:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 14:33:32 +0000 Subject: [MERGED] libosmocore[master]: GPRS: unify NS state printing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GPRS: unify NS state printing ...................................................................... GPRS: unify NS state printing * introduce defines with NS state names * use them for vty and tests * expand test output to print complete NS state Change-Id: I69f8d536135ae76dbca623c2f1ffba625adcb1e9 Related: SYS#3610 --- M include/osmocom/gprs/gprs_ns.h M src/gb/gprs_ns_vty.c M tests/gb/gprs_ns_test.c M tests/gb/gprs_ns_test.ok 4 files changed, 72 insertions(+), 67 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index d4aef82..2d2f86e 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -43,6 +43,10 @@ #define NSE_S_ALIVE 0x0002 #define NSE_S_RESET 0x0004 +#define NS_DESC_B(st) ((st) & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED") +#define NS_DESC_A(st) ((st) & NSE_S_ALIVE ? "ALIVE" : "DEAD") +#define NS_DESC_R(st) ((st) & NSE_S_RESET ? "RESET" : "UNRESET") + /*! Osmocom NS link layer types */ enum gprs_ns_ll { GPRS_NS_LL_UDP, /*!< NS/UDP/IP */ diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index 3b1a698..317a6a1 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -160,11 +160,11 @@ { vty_out(vty, "NSEI %5u, NS-VC %5u, %5s %9s, Remote: %-4s, %5s %9s", nsvc->nsei, nsvc->nsvci, - nsvc->state & NSE_S_ALIVE ? "ALIVE" : "DEAD", - nsvc->state & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED", + NS_DESC_A(nsvc->state), + NS_DESC_B(nsvc->state), nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", - nsvc->remote_state & NSE_S_ALIVE ? "ALIVE" : "DEAD", - nsvc->remote_state & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED"); + NS_DESC_A(nsvc->remote_state), + NS_DESC_B(nsvc->remote_state)); if (nsvc->ll == GPRS_NS_LL_UDP || nsvc->ll == GPRS_NS_LL_FR_GRE) vty_out(vty, ", %s %15s:%u", nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE", diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c index 456d8e3..0bbf943 100644 --- a/tests/gb/gprs_ns_test.c +++ b/tests/gb/gprs_ns_test.c @@ -390,11 +390,12 @@ printf("Current NS-VCIs:\n"); llist_for_each_entry(nsvc, &nsi->gprs_nsvcs, list) { struct sockaddr_in *peer = &(nsvc->ip.bts_addr); - printf(" VCI 0x%04x, NSEI 0x%04x, peer 0x%08x:%d%s%s%s\n", + printf(" VCI 0x%04x, NSEI 0x%04x, peer 0x%08x:%d, %s, %s, %s%s\n", nsvc->nsvci, nsvc->nsei, ntohl(peer->sin_addr.s_addr), ntohs(peer->sin_port), - nsvc->state & NSE_S_BLOCKED ? ", blocked" : "", - nsvc->state & NSE_S_ALIVE ? "" : ", dead", + NS_DESC_A(nsvc->state), + NS_DESC_B(nsvc->state), + NS_DESC_R(nsvc->state), nsvc->nsvci_is_valid ? "" : ", invalid VCI" ); dump_rate_ctr_group(stdout, " ", nsvc->ctrg); diff --git a/tests/gb/gprs_ns_test.ok b/tests/gb/gprs_ns_test.ok index b0c81e4..669e182 100644 --- a/tests/gb/gprs_ns_test.ok +++ b/tests/gb/gprs_ns_test.ok @@ -14,7 +14,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, BLOCKED, UNRESET --- Delete nsvc object (round 0)--- @@ -35,7 +35,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, BLOCKED, UNRESET --- Delete nsvc object (round 1)--- @@ -56,7 +56,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, BLOCKED, UNRESET --- Delete nsvc object (round 2)--- @@ -77,7 +77,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, BLOCKED, UNRESET --- Delete nsvc object (round 3)--- @@ -145,7 +145,7 @@ result (ALIVE_ACK) = 0 Current NS-VCIs: - VCI 0x1122, NSEI 0x1122, peer 0x01020304:1111 + VCI 0x1122, NSEI 0x1122, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET PROCESSING BSSGP RESET from 0x01020304:1111 00 00 00 00 22 04 82 4a 2e 07 81 08 08 88 10 20 30 40 50 60 10 00 @@ -170,7 +170,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, blocked + VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET --- Peer port changes, RESET, VCI changes --- @@ -187,8 +187,8 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, blocked - VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, blocked + VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, ALIVE, BLOCKED, UNRESET + VCI 0x1122, NSEI 0x1122, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET --- Peer port changes, RESET, NSEI changes --- @@ -205,8 +205,8 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, blocked - VCI 0x1122, NSEI 0x3344, peer 0x01020304:4444, blocked + VCI 0x3344, NSEI 0x1122, peer 0x01020304:3333, ALIVE, BLOCKED, UNRESET + VCI 0x1122, NSEI 0x3344, peer 0x01020304:4444, ALIVE, BLOCKED, UNRESET NS-VC changed NSEI count : 1 --- Peer port 3333, RESET, VCI is changed back --- @@ -225,8 +225,8 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, blocked - VCI 0x1122, NSEI 0x1122, peer 0x01020304:3333, blocked + VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET + VCI 0x1122, NSEI 0x1122, peer 0x01020304:3333, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 NS-VC changed NSEI count : 2 @@ -245,8 +245,8 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, blocked - VCI 0x1122, NSEI 0x1122, peer 0x01020304:4444, blocked + VCI 0x3344, NSEI 0x1122, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET + VCI 0x1122, NSEI 0x1122, peer 0x01020304:4444, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 NS-VC changed NSEI count : 2 @@ -289,7 +289,7 @@ result (ALIVE_ACK) = 0 Current NS-VCIs: - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET --- Setup VC 2 BSS -> SGSN --- @@ -330,8 +330,8 @@ result (ALIVE_ACK) = 0 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET --- Setup VC 1 SGSN -> BSS --- @@ -347,8 +347,8 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 --- Exchange NSEI 1 + 2 links --- @@ -368,8 +368,8 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, blocked, dead - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, DEAD, BLOCKED, RESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 2 NS-VC replaced other count: 1 @@ -389,8 +389,8 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, blocked, dead - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x00000000:0, DEAD, BLOCKED, RESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 1 @@ -433,8 +433,8 @@ result (ALIVE_ACK) = 0 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 1 @@ -453,8 +453,8 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 1 NS-VC changed NSEI count : 1 @@ -475,10 +475,10 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 1 NS-VC changed NSEI count : 1 @@ -499,10 +499,10 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 2 NS-VC changed NSEI count : 2 @@ -515,10 +515,10 @@ result (RESET_ACK) = 0 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 3 NS-VC replaced other count: 2 NS-VC changed NSEI count : 2 @@ -537,10 +537,10 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC replaced other count: 1 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0xf000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 4 NS-VC replaced other count: 2 NS-VC changed NSEI count : 3 @@ -560,11 +560,11 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0xf001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VC replaced other count: 2 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, blocked, dead + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0xf000, peer 0x00000000:0, DEAD, BLOCKED, RESET NS-VC Block count : 4 NS-VC replaced other count: 2 NS-VC changed NSEI count : 3 @@ -618,11 +618,11 @@ result (UNBLOCK_ACK) = 0 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VC replaced other count: 2 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222 + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, UNBLOCKED, UNRESET NS-VC Block count : 4 NS-VC replaced other count: 3 NS-VC changed NSEI count : 4 @@ -644,11 +644,11 @@ result (RESET_ACK) = 1 Current NS-VCIs: - VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, blocked + VCI 0xf001, NSEI 0x1000, peer 0x00000000:0, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VC replaced other count: 2 - VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 - VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, blocked + VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111, ALIVE, UNBLOCKED, UNRESET + VCI 0x1001, NSEI 0x1000, peer 0x01020304:2222, ALIVE, BLOCKED, UNRESET NS-VC Block count : 5 NS-VC replaced other count: 3 NS-VC changed NSEI count : 4 @@ -683,7 +683,7 @@ result (UNBLOCK_ACK) = 0 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, UNBLOCKED, UNRESET NS-VC Block count : 1 --- RESET, SGSN -> BSS --- @@ -701,7 +701,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 --- RESET with invalid NSEI, SGSN -> BSS --- @@ -716,7 +716,7 @@ result (RESET) = 0 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NSEI was invalid count : 1 @@ -732,7 +732,7 @@ result (RESET) = 0 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -752,7 +752,7 @@ result (RESET) = 9 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -765,7 +765,7 @@ result (RESET_ACK) = 0 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 1 @@ -782,7 +782,7 @@ result (RESET_ACK) = -22 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, DEAD, BLOCKED, RESET NS-VC Block count : 1 NS-VCI was invalid count : 1 NSEI was invalid count : 2 @@ -799,7 +799,7 @@ result (RESET_ACK) = -22 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, DEAD, BLOCKED, RESET NS-VC Block count : 1 NS-VCI was invalid count : 2 NSEI was invalid count : 2 @@ -835,7 +835,7 @@ result (UNBLOCK_ACK) = 0 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, UNBLOCKED, UNRESET NS-VC Block count : 1 --- Time out local test procedure --- @@ -938,7 +938,7 @@ 02 00 81 01 01 82 01 01 04 82 01 00 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked, dead + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, DEAD, BLOCKED, RESET --- Send message to SGSN --- @@ -967,7 +967,7 @@ result (ALIVE_ACK) = 1 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, blocked + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, BLOCKED, UNRESET NS-VC Block count : 1 --- Send message to SGSN --- @@ -995,7 +995,7 @@ result (ALIVE) = 1 Current NS-VCIs: - VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000, ALIVE, UNBLOCKED, UNRESET NS-VC Block count : 1 --- Send message to SGSN --- -- To view, visit https://gerrit.osmocom.org/4381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I69f8d536135ae76dbca623c2f1ffba625adcb1e9 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:33:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 14:33:32 +0000 Subject: [MERGED] libosmocore[master]: GPRS: clarify ip/frgre union use In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GPRS: clarify ip/frgre union use ...................................................................... GPRS: clarify ip/frgre union use * add comment about underlying assumption that structs in ip/frgre union members in gprs_nsvc struct have the same memory layout * remove such assumption from gprs_ns_ll_str() * use gprs_ns_ll_str() for NSE dump Change-Id: Idcb912b7b3f7460fd2b058e16650c0bde8f757ee --- M include/osmocom/gprs/gprs_ns.h M src/gb/gprs_ns.c M src/gb/gprs_ns_vty.c 3 files changed, 22 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 2d2f86e..4fb9f58 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -140,6 +140,8 @@ /*! which link-layer are we based on? */ enum gprs_ns_ll ll; + /*! make sure to always keep bts_addr as first struct member to not break the assumption + that those structs are similar */ union { struct { struct sockaddr_in bts_addr; diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 2d062cf..18d43cc 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1173,9 +1173,21 @@ const char *gprs_ns_ll_str(struct gprs_nsvc *nsvc) { static char buf[80]; - snprintf(buf, sizeof(buf), "%s:%u", - inet_ntoa(nsvc->ip.bts_addr.sin_addr), - osmo_ntohs(nsvc->ip.bts_addr.sin_port)); + + switch(nsvc->ll) { + case GPRS_NS_LL_UDP: + snprintf(buf, sizeof(buf), "%s:%u", + inet_ntoa(nsvc->ip.bts_addr.sin_addr), osmo_ntohs(nsvc->ip.bts_addr.sin_port)); + break; + case GPRS_NS_LL_FR_GRE: + snprintf(buf, sizeof(buf), "%s:%u", + inet_ntoa(nsvc->frgre.bts_addr.sin_addr), osmo_ntohs(nsvc->frgre.bts_addr.sin_port)); + break; + default: + buf[0] = '\0'; + break; + } + buf[sizeof(buf) - 1] = '\0'; return buf; diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index 317a6a1..4ed4fef 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -165,12 +165,11 @@ nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", NS_DESC_A(nsvc->remote_state), NS_DESC_B(nsvc->remote_state)); - if (nsvc->ll == GPRS_NS_LL_UDP || nsvc->ll == GPRS_NS_LL_FR_GRE) - vty_out(vty, ", %s %15s:%u", - nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE", - inet_ntoa(nsvc->ip.bts_addr.sin_addr), - osmo_ntohs(nsvc->ip.bts_addr.sin_port)); - vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, ", %s %s%s", + nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE", + gprs_ns_ll_str(nsvc), VTY_NEWLINE); + if (stats) { vty_out_rate_ctr_group(vty, " ", nsvc->ctrg); vty_out_stat_item_group(vty, " ", nsvc->statg); -- To view, visit https://gerrit.osmocom.org/4394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idcb912b7b3f7460fd2b058e16650c0bde8f757ee Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:34:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 14:34:29 +0000 Subject: osmo-mgw[master]: mgcp: remove port/timeslot calculator functions from mgcp.h In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4391 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ef14396dc9f97e570d9bcfb4d9b4a94e650ad46 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:36:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 14:36:23 +0000 Subject: [PATCH] libosmocore[master]: Introduce osmo_identifier_valid() function to check validity... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4128 to look at the new patch set (#2). Introduce osmo_identifier_valid() function to check validity of identifier We define the notion of an 'osmocom identifier' which is basically a 7-bit US-ASCII without any special characters beyond "-_:@". We introduce a function to verify if an identifier consists only of the permitted characters. Change-Id: I96a8d345c5a69238a12d040f39b70c485a5c421c --- M include/osmocom/core/utils.h M src/utils.c 2 files changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/28/4128/2 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 5f41213..09bc973 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -22,6 +22,7 @@ /*! Number of bytes necessary to store given BITS */ #define OSMO_BYTES_FOR_BITS(BITS) ((BITS + 8 - 1) / 8) +#include #include #include @@ -94,4 +95,6 @@ bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, bool require_even); +bool osmo_identifier_valid(const char *str); + /*! @} */ diff --git a/src/utils.c b/src/utils.c index 534916b..ef8e916 100644 --- a/src/utils.c +++ b/src/utils.c @@ -22,6 +22,7 @@ */ +#include #include #include #include @@ -411,6 +412,33 @@ return false; if (require_even && (len & 1)) return false; + + return true; +} + +/*! Determine if a given identifier is valid, i.e. doesn't contain illegal chars + * \param[in] str String to validate + * \returns true in case string contains valid identifier, false otherwise + */ +bool osmo_identifier_valid(const char *str) +{ + /* characters that are illegal in names */ + static const char illegal_chars[] = "., {}[]()<>|~\\^`'\"?=;/+*&%$#!"; + unsigned int i; + + /* an empty string is not a valid identifier */ + if (!str || strlen(str) == 0) + return false; + + for (i = 0; i < strlen(str); i++) { + /* check for 7-bit ASCII */ + if (str[i] & 0x80) + return false; + /* check for some explicit reserved control characters */ + if (strchr(illegal_chars, str[i])) + return false; + } + return true; } -- To view, visit https://gerrit.osmocom.org/4128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I96a8d345c5a69238a12d040f39b70c485a5c421c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:36:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 14:36:53 +0000 Subject: libosmocore[master]: Introduce osmo_identifier_valid() function to check validity... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I96a8d345c5a69238a12d040f39b70c485a5c421c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:38:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 14:38:38 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 5: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/4311/5/src/ctrl.c File src/ctrl.c: Line 98: cmd->reply = NULL; Maybe it's better to return smth like "unknown/unexpected error"? It would be more descriptive than empty message. Line 389: _LAST_CTRL_NODE_HLR); So we not only replace the commands, we also change the way we setup and use ctrl interface? I think it would be better to split "change interface" part into separate patch. https://gerrit.osmocom.org/#/c/4311/5/src/ctrl.h File src/ctrl.h: Line 30: _LAST_CTRL_NODE_HLR Same as ctrl.c - shouldn't this belong to a separate patch? This have nothing to do with actual ctrl commands change - would be the same with old commands too? -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 5 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:44:56 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 24 Oct 2017 14:44:56 +0000 Subject: libosmocore[master]: GPRS: check and report local address used for NSE In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/4395/2/src/gb/gprs_ns_vty.c File src/gb/gprs_ns_vty.c: Line 168: int rc = osmo_sock_local_ip((char *)&local, inet_ntoa(nsvc->ip.bts_addr.sin_addr)); Why that cast? either just type local or &local[0]? -- To view, visit https://gerrit.osmocom.org/4395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6932a29c7899d36bcc275f05dda9670b0e69bef0 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:47:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 14:47:37 +0000 Subject: libosmocore[master]: GPRS: check and report local address used for NSE In-Reply-To: References: Message-ID: Patch Set 2: > either just type local that would give "incompatible type" warning > or &local[0]? Isn't it the same as explicit cast? What would be advantage of writing it this way? -- To view, visit https://gerrit.osmocom.org/4395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6932a29c7899d36bcc275f05dda9670b0e69bef0 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:50:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 14:50:34 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 5: (3 comments) https://gerrit.osmocom.org/#/c/4311/5/src/ctrl.c File src/ctrl.c: Line 98: cmd->reply = NULL; > Maybe it's better to return smth like "unknown/unexpected error"? It would the ctrl API will insert a generic error message for us, no need to invent a new one. ... but now that I look at it in control_if.c:300, it actually also logs a notice that something failed to set an error message, so after all you're right. Line 389: _LAST_CTRL_NODE_HLR); > So we not only replace the commands, we also change the way we setup and us It is required to use ..._dynip2(), otherwise I would have to add the HLR CTRL_NODE enum values in libosmocore. You have a point about hlr_controlif_setup arguments changing though; and I have an unnecessary cosmetic change, too. https://gerrit.osmocom.org/#/c/4311/5/src/ctrl.h File src/ctrl.h: Line 30: _LAST_CTRL_NODE_HLR > Same as ctrl.c - shouldn't this belong to a separate patch? This have nothi no, this one belongs in this patch, I am using these new nodes to provide the new ctrl commands. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 5 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 24 14:59:09 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 24 Oct 2017 14:59:09 +0000 Subject: libosmocore[master]: GPRS: check and report local address used for NSE In-Reply-To: References: Message-ID: Patch Set 2: Compile a test? #include void bar(char *abc) { } int main(int argc, char **argv) { char foo[3]; printf("%p %p %p\n", foo, &foo, &foo[0]); bar(foo); bar(&foo); bar(&foo[0]); } ptr.c:13:6: warning: incompatible pointer types passing 'char (*)[3]' to parameter of type 'char *' [-Wincompatible-pointer-types] bar(&foo); ^~~~ ptr.c:3:16: note: passing argument to parameter 'abc' here void bar(char *abc) { ^ 1 warning generated. -- To view, visit https://gerrit.osmocom.org/4395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6932a29c7899d36bcc275f05dda9670b0e69bef0 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:27:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:27:53 +0000 Subject: [PATCH] osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4311 to look at the new patch set (#6). ctrl: completely replace all CTRL commands The previous commands are not conforming to how the CTRL interface is intended to work: SET enable-ps SET disable-ps SET status-ps 'status-ps' is a write-only command even though it returns the status. 'enable-ps' / 'disable-ps' indicate the value instead of a variable name of an entity. The entity takes the place of the variable value. See also https://lists.osmocom.org/pipermail/openbsc/2017-September/011236.html Instead, replace with SET subscriber.by-imsi-123456.ps-enabled {0,1} GET subscriber.by-imsi-123456.ps-enabled and also provide further CTRL functions while at it: {SET,GET} subscriber.by-{imsi,msisdn,id}-123456.{cs,ps}-enabled {0,1} GET subscriber.by-{imsi,msisdn,id}-123456.{info,info-aud,info-all} Provide CTRL tests in the form of transcripts. Adjust tests/test_subscriber.sql to feature nonzero SQN, to see some values for SQN in the CTRL transcript tests. (This does not affect the VTY tests, because that creates its own subscribers, and there's no VTY command to set the SQN.) This is the first time an application uses CTRL_NODE ids that are defined outside of libosmocore, see 'Depends' below. Implementation choice: the first idea was to have a '.' between the 'by-xxx' and the value, like: subscriber.by-xxx.123456.function but the difficulty with subscribers is that they are not in RAM, and I can't just point node_data at a struct instance that is always there (like, say, a global bts[0] struct in osmo-bsc). Instead, I want to store the selector and later decide whether to read from the DB or whatever. With a '.' separating things, the only way in a ctrl function to obtain both 'by-xxx' and '123456' for picking a subscriber record would be to parse the entire variable path string elements, including 'subscriber' and 'function', which would then also clumsily fix at which node level we hook these commands; there could have been separate CTRL_NODE_SUBSCR_BY_{IMSI,MSISDN,ID} parent nodes, but we cannot introspect the current parent node dynamically within a ctrl function handler (plus I'm not sure whether it's possible and a good idea to have the same command under multiple parent nodes). Rather than that, I store the 'by-foo-123' token in the node_data pointer to have both bits of information pointed at by a single pointer; I use the incoming command parsing to get this token pre-separated from surrounding node names, and no need to re-allocate it, since the vector of tokens lives until after command execution is complete. Each leaf command obtains this token from cmd->node (aka node_data), and feeds this token to a common static function to parse selector and value from it and to retrieve a subscriber record as needed. (BTW, I have mentioned on the mailing list that this way might be necessary to avoid numeric-only CTRL node names, but we don't need to, and that is not at all related to this choice of structure.) Depends: libosmocore I1bd62ae0d4eefde7e1517db15a2155640a1bab58 libosmocore Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 --- M src/ctrl.c M src/ctrl.h M tests/test_subscriber.ctrl M tests/test_subscriber.sql M tests/test_subscriber.vty A tests/test_subscriber_errors.ctrl 6 files changed, 1,039 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/11/4311/6 diff --git a/src/ctrl.c b/src/ctrl.c index b49765d..9297eb8 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -21,77 +21,360 @@ */ #include +#include +#include +#include -#include -#include +#include #include -#include "gsup_server.h" -#include "logging.h" -#include "db.h" #include "hlr.h" -#include "luop.h" #include "ctrl.h" +#include "db.h" -static int handle_cmd_ps(struct hlr *ctx, struct ctrl_cmd *cmd, bool enable) +#define SEL_BY "by-" +#define SEL_BY_IMSI SEL_BY "imsi-" +#define SEL_BY_MSISDN SEL_BY "msisdn-" +#define SEL_BY_ID SEL_BY "id-" + +#define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) + +static bool startswith(const char *str, const char *start) +{ + return strncmp(str, start, strlen(start)) == 0; +} + +static int _get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr) +{ + const char *val; + if (startswith(by_selector, SEL_BY_IMSI)) { + val = by_selector + strlen(SEL_BY_IMSI); + if (!osmo_imsi_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_imsi(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_MSISDN)) { + val = by_selector + strlen(SEL_BY_MSISDN); + if (!osmo_msisdn_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_msisdn(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_ID)) { + int64_t id; + char *endptr; + val = by_selector + strlen(SEL_BY_ID); + if (*val == '+') + return -EINVAL; + errno = 0; + id = strtoll(val, &endptr, 10); + if (errno || *endptr) + return -EINVAL; + return db_subscr_get_by_id(dbc, id, subscr); + } + return -ENOTSUP; +} + +static bool get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr, + struct ctrl_cmd *cmd) +{ + int rc = _get_subscriber(dbc, by_selector, subscr); + switch (rc) { + case 0: + return true; + case -ENOTSUP: + cmd->reply = "Not a known subscriber 'by-xxx-' selector."; + return false; + case -EINVAL: + cmd->reply = "Invalid value part of 'by-xxx-value' selector."; + return false; + case -ENOENT: + cmd->reply = "No such subscriber."; + return false; + default: + cmd->reply = "An unknown error has occured during get_subscriber()."; + return false; + } +} + +/* Optimization: if a subscriber operation is requested by-imsi, just return + * the IMSI right back. */ +static const char *get_subscriber_imsi(struct db_context *dbc, + const char *by_selector, + struct ctrl_cmd *cmd) +{ + static struct hlr_subscriber subscr; + + if (startswith(by_selector, SEL_BY_IMSI)) + return by_selector + strlen(SEL_BY_IMSI); + if (!get_subscriber(dbc, by_selector, &subscr, cmd)) + return NULL; + return subscr.imsi; +} + +/* printf fmt and arg to completely omit a string if it is empty. */ +#define FMT_S "%s%s%s%s" +#define ARG_S(name, val) \ + (val) && *(val) ? "\n" : "", \ + (val) && *(val) ? name : "", \ + (val) && *(val) ? "\t" : "", \ + (val) && *(val) ? (val) : "" \ + +/* printf fmt and arg to completely omit bool of given value. */ +#define FMT_BOOL "%s" +#define ARG_BOOL(name, val) \ + val ? "\n" name "\t1" : "\n" name "\t0" + +static void print_subscr_info(struct ctrl_cmd *cmd, + struct hlr_subscriber *subscr) +{ + ctrl_cmd_reply_printf(cmd, + "\nid\t%"PRIu64 + FMT_S + FMT_S + FMT_BOOL + FMT_BOOL + FMT_S + FMT_S + FMT_S + FMT_BOOL + FMT_BOOL + "\nperiodic_lu_timer\t%u" + "\nperiodic_rau_tau_timer\t%u" + "\nlmsi\t%08x" + , + subscr->id, + ARG_S("imsi", subscr->imsi), + ARG_S("msisdn", subscr->msisdn), + ARG_BOOL("nam_cs", subscr->nam_cs), + ARG_BOOL("nam_ps", subscr->nam_ps), + ARG_S("vlr_number", subscr->vlr_number), + ARG_S("sgsn_number", subscr->sgsn_number), + ARG_S("sgsn_address", subscr->sgsn_address), + ARG_BOOL("ms_purged_cs", subscr->ms_purged_cs), + ARG_BOOL("ms_purged_ps", subscr->ms_purged_ps), + subscr->periodic_lu_timer, + subscr->periodic_rau_tau_timer, + subscr->lmsi + ); +} + +static void print_subscr_info_aud2g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + ctrl_cmd_reply_printf(cmd, + "\naud2g.algo\t%s" + "\naud2g.ki\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.gsm.ki)); +} + +static void print_subscr_info_aud3g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + ctrl_cmd_reply_printf(cmd, + "\naud3g.algo\t%s" + "\naud3g.k\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.umts.k)); + /* hexdump uses a static string buffer, hence only one hexdump per + * printf(). */ + ctrl_cmd_reply_printf(cmd, + "\naud3g.%s\t%s" + "\naud3g.ind_bitlen\t%u" + "\naud3g.sqn\t%"PRIu64 + , + aud->u.umts.opc_is_op? "op" : "opc", + hexdump_buf(aud->u.umts.opc), + aud->u.umts.ind_bitlen, + aud->u.umts.sqn); +} + +CTRL_CMD_DEFINE_RO(subscr_info, "info"); +static int get_subscr_info(struct ctrl_cmd *cmd, void *data) { struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; - if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, &subscr) < 0) { - cmd->reply = "Subscriber Unknown in HLR"; + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + print_subscr_info(cmd, &subscr); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_aud, "info-aud"); +static int get_subscr_info_aud(struct ctrl_cmd *cmd, void *data) +{ + const char *imsi; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } - if (hlr_subscr_nam(ctx, &subscr, enable, true) < 0) { - cmd->reply = "Error updating DB"; + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_all, "info-all"); +static int get_subscr_info_all(struct ctrl_cmd *cmd, void *data) +{ + struct hlr_subscriber subscr; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, subscr.imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } + print_subscr_info(cmd, &subscr); + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +static int verify_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) +{ + if (!value || !*value + || (strcmp(value, "0") && strcmp(value, "1"))) + return 1; + return 0; +} + +static int get_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + cmd->reply = (is_ps ? subscr.nam_ps : subscr.nam_cs) + ? "1" : "0"; + return CTRL_CMD_REPLY; +} + +static int set_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + const char *imsi; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + if (db_subscr_nam(hlr->dbc, imsi, strcmp(cmd->value, "1") == 0, is_ps)) + return CTRL_CMD_ERROR; cmd->reply = "OK"; return CTRL_CMD_REPLY; } -CTRL_CMD_DEFINE_WO_NOVRF(enable_ps, "enable-ps"); -static int set_enable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_ps_enabled, "ps-enabled"); +static int verify_subscr_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, true); + return verify_subscr_cs_ps_enabled(cmd, value, data); +} +static int get_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return get_subscr_cs_ps_enabled(cmd, data, true); +} +static int set_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, true); } -CTRL_CMD_DEFINE_WO_NOVRF(disable_ps, "disable-ps"); -static int set_disable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_cs_enabled, "cs-enabled"); +static int verify_subscr_cs_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, false); + return verify_subscr_cs_ps_enabled(cmd, value, data); } - -CTRL_CMD_DEFINE_WO_NOVRF(status_ps, "status-ps"); -static int set_status_ps(struct ctrl_cmd *cmd, void *data) +static int get_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) { - struct hlr *ctx = data; - struct lu_operation *luop = lu_op_alloc(ctx->gs); - if (!luop) { - cmd->reply = "Internal HLR error"; - return CTRL_CMD_ERROR; - } - - if (!lu_op_fill_subscr(luop, ctx->dbc, cmd->value)) { - cmd->reply = "Subscriber Unknown in HLR"; - return CTRL_CMD_ERROR; - } - - cmd->reply = luop->subscr.nam_ps ? "1" : "0"; - - return CTRL_CMD_REPLY; + return get_subscr_cs_ps_enabled(cmd, data, false); +} +static int set_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, false); } int hlr_ctrl_cmds_install() { int rc = 0; - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_enable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_disable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_status_ps); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_aud); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_all); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_ps_enabled); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_cs_enabled); return rc; +} + +static int hlr_ctrl_node_lookup(void *data, vector vline, int *node_type, + void **node_data, int *i) +{ + const char *token = vector_slot(vline, *i); + + switch (*node_type) { + case CTRL_NODE_ROOT: + if (strcmp(token, "subscriber") != 0) + return 0; + *node_data = NULL; + *node_type = CTRL_NODE_SUBSCR; + break; + case CTRL_NODE_SUBSCR: + if (!startswith(token, "by-")) + return 0; + *node_data = (void*)token; + *node_type = CTRL_NODE_SUBSCR_BY; + break; + default: + return 0; + } + + return 1; } struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr) @@ -100,8 +383,8 @@ struct ctrl_handle *hdl = ctrl_interface_setup_dynip2(hlr, hlr->ctrl_bind_addr, OSMO_CTRL_PORT_HLR, - NULL, - 0); + hlr_ctrl_node_lookup, + _LAST_CTRL_NODE_HLR); if (!hdl) return NULL; diff --git a/src/ctrl.h b/src/ctrl.h index 239deea..3f9ba3f 100644 --- a/src/ctrl.h +++ b/src/ctrl.h @@ -24,7 +24,11 @@ #include -#include "gsup_server.h" +enum hlr_ctrl_node { + CTRL_NODE_SUBSCR = _LAST_CTRL_NODE, + CTRL_NODE_SUBSCR_BY, + _LAST_CTRL_NODE_HLR +}; int hlr_ctrl_cmds_install(); struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr); diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl index 3284ae5..b9be5fe 100644 --- a/tests/test_subscriber.ctrl +++ b/tests/test_subscriber.ctrl @@ -1,27 +1,598 @@ -GET 1 invalid -ERROR 1 Command not found -SET 2 invalid nonsense -ERROR 2 Command not found +GET 1 subscriber.by-imsi-901990000000001.info +GET_REPLY 1 subscriber.by-imsi-901990000000001.info +id 1 +imsi 901990000000001 +msisdn 1 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 -SET 3 enable-ps 901990000000001 -SET_REPLY 3 enable-ps OK -SET 4 status-ps 901990000000001 -SET_REPLY 4 status-ps 1 -SET 5 enable-ps 901990000000001 -SET_REPLY 5 enable-ps OK -SET 6 status-ps 901990000000001 -SET_REPLY 6 status-ps 1 +GET 2 subscriber.by-imsi-901990000000001.info-aud +GET_REPLY 2 subscriber.by-imsi-901990000000001.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 7 disable-ps 901990000000001 -SET_REPLY 7 disable-ps OK -SET 8 status-ps 901990000000001 -SET_REPLY 8 status-ps 0 -SET 9 disable-ps 901990000000001 -SET_REPLY 9 disable-ps OK -SET 10 status-ps 901990000000001 -SET_REPLY 10 status-ps 0 +GET 3 subscriber.by-imsi-901990000000001.info-all +GET_REPLY 3 subscriber.by-imsi-901990000000001.info-all +id 1 +imsi 901990000000001 +msisdn 1 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 11 enable-ps 901990000000001 -SET_REPLY 11 enable-ps OK -SET 12 status-ps 901990000000001 -SET_REPLY 12 status-ps 1 +GET 4 subscriber.by-imsi-901990000000002.info +GET_REPLY 4 subscriber.by-imsi-901990000000002.info +id 2 +imsi 901990000000002 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 5 subscriber.by-imsi-901990000000002.info-aud +GET_REPLY 5 subscriber.by-imsi-901990000000002.info-aud +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 4223 + +GET 6 subscriber.by-imsi-901990000000002.info-all +GET_REPLY 6 subscriber.by-imsi-901990000000002.info-all +id 2 +imsi 901990000000002 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 4223 + +GET 7 subscriber.by-imsi-901990000000003.info +GET_REPLY 7 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 8 subscriber.by-imsi-901990000000003.info-aud +GET_REPLY 8 subscriber.by-imsi-901990000000003.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 9 subscriber.by-imsi-901990000000003.info-all +GET_REPLY 9 subscriber.by-imsi-901990000000003.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 10 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 10 subscriber.by-imsi-901990000000003.ps-enabled 1 + +SET 11 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 11 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 12 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 12 subscriber.by-imsi-901990000000003.ps-enabled 0 + +GET 13 subscriber.by-imsi-901990000000003.info +GET_REPLY 13 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 14 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 14 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 15 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 15 subscriber.by-imsi-901990000000003.ps-enabled 0 + +SET 16 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 16 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 17 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 17 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 18 subscriber.by-imsi-901990000000003.info +GET_REPLY 18 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 19 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 19 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 20 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 20 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 21 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 21 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 22 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 22 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 23 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 23 subscriber.by-imsi-901990000000003.cs-enabled 0 + +GET 24 subscriber.by-imsi-901990000000003.info +GET_REPLY 24 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 25 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 25 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 26 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 26 subscriber.by-imsi-901990000000003.cs-enabled 0 + +SET 27 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 27 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 28 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 28 subscriber.by-imsi-901990000000003.cs-enabled 1 + +GET 29 subscriber.by-imsi-901990000000003.info +GET_REPLY 29 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 30 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 30 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 31 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 31 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 32 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 32 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 33 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 33 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 34 subscriber.by-imsi-901990000000003.info +GET_REPLY 34 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 35 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 35 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 36 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 36 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 37 subscriber.by-imsi-901990000000003.info +GET_REPLY 37 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + + + +GET 38 subscriber.by-msisdn-103.info +GET_REPLY 38 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 39 subscriber.by-msisdn-103.info-aud +GET_REPLY 39 subscriber.by-msisdn-103.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 40 subscriber.by-msisdn-103.info-all +GET_REPLY 40 subscriber.by-msisdn-103.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 41 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 41 subscriber.by-msisdn-103.ps-enabled 1 + +SET 42 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 42 subscriber.by-msisdn-103.ps-enabled OK +GET 43 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 43 subscriber.by-msisdn-103.ps-enabled 0 + +GET 44 subscriber.by-msisdn-103.info +GET_REPLY 44 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 45 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 45 subscriber.by-msisdn-103.ps-enabled OK +GET 46 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 46 subscriber.by-msisdn-103.ps-enabled 0 + +SET 47 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 47 subscriber.by-msisdn-103.ps-enabled OK +GET 48 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 48 subscriber.by-msisdn-103.ps-enabled 1 + +GET 49 subscriber.by-msisdn-103.info +GET_REPLY 49 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 50 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 50 subscriber.by-msisdn-103.ps-enabled OK +GET 51 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 51 subscriber.by-msisdn-103.ps-enabled 1 + +GET 52 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 52 subscriber.by-msisdn-103.cs-enabled 1 + +SET 53 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 53 subscriber.by-msisdn-103.cs-enabled OK +GET 54 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 54 subscriber.by-msisdn-103.cs-enabled 0 + +GET 55 subscriber.by-msisdn-103.info +GET_REPLY 55 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 56 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 56 subscriber.by-msisdn-103.cs-enabled OK +GET 57 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 57 subscriber.by-msisdn-103.cs-enabled 0 + +SET 58 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 58 subscriber.by-msisdn-103.cs-enabled OK +GET 59 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 59 subscriber.by-msisdn-103.cs-enabled 1 + +GET 60 subscriber.by-msisdn-103.info +GET_REPLY 60 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 61 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 61 subscriber.by-msisdn-103.cs-enabled OK +GET 62 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 62 subscriber.by-msisdn-103.cs-enabled 1 + +SET 63 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 63 subscriber.by-msisdn-103.ps-enabled OK +SET 64 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 64 subscriber.by-msisdn-103.cs-enabled OK +GET 65 subscriber.by-msisdn-103.info +GET_REPLY 65 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 66 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 66 subscriber.by-msisdn-103.ps-enabled OK +SET 67 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 67 subscriber.by-msisdn-103.cs-enabled OK +GET 68 subscriber.by-msisdn-103.info +GET_REPLY 68 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + + + +GET 69 subscriber.by-id-3.info +GET_REPLY 69 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 70 subscriber.by-id-3.info-aud +GET_REPLY 70 subscriber.by-id-3.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 71 subscriber.by-id-3.info-all +GET_REPLY 71 subscriber.by-id-3.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 72 subscriber.by-id-3.ps-enabled +GET_REPLY 72 subscriber.by-id-3.ps-enabled 1 + +SET 73 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 73 subscriber.by-id-3.ps-enabled OK +GET 74 subscriber.by-id-3.ps-enabled +GET_REPLY 74 subscriber.by-id-3.ps-enabled 0 + +GET 75 subscriber.by-id-3.info +GET_REPLY 75 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 76 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 76 subscriber.by-id-3.ps-enabled OK +GET 77 subscriber.by-id-3.ps-enabled +GET_REPLY 77 subscriber.by-id-3.ps-enabled 0 + +SET 78 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 78 subscriber.by-id-3.ps-enabled OK +GET 79 subscriber.by-id-3.ps-enabled +GET_REPLY 79 subscriber.by-id-3.ps-enabled 1 + +GET 80 subscriber.by-id-3.info +GET_REPLY 80 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 81 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 81 subscriber.by-id-3.ps-enabled OK +GET 82 subscriber.by-id-3.ps-enabled +GET_REPLY 82 subscriber.by-id-3.ps-enabled 1 + +GET 83 subscriber.by-id-3.cs-enabled +GET_REPLY 83 subscriber.by-id-3.cs-enabled 1 + +SET 84 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 84 subscriber.by-id-3.cs-enabled OK +GET 85 subscriber.by-id-3.cs-enabled +GET_REPLY 85 subscriber.by-id-3.cs-enabled 0 + +GET 86 subscriber.by-id-3.info +GET_REPLY 86 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 87 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 87 subscriber.by-id-3.cs-enabled OK +GET 88 subscriber.by-id-3.cs-enabled +GET_REPLY 88 subscriber.by-id-3.cs-enabled 0 + +SET 89 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 89 subscriber.by-id-3.cs-enabled OK +GET 90 subscriber.by-id-3.cs-enabled +GET_REPLY 90 subscriber.by-id-3.cs-enabled 1 + +GET 91 subscriber.by-id-3.info +GET_REPLY 91 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 92 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 92 subscriber.by-id-3.cs-enabled OK +GET 93 subscriber.by-id-3.cs-enabled +GET_REPLY 93 subscriber.by-id-3.cs-enabled 1 + +SET 94 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 94 subscriber.by-id-3.ps-enabled OK +SET 95 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 95 subscriber.by-id-3.cs-enabled OK +GET 96 subscriber.by-id-3.info +GET_REPLY 96 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 97 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 97 subscriber.by-id-3.ps-enabled OK +SET 98 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 98 subscriber.by-id-3.cs-enabled OK +GET 99 subscriber.by-id-3.info +GET_REPLY 99 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql index 0767d48..bce0af2 100644 --- a/tests/test_subscriber.sql +++ b/tests/test_subscriber.sql @@ -1,13 +1,13 @@ -- 2G only subscriber -INSERT INTO subscriber (id, imsi) VALUES (1, '901990000000001'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (1, '901990000000001', '1'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (1, 1, '000102030405060708090a0b0c0d0e0f'); -- 3G only subscriber INSERT INTO subscriber (id, imsi) VALUES (2, '901990000000002'); -INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 4223); -- 2G + 3G subscriber -INSERT INTO subscriber (id, imsi) VALUES (3, '901990000000003'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (3, '901990000000003', '103'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); -INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 2342); diff --git a/tests/test_subscriber.vty b/tests/test_subscriber.vty index 2e0bdce..2da455f 100644 --- a/tests/test_subscriber.vty +++ b/tests/test_subscriber.vty @@ -305,6 +305,7 @@ OPC=cededeffacedacefacedbadfadedbeef IND-bitlen=23 +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op C01ffedC1cadaeAc1d1f1edAcac1aB0a OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op CoiffedCicadaeAcidifiedAcaciaBoa % Invalid value for OP: 'CoiffedCicadaeAcidifiedAcaciaBoa' OsmoHLR# subscriber imsi 123456789023000 show @@ -313,8 +314,8 @@ MSISDN: 423 3G auth: MILENAGE K=deaf0ff1ced0d0dabbedd1ced1cef00d - OPC=cededeffacedacefacedbadfadedbeef - IND-bitlen=23 + OP=c01ffedc1cadaeac1d1f1edacac1ab0a + IND-bitlen=5 OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef OsmoHLR# subscriber id 1 show @@ -325,8 +326,8 @@ KI=cededeffacedacefacedbadfadedbeef 3G auth: MILENAGE K=deaf0ff1ced0d0dabbedd1ced1cef00d - OPC=cededeffacedacefacedbadfadedbeef - IND-bitlen=23 + OP=c01ffedc1cadaeac1d1f1edacac1ab0a + IND-bitlen=5 OsmoHLR# subscriber imsi 123456789023000 delete % Deleted subscriber for IMSI '123456789023000' diff --git a/tests/test_subscriber_errors.ctrl b/tests/test_subscriber_errors.ctrl new file mode 100644 index 0000000..2f64fdb --- /dev/null +++ b/tests/test_subscriber_errors.ctrl @@ -0,0 +1,107 @@ +GET 1 invalid +ERROR 1 Command not found +SET 2 invalid nonsense +ERROR 2 Command not found + +GET 3 subscriber.by-imsi-nonsense.info +ERROR 3 Invalid value part of 'by-xxx-value' selector. +GET 4 subscriber.by-msisdn-nonsense.info +ERROR 4 Invalid value part of 'by-xxx-value' selector. +GET 5 subscriber.by-id-nonsense.info +ERROR 5 Invalid value part of 'by-xxx-value' selector. + +GET 6 subscriber +ERROR 6 Command not present. +GET 7 subscriber. +ERROR 7 Command not present. +GET 8 subscriber.by-nonsense +ERROR 8 Command not present. +GET 9 subscriber.by-nonsense- +ERROR 9 Command not present. +GET 10 subscriber.by-nonsense-123456 +ERROR 10 Command not present. +GET 11 subscriber.by-nonsense-123456. +ERROR 11 Command not present. +GET 12 subscriber.by-imsi- +ERROR 12 Command not present. +GET 13 subscriber.by-imsi-. +ERROR 13 Command not present. +GET 14 subscriber.by-imsi-901990000000003 +ERROR 14 Command not present. +GET 15 subscriber.by-imsi-901990000000003. +ERROR 15 Command not present. + +GET 16 subscriber.by-nonsense-123456.info +ERROR 16 Not a known subscriber 'by-xxx-' selector. +GET 17 subscriber.by-123456.info +ERROR 17 Not a known subscriber 'by-xxx-' selector. + +GET 18 subscriber.by-imsi-.info +ERROR 18 Invalid value part of 'by-xxx-value' selector. +GET 19 subscriber.by-imsi--.info +ERROR 19 Invalid value part of 'by-xxx-value' selector. + +GET 20 subscriber.by-imsi-12345678901234567.info +ERROR 20 Invalid value part of 'by-xxx-value' selector. +GET 21 subscriber.by-imsi-12345.info +ERROR 21 Invalid value part of 'by-xxx-value' selector. +GET 22 subscriber.by-imsi-1234567890123456.info +ERROR 22 Invalid value part of 'by-xxx-value' selector. + +GET 23 subscriber.by-id-99999999999999999999999999.info +ERROR 23 Invalid value part of 'by-xxx-value' selector. +GET 24 subscriber.by-id-9223372036854775807.info +ERROR 24 No such subscriber. +GET 25 subscriber.by-id-9223372036854775808.info +ERROR 25 Invalid value part of 'by-xxx-value' selector. +GET 26 subscriber.by-id--1.info +ERROR 26 No such subscriber. +GET 27 subscriber.by-id--9223372036854775808.info +ERROR 27 No such subscriber. +GET 28 subscriber.by-id--9223372036854775809.info +ERROR 28 Invalid value part of 'by-xxx-value' selector. + +GET 29 subscriber.by-id-1+1.info +ERROR 29 Invalid value part of 'by-xxx-value' selector. +GET 30 subscriber.by-id--.info +ERROR 30 Invalid value part of 'by-xxx-value' selector. +GET 31 subscriber.by-id-+1.info +ERROR 31 Invalid value part of 'by-xxx-value' selector. +GET 32 subscriber.by-id-+-1.info +ERROR 32 Invalid value part of 'by-xxx-value' selector. +GET 33 subscriber.by-id--+1.info +ERROR 33 Invalid value part of 'by-xxx-value' selector. +GET 34 subscriber.by-id-++1.info +ERROR 34 Invalid value part of 'by-xxx-value' selector. +GET 35 subscriber.by-id---1.info +ERROR 35 Invalid value part of 'by-xxx-value' selector. + +GET 36 subscriber.by-id- 1.info +ERROR 36 Command not present. +GET 37 subscriber.by-id-+ 1.info +ERROR 37 Command not present. +GET 38 subscriber.by-id-- 1.info +ERROR 38 Command not present. + + +SET 39 subscriber.by-imsi-901990000000001.info foo +ERROR 39 Read Only attribute +SET 40 subscriber.by-imsi-901990000000001.info-aud foo +ERROR 40 Read Only attribute +SET 41 subscriber.by-imsi-901990000000001.info-all foo +ERROR 41 Read Only attribute + +SET 42 subscriber.by-imsi-901990000000001.ps-enabled nonsense +ERROR 42 Value failed verification. +SET 43 subscriber.by-imsi-901990000000001.cs-enabled nonsense +ERROR 43 Value failed verification. + +SET 44 subscriber.by-imsi-901990000000001.ps-enabled +ERROR err Command parser error. +SET 45 subscriber.by-imsi-901990000000001.cs-enabled +ERROR err Command parser error. + +GET 46 subscriber.by-imsi-1234567890123456.ps-enabled +ERROR 46 Invalid value part of 'by-xxx-value' selector. +GET 47 subscriber.by-imsi-1234567890123456.cs-enabled +ERROR 47 Invalid value part of 'by-xxx-value' selector. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 6 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:27:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:27:54 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: tweak params of hlr_controlif_setup() Message-ID: Review at https://gerrit.osmocom.org/4396 cosmetic: tweak params of hlr_controlif_setup() Cosmetically prepare for adding new CTRL commands in hlr_controlif_setup(): - drop unused 'gs' param. - use ctrl_interface_setup_dynip2(), so far with default CTRL nodes; custom nodes will be added soon. Prepares: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Change-Id: I63004a7953b04988449697dbc5d55d7ed0c6d82d --- M src/ctrl.c M src/ctrl.h M src/hlr.c 3 files changed, 8 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/96/4396/1 diff --git a/src/ctrl.c b/src/ctrl.c index 3bd4d8f..b49765d 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -94,14 +94,14 @@ return rc; } -struct ctrl_handle *hlr_controlif_setup(struct hlr *ctx, - struct osmo_gsup_server *gs) +struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr) { int rc; - struct ctrl_handle *hdl = ctrl_interface_setup_dynip(ctx, - ctx->ctrl_bind_addr, - OSMO_CTRL_PORT_HLR, - NULL); + struct ctrl_handle *hdl = ctrl_interface_setup_dynip2(hlr, + hlr->ctrl_bind_addr, + OSMO_CTRL_PORT_HLR, + NULL, + 0); if (!hdl) return NULL; diff --git a/src/ctrl.h b/src/ctrl.h index 663de30..239deea 100644 --- a/src/ctrl.h +++ b/src/ctrl.h @@ -27,5 +27,4 @@ #include "gsup_server.h" int hlr_ctrl_cmds_install(); -struct ctrl_handle *hlr_controlif_setup(struct hlr *ctx, - struct osmo_gsup_server *gs); +struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr); diff --git a/src/hlr.c b/src/hlr.c index b32f709..6310526 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -474,7 +474,7 @@ } g_hlr->ctrl_bind_addr = ctrl_vty_get_bind_addr(); - g_hlr->ctrl = hlr_controlif_setup(g_hlr, g_hlr->gs); + g_hlr->ctrl = hlr_controlif_setup(g_hlr); osmo_init_ignore_signals(); signal(SIGINT, &signal_hdlr); -- To view, visit https://gerrit.osmocom.org/4396 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63004a7953b04988449697dbc5d55d7ed0c6d82d Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:29:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:29:38 +0000 Subject: python/osmo-python-tests[master]: osmo_verify_transcript: add error handling for missing port In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4321 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1627c36cfb627e7f3a9b4d9f087bf10875ae0690 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:29:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:29:41 +0000 Subject: python/osmo-python-tests[master]: osmo_verify_transcript_vty: automatically obtain the prompt ... In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id5d953156023fcbfc8867c1c3634d787d0b3ac57 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:29:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:29:43 +0000 Subject: python/osmo-python-tests[master]: osmo_verify_transcript: allow running/piping commands directly In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c31a87fa255092bcd06da239651cc50174c8faa Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:29:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:29:47 +0000 Subject: python/osmo-python-tests[master]: osmo_verify_*: clarify naming to osmo_interact_* In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0cbd5db85ebebc893df638a07f5568632563dc9 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:30:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:30:27 +0000 Subject: python/osmo-python-tests[master]: cosmetic: cmdline arg doc tweaks, comment In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I60dc059879dfe15cd3415ce1ed068ded28ff084e Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:30:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:30:28 +0000 Subject: [MERGED] python/osmo-python-tests[master]: cosmetic: cmdline arg doc tweaks, comment In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: cmdline arg doc tweaks, comment ...................................................................... cosmetic: cmdline arg doc tweaks, comment Change-Id: I60dc059879dfe15cd3415ce1ed068ded28ff084e --- M osmopy/osmo_interact_common.py M osmopy/osmo_interact_vty.py 2 files changed, 4 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/osmopy/osmo_interact_common.py b/osmopy/osmo_interact_common.py index 6107b64..57f00bf 100644 --- a/osmopy/osmo_interact_common.py +++ b/osmopy/osmo_interact_common.py @@ -349,15 +349,15 @@ ' including command line arguments. If omitted, no' ' application is launched.') parser.add_argument('-p', '--port', dest='port', - help="Port that the application opens.") + help="Port to reach the application at.") parser.add_argument('-H', '--host', dest='host', default='localhost', - help="Host that the application opens the port on.") + help="Host to reach the application at.") return parser def parser_add_verify_args(parser): parser.add_argument('-u', '--update', dest='update', action='store_true', help='Do not verify, but OVERWRITE transcripts based on' - ' the applications current behavior. OVERWRITES TRANSCRIPT' + ' the application\'s current behavior. OVERWRITES TRANSCRIPT' ' FILES.') parser.add_argument('-v', '--verbose', action='store_true', help='Print commands and application output') diff --git a/osmopy/osmo_interact_vty.py b/osmopy/osmo_interact_vty.py index c484932..b57cd8c 100755 --- a/osmopy/osmo_interact_vty.py +++ b/osmopy/osmo_interact_vty.py @@ -142,6 +142,7 @@ received_lines = self._command(command_str, timeout) + # send escape to cancel the '?' command line if command_str[-1] == '?': self._command('\x03', timeout) -- To view, visit https://gerrit.osmocom.org/4325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I60dc059879dfe15cd3415ce1ed068ded28ff084e Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:30:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:30:29 +0000 Subject: [MERGED] python/osmo-python-tests[master]: osmo_verify_*: clarify naming to osmo_interact_* In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo_verify_*: clarify naming to osmo_interact_* ...................................................................... osmo_verify_*: clarify naming to osmo_interact_* Have common implementations in one place, and expose distinct command line argument signatures to obtain the separate tasks as separate scripts. osmo_interact_common.py implements the parts common to all VTY and CTRL interactions. osmo_interact_vty.py and osmo_interact_ctrl.py implement commands I/O but only expose command line args to directly pipe commands and responses. osmo_verify_transcript_vty.py and osmo_verify_transcript_ctrl.py act as before, now implemented by importing osmo_interact_{vty,ctrl}.py, only exposing the verifification command line arguments. Change-Id: Ie0cbd5db85ebebc893df638a07f5568632563dc9 --- M osmopy/__init__.py R osmopy/osmo_interact_common.py A osmopy/osmo_interact_ctrl.py A osmopy/osmo_interact_vty.py M osmopy/osmo_verify_transcript_ctrl.py M osmopy/osmo_verify_transcript_vty.py M setup.py 7 files changed, 320 insertions(+), 238 deletions(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/osmopy/__init__.py b/osmopy/__init__.py index 01ff3de..1b97e33 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -4,6 +4,8 @@ __all__ = ['obscvty', 'osmodumpdoc', 'osmotestconfig', 'osmotestvty', 'osmoutil', 'osmo_ipa', - 'osmo_verify_transcript_common', + 'osmo_interact_common', + 'osmo_interact_vty', + 'osmo_interact_ctrl', 'osmo_verify_transcript_vty', 'osmo_verify_transcript_ctrl'] diff --git a/osmopy/osmo_verify_transcript_common.py b/osmopy/osmo_interact_common.py similarity index 87% rename from osmopy/osmo_verify_transcript_common.py rename to osmopy/osmo_interact_common.py index 71961e6..6107b64 100644 --- a/osmopy/osmo_verify_transcript_common.py +++ b/osmopy/osmo_interact_common.py @@ -19,7 +19,9 @@ # along with this program. If not, see . ''' -Common code for verify_transcript_vty.py and verify_transcript_ctrl.py. +Common code for osmo_interact_vty.py and osmo_interact_ctrl.py. +This implements all of application interaction, piping and verification. +osmo_interact_{vty,ctrl}.py plug VTY and CTRL interface specific bits. ''' import argparse @@ -249,13 +251,14 @@ output.write('\n'.join(res)) output.write('\n') -def end_process(proc): +def end_process(proc, quiet=False): if not proc: return rc = proc.poll() if rc is not None: - print('Process has already terminated with', rc) + if not quiet: + print('Process has already terminated with', rc) proc.wait() return @@ -277,9 +280,11 @@ if proc.poll() is None: # termination seems to be slower than that, let's just kill proc.kill() - print("Killed child process") + if not quiet: + print("Killed child process") elif waited_time > .002: - print("Terminating took %.3fs" % waited_time) + if not quiet: + print("Terminating took %.3fs" % waited_time) proc.wait() class Application: @@ -307,7 +312,7 @@ self.proc = subprocess.Popen(self.command_tuple, stdout=out_err, stderr=out_err) def stop(self): - end_process(self.proc) + end_process(self.proc, self.quiet) def verify_application(run_app_str, interact, transcript_file, verbose): passed = None @@ -347,31 +352,31 @@ help="Port that the application opens.") parser.add_argument('-H', '--host', dest='host', default='localhost', help="Host that the application opens the port on.") + return parser + +def parser_add_verify_args(parser): parser.add_argument('-u', '--update', dest='update', action='store_true', help='Do not verify, but OVERWRITE transcripts based on' ' the applications current behavior. OVERWRITES TRANSCRIPT' ' FILES.') parser.add_argument('-v', '--verbose', action='store_true', help='Print commands and application output') - parser.add_argument('-O', '--output', dest='output_path', - help="Do not verify a transcript file, but directly" - " write command results to a file, '-' means stdout." - " If input files are provided, these must not be transcript" - " files, but bare commands, one per line, without" - " prompts nor expected results." - " If neither --command nor input files are" - " provided, read commands from stdin." - " Ignore '--update'.") - parser.add_argument('-c', '--command', dest='cmd_str', - help="Run this command instead of reading from a" - " transcript file, multiple commands may be separated" - " by ';'. Implies '-O -' unless -O is passed.") - parser.add_argument('transcript_files', nargs='*', help='transcript files to verify') + parser.add_argument('transcript_files', nargs='*', help='transcript file(s) to verify') return parser -def run_commands(run_app_str, output_path, cmd_str, cmd_files, interact): +def parser_add_run_args(parser): + parser.add_argument('-O', '--output', dest='output_path', + help="Write command results to a file instead of stdout." + "('-O -' writes to stdout and is the default)") + parser.add_argument('-c', '--command', dest='cmd_str', + help="Run this command (before reading input files, if any)." + " multiple commands may be separated by ';'") + parser.add_argument('cmd_files', nargs='*', help='file(s) with plain commands to run') + return parser + +def main_run_commands(run_app_str, output_path, cmd_str, cmd_files, interact): to_stdout = False - if output_path == '-': + if not output_path or output_path == '-': to_stdout = True output = sys.stdout else: @@ -419,7 +424,7 @@ except: traceback.print_exc() -def verify_transcripts(run_app_str, transcript_files, interact, verbose): +def main_verify_transcripts(run_app_str, transcript_files, interact, verbose): results = [] for t in transcript_files: passed = verify_application(run_app_str=run_app_str, @@ -437,19 +442,5 @@ if not all_passed: sys.exit(1) - -def main(run_app_str, output_path, cmd_str, transcript_files, interact, verbose): - - # If there is a command to run, pipe to stdout by default. - # If there are no input files nor commands to run, read from stdin - # and write results to stdout. - if not output_path: - if cmd_str or (not cmd_str and not transcript_files): - output_path = '-' - - if output_path: - run_commands(run_app_str, output_path, cmd_str, transcript_files, interact) - else: - verify_transcripts(run_app_str, transcript_files, interact, verbose) # vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_interact_ctrl.py b/osmopy/osmo_interact_ctrl.py new file mode 100755 index 0000000..9b1a20b --- /dev/null +++ b/osmopy/osmo_interact_ctrl.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run CTRL commands or test transcripts against a given application. Commandline +invocation exposes only direct command piping, the transcript verification code +is exposed as commandline args by osmo_verify_transcript_ctrl.py. +''' + +import re + +from osmopy.osmo_interact_common import * +from osmopy.osmo_ipa import Ctrl, IPA + +class InteractCtrl(Interact): + next_id = 1 + keep_ids = True + re_command = re.compile('^(SET|GET) ([^ ]*) (.*)$') + + class CtrlStep(Interact.StepBase): + + @staticmethod + def is_next_step(line, interact_instance): + m = InteractCtrl.re_command.match(line) + if not m: + return None + next_step = InteractCtrl.CtrlStep() + + set_get = m.group(1) + cmd_id = m.group(2) + var_val = m.group(3) + if not interact_instance.keep_ids: + cmd_id = interact_instance.next_id + interact_instance.next_id += 1 + next_step.command = '%s %s %s' % (set_get, cmd_id, var_val) + + return next_step + + def __init__(self, port, host, verbose=False, update=False, keep_ids=True): + if not update: + keep_ids = True + self.keep_ids = keep_ids + super().__init__(InteractCtrl.CtrlStep, port=port, host=host, verbose=verbose, update=update) + + def connect(self): + self.next_id = 1 + super().connect() + + def send(self, data): + data = Ctrl().add_header(data) + return self.socket.send(data) == len(data) + + def receive(self): + responses = [] + data = self.socket.recv(4096) + while (len(data)>0): + (response_with_header, data) = IPA().split_combined(data) + response = Ctrl().rem_header(response_with_header) + responses.append(response.decode('utf-8')) + return responses + + def command(self, command): + assert self.send(command) + res = self.receive() + split_responses = [] + for r in res: + split_responses.extend(r.splitlines()) + sys.stdout.flush() + sys.stderr.flush() + return split_responses + +if __name__ == '__main__': + parser = common_parser() + parser_add_run_args(parser) + args = parser.parse_args() + + interact = InteractCtrl(args.port, args.host, verbose=False, update=False, + keep_ids=True) + + main_run_commands(args.run_app_str, args.output_path, args.cmd_str, + args.cmd_files, interact) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_interact_vty.py b/osmopy/osmo_interact_vty.py new file mode 100755 index 0000000..c484932 --- /dev/null +++ b/osmopy/osmo_interact_vty.py @@ -0,0 +1,179 @@ +#!/usr/bin/env python3 +# +# (C) 2017 by sysmocom s.f.m.c. GmbH +# All rights reserved. +# +# Author: Neels Hofmeyr +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +''' +Run VTY commands or test transcripts against a given application. Commandline +invocation exposes only direct command piping, the transcript verification code +is exposed as commandline args by osmo_verify_transcript_vty.py. +''' + +import re + +from osmopy.osmo_interact_common import * + +class InteractVty(Interact): + + class VtyStep(Interact.StepBase): + expect_node = None # e.g. '(config-net)' + expect_prompt_char = None # '>' or '#' + + def __init__(self, prompt): + super().__init__() + self.prompt = prompt + + def verify_interact_state(self, interact_instance): + if interact_instance.update: + return + if interact_instance.this_node != self.expect_node: + raise Exception('Mismatch: expected VTY node %r in the prompt, got %r' + % (self.expect_node, interact_instance.this_node)) + if interact_instance.this_prompt_char != self.expect_prompt_char: + raise Exception('Mismatch: expected VTY prompt character %r, got %r' + % (self.expect_prompt_char, interact_instance.this_prompt_char)) + + @staticmethod + def is_next_step(line, interact_instance): + m = interact_instance.re_prompt.match(line) + if not m: + return None + next_step = InteractVty.VtyStep(interact_instance.prompt) + next_step.expect_node = m.group(1) + next_step.expect_prompt_char = m.group(2) + next_step.command = m.group(3) + return next_step + + def command_str(self, interact_instance=None): + if interact_instance is None: + node = self.expect_node + prompt_char = self.expect_prompt_char + else: + node = interact_instance.last_node + prompt_char = interact_instance.last_prompt_char + if node: + node = '(%s)' % node + node = node or '' + return '%s%s%s %s' % (self.prompt, node, prompt_char, self.command) + + def __init__(self, prompt, port, host, verbose, update): + self.prompt = prompt + super().__init__(InteractVty.VtyStep, port, host, verbose, update) + + def connect(self): + self.this_node = None + self.this_prompt_char = '>' # slight cheat for initial prompt char + self.last_node = None + self.last_prompt_char = None + + super().connect() + # receive the first welcome message and discard + data = self.socket.recv(4096) + if not self.prompt: + b = data + b = b[b.rfind(b'\n') + 1:] + while b and (b[0] < ord('A') or b[0] > ord('z')): + b = b[1:] + prompt_str = b.decode('utf-8') + if '>' in prompt_str: + self.prompt = prompt_str[:prompt_str.find('>')] + if not self.prompt: + raise Exception('Could not find application name; needed to decode prompts.' + ' Initial data was: %r' % data) + self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) + + def _command(self, command_str, timeout=10): + self.socket.send(command_str.encode()) + + waited_since = time.time() + received_lines = [] + last_line = '' + + while True: + new_data = self.socket.recv(4096).decode('utf-8') + + last_line = "%s%s" % (last_line, new_data) + + if last_line: + lines = last_line.splitlines() + received_lines.extend(lines[:-1]) + last_line = lines[-1] + + match = self.re_prompt.match(last_line) + if not match: + if time.time() - waited_since > timeout: + raise IOError("Failed to read data (did the app crash?)") + time.sleep(.1) + continue + + self.last_node = self.this_node + self.last_prompt_char = self.this_prompt_char + self.this_node = match.group(1) or None + self.this_prompt_char = match.group(2) + break + + # expecting to have received the command we sent as echo, remove it + clean_command_str = command_str.strip() + if clean_command_str.endswith('?'): + clean_command_str = clean_command_str[:-1] + if received_lines and received_lines[0] == clean_command_str: + received_lines = received_lines[1:] + return received_lines + + def command(self, command_str, timeout=10): + command_str = command_str or '\r' + if command_str[-1] not in '?\r\t': + command_str = command_str + '\r' + + received_lines = self._command(command_str, timeout) + + if command_str[-1] == '?': + self._command('\x03', timeout) + + return received_lines + +def parser_add_vty_args(parser): + parser.add_argument('-n', '--prompt-name', dest='prompt', + help="Name used in application's telnet VTY prompt." + " If omitted, will attempt to determine the name from" + " the initial VTY prompt.") + return parser + +if __name__ == '__main__': + parser = common_parser() + parser_add_vty_args(parser) + parser_add_run_args(parser) + parser.add_argument('-X', '--gen-xml-ref', dest='gen_xml', action='store_true', + help="Equivalent to '-c \"show online-help\" -O -'," + " can be used to generate the VTY reference file as" + " required by osmo-gsm-manuals.git.") + args = parser.parse_args() + + if args.gen_xml: + if args.cmd_str: + raise Exception('It does not make sense to pass both --command and' + ' --gen-xml-ref.') + args.cmd_str = 'show online-help' + + interact = InteractVty(args.prompt, args.port, args.host, + verbose=False, update=False) + + main_run_commands(args.run_app_str, args.output_path, args.cmd_str, + args.cmd_files, interact) + +# vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_ctrl.py b/osmopy/osmo_verify_transcript_ctrl.py index 3cf6880..3afbc62 100755 --- a/osmopy/osmo_verify_transcript_ctrl.py +++ b/osmopy/osmo_verify_transcript_ctrl.py @@ -40,70 +40,11 @@ or it can be imported as a module to run more complex setups. ''' -import re - -from osmopy.osmo_verify_transcript_common import * -from osmopy.osmo_ipa import Ctrl, IPA - -class InteractCtrl(Interact): - next_id = 1 - keep_ids = True - re_command = re.compile('^(SET|GET) ([^ ]*) (.*)$') - - class CtrlStep(Interact.StepBase): - - @staticmethod - def is_next_step(line, interact_instance): - m = InteractCtrl.re_command.match(line) - if not m: - return None - next_step = InteractCtrl.CtrlStep() - - set_get = m.group(1) - cmd_id = m.group(2) - var_val = m.group(3) - if not interact_instance.keep_ids: - cmd_id = interact_instance.next_id - interact_instance.next_id += 1 - next_step.command = '%s %s %s' % (set_get, cmd_id, var_val) - - return next_step - - def __init__(self, port, host, verbose=False, update=False, keep_ids=True): - if not update: - keep_ids = True - self.keep_ids = keep_ids - super().__init__(InteractCtrl.CtrlStep, port=port, host=host, verbose=verbose, update=update) - - def connect(self): - self.next_id = 1 - super().connect() - - def send(self, data): - data = Ctrl().add_header(data) - return self.socket.send(data) == len(data) - - def receive(self): - responses = [] - data = self.socket.recv(4096) - while (len(data)>0): - (response_with_header, data) = IPA().split_combined(data) - response = Ctrl().rem_header(response_with_header) - responses.append(response.decode('utf-8')) - return responses - - def command(self, command): - assert self.send(command) - res = self.receive() - split_responses = [] - for r in res: - split_responses.extend(r.splitlines()) - sys.stdout.flush() - sys.stderr.flush() - return split_responses +from osmopy.osmo_interact_ctrl import * if __name__ == '__main__': parser = common_parser() + parser_add_verify_args(parser) parser.add_argument('-i', '--keep-ids', dest='keep_ids', action='store_true', help='With --update, default is to overwrite the command IDs' ' so that they are consecutive numbers starting from 1.' @@ -112,7 +53,6 @@ interact = InteractCtrl(args.port, args.host, args.verbose, args.update, args.keep_ids) - main(args.run_app_str, args.output_path, args.cmd_str, - args.transcript_files, interact, args.verbose) + main_verify_transcripts(args.run_app_str, args.transcript_files, interact, args.verbose) # vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_vty.py b/osmopy/osmo_verify_transcript_vty.py index 28c83d0..e70c36c 100755 --- a/osmopy/osmo_verify_transcript_vty.py +++ b/osmopy/osmo_verify_transcript_vty.py @@ -52,148 +52,16 @@ import re -from osmopy.osmo_verify_transcript_common import * - -class InteractVty(Interact): - - class VtyStep(Interact.StepBase): - expect_node = None # e.g. '(config-net)' - expect_prompt_char = None # '>' or '#' - - def __init__(self, prompt): - super().__init__() - self.prompt = prompt - - def verify_interact_state(self, interact_instance): - if interact_instance.update: - return - if interact_instance.this_node != self.expect_node: - raise Exception('Mismatch: expected VTY node %r in the prompt, got %r' - % (self.expect_node, interact_instance.this_node)) - if interact_instance.this_prompt_char != self.expect_prompt_char: - raise Exception('Mismatch: expected VTY prompt character %r, got %r' - % (self.expect_prompt_char, interact_instance.this_prompt_char)) - - @staticmethod - def is_next_step(line, interact_instance): - m = interact_instance.re_prompt.match(line) - if not m: - return None - next_step = InteractVty.VtyStep(interact_instance.prompt) - next_step.expect_node = m.group(1) - next_step.expect_prompt_char = m.group(2) - next_step.command = m.group(3) - return next_step - - def command_str(self, interact_instance=None): - if interact_instance is None: - node = self.expect_node - prompt_char = self.expect_prompt_char - else: - node = interact_instance.last_node - prompt_char = interact_instance.last_prompt_char - if node: - node = '(%s)' % node - node = node or '' - return '%s%s%s %s' % (self.prompt, node, prompt_char, self.command) - - def __init__(self, prompt, port, host, verbose, update): - self.prompt = prompt - super().__init__(InteractVty.VtyStep, port, host, verbose, update) - - def connect(self): - self.this_node = None - self.this_prompt_char = '>' # slight cheat for initial prompt char - self.last_node = None - self.last_prompt_char = None - - super().connect() - # receive the first welcome message and discard - data = self.socket.recv(4096) - if not self.prompt: - b = data - b = b[b.rfind(b'\n') + 1:] - while b and (b[0] < ord('A') or b[0] > ord('z')): - b = b[1:] - prompt_str = b.decode('utf-8') - if '>' in prompt_str: - self.prompt = prompt_str[:prompt_str.find('>')] - if not self.prompt: - raise Exception('Could not find application name; needed to decode prompts.' - ' Initial data was: %r' % data) - self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) - - def _command(self, command_str, timeout=10): - self.socket.send(command_str.encode()) - - waited_since = time.time() - received_lines = [] - last_line = '' - - while True: - new_data = self.socket.recv(4096).decode('utf-8') - - last_line = "%s%s" % (last_line, new_data) - - if last_line: - lines = last_line.splitlines() - received_lines.extend(lines[:-1]) - last_line = lines[-1] - - match = self.re_prompt.match(last_line) - if not match: - if time.time() - waited_since > timeout: - raise IOError("Failed to read data (did the app crash?)") - time.sleep(.1) - continue - - self.last_node = self.this_node - self.last_prompt_char = self.this_prompt_char - self.this_node = match.group(1) or None - self.this_prompt_char = match.group(2) - break - - # expecting to have received the command we sent as echo, remove it - clean_command_str = command_str.strip() - if clean_command_str.endswith('?'): - clean_command_str = clean_command_str[:-1] - if received_lines and received_lines[0] == clean_command_str: - received_lines = received_lines[1:] - return received_lines - - def command(self, command_str, timeout=10): - command_str = command_str or '\r' - if command_str[-1] not in '?\r\t': - command_str = command_str + '\r' - - received_lines = self._command(command_str, timeout) - - if command_str[-1] == '?': - self._command('\x03', timeout) - - return received_lines +from osmopy.osmo_interact_vty import * if __name__ == '__main__': parser = common_parser() - parser.add_argument('-n', '--prompt-name', dest='prompt', - help="Name used in application's telnet VTY prompt." - " If omitted, will attempt to determine the name from" - " the initial VTY prompt.") - parser.add_argument('-X', '--gen-xml-ref', dest='gen_xml', action='store_true', - help="Equivalent to '-c \"show online-help\" -O -'," - " can be used to generate the VTY reference file as" - " required by osmo-gsm-manuals.git.") + parser_add_vty_args(parser) + parser_add_verify_args(parser) args = parser.parse_args() - - if args.gen_xml: - if args.cmd_str: - raise Exception('It does not make sense to pass both --command and' - ' --gen-xml-ref.') - args.cmd_str = 'show online-help' interact = InteractVty(args.prompt, args.port, args.host, args.verbose, args.update) - main(args.run_app_str, args.output_path, args.cmd_str, - args.transcript_files, interact, args.verbose) + main_verify_transcripts(args.run_app_str, args.transcript_files, interact, args.verbose) # vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/setup.py b/setup.py index ec8654a..a1fad1a 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,9 @@ scripts = ["osmopy/osmodumpdoc.py", "osmopy/osmotestconfig.py", "osmopy/osmotestvty.py"] elif sys.version_info.major == 3: - scripts = ["osmopy/osmo_verify_transcript_vty.py", + scripts = ["osmopy/osmo_interact_vty.py", + "osmopy/osmo_interact_ctrl.py", + "osmopy/osmo_verify_transcript_vty.py", "osmopy/osmo_verify_transcript_ctrl.py"] setup( -- To view, visit https://gerrit.osmocom.org/4324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie0cbd5db85ebebc893df638a07f5568632563dc9 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:30:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:30:29 +0000 Subject: [MERGED] python/osmo-python-tests[master]: osmo_verify_transcript: allow running/piping commands directly In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo_verify_transcript: allow running/piping commands directly ...................................................................... osmo_verify_transcript: allow running/piping commands directly To retrieve the VTY reference XML from 'show online-help', which we need for the osmo-gsm-manuals, it is useful to directly print the output of a single VTY command. I have also always wanted to be able to just type CTRL commands and get their results. Add --command and --output arguments to run specific commands and pipe to stdout instead of verifying a transcript file, in a way that works generically for both VTY and CTRL interface. The scripts' names are now a bit of a misnomer, to be tweaked separately. Change-Id: I2c31a87fa255092bcd06da239651cc50174c8faa --- M osmopy/osmo_verify_transcript_common.py M osmopy/osmo_verify_transcript_ctrl.py M osmopy/osmo_verify_transcript_vty.py 3 files changed, 107 insertions(+), 21 deletions(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/osmopy/osmo_verify_transcript_common.py b/osmopy/osmo_verify_transcript_common.py index d8e9860..71961e6 100644 --- a/osmopy/osmo_verify_transcript_common.py +++ b/osmopy/osmo_verify_transcript_common.py @@ -242,6 +242,13 @@ return 'Did not expect line %r' % got[g] return True + def feed_commands(self, output, command_strs): + for command_str in command_strs: + for command in command_str.splitlines(): + res = self.command(command) + output.write('\n'.join(res)) + output.write('\n') + def end_process(proc): if not proc: return @@ -285,30 +292,32 @@ Application._devnull = open(os.devnull, 'w') return Application._devnull - def __init__(self, command_tuple, purge_output=True): - self.command_tuple = command_tuple + def __init__(self, run_app_str, purge_output=True, quiet=False): + self.command_tuple = shlex.split(run_app_str) self.purge_output = purge_output + self.quiet = quiet def run(self): out_err = None if self.purge_output: out_err = Application.devnull() - print('Launching: cd %r; %s' % (os.getcwd(), ' '.join(self.command_tuple))) + if not self.quiet: + print('Launching: cd %r; %s' % (os.getcwd(), ' '.join(self.command_tuple))) self.proc = subprocess.Popen(self.command_tuple, stdout=out_err, stderr=out_err) def stop(self): end_process(self.proc) -def verify_application(command_tuple, interact, transcript_file, verbose): +def verify_application(run_app_str, interact, transcript_file, verbose): passed = None application = None sys.stdout.flush() sys.stderr.flush() - if command_tuple: - application = Application(command_tuple, purge_output=not verbose) + if run_app_str: + application = Application(run_app_str, purge_output=not verbose) application.run() try: @@ -330,7 +339,7 @@ def common_parser(): parser = argparse.ArgumentParser() - parser.add_argument('-r', '--run', dest='command_str', + parser.add_argument('-r', '--run', dest='run_app_str', help='command to run to launch application to test,' ' including command line arguments. If omitted, no' ' application is launched.') @@ -344,19 +353,76 @@ ' FILES.') parser.add_argument('-v', '--verbose', action='store_true', help='Print commands and application output') + parser.add_argument('-O', '--output', dest='output_path', + help="Do not verify a transcript file, but directly" + " write command results to a file, '-' means stdout." + " If input files are provided, these must not be transcript" + " files, but bare commands, one per line, without" + " prompts nor expected results." + " If neither --command nor input files are" + " provided, read commands from stdin." + " Ignore '--update'.") + parser.add_argument('-c', '--command', dest='cmd_str', + help="Run this command instead of reading from a" + " transcript file, multiple commands may be separated" + " by ';'. Implies '-O -' unless -O is passed.") parser.add_argument('transcript_files', nargs='*', help='transcript files to verify') return parser -def main(command_str, transcript_files, interact, verbose): - - if command_str: - command_tuple = shlex.split(command_str) +def run_commands(run_app_str, output_path, cmd_str, cmd_files, interact): + to_stdout = False + if output_path == '-': + to_stdout = True + output = sys.stdout else: - command_tuple = None + output = open(output_path, 'w') + application = None + + if run_app_str: + application = Application(run_app_str, quiet=to_stdout) + application.run() + + try: + interact.connect() + + if cmd_str: + interact.feed_commands(output, cmd_str.split(';')) + + for f_path in (cmd_files or []): + with open(f_path, 'r') as f: + interact.feed_commands(output, f.read().decode('utf-8').splitlines()) + + if not (cmd_str or cmd_files): + while True: + line = sys.stdin.readline() + if not line: + break; + interact.feed_commands(output, line.split(';')) + except: + traceback.print_exc() + finally: + if not to_stdout: + try: + output.close() + except: + traceback.print_exc() + + try: + interact.close() + except: + traceback.print_exc() + + if application: + try: + application.stop() + except: + traceback.print_exc() + +def verify_transcripts(run_app_str, transcript_files, interact, verbose): results = [] for t in transcript_files: - passed = verify_application(command_tuple=command_tuple, + passed = verify_application(run_app_str=run_app_str, interact=interact, transcript_file=t, verbose=verbose) @@ -372,4 +438,18 @@ if not all_passed: sys.exit(1) +def main(run_app_str, output_path, cmd_str, transcript_files, interact, verbose): + + # If there is a command to run, pipe to stdout by default. + # If there are no input files nor commands to run, read from stdin + # and write results to stdout. + if not output_path: + if cmd_str or (not cmd_str and not transcript_files): + output_path = '-' + + if output_path: + run_commands(run_app_str, output_path, cmd_str, transcript_files, interact) + else: + verify_transcripts(run_app_str, transcript_files, interact, verbose) + # vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_ctrl.py b/osmopy/osmo_verify_transcript_ctrl.py index 7afe4bf..3cf6880 100755 --- a/osmopy/osmo_verify_transcript_ctrl.py +++ b/osmopy/osmo_verify_transcript_ctrl.py @@ -112,9 +112,7 @@ interact = InteractCtrl(args.port, args.host, args.verbose, args.update, args.keep_ids) - main(command_str=args.command_str, - transcript_files=args.transcript_files, - interact=interact, - verbose=args.verbose) + main(args.run_app_str, args.output_path, args.cmd_str, + args.transcript_files, interact, args.verbose) # vim: tabstop=4 shiftwidth=4 expandtab nocin ai diff --git a/osmopy/osmo_verify_transcript_vty.py b/osmopy/osmo_verify_transcript_vty.py index 636d600..28c83d0 100755 --- a/osmopy/osmo_verify_transcript_vty.py +++ b/osmopy/osmo_verify_transcript_vty.py @@ -179,13 +179,21 @@ help="Name used in application's telnet VTY prompt." " If omitted, will attempt to determine the name from" " the initial VTY prompt.") + parser.add_argument('-X', '--gen-xml-ref', dest='gen_xml', action='store_true', + help="Equivalent to '-c \"show online-help\" -O -'," + " can be used to generate the VTY reference file as" + " required by osmo-gsm-manuals.git.") args = parser.parse_args() + + if args.gen_xml: + if args.cmd_str: + raise Exception('It does not make sense to pass both --command and' + ' --gen-xml-ref.') + args.cmd_str = 'show online-help' interact = InteractVty(args.prompt, args.port, args.host, args.verbose, args.update) - main(command_str=args.command_str, - transcript_files=args.transcript_files, - interact=interact, - verbose=args.verbose) + main(args.run_app_str, args.output_path, args.cmd_str, + args.transcript_files, interact, args.verbose) # vim: tabstop=4 shiftwidth=4 expandtab nocin ai -- To view, visit https://gerrit.osmocom.org/4323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2c31a87fa255092bcd06da239651cc50174c8faa Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:30:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:30:29 +0000 Subject: [MERGED] python/osmo-python-tests[master]: osmo_verify_transcript_vty: automatically obtain the prompt ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo_verify_transcript_vty: automatically obtain the prompt string ...................................................................... osmo_verify_transcript_vty: automatically obtain the prompt string If -n is omitted, retrieve the proper prompt name from the initial VTY opening prompt. Change-Id: Id5d953156023fcbfc8867c1c3634d787d0b3ac57 --- M osmopy/osmo_verify_transcript_vty.py 1 file changed, 16 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/osmopy/osmo_verify_transcript_vty.py b/osmopy/osmo_verify_transcript_vty.py index 3a4d630..636d600 100755 --- a/osmopy/osmo_verify_transcript_vty.py +++ b/osmopy/osmo_verify_transcript_vty.py @@ -99,7 +99,6 @@ def __init__(self, prompt, port, host, verbose, update): self.prompt = prompt - self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) super().__init__(InteractVty.VtyStep, port, host, verbose, update) def connect(self): @@ -110,7 +109,19 @@ super().connect() # receive the first welcome message and discard - self.socket.recv(4096) + data = self.socket.recv(4096) + if not self.prompt: + b = data + b = b[b.rfind(b'\n') + 1:] + while b and (b[0] < ord('A') or b[0] > ord('z')): + b = b[1:] + prompt_str = b.decode('utf-8') + if '>' in prompt_str: + self.prompt = prompt_str[:prompt_str.find('>')] + if not self.prompt: + raise Exception('Could not find application name; needed to decode prompts.' + ' Initial data was: %r' % data) + self.re_prompt = re.compile('^%s(?:\(([\w-]*)\))?([#>]) (.*)$' % self.prompt) def _command(self, command_str, timeout=10): self.socket.send(command_str.encode()) @@ -165,7 +176,9 @@ if __name__ == '__main__': parser = common_parser() parser.add_argument('-n', '--prompt-name', dest='prompt', - help="Name used in application's telnet VTY prompt.") + help="Name used in application's telnet VTY prompt." + " If omitted, will attempt to determine the name from" + " the initial VTY prompt.") args = parser.parse_args() interact = InteractVty(args.prompt, args.port, args.host, args.verbose, args.update) -- To view, visit https://gerrit.osmocom.org/4322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id5d953156023fcbfc8867c1c3634d787d0b3ac57 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:30:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:30:29 +0000 Subject: [MERGED] python/osmo-python-tests[master]: osmo_verify_transcript: add error handling for missing port In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo_verify_transcript: add error handling for missing port ...................................................................... osmo_verify_transcript: add error handling for missing port Change-Id: I1627c36cfb627e7f3a9b4d9f087bf10875ae0690 --- M osmopy/osmo_verify_transcript_common.py 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/osmopy/osmo_verify_transcript_common.py b/osmopy/osmo_verify_transcript_common.py index e4b5553..d8e9860 100644 --- a/osmopy/osmo_verify_transcript_common.py +++ b/osmopy/osmo_verify_transcript_common.py @@ -70,6 +70,9 @@ self.verbose = verbose self.update = update + if not port: + raise Exception("You need to provide port number to connect to") + def connect(self): assert self.socket is None retries = 30 -- To view, visit https://gerrit.osmocom.org/4321 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1627c36cfb627e7f3a9b4d9f087bf10875ae0690 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:30:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:30:58 +0000 Subject: [MERGED] libosmocore[master]: contrib/fsm-to-dot.py: some tweaks that help with osmo-bsc's... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: contrib/fsm-to-dot.py: some tweaks that help with osmo-bsc's new FSMs ...................................................................... contrib/fsm-to-dot.py: some tweaks that help with osmo-bsc's new FSMs Combine the C source file name and the string name into the fsm's internal name token, and use it in most places instead of the plain struct name: osmo-bsc's new FSMs have identical struct names in each static c context. Output in a file name that includes all of these more detailed name tokens. Also parse '(1 << EVENT)' as event names. Note that besides this patch, there are also some tweaks to the osmo-bsc patch that improve the fsm-to-dot experience... - call fsm-to-dot for single files to avoid name conflicts, or rename each struct as a unique name. - Add comments for the event name a callback is intended for, so that not all transitions are interpreted as TEARDOWN (because it is invoked in common error handling, which causes the script to interpret it as the causing event). (or change the event-checking if into a switch that names the valid event and has a default case for all others.) Change-Id: Ib60df7fd19efc99ba9fe797f14c0e3239c4bea20 --- M contrib/fsm-to-dot.py 1 file changed, 40 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py index 3549d1e..06d2df1 100755 --- a/contrib/fsm-to-dot.py +++ b/contrib/fsm-to-dot.py @@ -5,7 +5,7 @@ Usage: ./fsm-to-dot.py ~/openbsc/openbsc/src/libvlr/*.c - for f in *.dot ; do dot -Tpng $f > $f.png; done + for f in *.dot ; do dot -Tpng "$f" > "$f.png"; done # dot comes from 'apt-get install graphviz' Looks for osmo_fsm finite state machine definitions and madly parses .c files @@ -13,7 +13,7 @@ No proper C parsing is done here (pycparser sucked, unfortunately). ''' -import sys, re +import sys, re, os def err(msg): sys.stderr.write(msg + '\n') @@ -63,8 +63,13 @@ return ld re_state_start = re.compile(r'\[([A-Z_][A-Z_0-9]*)\]') -re_event = re.compile(r'S\(([A-Z_][A-Z_0-9]*)\)') +re_event_alternatives = [ + re.compile(r'\(1 *<< *([A-Z_][A-Z_0-9]*)\)'), + re.compile(r'S\(([A-Z_][A-Z_0-9]*)\)'), + ] re_action = re.compile(r'.action *= *([a-z_][a-z_0-9]*)') + +re_insane_dot_name_chars = re.compile('[^a-zA-Z_]') def state_starts(line): m = re_state_start.search(line) @@ -79,7 +84,10 @@ return line.find('out_state_mask') >= 0 def states_or_events(line): - return re_event.findall(line) + results = [] + for one_re in re_event_alternatives: + results.extend(one_re.findall(line)) + return results def parse_action(line): a = re_action.findall(line) @@ -224,13 +232,15 @@ return 'State(name=%r,short_name=%r,out=%d)' % (state.name, state.short_name, len(state.out_edges)) class Fsm: - def __init__(fsm, struct_name, states_struct_name, from_file=None): + def __init__(fsm, struct_name, string_name, states_struct_name, from_file=None): fsm.states = [] fsm.struct_name = struct_name + fsm.string_name = string_name fsm.states_struct_name = states_struct_name fsm.from_file = from_file fsm.action_funcs = set() fsm.event_names = set() + fsm.dot_name = fsm.all_names_sanitized() def parse_states(fsm, src): state = None @@ -462,8 +472,8 @@ edge_action = caller if calling_state.action == edge_action: edge_action = None - calling_fsm.add_special_state(calling_fsm.states, fsm.struct_name, - calling_state, kind=KIND_FSM, edge_action=edge_action, label=label) + calling_fsm.add_special_state(calling_fsm.states, fsm.dot_name, + calling_state, kind=KIND_FSM, edge_action=edge_action, label=' '.join(fsm.all_names())) label = None if calling_state.kind == KIND_STATE: @@ -471,13 +481,13 @@ edge_action = caller if state.action == edge_action: edge_action = None - fsm.add_special_state(fsm.states, calling_fsm.struct_name, None, + fsm.add_special_state(fsm.states, calling_fsm.dot_name, None, state, kind=KIND_FSM, edge_action=edge_action, label=label) # meta overview - meta_called_fsm = fsm_meta.have_state(fsm.struct_name, KIND_FSM) - meta_calling_fsm = fsm_meta.have_state(calling_fsm.struct_name, KIND_FSM) + meta_called_fsm = fsm_meta.have_state(fsm.dot_name, KIND_FSM) + meta_calling_fsm = fsm_meta.have_state(calling_fsm.dot_name, KIND_FSM) meta_calling_fsm.add_out_edge(Edge(meta_called_fsm)) @@ -519,8 +529,23 @@ return '\n'.join(out) + def all_names(fsm): + n = [] + if fsm.from_file: + n.append(os.path.basename(fsm.from_file.path)) + if fsm.struct_name: + n.append(fsm.struct_name) + if fsm.string_name: + n.append(fsm.string_name) + return n + + def all_names_sanitized(fsm, sep='_'): + n = sep.join(fsm.all_names()) + n = re_insane_dot_name_chars.sub('_', n) + return n + def write_dot_file(fsm): - dot_path = '%s.dot' % fsm.struct_name + dot_path = '%s.dot' % ('_'.join(fsm.all_names())) f = open(dot_path, 'w') f.write(fsm.to_dot()) f.close() @@ -528,6 +553,7 @@ re_fsm = re.compile(r'struct osmo_fsm ([a-z_][a-z_0-9]*) =') +re_fsm_string_name = re.compile(r'\bname = "([^"]*)"') re_fsm_states_struct_name = re.compile(r'\bstates = ([a-z_][a-z_0-9]*)\W*,') re_fsm_states = re.compile(r'struct osmo_fsm_state ([a-z_][a-z_0-9]*)\[\] =') re_func = re.compile(r'(\b[a-z_][a-z_0-9]*\b)\([^)]*\)\W*^{', re.MULTILINE) @@ -575,8 +601,9 @@ for m in re_fsm.finditer(c_file.src): struct_name = m.group(1) struct_def = c_file.extract_block('{', '}', m.start()) + string_name = (re_fsm_string_name.findall(struct_def) or [None])[0] states_struct_name = re_fsm_states_struct_name.findall(struct_def)[0] - fsm = Fsm(struct_name, states_struct_name, c_file) + fsm = Fsm(struct_name, string_name, states_struct_name, c_file) fsms.append(fsm) return fsms @@ -694,7 +721,7 @@ fsm.find_event_edges(c_files) fsm.add_fsm_alloc(c_files) -fsm_meta = Fsm("meta", "meta") +fsm_meta = Fsm("meta", None, "meta") for fsm in fsms: fsm.add_cross_fsm_links(fsms, c_files, fsm_meta) -- To view, visit https://gerrit.osmocom.org/4377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib60df7fd19efc99ba9fe797f14c0e3239c4bea20 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:31:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:31:07 +0000 Subject: [MERGED] libosmocore[master]: fixups for recent "Cleanup jenkins build scripts" In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fixups for recent "Cleanup jenkins build scripts" ...................................................................... fixups for recent "Cleanup jenkins build scripts" Change I24e500e132f5c8e8133d35548cb7b4e4552331d0 was merged, but IMHO needs improvement. Fix these: - clean the git source tree before each build step, in common prep_build(). - fix indenting inside the build() macros. - change build() arg to be build_dir, to absorb cleanup steps into build(). - in jenkins.sh, use $ENABLE_SANITIZE as global env, not passed as arg. - in jenkins.sh, don't do 'make distcheck' twice. It is not necessary to do it from source tree as well as separately from source tree, since distcheck already moves to a different build dir. Change-Id: I09d306350602f21943d5bd45f7388c83ede9b524 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh M contrib/jenkins_common.sh 3 files changed, 43 insertions(+), 22 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index e0c75fa..ef116b1 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -2,8 +2,13 @@ . $(dirname "$0")/jenkins_common.sh +src_dir="$PWD" build() { - $1 --enable-static \ + build_dir="$1" + + prep_build "$src_dir" "$build_dir" + + "$src_dir"/configure --enable-static \ --prefix=/usr/local/arm-none-eabi \ --host=arm-none-eabi \ --enable-embedded \ @@ -11,15 +16,11 @@ --disable-shared \ CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" -$MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh + $MAKE $PARALLEL_MAKE \ + || cat-testlogs.sh } # verify build in dir other than source tree -mkdir -p builddir -cd builddir -build ../configure - -cd .. -build ./configure - +build builddir +# verify build in source tree +build . diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index c397d52..d731504 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -9,19 +9,23 @@ ENABLE_SANITIZE="" fi +src_dir="$PWD" build() { - $1 --enable-static $2 CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh + build_dir="$1" + + prep_build "$src_dir" "$build_dir" + + "$src_dir"/configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" + $MAKE $PARALLEL_MAKE check \ + || cat-testlogs.sh } # verify build in dir other than source tree -mkdir -p builddir -cd builddir -build ../configure $ENABLE_SANITIZE +build builddir +# verify build in source tree +build . -cd .. -build ./configure $ENABLE_SANITIZE - +# do distcheck only once, which is fine from built source tree, since distcheck +# is well separated from the source tree state. +$MAKE distcheck \ + || cat-testlogs.sh diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index e52a96a..6cfa334 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -4,4 +4,20 @@ verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") -autoreconf --install --force +prep_build() { + _src_dir="$1" + _build_dir="$2" + + cd "$_src_dir" + + # a failed 'make distcheck' may leave files without write permissions + chmod -R a+w . + git clean -dxf + # make absolutely sure no src files have modifications + git checkout -f HEAD + + autoreconf --install --force + + mkdir -p "$_build_dir" + cd "$_build_dir" +} -- To view, visit https://gerrit.osmocom.org/4383 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I09d306350602f21943d5bd45f7388c83ede9b524 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:31:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:31:07 +0000 Subject: [MERGED] libosmocore[master]: jenkins: bail early if $MAKE env var is not set In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: bail early if $MAKE env var is not set ...................................................................... jenkins: bail early if $MAKE env var is not set If $MAKE is unset, it produces confusing errors, rather check explicitly. Change-Id: I59b111dfdee4e1edea04155144f01d99f5f72aa1 --- M contrib/jenkins_common.sh 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 6cfa334..bc4ac65 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -2,6 +2,12 @@ set -ex +if [ -z "$MAKE" ]; then + set +x + echo "Error: you need to set \$MAKE before invoking, e.g. MAKE=make" + exit 1 +fi + verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") prep_build() { -- To view, visit https://gerrit.osmocom.org/4384 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I59b111dfdee4e1edea04155144f01d99f5f72aa1 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:32:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:32:00 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoNITB: update vty reference In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OsmoNITB: update vty reference ...................................................................... OsmoNITB: update vty reference Change node IDs to use the names derived from the node prompt, in the process fix the node references to not place the vty_additions in the wrong places. Related: I8fa555570268b231c5e01727c661da92fad265de (libosmocore) Change-Id: I48edb65be94be56c4b57293d8edc1b30271acc12 --- M OsmoNITB/vty/nitb_vty_additions.xml M OsmoNITB/vty/nitb_vty_reference.xml 2 files changed, 761 insertions(+), 118 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoNITB/vty/nitb_vty_additions.xml b/OsmoNITB/vty/nitb_vty_additions.xml index 0d473bd..7ea60dc 100644 --- a/OsmoNITB/vty/nitb_vty_additions.xml +++ b/OsmoNITB/vty/nitb_vty_additions.xml @@ -1,20 +1,20 @@ - - + + MNCC Internal Configuration This node allows to configure the default codecs for the internal call control handling. - - + + SMPP Configuration This node allows to configure the SMPP interface for interfacing with external SMS applications. This section contains generic/common SMPP related configuration, and no per-ESME specific parameters. - - + + ESME Configuration This node allows to configure one particular SMPP ESME, which is an External SMS Entity such as a SMS based diff --git a/OsmoNITB/vty/nitb_vty_reference.xml b/OsmoNITB/vty/nitb_vty_reference.xml index 5f49b09..2e30dd6 100644 --- a/OsmoNITB/vty/nitb_vty_reference.xml +++ b/OsmoNITB/vty/nitb_vty_reference.xml @@ -1,7 +1,7 @@ - + - + @@ -202,7 +202,7 @@ - + @@ -233,6 +233,7 @@ + @@ -243,6 +244,13 @@ + + + + + + + @@ -307,6 +315,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -423,6 +459,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -454,10 +521,17 @@ + + + + + + + - + - + @@ -719,7 +793,7 @@ - + @@ -750,6 +824,7 @@ + @@ -760,6 +835,13 @@ + + + + + + + @@ -820,6 +902,13 @@ + + + + + + + @@ -833,6 +922,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -840,6 +963,14 @@ + + + + + + + + @@ -936,6 +1067,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1052,6 +1211,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1092,6 +1282,17 @@ + + + + + + + + + + + @@ -1209,8 +1410,15 @@ + + + + + + + - + @@ -1372,6 +1580,11 @@ + + + + + @@ -1488,11 +1701,6 @@ - - - - - @@ -1513,8 +1721,13 @@ + + + + + - + @@ -1607,7 +1820,7 @@ - + @@ -1638,6 +1851,7 @@ + @@ -1648,6 +1862,13 @@ + + + + + + + @@ -1678,7 +1899,7 @@ - + @@ -1795,7 +2016,7 @@ - + @@ -1863,7 +2084,7 @@ - + @@ -1913,7 +2134,7 @@ - + @@ -1922,6 +2143,7 @@ + @@ -1930,6 +2152,14 @@ + + + + + + + + @@ -1973,7 +2203,56 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1981,7 +2260,7 @@ - + @@ -2096,13 +2375,6 @@ - - - - - - - @@ -2119,6 +2391,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2182,88 +2502,100 @@ - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + @@ -2271,13 +2603,6 @@ - - - - - - - @@ -2297,7 +2622,7 @@ - + @@ -2360,7 +2685,7 @@ - + @@ -2440,33 +2765,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2725,6 +3023,12 @@ + + + + + + @@ -2926,6 +3230,13 @@ + + + + + + + @@ -2954,16 +3265,23 @@ - + - + - + + + + + + + + @@ -3442,6 +3760,12 @@ + + + + + + @@ -3450,12 +3774,19 @@ - + + + + + + + + @@ -3464,8 +3795,14 @@ + + + + + + - + @@ -3523,7 +3860,7 @@ - + @@ -3584,7 +3921,7 @@ - + @@ -3717,7 +4054,7 @@ - + @@ -3782,7 +4119,7 @@ - + @@ -3889,7 +4226,7 @@ - + @@ -3962,7 +4299,7 @@ - + @@ -4045,7 +4382,56 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4078,4 +4464,261 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/3986 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I48edb65be94be56c4b57293d8edc1b30271acc12 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:34:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:34:29 +0000 Subject: [PATCH] osmo-hlr[master]: test_subscriber.ctrl: test against octal/hex interpretation ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4343 to look at the new patch set (#4). test_subscriber.ctrl: test against octal/hex interpretation of id Add a large enough subscriber id and add a test that ensures a leading zero is not interpreted as octal, and that a leading 0x is invalid and not interpreted as hexadecimal. Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173 --- M tests/test_subscriber.ctrl M tests/test_subscriber.sql 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/43/4343/4 diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl index b9be5fe..4cefa4d 100644 --- a/tests/test_subscriber.ctrl +++ b/tests/test_subscriber.ctrl @@ -596,3 +596,19 @@ periodic_lu_timer 0 periodic_rau_tau_timer 0 lmsi 00000000 + +GET 100 subscriber.by-id-00123.info +GET_REPLY 100 subscriber.by-id-00123.info +id 123 +imsi 123123 +msisdn 123 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 101 subscriber.by-id-0x0123.info +ERROR 101 Invalid value part of 'by-xxx-value' selector. diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql index bce0af2..2b6afac 100644 --- a/tests/test_subscriber.sql +++ b/tests/test_subscriber.sql @@ -11,3 +11,7 @@ INSERT INTO subscriber (id, imsi, msisdn) VALUES (3, '901990000000003', '103'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 2342); + +-- A subscriber id > 7 and > 15 to check against octal and hex notations +INSERT INTO subscriber (id, imsi, msisdn) VALUES (123, '123123', '123'); +INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (123, 3, 'BeefedCafeFaceAcedAddedDecadeFee'); -- To view, visit https://gerrit.osmocom.org/4343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173 Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:37:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Oct 2017 15:37:21 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 6: now needs G#4396 -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 6 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:42:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 15:42:31 +0000 Subject: osmo-hlr[master]: cosmetic: tweak params of hlr_controlif_setup() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4396 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63004a7953b04988449697dbc5d55d7ed0c6d82d Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 15:51:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 15:51:20 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 6: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/4311/6/src/ctrl.c File src/ctrl.c: Line 233: aud3g.algo = OSMO_AUTH_ALG_NONE; I'm confused by this part. In case of ENOENT error we will continue with printing auth data to resp. but other errors will result in failure. If that's indeed the intention than it's worth placing a comment here which explains what's so special about ENOENT. Usually all the errors result in the same behavior. Line 258: rc = db_get_auth_data(hlr->dbc, subscr.imsi, &aud2g, &aud3g, NULL); If someone later have to change db-get_auth_data() they got to make sure not to break this special ENOENT case. Maybe place a comment in there? Line 262: aud3g.algo = OSMO_AUTH_ALG_NONE; Same here. Maybe move it to separate inline function? -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 6 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:00:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:00:46 +0000 Subject: [MERGED] libosmocore[master]: stats_test: Extend check to include test for counter group n... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: stats_test: Extend check to include test for counter group name mangling ...................................................................... stats_test: Extend check to include test for counter group name mangling In Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 we introduce name mangling to replace any '.' in counter (group) names to be converted to ':'. Let's test for this functionality explicitly as part of the stats_test. Change-Id: Ie35682aa79526e2ffeab6995cd640b7847d855bf --- M tests/stats/stats_test.c M tests/stats/stats_test.ok 2 files changed, 51 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/stats/stats_test.c b/tests/stats/stats_test.c index 61673ba..59fc449 100644 --- a/tests/stats/stats_test.c +++ b/tests/stats/stats_test.c @@ -47,6 +47,19 @@ .class_id = OSMO_STATS_CLASS_SUBSCRIBER, }; +static const struct rate_ctr_desc ctr_description_dot[] = { + [TEST_A_CTR] = { "ctr.a", "The A counter value with ."}, + [TEST_B_CTR] = { "ctr.b", "The B counter value with ."}, +}; + +static const struct rate_ctr_group_desc ctrg_desc_dot = { + .group_name_prefix = "ctr-test.one_dot", + .group_description = "Counter test number 1dot", + .num_ctr = ARRAY_SIZE(ctr_description_dot), + .ctr_desc = ctr_description_dot, + .class_id = OSMO_STATS_CLASS_SUBSCRIBER, +}; + enum test_items { TEST_A_ITEM, TEST_B_ITEM, @@ -296,7 +309,7 @@ { struct osmo_stats_reporter *srep1, *srep2, *srep; struct osmo_stat_item_group *statg1, *statg2; - struct rate_ctr_group *ctrg1, *ctrg2; + struct rate_ctr_group *ctrg1, *ctrg2, *ctrg3; void *stats_ctx = talloc_named_const(NULL, 1, "stats test context"); int rc; @@ -312,6 +325,8 @@ OSMO_ASSERT(ctrg1 != NULL); ctrg2 = rate_ctr_group_alloc(stats_ctx, &ctrg_desc, 2); OSMO_ASSERT(ctrg2 != NULL); + ctrg3 = rate_ctr_group_alloc(stats_ctx, &ctrg_desc_dot, 3); + OSMO_ASSERT(ctrg3 != NULL); srep1 = stats_reporter_create_test("test1"); OSMO_ASSERT(srep1 != NULL); @@ -339,7 +354,7 @@ printf("report (initial):\n"); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 16); + OSMO_ASSERT(send_count == 20); printf("report (srep1 global):\n"); /* force single flush */ @@ -348,7 +363,7 @@ srep2->force_single_flush = 1; send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 8); + OSMO_ASSERT(send_count == 10); printf("report (srep1 peer):\n"); /* force single flush */ @@ -357,7 +372,7 @@ srep2->force_single_flush = 1; send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 12); + OSMO_ASSERT(send_count == 14); printf("report (srep1 subscriber):\n"); /* force single flush */ @@ -366,7 +381,7 @@ srep2->force_single_flush = 1; send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 16); + OSMO_ASSERT(send_count == 20); printf("report (srep2 disabled):\n"); /* force single flush */ @@ -376,14 +391,14 @@ OSMO_ASSERT(rc >= 0); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 8); + OSMO_ASSERT(send_count == 10); printf("report (srep2 enabled, no flush forced):\n"); rc = osmo_stats_reporter_enable(srep2); OSMO_ASSERT(rc >= 0); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 8); + OSMO_ASSERT(send_count == 10); printf("report (should be empty):\n"); send_count = 0; @@ -410,7 +425,7 @@ rate_ctr_group_free(ctrg1); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 8); + OSMO_ASSERT(send_count == 12); printf("report (remove srep1):\n"); /* force single flush */ @@ -419,7 +434,7 @@ osmo_stats_reporter_free(srep1); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 4); + OSMO_ASSERT(send_count == 6); printf("report (remove statg2):\n"); /* force single flush */ @@ -427,7 +442,7 @@ osmo_stat_item_group_free(statg2); send_count = 0; osmo_stats_report(); - OSMO_ASSERT(send_count == 2); + OSMO_ASSERT(send_count == 4); printf("report (remove srep2):\n"); /* force single flush */ @@ -443,6 +458,8 @@ osmo_stats_report(); OSMO_ASSERT(send_count == 0); + rate_ctr_group_free(ctrg3); + /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); talloc_free(stats_ctx); diff --git a/tests/stats/stats_test.ok b/tests/stats/stats_test.ok index cb9daf2..8628adb 100644 --- a/tests/stats/stats_test.ok +++ b/tests/stats/stats_test.ok @@ -2,6 +2,10 @@ test1: open test2: open report (initial): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 @@ -19,6 +23,8 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 global): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 @@ -28,6 +34,8 @@ test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 peer): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 @@ -41,6 +49,10 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 subscriber): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 @@ -59,6 +71,8 @@ test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 disabled): test2: close + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 @@ -69,6 +83,8 @@ test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 enabled, no flush forced): test2: open + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 @@ -85,6 +101,10 @@ test2: item p= g=test.one i=1 n=item.a v=10 u=ma test1: item p= g=test.one i=1 n=item.a v=10 u=ma report (remove statg1, ctrg1): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 @@ -95,11 +115,15 @@ test1: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove srep1): test1: close + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove statg2): + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one_dot i=3 n=ctr:b v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 report (remove srep2): -- To view, visit https://gerrit.osmocom.org/4132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie35682aa79526e2ffeab6995cd640b7847d855bf Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:00:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:00:46 +0000 Subject: [MERGED] libosmocore[master]: Convert lib-internal rate_ctr from '.' separator to ':' sepa... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Convert lib-internal rate_ctr from '.' separator to ':' separator ...................................................................... Convert lib-internal rate_ctr from '.' separator to ':' separator The rate_ctr.c code would do this mangling automatically, but let's avoid using this from new versions of our code for simplicity/explicitness. Change-Id: I24a556f447cfac25efb6e83cac2d0c2972d98fe3 --- M src/gb/gprs_bssgp.c M src/gb/gprs_ns.c M tests/stats/stats_test.c 3 files changed, 15 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 2552849..b906643 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -43,17 +43,17 @@ void *bssgp_tall_ctx = NULL; static const struct rate_ctr_desc bssgp_ctr_description[] = { - { "packets.in", "Packets at BSSGP Level ( In)" }, - { "packets.out","Packets at BSSGP Level (Out)" }, - { "bytes.in", "Bytes at BSSGP Level ( In)" }, - { "bytes.out", "Bytes at BSSGP Level (Out)" }, + { "packets:in", "Packets at BSSGP Level ( In)" }, + { "packets:out","Packets at BSSGP Level (Out)" }, + { "bytes:in", "Bytes at BSSGP Level ( In)" }, + { "bytes:out", "Bytes at BSSGP Level (Out)" }, { "blocked", "BVC Blocking count" }, { "discarded", "BVC LLC Discarded count" }, { "status", "BVC Status count" }, }; static const struct rate_ctr_group_desc bssgp_ctrg_desc = { - .group_name_prefix = "bssgp.bss_ctx", + .group_name_prefix = "bssgp:bss_ctx", .group_description = "BSSGP Peer Statistics", .num_ctr = ARRAY_SIZE(bssgp_ctr_description), .ctr_desc = bssgp_ctr_description, diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 18d43cc..679b59d 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -115,22 +115,22 @@ }; static const struct rate_ctr_desc nsvc_ctr_description[] = { - { "packets.in", "Packets at NS Level ( In)" }, - { "packets.out","Packets at NS Level (Out)" }, - { "bytes.in", "Bytes at NS Level ( In)" }, - { "bytes.out", "Bytes at NS Level (Out)" }, + { "packets:in", "Packets at NS Level ( In)" }, + { "packets:out","Packets at NS Level (Out)" }, + { "bytes:in", "Bytes at NS Level ( In)" }, + { "bytes:out", "Bytes at NS Level (Out)" }, { "blocked", "NS-VC Block count " }, { "dead", "NS-VC gone dead count " }, { "replaced", "NS-VC replaced other count" }, { "nsei-chg", "NS-VC changed NSEI count " }, { "inv-nsvci", "NS-VCI was invalid count " }, { "inv-nsei", "NSEI was invalid count " }, - { "lost.alive", "ALIVE ACK missing count " }, - { "lost.reset", "RESET ACK missing count " }, + { "lost:alive", "ALIVE ACK missing count " }, + { "lost:reset", "RESET ACK missing count " }, }; static const struct rate_ctr_group_desc nsvc_ctrg_desc = { - .group_name_prefix = "ns.nsvc", + .group_name_prefix = "ns:nsvc", .group_description = "NSVC Peer Statistics", .num_ctr = ARRAY_SIZE(nsvc_ctr_description), .ctr_desc = nsvc_ctr_description, diff --git a/tests/stats/stats_test.c b/tests/stats/stats_test.c index 0234460..61673ba 100644 --- a/tests/stats/stats_test.c +++ b/tests/stats/stats_test.c @@ -35,12 +35,12 @@ }; static const struct rate_ctr_desc ctr_description[] = { - [TEST_A_CTR] = { "ctr.a", "The A counter value"}, - [TEST_B_CTR] = { "ctr.b", "The B counter value"}, + [TEST_A_CTR] = { "ctr:a", "The A counter value"}, + [TEST_B_CTR] = { "ctr:b", "The B counter value"}, }; static const struct rate_ctr_group_desc ctrg_desc = { - .group_name_prefix = "ctr-test.one", + .group_name_prefix = "ctr-test:one", .group_description = "Counter test number 1", .num_ctr = ARRAY_SIZE(ctr_description), .ctr_desc = ctr_description, -- To view, visit https://gerrit.osmocom.org/4131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24a556f447cfac25efb6e83cac2d0c2972d98fe3 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:00:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:00:46 +0000 Subject: [MERGED] libosmocore[master]: rate_ctr: Enforce counter (and ctr_group) names are valid id... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rate_ctr: Enforce counter (and ctr_group) names are valid identifiers ...................................................................... rate_ctr: Enforce counter (and ctr_group) names are valid identifiers As rate counters are automatically exposed on the CTRL interface, we need to make sure they don't contain special characters such as '.' which are not permitted/supported by CTRL. In order to be able to run old versions of osmocom programs with libosmocore versions after this commit, we introduce some special name mangling: Any '.' in the names are replaced with ':' during counter group registration, if valid identifiers can be obtained this way. Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 --- M include/osmocom/core/rate_ctr.h M src/rate_ctr.c M tests/gb/gprs_ns_test.c M tests/stats/stats_test.ok 4 files changed, 161 insertions(+), 45 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/rate_ctr.h b/include/osmocom/core/rate_ctr.h index 74414e9..6ce2dfe 100644 --- a/include/osmocom/core/rate_ctr.h +++ b/include/osmocom/core/rate_ctr.h @@ -48,7 +48,7 @@ /*! The class to which this group belongs */ int class_id; /*! The number of counters in this group */ - const unsigned int num_ctr; + unsigned int num_ctr; /*! Pointer to array of counter names */ const struct rate_ctr_desc *ctr_desc; }; diff --git a/src/rate_ctr.c b/src/rate_ctr.c index a04a776..6de59a0 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -1,4 +1,4 @@ -/* (C) 2009-2010 by Harald Welte +/* (C) 2009-2017 by Harald Welte * * All Rights Reserved * @@ -55,6 +55,7 @@ * * \file rate_ctr.c */ +#include #include #include @@ -63,10 +64,116 @@ #include #include #include +#include static LLIST_HEAD(rate_ctr_groups); static void *tall_rate_ctr_ctx; + + +static bool rate_ctrl_group_desc_validate(const struct rate_ctr_group_desc *desc, bool quiet) +{ + unsigned int i; + const struct rate_ctr_desc *ctr_desc = desc->ctr_desc; + + if (!desc) { + LOGP(DLGLOBAL, LOGL_ERROR, "NULL is not a valid counter group descriptor\n"); + return false; + } + + DEBUGP(DLGLOBAL, "validating counter group %p(%s) with %u counters\n", desc, + desc->group_name_prefix, desc->num_ctr); + + if (!osmo_identifier_valid(desc->group_name_prefix)) { + if (!quiet) + LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter group identifier\n", + desc->group_name_prefix); + return false; + } + + for (i = 0; i < desc->num_ctr; i++) { + if (!osmo_identifier_valid(ctr_desc[i].name)) { + if (!quiet) + LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter identifier\n", + ctr_desc[i].name); + return false; + } + } + + return true; +} + +/* return 'in' if it doesn't contaon any '.'; otherwise allocate a copy and + * replace all '.' with ':' */ +static char *mangle_identifier_ifneeded(const void *ctx, const char *in) +{ + char *out; + unsigned int i; + + if (!in) + return NULL; + + if (!strchr(in, '.')) + return (char *)in; + + out = talloc_strdup(ctx, in); + OSMO_ASSERT(out); + + for (i = 0; i < strlen(out); i++) { + if (out[i] == '.') + out[i] = ':'; + } + + return out; +} + +/* "mangle" a rate counter group descriptor, i.e. replace any '.' with ':' */ +static struct rate_ctr_group_desc * +rate_ctr_group_desc_mangle(void *ctx, const struct rate_ctr_group_desc *desc) +{ + struct rate_ctr_group_desc *desc_new = talloc_zero(ctx, struct rate_ctr_group_desc); + int i; + + OSMO_ASSERT(desc_new); + + /* mangle the name_prefix but copy/keep the rest */ + desc_new->group_name_prefix = mangle_identifier_ifneeded(desc_new, desc->group_name_prefix); + desc_new->group_description = desc->group_description; + desc_new->class_id = desc->class_id; + desc_new->num_ctr = desc->num_ctr; + desc_new->ctr_desc = talloc_array(desc_new, struct rate_ctr_desc, desc_new->num_ctr); + OSMO_ASSERT(desc_new->ctr_desc); + + for (i = 0; i < desc->num_ctr; i++) { + struct rate_ctr_desc *ctrd_new = (struct rate_ctr_desc *) desc_new->ctr_desc; + const struct rate_ctr_desc *ctrd = desc->ctr_desc; + + if (!ctrd[i].name) { + LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s'[%d] == NULL, aborting\n", + desc->group_name_prefix, i); + goto err_free; + } + + ctrd_new[i].name = mangle_identifier_ifneeded(desc_new->ctr_desc, ctrd[i].name); + ctrd_new[i].description = ctrd[i].description; + } + + if (!rate_ctrl_group_desc_validate(desc_new, false)) { + /* simple mangling of identifiers ('.' -> ':') was not sufficient to render a valid + * descriptor, we have to bail out */ + LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s' still invalid after mangling\n", + desc->group_name_prefix); + goto err_free; + } + + LOGP(DLGLOBAL, LOGL_INFO, "Needed to mangle ounter group '%s' names still using '.' as " + "separator, please consider updating the application\n", desc->group_name_prefix); + + return desc_new; +err_free: + talloc_free(desc_new); + return NULL; +} /*! Allocate a new group of counters according to description * \param[in] ctx \ref talloc context @@ -80,6 +187,15 @@ unsigned int size; struct rate_ctr_group *group; + /* attempt to mangle all '.' in identifiers to ':' for backwards compat */ + if (!rate_ctrl_group_desc_validate(desc, true)) { + /* don't use 'ctx' here as it would screw up memory leak debugging e.g. + * in osmo-msc */ + desc = rate_ctr_group_desc_mangle(NULL, desc); + if (!desc) + return NULL; + } + size = sizeof(struct rate_ctr_group) + desc->num_ctr * sizeof(struct rate_ctr); diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c index 0bbf943..fac3c36 100644 --- a/tests/gb/gprs_ns_test.c +++ b/tests/gb/gprs_ns_test.c @@ -261,7 +261,7 @@ for (i = 0; i < ctrg->desc->num_ctr; i++) { struct rate_ctr *ctr = &ctrg->ctr[i]; - if (ctr->current && !strchr(ctrg->desc->ctr_desc[i].name, '.')) + if (ctr->current && !strchr(ctrg->desc->ctr_desc[i].name, ':')) fprintf(stream, " %s%s: %llu%s", prefix, ctrg->desc->ctr_desc[i].description, (long long)ctr->current, diff --git a/tests/stats/stats_test.ok b/tests/stats/stats_test.ok index a0c001b..cb9daf2 100644 --- a/tests/stats/stats_test.ok +++ b/tests/stats/stats_test.ok @@ -2,14 +2,14 @@ test1: open test2: open report (initial): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -19,19 +19,19 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 global): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 peer): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -41,14 +41,14 @@ test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 subscriber): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -59,49 +59,49 @@ test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 disabled): test2: close - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.a v=-1 u=ma test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 enabled, no flush forced): test2: open - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (should be empty): report (group 1, counter 1 update): - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=1 d=1 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=1 d=1 report (group 1, item 1 update): test2: item p= g=test.one i=1 n=item.a v=10 u=ma test1: item p= g=test.one i=1 n=item.a v=10 u=ma report (remove statg1, ctrg1): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test1: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove srep1): test1: close - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove statg2): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 report (remove srep2): test2: close report (remove ctrg2, should be empty): -- To view, visit https://gerrit.osmocom.org/4130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:00:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:00:47 +0000 Subject: [MERGED] libosmocore[master]: fsm: Enforce FSM and FSM instance names are valid osmocom id... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fsm: Enforce FSM and FSM instance names are valid osmocom identifiers ...................................................................... fsm: Enforce FSM and FSM instance names are valid osmocom identifiers Let's enforce that the names of FSMs and their instances are valid osmocom identifiers. This is important as the FSMs are automatically exported via those names on the CTRL inteface, and we have to make sure CTRL syntax actually permits them. Change-Id: I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 --- M src/fsm.c 1 file changed, 12 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/fsm.c b/src/fsm.c index d62fd79..3f8de9c 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -146,6 +146,10 @@ */ int osmo_fsm_register(struct osmo_fsm *fsm) { + if (!osmo_identifier_valid(fsm->name)) { + LOGP(DLGLOBAL, LOGL_ERROR, "Attempting to register FSM with illegal identifier '%s'\n", fsm->name); + return -EINVAL; + } if (osmo_fsm_find_by_name(fsm->name)) return -EEXIST; llist_add_tail(&fsm->list, &osmo_g_fsms); @@ -206,8 +210,15 @@ fi->priv = priv; fi->log_level = log_level; osmo_timer_setup(&fi->timer, fsm_tmr_cb, fi); - if (id) + if (id) { + if (!osmo_identifier_valid(id)) { + LOGP(DLGLOBAL, LOGL_ERROR, "Attempting to allocate FSM instance of type '%s'" + " with illegal identifier '%s'\n", fsm->name, id); + talloc_free(fi); + return NULL; + } fi->id = talloc_strdup(fi, id); + } if (!fsm_log_addr) { if (id) -- To view, visit https://gerrit.osmocom.org/4129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:00:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:00:47 +0000 Subject: [MERGED] libosmocore[master]: Introduce osmo_identifier_valid() function to check validity... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Introduce osmo_identifier_valid() function to check validity of identifier ...................................................................... Introduce osmo_identifier_valid() function to check validity of identifier We define the notion of an 'osmocom identifier' which is basically a 7-bit US-ASCII without any special characters beyond "-_:@". We introduce a function to verify if an identifier consists only of the permitted characters. Change-Id: I96a8d345c5a69238a12d040f39b70c485a5c421c --- M include/osmocom/core/utils.h M src/utils.c 2 files changed, 31 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 4b083f6..c5cc138 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -22,6 +22,7 @@ /*! Number of bytes necessary to store given BITS */ #define OSMO_BYTES_FOR_BITS(BITS) ((BITS + 8 - 1) / 8) +#include #include #include @@ -112,4 +113,6 @@ bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, bool require_even); +bool osmo_identifier_valid(const char *str); + /*! @} */ diff --git a/src/utils.c b/src/utils.c index 534916b..ef8e916 100644 --- a/src/utils.c +++ b/src/utils.c @@ -22,6 +22,7 @@ */ +#include #include #include #include @@ -411,6 +412,33 @@ return false; if (require_even && (len & 1)) return false; + + return true; +} + +/*! Determine if a given identifier is valid, i.e. doesn't contain illegal chars + * \param[in] str String to validate + * \returns true in case string contains valid identifier, false otherwise + */ +bool osmo_identifier_valid(const char *str) +{ + /* characters that are illegal in names */ + static const char illegal_chars[] = "., {}[]()<>|~\\^`'\"?=;/+*&%$#!"; + unsigned int i; + + /* an empty string is not a valid identifier */ + if (!str || strlen(str) == 0) + return false; + + for (i = 0; i < strlen(str); i++) { + /* check for 7-bit ASCII */ + if (str[i] & 0x80) + return false; + /* check for some explicit reserved control characters */ + if (strchr(illegal_chars, str[i])) + return false; + } + return true; } -- To view, visit https://gerrit.osmocom.org/4128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I96a8d345c5a69238a12d040f39b70c485a5c421c Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:01:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:01:12 +0000 Subject: osmo-gsm-manuals[master]: OsmoHLR: update ctrl description and examples In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4da6115bb2eb005a9f95bf4de1bfe36468fd607 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:01:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:01:23 +0000 Subject: osmo-gsm-manuals[master]: OsmoHLR: add make target to update the example ctrl and vty ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4392 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I88027396ec15101697a79aa5e964387d47abdae2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:01:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:01:26 +0000 Subject: osmo-gsm-manuals[master]: refactor Makefile build rules, don't use the FORCE In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 7 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:01:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:01:57 +0000 Subject: osmo-hlr[master]: cosmetic: tweak params of hlr_controlif_setup() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4396 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63004a7953b04988449697dbc5d55d7ed0c6d82d Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:02:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:02:25 +0000 Subject: osmo-hlr[master]: test_subscriber.ctrl: test against octal/hex interpretation ... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173 Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:07:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:07:25 +0000 Subject: libosmocore[master]: Prefer bitvec_set_u64() over bitvec_set_uint() In-Reply-To: References: Message-ID: Patch Set 5: Code-Review-1 I don't really see the gain of this exercise. -- To view, visit https://gerrit.osmocom.org/4338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fd8d17f9fa6c51ef51f4294882cca5944d71df2 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:10:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 16:10:32 +0000 Subject: [ABANDON] libosmocore[master]: Prefer bitvec_set_u64() over bitvec_set_uint() In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Prefer bitvec_set_u64() over bitvec_set_uint() ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I2fd8d17f9fa6c51ef51f4294882cca5944d71df2 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:20:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 16:20:06 +0000 Subject: [PATCH] libosmocore[master]: GPRS: add vty command to show only persistent NS Message-ID: Review at https://gerrit.osmocom.org/4397 GPRS: add vty command to show only persistent NS The regular 'sh ns' lists all available NS. Sometimes it's handy to know which of those are persistent. * add "show ns persistent" command * adjust parameters of dump-ns*() functions to use bool where appropriate Change-Id: Ib812864bae3ea414cc107a7b4f49bea4e6161795 --- M src/gb/gprs_ns_vty.c 1 file changed, 23 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/4397/1 diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index c6fb141..a3f7b2b 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -156,8 +156,12 @@ return CMD_SUCCESS; } -static void dump_nse(struct vty *vty, struct gprs_nsvc *nsvc, int stats) +static void dump_nse(struct vty *vty, struct gprs_nsvc *nsvc, bool stats, bool persistent_only) { + if (persistent_only) + if (!nsvc->persistent) + return; + vty_out(vty, "NSEI %5u, NS-VC %5u, %5s %9s, ", nsvc->nsei, nsvc->nsvci, NS_DESC_A(nsvc->state), @@ -182,7 +186,7 @@ } } -static void dump_ns(struct vty *vty, struct gprs_ns_inst *nsi, int stats) +static void dump_ns(struct vty *vty, struct gprs_ns_inst *nsi, bool stats, bool persistent_only) { struct gprs_nsvc *nsvc; struct in_addr ia; @@ -198,7 +202,7 @@ llist_for_each_entry(nsvc, &nsi->gprs_nsvcs, list) { if (nsvc == nsi->unknown_nsvc) continue; - dump_nse(vty, nsvc, stats); + dump_nse(vty, nsvc, stats, persistent_only); } } @@ -206,7 +210,7 @@ SHOW_STR "Display information about the NS protocol") { struct gprs_ns_inst *nsi = vty_nsi; - dump_ns(vty, nsi, 0); + dump_ns(vty, nsi, false, false); return CMD_SUCCESS; } @@ -216,7 +220,17 @@ "Include statistics\n") { struct gprs_ns_inst *nsi = vty_nsi; - dump_ns(vty, nsi, 1); + dump_ns(vty, nsi, true, false); + return CMD_SUCCESS; +} + +DEFUN(show_ns_pers, show_ns_pers_cmd, "show ns persistent", + SHOW_STR + "Display information about the NS protocol\n" + "Show only persistent NS\n") +{ + struct gprs_ns_inst *nsi = vty_nsi; + dump_ns(vty, nsi, true, true); return CMD_SUCCESS; } @@ -230,7 +244,7 @@ struct gprs_ns_inst *nsi = vty_nsi; struct gprs_nsvc *nsvc; uint16_t id = atoi(argv[1]); - int show_stats = 0; + bool show_stats = false; if (!strcmp(argv[0], "nsei")) nsvc = gprs_nsvc_by_nsei(nsi, id); @@ -243,9 +257,9 @@ } if (argc >= 3) - show_stats = 1; + show_stats = true; - dump_nse(vty, nsvc, show_stats); + dump_nse(vty, nsvc, show_stats, false); return CMD_SUCCESS; } @@ -594,6 +608,7 @@ install_element_ve(&show_ns_cmd); install_element_ve(&show_ns_stats_cmd); + install_element_ve(&show_ns_pers_cmd); install_element_ve(&show_nse_cmd); install_element_ve(&logging_fltr_nsvc_cmd); -- To view, visit https://gerrit.osmocom.org/4397 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib812864bae3ea414cc107a7b4f49bea4e6161795 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:20:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 24 Oct 2017 16:20:07 +0000 Subject: [PATCH] libosmocore[master]: GPRS: constify NS printing routine parameters Message-ID: Review at https://gerrit.osmocom.org/4398 GPRS: constify NS printing routine parameters Change-Id: I549ab7c26ac1489e01f281594bafe44b0681dc83 --- M include/osmocom/gprs/gprs_ns.h M src/gb/gprs_ns.c M src/gb/gprs_ns_vty.c 3 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/98/4398/1 diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 4fb9f58..b368ad9 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -194,7 +194,7 @@ int gprs_ns_vty_init(struct gprs_ns_inst *nsi); /* Resturn peer info as string (NOTE: the buffer is allocated statically) */ -const char *gprs_ns_ll_str(struct gprs_nsvc *nsvc); +const char *gprs_ns_ll_str(const struct gprs_nsvc *nsvc); /* Copy the link layer info from other into nsvc */ void gprs_ns_ll_copy(struct gprs_nsvc *nsvc, struct gprs_nsvc *other); diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 18d43cc..d4db522 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1170,7 +1170,7 @@ return rc; } -const char *gprs_ns_ll_str(struct gprs_nsvc *nsvc) +const char *gprs_ns_ll_str(const struct gprs_nsvc *nsvc) { static char buf[80]; diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index a3f7b2b..e8ef2a2 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -156,7 +156,7 @@ return CMD_SUCCESS; } -static void dump_nse(struct vty *vty, struct gprs_nsvc *nsvc, bool stats, bool persistent_only) +static void dump_nse(struct vty *vty, const struct gprs_nsvc *nsvc, bool stats, bool persistent_only) { if (persistent_only) if (!nsvc->persistent) @@ -186,7 +186,7 @@ } } -static void dump_ns(struct vty *vty, struct gprs_ns_inst *nsi, bool stats, bool persistent_only) +static void dump_ns(struct vty *vty, const struct gprs_ns_inst *nsi, bool stats, bool persistent_only) { struct gprs_nsvc *nsvc; struct in_addr ia; -- To view, visit https://gerrit.osmocom.org/4398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I549ab7c26ac1489e01f281594bafe44b0681dc83 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:23:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:23:19 +0000 Subject: [PATCH] osmo-bsc[master]: Fix nanobts_omlattr unit test Message-ID: Review at https://gerrit.osmocom.org/4399 Fix nanobts_omlattr unit test The test clearly fails unless bts->network is set correctly. Not sure why this hasn't shown up before? Change-Id: I47786ed06ff610213d7a0b56d0ebf1c537cd7568 --- M tests/nanobts_omlattr/nanobts_omlattr_test.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/99/4399/1 diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index 3b5429c..3c81e43 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -199,6 +199,7 @@ gsm_bts_model_register(&bts_model_nanobts); bts = gsm_bts_alloc_register(net, GSM_BTS_TYPE_NANOBTS, 63); OSMO_ASSERT(bts); + bts->network = net; trx = talloc_zero(ctx, struct gsm_bts_trx); /* Parameters needed by nanobts_attr_bts_get() */ -- To view, visit https://gerrit.osmocom.org/4399 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I47786ed06ff610213d7a0b56d0ebf1c537cd7568 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:23:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:23:19 +0000 Subject: [PATCH] osmo-bsc[master]: nanobts_omlattra_test: Initialize logging before executing t... Message-ID: Review at https://gerrit.osmocom.org/4400 nanobts_omlattra_test: Initialize logging before executing tests ... the library code we call could want to log something, after all. Change-Id: Ic01e9bfb63d7b6def9432103e744c23c90f0f6b9 --- M tests/nanobts_omlattr/nanobts_omlattr_test.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/00/4400/1 diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index 3c81e43..cdb37a3 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -191,6 +191,9 @@ struct gsm_network *net; struct gsm_bts_trx *trx; + osmo_init_logging(&log_info); + log_set_log_level(osmo_stderr_target, LOGL_INFO); + ctx = talloc_named_const(NULL, 0, "ctx"); /* Allocate environmental structs (bts, net, trx) */ -- To view, visit https://gerrit.osmocom.org/4400 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic01e9bfb63d7b6def9432103e744c23c90f0f6b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:23:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:23:20 +0000 Subject: [PATCH] osmo-bsc[master]: WIP: Move most counter from per-BSC to per-BTS level Message-ID: Review at https://gerrit.osmocom.org/4401 WIP: Move most counter from per-BSC to per-BTS level Operators want to see statistics for each BTS, not just cumulative for all BTS/cells/sites. Change-Id: I34356cb5a62b09b7ddcb4194c33e4db4560743e1 --- M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libbsc/paging.c M src/libcommon/gsm_data.c 8 files changed, 80 insertions(+), 54 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/01/4401/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 51b2c98..5b2c5b4 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -223,49 +223,57 @@ enum { - BSC_CTR_CHREQ_TOTAL, - BSC_CTR_CHREQ_NO_CHANNEL, - BSC_CTR_HANDOVER_ATTEMPTED, - BSC_CTR_HANDOVER_NO_CHANNEL, - BSC_CTR_HANDOVER_TIMEOUT, - BSC_CTR_HANDOVER_COMPLETED, - BSC_CTR_HANDOVER_FAILED, + BTS_CTR_CHREQ_TOTAL, + BTS_CTR_CHREQ_NO_CHANNEL, + BTS_CTR_HANDOVER_ATTEMPTED, + BTS_CTR_HANDOVER_NO_CHANNEL, + BTS_CTR_HANDOVER_TIMEOUT, + BTS_CTR_HANDOVER_COMPLETED, + BTS_CTR_HANDOVER_FAILED, + BTS_CTR_PAGING_ATTEMPTED, + BTS_CTR_PAGING_COMPLETED, + BTS_CTR_PAGING_EXPIRED, + BTS_CTR_CHAN_RF_FAIL, + BTS_CTR_CHAN_RLL_ERR, + BTS_CTR_BTS_OML_FAIL, + BTS_CTR_BTS_RSL_FAIL, + BTS_CTR_CODEC_AMR_F, + BTS_CTR_CODEC_AMR_H, + BTS_CTR_CODEC_EFR, + BTS_CTR_CODEC_V1_FR, + BTS_CTR_CODEC_V1_HR, +}; + +static const struct rate_ctr_desc bts_ctr_description[] = { + [BTS_CTR_CHREQ_TOTAL] = {"chreq.total", "Received channel requests."}, + [BTS_CTR_CHREQ_NO_CHANNEL] = {"chreq.no_channel", "Sent to MS no channel available."}, + [BTS_CTR_HANDOVER_ATTEMPTED] = {"handover.attempted", "Received handover attempts."}, + [BTS_CTR_HANDOVER_NO_CHANNEL] = {"handover.no_channel", "Sent no channel available responses."}, + [BTS_CTR_HANDOVER_TIMEOUT] = {"handover.timeout", "Count the amount of timeouts of timer T3103."}, + [BTS_CTR_HANDOVER_COMPLETED] = {"handover.completed", "Received handover completed."}, + [BTS_CTR_HANDOVER_FAILED] = {"handover.failed", "Receive HO FAIL messages."}, + [BTS_CTR_PAGING_ATTEMPTED] = {"paging.attempted", "Paging attempts for a MS."}, + [BTS_CTR_PAGING_COMPLETED] = {"paging.completed", "Paging successful completed."}, + [BTS_CTR_PAGING_EXPIRED] = {"paging.expired", "Paging Request expired because of timeout T3113."}, + [BTS_CTR_CHAN_RF_FAIL] = {"chan.rf_fail", "Received a RF failure indication from BTS."}, + [BTS_CTR_CHAN_RLL_ERR] = {"chan.rll_err", "Received a RLL failure with T200 cause from BTS."}, + [BTS_CTR_BTS_OML_FAIL] = {"oml_fail", "Received a TEI down on a OML link."}, + [BTS_CTR_BTS_RSL_FAIL] = {"rsl_fail", "Received a TEI down on a OML link."}, + [BTS_CTR_CODEC_AMR_F] = {"codec.amr_f", "Count the usage of AMR/F codec by channel mode requested."}, + [BTS_CTR_CODEC_AMR_H] = {"codec.amr_h", "Count the usage of AMR/H codec by channel mode requested."}, + [BTS_CTR_CODEC_EFR] = {"codec.efr", "Count the usage of EFR codec by channel mode requested."}, + [BTS_CTR_CODEC_V1_FR] = {"codec.fr", "Count the usage of FR codec by channel mode requested."}, + [BTS_CTR_CODEC_V1_HR] = {"codec.hr", "Count the usage of HR codec by channel mode requested."}, +}; + +enum { BSC_CTR_PAGING_ATTEMPTED, BSC_CTR_PAGING_DETACHED, - BSC_CTR_PAGING_COMPLETED, - BSC_CTR_PAGING_EXPIRED, - BSC_CTR_CHAN_RF_FAIL, - BSC_CTR_CHAN_RLL_ERR, - BSC_CTR_BTS_OML_FAIL, - BSC_CTR_BTS_RSL_FAIL, - BSC_CTR_CODEC_AMR_F, - BSC_CTR_CODEC_AMR_H, - BSC_CTR_CODEC_EFR, - BSC_CTR_CODEC_V1_FR, - BSC_CTR_CODEC_V1_HR, }; static const struct rate_ctr_desc bsc_ctr_description[] = { - [BSC_CTR_CHREQ_TOTAL] = {"chreq.total", "Received channel requests."}, - [BSC_CTR_CHREQ_NO_CHANNEL] = {"chreq.no_channel", "Sent to MS no channel available."}, - [BSC_CTR_HANDOVER_ATTEMPTED] = {"handover.attempted", "Received handover attempts."}, - [BSC_CTR_HANDOVER_NO_CHANNEL] = {"handover.no_channel", "Sent no channel available responses."}, - [BSC_CTR_HANDOVER_TIMEOUT] = {"handover.timeout", "Count the amount of timeouts of timer T3103."}, - [BSC_CTR_HANDOVER_COMPLETED] = {"handover.completed", "Received handover completed."}, - [BSC_CTR_HANDOVER_FAILED] = {"handover.failed", "Receive HO FAIL messages."}, [BSC_CTR_PAGING_ATTEMPTED] = {"paging.attempted", "Paging attempts for a MS."}, [BSC_CTR_PAGING_DETACHED] = {"paging.detached", "Counts the amount of paging attempts which couldn't sent out any paging request because no responsible bts found."}, - [BSC_CTR_PAGING_COMPLETED] = {"paging.completed", "Paging successful completed."}, - [BSC_CTR_PAGING_EXPIRED] = {"paging.expired", "Paging Request expired because of timeout T3113."}, - [BSC_CTR_CHAN_RF_FAIL] = {"chan.rf_fail", "Received a RF failure indication from BTS."}, - [BSC_CTR_CHAN_RLL_ERR] = {"chan.rll_err", "Received a RLL failure with T200 cause from BTS."}, - [BSC_CTR_BTS_OML_FAIL] = {"bts.oml_fail", "Received a TEI down on a OML link."}, - [BSC_CTR_BTS_RSL_FAIL] = {"bts.rsl_fail", "Received a TEI down on a OML link."}, - [BSC_CTR_CODEC_AMR_F] = {"bts.codec_amr_f", "Count the usage of AMR/F codec by channel mode requested."}, - [BSC_CTR_CODEC_AMR_H] = {"bts.codec_amr_h", "Count the usage of AMR/H codec by channel mode requested."}, - [BSC_CTR_CODEC_EFR] = {"bts.codec_efr", "Count the usage of EFR codec by channel mode requested."}, - [BSC_CTR_CODEC_V1_FR] = {"bts.codec_fr", "Count the usage of FR codec by channel mode requested."}, - [BSC_CTR_CODEC_V1_HR] = {"bts.codec_hr", "Count the usage of HR codec by channel mode requested."}, }; enum { @@ -314,6 +322,14 @@ }; +static const struct rate_ctr_group_desc bts_ctrg_desc = { + "bts", + "base station", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(bts_ctr_description), + bts_ctr_description, +}; + static const struct rate_ctr_group_desc bsc_ctrg_desc = { "bsc", "base station controller", diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 240be1c..a26c368 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -847,6 +848,8 @@ int force_combined_si; int bcch_change_mark; + struct rate_ctr_group *bts_ctrs; + #ifdef ROLE_BSC /* Abis NM queue */ struct llist_head abis_queue; diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 9968602..fbaaf09 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -91,10 +91,10 @@ if (lchan->type == GSM_LCHAN_TCH_H) { switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_AMR: - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_CODEC_AMR_H]); + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CODEC_AMR_H]); break; case GSM48_CMODE_SPEECH_V1: - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_CODEC_V1_HR]); + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CODEC_V1_HR]); break; default: break; @@ -102,13 +102,13 @@ } else if (lchan->type == GSM_LCHAN_TCH_F) { switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_AMR: - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_CODEC_AMR_F]); + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CODEC_AMR_F]); break; case GSM48_CMODE_SPEECH_V1: - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_CODEC_V1_FR]); + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CODEC_V1_FR]); break; case GSM48_CMODE_SPEECH_EFR: - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_CODEC_EFR]); + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CODEC_EFR]); break; default: break; @@ -1366,7 +1366,7 @@ TLVP_LEN(&tp, RSL_IE_CAUSE)); LOGPC(DRSL, LOGL_NOTICE, "\n"); - rate_ctr_inc(&msg->lchan->ts->trx->bts->network->bsc_ctrs->ctr[BSC_CTR_CHAN_RF_FAIL]); + rate_ctr_inc(&msg->lchan->ts->trx->bts->bts_ctrs->ctr[BTS_CTR_CHAN_RF_FAIL]); return rsl_rf_chan_release_err(msg->lchan); } @@ -1872,7 +1872,7 @@ * request reference RA */ lctype = get_ctype_by_chreq(bts->network, rqd_ref->ra); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_CHREQ_TOTAL]); + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CHREQ_TOTAL]); /* * We want LOCATION UPDATES to succeed and will assign a TCH @@ -1885,7 +1885,7 @@ if (!lchan) { LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s 0x%x\n", msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_CHREQ_NO_CHANNEL]); + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CHREQ_NO_CHANNEL]); /* FIXME gather multiple CHAN RQD and reject up to 4 at the same time */ if (bts->network->T3122) rsl_send_imm_ass_rej(bts, 1, rqd_ref, bts->network->T3122 & 0xff); @@ -2082,7 +2082,7 @@ rll_indication(msg->lchan, rllh->link_id, BSC_RLLR_IND_ERR_IND); if (rlm_cause == RLL_CAUSE_T200_EXPIRED) { - rate_ctr_inc(&msg->lchan->ts->trx->bts->network->bsc_ctrs->ctr[BSC_CTR_CHAN_RLL_ERR]); + rate_ctr_inc(&msg->lchan->ts->trx->bts->bts_ctrs->ctr[BTS_CTR_CHAN_RLL_ERR]); return rsl_rf_chan_release_err(msg->lchan); } diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index 674813c..df83665 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -398,9 +398,9 @@ LOGP(DLMI, LOGL_ERROR, "Lost some E1 TEI link: %d %p\n", isd->link_type, trx); if (isd->link_type == E1INP_SIGN_OML) - rate_ctr_inc(&trx->bts->network->bsc_ctrs->ctr[BSC_CTR_BTS_OML_FAIL]); + rate_ctr_inc(&trx->bts->bts_ctrs->ctr[BTS_CTR_BTS_OML_FAIL]); else if (isd->link_type == E1INP_SIGN_RSL) - rate_ctr_inc(&trx->bts->network->bsc_ctrs->ctr[BSC_CTR_BTS_RSL_FAIL]); + rate_ctr_inc(&trx->bts->bts_ctrs->ctr[BTS_CTR_BTS_RSL_FAIL]); /* * free all allocated channels. change the nm_state so the diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 461e3d3..19d89cd 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -3769,6 +3769,7 @@ void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net) { +#if 0 vty_out(vty, "Channel Requests : %"PRIu64" total, %"PRIu64" no channel%s", net->bsc_ctrs->ctr[BSC_CTR_CHREQ_TOTAL].current, net->bsc_ctrs->ctr[BSC_CTR_CHREQ_NO_CHANNEL].current, @@ -3786,6 +3787,7 @@ net->bsc_ctrs->ctr[BSC_CTR_BTS_OML_FAIL].current, net->bsc_ctrs->ctr[BSC_CTR_BTS_RSL_FAIL].current, VTY_NEWLINE); +#endif } DEFUN(drop_bts, diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index ace8ac3..5152fec 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -105,7 +105,7 @@ "(old_lchan on BTS %u, new BTS %u) ...\n", old_lchan->ts->trx->bts->nr, bts->nr); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_HANDOVER_ATTEMPTED]); if (!old_lchan->conn) { LOGP(DHO, LOGL_ERROR, "Old lchan lacks connection data.\n"); @@ -115,7 +115,7 @@ new_lchan = lchan_alloc(bts, old_lchan->type, 0); if (!new_lchan) { LOGP(DHO, LOGL_NOTICE, "No free channel\n"); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]); + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_HANDOVER_NO_CHANNEL]); return -ENOSPC; } @@ -190,7 +190,7 @@ struct gsm_network *net = ho->new_lchan->ts->trx->bts->network; DEBUGP(DHO, "HO T3103 expired\n"); - rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT]); + rate_ctr_inc(&ho->new_lchan->ts->trx->bts->bts_ctrs->ctr[BTS_CTR_HANDOVER_TIMEOUT]); ho->new_lchan->conn->ho_lchan = NULL; ho->new_lchan->conn = NULL; @@ -266,7 +266,7 @@ ho->old_lchan->ts->trx->bts->nr, new_lchan->ts->trx->bts->nr, ho->old_lchan->ts->trx->arfcn, new_lchan->ts->trx->arfcn); - rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED]); + rate_ctr_inc(&new_lchan->ts->trx->bts->bts_ctrs->ctr[BTS_CTR_HANDOVER_COMPLETED]); osmo_timer_del(&ho->T3103); @@ -305,10 +305,10 @@ return -ENODEV; } - rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED]); - new_lchan = ho->new_lchan; + rate_ctr_inc(&new_lchan->ts->trx->bts->bts_ctrs->ctr[BTS_CTR_HANDOVER_FAILED]); + /* release the channel and forget about it */ ho->new_lchan->conn->ho_lchan = NULL; ho->new_lchan->conn = NULL; diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c index b8f9043..f763d73 100644 --- a/src/libbsc/paging.c +++ b/src/libbsc/paging.c @@ -269,7 +269,7 @@ req, bsc_subscr_name(req->bsub)); /* must be destroyed before calling cbfn, to prevent double free */ - rate_ctr_inc(&req->bts->network->bsc_ctrs->ctr[BSC_CTR_PAGING_EXPIRED]); + rate_ctr_inc(&req->bts->bts_ctrs->ctr[BTS_CTR_PAGING_EXPIRED]); cbfn_param = req->cbfn_param; cbfn = req->cbfn; @@ -297,6 +297,8 @@ return -EEXIST; } + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_PAGING_ATTEMPTED]); + LOGP(DPAG, LOGL_DEBUG, "Start paging of subscriber %s on bts %d.\n", bsc_subscr_name(bsub), bts->nr); req = talloc_zero(tall_paging_ctx, struct gsm_paging_request); diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index e085aa6..b1001f5 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -301,6 +301,9 @@ INIT_LLIST_HEAD(&bts->loc_list); + bts->bts_ctrs = rate_ctr_group_alloc(bts, &bts_ctrg_desc, 0); + OSMO_ASSERT(bts->bts_ctrs); + return bts; } -- To view, visit https://gerrit.osmocom.org/4401 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I34356cb5a62b09b7ddcb4194c33e4db4560743e1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:23:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:23:20 +0000 Subject: [PATCH] osmo-bsc[master]: osmo-bsc: Initialize logging before initializing rate_ctr Message-ID: Review at https://gerrit.osmocom.org/4402 osmo-bsc: Initialize logging before initializing rate_ctr The library code for rate counter initialization, which is called from the descendants of bsc_network_alloc() might already want to log something (particularly after Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f --- M src/osmo-bsc/osmo_bsc_main.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/02/4402/1 diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 5e8f45e..730e1db 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -196,15 +196,15 @@ tall_bsc_ctx = talloc_named_const(NULL, 1, "openbsc"); msgb_talloc_ctx_init(tall_bsc_ctx, 0); + osmo_init_logging(&log_info); + osmo_stats_init(tall_bsc_ctx); + /* Allocate global gsm_network struct */ rc = bsc_network_alloc(NULL); if (rc) { fprintf(stderr, "Allocation failed. exiting.\n"); exit(1); } - - osmo_init_logging(&log_info); - osmo_stats_init(tall_bsc_ctx); bts_init(); libosmo_abis_init(tall_bsc_ctx); -- To view, visit https://gerrit.osmocom.org/4402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:23:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:23:20 +0000 Subject: [PATCH] osmo-bsc[master]: Rename osmo_fsm to avoid illegal space in name + more meanin... Message-ID: Review at https://gerrit.osmocom.org/4403 Rename osmo_fsm to avoid illegal space in name + more meaningful name A FSM doesn't need "FSM" in its name, as it is obvious that it is a FSM. Also, having two that are called RESET is confusing, so let's try to come up with better names. Also, after Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 in libosmocore, we now enforce that no FSM identifiers contain spaces or other illegal characters. Change-Id: I1b44d26cebc4a47094d7b8b3983e5737b88bf003 --- M src/libcommon-cs/a_reset.c M src/osmo-bsc/osmo_bsc_reset.c 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/03/4403/1 diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index c40bc41..f08d813 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -124,7 +124,7 @@ /* State machine definition */ static struct osmo_fsm fsm = { - .name = "FSM RESET", + .name = "A-RESET", .states = fsm_states, .num_states = ARRAY_SIZE(fsm_states), .log_subsys = DMSC, @@ -149,7 +149,7 @@ reset->cb = cb; strncpy(reset->name, name, sizeof(reset->name)); reset->conn_loss_counter = 0; - reset->fsm = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, "FSM RESET INST"); + reset->fsm = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, NULL); OSMO_ASSERT(reset->fsm); reset->fsm->priv = reset; LOGP(DMSC, LOGL_NOTICE, "(%s) reset handler fsm created.\n", reset->name); diff --git a/src/osmo-bsc/osmo_bsc_reset.c b/src/osmo-bsc/osmo_bsc_reset.c index d28f548..aadbd86 100644 --- a/src/osmo-bsc/osmo_bsc_reset.c +++ b/src/osmo-bsc/osmo_bsc_reset.c @@ -124,7 +124,7 @@ /* State machine definition */ static struct osmo_fsm fsm = { - .name = "FSM RESET", + .name = "A-CONNECTION", .states = fsm_states, .num_states = ARRAY_SIZE(fsm_states), .log_subsys = DMSC, @@ -138,7 +138,7 @@ OSMO_ASSERT(msc->msc_con); osmo_fsm_register(&fsm); - msc->msc_con->fsm_reset = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, "FSM RESET INST"); + msc->msc_con->fsm_reset = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, NULL); OSMO_ASSERT(msc->msc_con->fsm_reset); msc->msc_con->fsm_reset->priv = msc; -- To view, visit https://gerrit.osmocom.org/4403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1b44d26cebc4a47094d7b8b3983e5737b88bf003 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:24:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:24:02 +0000 Subject: [ABANDON] osmo-bsc[master]: WIP: Move most counter from per-BSC to per-BTS level In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: WIP: Move most counter from per-BSC to per-BTS level ...................................................................... Abandoned not ready yet, accidential push -- To view, visit https://gerrit.osmocom.org/4401 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I34356cb5a62b09b7ddcb4194c33e4db4560743e1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:24:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:24:30 +0000 Subject: osmo-bsc[master]: Rename osmo_fsm to avoid illegal space in name + more meanin... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b44d26cebc4a47094d7b8b3983e5737b88bf003 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:31:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:31:58 +0000 Subject: osmo-bsc[master]: Fix nanobts_omlattr unit test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4399 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I47786ed06ff610213d7a0b56d0ebf1c537cd7568 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:32:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:32:08 +0000 Subject: osmo-bsc[master]: nanobts_omlattra_test: Initialize logging before executing t... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4400 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic01e9bfb63d7b6def9432103e744c23c90f0f6b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:32:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:32:17 +0000 Subject: osmo-bsc[master]: osmo-bsc: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:32:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:32:23 +0000 Subject: [MERGED] osmo-bsc[master]: osmo-bsc: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bsc: Initialize logging before initializing rate_ctr ...................................................................... osmo-bsc: Initialize logging before initializing rate_ctr The library code for rate counter initialization, which is called from the descendants of bsc_network_alloc() might already want to log something (particularly after Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f --- M src/osmo-bsc/osmo_bsc_main.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 5e8f45e..730e1db 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -196,15 +196,15 @@ tall_bsc_ctx = talloc_named_const(NULL, 1, "openbsc"); msgb_talloc_ctx_init(tall_bsc_ctx, 0); + osmo_init_logging(&log_info); + osmo_stats_init(tall_bsc_ctx); + /* Allocate global gsm_network struct */ rc = bsc_network_alloc(NULL); if (rc) { fprintf(stderr, "Allocation failed. exiting.\n"); exit(1); } - - osmo_init_logging(&log_info); - osmo_stats_init(tall_bsc_ctx); bts_init(); libosmo_abis_init(tall_bsc_ctx); -- To view, visit https://gerrit.osmocom.org/4402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:32:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:32:23 +0000 Subject: [MERGED] osmo-bsc[master]: nanobts_omlattra_test: Initialize logging before executing t... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: nanobts_omlattra_test: Initialize logging before executing tests ...................................................................... nanobts_omlattra_test: Initialize logging before executing tests ... the library code we call could want to log something, after all. Change-Id: Ic01e9bfb63d7b6def9432103e744c23c90f0f6b9 --- M tests/nanobts_omlattr/nanobts_omlattr_test.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index 3c81e43..cdb37a3 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -191,6 +191,9 @@ struct gsm_network *net; struct gsm_bts_trx *trx; + osmo_init_logging(&log_info); + log_set_log_level(osmo_stderr_target, LOGL_INFO); + ctx = talloc_named_const(NULL, 0, "ctx"); /* Allocate environmental structs (bts, net, trx) */ -- To view, visit https://gerrit.osmocom.org/4400 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic01e9bfb63d7b6def9432103e744c23c90f0f6b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:32:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:32:23 +0000 Subject: [MERGED] osmo-bsc[master]: Fix nanobts_omlattr unit test In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix nanobts_omlattr unit test ...................................................................... Fix nanobts_omlattr unit test The test clearly fails unless bts->network is set correctly. Not sure why this hasn't shown up before? Change-Id: I47786ed06ff610213d7a0b56d0ebf1c537cd7568 --- M tests/nanobts_omlattr/nanobts_omlattr_test.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index 3b5429c..3c81e43 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -199,6 +199,7 @@ gsm_bts_model_register(&bts_model_nanobts); bts = gsm_bts_alloc_register(net, GSM_BTS_TYPE_NANOBTS, 63); OSMO_ASSERT(bts); + bts->network = net; trx = talloc_zero(ctx, struct gsm_bts_trx); /* Parameters needed by nanobts_attr_bts_get() */ -- To view, visit https://gerrit.osmocom.org/4399 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I47786ed06ff610213d7a0b56d0ebf1c537cd7568 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:32:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:32:24 +0000 Subject: [MERGED] osmo-bsc[master]: Rename osmo_fsm to avoid illegal space in name + more meanin... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Rename osmo_fsm to avoid illegal space in name + more meaningful name ...................................................................... Rename osmo_fsm to avoid illegal space in name + more meaningful name A FSM doesn't need "FSM" in its name, as it is obvious that it is a FSM. Also, having two that are called RESET is confusing, so let's try to come up with better names. Also, after Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 in libosmocore, we now enforce that no FSM identifiers contain spaces or other illegal characters. Change-Id: I1b44d26cebc4a47094d7b8b3983e5737b88bf003 --- M src/libcommon-cs/a_reset.c M src/osmo-bsc/osmo_bsc_reset.c 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index c40bc41..f08d813 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -124,7 +124,7 @@ /* State machine definition */ static struct osmo_fsm fsm = { - .name = "FSM RESET", + .name = "A-RESET", .states = fsm_states, .num_states = ARRAY_SIZE(fsm_states), .log_subsys = DMSC, @@ -149,7 +149,7 @@ reset->cb = cb; strncpy(reset->name, name, sizeof(reset->name)); reset->conn_loss_counter = 0; - reset->fsm = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, "FSM RESET INST"); + reset->fsm = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, NULL); OSMO_ASSERT(reset->fsm); reset->fsm->priv = reset; LOGP(DMSC, LOGL_NOTICE, "(%s) reset handler fsm created.\n", reset->name); diff --git a/src/osmo-bsc/osmo_bsc_reset.c b/src/osmo-bsc/osmo_bsc_reset.c index d28f548..aadbd86 100644 --- a/src/osmo-bsc/osmo_bsc_reset.c +++ b/src/osmo-bsc/osmo_bsc_reset.c @@ -124,7 +124,7 @@ /* State machine definition */ static struct osmo_fsm fsm = { - .name = "FSM RESET", + .name = "A-CONNECTION", .states = fsm_states, .num_states = ARRAY_SIZE(fsm_states), .log_subsys = DMSC, @@ -138,7 +138,7 @@ OSMO_ASSERT(msc->msc_con); osmo_fsm_register(&fsm); - msc->msc_con->fsm_reset = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, "FSM RESET INST"); + msc->msc_con->fsm_reset = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, NULL); OSMO_ASSERT(msc->msc_con->fsm_reset); msc->msc_con->fsm_reset->priv = msc; -- To view, visit https://gerrit.osmocom.org/4403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1b44d26cebc4a47094d7b8b3983e5737b88bf003 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:32:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:32:51 +0000 Subject: libosmocore[master]: GPRS: add vty command to show only persistent NS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4397 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib812864bae3ea414cc107a7b4f49bea4e6161795 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:34:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:34:39 +0000 Subject: libosmocore[master]: GPRS: constify NS printing routine parameters In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I549ab7c26ac1489e01f281594bafe44b0681dc83 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:34:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:34:41 +0000 Subject: [MERGED] libosmocore[master]: GPRS: constify NS printing routine parameters In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GPRS: constify NS printing routine parameters ...................................................................... GPRS: constify NS printing routine parameters Change-Id: I549ab7c26ac1489e01f281594bafe44b0681dc83 --- M include/osmocom/gprs/gprs_ns.h M src/gb/gprs_ns.c M src/gb/gprs_ns_vty.c 3 files changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 4fb9f58..b368ad9 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -194,7 +194,7 @@ int gprs_ns_vty_init(struct gprs_ns_inst *nsi); /* Resturn peer info as string (NOTE: the buffer is allocated statically) */ -const char *gprs_ns_ll_str(struct gprs_nsvc *nsvc); +const char *gprs_ns_ll_str(const struct gprs_nsvc *nsvc); /* Copy the link layer info from other into nsvc */ void gprs_ns_ll_copy(struct gprs_nsvc *nsvc, struct gprs_nsvc *other); diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 679b59d..a00c8e5 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1170,7 +1170,7 @@ return rc; } -const char *gprs_ns_ll_str(struct gprs_nsvc *nsvc) +const char *gprs_ns_ll_str(const struct gprs_nsvc *nsvc) { static char buf[80]; diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index a3f7b2b..e8ef2a2 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -156,7 +156,7 @@ return CMD_SUCCESS; } -static void dump_nse(struct vty *vty, struct gprs_nsvc *nsvc, bool stats, bool persistent_only) +static void dump_nse(struct vty *vty, const struct gprs_nsvc *nsvc, bool stats, bool persistent_only) { if (persistent_only) if (!nsvc->persistent) @@ -186,7 +186,7 @@ } } -static void dump_ns(struct vty *vty, struct gprs_ns_inst *nsi, bool stats, bool persistent_only) +static void dump_ns(struct vty *vty, const struct gprs_ns_inst *nsi, bool stats, bool persistent_only) { struct gprs_nsvc *nsvc; struct in_addr ia; -- To view, visit https://gerrit.osmocom.org/4398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I549ab7c26ac1489e01f281594bafe44b0681dc83 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:34:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:34:41 +0000 Subject: [MERGED] libosmocore[master]: GPRS: add vty command to show only persistent NS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GPRS: add vty command to show only persistent NS ...................................................................... GPRS: add vty command to show only persistent NS The regular 'sh ns' lists all available NS. Sometimes it's handy to know which of those are persistent. * add "show ns persistent" command * adjust parameters of dump-ns*() functions to use bool where appropriate Change-Id: Ib812864bae3ea414cc107a7b4f49bea4e6161795 --- M src/gb/gprs_ns_vty.c 1 file changed, 23 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index c6fb141..a3f7b2b 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -156,8 +156,12 @@ return CMD_SUCCESS; } -static void dump_nse(struct vty *vty, struct gprs_nsvc *nsvc, int stats) +static void dump_nse(struct vty *vty, struct gprs_nsvc *nsvc, bool stats, bool persistent_only) { + if (persistent_only) + if (!nsvc->persistent) + return; + vty_out(vty, "NSEI %5u, NS-VC %5u, %5s %9s, ", nsvc->nsei, nsvc->nsvci, NS_DESC_A(nsvc->state), @@ -182,7 +186,7 @@ } } -static void dump_ns(struct vty *vty, struct gprs_ns_inst *nsi, int stats) +static void dump_ns(struct vty *vty, struct gprs_ns_inst *nsi, bool stats, bool persistent_only) { struct gprs_nsvc *nsvc; struct in_addr ia; @@ -198,7 +202,7 @@ llist_for_each_entry(nsvc, &nsi->gprs_nsvcs, list) { if (nsvc == nsi->unknown_nsvc) continue; - dump_nse(vty, nsvc, stats); + dump_nse(vty, nsvc, stats, persistent_only); } } @@ -206,7 +210,7 @@ SHOW_STR "Display information about the NS protocol") { struct gprs_ns_inst *nsi = vty_nsi; - dump_ns(vty, nsi, 0); + dump_ns(vty, nsi, false, false); return CMD_SUCCESS; } @@ -216,7 +220,17 @@ "Include statistics\n") { struct gprs_ns_inst *nsi = vty_nsi; - dump_ns(vty, nsi, 1); + dump_ns(vty, nsi, true, false); + return CMD_SUCCESS; +} + +DEFUN(show_ns_pers, show_ns_pers_cmd, "show ns persistent", + SHOW_STR + "Display information about the NS protocol\n" + "Show only persistent NS\n") +{ + struct gprs_ns_inst *nsi = vty_nsi; + dump_ns(vty, nsi, true, true); return CMD_SUCCESS; } @@ -230,7 +244,7 @@ struct gprs_ns_inst *nsi = vty_nsi; struct gprs_nsvc *nsvc; uint16_t id = atoi(argv[1]); - int show_stats = 0; + bool show_stats = false; if (!strcmp(argv[0], "nsei")) nsvc = gprs_nsvc_by_nsei(nsi, id); @@ -243,9 +257,9 @@ } if (argc >= 3) - show_stats = 1; + show_stats = true; - dump_nse(vty, nsvc, show_stats); + dump_nse(vty, nsvc, show_stats, false); return CMD_SUCCESS; } @@ -594,6 +608,7 @@ install_element_ve(&show_ns_cmd); install_element_ve(&show_ns_stats_cmd); + install_element_ve(&show_ns_pers_cmd); install_element_ve(&show_nse_cmd); install_element_ve(&logging_fltr_nsvc_cmd); -- To view, visit https://gerrit.osmocom.org/4397 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib812864bae3ea414cc107a7b4f49bea4e6161795 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:37:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:37:19 +0000 Subject: [PATCH] libosmocore[master]: rate_ctr: Fix null pointer dereference in error path Message-ID: Review at https://gerrit.osmocom.org/4404 rate_ctr: Fix null pointer dereference in error path In Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 we introduced a variable de-reference before we check if it's NULL. Let's reorder the statements to avoid this. Fixes: Coverity CID#178219 Change-Id: I99265a7ee76f85c479543c19ce8c05ce5d43ae69 --- M src/rate_ctr.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/04/4404/1 diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 6de59a0..296cc16 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -74,12 +74,13 @@ static bool rate_ctrl_group_desc_validate(const struct rate_ctr_group_desc *desc, bool quiet) { unsigned int i; - const struct rate_ctr_desc *ctr_desc = desc->ctr_desc; + const struct rate_ctr_desc *ctr_desc; if (!desc) { LOGP(DLGLOBAL, LOGL_ERROR, "NULL is not a valid counter group descriptor\n"); return false; } + ctr_desc = desc->ctr_desc; DEBUGP(DLGLOBAL, "validating counter group %p(%s) with %u counters\n", desc, desc->group_name_prefix, desc->num_ctr); -- To view, visit https://gerrit.osmocom.org/4404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I99265a7ee76f85c479543c19ce8c05ce5d43ae69 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:46:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:46:19 +0000 Subject: [PATCH] osmo-bts[master]: Fix Downlink AMR FSM name to avoid illegal space character Message-ID: Review at https://gerrit.osmocom.org/4405 Fix Downlink AMR FSM name to avoid illegal space character Since libosmocore Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 we enforce that FSM names do not contain illegal characteers such as spaces. Let's change the DL TX FSM for AMR to comply to this. Also, actually do check the result of the FSM registration. Change-Id: Ieccd1dc32c0faf5e544d17daca4a417d1d168c21 --- M src/common/bts.c M src/common/dtx_dl_amr_fsm.c 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/05/4405/1 diff --git a/src/common/bts.c b/src/common/bts.c index cb5284d..6747f50 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -180,7 +180,9 @@ INIT_LLIST_HEAD(&btsb->oml_queue); /* register DTX DL FSM */ - osmo_fsm_register(&dtx_dl_amr_fsm); + rc = osmo_fsm_register(&dtx_dl_amr_fsm); + OSMO_ASSERT(rc == 0); + return rc; } diff --git a/src/common/dtx_dl_amr_fsm.c b/src/common/dtx_dl_amr_fsm.c index d599048..38e22c9 100644 --- a/src/common/dtx_dl_amr_fsm.c +++ b/src/common/dtx_dl_amr_fsm.c @@ -469,7 +469,7 @@ }; struct osmo_fsm dtx_dl_amr_fsm = { - .name = "DTX DL AMR FSM", + .name = "DTX_DL_AMR_FSM", .states = dtx_dl_amr_fsm_states, .num_states = ARRAY_SIZE(dtx_dl_amr_fsm_states), .event_names = dtx_dl_amr_fsm_event_names, -- To view, visit https://gerrit.osmocom.org/4405 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieccd1dc32c0faf5e544d17daca4a417d1d168c21 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:46:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:46:27 +0000 Subject: osmo-bts[master]: Fix Downlink AMR FSM name to avoid illegal space character In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4405 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieccd1dc32c0faf5e544d17daca4a417d1d168c21 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:46:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:46:32 +0000 Subject: libosmocore[master]: rate_ctr: Fix null pointer dereference in error path In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99265a7ee76f85c479543c19ce8c05ce5d43ae69 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 24 16:46:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 16:46:34 +0000 Subject: [MERGED] libosmocore[master]: rate_ctr: Fix null pointer dereference in error path In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rate_ctr: Fix null pointer dereference in error path ...................................................................... rate_ctr: Fix null pointer dereference in error path In Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 we introduced a variable de-reference before we check if it's NULL. Let's reorder the statements to avoid this. Fixes: Coverity CID#178219 Change-Id: I99265a7ee76f85c479543c19ce8c05ce5d43ae69 --- M src/rate_ctr.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 6de59a0..296cc16 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -74,12 +74,13 @@ static bool rate_ctrl_group_desc_validate(const struct rate_ctr_group_desc *desc, bool quiet) { unsigned int i; - const struct rate_ctr_desc *ctr_desc = desc->ctr_desc; + const struct rate_ctr_desc *ctr_desc; if (!desc) { LOGP(DLGLOBAL, LOGL_ERROR, "NULL is not a valid counter group descriptor\n"); return false; } + ctr_desc = desc->ctr_desc; DEBUGP(DLGLOBAL, "validating counter group %p(%s) with %u counters\n", desc, desc->group_name_prefix, desc->num_ctr); -- To view, visit https://gerrit.osmocom.org/4404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I99265a7ee76f85c479543c19ce8c05ce5d43ae69 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 24 17:01:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Oct 2017 17:01:20 +0000 Subject: [MERGED] osmo-bts[master]: Fix Downlink AMR FSM name to avoid illegal space character In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix Downlink AMR FSM name to avoid illegal space character ...................................................................... Fix Downlink AMR FSM name to avoid illegal space character Since libosmocore Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 we enforce that FSM names do not contain illegal characteers such as spaces. Let's change the DL TX FSM for AMR to comply to this. Also, actually do check the result of the FSM registration. Change-Id: Ieccd1dc32c0faf5e544d17daca4a417d1d168c21 --- M src/common/bts.c M src/common/dtx_dl_amr_fsm.c 2 files changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/bts.c b/src/common/bts.c index cb5284d..6747f50 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -180,7 +180,9 @@ INIT_LLIST_HEAD(&btsb->oml_queue); /* register DTX DL FSM */ - osmo_fsm_register(&dtx_dl_amr_fsm); + rc = osmo_fsm_register(&dtx_dl_amr_fsm); + OSMO_ASSERT(rc == 0); + return rc; } diff --git a/src/common/dtx_dl_amr_fsm.c b/src/common/dtx_dl_amr_fsm.c index d599048..38e22c9 100644 --- a/src/common/dtx_dl_amr_fsm.c +++ b/src/common/dtx_dl_amr_fsm.c @@ -469,7 +469,7 @@ }; struct osmo_fsm dtx_dl_amr_fsm = { - .name = "DTX DL AMR FSM", + .name = "DTX_DL_AMR_FSM", .states = dtx_dl_amr_fsm_states, .num_states = ARRAY_SIZE(dtx_dl_amr_fsm_states), .event_names = dtx_dl_amr_fsm_event_names, -- To view, visit https://gerrit.osmocom.org/4405 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieccd1dc32c0faf5e544d17daca4a417d1d168c21 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Tue Oct 24 19:55:14 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 19:55:14 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59ef9abc7dfc9_40867bef801694578@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_8.0/x86_64 Package network:osmocom:nightly/libosmocore failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 258s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 258s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 258s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 258s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 258s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 258s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 258s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 258s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 258s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 258s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 258s] -Success [ 258s] ./testsuite.at:69: exit code was 132, expected 0 [ 258s] 11. testsuite.at:66: 11. coding (testsuite.at:66): FAILED (testsuite.at:69) [ 258s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 258s] make[1]: *** [override_dh_auto_test] Error 1 [ 258s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 258s] debian/rules:15: recipe for target 'build' failed [ 258s] make: *** [build] Error 2 [ 258s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 258s] [ 258s] build32 failed "build libosmocore_0.9.6.20171024.dsc" at Tue Oct 24 19:55:03 UTC 2017. [ 258s] [ 258s] ### VM INTERACTION START ### [ 259s] Powering off. [ 259s] [ 248.726163] reboot: Power down [ 260s] ### VM INTERACTION END ### [ 260s] [ 260s] build32 failed "build libosmocore_0.9.6.20171024.dsc" at Tue Oct 24 19:55:06 UTC 2017. [ 260s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 19:56:40 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 19:56:40 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59ef9afb7e4d8_40867bef801695272@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 138s] Subject: [osmo-pcu 0.3.0.20171024] testsuite: 2 3 5 6 7 8 11 failed [ 138s] [ 138s] You may investigate any problem if you feel able to do so, in which [ 138s] case the test suite provides a good starting point. Its output may [ 138s] be found below `tests/testsuite.dir'. [ 138s] [ 138s] Makefile:1208: recipe for target 'check-local' failed [ 138s] make[3]: *** [check-local] Error 1 [ 138s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 138s] Makefile:1044: recipe for target 'check-am' failed [ 138s] make[2]: *** [check-am] Error 2 [ 138s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 138s] Makefile:448: recipe for target 'check-recursive' failed [ 138s] make[1]: *** [check-recursive] Error 1 [ 138s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 138s] dh_auto_test: make -j1 check returned exit code 2 [ 138s] debian/rules:12: recipe for target 'build' failed [ 138s] make: *** [build] Error 2 [ 138s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 138s] [ 138s] lamb07 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:56:26 UTC 2017. [ 138s] [ 138s] ### VM INTERACTION START ### [ 139s] Powering off. [ 139s] [ 132.049004] reboot: Power down [ 139s] ### VM INTERACTION END ### [ 139s] [ 139s] lamb07 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:56:27 UTC 2017. [ 139s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 19:57:31 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 19:57:31 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59ef9b39531c8_40867bef8016955bd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 144s] To: [ 144s] Subject: [osmo-pcu 0.3.0.20171024] testsuite: 2 3 5 6 7 8 11 failed [ 144s] [ 144s] You may investigate any problem if you feel able to do so, in which [ 144s] case the test suite provides a good starting point. Its output may [ 144s] be found below `tests/testsuite.dir'. [ 144s] [ 144s] Makefile:1221: recipe for target 'check-local' failed [ 144s] make[3]: *** [check-local] Error 1 [ 144s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 144s] Makefile:1055: recipe for target 'check-am' failed [ 144s] make[2]: *** [check-am] Error 2 [ 144s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 144s] Makefile:460: recipe for target 'check-recursive' failed [ 144s] make[1]: *** [check-recursive] Error 1 [ 144s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 144s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 144s] debian/rules:12: recipe for target 'build' failed [ 144s] make: *** [build] Error 2 [ 144s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 144s] [ 144s] lamb03 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:57:23 UTC 2017. [ 144s] [ 144s] ### VM INTERACTION START ### [ 147s] [ 139.932118] reboot: Power down [ 147s] ### VM INTERACTION END ### [ 147s] [ 147s] lamb03 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:57:26 UTC 2017. [ 147s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 19:57:48 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 19:57:48 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59ef9b52c24ed_40867bef8016956ea@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 85s] bssgp_nsi->nsip.remote_port = sgsn_port; [ 85s] ^ [ 85s] gprs_bssgp_pcu.cpp:900:18: error: 'struct gprs_ns_inst::' has no member named 'remote_ip' [ 85s] bssgp_nsi->nsip.remote_ip = sgsn_ip; [ 85s] ^ [ 85s] gprs_bssgp_pcu.cpp: At global scope: [ 85s] gprs_bssgp_pcu.cpp:77:12: warning: 'int parse_ra_cap(tlv_parsed*, MS_Radio_Access_capability_t*)' defined but not used [-Wunused-function] [ 85s] static int parse_ra_cap(struct tlv_parsed *tp, MS_Radio_Access_capability_t *rac) [ 85s] ^ [ 85s] Makefile:765: recipe for target 'gprs_bssgp_pcu.lo' failed [ 85s] make[2]: *** [gprs_bssgp_pcu.lo] Error 1 [ 85s] make[2]: Leaving directory '/usr/src/packages/BUILD/src' [ 85s] Makefile:448: recipe for target 'all-recursive' failed [ 85s] make[1]: *** [all-recursive] Error 1 [ 85s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 85s] dh_auto_build: make -j1 returned exit code 2 [ 85s] debian/rules:12: recipe for target 'build' failed [ 85s] make: *** [build] Error 2 [ 85s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 85s] [ 85s] lamb01 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:57:32 UTC 2017. [ 85s] [ 85s] ### VM INTERACTION START ### [ 87s] Powering off. [ 87s] [ 79.725563] reboot: Power down [ 87s] ### VM INTERACTION END ### [ 87s] [ 87s] lamb01 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:57:34 UTC 2017. [ 87s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 19:58:05 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 19:58:05 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59ef9b544b9f9_40867bef8016957d5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 148s] To: [ 148s] Subject: [osmo-pcu 0.3.0.20171024] testsuite: 2 3 5 6 7 8 11 failed [ 148s] [ 148s] You may investigate any problem if you feel able to do so, in which [ 148s] case the test suite provides a good starting point. Its output may [ 148s] be found below `tests/testsuite.dir'. [ 148s] [ 148s] Makefile:1221: recipe for target 'check-local' failed [ 148s] make[3]: *** [check-local] Error 1 [ 148s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 148s] Makefile:1055: recipe for target 'check-am' failed [ 148s] make[2]: *** [check-am] Error 2 [ 148s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 148s] Makefile:460: recipe for target 'check-recursive' failed [ 148s] make[1]: *** [check-recursive] Error 1 [ 148s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 148s] dh_auto_test: make -j1 check returned exit code 2 [ 148s] debian/rules:12: recipe for target 'build' failed [ 148s] make: *** [build] Error 2 [ 148s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 148s] [ 148s] lamb70 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:57:50 UTC 2017. [ 148s] [ 148s] ### VM INTERACTION START ### [ 152s] [ 144.778141] reboot: Power down [ 152s] ### VM INTERACTION END ### [ 152s] [ 152s] lamb70 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:57:54 UTC 2017. [ 152s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 19:58:22 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 19:58:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59ef9b737be96_40867bef8016958a3@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 191s] To: [ 191s] Subject: [osmo-pcu 0.3.0.20171024] testsuite: 2 3 5 6 7 8 11 failed [ 191s] [ 191s] You may investigate any problem if you feel able to do so, in which [ 191s] case the test suite provides a good starting point. Its output may [ 191s] be found below `tests/testsuite.dir'. [ 191s] [ 191s] Makefile:1221: recipe for target 'check-local' failed [ 191s] make[3]: *** [check-local] Error 1 [ 191s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 191s] Makefile:1055: recipe for target 'check-am' failed [ 191s] make[2]: *** [check-am] Error 2 [ 191s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 191s] Makefile:460: recipe for target 'check-recursive' failed [ 191s] make[1]: *** [check-recursive] Error 1 [ 191s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 191s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 191s] debian/rules:12: recipe for target 'build' failed [ 191s] make: *** [build] Error 2 [ 191s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 192s] [ 192s] lamb59 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:58:04 UTC 2017. [ 192s] [ 192s] ### VM INTERACTION START ### [ 195s] [ 187.074538] reboot: Power down [ 195s] ### VM INTERACTION END ### [ 195s] [ 195s] lamb59 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:58:08 UTC 2017. [ 195s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 19:58:22 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 19:58:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59ef9b744ea82_40867bef80169607a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 162s] To: [ 162s] Subject: [osmo-pcu 0.3.0.20171024] testsuite: 2 3 5 6 7 8 11 failed [ 162s] [ 162s] You may investigate any problem if you feel able to do so, in which [ 162s] case the test suite provides a good starting point. Its output may [ 162s] be found below `tests/testsuite.dir'. [ 162s] [ 162s] Makefile:1221: recipe for target 'check-local' failed [ 162s] make[3]: *** [check-local] Error 1 [ 162s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 162s] Makefile:1055: recipe for target 'check-am' failed [ 162s] make[2]: *** [check-am] Error 2 [ 162s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 162s] Makefile:460: recipe for target 'check-recursive' failed [ 162s] make[1]: *** [check-recursive] Error 1 [ 162s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 162s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 162s] debian/rules:12: recipe for target 'build' failed [ 162s] make: *** [build] Error 2 [ 162s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 162s] [ 162s] lamb07 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:58:05 UTC 2017. [ 162s] [ 162s] ### VM INTERACTION START ### [ 165s] [ 156.973934] reboot: Power down [ 165s] ### VM INTERACTION END ### [ 165s] [ 165s] lamb07 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:58:09 UTC 2017. [ 165s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 19:58:40 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 19:58:40 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59ef9b7625315_40867bef80169619f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 239s] To: [ 239s] Subject: [osmo-pcu 0.3.0.20171024] testsuite: 2 3 5 6 7 8 11 failed [ 239s] [ 239s] You may investigate any problem if you feel able to do so, in which [ 239s] case the test suite provides a good starting point. Its output may [ 239s] be found below `tests/testsuite.dir'. [ 239s] [ 239s] Makefile:1221: recipe for target 'check-local' failed [ 239s] make[3]: *** [check-local] Error 1 [ 239s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 239s] Makefile:1055: recipe for target 'check-am' failed [ 239s] make[2]: *** [check-am] Error 2 [ 239s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 239s] Makefile:460: recipe for target 'check-recursive' failed [ 239s] make[1]: *** [check-recursive] Error 1 [ 239s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 239s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 239s] debian/rules:12: recipe for target 'build' failed [ 239s] make: *** [build] Error 2 [ 239s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 239s] [ 239s] lamb22 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:58:28 UTC 2017. [ 239s] [ 239s] ### VM INTERACTION START ### [ 243s] [ 231.116903] reboot: Power down [ 243s] ### VM INTERACTION END ### [ 243s] [ 243s] lamb22 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:58:31 UTC 2017. [ 243s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 19:58:57 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 19:58:57 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59ef9b908fbb9_40867bef8016962f7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 178s] To: [ 178s] Subject: [osmo-pcu 0.3.0.20171024] testsuite: 2 3 5 6 7 8 11 failed [ 178s] [ 178s] You may investigate any problem if you feel able to do so, in which [ 178s] case the test suite provides a good starting point. Its output may [ 178s] be found below `tests/testsuite.dir'. [ 178s] [ 178s] Makefile:1221: recipe for target 'check-local' failed [ 178s] make[3]: *** [check-local] Error 1 [ 178s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 178s] Makefile:1055: recipe for target 'check-am' failed [ 178s] make[2]: *** [check-am] Error 2 [ 178s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 178s] Makefile:460: recipe for target 'check-recursive' failed [ 178s] make[1]: *** [check-recursive] Error 1 [ 178s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 178s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 178s] debian/rules:12: recipe for target 'build' failed [ 178s] make: *** [build] Error 2 [ 178s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 178s] [ 178s] lamb53 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:58:48 UTC 2017. [ 178s] [ 178s] ### VM INTERACTION START ### [ 181s] [ 173.539099] reboot: Power down [ 181s] ### VM INTERACTION END ### [ 181s] [ 181s] lamb53 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:58:51 UTC 2017. [ 181s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 19:59:48 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 19:59:48 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59ef9bd1e6203_40867bef801696485@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 138s] To: [ 138s] Subject: [osmo-pcu 0.3.0.20171024] testsuite: 2 3 5 6 7 8 11 failed [ 138s] [ 138s] You may investigate any problem if you feel able to do so, in which [ 138s] case the test suite provides a good starting point. Its output may [ 138s] be found below `tests/testsuite.dir'. [ 138s] [ 138s] Makefile:1221: recipe for target 'check-local' failed [ 138s] make[3]: *** [check-local] Error 1 [ 138s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 138s] Makefile:1055: recipe for target 'check-am' failed [ 138s] make[2]: *** [check-am] Error 2 [ 138s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 138s] Makefile:460: recipe for target 'check-recursive' failed [ 138s] make[1]: *** [check-recursive] Error 1 [ 138s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 138s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 138s] debian/rules:12: recipe for target 'build' failed [ 138s] make: *** [build] Error 2 [ 138s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 138s] [ 138s] lamb76 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:59:36 UTC 2017. [ 138s] [ 138s] ### VM INTERACTION START ### [ 141s] [ 133.348340] reboot: Power down [ 141s] ### VM INTERACTION END ### [ 141s] [ 141s] lamb76 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:59:39 UTC 2017. [ 141s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 19:59:48 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 19:59:48 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59ef9bd2b12a3_40867bef80169659c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 151s] To: [ 151s] Subject: [osmo-pcu 0.3.0.20171024] testsuite: 2 3 5 6 7 8 11 failed [ 151s] [ 151s] You may investigate any problem if you feel able to do so, in which [ 151s] case the test suite provides a good starting point. Its output may [ 151s] be found below `tests/testsuite.dir'. [ 151s] [ 151s] Makefile:1221: recipe for target 'check-local' failed [ 151s] make[3]: *** [check-local] Error 1 [ 151s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 151s] Makefile:1055: recipe for target 'check-am' failed [ 151s] make[2]: *** [check-am] Error 2 [ 151s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 151s] Makefile:460: recipe for target 'check-recursive' failed [ 151s] make[1]: *** [check-recursive] Error 1 [ 151s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 151s] dh_auto_test: make -j1 check returned exit code 2 [ 151s] debian/rules:12: recipe for target 'build' failed [ 151s] make: *** [build] Error 2 [ 151s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 151s] [ 151s] lamb01 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:59:40 UTC 2017. [ 151s] [ 151s] ### VM INTERACTION START ### [ 154s] [ 147.615692] reboot: Power down [ 154s] ### VM INTERACTION END ### [ 154s] [ 154s] lamb01 failed "build osmo-pcu_0.3.0.20171024.dsc" at Tue Oct 24 19:59:43 UTC 2017. [ 154s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:04:22 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:04:22 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59ef9cdbd91ee_40867bef801698256@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 187s] [ 187s] Makefile:758: recipe for target 'check-local' failed [ 187s] make[5]: *** [check-local] Error 1 [ 187s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 187s] Makefile:608: recipe for target 'check-am' failed [ 187s] make[4]: *** [check-am] Error 2 [ 187s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 187s] Makefile:460: recipe for target 'check-recursive' failed [ 187s] make[3]: *** [check-recursive] Error 1 [ 187s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 187s] Makefile:527: recipe for target 'check-recursive' failed [ 187s] make[2]: *** [check-recursive] Error 1 [ 187s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 187s] Makefile:818: recipe for target 'check' failed [ 187s] make[1]: *** [check] Error 2 [ 187s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 187s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 187s] debian/rules:13: recipe for target 'build' failed [ 187s] make: *** [build] Error 2 [ 187s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 187s] [ 187s] lamb16 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:04:03 UTC 2017. [ 187s] [ 187s] ### VM INTERACTION START ### [ 190s] [ 183.616667] reboot: Power down [ 190s] ### VM INTERACTION END ### [ 190s] [ 190s] lamb16 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:04:06 UTC 2017. [ 190s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:07:15 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:07:15 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59ef9d91434b6_40867bef801699184@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 193s] [ 193s] Makefile:758: recipe for target 'check-local' failed [ 193s] make[5]: *** [check-local] Error 1 [ 193s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 193s] Makefile:608: recipe for target 'check-am' failed [ 193s] make[4]: *** [check-am] Error 2 [ 193s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 193s] Makefile:460: recipe for target 'check-recursive' failed [ 193s] make[3]: *** [check-recursive] Error 1 [ 193s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 193s] Makefile:527: recipe for target 'check-recursive' failed [ 193s] make[2]: *** [check-recursive] Error 1 [ 193s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 193s] Makefile:818: recipe for target 'check' failed [ 193s] make[1]: *** [check] Error 2 [ 193s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 193s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 193s] debian/rules:13: recipe for target 'build' failed [ 193s] make: *** [build] Error 2 [ 193s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 193s] [ 193s] build34 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:07:02 UTC 2017. [ 193s] [ 193s] ### VM INTERACTION START ### [ 197s] [ 188.578196] reboot: Power down [ 197s] ### VM INTERACTION END ### [ 197s] [ 197s] build34 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:07:05 UTC 2017. [ 197s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:07:31 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:07:31 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59ef9d91dcc33_40867bef801699267@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 217s] [ 217s] Makefile:758: recipe for target 'check-local' failed [ 217s] make[5]: *** [check-local] Error 1 [ 217s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 217s] Makefile:608: recipe for target 'check-am' failed [ 217s] make[4]: *** [check-am] Error 2 [ 217s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 217s] Makefile:460: recipe for target 'check-recursive' failed [ 217s] make[3]: *** [check-recursive] Error 1 [ 217s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 217s] Makefile:527: recipe for target 'check-recursive' failed [ 217s] make[2]: *** [check-recursive] Error 1 [ 217s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 217s] Makefile:818: recipe for target 'check' failed [ 217s] make[1]: *** [check] Error 2 [ 217s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 217s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 217s] debian/rules:13: recipe for target 'build' failed [ 217s] make: *** [build] Error 2 [ 217s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 217s] [ 217s] lamb06 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:07:24 UTC 2017. [ 217s] [ 217s] ### VM INTERACTION START ### [ 220s] [ 212.125702] reboot: Power down [ 220s] ### VM INTERACTION END ### [ 220s] [ 220s] lamb06 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:07:28 UTC 2017. [ 220s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:07:31 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:07:31 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59ef9d923b2f1_40867bef80169934d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 176s] [ 176s] Makefile:758: recipe for target 'check-local' failed [ 176s] make[5]: *** [check-local] Error 1 [ 176s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 176s] Makefile:608: recipe for target 'check-am' failed [ 176s] make[4]: *** [check-am] Error 2 [ 176s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 176s] Makefile:460: recipe for target 'check-recursive' failed [ 176s] make[3]: *** [check-recursive] Error 1 [ 176s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 176s] Makefile:527: recipe for target 'check-recursive' failed [ 176s] make[2]: *** [check-recursive] Error 1 [ 176s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 176s] Makefile:818: recipe for target 'check' failed [ 176s] make[1]: *** [check] Error 2 [ 176s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 176s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 176s] debian/rules:13: recipe for target 'build' failed [ 176s] make: *** [build] Error 2 [ 176s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 176s] [ 176s] lamb15 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:07:25 UTC 2017. [ 176s] [ 176s] ### VM INTERACTION START ### [ 180s] [ 172.134949] reboot: Power down [ 180s] ### VM INTERACTION END ### [ 180s] [ 180s] lamb15 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:07:29 UTC 2017. [ 180s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:08:05 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:08:05 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59ef9daf1b7ec_40867bef80169994@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 208s] [ 208s] Makefile:758: recipe for target 'check-local' failed [ 208s] make[5]: *** [check-local] Error 1 [ 208s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 208s] Makefile:608: recipe for target 'check-am' failed [ 208s] make[4]: *** [check-am] Error 2 [ 208s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 208s] Makefile:460: recipe for target 'check-recursive' failed [ 208s] make[3]: *** [check-recursive] Error 1 [ 208s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 208s] Makefile:527: recipe for target 'check-recursive' failed [ 208s] make[2]: *** [check-recursive] Error 1 [ 208s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 208s] Makefile:818: recipe for target 'check' failed [ 208s] make[1]: *** [check] Error 2 [ 208s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 208s] dh_auto_test: make -j1 check returned exit code 2 [ 208s] debian/rules:13: recipe for target 'build' failed [ 208s] make: *** [build] Error 2 [ 208s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 208s] [ 208s] lamb57 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:07:52 UTC 2017. [ 208s] [ 208s] ### VM INTERACTION START ### [ 211s] [ 204.671622] reboot: Power down [ 211s] ### VM INTERACTION END ### [ 211s] [ 211s] lamb57 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:07:55 UTC 2017. [ 211s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:08:57 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:08:57 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59ef9deb69d70_40867bef80170049@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 213s] [ 213s] Makefile:758: recipe for target 'check-local' failed [ 213s] make[5]: *** [check-local] Error 1 [ 213s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 213s] Makefile:608: recipe for target 'check-am' failed [ 213s] make[4]: *** [check-am] Error 2 [ 213s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 213s] Makefile:460: recipe for target 'check-recursive' failed [ 213s] make[3]: *** [check-recursive] Error 1 [ 213s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 213s] Makefile:527: recipe for target 'check-recursive' failed [ 213s] make[2]: *** [check-recursive] Error 1 [ 213s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 213s] Makefile:818: recipe for target 'check' failed [ 213s] make[1]: *** [check] Error 2 [ 213s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 213s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 213s] debian/rules:13: recipe for target 'build' failed [ 213s] make: *** [build] Error 2 [ 213s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 213s] [ 213s] build32 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:08:49 UTC 2017. [ 213s] [ 213s] ### VM INTERACTION START ### [ 216s] [ 204.620451] reboot: Power down [ 217s] ### VM INTERACTION END ### [ 217s] [ 217s] build32 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:08:53 UTC 2017. [ 217s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:08:57 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:08:57 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59ef9ded8994_40867bef801700619@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 177s] [ 177s] Makefile:758: recipe for target 'check-local' failed [ 177s] make[5]: *** [check-local] Error 1 [ 177s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 177s] Makefile:608: recipe for target 'check-am' failed [ 177s] make[4]: *** [check-am] Error 2 [ 177s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 177s] Makefile:460: recipe for target 'check-recursive' failed [ 177s] make[3]: *** [check-recursive] Error 1 [ 177s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 177s] Makefile:527: recipe for target 'check-recursive' failed [ 177s] make[2]: *** [check-recursive] Error 1 [ 177s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 177s] Makefile:818: recipe for target 'check' failed [ 177s] make[1]: *** [check] Error 2 [ 177s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 177s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 177s] debian/rules:13: recipe for target 'build' failed [ 177s] make: *** [build] Error 2 [ 177s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 177s] [ 177s] lamb75 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:08:45 UTC 2017. [ 177s] [ 177s] ### VM INTERACTION START ### [ 180s] [ 172.204752] reboot: Power down [ 180s] ### VM INTERACTION END ### [ 180s] [ 180s] lamb75 failed "build openbsc_0.15.1.20171024.dsc" at Tue Oct 24 20:08:47 UTC 2017. [ 180s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:11:48 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:11:48 +0000 Subject: Build failure of network:osmocom:nightly/osmo-sgsn in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59ef9e9cb7ace_40867bef8017016ab@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-sgsn/Debian_8.0/i586 Package network:osmocom:nightly/osmo-sgsn failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-sgsn Last lines of build log: [ 89s] | #define HAVE_STRING_H 1 [ 89s] | #define HAVE_MEMORY_H 1 [ 89s] | #define HAVE_STRINGS_H 1 [ 89s] | #define HAVE_INTTYPES_H 1 [ 89s] | #define HAVE_STDINT_H 1 [ 89s] | #define HAVE_UNISTD_H 1 [ 89s] | #define HAVE_DLFCN_H 1 [ 89s] | #define LT_OBJDIR ".libs/" [ 89s] | #define STDC_HEADERS 1 [ 89s] | #define HAVE_TM_GMTOFF_IN_TM 1 [ 89s] | [ 89s] | configure: exit 0 [ 89s] [ 89s] debian/rules:65: recipe for target 'override_dh_auto_test' failed [ 89s] make[1]: *** [override_dh_auto_test] Error 1 [ 89s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 89s] debian/rules:45: recipe for target 'build' failed [ 89s] make: *** [build] Error 2 [ 89s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 89s] [ 89s] build75 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:11:33 UTC 2017. [ 89s] [ 89s] ### VM INTERACTION START ### [ 90s] Powering off. [ 90s] [ 82.943091] reboot: Power down [ 90s] ### VM INTERACTION END ### [ 90s] [ 90s] build75 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:11:34 UTC 2017. [ 90s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:12:58 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:12:58 +0000 Subject: Build failure of network:osmocom:nightly/osmo-sgsn in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59ef9ed884be5_40867bef8017020bf@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-sgsn/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-sgsn failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-sgsn Last lines of build log: [ 107s] | #define HAVE_STDLIB_H 1 [ 107s] | #define HAVE_STRING_H 1 [ 107s] | #define HAVE_MEMORY_H 1 [ 107s] | #define HAVE_STRINGS_H 1 [ 107s] | #define HAVE_INTTYPES_H 1 [ 107s] | #define HAVE_STDINT_H 1 [ 107s] | #define HAVE_UNISTD_H 1 [ 107s] | #define HAVE_DLFCN_H 1 [ 107s] | #define LT_OBJDIR ".libs/" [ 107s] | #define STDC_HEADERS 1 [ 107s] | #define HAVE_TM_GMTOFF_IN_TM 1 [ 107s] | [ 107s] | configure: exit 0 [ 107s] [ 107s] debian/rules:65: recipe for target 'override_dh_auto_test' failed [ 107s] make[1]: *** [override_dh_auto_test] Error 1 [ 107s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 107s] debian/rules:45: recipe for target 'build' failed [ 107s] make: *** [build] Error 2 [ 107s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 107s] [ 107s] lamb28 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:12:51 UTC 2017. [ 107s] [ 107s] ### VM INTERACTION START ### [ 109s] [ 101.694888] reboot: Power down [ 109s] ### VM INTERACTION END ### [ 109s] [ 109s] lamb28 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:12:54 UTC 2017. [ 109s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:14:40 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:14:40 +0000 Subject: Build failure of network:osmocom:nightly/osmo-sgsn in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59ef9f368a14d_40867bef801702538@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-sgsn/Debian_9.0/i586 Package network:osmocom:nightly/osmo-sgsn failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-sgsn Last lines of build log: [ 122s] VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 [ 122s] + Packets at NS Level ( In): 5 [ 122s] + Packets at NS Level (Out): 5 [ 122s] + Bytes at NS Level ( In): 37 [ 122s] + Bytes at NS Level (Out): 21 [ 122s] VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 [ 122s] + Packets at NS Level ( In): 5 [ 122s] + Packets at NS Level (Out): 5 [ 122s] + Bytes at NS Level ( In): 21 [ 122s] + Bytes at NS Level (Out): 37 [ 122s] NS-VC Block count : 1 [ 122s] [ 122s] Gbproxy global: [ 122s] 2. testsuite.at:10: 2. gbproxy (testsuite.at:10): FAILED (testsuite.at:13) [ 122s] debian/rules:65: recipe for target 'override_dh_auto_test' failed [ 122s] make[1]: *** [override_dh_auto_test] Error 1 [ 122s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 122s] debian/rules:45: recipe for target 'build' failed [ 122s] make: *** [build] Error 2 [ 122s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 122s] [ 122s] lamb19 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:14:32 UTC 2017. [ 122s] [ 122s] ### VM INTERACTION START ### [ 125s] [ 116.618535] reboot: Power down [ 125s] ### VM INTERACTION END ### [ 125s] [ 125s] lamb19 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:14:36 UTC 2017. [ 125s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:16:05 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:16:05 +0000 Subject: Build failure of network:osmocom:nightly/osmo-sgsn in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59ef9f8e6867b_40867bef801703179@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-sgsn/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-sgsn failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-sgsn Last lines of build log: [ 100s] VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 [ 100s] + Packets at NS Level ( In): 5 [ 100s] + Packets at NS Level (Out): 5 [ 100s] + Bytes at NS Level ( In): 37 [ 100s] + Bytes at NS Level (Out): 21 [ 100s] VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 [ 100s] + Packets at NS Level ( In): 5 [ 100s] + Packets at NS Level (Out): 5 [ 100s] + Bytes at NS Level ( In): 21 [ 100s] + Bytes at NS Level (Out): 37 [ 100s] NS-VC Block count : 1 [ 100s] [ 100s] Gbproxy global: [ 100s] 2. testsuite.at:10: 2. gbproxy (testsuite.at:10): FAILED (testsuite.at:13) [ 100s] debian/rules:65: recipe for target 'override_dh_auto_test' failed [ 100s] make[1]: *** [override_dh_auto_test] Error 1 [ 100s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 100s] debian/rules:45: recipe for target 'build' failed [ 100s] make: *** [build] Error 2 [ 100s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 100s] [ 100s] lamb15 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:15:44 UTC 2017. [ 100s] [ 100s] ### VM INTERACTION START ### [ 104s] [ 96.223706] reboot: Power down [ 104s] ### VM INTERACTION END ### [ 104s] [ 104s] lamb15 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:15:48 UTC 2017. [ 104s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:16:22 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:16:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-sgsn in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59ef9faacbbd0_40867bef80170368d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-sgsn/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-sgsn failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-sgsn Last lines of build log: [ 163s] | #define HAVE_STDLIB_H 1 [ 163s] | #define HAVE_STRING_H 1 [ 163s] | #define HAVE_MEMORY_H 1 [ 163s] | #define HAVE_STRINGS_H 1 [ 163s] | #define HAVE_INTTYPES_H 1 [ 163s] | #define HAVE_STDINT_H 1 [ 163s] | #define HAVE_UNISTD_H 1 [ 163s] | #define HAVE_DLFCN_H 1 [ 163s] | #define LT_OBJDIR ".libs/" [ 163s] | #define STDC_HEADERS 1 [ 163s] | #define HAVE_TM_GMTOFF_IN_TM 1 [ 163s] | [ 163s] | configure: exit 0 [ 163s] [ 163s] debian/rules:65: recipe for target 'override_dh_auto_test' failed [ 163s] make[1]: *** [override_dh_auto_test] Error 1 [ 163s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 163s] debian/rules:45: recipe for target 'build' failed [ 163s] make: *** [build] Error 2 [ 163s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 163s] [ 163s] cloud116 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:16:06 UTC 2017. [ 163s] [ 163s] ### VM INTERACTION START ### [ 166s] [ 152.142882] reboot: Power down [ 167s] ### VM INTERACTION END ### [ 167s] [ 167s] cloud116 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:16:10 UTC 2017. [ 167s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:17:14 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:17:14 +0000 Subject: Build failure of network:osmocom:nightly/osmo-sgsn in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59ef9fe4e9c14_40867bef8017045ca@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-sgsn/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-sgsn failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-sgsn Last lines of build log: [ 120s] | #define STDC_HEADERS 1 [ 120s] | #define HAVE_SYS_TYPES_H 1 [ 120s] | #define HAVE_SYS_STAT_H 1 [ 120s] | #define HAVE_STDLIB_H 1 [ 120s] | #define HAVE_STRING_H 1 [ 120s] | #define HAVE_MEMORY_H 1 [ 120s] | #define HAVE_STRINGS_H 1 [ 120s] | #define HAVE_INTTYPES_H 1 [ 120s] | #define HAVE_STDINT_H 1 [ 120s] | #define HAVE_UNISTD_H 1 [ 120s] | #define HAVE_DLFCN_H 1 [ 120s] | #define LT_OBJDIR ".libs/" [ 120s] | #define STDC_HEADERS 1 [ 120s] | #define HAVE_TM_GMTOFF_IN_TM 1 [ 120s] | [ 120s] | configure: exit 0 [ 120s] [ 120s] debian/rules:65: recipe for target 'override_dh_auto_test' failed [ 120s] make[1]: *** [override_dh_auto_test] Error 1 [ 120s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 120s] debian/rules:45: recipe for target 'build' failed [ 120s] make: *** [build] Error 2 [ 120s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 120s] [ 120s] build35 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:16:56 UTC 2017. [ 120s] [ 120s] ### VM INTERACTION START ### [ 122s] [ 113.971940] reboot: Power down [ 122s] ### VM INTERACTION END ### -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:19:31 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:19:31 +0000 Subject: Build failure of network:osmocom:nightly/osmo-sgsn in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59efa06144aa7_40867bef8017055af@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-sgsn/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-sgsn failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-sgsn Last lines of build log: [ 121s] | #define HAVE_STDLIB_H 1 [ 121s] | #define HAVE_STRING_H 1 [ 121s] | #define HAVE_MEMORY_H 1 [ 121s] | #define HAVE_STRINGS_H 1 [ 121s] | #define HAVE_INTTYPES_H 1 [ 121s] | #define HAVE_STDINT_H 1 [ 121s] | #define HAVE_UNISTD_H 1 [ 121s] | #define HAVE_DLFCN_H 1 [ 121s] | #define LT_OBJDIR ".libs/" [ 121s] | #define STDC_HEADERS 1 [ 121s] | #define HAVE_TM_GMTOFF_IN_TM 1 [ 121s] | [ 121s] | configure: exit 0 [ 121s] [ 121s] debian/rules:65: recipe for target 'override_dh_auto_test' failed [ 121s] make[1]: *** [override_dh_auto_test] Error 1 [ 121s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 121s] debian/rules:45: recipe for target 'build' failed [ 121s] make: *** [build] Error 2 [ 121s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 121s] [ 121s] build34 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:19:10 UTC 2017. [ 121s] [ 121s] ### VM INTERACTION START ### [ 123s] [ 115.300899] reboot: Power down [ 124s] ### VM INTERACTION END ### [ 124s] [ 124s] build34 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:19:14 UTC 2017. [ 124s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:20:40 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:20:40 +0000 Subject: Build failure of network:osmocom:nightly/osmo-sgsn in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59efa0a322ed7_40867bef8017062b7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-sgsn/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-sgsn failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-sgsn Last lines of build log: [ 158s] | #define HAVE_STDLIB_H 1 [ 158s] | #define HAVE_STRING_H 1 [ 158s] | #define HAVE_MEMORY_H 1 [ 158s] | #define HAVE_STRINGS_H 1 [ 158s] | #define HAVE_INTTYPES_H 1 [ 158s] | #define HAVE_STDINT_H 1 [ 158s] | #define HAVE_UNISTD_H 1 [ 158s] | #define HAVE_DLFCN_H 1 [ 158s] | #define LT_OBJDIR ".libs/" [ 158s] | #define STDC_HEADERS 1 [ 158s] | #define HAVE_TM_GMTOFF_IN_TM 1 [ 158s] | [ 158s] | configure: exit 0 [ 158s] [ 158s] debian/rules:65: recipe for target 'override_dh_auto_test' failed [ 158s] make[1]: *** [override_dh_auto_test] Error 1 [ 158s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 158s] debian/rules:45: recipe for target 'build' failed [ 158s] make: *** [build] Error 2 [ 158s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 158s] [ 158s] cloud128 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:20:26 UTC 2017. [ 158s] [ 158s] ### VM INTERACTION START ### [ 161s] [ 137.054872] reboot: Power down [ 162s] ### VM INTERACTION END ### [ 162s] [ 162s] cloud128 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:20:31 UTC 2017. [ 162s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Oct 24 20:24:57 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 24 Oct 2017 20:24:57 +0000 Subject: Build failure of network:osmocom:nightly/osmo-sgsn in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59efada9ae1ce_40867bef8017145c1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-sgsn/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-sgsn failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-sgsn Last lines of build log: [ 156s] VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 [ 156s] + Packets at NS Level ( In): 5 [ 156s] + Packets at NS Level (Out): 5 [ 156s] + Bytes at NS Level ( In): 37 [ 156s] + Bytes at NS Level (Out): 21 [ 156s] VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 [ 156s] + Packets at NS Level ( In): 5 [ 156s] + Packets at NS Level (Out): 5 [ 156s] + Bytes at NS Level ( In): 21 [ 156s] + Bytes at NS Level (Out): 37 [ 156s] NS-VC Block count : 1 [ 156s] [ 156s] Gbproxy global: [ 156s] 2. testsuite.at:10: 2. gbproxy (testsuite.at:10): FAILED (testsuite.at:13) [ 156s] debian/rules:65: recipe for target 'override_dh_auto_test' failed [ 156s] make[1]: *** [override_dh_auto_test] Error 1 [ 156s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 156s] debian/rules:45: recipe for target 'build' failed [ 156s] make: *** [build] Error 2 [ 156s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 156s] [ 156s] cloud122 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:24:36 UTC 2017. [ 156s] [ 156s] ### VM INTERACTION START ### [ 159s] [ 145.048559] reboot: Power down [ 160s] ### VM INTERACTION END ### [ 160s] [ 160s] cloud122 failed "build osmo-sgsn_0.1.0.20171024.dsc" at Tue Oct 24 20:24:41 UTC 2017. [ 160s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Wed Oct 25 01:28:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 01:28:53 +0000 Subject: [PATCH] osmo-msc[master]: Rename osmo_fsm to avoid illegal space in name + more meanin... Message-ID: Review at https://gerrit.osmocom.org/4406 Rename osmo_fsm to avoid illegal space in name + more meaningful name A FSM doesn't need "FSM" in its name, as it is obvious that it is a FSM. Also, having two that are called RESET is confusing, so let's try to come up with better names. Also, after Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 in libosmocore, we now enforce that no FSM identifiers contain spaces or other illegal characters. Closes: OS#2593 Change-Id: I858a81b8a4e01b2e802e3159f2835e5ca515953d --- M src/libcommon-cs/a_reset.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/06/4406/1 diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index 9a226ac..7dbd014 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -124,7 +124,7 @@ /* State machine definition */ static struct osmo_fsm fsm = { - .name = "FSM RESET", + .name = "A-RESET", .states = fsm_states, .num_states = ARRAY_SIZE(fsm_states), .log_subsys = DMSC, @@ -149,7 +149,7 @@ reset->cb = cb; strncpy(reset->name, name, sizeof(reset->name)); reset->conn_loss_counter = 0; - reset->fsm = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, "FSM RESET INST"); + reset->fsm = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, NULL); OSMO_ASSERT(reset->fsm); reset->fsm->priv = reset; LOGP(DMSC, LOGL_NOTICE, "(%s) reset handler fsm created.\n", reset->name); -- To view, visit https://gerrit.osmocom.org/4406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I858a81b8a4e01b2e802e3159f2835e5ca515953d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 25 02:19:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 25 Oct 2017 02:19:22 +0000 Subject: [PATCH] libosmocore[master]: utils: avoid segfault when calling osmo_strlcpy(src=NULL) Message-ID: Review at https://gerrit.osmocom.org/4407 utils: avoid segfault when calling osmo_strlcpy(src=NULL) Change-Id: Ieba7ba262ace2e370a4b9a550b3131fb13f07413 --- M src/utils.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/07/4407/1 diff --git a/src/utils.c b/src/utils.c index ef8e916..f5894d8 100644 --- a/src/utils.c +++ b/src/utils.c @@ -372,7 +372,7 @@ */ size_t osmo_strlcpy(char *dst, const char *src, size_t siz) { - size_t ret = strlen(src); + size_t ret = src ? strlen(src) : 0; if (siz) { size_t len = (ret >= siz) ? siz - 1 : ret; -- To view, visit https://gerrit.osmocom.org/4407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieba7ba262ace2e370a4b9a550b3131fb13f07413 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 25 08:21:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 08:21:27 +0000 Subject: libosmocore[master]: utils: avoid segfault when calling osmo_strlcpy(src=NULL) In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) I think test case is required which tried osmo_strlcpy(src=NULL), osmo_strlcpy(siz=0) etc. to ensure that fix actually works as expected. https://gerrit.osmocom.org/#/c/4407/1/src/utils.c File src/utils.c: Line 375: size_t ret = src ? strlen(src) : 0; Why not simply return here right away? I thought this is the preferred style for error handling? -- To view, visit https://gerrit.osmocom.org/4407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieba7ba262ace2e370a4b9a550b3131fb13f07413 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 25 08:22:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 08:22:14 +0000 Subject: osmo-msc[master]: Rename osmo_fsm to avoid illegal space in name + more meanin... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I858a81b8a4e01b2e802e3159f2835e5ca515953d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 08:24:03 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 25 Oct 2017 08:24:03 +0000 Subject: [PATCH] osmo-msc[master]: reset: fix illegal FSM name Message-ID: Review at https://gerrit.osmocom.org/4408 reset: fix illegal FSM name The name of the state machine that controls the reset contains a whitespace. This is not allowed. Replace whitespace with an underscore. Change-Id: I1f19cef832308a6078c2c23a3a9b08fa3f0be0b9 --- M src/libcommon-cs/a_reset.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/08/4408/1 diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index 9a226ac..d1a6032 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -124,7 +124,7 @@ /* State machine definition */ static struct osmo_fsm fsm = { - .name = "FSM RESET", + .name = "FSM_RESET", .states = fsm_states, .num_states = ARRAY_SIZE(fsm_states), .log_subsys = DMSC, -- To view, visit https://gerrit.osmocom.org/4408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f19cef832308a6078c2c23a3a9b08fa3f0be0b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 25 08:29:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 25 Oct 2017 08:29:28 +0000 Subject: [PATCH] osmo-bsc[master]: reset: fix illegal FSM name Message-ID: Review at https://gerrit.osmocom.org/4409 reset: fix illegal FSM name The name of the state machine that controls the reset contains a whitespace. This is not allowed. Replace whitespace with an underscore. Change-Id: I44b8e0935f9d249903a30852ca1cdcf335219ba6 --- M src/libcommon-cs/a_reset.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/4409/1 diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index c40bc41..612a028 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -124,7 +124,7 @@ /* State machine definition */ static struct osmo_fsm fsm = { - .name = "FSM RESET", + .name = "FSM_RESET", .states = fsm_states, .num_states = ARRAY_SIZE(fsm_states), .log_subsys = DMSC, -- To view, visit https://gerrit.osmocom.org/4409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I44b8e0935f9d249903a30852ca1cdcf335219ba6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 25 08:38:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 08:38:23 +0000 Subject: [PATCH] osmo-sgsn[master]: Fix build after recent rate_ctr patches Message-ID: Review at https://gerrit.osmocom.org/4410 Fix build after recent rate_ctr patches It seems like recent changes expanded output of dump_rate_ctr_group(). Adjust output accordingly to fix the build. Change-Id: Icc9a53d35be2b0793d7ed25e6fec5bf6c8f84d92 --- M tests/gbproxy/gbproxy_test.ok 1 file changed, 248 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/10/4410/1 diff --git a/tests/gbproxy/gbproxy_test.ok b/tests/gbproxy/gbproxy_test.ok index 737aec0..ff86b67 100644 --- a/tests/gbproxy/gbproxy_test.ok +++ b/tests/gbproxy/gbproxy_test.ok @@ -38,6 +38,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Initialise BSS 1 --- @@ -96,7 +100,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 12 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Peers: @@ -170,8 +182,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 12 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -233,8 +257,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -284,8 +320,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -335,8 +383,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 13 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 67 + Bytes at NS Level (Out): 45 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -386,8 +446,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:4444 + Packets at NS Level ( In): 17 + Packets at NS Level (Out): 17 + Bytes at NS Level ( In): 82 + Bytes at NS Level (Out): 57 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -439,9 +511,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x00000000:0 + Packets at NS Level ( In): 10 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 64 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -491,9 +575,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 14 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 79 + Bytes at NS Level (Out): 45 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -519,9 +615,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 15 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 101 + Bytes at NS Level (Out): 45 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 7 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 81 NS-VC Block count : 1 Peers: @@ -561,9 +669,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 16 + Packets at NS Level (Out): 14 + Bytes at NS Level ( In): 123 + Bytes at NS Level (Out): 54 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 7 + Packets at NS Level (Out): 8 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 103 NS-VC Block count : 1 Peers: @@ -603,9 +723,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 17 + Packets at NS Level (Out): 15 + Bytes at NS Level ( In): 145 + Bytes at NS Level (Out): 63 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 48 + Bytes at NS Level (Out): 125 NS-VC Block count : 1 Peers: @@ -729,9 +861,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 21 + Packets at NS Level (Out): 22 + Bytes at NS Level ( In): 107 + Bytes at NS Level (Out): 73 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 18 + Bytes at NS Level ( In): 157 + Bytes at NS Level (Out): 80 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 12 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 69 + Bytes at NS Level (Out): 159 NS-VC Block count : 1 Peers: @@ -846,6 +990,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Initialise BSS 1 --- @@ -890,7 +1038,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Setup BVCI 1 --- @@ -1051,8 +1207,16 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 12 + Packets at NS Level (Out): 12 + Bytes at NS Level ( In): 82 + Bytes at NS Level (Out): 50 NS-VC changed NSEI count : 1 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 8 + Bytes at NS Level ( In): 38 + Bytes at NS Level (Out): 67 NS-VC Block count : 1 --- Setup BVCI 1 --- @@ -1263,10 +1427,22 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 3 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 3 + Bytes at NS Level (Out): 12 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x2000, peer 0x00000000:0 + Packets at NS Level ( In): 18 + Packets at NS Level (Out): 16 + Bytes at NS Level ( In): 150 + Bytes at NS Level (Out): 76 NS-VC changed NSEI count : 1 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 13 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 68 + Bytes at NS Level (Out): 123 NS-VC Block count : 1 --- Setup BVCI 1 --- @@ -1592,7 +1768,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -1879,6 +2063,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Initialise BSS 1 --- @@ -1937,7 +2125,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 12 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Peers: @@ -2396,7 +2592,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -3116,7 +3320,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -3443,7 +3655,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -4299,9 +4519,21 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 59 + Bytes at NS Level (Out): 30 VCI 0x0103, NSEI 0x0102, peer 0x15161718:32001 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -5490,7 +5722,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -7164,7 +7404,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: -- To view, visit https://gerrit.osmocom.org/4410 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icc9a53d35be2b0793d7ed25e6fec5bf6c8f84d92 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 25 08:38:38 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 25 Oct 2017 08:38:38 +0000 Subject: osmo-msc[master]: Rename osmo_fsm to avoid illegal space in name + more meanin... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 > Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I858a81b8a4e01b2e802e3159f2835e5ca515953d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 08:39:33 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 25 Oct 2017 08:39:33 +0000 Subject: [ABANDON] osmo-msc[master]: reset: fix illegal FSM name In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: reset: fix illegal FSM name ...................................................................... Abandoned There is already a patch for that. -- To view, visit https://gerrit.osmocom.org/4408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I1f19cef832308a6078c2c23a3a9b08fa3f0be0b9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 08:52:06 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 25 Oct 2017 08:52:06 +0000 Subject: [PATCH] osmo-bsc[master]: reset: fix illegal FSM name In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4409 to look at the new patch set (#2). reset: fix illegal FSM name The name of the state machine that controls the reset contains a whitespace. This is not allowed. Replace whitespace with an underscore. Change-Id: I44b8e0935f9d249903a30852ca1cdcf335219ba6 --- M src/libcommon-cs/a_reset.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/4409/2 diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index c40bc41..d441ec0 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -124,7 +124,7 @@ /* State machine definition */ static struct osmo_fsm fsm = { - .name = "FSM RESET", + .name = "A-RESET", .states = fsm_states, .num_states = ARRAY_SIZE(fsm_states), .log_subsys = DMSC, -- To view, visit https://gerrit.osmocom.org/4409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I44b8e0935f9d249903a30852ca1cdcf335219ba6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 08:54:55 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 25 Oct 2017 08:54:55 +0000 Subject: [PATCH] osmo-bsc[master]: reset: fix illegal FSM name In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4409 to look at the new patch set (#3). reset: fix illegal FSM name The name of the state machine that controls the reset contains a whitespace. This is not allowed. Replace whitespace with an underscore and choose a more meaningful name. Change-Id: I44b8e0935f9d249903a30852ca1cdcf335219ba6 --- M src/libcommon-cs/a_reset.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/4409/3 diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index c40bc41..d441ec0 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -124,7 +124,7 @@ /* State machine definition */ static struct osmo_fsm fsm = { - .name = "FSM RESET", + .name = "A-RESET", .states = fsm_states, .num_states = ARRAY_SIZE(fsm_states), .log_subsys = DMSC, -- To view, visit https://gerrit.osmocom.org/4409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I44b8e0935f9d249903a30852ca1cdcf335219ba6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 09:15:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 09:15:35 +0000 Subject: [PATCH] osmo-pcu[master]: Initialize logging before initializing rate_ctr Message-ID: Review at https://gerrit.osmocom.org/4411 Initialize logging before initializing rate_ctr The library code for rate counter initialization, which is called from the descendants of bsc_network_alloc() might already want to log something (particularly after Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 --- M src/bts.cpp 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/11/4411/1 diff --git a/src/bts.cpp b/src/bts.cpp index b768569..09a562a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -33,6 +33,7 @@ #include #include #include + #include #include #include #include @@ -49,6 +50,7 @@ extern void *tall_pcu_ctx; static BTS s_bts; +static bool log_not_initialized = true; /** * For gcc-4.4 compat do not use extended initializer list but keep the @@ -207,6 +209,11 @@ } } + if (log_not_initialized) { + log_not_initialized = false; + osmo_init_logging(&gprs_log_info); + } + m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); OSMO_ASSERT(m_ratectrs); m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0); -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 25 09:50:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 09:50:37 +0000 Subject: osmo-sgsn[master]: Fix build after recent rate_ctr patches In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 I'm happy with those changes, but I would appreciate if you could figure out *why* the output was expanded. This was not the intention of the patches, it was all just about renaming counter groups and counters. -- To view, visit https://gerrit.osmocom.org/4410 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icc9a53d35be2b0793d7ed25e6fec5bf6c8f84d92 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 09:50:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 09:50:50 +0000 Subject: osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 I'm happy with those changes, but I would appreciate if you could figure out *why* the output was expanded. This was not the intention of the patches, it was all just about renaming counter groups and counters. -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 09:52:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 09:52:25 +0000 Subject: osmo-bsc[master]: reset: fix illegal FSM name In-Reply-To: References: Message-ID: Patch Set 3: Mh, I did write the exact same change in Change-Id I1b44d26cebc4a47094d7b8b3983e5737b88bf003 -- To view, visit https://gerrit.osmocom.org/4409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44b8e0935f9d249903a30852ca1cdcf335219ba6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 09:53:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 09:53:13 +0000 Subject: osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 09:55:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 09:55:12 +0000 Subject: osmo-sgsn[master]: Fix build after recent rate_ctr patches In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4410 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icc9a53d35be2b0793d7ed25e6fec5bf6c8f84d92 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 09:55:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 09:55:15 +0000 Subject: [MERGED] osmo-sgsn[master]: Fix build after recent rate_ctr patches In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix build after recent rate_ctr patches ...................................................................... Fix build after recent rate_ctr patches It seems like recent changes expanded output of dump_rate_ctr_group(). Adjust output accordingly to fix the build. Change-Id: Icc9a53d35be2b0793d7ed25e6fec5bf6c8f84d92 --- M tests/gbproxy/gbproxy_test.ok 1 file changed, 248 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/gbproxy/gbproxy_test.ok b/tests/gbproxy/gbproxy_test.ok index 737aec0..ff86b67 100644 --- a/tests/gbproxy/gbproxy_test.ok +++ b/tests/gbproxy/gbproxy_test.ok @@ -38,6 +38,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Initialise BSS 1 --- @@ -96,7 +100,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 12 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Peers: @@ -170,8 +182,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 12 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -233,8 +257,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -284,8 +320,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -335,8 +383,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 13 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 67 + Bytes at NS Level (Out): 45 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -386,8 +446,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:4444 + Packets at NS Level ( In): 17 + Packets at NS Level (Out): 17 + Bytes at NS Level ( In): 82 + Bytes at NS Level (Out): 57 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -439,9 +511,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x00000000:0 + Packets at NS Level ( In): 10 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 64 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -491,9 +575,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 14 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 79 + Bytes at NS Level (Out): 45 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -519,9 +615,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 15 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 101 + Bytes at NS Level (Out): 45 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 7 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 81 NS-VC Block count : 1 Peers: @@ -561,9 +669,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 16 + Packets at NS Level (Out): 14 + Bytes at NS Level ( In): 123 + Bytes at NS Level (Out): 54 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 7 + Packets at NS Level (Out): 8 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 103 NS-VC Block count : 1 Peers: @@ -603,9 +723,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 17 + Packets at NS Level (Out): 15 + Bytes at NS Level ( In): 145 + Bytes at NS Level (Out): 63 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 48 + Bytes at NS Level (Out): 125 NS-VC Block count : 1 Peers: @@ -729,9 +861,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 21 + Packets at NS Level (Out): 22 + Bytes at NS Level ( In): 107 + Bytes at NS Level (Out): 73 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 18 + Bytes at NS Level ( In): 157 + Bytes at NS Level (Out): 80 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 12 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 69 + Bytes at NS Level (Out): 159 NS-VC Block count : 1 Peers: @@ -846,6 +990,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Initialise BSS 1 --- @@ -890,7 +1038,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Setup BVCI 1 --- @@ -1051,8 +1207,16 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 12 + Packets at NS Level (Out): 12 + Bytes at NS Level ( In): 82 + Bytes at NS Level (Out): 50 NS-VC changed NSEI count : 1 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 8 + Bytes at NS Level ( In): 38 + Bytes at NS Level (Out): 67 NS-VC Block count : 1 --- Setup BVCI 1 --- @@ -1263,10 +1427,22 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 3 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 3 + Bytes at NS Level (Out): 12 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x2000, peer 0x00000000:0 + Packets at NS Level ( In): 18 + Packets at NS Level (Out): 16 + Bytes at NS Level ( In): 150 + Bytes at NS Level (Out): 76 NS-VC changed NSEI count : 1 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 13 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 68 + Bytes at NS Level (Out): 123 NS-VC Block count : 1 --- Setup BVCI 1 --- @@ -1592,7 +1768,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -1879,6 +2063,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Initialise BSS 1 --- @@ -1937,7 +2125,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 12 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Peers: @@ -2396,7 +2592,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -3116,7 +3320,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -3443,7 +3655,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -4299,9 +4519,21 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 59 + Bytes at NS Level (Out): 30 VCI 0x0103, NSEI 0x0102, peer 0x15161718:32001 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -5490,7 +5722,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -7164,7 +7404,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: -- To view, visit https://gerrit.osmocom.org/4410 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icc9a53d35be2b0793d7ed25e6fec5bf6c8f84d92 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 09:55:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 09:55:23 +0000 Subject: osmo-msc[master]: Rename osmo_fsm to avoid illegal space in name + more meanin... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I858a81b8a4e01b2e802e3159f2835e5ca515953d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 09:55:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 09:55:24 +0000 Subject: [MERGED] osmo-msc[master]: Rename osmo_fsm to avoid illegal space in name + more meanin... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Rename osmo_fsm to avoid illegal space in name + more meaningful name ...................................................................... Rename osmo_fsm to avoid illegal space in name + more meaningful name A FSM doesn't need "FSM" in its name, as it is obvious that it is a FSM. Also, having two that are called RESET is confusing, so let's try to come up with better names. Also, after Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 in libosmocore, we now enforce that no FSM identifiers contain spaces or other illegal characters. Closes: OS#2593 Change-Id: I858a81b8a4e01b2e802e3159f2835e5ca515953d --- M src/libcommon-cs/a_reset.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: dexter: Looks good to me, but someone else must approve Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index 9a226ac..7dbd014 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -124,7 +124,7 @@ /* State machine definition */ static struct osmo_fsm fsm = { - .name = "FSM RESET", + .name = "A-RESET", .states = fsm_states, .num_states = ARRAY_SIZE(fsm_states), .log_subsys = DMSC, @@ -149,7 +149,7 @@ reset->cb = cb; strncpy(reset->name, name, sizeof(reset->name)); reset->conn_loss_counter = 0; - reset->fsm = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, "FSM RESET INST"); + reset->fsm = osmo_fsm_inst_alloc(&fsm, NULL, NULL, LOGL_DEBUG, NULL); OSMO_ASSERT(reset->fsm); reset->fsm->priv = reset; LOGP(DMSC, LOGL_NOTICE, "(%s) reset handler fsm created.\n", reset->name); -- To view, visit https://gerrit.osmocom.org/4406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I858a81b8a4e01b2e802e3159f2835e5ca515953d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 25 10:00:27 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 25 Oct 2017 10:00:27 +0000 Subject: osmo-bsc[master]: Rename osmo_fsm to avoid illegal space in name + more meanin... In-Reply-To: References: Message-ID: Patch Set 2: Please, if it applies, remember to send the same patch against openbsc.git -- To view, visit https://gerrit.osmocom.org/4403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b44d26cebc4a47094d7b8b3983e5737b88bf003 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 10:05:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 25 Oct 2017 10:05:52 +0000 Subject: [ABANDON] libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: osmux: Re-write osmux_snprintf ...................................................................... Abandoned 3 patches were merged fixing a few bits remaining to be improved after Pablos' patches. This patch can as a result be abandoned. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Oct 25 10:09:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 10:09:59 +0000 Subject: osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 1: > *why* the output was expanded We init logging first in BTS singleton with some default log levels. Later on init is called again in individual tests but this setting is not taken into account for some reason. Not sure yet why. -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 10:24:36 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 25 Oct 2017 10:24:36 +0000 Subject: [PATCH] osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4146 to look at the new patch set (#13). client: add unified function to generate MGCP messages currently the only way to generate MGCP messages is to use mgcp_msg_crcx(), mgcp_msg_mdcx() and mgcp_msg_dlcx(). All three function take a fixed set of parameters via their parameter list. There is no way to add or leave away optional parameters. add function mgcp_msg_gen(), this function takes a unified message struct. The struct features a presence bitmask which allows to enable and disable parameters as needed. It is also possible to add new parameters in the future without breaking the API. Depends: libosmocore I15e1af68616309555d0ed9ac5da027c9833d42e3 Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.c M tests/mgcp_client/mgcp_client_test.err M tests/mgcp_client/mgcp_client_test.ok 5 files changed, 249 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/4146/13 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index efc1f76..21717e3 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include @@ -37,6 +38,36 @@ uint16_t audio_port; }; +enum mgcp_verb { + MGCP_VERB_CRCX, + MGCP_VERB_MDCX, + MGCP_VERB_DLCX, + MGCP_VERB_AUEP, + MGCP_VERB_RSIP, +}; + +#define MGCP_MSG_PRESENCE_ENDPOINT 0x0001 +#define MGCP_MSG_PRESENCE_CALL_ID 0x0002 +#define MGCP_MSG_PRESENCE_CONN_ID 0x0004 +#define MGCP_MSG_PRESENCE_AUDIO_IP 0x0008 +#define MGCP_MSG_PRESENCE_AUDIO_PORT 0x0010 +#define MGCP_MSG_PRESENCE_CONN_MODE 0x0020 + +/* See also RFC3435 section 3.2.1.3 */ +#define MGCP_ENDPOINT_MAXLEN (255*2+1+1) + +struct mgcp_msg { + enum mgcp_verb verb; + /* See MGCP_MSG_PRESENCE_* constants */ + uint32_t presence; + char endpoint[MGCP_ENDPOINT_MAXLEN]; + unsigned int call_id; + uint32_t conn_id; + uint16_t audio_port; + char *audio_ip; + enum mgcp_connection_mode conn_mode; +}; + void mgcp_client_conf_init(struct mgcp_client_conf *conf); void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf); int mgcp_client_config_write(struct vty *vty, const char *indent); @@ -65,14 +96,19 @@ struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, - enum mgcp_connection_mode mode); + enum mgcp_connection_mode mode) +OSMO_DEPRECATED("Use mgcp_msg_gen() instead"); struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, const char *rtp_conn_addr, - uint16_t rtp_port, enum mgcp_connection_mode mode); + uint16_t rtp_port, enum mgcp_connection_mode mode) +OSMO_DEPRECATED("Use mgcp_msg_gen() instead"); struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, - unsigned int call_id); + unsigned int call_id) +OSMO_DEPRECATED("Use mgcp_msg_gen() instead"); + +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg); extern const struct value_string mgcp_client_connection_mode_strs[]; static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 1cd37be..c7cc989 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -614,6 +615,109 @@ "C: %x\r\n", trans_id, rtp_endpoint, call_id); } +#define MGCP_CRCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CALL_ID | \ + MGCP_MSG_PRESENCE_CONN_ID | \ + MGCP_MSG_PRESENCE_CONN_MODE) +#define MGCP_MDCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CONN_ID) +#define MGCP_DLCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) +#define MGCP_RSIP_MANDATORY 0 /* none */ + +struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg) +{ + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); + uint32_t mandatory_mask; + struct msgb *msg = msgb_alloc_headroom(4096, 128, "MGCP tx"); + int rc = 0; + + msg->l2h = msg->data; + msg->cb[MSGB_CB_MGCP_TRANS_ID] = trans_id; + + /* Add command verb */ + switch (mgcp_msg->verb) { + case MGCP_VERB_CRCX: + mandatory_mask = MGCP_CRCX_MANDATORY; + rc += msgb_printf(msg, "CRCX %u", trans_id); + break; + case MGCP_VERB_MDCX: + mandatory_mask = MGCP_MDCX_MANDATORY; + rc += msgb_printf(msg, "MDCX %u", trans_id); + break; + case MGCP_VERB_DLCX: + mandatory_mask = MGCP_DLCX_MANDATORY; + rc += msgb_printf(msg, "DLCX %u", trans_id); + break; + case MGCP_VERB_AUEP: + mandatory_mask = MGCP_AUEP_MANDATORY; + rc += msgb_printf(msg, "AUEP %u", trans_id); + break; + case MGCP_VERB_RSIP: + mandatory_mask = MGCP_RSIP_MANDATORY; + rc += msgb_printf(msg, "RSIP %u", trans_id); + break; + default: + LOGP(DLMGCP, LOGL_ERROR, + "Invalid command verb, can not generate MGCP message\n"); + msgb_free(msg); + return NULL; + } + + /* Check if mandatory fields are missing */ + if (!((mgcp_msg->presence & mandatory_mask) == mandatory_mask)) { + LOGP(DLMGCP, LOGL_ERROR, + "One or more missing mandatory fields, can not generate MGCP message\n"); + msgb_free(msg); + return NULL; + } + + /* Add endpoint name */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_ENDPOINT) + rc += msgb_printf(msg, " %s", mgcp_msg->endpoint); + + /* Add protocol version */ + rc += msgb_printf(msg, " MGCP 1.0\r\n"); + + /* Add call id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CALL_ID) + rc += msgb_printf(msg, "C: %x\r\n", mgcp_msg->call_id); + + /* Add connection id */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID) + rc += msgb_printf(msg, "I: %u\r\n", mgcp_msg->conn_id); + + /* Add local connection options */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID + && mgcp_msg->verb == MGCP_VERB_CRCX) + rc += msgb_printf(msg, "L: p:20, a:AMR, nt:IN\r\n"); + + /* Add mode */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_MODE) + rc += + msgb_printf(msg, "M: %s\r\n", + mgcp_client_cmode_name(mgcp_msg->conn_mode)); + + /* Add RTP address and port (SDP) */ + if (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_IP + && mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT) { + rc += msgb_printf(msg, "\r\n"); + rc += msgb_printf(msg, "c=IN IP4 %s\r\n", mgcp_msg->audio_ip); + rc += + msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", + mgcp_msg->audio_port); + } + + if (rc != 0) { + LOGP(DLMGCP, LOGL_ERROR, + "message buffer to small, can not generate MGCP message\n"); + msgb_free(msg); + msg = NULL; + } + + return msg; +} + struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 69e1810..7977a6a 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -149,6 +149,80 @@ "a=ptime:20\r\n"); } +void test_mgcp_msg(void) +{ + struct msgb *msg; + char audio_ip_overflow[5000]; + + /* A message struct prefilled with some arbitary values */ + struct mgcp_msg mgcp_msg = { + .audio_ip = "192.168.100.23", + .endpoint = "23 at mgw", + .audio_port = 1234, + .call_id = 47, + .conn_id = 11, + .conn_mode = MGCP_CONN_RECV_SEND + }; + + if (mgcp) + talloc_free(mgcp); + mgcp = mgcp_client_init(ctx, &conf); + + printf("\n"); + + printf("Generated CRCX message:\n"); + mgcp_msg.verb = MGCP_VERB_CRCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Generated MDCX message:\n"); + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Generated DLCX message:\n"); + mgcp_msg.verb = MGCP_VERB_DLCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Generated AUEP message:\n"); + mgcp_msg.verb = MGCP_VERB_AUEP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", msg->data); + + printf("Generated RSIP message:\n"); + mgcp_msg.verb = MGCP_VERB_RSIP; + mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + printf("%s\n", (char *)msg->data); + + printf("Overfolow test:\n"); + mgcp_msg.verb = MGCP_VERB_MDCX; + mgcp_msg.presence = + (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | + MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); + memset(audio_ip_overflow, 'X', sizeof(audio_ip_overflow)); + audio_ip_overflow[sizeof(audio_ip_overflow) - 1] = '\0'; + mgcp_msg.audio_ip = audio_ip_overflow; + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg == NULL); + + printf("\n"); + msgb_free(msg); +} + static const struct log_info_cat log_categories[] = { }; @@ -171,6 +245,7 @@ mgcp_client_conf_init(&conf); test_crcx(); + test_mgcp_msg(); printf("Done\n"); fprintf(stderr, "Done\n"); diff --git a/tests/mgcp_client/mgcp_client_test.err b/tests/mgcp_client/mgcp_client_test.err index a965a70..24151ee 100644 --- a/tests/mgcp_client/mgcp_client_test.err +++ b/tests/mgcp_client/mgcp_client_test.err @@ -1 +1,2 @@ +DLMGCP message buffer to small, can not generate MGCP message Done diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index d35f2d6..e3b6113 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -28,4 +28,34 @@ head.trans_id = 1 head.comment = OK audio_port = 16002 + +Generated CRCX message: +CRCX 1 23 at mgw MGCP 1.0 +C: 2f +I: 11 +L: p:20, a:AMR, nt:IN +M: sendrecv + +Generated MDCX message: +MDCX 2 23 at mgw MGCP 1.0 +C: 2f +I: 11 +M: sendrecv + +c=IN IP4 192.168.100.23 +m=audio 1234 RTP/AVP 255 + +Generated DLCX message: +DLCX 3 23 at mgw MGCP 1.0 +C: 2f +I: 11 + +Generated AUEP message: +AUEP 4 23 at mgw MGCP 1.0 + +Generated RSIP message: +RSIP 5 23 at mgw MGCP 1.0 + +Overfolow test: + Done -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 13 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 25 10:24:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 25 Oct 2017 10:24:39 +0000 Subject: [PATCH] osmo-mgw[master]: client: fix stderror logging in unit-test Message-ID: Review at https://gerrit.osmocom.org/4412 client: fix stderror logging in unit-test When testing the file name and the line numbers are output to stderr, this causes the test to fail when change moves the lines. Disable line numbers in the stderror log when testing, also disable timestamps and colors. Make sure the log category is print. Change-Id: I7f1bd9454188f0ca869dada1fcc2877b789cc0ac --- M tests/mgcp_client/mgcp_client_test.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/12/4412/1 diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index f2f0e0f..69e1810 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -163,6 +163,10 @@ ctx = talloc_named_const(NULL, 1, "mgcp_client_test"); msgb_talloc_ctx_init(ctx, 0); osmo_init_logging(&log_info); + log_set_print_filename(osmo_stderr_target, 0); + log_set_print_timestamp(osmo_stderr_target, 0); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_category(osmo_stderr_target, 1); mgcp_client_conf_init(&conf); -- To view, visit https://gerrit.osmocom.org/4412 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f1bd9454188f0ca869dada1fcc2877b789cc0ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Oct 25 11:51:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 11:51:23 +0000 Subject: libosmocore[master]: utils: avoid segfault when calling osmo_strlcpy(src=NULL) In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4407/1/src/utils.c File src/utils.c: Line 375: size_t ret = src ? strlen(src) : 0; > Why not simply return here right away? I thought this is the preferred styl I guess it's a good idea to still zero-terminate 'dst' even if 'src' is NULL. -- To view, visit https://gerrit.osmocom.org/4407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieba7ba262ace2e370a4b9a550b3131fb13f07413 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 25 11:51:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 11:51:26 +0000 Subject: libosmocore[master]: utils: avoid segfault when calling osmo_strlcpy(src=NULL) In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieba7ba262ace2e370a4b9a550b3131fb13f07413 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 11:51:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 11:51:59 +0000 Subject: osmo-mgw[master]: client: fix stderror logging in unit-test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4412 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7f1bd9454188f0ca869dada1fcc2877b789cc0ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 11:53:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 11:53:16 +0000 Subject: osmo-bsc[master]: reset: fix illegal FSM name In-Reply-To: References: Message-ID: Patch Set 3: > Mh, I did write the exact same change in Change-Id > I1b44d26cebc4a47094d7b8b3983e5737b88bf003 > Mh, I did write the exact same change in Change-Id > I1b44d26cebc4a47094d7b8b3983e5737b88bf003 > Mh, I did write the exact same change in Change-Id > I1b44d26cebc4a47094d7b8b3983e5737b88bf003 ... which was merged master last night at 6pm. Please make sure to pull master before working on fixes. -- To view, visit https://gerrit.osmocom.org/4409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44b8e0935f9d249903a30852ca1cdcf335219ba6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 11:53:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 11:53:42 +0000 Subject: [ABANDON] osmo-bsc[master]: reset: fix illegal FSM name In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: reset: fix illegal FSM name ...................................................................... Abandoned this was merged yesterday as I1b44d26cebc4a47094d7b8b3983e5737b88bf003 -- To view, visit https://gerrit.osmocom.org/4409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I44b8e0935f9d249903a30852ca1cdcf335219ba6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 12:36:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 12:36:48 +0000 Subject: [PATCH] osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4411 to look at the new patch set (#2). Initialize logging before initializing rate_ctr The library code for rate counter initialization might already want to log something (particularly after Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Before the rate counters were initialized implicitly in BTS constructor which makes proper logging init impossible. Fix this by using explicit init similar to the way we do it for vty. Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 --- M src/bts.cpp M src/bts.h M src/pcu_main.cpp M src/pcu_vty.c M src/pcu_vty.h M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp M tests/types/TypesTest.cpp 8 files changed, 129 insertions(+), 121 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/11/4411/2 diff --git a/src/bts.cpp b/src/bts.cpp index b768569..0f7462a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -50,107 +50,6 @@ static BTS s_bts; -/** - * For gcc-4.4 compat do not use extended initializer list but keep the - * order from the enum here. Once we support GCC4.7 and up we can change - * the code below. - */ -static const struct rate_ctr_desc bts_ctr_description[] = { - { "tbf.dl.alloc", "TBF DL Allocated "}, - { "tbf.dl.freed", "TBF DL Freed "}, - { "tbf.dl.aborted", "TBF DL Aborted "}, - { "tbf.ul.alloc", "TBF UL Allocated "}, - { "tbf.ul.freed", "TBF UL Freed "}, - { "tbf.ul.aborted", "TBF UL Aborted "}, - { "tbf.reused", "TBF Reused "}, - { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, - { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, - { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, - { "rlc.sent", "RLC Sent "}, - { "rlc.resent", "RLC Resent "}, - { "rlc.restarted", "RLC Restarted "}, - { "rlc.stalled", "RLC Stalled "}, - { "rlc.nacked", "RLC Nacked "}, - { "rlc.final_block_resent", "RLC Final Blk resent "}, - { "rlc.ass.timedout", "RLC Assign Timeout "}, - { "rlc.ass.failed", "RLC Assign Failed "}, - { "rlc.ack.timedout", "RLC Ack Timeout "}, - { "rlc.ack.failed", "RLC Ack Failed "}, - { "rlc.rel.timedout", "RLC Release Timeout "}, - { "rlc.late-block", "RLC Late Block "}, - { "rlc.sent-dummy", "RLC Sent Dummy "}, - { "rlc.sent-control", "RLC Sent Control "}, - { "rlc.dl_bytes", "RLC DL Bytes "}, - { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, - { "rlc.ul_bytes", "RLC UL Bytes "}, - { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, - { "decode.errors", "Decode Errors "}, - { "sba.allocated", "SBA Allocated "}, - { "sba.freed", "SBA Freed "}, - { "sba.timedout", "SBA Timeout "}, - { "llc.timeout", "Timedout Frames "}, - { "llc.dropped", "Dropped Frames "}, - { "llc.scheduled", "Scheduled Frames "}, - { "llc.dl_bytes", "RLC encapsulated PDUs"}, - { "llc.ul_bytes", "full PDUs received "}, - { "rach.requests", "RACH requests "}, - { "11bit_rach.requests", "11BIT_RACH requests "}, - { "spb.uplink_first_segment", "First seg of UL SPB "}, - { "spb.uplink_second_segment", "Second seg of UL SPB "}, - { "spb.downlink_first_segment", "First seg of DL SPB "}, - { "spb.downlink_second_segment","Second seg of DL SPB "}, - { "immediate.assignment_UL", "Immediate Assign UL "}, - { "immediate.assignment_rej", "Immediate Assign Rej "}, - { "immediate.assignment_DL", "Immediate Assign DL "}, - { "channel.request_description","Channel Request Desc "}, - { "pkt.ul_assignment", "Packet UL Assignment "}, - { "pkt.access_reject", "Packet Access Reject "}, - { "pkt.dl_assignment", "Packet DL Assignment "}, - { "ul.control", "UL control Block "}, - { "ul.assignment_poll_timeout", "UL Assign Timeout "}, - { "ul.assignment_failed", "UL Assign Failed "}, - { "dl.assignment_timeout", "DL Assign Timeout "}, - { "dl.assignment_failed", "DL Assign Failed "}, - { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, - { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, - { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, - { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, - { "gprs.downlink_cs1", "CS1 downlink "}, - { "gprs.downlink_cs2", "CS2 downlink "}, - { "gprs.downlink_cs3", "CS3 downlink "}, - { "gprs.downlink_cs4", "CS4 downlink "}, - { "egprs.downlink_mcs1", "MCS1 downlink "}, - { "egprs.downlink_mcs2", "MCS2 downlink "}, - { "egprs.downlink_mcs3", "MCS3 downlink "}, - { "egprs.downlink_mcs4", "MCS4 downlink "}, - { "egprs.downlink_mcs5", "MCS5 downlink "}, - { "egprs.downlink_mcs6", "MCS6 downlink "}, - { "egprs.downlink_mcs7", "MCS7 downlink "}, - { "egprs.downlink_mcs8", "MCS8 downlink "}, - { "egprs.downlink_mcs9", "MCS9 downlink "}, - { "gprs.uplink_cs1", "CS1 Uplink "}, - { "gprs.uplink_cs2", "CS2 Uplink "}, - { "gprs.uplink_cs3", "CS3 Uplink "}, - { "gprs.uplink_cs4", "CS4 Uplink "}, - { "egprs.uplink_mcs1", "MCS1 Uplink "}, - { "egprs.uplink_mcs2", "MCS2 Uplink "}, - { "egprs.uplink_mcs3", "MCS3 Uplink "}, - { "egprs.uplink_mcs4", "MCS4 Uplink "}, - { "egprs.uplink_mcs5", "MCS5 Uplink "}, - { "egprs.uplink_mcs6", "MCS6 Uplink "}, - { "egprs.uplink_mcs7", "MCS7 Uplink "}, - { "egprs.uplink_mcs8", "MCS8 Uplink "}, - { "egprs.uplink_mcs9", "MCS9 Uplink "}, -}; - -static const struct rate_ctr_group_desc bts_ctrg_desc = { - "bts", - "BTS Statistics", - OSMO_STATS_CLASS_GLOBAL, - ARRAY_SIZE(bts_ctr_description), - bts_ctr_description, -}; - static const struct osmo_stat_item_desc bts_stat_item_description[] = { { "ms.present", "MS Present ", OSMO_STAT_ITEM_NO_UNIT, 4, 0}, @@ -179,11 +78,6 @@ return BTS::main_bts()->bts_data(); } -struct rate_ctr_group *bts_main_data_stats() -{ - return BTS::main_bts()->rate_counters(); -} - BTS::BTS() : m_cur_fn(0) , m_cur_blk_fn(-1) @@ -207,8 +101,6 @@ } } - m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); - OSMO_ASSERT(m_ratectrs); m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0); OSMO_ASSERT(m_statg); } @@ -219,7 +111,8 @@ * m_ms_store's destructor */ m_ms_store.cleanup(); - rate_ctr_group_free(m_ratectrs); + if (m_bts.ctrs) + rate_ctr_group_free(m_bts.ctrs); osmo_stat_item_group_free(m_statg); } diff --git a/src/bts.h b/src/bts.h index d65cd2f..c2177ae 100644 --- a/src/bts.h +++ b/src/bts.h @@ -217,7 +217,7 @@ bool si13_is_set; /* 0 to support resegmentation in DL, 1 for no reseg */ uint8_t dl_arq_type; - + struct rate_ctr_group *ctrs; uint32_t ms_idle_sec; uint8_t cs_adj_enabled; uint8_t cs_adj_upper_limit; @@ -482,7 +482,6 @@ /* * Below for C interface for the VTY */ - struct rate_ctr_group *rate_counters() const; struct osmo_stat_item_group *stat_items() const; LListHead& ul_tbfs(); @@ -493,7 +492,6 @@ struct gprs_rlcmac_bts m_bts; PollController m_pollController; SBAController m_sba; - struct rate_ctr_group *m_ratectrs; struct osmo_stat_item_group *m_statg; GprsMsStorage m_ms_store; @@ -570,11 +568,6 @@ return m_assigned_tfi[dir]; } -inline struct rate_ctr_group *BTS::rate_counters() const -{ - return m_ratectrs; -} - inline struct osmo_stat_item_group *BTS::stat_items() const { return m_statg; @@ -582,12 +575,14 @@ #define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ inline void BTS::func_name(int inc) {\ - rate_ctr_add(&m_ratectrs->ctr[ctr_name], inc); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ } #define CREATE_COUNT_INLINE(func_name, ctr_name) \ inline void BTS::func_name() {\ - rate_ctr_inc(&m_ratectrs->ctr[ctr_name]); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ } CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) @@ -705,7 +700,6 @@ extern "C" { #endif struct gprs_rlcmac_bts *bts_main_data(); - struct rate_ctr_group *bts_main_data_stats(); struct osmo_stat_item_group *bts_main_data_stat_items(); #ifdef __cplusplus } diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b7574f9..afc1d96 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -251,6 +251,7 @@ vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); + bts->ctrs = pcu_ctr_init(); handle_options(argc, argv); if ((!!spoof_mcc) + (!!spoof_mnc) == 1) { diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 5ec16ea..d4926cd 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "pcu_vty.h" #include "gprs_rlcmac.h" @@ -836,7 +837,9 @@ "show bts statistics", SHOW_STR "BTS related functionality\nStatistics\n") { - vty_out_rate_ctr_group(vty, "", bts_main_data_stats()); + struct gprs_rlcmac_bts *bts = bts_main_data(); + + vty_out_rate_ctr_group(vty, "", bts->ctrs); return CMD_SUCCESS; } @@ -1199,3 +1202,104 @@ return 0; } + +struct rate_ctr_group *pcu_ctr_init() +{ + const struct rate_ctr_desc bts_ctr_description[] = { + { "tbf.dl.alloc", "TBF DL Allocated "}, + { "tbf.dl.freed", "TBF DL Freed "}, + { "tbf.dl.aborted", "TBF DL Aborted "}, + { "tbf.ul.alloc", "TBF UL Allocated "}, + { "tbf.ul.freed", "TBF UL Freed "}, + { "tbf.ul.aborted", "TBF UL Aborted "}, + { "tbf.reused", "TBF Reused "}, + { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, + { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, + { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, + { "rlc.sent", "RLC Sent "}, + { "rlc.resent", "RLC Resent "}, + { "rlc.restarted", "RLC Restarted "}, + { "rlc.stalled", "RLC Stalled "}, + { "rlc.nacked", "RLC Nacked "}, + { "rlc.final_block_resent", "RLC Final Blk resent "}, + { "rlc.ass.timedout", "RLC Assign Timeout "}, + { "rlc.ass.failed", "RLC Assign Failed "}, + { "rlc.ack.timedout", "RLC Ack Timeout "}, + { "rlc.ack.failed", "RLC Ack Failed "}, + { "rlc.rel.timedout", "RLC Release Timeout "}, + { "rlc.late-block", "RLC Late Block "}, + { "rlc.sent-dummy", "RLC Sent Dummy "}, + { "rlc.sent-control", "RLC Sent Control "}, + { "rlc.dl_bytes", "RLC DL Bytes "}, + { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, + { "rlc.ul_bytes", "RLC UL Bytes "}, + { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, + { "decode.errors", "Decode Errors "}, + { "sba.allocated", "SBA Allocated "}, + { "sba.freed", "SBA Freed "}, + { "sba.timedout", "SBA Timeout "}, + { "llc.timeout", "Timedout Frames "}, + { "llc.dropped", "Dropped Frames "}, + { "llc.scheduled", "Scheduled Frames "}, + { "llc.dl_bytes", "RLC encapsulated PDUs"}, + { "llc.ul_bytes", "full PDUs received "}, + { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "spb.uplink_first_segment", "First seg of UL SPB "}, + { "spb.uplink_second_segment", "Second seg of UL SPB "}, + { "spb.downlink_first_segment", "First seg of DL SPB "}, + { "spb.downlink_second_segment","Second seg of DL SPB "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_rej", "Immediate Assign Rej "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "channel.request_description","Channel Request Desc "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.access_reject", "Packet Access Reject "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, + }; + + const struct rate_ctr_group_desc bts_ctrg_desc = { + "bts", + "BTS Statistics", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(bts_ctr_description), + bts_ctr_description, + }; + + return rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); +} diff --git a/src/pcu_vty.h b/src/pcu_vty.h index a075350..0371597 100644 --- a/src/pcu_vty.h +++ b/src/pcu_vty.h @@ -13,6 +13,7 @@ int pcu_vty_is_config_node(struct vty *vty, int node); int pcu_vty_init(const struct log_info *cat); +struct rate_ctr_group *pcu_ctr_init(); extern struct vty_app_info pcu_vty_info; diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..37d9718 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } /* globals used by the code */ @@ -117,6 +118,7 @@ printf("Testing alloc_a direction(%d)\n", dir); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; struct gprs_rlcmac_trx *trx = &bts->trx[0]; @@ -195,6 +197,7 @@ printf("Testing UL then DL assignment.\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -237,6 +240,7 @@ printf("Testing DL then UL assignment followed by update\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -284,6 +288,7 @@ printf("Testing jolly example\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -345,6 +350,7 @@ gprs_rlcmac_tbf *ul_tbf, *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -389,6 +395,7 @@ gprs_rlcmac_dl_tbf *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -482,6 +489,7 @@ uint8_t trx_no = -1; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); gprs_rlcmac_tbf *tbf = NULL; @@ -663,6 +671,7 @@ printf("Going to test assignment with many TBF, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -701,6 +710,7 @@ printf("Going to test assignment with many connections, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -809,6 +819,7 @@ printf("Testing DL TS allocation for Multi UEs\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..5b626a8 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -74,6 +74,7 @@ printf("=== start %s ===\n", __func__); + the_bts.bts_data()->ctrs = pcu_ctr_init(); the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a; the_bts.bts_data()->trx[0].pdch[2].enable(); the_bts.bts_data()->trx[0].pdch[3].enable(); @@ -148,6 +149,7 @@ gprs_rlcmac_trx *trx; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; bts->initial_cs_dl = cs; bts->initial_cs_ul = cs; diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 7d09108..e71993a 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } #define OSMO_ASSERT_STR_EQ(a, b) \ @@ -351,6 +352,7 @@ int bsn_begin, bsn_end, num_blocks; Ack_Nack_Description_t desc; + dummy_bts.bts_data()->ctrs = pcu_ctr_init(); dl_win.m_v_b.reset(); OSMO_ASSERT(dl_win.window_empty()); -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 25 13:04:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 13:04:58 +0000 Subject: [MERGED] osmo-sgsn[master]: log: fix default loglevels In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: log: fix default loglevels ...................................................................... log: fix default loglevels for some log categories the default loglevel is far to verbose. downgrade all loglevels to LOGL_NOTICE Change-Id: I3a427ce201c96338a00a84d737d090ac1a77a29f --- M src/gprs/sgsn_main.c 1 file changed, 9 insertions(+), 9 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index 7036bf6..e48d8d1 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -302,47 +302,47 @@ [DGPRS] = { .name = "DGPRS", .description = "GPRS Packet Service", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DNS] = { .name = "DNS", .description = "GPRS Network Service (NS)", - .enabled = 1, .loglevel = LOGL_INFO, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DBSSGP] = { .name = "DBSSGP", .description = "GPRS BSS Gateway Protocol (BSSGP)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DLLC] = { .name = "DLLC", .description = "GPRS Logical Link Control Protocol (LLC)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DSNDCP] = { .name = "DSNDCP", .description = "GPRS Sub-Network Dependent Control Protocol (SNDCP)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DRANAP] = { .name = "DRANAP", .description = "RAN Application Part (RANAP)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DSUA] = { .name = "DSUA", .description = "SCCP User Adaptation (SUA)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DSLHC] = { .name = "DSLHC", .description = "RFC1144 TCP/IP Header compression (SLHC)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DV42BIS] = { .name = "DV42BIS", .description = "V.42bis data compression (SNDCP)", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, } }; -- To view, visit https://gerrit.osmocom.org/4365 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3a427ce201c96338a00a84d737d090ac1a77a29f Gerrit-PatchSet: 5 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 25 13:12:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 13:12:27 +0000 Subject: [MERGED] osmo-sgsn[master]: non-iu-build: guard vty libosmo-sigtran function calls. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: non-iu-build: guard vty libosmo-sigtran function calls. ...................................................................... non-iu-build: guard vty libosmo-sigtran function calls. 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 --- M src/gprs/gtphub_main.c 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index 782afb3..c3e25d5 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -115,6 +115,7 @@ } } +#if BUILD_IU int gtphub_vty_go_parent(struct vty *vty) { switch (vty->node) { @@ -124,13 +125,16 @@ return vty->node; } +#endif int gtphub_vty_is_config_node(struct vty *vty, int node) { /* Check if libosmo-sccp declares the node in * question as config node */ +#if BUILD_IU if (osmo_ss7_is_config_node(vty, node)) return 1; +#endif switch (node) { /* add items that are not config */ @@ -145,7 +149,9 @@ static struct vty_app_info vty_info = { .name = "OsmoGTPhub", .version = PACKAGE_VERSION, +#if BUILD_IU .go_parent_cb = gtphub_vty_go_parent, +#endif .is_config_node = gtphub_vty_is_config_node, }; -- To view, visit https://gerrit.osmocom.org/4369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1c609ef0c344ce825c313335c7e084bf97159262 Gerrit-PatchSet: 4 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Oct 25 13:15:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 13:15:50 +0000 Subject: [PATCH] osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4411 to look at the new patch set (#3). Initialize logging before initializing rate_ctr The library code for rate counter initialization might already want to log something (particularly after Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Before the rate counters were initialized implicitly in BTS constructor which makes proper logging init impossible. Fix this by using explicit init similar to the way we do it for vty. Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 --- M src/Makefile.am M src/bts.cpp M src/bts.h A src/pcu_ctr.c A src/pcu_ctr.h M src/pcu_main.cpp M src/pcu_vty.c M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp M tests/types/TypesTest.cpp 10 files changed, 189 insertions(+), 122 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/11/4411/3 diff --git a/src/Makefile.am b/src/Makefile.am index 1543851..67291ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,7 @@ gprs_ms_storage.cpp \ gsm_timer.cpp \ pcu_l1_if.cpp \ + pcu_ctr.c \ pcu_vty.c \ pcu_vty_functions.cpp \ tbf.cpp \ @@ -79,6 +80,7 @@ gprs_ms_storage.h \ pcu_l1_if.h \ gsm_timer.h \ + pcu_ctr.h \ pcu_vty.h \ pcu_vty_functions.h \ tbf.h \ diff --git a/src/bts.cpp b/src/bts.cpp index b768569..0f7462a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -50,107 +50,6 @@ static BTS s_bts; -/** - * For gcc-4.4 compat do not use extended initializer list but keep the - * order from the enum here. Once we support GCC4.7 and up we can change - * the code below. - */ -static const struct rate_ctr_desc bts_ctr_description[] = { - { "tbf.dl.alloc", "TBF DL Allocated "}, - { "tbf.dl.freed", "TBF DL Freed "}, - { "tbf.dl.aborted", "TBF DL Aborted "}, - { "tbf.ul.alloc", "TBF UL Allocated "}, - { "tbf.ul.freed", "TBF UL Freed "}, - { "tbf.ul.aborted", "TBF UL Aborted "}, - { "tbf.reused", "TBF Reused "}, - { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, - { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, - { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, - { "rlc.sent", "RLC Sent "}, - { "rlc.resent", "RLC Resent "}, - { "rlc.restarted", "RLC Restarted "}, - { "rlc.stalled", "RLC Stalled "}, - { "rlc.nacked", "RLC Nacked "}, - { "rlc.final_block_resent", "RLC Final Blk resent "}, - { "rlc.ass.timedout", "RLC Assign Timeout "}, - { "rlc.ass.failed", "RLC Assign Failed "}, - { "rlc.ack.timedout", "RLC Ack Timeout "}, - { "rlc.ack.failed", "RLC Ack Failed "}, - { "rlc.rel.timedout", "RLC Release Timeout "}, - { "rlc.late-block", "RLC Late Block "}, - { "rlc.sent-dummy", "RLC Sent Dummy "}, - { "rlc.sent-control", "RLC Sent Control "}, - { "rlc.dl_bytes", "RLC DL Bytes "}, - { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, - { "rlc.ul_bytes", "RLC UL Bytes "}, - { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, - { "decode.errors", "Decode Errors "}, - { "sba.allocated", "SBA Allocated "}, - { "sba.freed", "SBA Freed "}, - { "sba.timedout", "SBA Timeout "}, - { "llc.timeout", "Timedout Frames "}, - { "llc.dropped", "Dropped Frames "}, - { "llc.scheduled", "Scheduled Frames "}, - { "llc.dl_bytes", "RLC encapsulated PDUs"}, - { "llc.ul_bytes", "full PDUs received "}, - { "rach.requests", "RACH requests "}, - { "11bit_rach.requests", "11BIT_RACH requests "}, - { "spb.uplink_first_segment", "First seg of UL SPB "}, - { "spb.uplink_second_segment", "Second seg of UL SPB "}, - { "spb.downlink_first_segment", "First seg of DL SPB "}, - { "spb.downlink_second_segment","Second seg of DL SPB "}, - { "immediate.assignment_UL", "Immediate Assign UL "}, - { "immediate.assignment_rej", "Immediate Assign Rej "}, - { "immediate.assignment_DL", "Immediate Assign DL "}, - { "channel.request_description","Channel Request Desc "}, - { "pkt.ul_assignment", "Packet UL Assignment "}, - { "pkt.access_reject", "Packet Access Reject "}, - { "pkt.dl_assignment", "Packet DL Assignment "}, - { "ul.control", "UL control Block "}, - { "ul.assignment_poll_timeout", "UL Assign Timeout "}, - { "ul.assignment_failed", "UL Assign Failed "}, - { "dl.assignment_timeout", "DL Assign Timeout "}, - { "dl.assignment_failed", "DL Assign Failed "}, - { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, - { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, - { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, - { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, - { "gprs.downlink_cs1", "CS1 downlink "}, - { "gprs.downlink_cs2", "CS2 downlink "}, - { "gprs.downlink_cs3", "CS3 downlink "}, - { "gprs.downlink_cs4", "CS4 downlink "}, - { "egprs.downlink_mcs1", "MCS1 downlink "}, - { "egprs.downlink_mcs2", "MCS2 downlink "}, - { "egprs.downlink_mcs3", "MCS3 downlink "}, - { "egprs.downlink_mcs4", "MCS4 downlink "}, - { "egprs.downlink_mcs5", "MCS5 downlink "}, - { "egprs.downlink_mcs6", "MCS6 downlink "}, - { "egprs.downlink_mcs7", "MCS7 downlink "}, - { "egprs.downlink_mcs8", "MCS8 downlink "}, - { "egprs.downlink_mcs9", "MCS9 downlink "}, - { "gprs.uplink_cs1", "CS1 Uplink "}, - { "gprs.uplink_cs2", "CS2 Uplink "}, - { "gprs.uplink_cs3", "CS3 Uplink "}, - { "gprs.uplink_cs4", "CS4 Uplink "}, - { "egprs.uplink_mcs1", "MCS1 Uplink "}, - { "egprs.uplink_mcs2", "MCS2 Uplink "}, - { "egprs.uplink_mcs3", "MCS3 Uplink "}, - { "egprs.uplink_mcs4", "MCS4 Uplink "}, - { "egprs.uplink_mcs5", "MCS5 Uplink "}, - { "egprs.uplink_mcs6", "MCS6 Uplink "}, - { "egprs.uplink_mcs7", "MCS7 Uplink "}, - { "egprs.uplink_mcs8", "MCS8 Uplink "}, - { "egprs.uplink_mcs9", "MCS9 Uplink "}, -}; - -static const struct rate_ctr_group_desc bts_ctrg_desc = { - "bts", - "BTS Statistics", - OSMO_STATS_CLASS_GLOBAL, - ARRAY_SIZE(bts_ctr_description), - bts_ctr_description, -}; - static const struct osmo_stat_item_desc bts_stat_item_description[] = { { "ms.present", "MS Present ", OSMO_STAT_ITEM_NO_UNIT, 4, 0}, @@ -179,11 +78,6 @@ return BTS::main_bts()->bts_data(); } -struct rate_ctr_group *bts_main_data_stats() -{ - return BTS::main_bts()->rate_counters(); -} - BTS::BTS() : m_cur_fn(0) , m_cur_blk_fn(-1) @@ -207,8 +101,6 @@ } } - m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); - OSMO_ASSERT(m_ratectrs); m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0); OSMO_ASSERT(m_statg); } @@ -219,7 +111,8 @@ * m_ms_store's destructor */ m_ms_store.cleanup(); - rate_ctr_group_free(m_ratectrs); + if (m_bts.ctrs) + rate_ctr_group_free(m_bts.ctrs); osmo_stat_item_group_free(m_statg); } diff --git a/src/bts.h b/src/bts.h index d65cd2f..c2177ae 100644 --- a/src/bts.h +++ b/src/bts.h @@ -217,7 +217,7 @@ bool si13_is_set; /* 0 to support resegmentation in DL, 1 for no reseg */ uint8_t dl_arq_type; - + struct rate_ctr_group *ctrs; uint32_t ms_idle_sec; uint8_t cs_adj_enabled; uint8_t cs_adj_upper_limit; @@ -482,7 +482,6 @@ /* * Below for C interface for the VTY */ - struct rate_ctr_group *rate_counters() const; struct osmo_stat_item_group *stat_items() const; LListHead& ul_tbfs(); @@ -493,7 +492,6 @@ struct gprs_rlcmac_bts m_bts; PollController m_pollController; SBAController m_sba; - struct rate_ctr_group *m_ratectrs; struct osmo_stat_item_group *m_statg; GprsMsStorage m_ms_store; @@ -570,11 +568,6 @@ return m_assigned_tfi[dir]; } -inline struct rate_ctr_group *BTS::rate_counters() const -{ - return m_ratectrs; -} - inline struct osmo_stat_item_group *BTS::stat_items() const { return m_statg; @@ -582,12 +575,14 @@ #define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ inline void BTS::func_name(int inc) {\ - rate_ctr_add(&m_ratectrs->ctr[ctr_name], inc); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ } #define CREATE_COUNT_INLINE(func_name, ctr_name) \ inline void BTS::func_name() {\ - rate_ctr_inc(&m_ratectrs->ctr[ctr_name]); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ } CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) @@ -705,7 +700,6 @@ extern "C" { #endif struct gprs_rlcmac_bts *bts_main_data(); - struct rate_ctr_group *bts_main_data_stats(); struct osmo_stat_item_group *bts_main_data_stat_items(); #ifdef __cplusplus } diff --git a/src/pcu_ctr.c b/src/pcu_ctr.c new file mode 100644 index 0000000..7d2f15b --- /dev/null +++ b/src/pcu_ctr.c @@ -0,0 +1,129 @@ +/* pcu_ctr.c + * + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by Sysmocom s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "pcu_ctr.h" + +#include +#include +#include + +extern void *tall_pcu_ctx; + +struct rate_ctr_group *pcu_ctr_init() +{ + const struct rate_ctr_desc bts_ctr_description[] = { + { "tbf.dl.alloc", "TBF DL Allocated "}, + { "tbf.dl.freed", "TBF DL Freed "}, + { "tbf.dl.aborted", "TBF DL Aborted "}, + { "tbf.ul.alloc", "TBF UL Allocated "}, + { "tbf.ul.freed", "TBF UL Freed "}, + { "tbf.ul.aborted", "TBF UL Aborted "}, + { "tbf.reused", "TBF Reused "}, + { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, + { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, + { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, + { "rlc.sent", "RLC Sent "}, + { "rlc.resent", "RLC Resent "}, + { "rlc.restarted", "RLC Restarted "}, + { "rlc.stalled", "RLC Stalled "}, + { "rlc.nacked", "RLC Nacked "}, + { "rlc.final_block_resent", "RLC Final Blk resent "}, + { "rlc.ass.timedout", "RLC Assign Timeout "}, + { "rlc.ass.failed", "RLC Assign Failed "}, + { "rlc.ack.timedout", "RLC Ack Timeout "}, + { "rlc.ack.failed", "RLC Ack Failed "}, + { "rlc.rel.timedout", "RLC Release Timeout "}, + { "rlc.late-block", "RLC Late Block "}, + { "rlc.sent-dummy", "RLC Sent Dummy "}, + { "rlc.sent-control", "RLC Sent Control "}, + { "rlc.dl_bytes", "RLC DL Bytes "}, + { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, + { "rlc.ul_bytes", "RLC UL Bytes "}, + { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, + { "decode.errors", "Decode Errors "}, + { "sba.allocated", "SBA Allocated "}, + { "sba.freed", "SBA Freed "}, + { "sba.timedout", "SBA Timeout "}, + { "llc.timeout", "Timedout Frames "}, + { "llc.dropped", "Dropped Frames "}, + { "llc.scheduled", "Scheduled Frames "}, + { "llc.dl_bytes", "RLC encapsulated PDUs"}, + { "llc.ul_bytes", "full PDUs received "}, + { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "spb.uplink_first_segment", "First seg of UL SPB "}, + { "spb.uplink_second_segment", "Second seg of UL SPB "}, + { "spb.downlink_first_segment", "First seg of DL SPB "}, + { "spb.downlink_second_segment","Second seg of DL SPB "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_rej", "Immediate Assign Rej "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "channel.request_description","Channel Request Desc "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.access_reject", "Packet Access Reject "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, + }; + + const struct rate_ctr_group_desc bts_ctrg_desc = { + "bts", + "BTS Statistics", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(bts_ctr_description), + bts_ctr_description, + }; + + return rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); +} diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h new file mode 100644 index 0000000..8f62bf9 --- /dev/null +++ b/src/pcu_ctr.h @@ -0,0 +1,29 @@ +/* pcu_ctr.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by Sysmocom s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#include +#include +#include + +struct rate_ctr_group *pcu_ctr_init(); diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b7574f9..c7dd3ed 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -30,6 +30,7 @@ #include extern "C" { #include "pcu_vty.h" +#include "pcu_ctr.h" #include #include #include @@ -251,6 +252,7 @@ vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); + bts->ctrs = pcu_ctr_init(); handle_options(argc, argv); if ((!!spoof_mcc) + (!!spoof_mnc) == 1) { diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 5ec16ea..c94f7d2 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "pcu_vty.h" #include "gprs_rlcmac.h" @@ -836,7 +837,9 @@ "show bts statistics", SHOW_STR "BTS related functionality\nStatistics\n") { - vty_out_rate_ctr_group(vty, "", bts_main_data_stats()); + struct gprs_rlcmac_bts *bts = bts_main_data(); + + vty_out_rate_ctr_group(vty, "", bts->ctrs); return CMD_SUCCESS; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..48ca24f 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } /* globals used by the code */ @@ -117,6 +118,7 @@ printf("Testing alloc_a direction(%d)\n", dir); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; struct gprs_rlcmac_trx *trx = &bts->trx[0]; @@ -195,6 +197,7 @@ printf("Testing UL then DL assignment.\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -237,6 +240,7 @@ printf("Testing DL then UL assignment followed by update\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -284,6 +288,7 @@ printf("Testing jolly example\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -345,6 +350,7 @@ gprs_rlcmac_tbf *ul_tbf, *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -389,6 +395,7 @@ gprs_rlcmac_dl_tbf *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -482,6 +489,7 @@ uint8_t trx_no = -1; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); gprs_rlcmac_tbf *tbf = NULL; @@ -663,6 +671,7 @@ printf("Going to test assignment with many TBF, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -701,6 +710,7 @@ printf("Going to test assignment with many connections, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -809,6 +819,7 @@ printf("Testing DL TS allocation for Multi UEs\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..604366e 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -30,7 +30,7 @@ extern "C" { #include "pcu_vty.h" - +#include "pcu_ctr.h" #include #include #include @@ -74,6 +74,7 @@ printf("=== start %s ===\n", __func__); + the_bts.bts_data()->ctrs = pcu_ctr_init(); the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a; the_bts.bts_data()->trx[0].pdch[2].enable(); the_bts.bts_data()->trx[0].pdch[3].enable(); @@ -148,6 +149,7 @@ gprs_rlcmac_trx *trx; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; bts->initial_cs_dl = cs; bts->initial_cs_ul = cs; diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 7d09108..25d689b 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } #define OSMO_ASSERT_STR_EQ(a, b) \ @@ -351,6 +352,7 @@ int bsn_begin, bsn_end, num_blocks; Ack_Nack_Description_t desc; + dummy_bts.bts_data()->ctrs = pcu_ctr_init(); dl_win.m_v_b.reset(); OSMO_ASSERT(dl_win.window_empty()); -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 25 13:17:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 13:17:46 +0000 Subject: [MERGED] osmo-sgsn[master]: configure: fix libosmo-sigtran dependency In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure: fix libosmo-sigtran dependency ...................................................................... configure: fix libosmo-sigtran dependency the configure script requires libosmo-sigtran even when IU is not enabled. move the line that checks for libosmo-sigtran into the conditional branch for IU Change-Id: I72819462db0b4656fabaa80731342d06ae91fcdf --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index c8e23e5..0daa5e2 100644 --- a/configure.ac +++ b/configure.ac @@ -46,13 +46,13 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) if test "x$osmo_ac_iu" = "xyes" ; then + PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) -- To view, visit https://gerrit.osmocom.org/4364 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I72819462db0b4656fabaa80731342d06ae91fcdf Gerrit-PatchSet: 4 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 14:36:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 25 Oct 2017 14:36:58 +0000 Subject: osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 3: (3 comments) There are numerous ways to solve chicken/eggs like this... ideas: Wrap m_ratectrs in a getter function, which allocates the rate counters the first time the getter is called (only if m_ratectrs == NULL), instead of doing so directly in the constructor. or Make the global singleton BTS dynamically allocated (a pointer instead of an instance) and call the constructor after the logging init; also move the call to bts_main_data() further down in pcu_main.c. In this patch, I wonder why the extensive move / separate files are needed. Is that a cosmetic choice or a compilation requirement? https://gerrit.osmocom.org/#/c/4411/3/src/bts.h File src/bts.h: Line 220: struct rate_ctr_group *ctrs; curious, any reason to place it squarely in the middle between lots of unrelated uints? https://gerrit.osmocom.org/#/c/4411/3/src/pcu_ctr.c File src/pcu_ctr.c: Line 5: * Author: Max Suraev "sysmocom" not capitalized, also Harald says to add a dash, which I wasn't aware of until recently. I usually also add a mail address... by sysmocom - s.f.m.c. GmbH Line 32: const struct rate_ctr_desc bts_ctr_description[] = { I assume these structs aren't copied by the rate_ctr_init(?), in which case they must be static. -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 25 14:37:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 14:37:20 +0000 Subject: [PATCH] osmo-pcu[master]: Move all rate counter related code together Message-ID: Review at https://gerrit.osmocom.org/4413 Move all rate counter related code together Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Related: OS#1541 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/llc.cpp M src/pcu_ctr.h M src/rlc.cpp M src/sba.cpp M src/tbf.cpp M src/tbf_dl.cpp M src/tbf_ul.cpp 11 files changed, 303 insertions(+), 288 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/4413/1 diff --git a/src/bts.cpp b/src/bts.cpp index 0f7462a..16d9dba 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -30,6 +30,7 @@ #include extern "C" { + #include "pcu_ctr.h" #include #include #include @@ -161,7 +162,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "Late RLC block, FN delta: %d FN: %d curFN: %d\n", delay, fn, current_frame_number()); - rlc_late_block(); + rlc_late_block(bts_data()->ctrs); } m_cur_blk_fn = fn; @@ -506,10 +507,10 @@ uint16_t priority = 0; bool failure = false; - rach_frame(); + rach_frame(bts_data()->ctrs); if (is_11bit) - rach_frame_11bit(); + rach_frame_11bit(bts_data()->ctrs); /* Determine full frame number */ Fn = rfn_to_fn(Fn); @@ -590,7 +591,7 @@ plen = Encoding::write_immediate_assignment_reject( immediate_assignment, ra, Fn, burst_type); - immediate_assignment_reject(); + immediate_assignment_reject(bts_data()->ctrs); } else { LOGP(DRLCMAC, LOGL_DEBUG, @@ -605,7 +606,7 @@ } if (plen >= 0) { - immediate_assignment_ul_tbf(); + immediate_assignment_ul_tbf(bts_data()->ctrs); pcu_l1if_tx_agch(immediate_assignment, plen); } @@ -699,7 +700,7 @@ tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); if (plen >= 0) { - immediate_assignment_dl_tbf(); + immediate_assignment_dl_tbf(bts_data()->ctrs); pcu_l1if_tx_pch(immediate_assignment, plen, imsi); } @@ -1026,7 +1027,7 @@ static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) { - bts->channel_request_description(); + channel_request_description(bts->bts_data()->ctrs); /* This call will register the new TBF with the MS on success */ gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), @@ -1356,7 +1357,7 @@ else bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - bts()->rlc_rcvd_control(); + rlc_rcvd_control(bts_data()->ctrs); switch (ul_control_block->u.MESSAGE_TYPE) { case MT_PACKET_CONTROL_ACK: rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); @@ -1377,7 +1378,7 @@ /* ignoring it. change the SI to not force sending these? */ break; default: - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMAC, LOGL_NOTICE, "RX: [PCU <- BTS] unknown control block(%d) received\n", ul_control_block->u.MESSAGE_TYPE); @@ -1393,13 +1394,13 @@ { GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); if (!cs) { - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" "length: %d)\n", len); return -EINVAL; } - bts()->rlc_ul_bytes(len); + rlc_ul_bytes(bts_data()->ctrs, len); LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); @@ -1410,7 +1411,7 @@ if (cs.isEgprs()) return rcv_data_block(data, len, fn, meas, cs); - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", cs.name()); return -EINVAL; @@ -1447,7 +1448,7 @@ LOGP(DRLCMACUL, LOGL_ERROR, "Got %s RLC block but header parsing has failed\n", cs.name()); - bts()->decode_error(); + decode_error(bts_data()->ctrs); return rc; } diff --git a/src/bts.h b/src/bts.h index c2177ae..ec02b8c 100644 --- a/src/bts.h +++ b/src/bts.h @@ -387,95 +387,6 @@ uint8_t ts_no, uint8_t channel, uint32_t fn, const uint8_t *data, unsigned int len); - /* - * Statistics - */ - void tbf_dl_created(); - void tbf_dl_freed(); - void tbf_dl_aborted(); - void tbf_ul_created(); - void tbf_ul_freed(); - void tbf_ul_aborted(); - void tbf_reused(); - void tbf_alloc_algo_a(); - void tbf_alloc_algo_b(); - void tbf_failed_egprs_only(); - void rlc_sent(); - void rlc_resent(); - void rlc_restarted(); - void rlc_stalled(); - void rlc_nacked(); - void rlc_final_block_resent(); - void rlc_ass_timedout(); - void rlc_ass_failed(); - void rlc_ack_timedout(); - void rlc_ack_failed(); - void rlc_rel_timedout(); - void rlc_late_block(); - void rlc_sent_dummy(); - void rlc_sent_control(); - void rlc_dl_bytes(int bytes); - void rlc_dl_payload_bytes(int bytes); - void rlc_ul_bytes(int bytes); - void rlc_ul_payload_bytes(int bytes); - void decode_error(); - void sba_allocated(); - void sba_freed(); - void sba_timedout(); - void llc_timedout_frame(); - void llc_dropped_frame(); - void llc_frame_sched(); - void llc_dl_bytes(int bytes); - void llc_ul_bytes(int bytes); - void rach_frame(); - void rach_frame_11bit(); - void spb_uplink_first_segment(); - void spb_uplink_second_segment(); - void spb_downlink_first_segment(); - void spb_downlink_second_segment(); - void immediate_assignment_ul_tbf(); - void immediate_assignment_reject(); - void immediate_assignment_dl_tbf(); - void channel_request_description(); - void pkt_ul_assignment(); - void pkt_access_reject(); - void pkt_dl_assignemnt(); - void rlc_rcvd_control(); - void pua_poll_timedout(); - void pua_poll_failed(); - void pda_poll_timedout(); - void pda_poll_failed(); - void pkt_ul_ack_nack_poll_timedout(); - void pkt_ul_ack_nack_poll_failed(); - void pkt_dl_ack_nack_poll_timedout(); - void pkt_dl_ack_nack_poll_failed(); - void gprs_dl_cs1(); - void gprs_dl_cs2(); - void gprs_dl_cs3(); - void gprs_dl_cs4(); - void egprs_dl_mcs1(); - void egprs_dl_mcs2(); - void egprs_dl_mcs3(); - void egprs_dl_mcs4(); - void egprs_dl_mcs5(); - void egprs_dl_mcs6(); - void egprs_dl_mcs7(); - void egprs_dl_mcs8(); - void egprs_dl_mcs9(); - void gprs_ul_cs1(); - void gprs_ul_cs2(); - void gprs_ul_cs3(); - void gprs_ul_cs4(); - void egprs_ul_mcs1(); - void egprs_ul_mcs2(); - void egprs_ul_mcs3(); - void egprs_ul_mcs4(); - void egprs_ul_mcs5(); - void egprs_ul_mcs6(); - void egprs_ul_mcs7(); - void egprs_ul_mcs8(); - void egprs_ul_mcs9(); - void ms_present(int32_t n); int32_t ms_present_get(); @@ -572,106 +483,6 @@ { return m_statg; } - -#define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ - inline void BTS::func_name(int inc) {\ - OSMO_ASSERT(m_bts.ctrs); \ - rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ - } - -#define CREATE_COUNT_INLINE(func_name, ctr_name) \ - inline void BTS::func_name() {\ - OSMO_ASSERT(m_bts.ctrs); \ - rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ - } - -CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) -CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) -CREATE_COUNT_INLINE(tbf_dl_aborted, CTR_TBF_DL_ABORTED) -CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) -CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) -CREATE_COUNT_INLINE(tbf_ul_aborted, CTR_TBF_UL_ABORTED) -CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) -CREATE_COUNT_INLINE(tbf_alloc_algo_a, CTR_TBF_ALLOC_ALGO_A) -CREATE_COUNT_INLINE(tbf_alloc_algo_b, CTR_TBF_ALLOC_ALGO_B) -CREATE_COUNT_INLINE(tbf_failed_egprs_only, CTR_TBF_FAILED_EGPRS_ONLY) -CREATE_COUNT_INLINE(rlc_sent, CTR_RLC_SENT) -CREATE_COUNT_INLINE(rlc_resent, CTR_RLC_RESENT) -CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) -CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) -CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) -CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); -CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); -CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_ack_failed, CTR_RLC_ACK_FAILED); -CREATE_COUNT_INLINE(rlc_rel_timedout, CTR_RLC_REL_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_late_block, CTR_RLC_LATE_BLOCK); -CREATE_COUNT_INLINE(rlc_sent_dummy, CTR_RLC_SENT_DUMMY); -CREATE_COUNT_INLINE(rlc_sent_control, CTR_RLC_SENT_CONTROL); -CREATE_COUNT_ADD_INLINE(rlc_dl_bytes, CTR_RLC_DL_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_dl_payload_bytes, CTR_RLC_DL_PAYLOAD_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_ul_bytes, CTR_RLC_UL_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_ul_payload_bytes, CTR_RLC_UL_PAYLOAD_BYTES); -CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) -CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) -CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) -CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) -CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); -CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); -CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); -CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); -CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); -CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); -CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); -CREATE_COUNT_INLINE(spb_uplink_first_segment, CTR_SPB_UL_FIRST_SEGMENT); -CREATE_COUNT_INLINE(spb_uplink_second_segment, CTR_SPB_UL_SECOND_SEGMENT); -CREATE_COUNT_INLINE(spb_downlink_first_segment, CTR_SPB_DL_FIRST_SEGMENT); -CREATE_COUNT_INLINE(spb_downlink_second_segment, CTR_SPB_DL_SECOND_SEGMENT); -CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); -CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); -CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); -CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); -CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); -CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); -CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); -CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); -CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); -CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); -CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); -CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); -CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); -CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); -CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); -CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); -CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); -CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); -CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); -CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); -CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); -CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); -CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); -CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); -CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); -CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); -CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); -CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); -CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); -CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); -CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); -CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); -CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); -CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); -CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); -CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); -CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); -CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); - -#undef CREATE_COUNT_INLINE #define CREATE_STAT_INLINE(func_name, func_name_get, stat_name) \ inline void BTS::func_name(int32_t val) {\ diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 2350808..838d6b2 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,6 +25,10 @@ #include "pcu_utils.h" +extern "C" { +#include "pcu_ctr.h" +} + static uint32_t sched_poll(BTS *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, struct gprs_rlcmac_tbf **poll_tbf, @@ -316,18 +320,18 @@ switch(cat) { case PCU_GSMTAP_C_DL_CTRL: - bts->bts->rlc_sent_control(); + rlc_sent_control(bts->bts->bts_data()->ctrs); bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DATA_GPRS: - bts->bts->rlc_sent(); + rlc_sent(bts->bts->bts_data()->ctrs); /* FIXME: distinguish between GPRS and EGPRS */ bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DUMMY: - bts->bts->rlc_sent_dummy(); + rlc_sent_dummy(bts->bts->bts_data()->ctrs); bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); break; @@ -403,7 +407,7 @@ if (!msg) return -ENOMEM; /* msg is now available */ - bts->bts->rlc_dl_bytes(msg->data_len); + rlc_dl_bytes(bts->bts->bts_data()->ctrs, msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 2b08cf6..e657f3a 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -29,6 +29,10 @@ #include #include +extern "C" { +#include "pcu_ctr.h" +} + /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 @@ -485,7 +489,7 @@ ms_->set_reserved_slots(trx, 1 << ts, 1 << ts); tbf_->upgrade_to_multislot = 0; - bts->bts->tbf_alloc_algo_a(); + tbf_alloc_algo_a(bts->bts->bts_data()->ctrs); return 0; } @@ -1021,7 +1025,7 @@ } } - bts->bts->tbf_alloc_algo_b(); + tbf_alloc_algo_b(bts->bts->bts_data()->ctrs); return 0; } diff --git a/src/llc.cpp b/src/llc.cpp index 79afc37..182fdfc 100644 --- a/src/llc.cpp +++ b/src/llc.cpp @@ -25,6 +25,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include } @@ -126,7 +127,7 @@ while ((msg = msgb_dequeue(&m_queue))) { if (bts) - bts->llc_dropped_frame(); + llc_dropped_frame(bts->bts_data()->ctrs); msgb_free(msg); } diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h index 8f62bf9..235ecd4 100644 --- a/src/pcu_ctr.h +++ b/src/pcu_ctr.h @@ -22,8 +22,197 @@ #pragma once +#include +#include + #include #include #include +enum { + CTR_TBF_DL_ALLOCATED, + CTR_TBF_DL_FREED, + CTR_TBF_DL_ABORTED, + CTR_TBF_UL_ALLOCATED, + CTR_TBF_UL_FREED, + CTR_TBF_UL_ABORTED, + CTR_TBF_REUSED, + CTR_TBF_ALLOC_ALGO_A, + CTR_TBF_ALLOC_ALGO_B, + CTR_TBF_FAILED_EGPRS_ONLY, + CTR_RLC_SENT, + CTR_RLC_RESENT, + CTR_RLC_RESTARTED, + CTR_RLC_STALLED, + CTR_RLC_NACKED, + CTR_RLC_FINAL_BLOCK_RESENT, + CTR_RLC_ASS_TIMEDOUT, + CTR_RLC_ASS_FAILED, + CTR_RLC_ACK_TIMEDOUT, + CTR_RLC_ACK_FAILED, + CTR_RLC_REL_TIMEDOUT, + CTR_RLC_LATE_BLOCK, + CTR_RLC_SENT_DUMMY, + CTR_RLC_SENT_CONTROL, + CTR_RLC_DL_BYTES, + CTR_RLC_DL_PAYLOAD_BYTES, + CTR_RLC_UL_BYTES, + CTR_RLC_UL_PAYLOAD_BYTES, + CTR_DECODE_ERRORS, + CTR_SBA_ALLOCATED, + CTR_SBA_FREED, + CTR_SBA_TIMEDOUT, + CTR_LLC_FRAME_TIMEDOUT, + CTR_LLC_FRAME_DROPPED, + CTR_LLC_FRAME_SCHED, + CTR_LLC_DL_BYTES, + CTR_LLC_UL_BYTES, + CTR_RACH_REQUESTS, + CTR_11BIT_RACH_REQUESTS, + CTR_SPB_UL_FIRST_SEGMENT, + CTR_SPB_UL_SECOND_SEGMENT, + CTR_SPB_DL_FIRST_SEGMENT, + CTR_SPB_DL_SECOND_SEGMENT, + CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_REJ, + CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_CHANNEL_REQUEST_DESCRIPTION, + CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_ACCESS_REJ, + CTR_PKT_DL_ASSIGNMENT, + CTR_RLC_RECV_CONTROL, + CTR_PUA_POLL_TIMEDOUT, + CTR_PUA_POLL_FAILED, + CTR_PDA_POLL_TIMEDOUT, + CTR_PDA_POLL_FAILED, + CTR_PUAN_POLL_TIMEDOUT, + CTR_PUAN_POLL_FAILED, + CTR_PDAN_POLL_TIMEDOUT, + CTR_PDAN_POLL_FAILED, + CTR_GPRS_DL_CS1, + CTR_GPRS_DL_CS2, + CTR_GPRS_DL_CS3, + CTR_GPRS_DL_CS4, + CTR_EGPRS_DL_MCS1, + CTR_EGPRS_DL_MCS2, + CTR_EGPRS_DL_MCS3, + CTR_EGPRS_DL_MCS4, + CTR_EGPRS_DL_MCS5, + CTR_EGPRS_DL_MCS6, + CTR_EGPRS_DL_MCS7, + CTR_EGPRS_DL_MCS8, + CTR_EGPRS_DL_MCS9, + CTR_GPRS_UL_CS1, + CTR_GPRS_UL_CS2, + CTR_GPRS_UL_CS3, + CTR_GPRS_UL_CS4, + CTR_EGPRS_UL_MCS1, + CTR_EGPRS_UL_MCS2, + CTR_EGPRS_UL_MCS3, + CTR_EGPRS_UL_MCS4, + CTR_EGPRS_UL_MCS5, + CTR_EGPRS_UL_MCS6, + CTR_EGPRS_UL_MCS7, + CTR_EGPRS_UL_MCS8, + CTR_EGPRS_UL_MCS9, + }; + struct rate_ctr_group *pcu_ctr_init(); + +#define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ + inline void func_name(struct rate_ctr_group *ctrs, int inc) { \ + OSMO_ASSERT(ctrs); \ + rate_ctr_add(&ctrs->ctr[ctr_name], inc); \ + } + +#define CREATE_COUNT_INLINE(func_name, ctr_name) \ + static inline void func_name(struct rate_ctr_group *ctrs) {\ + OSMO_ASSERT(ctrs); \ + rate_ctr_inc(&ctrs->ctr[ctr_name]); \ + } + +CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) +CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) +CREATE_COUNT_INLINE(tbf_dl_aborted, CTR_TBF_DL_ABORTED) +CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) +CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) +CREATE_COUNT_INLINE(tbf_ul_aborted, CTR_TBF_UL_ABORTED) +CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) +CREATE_COUNT_INLINE(tbf_alloc_algo_a, CTR_TBF_ALLOC_ALGO_A) +CREATE_COUNT_INLINE(tbf_alloc_algo_b, CTR_TBF_ALLOC_ALGO_B) +CREATE_COUNT_INLINE(tbf_failed_egprs_only, CTR_TBF_FAILED_EGPRS_ONLY) +CREATE_COUNT_INLINE(rlc_sent, CTR_RLC_SENT) +CREATE_COUNT_INLINE(rlc_resent, CTR_RLC_RESENT) +CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) +CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) +CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) +CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); +CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); +CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_ack_failed, CTR_RLC_ACK_FAILED); +CREATE_COUNT_INLINE(rlc_rel_timedout, CTR_RLC_REL_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_late_block, CTR_RLC_LATE_BLOCK); +CREATE_COUNT_INLINE(rlc_sent_dummy, CTR_RLC_SENT_DUMMY); +CREATE_COUNT_INLINE(rlc_sent_control, CTR_RLC_SENT_CONTROL); +CREATE_COUNT_ADD_INLINE(rlc_dl_bytes, CTR_RLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_dl_payload_bytes, CTR_RLC_DL_PAYLOAD_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_bytes, CTR_RLC_UL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_payload_bytes, CTR_RLC_UL_PAYLOAD_BYTES); +CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) +CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) +CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) +CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) +CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); +CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); +CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); +CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); +CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); +CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); +CREATE_COUNT_INLINE(spb_uplink_first_segment, CTR_SPB_UL_FIRST_SEGMENT); +CREATE_COUNT_INLINE(spb_uplink_second_segment, CTR_SPB_UL_SECOND_SEGMENT); +CREATE_COUNT_INLINE(spb_downlink_first_segment, CTR_SPB_DL_FIRST_SEGMENT); +CREATE_COUNT_INLINE(spb_downlink_second_segment, CTR_SPB_DL_SECOND_SEGMENT); +CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); +CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); +CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); +CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); +CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); +CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); +CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); +CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); +CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); +CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); +CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); +CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); +CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); +CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); +CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); +CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); +CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); +CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); +CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); +CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); +CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); +CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); +CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); +CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); +CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); +CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); +CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); +CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); +CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); +CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); +CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); +CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); +CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); diff --git a/src/rlc.cpp b/src/rlc.cpp index acd4169..560bbbf 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -23,6 +23,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include } @@ -154,7 +155,7 @@ } else { LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); - bts->rlc_nacked(); + rlc_nacked(bts->bts_data()->ctrs); *lost += 1; } } @@ -178,7 +179,7 @@ } else { LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); - bts->rlc_nacked(); + rlc_nacked(bts->bts_data()->ctrs); *lost += 1; } } diff --git a/src/sba.cpp b/src/sba.cpp index 56a7543..450cdc6 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -26,6 +26,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include #include } @@ -84,7 +85,7 @@ sba->ta = ta; llist_add(&sba->list, &m_sbas); - m_bts.sba_allocated(); + sba_allocated(m_bts.bts_data()->ctrs); *_trx = trx; *_ts = ts; @@ -130,14 +131,14 @@ LOGP(DRLCMAC, LOGL_NOTICE, "Poll timeout for SBA (TRX=%u, TS=%u, FN=%u, TA=%u)\n", sba->trx_no, sba->ts_no, sba->fn, sba->ta); - m_bts.sba_timedout(); + sba_timedout(m_bts.bts_data()->ctrs); free_sba(sba); return 0; } void SBAController::free_sba(gprs_rlcmac_sba *sba) { - m_bts.sba_freed(); + sba_freed(m_bts.bts_data()->ctrs); llist_del(&sba->list); talloc_free(sba); } diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..1dd190f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -31,6 +31,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include #include #include @@ -421,9 +422,9 @@ /* update counters */ if (tbf->direction == GPRS_RLCMAC_UL_TBF) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf); - tbf->bts->tbf_ul_freed(); + tbf_ul_freed(tbf->bts->bts_data()->ctrs); if (tbf->state_is(GPRS_RLCMAC_FLOW)) - tbf->bts->tbf_ul_aborted(); + tbf_ul_aborted(tbf->bts->bts_data()->ctrs); rate_ctr_group_free(ul_tbf->m_ul_egprs_ctrs); rate_ctr_group_free(ul_tbf->m_ul_gprs_ctrs); } else { @@ -433,9 +434,9 @@ } else { rate_ctr_group_free(dl_tbf->m_dl_gprs_ctrs); } - tbf->bts->tbf_dl_freed(); + tbf_dl_freed(tbf->bts->bts_data()->ctrs); if (tbf->state_is(GPRS_RLCMAC_FLOW)) - tbf->bts->tbf_dl_aborted(); + tbf_dl_aborted(tbf->bts->bts_data()->ctrs); } /* Give final measurement report */ @@ -653,14 +654,14 @@ LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling PACKET CONTROL ACK for PACKET UPLINK ACK\n"); rlcmac_diag(); } - bts->rlc_ack_timedout(); - bts->pkt_ul_ack_nack_poll_timedout(); + rlc_ack_timedout(bts->bts_data()->ctrs); + pkt_ul_ack_nack_poll_timedout(bts->bts_data()->ctrs); if (state_is(GPRS_RLCMAC_FINISHED)) { ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); - bts->pkt_ul_ack_nack_poll_failed(); + pkt_ul_ack_nack_poll_failed(bts->bts_data()->ctrs); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); return; @@ -679,14 +680,14 @@ } ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; - bts->rlc_ass_timedout(); - bts->pua_poll_timedout(); + rlc_ass_timedout(bts->bts_data()->ctrs); + pua_poll_timedout(bts->bts_data()->ctrs); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); - bts->rlc_ass_failed(); - bts->pua_poll_failed(); + rlc_ass_failed(bts->bts_data()->ctrs); + pua_poll_failed(bts->bts_data()->ctrs); return; } /* reschedule UL assignment */ @@ -701,14 +702,14 @@ } dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; - bts->rlc_ass_timedout(); - bts->pda_poll_timedout(); + rlc_ass_timedout(bts->bts_data()->ctrs); + pda_poll_timedout(bts->bts_data()->ctrs); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); - bts->rlc_ass_failed(); - bts->pda_poll_failed(); + rlc_ass_failed(bts->bts_data()->ctrs); + pda_poll_failed(bts->bts_data()->ctrs); return; } /* reschedule DL assignment */ @@ -724,17 +725,17 @@ } dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) - bts->rlc_rel_timedout(); + rlc_rel_timedout(bts->bts_data()->ctrs); else { - bts->rlc_ack_timedout(); - bts->pkt_dl_ack_nack_poll_timedout(); + rlc_ack_timedout(bts->bts_data()->ctrs); + pkt_dl_ack_nack_poll_timedout(bts->bts_data()->ctrs); } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(dl_tbf, 3195, dl_tbf->bts_data()->t3195, 0); - bts->pkt_dl_ack_nack_poll_failed(); - bts->rlc_ack_failed(); + pkt_dl_ack_nack_poll_failed(bts->bts_data()->ctrs); + rlc_ack_failed(bts->bts_data()->ctrs); return; } /* resend IMM.ASS on CCCH on timeout */ @@ -840,7 +841,7 @@ if (egprs_ms_class == 0 && bts->egprs_enabled) { LOGP(DRLCMAC, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n"); - bts->bts->tbf_failed_egprs_only(); + tbf_failed_egprs_only(bts->bts->bts_data()->ctrs); return NULL; } @@ -887,7 +888,7 @@ } llist_add(&tbf->list(), &bts->bts->ul_tbfs()); - tbf->bts->tbf_ul_created(); + tbf_ul_created(tbf->bts->bts_data()->ctrs); return tbf; } @@ -932,7 +933,7 @@ if (ms_class > 0) { LOGP(DRLCMAC, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n"); - bts->bts->tbf_failed_egprs_only(); + tbf_failed_egprs_only(bts->bts->bts_data()->ctrs); return NULL; } egprs_ms_class = 1; @@ -986,7 +987,7 @@ } llist_add(&tbf->list(), &bts->bts->dl_tbfs()); - tbf->bts->tbf_dl_created(); + tbf_dl_created(tbf->bts->bts_data()->ctrs); tbf->m_last_dl_poll_fn = -1; tbf->m_last_dl_drained_fn = -1; @@ -1180,7 +1181,7 @@ encode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); - bts->pkt_dl_assignemnt(); + pkt_dl_assignemnt(bts->bts_data()->ctrs); bitvec_pack(ass_vec, msgb_put(msg, 23)); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1213,7 +1214,7 @@ Encoding::write_packet_access_reject( packet_access_rej, tlli()); - bts->pkt_access_reject(); + pkt_access_reject(bts->bts_data()->ctrs); bitvec_pack(packet_access_rej, msgb_put(msg, 23)); @@ -1279,7 +1280,7 @@ decode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); - bts->pkt_ul_assignment(); + pkt_ul_assignment(bts->bts_data()->ctrs); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1312,7 +1313,7 @@ { struct gprs_rlcmac_dl_tbf *new_tbf = NULL; - bts->tbf_reused(); + tbf_reused(bts->bts_data()->ctrs); new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), @@ -1468,7 +1469,7 @@ ms->set_tlli(tlli); llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); - ul_tbf->bts->tbf_ul_created(); + tbf_ul_created(ul_tbf->bts->bts_data()->ctrs); ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 3d27883..deeb89e 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -32,6 +32,7 @@ #include "pcu_utils.h" extern "C" { +#include "pcu_ctr.h" #include #include #include @@ -295,12 +296,12 @@ break; } - bts->llc_timedout_frame(); + llc_timedout_frame(bts->bts_data()->ctrs); drop_frame: frames++; octets += msg->len; msgb_free(msg); - bts->llc_dropped_frame(); + llc_dropped_frame(bts->bts_data()->ctrs); continue; } @@ -407,19 +408,19 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Resending BSN %d\n", bsn); /* re-send block with negative aknowlegement */ m_window.m_v_b.mark_unacked(bsn); - bts->rlc_resent(); + rlc_resent(bts->bts_data()->ctrs); } else if (state_is(GPRS_RLCMAC_FINISHED)) { LOGP(DRLCMACDL, LOGL_DEBUG, "- Restarting at BSN %d, " "because all blocks have been transmitted.\n", m_window.v_a()); - bts->rlc_restarted(); + rlc_restarted(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else if (dl_window_stalled()) { LOGP(DRLCMACDL, LOGL_NOTICE, "- Restarting at BSN %d, " "because the window is stalled.\n", m_window.v_a()); - bts->rlc_stalled(); + rlc_stalled(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else if (have_data()) { @@ -435,7 +436,7 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Restarting at BSN %d, " "because all blocks have been transmitted (FLOW).\n", m_window.v_a()); - bts->rlc_restarted(); + rlc_restarted(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else { @@ -452,8 +453,8 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Nothing else to send, Re-transmit final block!\n"); bsn = m_window.v_s_mod(-1); - bts->rlc_final_block_resent(); - bts->rlc_resent(); + rlc_final_block_resent(bts->bts_data()->ctrs); + rlc_resent(bts->bts_data()->ctrs); } *may_combine = m_rlc.block(bsn)->cs_current_trans.numDataBlocks() > 1; @@ -535,7 +536,7 @@ tbf_name(this), msg->len); m_llc.put_frame(msg->data, msg->len); - bts->llc_frame_sched(); + llc_frame_sched(bts->bts_data()->ctrs); msgb_free(msg); m_last_dl_drained_fn = -1; } @@ -611,7 +612,7 @@ &m_llc, &write_offset, &num_chunks, data, is_final, &payload_written); if (payload_written > 0) - bts->rlc_dl_payload_bytes(payload_written); + rlc_dl_payload_bytes(bts->bts_data()->ctrs, payload_written); if (ar == Encoding::AR_NEED_MORE_BLOCKS) break; @@ -619,7 +620,7 @@ LOGP(DRLCMACDL, LOGL_INFO, "Complete DL frame for %s" "len=%d\n", tbf_name(this), m_llc.frame_length()); gprs_rlcmac_dl_bw(this, m_llc.frame_length()); - bts->llc_dl_bytes(m_llc.frame_length()); + llc_dl_bytes(bts->bts_data()->ctrs, m_llc.frame_length()); m_llc.reset(); if (is_final) { @@ -1359,19 +1360,19 @@ if (block_status_dl == EGPRS_RESEG_FIRST_SEG_SENT) { /* statistics */ - bts->spb_downlink_second_segment(); + spb_downlink_second_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_SEC_SEG; } else if ((cs_init.headerTypeData() == GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1) || (cs_init.headerTypeData() == GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2)) { - bts->spb_downlink_first_segment(); + spb_downlink_first_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_FIRST_SEG; } else if ((GprsCodingScheme::Scheme(cs_init) == GprsCodingScheme::MCS4) && (GprsCodingScheme::Scheme(cs_current_trans) == GprsCodingScheme::MCS1)) { - bts->spb_downlink_first_segment(); + spb_downlink_first_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_FIRST_SEG; } } @@ -1407,58 +1408,58 @@ if (cs.isGprs()) { switch (coding_scheme) { case GprsCodingScheme::CS1 : - bts->gprs_dl_cs1(); + gprs_dl_cs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS1]); break; case GprsCodingScheme::CS2 : - bts->gprs_dl_cs2(); + gprs_dl_cs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS2]); break; case GprsCodingScheme::CS3 : - bts->gprs_dl_cs3(); + gprs_dl_cs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS3]); break; case GprsCodingScheme::CS4 : - bts->gprs_dl_cs4(); + gprs_dl_cs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS4]); break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : - bts->egprs_dl_mcs1(); + egprs_dl_mcs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS1]); break; case GprsCodingScheme::MCS2 : - bts->egprs_dl_mcs2(); + egprs_dl_mcs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS2]); break; case GprsCodingScheme::MCS3 : - bts->egprs_dl_mcs3(); + egprs_dl_mcs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS3]); break; case GprsCodingScheme::MCS4 : - bts->egprs_dl_mcs4(); + egprs_dl_mcs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS4]); break; case GprsCodingScheme::MCS5 : - bts->egprs_dl_mcs5(); + egprs_dl_mcs5(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS5]); break; case GprsCodingScheme::MCS6 : - bts->egprs_dl_mcs6(); + egprs_dl_mcs6(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS6]); break; case GprsCodingScheme::MCS7 : - bts->egprs_dl_mcs7(); + egprs_dl_mcs7(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS7]); break; case GprsCodingScheme::MCS8 : - bts->egprs_dl_mcs8(); + egprs_dl_mcs8(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS8]); break; case GprsCodingScheme::MCS9 : - bts->egprs_dl_mcs9(); + egprs_dl_mcs9(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS9]); break; } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 81d3b24..1f8f0f6 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -32,6 +32,7 @@ #include "pcu_utils.h" extern "C" { +#include "pcu_ctr.h" #include #include } @@ -70,7 +71,7 @@ frame = frames + i; if (frame->length) { - bts->rlc_ul_payload_bytes(frame->length); + rlc_ul_payload_bytes(bts->bts_data()->ctrs, frame->length); LOGP(DRLCMACUL, LOGL_DEBUG, "-- Frame %d " "starts at offset %d, " @@ -87,7 +88,7 @@ LOGP(DRLCMACUL, LOGL_INFO, "%s complete UL frame len=%d\n", tbf_name(this) , m_llc.frame_length()); snd_ul_ud(); - bts->llc_ul_bytes(m_llc.frame_length()); + llc_ul_bytes(bts->bts_data()->ctrs, m_llc.frame_length()); m_llc.reset(); } } @@ -277,7 +278,7 @@ rdbi, rlc->cs, rlc_data, NULL, 0, &new_tlli); if (num_chunks < 0) { - bts->decode_error(); + decode_error(bts->bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_NOTICE, "Failed to decode TLLI of %s UL DATA " "TFI=%d.\n", rlc->cs.name(), rlc->tfi); @@ -419,7 +420,7 @@ union split_block_status *spb_status = &block->spb_status; uint8_t *rlc_data = &block->block[0]; - bts->spb_uplink_second_segment(); + spb_uplink_second_segment(bts->bts_data()->ctrs); if (spb_status->block_status_ul & EGPRS_RESEG_FIRST_SEG_RXD) { @@ -457,7 +458,7 @@ uint8_t *rlc_data = &block->block[0]; union split_block_status *spb_status = &block->spb_status; - bts->spb_uplink_first_segment(); + spb_uplink_first_segment(bts->bts_data()->ctrs); if (spb_status->block_status_ul & EGPRS_RESEG_SECOND_SEG_RXD) { LOGP(DRLCMACUL, LOGL_DEBUG, @@ -552,58 +553,58 @@ if (cs.isGprs()) { switch (coding_scheme) { case GprsCodingScheme::CS1 : - bts->gprs_ul_cs1(); + gprs_ul_cs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS1]); break; case GprsCodingScheme::CS2 : - bts->gprs_ul_cs2(); + gprs_ul_cs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS2]); break; case GprsCodingScheme::CS3 : - bts->gprs_ul_cs3(); + gprs_ul_cs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS3]); break; case GprsCodingScheme::CS4 : - bts->gprs_ul_cs4(); + gprs_ul_cs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS4]); break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : - bts->egprs_ul_mcs1(); + egprs_ul_mcs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS1]); break; case GprsCodingScheme::MCS2 : - bts->egprs_ul_mcs2(); + egprs_ul_mcs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS2]); break; case GprsCodingScheme::MCS3 : - bts->egprs_ul_mcs3(); + egprs_ul_mcs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS3]); break; case GprsCodingScheme::MCS4 : - bts->egprs_ul_mcs4(); + egprs_ul_mcs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS4]); break; case GprsCodingScheme::MCS5 : - bts->egprs_ul_mcs5(); + egprs_ul_mcs5(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS5]); break; case GprsCodingScheme::MCS6 : - bts->egprs_ul_mcs6(); + egprs_ul_mcs6(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS6]); break; case GprsCodingScheme::MCS7 : - bts->egprs_ul_mcs7(); + egprs_ul_mcs7(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS7]); break; case GprsCodingScheme::MCS8 : - bts->egprs_ul_mcs8(); + egprs_ul_mcs8(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS8]); break; case GprsCodingScheme::MCS9 : - bts->egprs_ul_mcs9(); + egprs_ul_mcs9(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS9]); break; } -- To view, visit https://gerrit.osmocom.org/4413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Oct 25 14:42:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 14:42:22 +0000 Subject: osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) > why the extensive move / separate files are needed There's a ticket about getting rid of BTS singleton so this seems like a good opportunity to move it. Besides, once it does not operate on BTS members it has nothing to do with it so it's better to put this into separate file. https://gerrit.osmocom.org/#/c/4411/3/src/bts.h File src/bts.h: Line 220: struct rate_ctr_group *ctrs; > curious, any reason to place it squarely in the middle between lots of unre Where would you prefer to see it? -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 25 14:51:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 14:51:57 +0000 Subject: [PATCH] osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4411 to look at the new patch set (#4). Initialize logging before initializing rate_ctr The library code for rate counter initialization might already want to log something (particularly after Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Before the rate counters were initialized implicitly in BTS constructor which makes proper logging init impossible. Fix this by using explicit init similar to the way we do it for vty. Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 --- M src/Makefile.am M src/bts.cpp M src/bts.h A src/pcu_ctr.c A src/pcu_ctr.h M src/pcu_main.cpp M src/pcu_vty.c M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp M tests/types/TypesTest.cpp 10 files changed, 191 insertions(+), 121 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/11/4411/4 diff --git a/src/Makefile.am b/src/Makefile.am index 1543851..67291ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,7 @@ gprs_ms_storage.cpp \ gsm_timer.cpp \ pcu_l1_if.cpp \ + pcu_ctr.c \ pcu_vty.c \ pcu_vty_functions.cpp \ tbf.cpp \ @@ -79,6 +80,7 @@ gprs_ms_storage.h \ pcu_l1_if.h \ gsm_timer.h \ + pcu_ctr.h \ pcu_vty.h \ pcu_vty_functions.h \ tbf.h \ diff --git a/src/bts.cpp b/src/bts.cpp index b768569..0f7462a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -50,107 +50,6 @@ static BTS s_bts; -/** - * For gcc-4.4 compat do not use extended initializer list but keep the - * order from the enum here. Once we support GCC4.7 and up we can change - * the code below. - */ -static const struct rate_ctr_desc bts_ctr_description[] = { - { "tbf.dl.alloc", "TBF DL Allocated "}, - { "tbf.dl.freed", "TBF DL Freed "}, - { "tbf.dl.aborted", "TBF DL Aborted "}, - { "tbf.ul.alloc", "TBF UL Allocated "}, - { "tbf.ul.freed", "TBF UL Freed "}, - { "tbf.ul.aborted", "TBF UL Aborted "}, - { "tbf.reused", "TBF Reused "}, - { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, - { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, - { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, - { "rlc.sent", "RLC Sent "}, - { "rlc.resent", "RLC Resent "}, - { "rlc.restarted", "RLC Restarted "}, - { "rlc.stalled", "RLC Stalled "}, - { "rlc.nacked", "RLC Nacked "}, - { "rlc.final_block_resent", "RLC Final Blk resent "}, - { "rlc.ass.timedout", "RLC Assign Timeout "}, - { "rlc.ass.failed", "RLC Assign Failed "}, - { "rlc.ack.timedout", "RLC Ack Timeout "}, - { "rlc.ack.failed", "RLC Ack Failed "}, - { "rlc.rel.timedout", "RLC Release Timeout "}, - { "rlc.late-block", "RLC Late Block "}, - { "rlc.sent-dummy", "RLC Sent Dummy "}, - { "rlc.sent-control", "RLC Sent Control "}, - { "rlc.dl_bytes", "RLC DL Bytes "}, - { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, - { "rlc.ul_bytes", "RLC UL Bytes "}, - { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, - { "decode.errors", "Decode Errors "}, - { "sba.allocated", "SBA Allocated "}, - { "sba.freed", "SBA Freed "}, - { "sba.timedout", "SBA Timeout "}, - { "llc.timeout", "Timedout Frames "}, - { "llc.dropped", "Dropped Frames "}, - { "llc.scheduled", "Scheduled Frames "}, - { "llc.dl_bytes", "RLC encapsulated PDUs"}, - { "llc.ul_bytes", "full PDUs received "}, - { "rach.requests", "RACH requests "}, - { "11bit_rach.requests", "11BIT_RACH requests "}, - { "spb.uplink_first_segment", "First seg of UL SPB "}, - { "spb.uplink_second_segment", "Second seg of UL SPB "}, - { "spb.downlink_first_segment", "First seg of DL SPB "}, - { "spb.downlink_second_segment","Second seg of DL SPB "}, - { "immediate.assignment_UL", "Immediate Assign UL "}, - { "immediate.assignment_rej", "Immediate Assign Rej "}, - { "immediate.assignment_DL", "Immediate Assign DL "}, - { "channel.request_description","Channel Request Desc "}, - { "pkt.ul_assignment", "Packet UL Assignment "}, - { "pkt.access_reject", "Packet Access Reject "}, - { "pkt.dl_assignment", "Packet DL Assignment "}, - { "ul.control", "UL control Block "}, - { "ul.assignment_poll_timeout", "UL Assign Timeout "}, - { "ul.assignment_failed", "UL Assign Failed "}, - { "dl.assignment_timeout", "DL Assign Timeout "}, - { "dl.assignment_failed", "DL Assign Failed "}, - { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, - { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, - { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, - { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, - { "gprs.downlink_cs1", "CS1 downlink "}, - { "gprs.downlink_cs2", "CS2 downlink "}, - { "gprs.downlink_cs3", "CS3 downlink "}, - { "gprs.downlink_cs4", "CS4 downlink "}, - { "egprs.downlink_mcs1", "MCS1 downlink "}, - { "egprs.downlink_mcs2", "MCS2 downlink "}, - { "egprs.downlink_mcs3", "MCS3 downlink "}, - { "egprs.downlink_mcs4", "MCS4 downlink "}, - { "egprs.downlink_mcs5", "MCS5 downlink "}, - { "egprs.downlink_mcs6", "MCS6 downlink "}, - { "egprs.downlink_mcs7", "MCS7 downlink "}, - { "egprs.downlink_mcs8", "MCS8 downlink "}, - { "egprs.downlink_mcs9", "MCS9 downlink "}, - { "gprs.uplink_cs1", "CS1 Uplink "}, - { "gprs.uplink_cs2", "CS2 Uplink "}, - { "gprs.uplink_cs3", "CS3 Uplink "}, - { "gprs.uplink_cs4", "CS4 Uplink "}, - { "egprs.uplink_mcs1", "MCS1 Uplink "}, - { "egprs.uplink_mcs2", "MCS2 Uplink "}, - { "egprs.uplink_mcs3", "MCS3 Uplink "}, - { "egprs.uplink_mcs4", "MCS4 Uplink "}, - { "egprs.uplink_mcs5", "MCS5 Uplink "}, - { "egprs.uplink_mcs6", "MCS6 Uplink "}, - { "egprs.uplink_mcs7", "MCS7 Uplink "}, - { "egprs.uplink_mcs8", "MCS8 Uplink "}, - { "egprs.uplink_mcs9", "MCS9 Uplink "}, -}; - -static const struct rate_ctr_group_desc bts_ctrg_desc = { - "bts", - "BTS Statistics", - OSMO_STATS_CLASS_GLOBAL, - ARRAY_SIZE(bts_ctr_description), - bts_ctr_description, -}; - static const struct osmo_stat_item_desc bts_stat_item_description[] = { { "ms.present", "MS Present ", OSMO_STAT_ITEM_NO_UNIT, 4, 0}, @@ -179,11 +78,6 @@ return BTS::main_bts()->bts_data(); } -struct rate_ctr_group *bts_main_data_stats() -{ - return BTS::main_bts()->rate_counters(); -} - BTS::BTS() : m_cur_fn(0) , m_cur_blk_fn(-1) @@ -207,8 +101,6 @@ } } - m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); - OSMO_ASSERT(m_ratectrs); m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0); OSMO_ASSERT(m_statg); } @@ -219,7 +111,8 @@ * m_ms_store's destructor */ m_ms_store.cleanup(); - rate_ctr_group_free(m_ratectrs); + if (m_bts.ctrs) + rate_ctr_group_free(m_bts.ctrs); osmo_stat_item_group_free(m_statg); } diff --git a/src/bts.h b/src/bts.h index d65cd2f..19d948a 100644 --- a/src/bts.h +++ b/src/bts.h @@ -231,6 +231,9 @@ /* State for dynamic algorithm selection */ int multislot_disabled; + /* Statistics */ + struct rate_ctr_group *ctrs; + /** * Point back to the C++ object. This is used during the transition * period. @@ -482,7 +485,6 @@ /* * Below for C interface for the VTY */ - struct rate_ctr_group *rate_counters() const; struct osmo_stat_item_group *stat_items() const; LListHead& ul_tbfs(); @@ -493,7 +495,6 @@ struct gprs_rlcmac_bts m_bts; PollController m_pollController; SBAController m_sba; - struct rate_ctr_group *m_ratectrs; struct osmo_stat_item_group *m_statg; GprsMsStorage m_ms_store; @@ -570,11 +571,6 @@ return m_assigned_tfi[dir]; } -inline struct rate_ctr_group *BTS::rate_counters() const -{ - return m_ratectrs; -} - inline struct osmo_stat_item_group *BTS::stat_items() const { return m_statg; @@ -582,12 +578,14 @@ #define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ inline void BTS::func_name(int inc) {\ - rate_ctr_add(&m_ratectrs->ctr[ctr_name], inc); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ } #define CREATE_COUNT_INLINE(func_name, ctr_name) \ inline void BTS::func_name() {\ - rate_ctr_inc(&m_ratectrs->ctr[ctr_name]); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ } CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) @@ -705,7 +703,6 @@ extern "C" { #endif struct gprs_rlcmac_bts *bts_main_data(); - struct rate_ctr_group *bts_main_data_stats(); struct osmo_stat_item_group *bts_main_data_stat_items(); #ifdef __cplusplus } diff --git a/src/pcu_ctr.c b/src/pcu_ctr.c new file mode 100644 index 0000000..6554582 --- /dev/null +++ b/src/pcu_ctr.c @@ -0,0 +1,129 @@ +/* pcu_ctr.c + * + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "pcu_ctr.h" + +#include +#include +#include + +extern void *tall_pcu_ctx; + +struct rate_ctr_group *pcu_ctr_init() +{ + static const struct rate_ctr_desc bts_ctr_description[] = { + { "tbf.dl.alloc", "TBF DL Allocated "}, + { "tbf.dl.freed", "TBF DL Freed "}, + { "tbf.dl.aborted", "TBF DL Aborted "}, + { "tbf.ul.alloc", "TBF UL Allocated "}, + { "tbf.ul.freed", "TBF UL Freed "}, + { "tbf.ul.aborted", "TBF UL Aborted "}, + { "tbf.reused", "TBF Reused "}, + { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, + { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, + { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, + { "rlc.sent", "RLC Sent "}, + { "rlc.resent", "RLC Resent "}, + { "rlc.restarted", "RLC Restarted "}, + { "rlc.stalled", "RLC Stalled "}, + { "rlc.nacked", "RLC Nacked "}, + { "rlc.final_block_resent", "RLC Final Blk resent "}, + { "rlc.ass.timedout", "RLC Assign Timeout "}, + { "rlc.ass.failed", "RLC Assign Failed "}, + { "rlc.ack.timedout", "RLC Ack Timeout "}, + { "rlc.ack.failed", "RLC Ack Failed "}, + { "rlc.rel.timedout", "RLC Release Timeout "}, + { "rlc.late-block", "RLC Late Block "}, + { "rlc.sent-dummy", "RLC Sent Dummy "}, + { "rlc.sent-control", "RLC Sent Control "}, + { "rlc.dl_bytes", "RLC DL Bytes "}, + { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, + { "rlc.ul_bytes", "RLC UL Bytes "}, + { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, + { "decode.errors", "Decode Errors "}, + { "sba.allocated", "SBA Allocated "}, + { "sba.freed", "SBA Freed "}, + { "sba.timedout", "SBA Timeout "}, + { "llc.timeout", "Timedout Frames "}, + { "llc.dropped", "Dropped Frames "}, + { "llc.scheduled", "Scheduled Frames "}, + { "llc.dl_bytes", "RLC encapsulated PDUs"}, + { "llc.ul_bytes", "full PDUs received "}, + { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "spb.uplink_first_segment", "First seg of UL SPB "}, + { "spb.uplink_second_segment", "Second seg of UL SPB "}, + { "spb.downlink_first_segment", "First seg of DL SPB "}, + { "spb.downlink_second_segment","Second seg of DL SPB "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_rej", "Immediate Assign Rej "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "channel.request_description","Channel Request Desc "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.access_reject", "Packet Access Reject "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, + }; + + const struct rate_ctr_group_desc bts_ctrg_desc = { + "bts", + "BTS Statistics", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(bts_ctr_description), + bts_ctr_description, + }; + + return rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); +} diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h new file mode 100644 index 0000000..8f62bf9 --- /dev/null +++ b/src/pcu_ctr.h @@ -0,0 +1,29 @@ +/* pcu_ctr.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by Sysmocom s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#include +#include +#include + +struct rate_ctr_group *pcu_ctr_init(); diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b7574f9..c7dd3ed 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -30,6 +30,7 @@ #include extern "C" { #include "pcu_vty.h" +#include "pcu_ctr.h" #include #include #include @@ -251,6 +252,7 @@ vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); + bts->ctrs = pcu_ctr_init(); handle_options(argc, argv); if ((!!spoof_mcc) + (!!spoof_mnc) == 1) { diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 5ec16ea..c94f7d2 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "pcu_vty.h" #include "gprs_rlcmac.h" @@ -836,7 +837,9 @@ "show bts statistics", SHOW_STR "BTS related functionality\nStatistics\n") { - vty_out_rate_ctr_group(vty, "", bts_main_data_stats()); + struct gprs_rlcmac_bts *bts = bts_main_data(); + + vty_out_rate_ctr_group(vty, "", bts->ctrs); return CMD_SUCCESS; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..48ca24f 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } /* globals used by the code */ @@ -117,6 +118,7 @@ printf("Testing alloc_a direction(%d)\n", dir); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; struct gprs_rlcmac_trx *trx = &bts->trx[0]; @@ -195,6 +197,7 @@ printf("Testing UL then DL assignment.\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -237,6 +240,7 @@ printf("Testing DL then UL assignment followed by update\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -284,6 +288,7 @@ printf("Testing jolly example\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -345,6 +350,7 @@ gprs_rlcmac_tbf *ul_tbf, *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -389,6 +395,7 @@ gprs_rlcmac_dl_tbf *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -482,6 +489,7 @@ uint8_t trx_no = -1; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); gprs_rlcmac_tbf *tbf = NULL; @@ -663,6 +671,7 @@ printf("Going to test assignment with many TBF, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -701,6 +710,7 @@ printf("Going to test assignment with many connections, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -809,6 +819,7 @@ printf("Testing DL TS allocation for Multi UEs\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..604366e 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -30,7 +30,7 @@ extern "C" { #include "pcu_vty.h" - +#include "pcu_ctr.h" #include #include #include @@ -74,6 +74,7 @@ printf("=== start %s ===\n", __func__); + the_bts.bts_data()->ctrs = pcu_ctr_init(); the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a; the_bts.bts_data()->trx[0].pdch[2].enable(); the_bts.bts_data()->trx[0].pdch[3].enable(); @@ -148,6 +149,7 @@ gprs_rlcmac_trx *trx; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; bts->initial_cs_dl = cs; bts->initial_cs_ul = cs; diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 7d09108..25d689b 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } #define OSMO_ASSERT_STR_EQ(a, b) \ @@ -351,6 +352,7 @@ int bsn_begin, bsn_end, num_blocks; Ack_Nack_Description_t desc; + dummy_bts.bts_data()->ctrs = pcu_ctr_init(); dl_win.m_v_b.reset(); OSMO_ASSERT(dl_win.window_empty()); -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 25 14:54:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 25 Oct 2017 14:54:10 +0000 Subject: [PATCH] openbsc[master]: debian/rules: show testsuite.log when tests are failing Message-ID: Review at https://gerrit.osmocom.org/4414 debian/rules: show testsuite.log when tests are failing Change-Id: I30151897d621a1428095006e1f0e8a47059de4cd --- M debian/rules 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/14/4414/1 diff --git a/debian/rules b/debian/rules index 4e187a6..2d1effe 100755 --- a/debian/rules +++ b/debian/rules @@ -30,3 +30,6 @@ echo $(VERSION) > openbsc/.tarball-version dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4414 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I30151897d621a1428095006e1f0e8a47059de4cd Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 25 14:54:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 14:54:22 +0000 Subject: libosmocore[master]: utils: avoid segfault when calling osmo_strlcpy(src=NULL) In-Reply-To: References: Message-ID: Patch Set 1: Even in that case I still think that we have to update tests as well. -- To view, visit https://gerrit.osmocom.org/4407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieba7ba262ace2e370a4b9a550b3131fb13f07413 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 14:54:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 25 Oct 2017 14:54:59 +0000 Subject: openbsc[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 we already have this in many other repositories and it works well -- To view, visit https://gerrit.osmocom.org/4414 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I30151897d621a1428095006e1f0e8a47059de4cd Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 15:15:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 25 Oct 2017 15:15:21 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 6: (3 comments) all in all I think this patch can stay as it is, but I need to fix the db API docs: https://gerrit.osmocom.org/#/c/4311/6/src/ctrl.c File src/ctrl.c: Line 233: aud3g.algo = OSMO_AUTH_ALG_NONE; > I'm confused by this part. In case of ENOENT error we will continue with pr ah, I think that might have come from the VTY code where I used to print "2G auth data: none" in some earlier state of the patches, so that I wanted to output absence and still want to call the printing functions below; doesn't apply here, that's right. Returning immediately is however just a minor optimization, really. In general, ENOENT indicates that no auth data is present, which is a valid situation. Line 258: rc = db_get_auth_data(hlr->dbc, subscr.imsi, &aud2g, &aud3g, NULL); > If someone later have to change db-get_auth_data() they got to make sure no ENOENT rc is a concept used throughout the db API of osmo-hlr, it is imperative to not break that in case of changes. It is documented for all the db functions. ...at least I thought so, I see now that db_get_auth_data() was changed to the ENOENT rc but I forgot to adjust the API comment. Other functions also need fixing of their API doc, it should all read something like db_subscr_nam()'s doc: * Returns 0 on success, -ENOENT when the given IMSI does not exist, -EINVAL if * the SQL statement could not be composed, -ENOEXEC if running the SQL * statement failed, -EIO if the amount of rows modified is unexpected. Line 262: aud3g.algo = OSMO_AUTH_ALG_NONE; > Same here. Maybe move it to separate inline function? here it makes sense to continue. We gather data, then print it below. Note the print_subscr_info() that we still want to call even if no auth data is present. So I would keep this as is, so that ENOENT makes sure to mark auth data as not present and then go on to print whatever we got. I think the two instances of rc evaluation don't justify effort to undup the code yet... but it would make sense in principle, agreed. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 6 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 25 15:26:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 15:26:00 +0000 Subject: [PATCH] osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4411 to look at the new patch set (#5). Initialize logging before initializing rate_ctr The library code for rate counter initialization might already want to log something (particularly after Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Before the rate counters were initialized implicitly in BTS constructor which makes proper logging init impossible. Fix this by using explicit init similar to the way we do it for vty. Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 --- M src/Makefile.am M src/bts.cpp M src/bts.h A src/pcu_ctr.c A src/pcu_ctr.h M src/pcu_main.cpp M src/pcu_vty.c M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp M tests/types/TypesTest.cpp 10 files changed, 191 insertions(+), 121 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/11/4411/5 diff --git a/src/Makefile.am b/src/Makefile.am index 1543851..67291ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,7 @@ gprs_ms_storage.cpp \ gsm_timer.cpp \ pcu_l1_if.cpp \ + pcu_ctr.c \ pcu_vty.c \ pcu_vty_functions.cpp \ tbf.cpp \ @@ -79,6 +80,7 @@ gprs_ms_storage.h \ pcu_l1_if.h \ gsm_timer.h \ + pcu_ctr.h \ pcu_vty.h \ pcu_vty_functions.h \ tbf.h \ diff --git a/src/bts.cpp b/src/bts.cpp index b768569..0f7462a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -50,107 +50,6 @@ static BTS s_bts; -/** - * For gcc-4.4 compat do not use extended initializer list but keep the - * order from the enum here. Once we support GCC4.7 and up we can change - * the code below. - */ -static const struct rate_ctr_desc bts_ctr_description[] = { - { "tbf.dl.alloc", "TBF DL Allocated "}, - { "tbf.dl.freed", "TBF DL Freed "}, - { "tbf.dl.aborted", "TBF DL Aborted "}, - { "tbf.ul.alloc", "TBF UL Allocated "}, - { "tbf.ul.freed", "TBF UL Freed "}, - { "tbf.ul.aborted", "TBF UL Aborted "}, - { "tbf.reused", "TBF Reused "}, - { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, - { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, - { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, - { "rlc.sent", "RLC Sent "}, - { "rlc.resent", "RLC Resent "}, - { "rlc.restarted", "RLC Restarted "}, - { "rlc.stalled", "RLC Stalled "}, - { "rlc.nacked", "RLC Nacked "}, - { "rlc.final_block_resent", "RLC Final Blk resent "}, - { "rlc.ass.timedout", "RLC Assign Timeout "}, - { "rlc.ass.failed", "RLC Assign Failed "}, - { "rlc.ack.timedout", "RLC Ack Timeout "}, - { "rlc.ack.failed", "RLC Ack Failed "}, - { "rlc.rel.timedout", "RLC Release Timeout "}, - { "rlc.late-block", "RLC Late Block "}, - { "rlc.sent-dummy", "RLC Sent Dummy "}, - { "rlc.sent-control", "RLC Sent Control "}, - { "rlc.dl_bytes", "RLC DL Bytes "}, - { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, - { "rlc.ul_bytes", "RLC UL Bytes "}, - { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, - { "decode.errors", "Decode Errors "}, - { "sba.allocated", "SBA Allocated "}, - { "sba.freed", "SBA Freed "}, - { "sba.timedout", "SBA Timeout "}, - { "llc.timeout", "Timedout Frames "}, - { "llc.dropped", "Dropped Frames "}, - { "llc.scheduled", "Scheduled Frames "}, - { "llc.dl_bytes", "RLC encapsulated PDUs"}, - { "llc.ul_bytes", "full PDUs received "}, - { "rach.requests", "RACH requests "}, - { "11bit_rach.requests", "11BIT_RACH requests "}, - { "spb.uplink_first_segment", "First seg of UL SPB "}, - { "spb.uplink_second_segment", "Second seg of UL SPB "}, - { "spb.downlink_first_segment", "First seg of DL SPB "}, - { "spb.downlink_second_segment","Second seg of DL SPB "}, - { "immediate.assignment_UL", "Immediate Assign UL "}, - { "immediate.assignment_rej", "Immediate Assign Rej "}, - { "immediate.assignment_DL", "Immediate Assign DL "}, - { "channel.request_description","Channel Request Desc "}, - { "pkt.ul_assignment", "Packet UL Assignment "}, - { "pkt.access_reject", "Packet Access Reject "}, - { "pkt.dl_assignment", "Packet DL Assignment "}, - { "ul.control", "UL control Block "}, - { "ul.assignment_poll_timeout", "UL Assign Timeout "}, - { "ul.assignment_failed", "UL Assign Failed "}, - { "dl.assignment_timeout", "DL Assign Timeout "}, - { "dl.assignment_failed", "DL Assign Failed "}, - { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, - { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, - { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, - { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, - { "gprs.downlink_cs1", "CS1 downlink "}, - { "gprs.downlink_cs2", "CS2 downlink "}, - { "gprs.downlink_cs3", "CS3 downlink "}, - { "gprs.downlink_cs4", "CS4 downlink "}, - { "egprs.downlink_mcs1", "MCS1 downlink "}, - { "egprs.downlink_mcs2", "MCS2 downlink "}, - { "egprs.downlink_mcs3", "MCS3 downlink "}, - { "egprs.downlink_mcs4", "MCS4 downlink "}, - { "egprs.downlink_mcs5", "MCS5 downlink "}, - { "egprs.downlink_mcs6", "MCS6 downlink "}, - { "egprs.downlink_mcs7", "MCS7 downlink "}, - { "egprs.downlink_mcs8", "MCS8 downlink "}, - { "egprs.downlink_mcs9", "MCS9 downlink "}, - { "gprs.uplink_cs1", "CS1 Uplink "}, - { "gprs.uplink_cs2", "CS2 Uplink "}, - { "gprs.uplink_cs3", "CS3 Uplink "}, - { "gprs.uplink_cs4", "CS4 Uplink "}, - { "egprs.uplink_mcs1", "MCS1 Uplink "}, - { "egprs.uplink_mcs2", "MCS2 Uplink "}, - { "egprs.uplink_mcs3", "MCS3 Uplink "}, - { "egprs.uplink_mcs4", "MCS4 Uplink "}, - { "egprs.uplink_mcs5", "MCS5 Uplink "}, - { "egprs.uplink_mcs6", "MCS6 Uplink "}, - { "egprs.uplink_mcs7", "MCS7 Uplink "}, - { "egprs.uplink_mcs8", "MCS8 Uplink "}, - { "egprs.uplink_mcs9", "MCS9 Uplink "}, -}; - -static const struct rate_ctr_group_desc bts_ctrg_desc = { - "bts", - "BTS Statistics", - OSMO_STATS_CLASS_GLOBAL, - ARRAY_SIZE(bts_ctr_description), - bts_ctr_description, -}; - static const struct osmo_stat_item_desc bts_stat_item_description[] = { { "ms.present", "MS Present ", OSMO_STAT_ITEM_NO_UNIT, 4, 0}, @@ -179,11 +78,6 @@ return BTS::main_bts()->bts_data(); } -struct rate_ctr_group *bts_main_data_stats() -{ - return BTS::main_bts()->rate_counters(); -} - BTS::BTS() : m_cur_fn(0) , m_cur_blk_fn(-1) @@ -207,8 +101,6 @@ } } - m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); - OSMO_ASSERT(m_ratectrs); m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0); OSMO_ASSERT(m_statg); } @@ -219,7 +111,8 @@ * m_ms_store's destructor */ m_ms_store.cleanup(); - rate_ctr_group_free(m_ratectrs); + if (m_bts.ctrs) + rate_ctr_group_free(m_bts.ctrs); osmo_stat_item_group_free(m_statg); } diff --git a/src/bts.h b/src/bts.h index d65cd2f..19d948a 100644 --- a/src/bts.h +++ b/src/bts.h @@ -231,6 +231,9 @@ /* State for dynamic algorithm selection */ int multislot_disabled; + /* Statistics */ + struct rate_ctr_group *ctrs; + /** * Point back to the C++ object. This is used during the transition * period. @@ -482,7 +485,6 @@ /* * Below for C interface for the VTY */ - struct rate_ctr_group *rate_counters() const; struct osmo_stat_item_group *stat_items() const; LListHead& ul_tbfs(); @@ -493,7 +495,6 @@ struct gprs_rlcmac_bts m_bts; PollController m_pollController; SBAController m_sba; - struct rate_ctr_group *m_ratectrs; struct osmo_stat_item_group *m_statg; GprsMsStorage m_ms_store; @@ -570,11 +571,6 @@ return m_assigned_tfi[dir]; } -inline struct rate_ctr_group *BTS::rate_counters() const -{ - return m_ratectrs; -} - inline struct osmo_stat_item_group *BTS::stat_items() const { return m_statg; @@ -582,12 +578,14 @@ #define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ inline void BTS::func_name(int inc) {\ - rate_ctr_add(&m_ratectrs->ctr[ctr_name], inc); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ } #define CREATE_COUNT_INLINE(func_name, ctr_name) \ inline void BTS::func_name() {\ - rate_ctr_inc(&m_ratectrs->ctr[ctr_name]); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ } CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) @@ -705,7 +703,6 @@ extern "C" { #endif struct gprs_rlcmac_bts *bts_main_data(); - struct rate_ctr_group *bts_main_data_stats(); struct osmo_stat_item_group *bts_main_data_stat_items(); #ifdef __cplusplus } diff --git a/src/pcu_ctr.c b/src/pcu_ctr.c new file mode 100644 index 0000000..d3ed801 --- /dev/null +++ b/src/pcu_ctr.c @@ -0,0 +1,41 @@ +/* pcu_ctr.c + * + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "pcu_ctr.h" + +#include +#include +#include + +extern void *tall_pcu_ctx; + +struct rate_ctr_group *pcu_ctr_init() +{ + const struct rate_ctr_group_desc bts_ctrg_desc = { + "bts", + "BTS Statistics", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(bts_ctr_description), + bts_ctr_description, + }; + + return rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); +} diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h new file mode 100644 index 0000000..d90785c --- /dev/null +++ b/src/pcu_ctr.h @@ -0,0 +1,117 @@ +/* pcu_ctr.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by Sysmocom s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#include +#include +#include + +static const struct rate_ctr_desc bts_ctr_description[] = { + { "tbf.dl.alloc", "TBF DL Allocated "}, + { "tbf.dl.freed", "TBF DL Freed "}, + { "tbf.dl.aborted", "TBF DL Aborted "}, + { "tbf.ul.alloc", "TBF UL Allocated "}, + { "tbf.ul.freed", "TBF UL Freed "}, + { "tbf.ul.aborted", "TBF UL Aborted "}, + { "tbf.reused", "TBF Reused "}, + { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, + { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, + { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, + { "rlc.sent", "RLC Sent "}, + { "rlc.resent", "RLC Resent "}, + { "rlc.restarted", "RLC Restarted "}, + { "rlc.stalled", "RLC Stalled "}, + { "rlc.nacked", "RLC Nacked "}, + { "rlc.final_block_resent", "RLC Final Blk resent "}, + { "rlc.ass.timedout", "RLC Assign Timeout "}, + { "rlc.ass.failed", "RLC Assign Failed "}, + { "rlc.ack.timedout", "RLC Ack Timeout "}, + { "rlc.ack.failed", "RLC Ack Failed "}, + { "rlc.rel.timedout", "RLC Release Timeout "}, + { "rlc.late-block", "RLC Late Block "}, + { "rlc.sent-dummy", "RLC Sent Dummy "}, + { "rlc.sent-control", "RLC Sent Control "}, + { "rlc.dl_bytes", "RLC DL Bytes "}, + { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, + { "rlc.ul_bytes", "RLC UL Bytes "}, + { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, + { "decode.errors", "Decode Errors "}, + { "sba.allocated", "SBA Allocated "}, + { "sba.freed", "SBA Freed "}, + { "sba.timedout", "SBA Timeout "}, + { "llc.timeout", "Timedout Frames "}, + { "llc.dropped", "Dropped Frames "}, + { "llc.scheduled", "Scheduled Frames "}, + { "llc.dl_bytes", "RLC encapsulated PDUs"}, + { "llc.ul_bytes", "full PDUs received "}, + { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "spb.uplink_first_segment", "First seg of UL SPB "}, + { "spb.uplink_second_segment", "Second seg of UL SPB "}, + { "spb.downlink_first_segment", "First seg of DL SPB "}, + { "spb.downlink_second_segment","Second seg of DL SPB "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_rej", "Immediate Assign Rej "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "channel.request_description","Channel Request Desc "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.access_reject", "Packet Access Reject "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, +}; + +struct rate_ctr_group *pcu_ctr_init(); diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b7574f9..c7dd3ed 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -30,6 +30,7 @@ #include extern "C" { #include "pcu_vty.h" +#include "pcu_ctr.h" #include #include #include @@ -251,6 +252,7 @@ vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); + bts->ctrs = pcu_ctr_init(); handle_options(argc, argv); if ((!!spoof_mcc) + (!!spoof_mnc) == 1) { diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 5ec16ea..c94f7d2 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "pcu_vty.h" #include "gprs_rlcmac.h" @@ -836,7 +837,9 @@ "show bts statistics", SHOW_STR "BTS related functionality\nStatistics\n") { - vty_out_rate_ctr_group(vty, "", bts_main_data_stats()); + struct gprs_rlcmac_bts *bts = bts_main_data(); + + vty_out_rate_ctr_group(vty, "", bts->ctrs); return CMD_SUCCESS; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..48ca24f 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } /* globals used by the code */ @@ -117,6 +118,7 @@ printf("Testing alloc_a direction(%d)\n", dir); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; struct gprs_rlcmac_trx *trx = &bts->trx[0]; @@ -195,6 +197,7 @@ printf("Testing UL then DL assignment.\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -237,6 +240,7 @@ printf("Testing DL then UL assignment followed by update\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -284,6 +288,7 @@ printf("Testing jolly example\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -345,6 +350,7 @@ gprs_rlcmac_tbf *ul_tbf, *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -389,6 +395,7 @@ gprs_rlcmac_dl_tbf *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -482,6 +489,7 @@ uint8_t trx_no = -1; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); gprs_rlcmac_tbf *tbf = NULL; @@ -663,6 +671,7 @@ printf("Going to test assignment with many TBF, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -701,6 +710,7 @@ printf("Going to test assignment with many connections, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -809,6 +819,7 @@ printf("Testing DL TS allocation for Multi UEs\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..604366e 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -30,7 +30,7 @@ extern "C" { #include "pcu_vty.h" - +#include "pcu_ctr.h" #include #include #include @@ -74,6 +74,7 @@ printf("=== start %s ===\n", __func__); + the_bts.bts_data()->ctrs = pcu_ctr_init(); the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a; the_bts.bts_data()->trx[0].pdch[2].enable(); the_bts.bts_data()->trx[0].pdch[3].enable(); @@ -148,6 +149,7 @@ gprs_rlcmac_trx *trx; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; bts->initial_cs_dl = cs; bts->initial_cs_ul = cs; diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 7d09108..25d689b 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } #define OSMO_ASSERT_STR_EQ(a, b) \ @@ -351,6 +352,7 @@ int bsn_begin, bsn_end, num_blocks; Ack_Nack_Description_t desc; + dummy_bts.bts_data()->ctrs = pcu_ctr_init(); dl_win.m_v_b.reset(); OSMO_ASSERT(dl_win.window_empty()); -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 25 15:26:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 15:26:00 +0000 Subject: [PATCH] osmo-pcu[master]: Move all rate counter related code together In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4413 to look at the new patch set (#3). Move all rate counter related code together Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Related: OS#1538 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/llc.cpp M src/pcu_ctr.h M src/rlc.cpp M src/sba.cpp M src/tbf.cpp M src/tbf_dl.cpp M src/tbf_ul.cpp 11 files changed, 303 insertions(+), 288 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/4413/3 diff --git a/src/bts.cpp b/src/bts.cpp index 0f7462a..16d9dba 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -30,6 +30,7 @@ #include extern "C" { + #include "pcu_ctr.h" #include #include #include @@ -161,7 +162,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "Late RLC block, FN delta: %d FN: %d curFN: %d\n", delay, fn, current_frame_number()); - rlc_late_block(); + rlc_late_block(bts_data()->ctrs); } m_cur_blk_fn = fn; @@ -506,10 +507,10 @@ uint16_t priority = 0; bool failure = false; - rach_frame(); + rach_frame(bts_data()->ctrs); if (is_11bit) - rach_frame_11bit(); + rach_frame_11bit(bts_data()->ctrs); /* Determine full frame number */ Fn = rfn_to_fn(Fn); @@ -590,7 +591,7 @@ plen = Encoding::write_immediate_assignment_reject( immediate_assignment, ra, Fn, burst_type); - immediate_assignment_reject(); + immediate_assignment_reject(bts_data()->ctrs); } else { LOGP(DRLCMAC, LOGL_DEBUG, @@ -605,7 +606,7 @@ } if (plen >= 0) { - immediate_assignment_ul_tbf(); + immediate_assignment_ul_tbf(bts_data()->ctrs); pcu_l1if_tx_agch(immediate_assignment, plen); } @@ -699,7 +700,7 @@ tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); if (plen >= 0) { - immediate_assignment_dl_tbf(); + immediate_assignment_dl_tbf(bts_data()->ctrs); pcu_l1if_tx_pch(immediate_assignment, plen, imsi); } @@ -1026,7 +1027,7 @@ static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) { - bts->channel_request_description(); + channel_request_description(bts->bts_data()->ctrs); /* This call will register the new TBF with the MS on success */ gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), @@ -1356,7 +1357,7 @@ else bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - bts()->rlc_rcvd_control(); + rlc_rcvd_control(bts_data()->ctrs); switch (ul_control_block->u.MESSAGE_TYPE) { case MT_PACKET_CONTROL_ACK: rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); @@ -1377,7 +1378,7 @@ /* ignoring it. change the SI to not force sending these? */ break; default: - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMAC, LOGL_NOTICE, "RX: [PCU <- BTS] unknown control block(%d) received\n", ul_control_block->u.MESSAGE_TYPE); @@ -1393,13 +1394,13 @@ { GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); if (!cs) { - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" "length: %d)\n", len); return -EINVAL; } - bts()->rlc_ul_bytes(len); + rlc_ul_bytes(bts_data()->ctrs, len); LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); @@ -1410,7 +1411,7 @@ if (cs.isEgprs()) return rcv_data_block(data, len, fn, meas, cs); - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", cs.name()); return -EINVAL; @@ -1447,7 +1448,7 @@ LOGP(DRLCMACUL, LOGL_ERROR, "Got %s RLC block but header parsing has failed\n", cs.name()); - bts()->decode_error(); + decode_error(bts_data()->ctrs); return rc; } diff --git a/src/bts.h b/src/bts.h index 19d948a..d20f633 100644 --- a/src/bts.h +++ b/src/bts.h @@ -390,95 +390,6 @@ uint8_t ts_no, uint8_t channel, uint32_t fn, const uint8_t *data, unsigned int len); - /* - * Statistics - */ - void tbf_dl_created(); - void tbf_dl_freed(); - void tbf_dl_aborted(); - void tbf_ul_created(); - void tbf_ul_freed(); - void tbf_ul_aborted(); - void tbf_reused(); - void tbf_alloc_algo_a(); - void tbf_alloc_algo_b(); - void tbf_failed_egprs_only(); - void rlc_sent(); - void rlc_resent(); - void rlc_restarted(); - void rlc_stalled(); - void rlc_nacked(); - void rlc_final_block_resent(); - void rlc_ass_timedout(); - void rlc_ass_failed(); - void rlc_ack_timedout(); - void rlc_ack_failed(); - void rlc_rel_timedout(); - void rlc_late_block(); - void rlc_sent_dummy(); - void rlc_sent_control(); - void rlc_dl_bytes(int bytes); - void rlc_dl_payload_bytes(int bytes); - void rlc_ul_bytes(int bytes); - void rlc_ul_payload_bytes(int bytes); - void decode_error(); - void sba_allocated(); - void sba_freed(); - void sba_timedout(); - void llc_timedout_frame(); - void llc_dropped_frame(); - void llc_frame_sched(); - void llc_dl_bytes(int bytes); - void llc_ul_bytes(int bytes); - void rach_frame(); - void rach_frame_11bit(); - void spb_uplink_first_segment(); - void spb_uplink_second_segment(); - void spb_downlink_first_segment(); - void spb_downlink_second_segment(); - void immediate_assignment_ul_tbf(); - void immediate_assignment_reject(); - void immediate_assignment_dl_tbf(); - void channel_request_description(); - void pkt_ul_assignment(); - void pkt_access_reject(); - void pkt_dl_assignemnt(); - void rlc_rcvd_control(); - void pua_poll_timedout(); - void pua_poll_failed(); - void pda_poll_timedout(); - void pda_poll_failed(); - void pkt_ul_ack_nack_poll_timedout(); - void pkt_ul_ack_nack_poll_failed(); - void pkt_dl_ack_nack_poll_timedout(); - void pkt_dl_ack_nack_poll_failed(); - void gprs_dl_cs1(); - void gprs_dl_cs2(); - void gprs_dl_cs3(); - void gprs_dl_cs4(); - void egprs_dl_mcs1(); - void egprs_dl_mcs2(); - void egprs_dl_mcs3(); - void egprs_dl_mcs4(); - void egprs_dl_mcs5(); - void egprs_dl_mcs6(); - void egprs_dl_mcs7(); - void egprs_dl_mcs8(); - void egprs_dl_mcs9(); - void gprs_ul_cs1(); - void gprs_ul_cs2(); - void gprs_ul_cs3(); - void gprs_ul_cs4(); - void egprs_ul_mcs1(); - void egprs_ul_mcs2(); - void egprs_ul_mcs3(); - void egprs_ul_mcs4(); - void egprs_ul_mcs5(); - void egprs_ul_mcs6(); - void egprs_ul_mcs7(); - void egprs_ul_mcs8(); - void egprs_ul_mcs9(); - void ms_present(int32_t n); int32_t ms_present_get(); @@ -575,106 +486,6 @@ { return m_statg; } - -#define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ - inline void BTS::func_name(int inc) {\ - OSMO_ASSERT(m_bts.ctrs); \ - rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ - } - -#define CREATE_COUNT_INLINE(func_name, ctr_name) \ - inline void BTS::func_name() {\ - OSMO_ASSERT(m_bts.ctrs); \ - rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ - } - -CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) -CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) -CREATE_COUNT_INLINE(tbf_dl_aborted, CTR_TBF_DL_ABORTED) -CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) -CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) -CREATE_COUNT_INLINE(tbf_ul_aborted, CTR_TBF_UL_ABORTED) -CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) -CREATE_COUNT_INLINE(tbf_alloc_algo_a, CTR_TBF_ALLOC_ALGO_A) -CREATE_COUNT_INLINE(tbf_alloc_algo_b, CTR_TBF_ALLOC_ALGO_B) -CREATE_COUNT_INLINE(tbf_failed_egprs_only, CTR_TBF_FAILED_EGPRS_ONLY) -CREATE_COUNT_INLINE(rlc_sent, CTR_RLC_SENT) -CREATE_COUNT_INLINE(rlc_resent, CTR_RLC_RESENT) -CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) -CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) -CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) -CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); -CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); -CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_ack_failed, CTR_RLC_ACK_FAILED); -CREATE_COUNT_INLINE(rlc_rel_timedout, CTR_RLC_REL_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_late_block, CTR_RLC_LATE_BLOCK); -CREATE_COUNT_INLINE(rlc_sent_dummy, CTR_RLC_SENT_DUMMY); -CREATE_COUNT_INLINE(rlc_sent_control, CTR_RLC_SENT_CONTROL); -CREATE_COUNT_ADD_INLINE(rlc_dl_bytes, CTR_RLC_DL_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_dl_payload_bytes, CTR_RLC_DL_PAYLOAD_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_ul_bytes, CTR_RLC_UL_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_ul_payload_bytes, CTR_RLC_UL_PAYLOAD_BYTES); -CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) -CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) -CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) -CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) -CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); -CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); -CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); -CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); -CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); -CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); -CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); -CREATE_COUNT_INLINE(spb_uplink_first_segment, CTR_SPB_UL_FIRST_SEGMENT); -CREATE_COUNT_INLINE(spb_uplink_second_segment, CTR_SPB_UL_SECOND_SEGMENT); -CREATE_COUNT_INLINE(spb_downlink_first_segment, CTR_SPB_DL_FIRST_SEGMENT); -CREATE_COUNT_INLINE(spb_downlink_second_segment, CTR_SPB_DL_SECOND_SEGMENT); -CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); -CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); -CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); -CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); -CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); -CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); -CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); -CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); -CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); -CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); -CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); -CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); -CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); -CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); -CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); -CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); -CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); -CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); -CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); -CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); -CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); -CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); -CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); -CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); -CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); -CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); -CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); -CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); -CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); -CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); -CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); -CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); -CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); -CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); -CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); -CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); -CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); -CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); - -#undef CREATE_COUNT_INLINE #define CREATE_STAT_INLINE(func_name, func_name_get, stat_name) \ inline void BTS::func_name(int32_t val) {\ diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 2350808..838d6b2 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,6 +25,10 @@ #include "pcu_utils.h" +extern "C" { +#include "pcu_ctr.h" +} + static uint32_t sched_poll(BTS *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, struct gprs_rlcmac_tbf **poll_tbf, @@ -316,18 +320,18 @@ switch(cat) { case PCU_GSMTAP_C_DL_CTRL: - bts->bts->rlc_sent_control(); + rlc_sent_control(bts->bts->bts_data()->ctrs); bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DATA_GPRS: - bts->bts->rlc_sent(); + rlc_sent(bts->bts->bts_data()->ctrs); /* FIXME: distinguish between GPRS and EGPRS */ bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DUMMY: - bts->bts->rlc_sent_dummy(); + rlc_sent_dummy(bts->bts->bts_data()->ctrs); bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); break; @@ -403,7 +407,7 @@ if (!msg) return -ENOMEM; /* msg is now available */ - bts->bts->rlc_dl_bytes(msg->data_len); + rlc_dl_bytes(bts->bts->bts_data()->ctrs, msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 2b08cf6..e657f3a 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -29,6 +29,10 @@ #include #include +extern "C" { +#include "pcu_ctr.h" +} + /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 @@ -485,7 +489,7 @@ ms_->set_reserved_slots(trx, 1 << ts, 1 << ts); tbf_->upgrade_to_multislot = 0; - bts->bts->tbf_alloc_algo_a(); + tbf_alloc_algo_a(bts->bts->bts_data()->ctrs); return 0; } @@ -1021,7 +1025,7 @@ } } - bts->bts->tbf_alloc_algo_b(); + tbf_alloc_algo_b(bts->bts->bts_data()->ctrs); return 0; } diff --git a/src/llc.cpp b/src/llc.cpp index 79afc37..182fdfc 100644 --- a/src/llc.cpp +++ b/src/llc.cpp @@ -25,6 +25,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include } @@ -126,7 +127,7 @@ while ((msg = msgb_dequeue(&m_queue))) { if (bts) - bts->llc_dropped_frame(); + llc_dropped_frame(bts->bts_data()->ctrs); msgb_free(msg); } diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h index d90785c..0baa543 100644 --- a/src/pcu_ctr.h +++ b/src/pcu_ctr.h @@ -22,9 +22,100 @@ #pragma once +#include +#include + #include #include #include + +enum { + CTR_TBF_DL_ALLOCATED, + CTR_TBF_DL_FREED, + CTR_TBF_DL_ABORTED, + CTR_TBF_UL_ALLOCATED, + CTR_TBF_UL_FREED, + CTR_TBF_UL_ABORTED, + CTR_TBF_REUSED, + CTR_TBF_ALLOC_ALGO_A, + CTR_TBF_ALLOC_ALGO_B, + CTR_TBF_FAILED_EGPRS_ONLY, + CTR_RLC_SENT, + CTR_RLC_RESENT, + CTR_RLC_RESTARTED, + CTR_RLC_STALLED, + CTR_RLC_NACKED, + CTR_RLC_FINAL_BLOCK_RESENT, + CTR_RLC_ASS_TIMEDOUT, + CTR_RLC_ASS_FAILED, + CTR_RLC_ACK_TIMEDOUT, + CTR_RLC_ACK_FAILED, + CTR_RLC_REL_TIMEDOUT, + CTR_RLC_LATE_BLOCK, + CTR_RLC_SENT_DUMMY, + CTR_RLC_SENT_CONTROL, + CTR_RLC_DL_BYTES, + CTR_RLC_DL_PAYLOAD_BYTES, + CTR_RLC_UL_BYTES, + CTR_RLC_UL_PAYLOAD_BYTES, + CTR_DECODE_ERRORS, + CTR_SBA_ALLOCATED, + CTR_SBA_FREED, + CTR_SBA_TIMEDOUT, + CTR_LLC_FRAME_TIMEDOUT, + CTR_LLC_FRAME_DROPPED, + CTR_LLC_FRAME_SCHED, + CTR_LLC_DL_BYTES, + CTR_LLC_UL_BYTES, + CTR_RACH_REQUESTS, + CTR_11BIT_RACH_REQUESTS, + CTR_SPB_UL_FIRST_SEGMENT, + CTR_SPB_UL_SECOND_SEGMENT, + CTR_SPB_DL_FIRST_SEGMENT, + CTR_SPB_DL_SECOND_SEGMENT, + CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_REJ, + CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_CHANNEL_REQUEST_DESCRIPTION, + CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_ACCESS_REJ, + CTR_PKT_DL_ASSIGNMENT, + CTR_RLC_RECV_CONTROL, + CTR_PUA_POLL_TIMEDOUT, + CTR_PUA_POLL_FAILED, + CTR_PDA_POLL_TIMEDOUT, + CTR_PDA_POLL_FAILED, + CTR_PUAN_POLL_TIMEDOUT, + CTR_PUAN_POLL_FAILED, + CTR_PDAN_POLL_TIMEDOUT, + CTR_PDAN_POLL_FAILED, + CTR_GPRS_DL_CS1, + CTR_GPRS_DL_CS2, + CTR_GPRS_DL_CS3, + CTR_GPRS_DL_CS4, + CTR_EGPRS_DL_MCS1, + CTR_EGPRS_DL_MCS2, + CTR_EGPRS_DL_MCS3, + CTR_EGPRS_DL_MCS4, + CTR_EGPRS_DL_MCS5, + CTR_EGPRS_DL_MCS6, + CTR_EGPRS_DL_MCS7, + CTR_EGPRS_DL_MCS8, + CTR_EGPRS_DL_MCS9, + CTR_GPRS_UL_CS1, + CTR_GPRS_UL_CS2, + CTR_GPRS_UL_CS3, + CTR_GPRS_UL_CS4, + CTR_EGPRS_UL_MCS1, + CTR_EGPRS_UL_MCS2, + CTR_EGPRS_UL_MCS3, + CTR_EGPRS_UL_MCS4, + CTR_EGPRS_UL_MCS5, + CTR_EGPRS_UL_MCS6, + CTR_EGPRS_UL_MCS7, + CTR_EGPRS_UL_MCS8, + CTR_EGPRS_UL_MCS9, +}; static const struct rate_ctr_desc bts_ctr_description[] = { { "tbf.dl.alloc", "TBF DL Allocated "}, @@ -115,3 +206,101 @@ }; struct rate_ctr_group *pcu_ctr_init(); + +#define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ + inline void func_name(struct rate_ctr_group *ctrs, int inc) { \ + OSMO_ASSERT(ctrs); \ + rate_ctr_add(&ctrs->ctr[ctr_name], inc); \ + } + +#define CREATE_COUNT_INLINE(func_name, ctr_name) \ + static inline void func_name(struct rate_ctr_group *ctrs) {\ + OSMO_ASSERT(ctrs); \ + rate_ctr_inc(&ctrs->ctr[ctr_name]); \ + } + +CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) +CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) +CREATE_COUNT_INLINE(tbf_dl_aborted, CTR_TBF_DL_ABORTED) +CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) +CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) +CREATE_COUNT_INLINE(tbf_ul_aborted, CTR_TBF_UL_ABORTED) +CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) +CREATE_COUNT_INLINE(tbf_alloc_algo_a, CTR_TBF_ALLOC_ALGO_A) +CREATE_COUNT_INLINE(tbf_alloc_algo_b, CTR_TBF_ALLOC_ALGO_B) +CREATE_COUNT_INLINE(tbf_failed_egprs_only, CTR_TBF_FAILED_EGPRS_ONLY) +CREATE_COUNT_INLINE(rlc_sent, CTR_RLC_SENT) +CREATE_COUNT_INLINE(rlc_resent, CTR_RLC_RESENT) +CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) +CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) +CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) +CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); +CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); +CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_ack_failed, CTR_RLC_ACK_FAILED); +CREATE_COUNT_INLINE(rlc_rel_timedout, CTR_RLC_REL_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_late_block, CTR_RLC_LATE_BLOCK); +CREATE_COUNT_INLINE(rlc_sent_dummy, CTR_RLC_SENT_DUMMY); +CREATE_COUNT_INLINE(rlc_sent_control, CTR_RLC_SENT_CONTROL); +CREATE_COUNT_ADD_INLINE(rlc_dl_bytes, CTR_RLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_dl_payload_bytes, CTR_RLC_DL_PAYLOAD_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_bytes, CTR_RLC_UL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_payload_bytes, CTR_RLC_UL_PAYLOAD_BYTES); +CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) +CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) +CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) +CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) +CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); +CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); +CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); +CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); +CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); +CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); +CREATE_COUNT_INLINE(spb_uplink_first_segment, CTR_SPB_UL_FIRST_SEGMENT); +CREATE_COUNT_INLINE(spb_uplink_second_segment, CTR_SPB_UL_SECOND_SEGMENT); +CREATE_COUNT_INLINE(spb_downlink_first_segment, CTR_SPB_DL_FIRST_SEGMENT); +CREATE_COUNT_INLINE(spb_downlink_second_segment, CTR_SPB_DL_SECOND_SEGMENT); +CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); +CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); +CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); +CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); +CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); +CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); +CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); +CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); +CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); +CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); +CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); +CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); +CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); +CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); +CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); +CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); +CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); +CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); +CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); +CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); +CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); +CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); +CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); +CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); +CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); +CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); +CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); +CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); +CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); +CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); +CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); +CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); +CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); diff --git a/src/rlc.cpp b/src/rlc.cpp index acd4169..560bbbf 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -23,6 +23,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include } @@ -154,7 +155,7 @@ } else { LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); - bts->rlc_nacked(); + rlc_nacked(bts->bts_data()->ctrs); *lost += 1; } } @@ -178,7 +179,7 @@ } else { LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); - bts->rlc_nacked(); + rlc_nacked(bts->bts_data()->ctrs); *lost += 1; } } diff --git a/src/sba.cpp b/src/sba.cpp index 56a7543..450cdc6 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -26,6 +26,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include #include } @@ -84,7 +85,7 @@ sba->ta = ta; llist_add(&sba->list, &m_sbas); - m_bts.sba_allocated(); + sba_allocated(m_bts.bts_data()->ctrs); *_trx = trx; *_ts = ts; @@ -130,14 +131,14 @@ LOGP(DRLCMAC, LOGL_NOTICE, "Poll timeout for SBA (TRX=%u, TS=%u, FN=%u, TA=%u)\n", sba->trx_no, sba->ts_no, sba->fn, sba->ta); - m_bts.sba_timedout(); + sba_timedout(m_bts.bts_data()->ctrs); free_sba(sba); return 0; } void SBAController::free_sba(gprs_rlcmac_sba *sba) { - m_bts.sba_freed(); + sba_freed(m_bts.bts_data()->ctrs); llist_del(&sba->list); talloc_free(sba); } diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..1dd190f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -31,6 +31,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include #include #include @@ -421,9 +422,9 @@ /* update counters */ if (tbf->direction == GPRS_RLCMAC_UL_TBF) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf); - tbf->bts->tbf_ul_freed(); + tbf_ul_freed(tbf->bts->bts_data()->ctrs); if (tbf->state_is(GPRS_RLCMAC_FLOW)) - tbf->bts->tbf_ul_aborted(); + tbf_ul_aborted(tbf->bts->bts_data()->ctrs); rate_ctr_group_free(ul_tbf->m_ul_egprs_ctrs); rate_ctr_group_free(ul_tbf->m_ul_gprs_ctrs); } else { @@ -433,9 +434,9 @@ } else { rate_ctr_group_free(dl_tbf->m_dl_gprs_ctrs); } - tbf->bts->tbf_dl_freed(); + tbf_dl_freed(tbf->bts->bts_data()->ctrs); if (tbf->state_is(GPRS_RLCMAC_FLOW)) - tbf->bts->tbf_dl_aborted(); + tbf_dl_aborted(tbf->bts->bts_data()->ctrs); } /* Give final measurement report */ @@ -653,14 +654,14 @@ LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling PACKET CONTROL ACK for PACKET UPLINK ACK\n"); rlcmac_diag(); } - bts->rlc_ack_timedout(); - bts->pkt_ul_ack_nack_poll_timedout(); + rlc_ack_timedout(bts->bts_data()->ctrs); + pkt_ul_ack_nack_poll_timedout(bts->bts_data()->ctrs); if (state_is(GPRS_RLCMAC_FINISHED)) { ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); - bts->pkt_ul_ack_nack_poll_failed(); + pkt_ul_ack_nack_poll_failed(bts->bts_data()->ctrs); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); return; @@ -679,14 +680,14 @@ } ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; - bts->rlc_ass_timedout(); - bts->pua_poll_timedout(); + rlc_ass_timedout(bts->bts_data()->ctrs); + pua_poll_timedout(bts->bts_data()->ctrs); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); - bts->rlc_ass_failed(); - bts->pua_poll_failed(); + rlc_ass_failed(bts->bts_data()->ctrs); + pua_poll_failed(bts->bts_data()->ctrs); return; } /* reschedule UL assignment */ @@ -701,14 +702,14 @@ } dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; - bts->rlc_ass_timedout(); - bts->pda_poll_timedout(); + rlc_ass_timedout(bts->bts_data()->ctrs); + pda_poll_timedout(bts->bts_data()->ctrs); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); - bts->rlc_ass_failed(); - bts->pda_poll_failed(); + rlc_ass_failed(bts->bts_data()->ctrs); + pda_poll_failed(bts->bts_data()->ctrs); return; } /* reschedule DL assignment */ @@ -724,17 +725,17 @@ } dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) - bts->rlc_rel_timedout(); + rlc_rel_timedout(bts->bts_data()->ctrs); else { - bts->rlc_ack_timedout(); - bts->pkt_dl_ack_nack_poll_timedout(); + rlc_ack_timedout(bts->bts_data()->ctrs); + pkt_dl_ack_nack_poll_timedout(bts->bts_data()->ctrs); } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(dl_tbf, 3195, dl_tbf->bts_data()->t3195, 0); - bts->pkt_dl_ack_nack_poll_failed(); - bts->rlc_ack_failed(); + pkt_dl_ack_nack_poll_failed(bts->bts_data()->ctrs); + rlc_ack_failed(bts->bts_data()->ctrs); return; } /* resend IMM.ASS on CCCH on timeout */ @@ -840,7 +841,7 @@ if (egprs_ms_class == 0 && bts->egprs_enabled) { LOGP(DRLCMAC, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n"); - bts->bts->tbf_failed_egprs_only(); + tbf_failed_egprs_only(bts->bts->bts_data()->ctrs); return NULL; } @@ -887,7 +888,7 @@ } llist_add(&tbf->list(), &bts->bts->ul_tbfs()); - tbf->bts->tbf_ul_created(); + tbf_ul_created(tbf->bts->bts_data()->ctrs); return tbf; } @@ -932,7 +933,7 @@ if (ms_class > 0) { LOGP(DRLCMAC, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n"); - bts->bts->tbf_failed_egprs_only(); + tbf_failed_egprs_only(bts->bts->bts_data()->ctrs); return NULL; } egprs_ms_class = 1; @@ -986,7 +987,7 @@ } llist_add(&tbf->list(), &bts->bts->dl_tbfs()); - tbf->bts->tbf_dl_created(); + tbf_dl_created(tbf->bts->bts_data()->ctrs); tbf->m_last_dl_poll_fn = -1; tbf->m_last_dl_drained_fn = -1; @@ -1180,7 +1181,7 @@ encode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); - bts->pkt_dl_assignemnt(); + pkt_dl_assignemnt(bts->bts_data()->ctrs); bitvec_pack(ass_vec, msgb_put(msg, 23)); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1213,7 +1214,7 @@ Encoding::write_packet_access_reject( packet_access_rej, tlli()); - bts->pkt_access_reject(); + pkt_access_reject(bts->bts_data()->ctrs); bitvec_pack(packet_access_rej, msgb_put(msg, 23)); @@ -1279,7 +1280,7 @@ decode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); - bts->pkt_ul_assignment(); + pkt_ul_assignment(bts->bts_data()->ctrs); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1312,7 +1313,7 @@ { struct gprs_rlcmac_dl_tbf *new_tbf = NULL; - bts->tbf_reused(); + tbf_reused(bts->bts_data()->ctrs); new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), @@ -1468,7 +1469,7 @@ ms->set_tlli(tlli); llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); - ul_tbf->bts->tbf_ul_created(); + tbf_ul_created(ul_tbf->bts->bts_data()->ctrs); ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 3d27883..deeb89e 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -32,6 +32,7 @@ #include "pcu_utils.h" extern "C" { +#include "pcu_ctr.h" #include #include #include @@ -295,12 +296,12 @@ break; } - bts->llc_timedout_frame(); + llc_timedout_frame(bts->bts_data()->ctrs); drop_frame: frames++; octets += msg->len; msgb_free(msg); - bts->llc_dropped_frame(); + llc_dropped_frame(bts->bts_data()->ctrs); continue; } @@ -407,19 +408,19 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Resending BSN %d\n", bsn); /* re-send block with negative aknowlegement */ m_window.m_v_b.mark_unacked(bsn); - bts->rlc_resent(); + rlc_resent(bts->bts_data()->ctrs); } else if (state_is(GPRS_RLCMAC_FINISHED)) { LOGP(DRLCMACDL, LOGL_DEBUG, "- Restarting at BSN %d, " "because all blocks have been transmitted.\n", m_window.v_a()); - bts->rlc_restarted(); + rlc_restarted(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else if (dl_window_stalled()) { LOGP(DRLCMACDL, LOGL_NOTICE, "- Restarting at BSN %d, " "because the window is stalled.\n", m_window.v_a()); - bts->rlc_stalled(); + rlc_stalled(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else if (have_data()) { @@ -435,7 +436,7 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Restarting at BSN %d, " "because all blocks have been transmitted (FLOW).\n", m_window.v_a()); - bts->rlc_restarted(); + rlc_restarted(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else { @@ -452,8 +453,8 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Nothing else to send, Re-transmit final block!\n"); bsn = m_window.v_s_mod(-1); - bts->rlc_final_block_resent(); - bts->rlc_resent(); + rlc_final_block_resent(bts->bts_data()->ctrs); + rlc_resent(bts->bts_data()->ctrs); } *may_combine = m_rlc.block(bsn)->cs_current_trans.numDataBlocks() > 1; @@ -535,7 +536,7 @@ tbf_name(this), msg->len); m_llc.put_frame(msg->data, msg->len); - bts->llc_frame_sched(); + llc_frame_sched(bts->bts_data()->ctrs); msgb_free(msg); m_last_dl_drained_fn = -1; } @@ -611,7 +612,7 @@ &m_llc, &write_offset, &num_chunks, data, is_final, &payload_written); if (payload_written > 0) - bts->rlc_dl_payload_bytes(payload_written); + rlc_dl_payload_bytes(bts->bts_data()->ctrs, payload_written); if (ar == Encoding::AR_NEED_MORE_BLOCKS) break; @@ -619,7 +620,7 @@ LOGP(DRLCMACDL, LOGL_INFO, "Complete DL frame for %s" "len=%d\n", tbf_name(this), m_llc.frame_length()); gprs_rlcmac_dl_bw(this, m_llc.frame_length()); - bts->llc_dl_bytes(m_llc.frame_length()); + llc_dl_bytes(bts->bts_data()->ctrs, m_llc.frame_length()); m_llc.reset(); if (is_final) { @@ -1359,19 +1360,19 @@ if (block_status_dl == EGPRS_RESEG_FIRST_SEG_SENT) { /* statistics */ - bts->spb_downlink_second_segment(); + spb_downlink_second_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_SEC_SEG; } else if ((cs_init.headerTypeData() == GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1) || (cs_init.headerTypeData() == GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2)) { - bts->spb_downlink_first_segment(); + spb_downlink_first_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_FIRST_SEG; } else if ((GprsCodingScheme::Scheme(cs_init) == GprsCodingScheme::MCS4) && (GprsCodingScheme::Scheme(cs_current_trans) == GprsCodingScheme::MCS1)) { - bts->spb_downlink_first_segment(); + spb_downlink_first_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_FIRST_SEG; } } @@ -1407,58 +1408,58 @@ if (cs.isGprs()) { switch (coding_scheme) { case GprsCodingScheme::CS1 : - bts->gprs_dl_cs1(); + gprs_dl_cs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS1]); break; case GprsCodingScheme::CS2 : - bts->gprs_dl_cs2(); + gprs_dl_cs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS2]); break; case GprsCodingScheme::CS3 : - bts->gprs_dl_cs3(); + gprs_dl_cs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS3]); break; case GprsCodingScheme::CS4 : - bts->gprs_dl_cs4(); + gprs_dl_cs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS4]); break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : - bts->egprs_dl_mcs1(); + egprs_dl_mcs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS1]); break; case GprsCodingScheme::MCS2 : - bts->egprs_dl_mcs2(); + egprs_dl_mcs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS2]); break; case GprsCodingScheme::MCS3 : - bts->egprs_dl_mcs3(); + egprs_dl_mcs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS3]); break; case GprsCodingScheme::MCS4 : - bts->egprs_dl_mcs4(); + egprs_dl_mcs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS4]); break; case GprsCodingScheme::MCS5 : - bts->egprs_dl_mcs5(); + egprs_dl_mcs5(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS5]); break; case GprsCodingScheme::MCS6 : - bts->egprs_dl_mcs6(); + egprs_dl_mcs6(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS6]); break; case GprsCodingScheme::MCS7 : - bts->egprs_dl_mcs7(); + egprs_dl_mcs7(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS7]); break; case GprsCodingScheme::MCS8 : - bts->egprs_dl_mcs8(); + egprs_dl_mcs8(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS8]); break; case GprsCodingScheme::MCS9 : - bts->egprs_dl_mcs9(); + egprs_dl_mcs9(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS9]); break; } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 81d3b24..1f8f0f6 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -32,6 +32,7 @@ #include "pcu_utils.h" extern "C" { +#include "pcu_ctr.h" #include #include } @@ -70,7 +71,7 @@ frame = frames + i; if (frame->length) { - bts->rlc_ul_payload_bytes(frame->length); + rlc_ul_payload_bytes(bts->bts_data()->ctrs, frame->length); LOGP(DRLCMACUL, LOGL_DEBUG, "-- Frame %d " "starts at offset %d, " @@ -87,7 +88,7 @@ LOGP(DRLCMACUL, LOGL_INFO, "%s complete UL frame len=%d\n", tbf_name(this) , m_llc.frame_length()); snd_ul_ud(); - bts->llc_ul_bytes(m_llc.frame_length()); + llc_ul_bytes(bts->bts_data()->ctrs, m_llc.frame_length()); m_llc.reset(); } } @@ -277,7 +278,7 @@ rdbi, rlc->cs, rlc_data, NULL, 0, &new_tlli); if (num_chunks < 0) { - bts->decode_error(); + decode_error(bts->bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_NOTICE, "Failed to decode TLLI of %s UL DATA " "TFI=%d.\n", rlc->cs.name(), rlc->tfi); @@ -419,7 +420,7 @@ union split_block_status *spb_status = &block->spb_status; uint8_t *rlc_data = &block->block[0]; - bts->spb_uplink_second_segment(); + spb_uplink_second_segment(bts->bts_data()->ctrs); if (spb_status->block_status_ul & EGPRS_RESEG_FIRST_SEG_RXD) { @@ -457,7 +458,7 @@ uint8_t *rlc_data = &block->block[0]; union split_block_status *spb_status = &block->spb_status; - bts->spb_uplink_first_segment(); + spb_uplink_first_segment(bts->bts_data()->ctrs); if (spb_status->block_status_ul & EGPRS_RESEG_SECOND_SEG_RXD) { LOGP(DRLCMACUL, LOGL_DEBUG, @@ -552,58 +553,58 @@ if (cs.isGprs()) { switch (coding_scheme) { case GprsCodingScheme::CS1 : - bts->gprs_ul_cs1(); + gprs_ul_cs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS1]); break; case GprsCodingScheme::CS2 : - bts->gprs_ul_cs2(); + gprs_ul_cs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS2]); break; case GprsCodingScheme::CS3 : - bts->gprs_ul_cs3(); + gprs_ul_cs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS3]); break; case GprsCodingScheme::CS4 : - bts->gprs_ul_cs4(); + gprs_ul_cs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS4]); break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : - bts->egprs_ul_mcs1(); + egprs_ul_mcs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS1]); break; case GprsCodingScheme::MCS2 : - bts->egprs_ul_mcs2(); + egprs_ul_mcs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS2]); break; case GprsCodingScheme::MCS3 : - bts->egprs_ul_mcs3(); + egprs_ul_mcs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS3]); break; case GprsCodingScheme::MCS4 : - bts->egprs_ul_mcs4(); + egprs_ul_mcs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS4]); break; case GprsCodingScheme::MCS5 : - bts->egprs_ul_mcs5(); + egprs_ul_mcs5(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS5]); break; case GprsCodingScheme::MCS6 : - bts->egprs_ul_mcs6(); + egprs_ul_mcs6(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS6]); break; case GprsCodingScheme::MCS7 : - bts->egprs_ul_mcs7(); + egprs_ul_mcs7(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS7]); break; case GprsCodingScheme::MCS8 : - bts->egprs_ul_mcs8(); + egprs_ul_mcs8(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS8]); break; case GprsCodingScheme::MCS9 : - bts->egprs_ul_mcs9(); + egprs_ul_mcs9(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS9]); break; } -- To view, visit https://gerrit.osmocom.org/4413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 15:37:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 15:37:07 +0000 Subject: [PATCH] osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4411 to look at the new patch set (#6). Initialize logging before initializing rate_ctr The library code for rate counter initialization might already want to log something (particularly after Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Before the rate counters were initialized implicitly in BTS constructor which makes proper logging init impossible. Fix this by using explicit init similar to the way we do it for vty. Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 --- M src/Makefile.am M src/bts.cpp M src/bts.h A src/pcu_ctr.c A src/pcu_ctr.h M src/pcu_main.cpp M src/pcu_vty.c M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp M tests/types/TypesTest.cpp 10 files changed, 194 insertions(+), 121 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/11/4411/6 diff --git a/src/Makefile.am b/src/Makefile.am index 1543851..67291ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,7 @@ gprs_ms_storage.cpp \ gsm_timer.cpp \ pcu_l1_if.cpp \ + pcu_ctr.c \ pcu_vty.c \ pcu_vty_functions.cpp \ tbf.cpp \ @@ -79,6 +80,7 @@ gprs_ms_storage.h \ pcu_l1_if.h \ gsm_timer.h \ + pcu_ctr.h \ pcu_vty.h \ pcu_vty_functions.h \ tbf.h \ diff --git a/src/bts.cpp b/src/bts.cpp index b768569..0f7462a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -50,107 +50,6 @@ static BTS s_bts; -/** - * For gcc-4.4 compat do not use extended initializer list but keep the - * order from the enum here. Once we support GCC4.7 and up we can change - * the code below. - */ -static const struct rate_ctr_desc bts_ctr_description[] = { - { "tbf.dl.alloc", "TBF DL Allocated "}, - { "tbf.dl.freed", "TBF DL Freed "}, - { "tbf.dl.aborted", "TBF DL Aborted "}, - { "tbf.ul.alloc", "TBF UL Allocated "}, - { "tbf.ul.freed", "TBF UL Freed "}, - { "tbf.ul.aborted", "TBF UL Aborted "}, - { "tbf.reused", "TBF Reused "}, - { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, - { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, - { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, - { "rlc.sent", "RLC Sent "}, - { "rlc.resent", "RLC Resent "}, - { "rlc.restarted", "RLC Restarted "}, - { "rlc.stalled", "RLC Stalled "}, - { "rlc.nacked", "RLC Nacked "}, - { "rlc.final_block_resent", "RLC Final Blk resent "}, - { "rlc.ass.timedout", "RLC Assign Timeout "}, - { "rlc.ass.failed", "RLC Assign Failed "}, - { "rlc.ack.timedout", "RLC Ack Timeout "}, - { "rlc.ack.failed", "RLC Ack Failed "}, - { "rlc.rel.timedout", "RLC Release Timeout "}, - { "rlc.late-block", "RLC Late Block "}, - { "rlc.sent-dummy", "RLC Sent Dummy "}, - { "rlc.sent-control", "RLC Sent Control "}, - { "rlc.dl_bytes", "RLC DL Bytes "}, - { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, - { "rlc.ul_bytes", "RLC UL Bytes "}, - { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, - { "decode.errors", "Decode Errors "}, - { "sba.allocated", "SBA Allocated "}, - { "sba.freed", "SBA Freed "}, - { "sba.timedout", "SBA Timeout "}, - { "llc.timeout", "Timedout Frames "}, - { "llc.dropped", "Dropped Frames "}, - { "llc.scheduled", "Scheduled Frames "}, - { "llc.dl_bytes", "RLC encapsulated PDUs"}, - { "llc.ul_bytes", "full PDUs received "}, - { "rach.requests", "RACH requests "}, - { "11bit_rach.requests", "11BIT_RACH requests "}, - { "spb.uplink_first_segment", "First seg of UL SPB "}, - { "spb.uplink_second_segment", "Second seg of UL SPB "}, - { "spb.downlink_first_segment", "First seg of DL SPB "}, - { "spb.downlink_second_segment","Second seg of DL SPB "}, - { "immediate.assignment_UL", "Immediate Assign UL "}, - { "immediate.assignment_rej", "Immediate Assign Rej "}, - { "immediate.assignment_DL", "Immediate Assign DL "}, - { "channel.request_description","Channel Request Desc "}, - { "pkt.ul_assignment", "Packet UL Assignment "}, - { "pkt.access_reject", "Packet Access Reject "}, - { "pkt.dl_assignment", "Packet DL Assignment "}, - { "ul.control", "UL control Block "}, - { "ul.assignment_poll_timeout", "UL Assign Timeout "}, - { "ul.assignment_failed", "UL Assign Failed "}, - { "dl.assignment_timeout", "DL Assign Timeout "}, - { "dl.assignment_failed", "DL Assign Failed "}, - { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, - { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, - { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, - { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, - { "gprs.downlink_cs1", "CS1 downlink "}, - { "gprs.downlink_cs2", "CS2 downlink "}, - { "gprs.downlink_cs3", "CS3 downlink "}, - { "gprs.downlink_cs4", "CS4 downlink "}, - { "egprs.downlink_mcs1", "MCS1 downlink "}, - { "egprs.downlink_mcs2", "MCS2 downlink "}, - { "egprs.downlink_mcs3", "MCS3 downlink "}, - { "egprs.downlink_mcs4", "MCS4 downlink "}, - { "egprs.downlink_mcs5", "MCS5 downlink "}, - { "egprs.downlink_mcs6", "MCS6 downlink "}, - { "egprs.downlink_mcs7", "MCS7 downlink "}, - { "egprs.downlink_mcs8", "MCS8 downlink "}, - { "egprs.downlink_mcs9", "MCS9 downlink "}, - { "gprs.uplink_cs1", "CS1 Uplink "}, - { "gprs.uplink_cs2", "CS2 Uplink "}, - { "gprs.uplink_cs3", "CS3 Uplink "}, - { "gprs.uplink_cs4", "CS4 Uplink "}, - { "egprs.uplink_mcs1", "MCS1 Uplink "}, - { "egprs.uplink_mcs2", "MCS2 Uplink "}, - { "egprs.uplink_mcs3", "MCS3 Uplink "}, - { "egprs.uplink_mcs4", "MCS4 Uplink "}, - { "egprs.uplink_mcs5", "MCS5 Uplink "}, - { "egprs.uplink_mcs6", "MCS6 Uplink "}, - { "egprs.uplink_mcs7", "MCS7 Uplink "}, - { "egprs.uplink_mcs8", "MCS8 Uplink "}, - { "egprs.uplink_mcs9", "MCS9 Uplink "}, -}; - -static const struct rate_ctr_group_desc bts_ctrg_desc = { - "bts", - "BTS Statistics", - OSMO_STATS_CLASS_GLOBAL, - ARRAY_SIZE(bts_ctr_description), - bts_ctr_description, -}; - static const struct osmo_stat_item_desc bts_stat_item_description[] = { { "ms.present", "MS Present ", OSMO_STAT_ITEM_NO_UNIT, 4, 0}, @@ -179,11 +78,6 @@ return BTS::main_bts()->bts_data(); } -struct rate_ctr_group *bts_main_data_stats() -{ - return BTS::main_bts()->rate_counters(); -} - BTS::BTS() : m_cur_fn(0) , m_cur_blk_fn(-1) @@ -207,8 +101,6 @@ } } - m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); - OSMO_ASSERT(m_ratectrs); m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0); OSMO_ASSERT(m_statg); } @@ -219,7 +111,8 @@ * m_ms_store's destructor */ m_ms_store.cleanup(); - rate_ctr_group_free(m_ratectrs); + if (m_bts.ctrs) + rate_ctr_group_free(m_bts.ctrs); osmo_stat_item_group_free(m_statg); } diff --git a/src/bts.h b/src/bts.h index d65cd2f..19d948a 100644 --- a/src/bts.h +++ b/src/bts.h @@ -231,6 +231,9 @@ /* State for dynamic algorithm selection */ int multislot_disabled; + /* Statistics */ + struct rate_ctr_group *ctrs; + /** * Point back to the C++ object. This is used during the transition * period. @@ -482,7 +485,6 @@ /* * Below for C interface for the VTY */ - struct rate_ctr_group *rate_counters() const; struct osmo_stat_item_group *stat_items() const; LListHead& ul_tbfs(); @@ -493,7 +495,6 @@ struct gprs_rlcmac_bts m_bts; PollController m_pollController; SBAController m_sba; - struct rate_ctr_group *m_ratectrs; struct osmo_stat_item_group *m_statg; GprsMsStorage m_ms_store; @@ -570,11 +571,6 @@ return m_assigned_tfi[dir]; } -inline struct rate_ctr_group *BTS::rate_counters() const -{ - return m_ratectrs; -} - inline struct osmo_stat_item_group *BTS::stat_items() const { return m_statg; @@ -582,12 +578,14 @@ #define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ inline void BTS::func_name(int inc) {\ - rate_ctr_add(&m_ratectrs->ctr[ctr_name], inc); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ } #define CREATE_COUNT_INLINE(func_name, ctr_name) \ inline void BTS::func_name() {\ - rate_ctr_inc(&m_ratectrs->ctr[ctr_name]); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ } CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) @@ -705,7 +703,6 @@ extern "C" { #endif struct gprs_rlcmac_bts *bts_main_data(); - struct rate_ctr_group *bts_main_data_stats(); struct osmo_stat_item_group *bts_main_data_stat_items(); #ifdef __cplusplus } diff --git a/src/pcu_ctr.c b/src/pcu_ctr.c new file mode 100644 index 0000000..d3ed801 --- /dev/null +++ b/src/pcu_ctr.c @@ -0,0 +1,41 @@ +/* pcu_ctr.c + * + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "pcu_ctr.h" + +#include +#include +#include + +extern void *tall_pcu_ctx; + +struct rate_ctr_group *pcu_ctr_init() +{ + const struct rate_ctr_group_desc bts_ctrg_desc = { + "bts", + "BTS Statistics", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(bts_ctr_description), + bts_ctr_description, + }; + + return rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); +} diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h new file mode 100644 index 0000000..8cfada4 --- /dev/null +++ b/src/pcu_ctr.h @@ -0,0 +1,120 @@ +/* pcu_ctr.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by Sysmocom s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#include +#include + +#include +#include +#include + +static const struct rate_ctr_desc bts_ctr_description[] = { + { "tbf.dl.alloc", "TBF DL Allocated "}, + { "tbf.dl.freed", "TBF DL Freed "}, + { "tbf.dl.aborted", "TBF DL Aborted "}, + { "tbf.ul.alloc", "TBF UL Allocated "}, + { "tbf.ul.freed", "TBF UL Freed "}, + { "tbf.ul.aborted", "TBF UL Aborted "}, + { "tbf.reused", "TBF Reused "}, + { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, + { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, + { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, + { "rlc.sent", "RLC Sent "}, + { "rlc.resent", "RLC Resent "}, + { "rlc.restarted", "RLC Restarted "}, + { "rlc.stalled", "RLC Stalled "}, + { "rlc.nacked", "RLC Nacked "}, + { "rlc.final_block_resent", "RLC Final Blk resent "}, + { "rlc.ass.timedout", "RLC Assign Timeout "}, + { "rlc.ass.failed", "RLC Assign Failed "}, + { "rlc.ack.timedout", "RLC Ack Timeout "}, + { "rlc.ack.failed", "RLC Ack Failed "}, + { "rlc.rel.timedout", "RLC Release Timeout "}, + { "rlc.late-block", "RLC Late Block "}, + { "rlc.sent-dummy", "RLC Sent Dummy "}, + { "rlc.sent-control", "RLC Sent Control "}, + { "rlc.dl_bytes", "RLC DL Bytes "}, + { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, + { "rlc.ul_bytes", "RLC UL Bytes "}, + { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, + { "decode.errors", "Decode Errors "}, + { "sba.allocated", "SBA Allocated "}, + { "sba.freed", "SBA Freed "}, + { "sba.timedout", "SBA Timeout "}, + { "llc.timeout", "Timedout Frames "}, + { "llc.dropped", "Dropped Frames "}, + { "llc.scheduled", "Scheduled Frames "}, + { "llc.dl_bytes", "RLC encapsulated PDUs"}, + { "llc.ul_bytes", "full PDUs received "}, + { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "spb.uplink_first_segment", "First seg of UL SPB "}, + { "spb.uplink_second_segment", "Second seg of UL SPB "}, + { "spb.downlink_first_segment", "First seg of DL SPB "}, + { "spb.downlink_second_segment","Second seg of DL SPB "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_rej", "Immediate Assign Rej "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "channel.request_description","Channel Request Desc "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.access_reject", "Packet Access Reject "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, +}; + +struct rate_ctr_group *pcu_ctr_init(); diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b7574f9..c7dd3ed 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -30,6 +30,7 @@ #include extern "C" { #include "pcu_vty.h" +#include "pcu_ctr.h" #include #include #include @@ -251,6 +252,7 @@ vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); + bts->ctrs = pcu_ctr_init(); handle_options(argc, argv); if ((!!spoof_mcc) + (!!spoof_mnc) == 1) { diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 5ec16ea..c94f7d2 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "pcu_vty.h" #include "gprs_rlcmac.h" @@ -836,7 +837,9 @@ "show bts statistics", SHOW_STR "BTS related functionality\nStatistics\n") { - vty_out_rate_ctr_group(vty, "", bts_main_data_stats()); + struct gprs_rlcmac_bts *bts = bts_main_data(); + + vty_out_rate_ctr_group(vty, "", bts->ctrs); return CMD_SUCCESS; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..48ca24f 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } /* globals used by the code */ @@ -117,6 +118,7 @@ printf("Testing alloc_a direction(%d)\n", dir); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; struct gprs_rlcmac_trx *trx = &bts->trx[0]; @@ -195,6 +197,7 @@ printf("Testing UL then DL assignment.\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -237,6 +240,7 @@ printf("Testing DL then UL assignment followed by update\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -284,6 +288,7 @@ printf("Testing jolly example\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -345,6 +350,7 @@ gprs_rlcmac_tbf *ul_tbf, *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -389,6 +395,7 @@ gprs_rlcmac_dl_tbf *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -482,6 +489,7 @@ uint8_t trx_no = -1; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); gprs_rlcmac_tbf *tbf = NULL; @@ -663,6 +671,7 @@ printf("Going to test assignment with many TBF, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -701,6 +710,7 @@ printf("Going to test assignment with many connections, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -809,6 +819,7 @@ printf("Testing DL TS allocation for Multi UEs\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..604366e 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -30,7 +30,7 @@ extern "C" { #include "pcu_vty.h" - +#include "pcu_ctr.h" #include #include #include @@ -74,6 +74,7 @@ printf("=== start %s ===\n", __func__); + the_bts.bts_data()->ctrs = pcu_ctr_init(); the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a; the_bts.bts_data()->trx[0].pdch[2].enable(); the_bts.bts_data()->trx[0].pdch[3].enable(); @@ -148,6 +149,7 @@ gprs_rlcmac_trx *trx; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; bts->initial_cs_dl = cs; bts->initial_cs_ul = cs; diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 7d09108..25d689b 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } #define OSMO_ASSERT_STR_EQ(a, b) \ @@ -351,6 +352,7 @@ int bsn_begin, bsn_end, num_blocks; Ack_Nack_Description_t desc; + dummy_bts.bts_data()->ctrs = pcu_ctr_init(); dl_win.m_v_b.reset(); OSMO_ASSERT(dl_win.window_empty()); -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 25 15:37:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 15:37:07 +0000 Subject: [PATCH] osmo-pcu[master]: Move all rate counter related code together In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4413 to look at the new patch set (#4). Move all rate counter related code together Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Related: OS#1538 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/llc.cpp M src/pcu_ctr.h M src/rlc.cpp M src/sba.cpp M src/tbf.cpp M src/tbf_dl.cpp M src/tbf_ul.cpp 11 files changed, 300 insertions(+), 288 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/4413/4 diff --git a/src/bts.cpp b/src/bts.cpp index 0f7462a..16d9dba 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -30,6 +30,7 @@ #include extern "C" { + #include "pcu_ctr.h" #include #include #include @@ -161,7 +162,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "Late RLC block, FN delta: %d FN: %d curFN: %d\n", delay, fn, current_frame_number()); - rlc_late_block(); + rlc_late_block(bts_data()->ctrs); } m_cur_blk_fn = fn; @@ -506,10 +507,10 @@ uint16_t priority = 0; bool failure = false; - rach_frame(); + rach_frame(bts_data()->ctrs); if (is_11bit) - rach_frame_11bit(); + rach_frame_11bit(bts_data()->ctrs); /* Determine full frame number */ Fn = rfn_to_fn(Fn); @@ -590,7 +591,7 @@ plen = Encoding::write_immediate_assignment_reject( immediate_assignment, ra, Fn, burst_type); - immediate_assignment_reject(); + immediate_assignment_reject(bts_data()->ctrs); } else { LOGP(DRLCMAC, LOGL_DEBUG, @@ -605,7 +606,7 @@ } if (plen >= 0) { - immediate_assignment_ul_tbf(); + immediate_assignment_ul_tbf(bts_data()->ctrs); pcu_l1if_tx_agch(immediate_assignment, plen); } @@ -699,7 +700,7 @@ tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); if (plen >= 0) { - immediate_assignment_dl_tbf(); + immediate_assignment_dl_tbf(bts_data()->ctrs); pcu_l1if_tx_pch(immediate_assignment, plen, imsi); } @@ -1026,7 +1027,7 @@ static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) { - bts->channel_request_description(); + channel_request_description(bts->bts_data()->ctrs); /* This call will register the new TBF with the MS on success */ gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), @@ -1356,7 +1357,7 @@ else bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - bts()->rlc_rcvd_control(); + rlc_rcvd_control(bts_data()->ctrs); switch (ul_control_block->u.MESSAGE_TYPE) { case MT_PACKET_CONTROL_ACK: rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); @@ -1377,7 +1378,7 @@ /* ignoring it. change the SI to not force sending these? */ break; default: - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMAC, LOGL_NOTICE, "RX: [PCU <- BTS] unknown control block(%d) received\n", ul_control_block->u.MESSAGE_TYPE); @@ -1393,13 +1394,13 @@ { GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); if (!cs) { - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" "length: %d)\n", len); return -EINVAL; } - bts()->rlc_ul_bytes(len); + rlc_ul_bytes(bts_data()->ctrs, len); LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); @@ -1410,7 +1411,7 @@ if (cs.isEgprs()) return rcv_data_block(data, len, fn, meas, cs); - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", cs.name()); return -EINVAL; @@ -1447,7 +1448,7 @@ LOGP(DRLCMACUL, LOGL_ERROR, "Got %s RLC block but header parsing has failed\n", cs.name()); - bts()->decode_error(); + decode_error(bts_data()->ctrs); return rc; } diff --git a/src/bts.h b/src/bts.h index 19d948a..d20f633 100644 --- a/src/bts.h +++ b/src/bts.h @@ -390,95 +390,6 @@ uint8_t ts_no, uint8_t channel, uint32_t fn, const uint8_t *data, unsigned int len); - /* - * Statistics - */ - void tbf_dl_created(); - void tbf_dl_freed(); - void tbf_dl_aborted(); - void tbf_ul_created(); - void tbf_ul_freed(); - void tbf_ul_aborted(); - void tbf_reused(); - void tbf_alloc_algo_a(); - void tbf_alloc_algo_b(); - void tbf_failed_egprs_only(); - void rlc_sent(); - void rlc_resent(); - void rlc_restarted(); - void rlc_stalled(); - void rlc_nacked(); - void rlc_final_block_resent(); - void rlc_ass_timedout(); - void rlc_ass_failed(); - void rlc_ack_timedout(); - void rlc_ack_failed(); - void rlc_rel_timedout(); - void rlc_late_block(); - void rlc_sent_dummy(); - void rlc_sent_control(); - void rlc_dl_bytes(int bytes); - void rlc_dl_payload_bytes(int bytes); - void rlc_ul_bytes(int bytes); - void rlc_ul_payload_bytes(int bytes); - void decode_error(); - void sba_allocated(); - void sba_freed(); - void sba_timedout(); - void llc_timedout_frame(); - void llc_dropped_frame(); - void llc_frame_sched(); - void llc_dl_bytes(int bytes); - void llc_ul_bytes(int bytes); - void rach_frame(); - void rach_frame_11bit(); - void spb_uplink_first_segment(); - void spb_uplink_second_segment(); - void spb_downlink_first_segment(); - void spb_downlink_second_segment(); - void immediate_assignment_ul_tbf(); - void immediate_assignment_reject(); - void immediate_assignment_dl_tbf(); - void channel_request_description(); - void pkt_ul_assignment(); - void pkt_access_reject(); - void pkt_dl_assignemnt(); - void rlc_rcvd_control(); - void pua_poll_timedout(); - void pua_poll_failed(); - void pda_poll_timedout(); - void pda_poll_failed(); - void pkt_ul_ack_nack_poll_timedout(); - void pkt_ul_ack_nack_poll_failed(); - void pkt_dl_ack_nack_poll_timedout(); - void pkt_dl_ack_nack_poll_failed(); - void gprs_dl_cs1(); - void gprs_dl_cs2(); - void gprs_dl_cs3(); - void gprs_dl_cs4(); - void egprs_dl_mcs1(); - void egprs_dl_mcs2(); - void egprs_dl_mcs3(); - void egprs_dl_mcs4(); - void egprs_dl_mcs5(); - void egprs_dl_mcs6(); - void egprs_dl_mcs7(); - void egprs_dl_mcs8(); - void egprs_dl_mcs9(); - void gprs_ul_cs1(); - void gprs_ul_cs2(); - void gprs_ul_cs3(); - void gprs_ul_cs4(); - void egprs_ul_mcs1(); - void egprs_ul_mcs2(); - void egprs_ul_mcs3(); - void egprs_ul_mcs4(); - void egprs_ul_mcs5(); - void egprs_ul_mcs6(); - void egprs_ul_mcs7(); - void egprs_ul_mcs8(); - void egprs_ul_mcs9(); - void ms_present(int32_t n); int32_t ms_present_get(); @@ -575,106 +486,6 @@ { return m_statg; } - -#define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ - inline void BTS::func_name(int inc) {\ - OSMO_ASSERT(m_bts.ctrs); \ - rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ - } - -#define CREATE_COUNT_INLINE(func_name, ctr_name) \ - inline void BTS::func_name() {\ - OSMO_ASSERT(m_bts.ctrs); \ - rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ - } - -CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) -CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) -CREATE_COUNT_INLINE(tbf_dl_aborted, CTR_TBF_DL_ABORTED) -CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) -CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) -CREATE_COUNT_INLINE(tbf_ul_aborted, CTR_TBF_UL_ABORTED) -CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) -CREATE_COUNT_INLINE(tbf_alloc_algo_a, CTR_TBF_ALLOC_ALGO_A) -CREATE_COUNT_INLINE(tbf_alloc_algo_b, CTR_TBF_ALLOC_ALGO_B) -CREATE_COUNT_INLINE(tbf_failed_egprs_only, CTR_TBF_FAILED_EGPRS_ONLY) -CREATE_COUNT_INLINE(rlc_sent, CTR_RLC_SENT) -CREATE_COUNT_INLINE(rlc_resent, CTR_RLC_RESENT) -CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) -CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) -CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) -CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); -CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); -CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_ack_failed, CTR_RLC_ACK_FAILED); -CREATE_COUNT_INLINE(rlc_rel_timedout, CTR_RLC_REL_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_late_block, CTR_RLC_LATE_BLOCK); -CREATE_COUNT_INLINE(rlc_sent_dummy, CTR_RLC_SENT_DUMMY); -CREATE_COUNT_INLINE(rlc_sent_control, CTR_RLC_SENT_CONTROL); -CREATE_COUNT_ADD_INLINE(rlc_dl_bytes, CTR_RLC_DL_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_dl_payload_bytes, CTR_RLC_DL_PAYLOAD_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_ul_bytes, CTR_RLC_UL_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_ul_payload_bytes, CTR_RLC_UL_PAYLOAD_BYTES); -CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) -CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) -CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) -CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) -CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); -CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); -CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); -CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); -CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); -CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); -CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); -CREATE_COUNT_INLINE(spb_uplink_first_segment, CTR_SPB_UL_FIRST_SEGMENT); -CREATE_COUNT_INLINE(spb_uplink_second_segment, CTR_SPB_UL_SECOND_SEGMENT); -CREATE_COUNT_INLINE(spb_downlink_first_segment, CTR_SPB_DL_FIRST_SEGMENT); -CREATE_COUNT_INLINE(spb_downlink_second_segment, CTR_SPB_DL_SECOND_SEGMENT); -CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); -CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); -CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); -CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); -CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); -CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); -CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); -CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); -CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); -CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); -CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); -CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); -CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); -CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); -CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); -CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); -CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); -CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); -CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); -CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); -CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); -CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); -CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); -CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); -CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); -CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); -CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); -CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); -CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); -CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); -CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); -CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); -CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); -CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); -CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); -CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); -CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); -CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); - -#undef CREATE_COUNT_INLINE #define CREATE_STAT_INLINE(func_name, func_name_get, stat_name) \ inline void BTS::func_name(int32_t val) {\ diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 2350808..838d6b2 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,6 +25,10 @@ #include "pcu_utils.h" +extern "C" { +#include "pcu_ctr.h" +} + static uint32_t sched_poll(BTS *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, struct gprs_rlcmac_tbf **poll_tbf, @@ -316,18 +320,18 @@ switch(cat) { case PCU_GSMTAP_C_DL_CTRL: - bts->bts->rlc_sent_control(); + rlc_sent_control(bts->bts->bts_data()->ctrs); bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DATA_GPRS: - bts->bts->rlc_sent(); + rlc_sent(bts->bts->bts_data()->ctrs); /* FIXME: distinguish between GPRS and EGPRS */ bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DUMMY: - bts->bts->rlc_sent_dummy(); + rlc_sent_dummy(bts->bts->bts_data()->ctrs); bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); break; @@ -403,7 +407,7 @@ if (!msg) return -ENOMEM; /* msg is now available */ - bts->bts->rlc_dl_bytes(msg->data_len); + rlc_dl_bytes(bts->bts->bts_data()->ctrs, msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 2b08cf6..e657f3a 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -29,6 +29,10 @@ #include #include +extern "C" { +#include "pcu_ctr.h" +} + /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 @@ -485,7 +489,7 @@ ms_->set_reserved_slots(trx, 1 << ts, 1 << ts); tbf_->upgrade_to_multislot = 0; - bts->bts->tbf_alloc_algo_a(); + tbf_alloc_algo_a(bts->bts->bts_data()->ctrs); return 0; } @@ -1021,7 +1025,7 @@ } } - bts->bts->tbf_alloc_algo_b(); + tbf_alloc_algo_b(bts->bts->bts_data()->ctrs); return 0; } diff --git a/src/llc.cpp b/src/llc.cpp index 79afc37..182fdfc 100644 --- a/src/llc.cpp +++ b/src/llc.cpp @@ -25,6 +25,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include } @@ -126,7 +127,7 @@ while ((msg = msgb_dequeue(&m_queue))) { if (bts) - bts->llc_dropped_frame(); + llc_dropped_frame(bts->bts_data()->ctrs); msgb_free(msg); } diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h index 8cfada4..0baa543 100644 --- a/src/pcu_ctr.h +++ b/src/pcu_ctr.h @@ -29,6 +29,94 @@ #include #include +enum { + CTR_TBF_DL_ALLOCATED, + CTR_TBF_DL_FREED, + CTR_TBF_DL_ABORTED, + CTR_TBF_UL_ALLOCATED, + CTR_TBF_UL_FREED, + CTR_TBF_UL_ABORTED, + CTR_TBF_REUSED, + CTR_TBF_ALLOC_ALGO_A, + CTR_TBF_ALLOC_ALGO_B, + CTR_TBF_FAILED_EGPRS_ONLY, + CTR_RLC_SENT, + CTR_RLC_RESENT, + CTR_RLC_RESTARTED, + CTR_RLC_STALLED, + CTR_RLC_NACKED, + CTR_RLC_FINAL_BLOCK_RESENT, + CTR_RLC_ASS_TIMEDOUT, + CTR_RLC_ASS_FAILED, + CTR_RLC_ACK_TIMEDOUT, + CTR_RLC_ACK_FAILED, + CTR_RLC_REL_TIMEDOUT, + CTR_RLC_LATE_BLOCK, + CTR_RLC_SENT_DUMMY, + CTR_RLC_SENT_CONTROL, + CTR_RLC_DL_BYTES, + CTR_RLC_DL_PAYLOAD_BYTES, + CTR_RLC_UL_BYTES, + CTR_RLC_UL_PAYLOAD_BYTES, + CTR_DECODE_ERRORS, + CTR_SBA_ALLOCATED, + CTR_SBA_FREED, + CTR_SBA_TIMEDOUT, + CTR_LLC_FRAME_TIMEDOUT, + CTR_LLC_FRAME_DROPPED, + CTR_LLC_FRAME_SCHED, + CTR_LLC_DL_BYTES, + CTR_LLC_UL_BYTES, + CTR_RACH_REQUESTS, + CTR_11BIT_RACH_REQUESTS, + CTR_SPB_UL_FIRST_SEGMENT, + CTR_SPB_UL_SECOND_SEGMENT, + CTR_SPB_DL_FIRST_SEGMENT, + CTR_SPB_DL_SECOND_SEGMENT, + CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_REJ, + CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_CHANNEL_REQUEST_DESCRIPTION, + CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_ACCESS_REJ, + CTR_PKT_DL_ASSIGNMENT, + CTR_RLC_RECV_CONTROL, + CTR_PUA_POLL_TIMEDOUT, + CTR_PUA_POLL_FAILED, + CTR_PDA_POLL_TIMEDOUT, + CTR_PDA_POLL_FAILED, + CTR_PUAN_POLL_TIMEDOUT, + CTR_PUAN_POLL_FAILED, + CTR_PDAN_POLL_TIMEDOUT, + CTR_PDAN_POLL_FAILED, + CTR_GPRS_DL_CS1, + CTR_GPRS_DL_CS2, + CTR_GPRS_DL_CS3, + CTR_GPRS_DL_CS4, + CTR_EGPRS_DL_MCS1, + CTR_EGPRS_DL_MCS2, + CTR_EGPRS_DL_MCS3, + CTR_EGPRS_DL_MCS4, + CTR_EGPRS_DL_MCS5, + CTR_EGPRS_DL_MCS6, + CTR_EGPRS_DL_MCS7, + CTR_EGPRS_DL_MCS8, + CTR_EGPRS_DL_MCS9, + CTR_GPRS_UL_CS1, + CTR_GPRS_UL_CS2, + CTR_GPRS_UL_CS3, + CTR_GPRS_UL_CS4, + CTR_EGPRS_UL_MCS1, + CTR_EGPRS_UL_MCS2, + CTR_EGPRS_UL_MCS3, + CTR_EGPRS_UL_MCS4, + CTR_EGPRS_UL_MCS5, + CTR_EGPRS_UL_MCS6, + CTR_EGPRS_UL_MCS7, + CTR_EGPRS_UL_MCS8, + CTR_EGPRS_UL_MCS9, +}; + static const struct rate_ctr_desc bts_ctr_description[] = { { "tbf.dl.alloc", "TBF DL Allocated "}, { "tbf.dl.freed", "TBF DL Freed "}, @@ -118,3 +206,101 @@ }; struct rate_ctr_group *pcu_ctr_init(); + +#define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ + inline void func_name(struct rate_ctr_group *ctrs, int inc) { \ + OSMO_ASSERT(ctrs); \ + rate_ctr_add(&ctrs->ctr[ctr_name], inc); \ + } + +#define CREATE_COUNT_INLINE(func_name, ctr_name) \ + static inline void func_name(struct rate_ctr_group *ctrs) {\ + OSMO_ASSERT(ctrs); \ + rate_ctr_inc(&ctrs->ctr[ctr_name]); \ + } + +CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) +CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) +CREATE_COUNT_INLINE(tbf_dl_aborted, CTR_TBF_DL_ABORTED) +CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) +CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) +CREATE_COUNT_INLINE(tbf_ul_aborted, CTR_TBF_UL_ABORTED) +CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) +CREATE_COUNT_INLINE(tbf_alloc_algo_a, CTR_TBF_ALLOC_ALGO_A) +CREATE_COUNT_INLINE(tbf_alloc_algo_b, CTR_TBF_ALLOC_ALGO_B) +CREATE_COUNT_INLINE(tbf_failed_egprs_only, CTR_TBF_FAILED_EGPRS_ONLY) +CREATE_COUNT_INLINE(rlc_sent, CTR_RLC_SENT) +CREATE_COUNT_INLINE(rlc_resent, CTR_RLC_RESENT) +CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) +CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) +CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) +CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); +CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); +CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_ack_failed, CTR_RLC_ACK_FAILED); +CREATE_COUNT_INLINE(rlc_rel_timedout, CTR_RLC_REL_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_late_block, CTR_RLC_LATE_BLOCK); +CREATE_COUNT_INLINE(rlc_sent_dummy, CTR_RLC_SENT_DUMMY); +CREATE_COUNT_INLINE(rlc_sent_control, CTR_RLC_SENT_CONTROL); +CREATE_COUNT_ADD_INLINE(rlc_dl_bytes, CTR_RLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_dl_payload_bytes, CTR_RLC_DL_PAYLOAD_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_bytes, CTR_RLC_UL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_payload_bytes, CTR_RLC_UL_PAYLOAD_BYTES); +CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) +CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) +CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) +CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) +CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); +CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); +CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); +CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); +CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); +CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); +CREATE_COUNT_INLINE(spb_uplink_first_segment, CTR_SPB_UL_FIRST_SEGMENT); +CREATE_COUNT_INLINE(spb_uplink_second_segment, CTR_SPB_UL_SECOND_SEGMENT); +CREATE_COUNT_INLINE(spb_downlink_first_segment, CTR_SPB_DL_FIRST_SEGMENT); +CREATE_COUNT_INLINE(spb_downlink_second_segment, CTR_SPB_DL_SECOND_SEGMENT); +CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); +CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); +CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); +CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); +CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); +CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); +CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); +CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); +CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); +CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); +CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); +CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); +CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); +CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); +CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); +CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); +CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); +CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); +CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); +CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); +CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); +CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); +CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); +CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); +CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); +CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); +CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); +CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); +CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); +CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); +CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); +CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); +CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); diff --git a/src/rlc.cpp b/src/rlc.cpp index acd4169..560bbbf 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -23,6 +23,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include } @@ -154,7 +155,7 @@ } else { LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); - bts->rlc_nacked(); + rlc_nacked(bts->bts_data()->ctrs); *lost += 1; } } @@ -178,7 +179,7 @@ } else { LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); - bts->rlc_nacked(); + rlc_nacked(bts->bts_data()->ctrs); *lost += 1; } } diff --git a/src/sba.cpp b/src/sba.cpp index 56a7543..450cdc6 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -26,6 +26,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include #include } @@ -84,7 +85,7 @@ sba->ta = ta; llist_add(&sba->list, &m_sbas); - m_bts.sba_allocated(); + sba_allocated(m_bts.bts_data()->ctrs); *_trx = trx; *_ts = ts; @@ -130,14 +131,14 @@ LOGP(DRLCMAC, LOGL_NOTICE, "Poll timeout for SBA (TRX=%u, TS=%u, FN=%u, TA=%u)\n", sba->trx_no, sba->ts_no, sba->fn, sba->ta); - m_bts.sba_timedout(); + sba_timedout(m_bts.bts_data()->ctrs); free_sba(sba); return 0; } void SBAController::free_sba(gprs_rlcmac_sba *sba) { - m_bts.sba_freed(); + sba_freed(m_bts.bts_data()->ctrs); llist_del(&sba->list); talloc_free(sba); } diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..1dd190f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -31,6 +31,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include #include #include @@ -421,9 +422,9 @@ /* update counters */ if (tbf->direction == GPRS_RLCMAC_UL_TBF) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf); - tbf->bts->tbf_ul_freed(); + tbf_ul_freed(tbf->bts->bts_data()->ctrs); if (tbf->state_is(GPRS_RLCMAC_FLOW)) - tbf->bts->tbf_ul_aborted(); + tbf_ul_aborted(tbf->bts->bts_data()->ctrs); rate_ctr_group_free(ul_tbf->m_ul_egprs_ctrs); rate_ctr_group_free(ul_tbf->m_ul_gprs_ctrs); } else { @@ -433,9 +434,9 @@ } else { rate_ctr_group_free(dl_tbf->m_dl_gprs_ctrs); } - tbf->bts->tbf_dl_freed(); + tbf_dl_freed(tbf->bts->bts_data()->ctrs); if (tbf->state_is(GPRS_RLCMAC_FLOW)) - tbf->bts->tbf_dl_aborted(); + tbf_dl_aborted(tbf->bts->bts_data()->ctrs); } /* Give final measurement report */ @@ -653,14 +654,14 @@ LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling PACKET CONTROL ACK for PACKET UPLINK ACK\n"); rlcmac_diag(); } - bts->rlc_ack_timedout(); - bts->pkt_ul_ack_nack_poll_timedout(); + rlc_ack_timedout(bts->bts_data()->ctrs); + pkt_ul_ack_nack_poll_timedout(bts->bts_data()->ctrs); if (state_is(GPRS_RLCMAC_FINISHED)) { ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); - bts->pkt_ul_ack_nack_poll_failed(); + pkt_ul_ack_nack_poll_failed(bts->bts_data()->ctrs); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); return; @@ -679,14 +680,14 @@ } ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; - bts->rlc_ass_timedout(); - bts->pua_poll_timedout(); + rlc_ass_timedout(bts->bts_data()->ctrs); + pua_poll_timedout(bts->bts_data()->ctrs); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); - bts->rlc_ass_failed(); - bts->pua_poll_failed(); + rlc_ass_failed(bts->bts_data()->ctrs); + pua_poll_failed(bts->bts_data()->ctrs); return; } /* reschedule UL assignment */ @@ -701,14 +702,14 @@ } dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; - bts->rlc_ass_timedout(); - bts->pda_poll_timedout(); + rlc_ass_timedout(bts->bts_data()->ctrs); + pda_poll_timedout(bts->bts_data()->ctrs); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); - bts->rlc_ass_failed(); - bts->pda_poll_failed(); + rlc_ass_failed(bts->bts_data()->ctrs); + pda_poll_failed(bts->bts_data()->ctrs); return; } /* reschedule DL assignment */ @@ -724,17 +725,17 @@ } dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) - bts->rlc_rel_timedout(); + rlc_rel_timedout(bts->bts_data()->ctrs); else { - bts->rlc_ack_timedout(); - bts->pkt_dl_ack_nack_poll_timedout(); + rlc_ack_timedout(bts->bts_data()->ctrs); + pkt_dl_ack_nack_poll_timedout(bts->bts_data()->ctrs); } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(dl_tbf, 3195, dl_tbf->bts_data()->t3195, 0); - bts->pkt_dl_ack_nack_poll_failed(); - bts->rlc_ack_failed(); + pkt_dl_ack_nack_poll_failed(bts->bts_data()->ctrs); + rlc_ack_failed(bts->bts_data()->ctrs); return; } /* resend IMM.ASS on CCCH on timeout */ @@ -840,7 +841,7 @@ if (egprs_ms_class == 0 && bts->egprs_enabled) { LOGP(DRLCMAC, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n"); - bts->bts->tbf_failed_egprs_only(); + tbf_failed_egprs_only(bts->bts->bts_data()->ctrs); return NULL; } @@ -887,7 +888,7 @@ } llist_add(&tbf->list(), &bts->bts->ul_tbfs()); - tbf->bts->tbf_ul_created(); + tbf_ul_created(tbf->bts->bts_data()->ctrs); return tbf; } @@ -932,7 +933,7 @@ if (ms_class > 0) { LOGP(DRLCMAC, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n"); - bts->bts->tbf_failed_egprs_only(); + tbf_failed_egprs_only(bts->bts->bts_data()->ctrs); return NULL; } egprs_ms_class = 1; @@ -986,7 +987,7 @@ } llist_add(&tbf->list(), &bts->bts->dl_tbfs()); - tbf->bts->tbf_dl_created(); + tbf_dl_created(tbf->bts->bts_data()->ctrs); tbf->m_last_dl_poll_fn = -1; tbf->m_last_dl_drained_fn = -1; @@ -1180,7 +1181,7 @@ encode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); - bts->pkt_dl_assignemnt(); + pkt_dl_assignemnt(bts->bts_data()->ctrs); bitvec_pack(ass_vec, msgb_put(msg, 23)); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1213,7 +1214,7 @@ Encoding::write_packet_access_reject( packet_access_rej, tlli()); - bts->pkt_access_reject(); + pkt_access_reject(bts->bts_data()->ctrs); bitvec_pack(packet_access_rej, msgb_put(msg, 23)); @@ -1279,7 +1280,7 @@ decode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); - bts->pkt_ul_assignment(); + pkt_ul_assignment(bts->bts_data()->ctrs); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1312,7 +1313,7 @@ { struct gprs_rlcmac_dl_tbf *new_tbf = NULL; - bts->tbf_reused(); + tbf_reused(bts->bts_data()->ctrs); new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), @@ -1468,7 +1469,7 @@ ms->set_tlli(tlli); llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); - ul_tbf->bts->tbf_ul_created(); + tbf_ul_created(ul_tbf->bts->bts_data()->ctrs); ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 3d27883..deeb89e 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -32,6 +32,7 @@ #include "pcu_utils.h" extern "C" { +#include "pcu_ctr.h" #include #include #include @@ -295,12 +296,12 @@ break; } - bts->llc_timedout_frame(); + llc_timedout_frame(bts->bts_data()->ctrs); drop_frame: frames++; octets += msg->len; msgb_free(msg); - bts->llc_dropped_frame(); + llc_dropped_frame(bts->bts_data()->ctrs); continue; } @@ -407,19 +408,19 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Resending BSN %d\n", bsn); /* re-send block with negative aknowlegement */ m_window.m_v_b.mark_unacked(bsn); - bts->rlc_resent(); + rlc_resent(bts->bts_data()->ctrs); } else if (state_is(GPRS_RLCMAC_FINISHED)) { LOGP(DRLCMACDL, LOGL_DEBUG, "- Restarting at BSN %d, " "because all blocks have been transmitted.\n", m_window.v_a()); - bts->rlc_restarted(); + rlc_restarted(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else if (dl_window_stalled()) { LOGP(DRLCMACDL, LOGL_NOTICE, "- Restarting at BSN %d, " "because the window is stalled.\n", m_window.v_a()); - bts->rlc_stalled(); + rlc_stalled(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else if (have_data()) { @@ -435,7 +436,7 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Restarting at BSN %d, " "because all blocks have been transmitted (FLOW).\n", m_window.v_a()); - bts->rlc_restarted(); + rlc_restarted(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else { @@ -452,8 +453,8 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Nothing else to send, Re-transmit final block!\n"); bsn = m_window.v_s_mod(-1); - bts->rlc_final_block_resent(); - bts->rlc_resent(); + rlc_final_block_resent(bts->bts_data()->ctrs); + rlc_resent(bts->bts_data()->ctrs); } *may_combine = m_rlc.block(bsn)->cs_current_trans.numDataBlocks() > 1; @@ -535,7 +536,7 @@ tbf_name(this), msg->len); m_llc.put_frame(msg->data, msg->len); - bts->llc_frame_sched(); + llc_frame_sched(bts->bts_data()->ctrs); msgb_free(msg); m_last_dl_drained_fn = -1; } @@ -611,7 +612,7 @@ &m_llc, &write_offset, &num_chunks, data, is_final, &payload_written); if (payload_written > 0) - bts->rlc_dl_payload_bytes(payload_written); + rlc_dl_payload_bytes(bts->bts_data()->ctrs, payload_written); if (ar == Encoding::AR_NEED_MORE_BLOCKS) break; @@ -619,7 +620,7 @@ LOGP(DRLCMACDL, LOGL_INFO, "Complete DL frame for %s" "len=%d\n", tbf_name(this), m_llc.frame_length()); gprs_rlcmac_dl_bw(this, m_llc.frame_length()); - bts->llc_dl_bytes(m_llc.frame_length()); + llc_dl_bytes(bts->bts_data()->ctrs, m_llc.frame_length()); m_llc.reset(); if (is_final) { @@ -1359,19 +1360,19 @@ if (block_status_dl == EGPRS_RESEG_FIRST_SEG_SENT) { /* statistics */ - bts->spb_downlink_second_segment(); + spb_downlink_second_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_SEC_SEG; } else if ((cs_init.headerTypeData() == GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1) || (cs_init.headerTypeData() == GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2)) { - bts->spb_downlink_first_segment(); + spb_downlink_first_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_FIRST_SEG; } else if ((GprsCodingScheme::Scheme(cs_init) == GprsCodingScheme::MCS4) && (GprsCodingScheme::Scheme(cs_current_trans) == GprsCodingScheme::MCS1)) { - bts->spb_downlink_first_segment(); + spb_downlink_first_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_FIRST_SEG; } } @@ -1407,58 +1408,58 @@ if (cs.isGprs()) { switch (coding_scheme) { case GprsCodingScheme::CS1 : - bts->gprs_dl_cs1(); + gprs_dl_cs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS1]); break; case GprsCodingScheme::CS2 : - bts->gprs_dl_cs2(); + gprs_dl_cs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS2]); break; case GprsCodingScheme::CS3 : - bts->gprs_dl_cs3(); + gprs_dl_cs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS3]); break; case GprsCodingScheme::CS4 : - bts->gprs_dl_cs4(); + gprs_dl_cs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS4]); break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : - bts->egprs_dl_mcs1(); + egprs_dl_mcs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS1]); break; case GprsCodingScheme::MCS2 : - bts->egprs_dl_mcs2(); + egprs_dl_mcs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS2]); break; case GprsCodingScheme::MCS3 : - bts->egprs_dl_mcs3(); + egprs_dl_mcs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS3]); break; case GprsCodingScheme::MCS4 : - bts->egprs_dl_mcs4(); + egprs_dl_mcs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS4]); break; case GprsCodingScheme::MCS5 : - bts->egprs_dl_mcs5(); + egprs_dl_mcs5(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS5]); break; case GprsCodingScheme::MCS6 : - bts->egprs_dl_mcs6(); + egprs_dl_mcs6(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS6]); break; case GprsCodingScheme::MCS7 : - bts->egprs_dl_mcs7(); + egprs_dl_mcs7(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS7]); break; case GprsCodingScheme::MCS8 : - bts->egprs_dl_mcs8(); + egprs_dl_mcs8(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS8]); break; case GprsCodingScheme::MCS9 : - bts->egprs_dl_mcs9(); + egprs_dl_mcs9(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS9]); break; } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 81d3b24..1f8f0f6 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -32,6 +32,7 @@ #include "pcu_utils.h" extern "C" { +#include "pcu_ctr.h" #include #include } @@ -70,7 +71,7 @@ frame = frames + i; if (frame->length) { - bts->rlc_ul_payload_bytes(frame->length); + rlc_ul_payload_bytes(bts->bts_data()->ctrs, frame->length); LOGP(DRLCMACUL, LOGL_DEBUG, "-- Frame %d " "starts at offset %d, " @@ -87,7 +88,7 @@ LOGP(DRLCMACUL, LOGL_INFO, "%s complete UL frame len=%d\n", tbf_name(this) , m_llc.frame_length()); snd_ul_ud(); - bts->llc_ul_bytes(m_llc.frame_length()); + llc_ul_bytes(bts->bts_data()->ctrs, m_llc.frame_length()); m_llc.reset(); } } @@ -277,7 +278,7 @@ rdbi, rlc->cs, rlc_data, NULL, 0, &new_tlli); if (num_chunks < 0) { - bts->decode_error(); + decode_error(bts->bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_NOTICE, "Failed to decode TLLI of %s UL DATA " "TFI=%d.\n", rlc->cs.name(), rlc->tfi); @@ -419,7 +420,7 @@ union split_block_status *spb_status = &block->spb_status; uint8_t *rlc_data = &block->block[0]; - bts->spb_uplink_second_segment(); + spb_uplink_second_segment(bts->bts_data()->ctrs); if (spb_status->block_status_ul & EGPRS_RESEG_FIRST_SEG_RXD) { @@ -457,7 +458,7 @@ uint8_t *rlc_data = &block->block[0]; union split_block_status *spb_status = &block->spb_status; - bts->spb_uplink_first_segment(); + spb_uplink_first_segment(bts->bts_data()->ctrs); if (spb_status->block_status_ul & EGPRS_RESEG_SECOND_SEG_RXD) { LOGP(DRLCMACUL, LOGL_DEBUG, @@ -552,58 +553,58 @@ if (cs.isGprs()) { switch (coding_scheme) { case GprsCodingScheme::CS1 : - bts->gprs_ul_cs1(); + gprs_ul_cs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS1]); break; case GprsCodingScheme::CS2 : - bts->gprs_ul_cs2(); + gprs_ul_cs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS2]); break; case GprsCodingScheme::CS3 : - bts->gprs_ul_cs3(); + gprs_ul_cs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS3]); break; case GprsCodingScheme::CS4 : - bts->gprs_ul_cs4(); + gprs_ul_cs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS4]); break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : - bts->egprs_ul_mcs1(); + egprs_ul_mcs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS1]); break; case GprsCodingScheme::MCS2 : - bts->egprs_ul_mcs2(); + egprs_ul_mcs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS2]); break; case GprsCodingScheme::MCS3 : - bts->egprs_ul_mcs3(); + egprs_ul_mcs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS3]); break; case GprsCodingScheme::MCS4 : - bts->egprs_ul_mcs4(); + egprs_ul_mcs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS4]); break; case GprsCodingScheme::MCS5 : - bts->egprs_ul_mcs5(); + egprs_ul_mcs5(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS5]); break; case GprsCodingScheme::MCS6 : - bts->egprs_ul_mcs6(); + egprs_ul_mcs6(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS6]); break; case GprsCodingScheme::MCS7 : - bts->egprs_ul_mcs7(); + egprs_ul_mcs7(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS7]); break; case GprsCodingScheme::MCS8 : - bts->egprs_ul_mcs8(); + egprs_ul_mcs8(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS8]); break; case GprsCodingScheme::MCS9 : - bts->egprs_ul_mcs9(); + egprs_ul_mcs9(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS9]); break; } -- To view, visit https://gerrit.osmocom.org/4413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 15:46:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 15:46:18 +0000 Subject: [PATCH] osmo-pcu[master]: Move all rate counter related code together In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4413 to look at the new patch set (#5). Move all rate counter related code together Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Related: OS#1538 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/llc.cpp M src/pcu_ctr.h M src/rlc.cpp M src/sba.cpp M src/tbf.cpp M src/tbf_dl.cpp M src/tbf_ul.cpp 11 files changed, 302 insertions(+), 288 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/4413/5 diff --git a/src/bts.cpp b/src/bts.cpp index 0f7462a..16d9dba 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -30,6 +30,7 @@ #include extern "C" { + #include "pcu_ctr.h" #include #include #include @@ -161,7 +162,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "Late RLC block, FN delta: %d FN: %d curFN: %d\n", delay, fn, current_frame_number()); - rlc_late_block(); + rlc_late_block(bts_data()->ctrs); } m_cur_blk_fn = fn; @@ -506,10 +507,10 @@ uint16_t priority = 0; bool failure = false; - rach_frame(); + rach_frame(bts_data()->ctrs); if (is_11bit) - rach_frame_11bit(); + rach_frame_11bit(bts_data()->ctrs); /* Determine full frame number */ Fn = rfn_to_fn(Fn); @@ -590,7 +591,7 @@ plen = Encoding::write_immediate_assignment_reject( immediate_assignment, ra, Fn, burst_type); - immediate_assignment_reject(); + immediate_assignment_reject(bts_data()->ctrs); } else { LOGP(DRLCMAC, LOGL_DEBUG, @@ -605,7 +606,7 @@ } if (plen >= 0) { - immediate_assignment_ul_tbf(); + immediate_assignment_ul_tbf(bts_data()->ctrs); pcu_l1if_tx_agch(immediate_assignment, plen); } @@ -699,7 +700,7 @@ tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); if (plen >= 0) { - immediate_assignment_dl_tbf(); + immediate_assignment_dl_tbf(bts_data()->ctrs); pcu_l1if_tx_pch(immediate_assignment, plen, imsi); } @@ -1026,7 +1027,7 @@ static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) { - bts->channel_request_description(); + channel_request_description(bts->bts_data()->ctrs); /* This call will register the new TBF with the MS on success */ gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), @@ -1356,7 +1357,7 @@ else bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - bts()->rlc_rcvd_control(); + rlc_rcvd_control(bts_data()->ctrs); switch (ul_control_block->u.MESSAGE_TYPE) { case MT_PACKET_CONTROL_ACK: rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); @@ -1377,7 +1378,7 @@ /* ignoring it. change the SI to not force sending these? */ break; default: - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMAC, LOGL_NOTICE, "RX: [PCU <- BTS] unknown control block(%d) received\n", ul_control_block->u.MESSAGE_TYPE); @@ -1393,13 +1394,13 @@ { GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); if (!cs) { - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" "length: %d)\n", len); return -EINVAL; } - bts()->rlc_ul_bytes(len); + rlc_ul_bytes(bts_data()->ctrs, len); LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); @@ -1410,7 +1411,7 @@ if (cs.isEgprs()) return rcv_data_block(data, len, fn, meas, cs); - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", cs.name()); return -EINVAL; @@ -1447,7 +1448,7 @@ LOGP(DRLCMACUL, LOGL_ERROR, "Got %s RLC block but header parsing has failed\n", cs.name()); - bts()->decode_error(); + decode_error(bts_data()->ctrs); return rc; } diff --git a/src/bts.h b/src/bts.h index 19d948a..d20f633 100644 --- a/src/bts.h +++ b/src/bts.h @@ -390,95 +390,6 @@ uint8_t ts_no, uint8_t channel, uint32_t fn, const uint8_t *data, unsigned int len); - /* - * Statistics - */ - void tbf_dl_created(); - void tbf_dl_freed(); - void tbf_dl_aborted(); - void tbf_ul_created(); - void tbf_ul_freed(); - void tbf_ul_aborted(); - void tbf_reused(); - void tbf_alloc_algo_a(); - void tbf_alloc_algo_b(); - void tbf_failed_egprs_only(); - void rlc_sent(); - void rlc_resent(); - void rlc_restarted(); - void rlc_stalled(); - void rlc_nacked(); - void rlc_final_block_resent(); - void rlc_ass_timedout(); - void rlc_ass_failed(); - void rlc_ack_timedout(); - void rlc_ack_failed(); - void rlc_rel_timedout(); - void rlc_late_block(); - void rlc_sent_dummy(); - void rlc_sent_control(); - void rlc_dl_bytes(int bytes); - void rlc_dl_payload_bytes(int bytes); - void rlc_ul_bytes(int bytes); - void rlc_ul_payload_bytes(int bytes); - void decode_error(); - void sba_allocated(); - void sba_freed(); - void sba_timedout(); - void llc_timedout_frame(); - void llc_dropped_frame(); - void llc_frame_sched(); - void llc_dl_bytes(int bytes); - void llc_ul_bytes(int bytes); - void rach_frame(); - void rach_frame_11bit(); - void spb_uplink_first_segment(); - void spb_uplink_second_segment(); - void spb_downlink_first_segment(); - void spb_downlink_second_segment(); - void immediate_assignment_ul_tbf(); - void immediate_assignment_reject(); - void immediate_assignment_dl_tbf(); - void channel_request_description(); - void pkt_ul_assignment(); - void pkt_access_reject(); - void pkt_dl_assignemnt(); - void rlc_rcvd_control(); - void pua_poll_timedout(); - void pua_poll_failed(); - void pda_poll_timedout(); - void pda_poll_failed(); - void pkt_ul_ack_nack_poll_timedout(); - void pkt_ul_ack_nack_poll_failed(); - void pkt_dl_ack_nack_poll_timedout(); - void pkt_dl_ack_nack_poll_failed(); - void gprs_dl_cs1(); - void gprs_dl_cs2(); - void gprs_dl_cs3(); - void gprs_dl_cs4(); - void egprs_dl_mcs1(); - void egprs_dl_mcs2(); - void egprs_dl_mcs3(); - void egprs_dl_mcs4(); - void egprs_dl_mcs5(); - void egprs_dl_mcs6(); - void egprs_dl_mcs7(); - void egprs_dl_mcs8(); - void egprs_dl_mcs9(); - void gprs_ul_cs1(); - void gprs_ul_cs2(); - void gprs_ul_cs3(); - void gprs_ul_cs4(); - void egprs_ul_mcs1(); - void egprs_ul_mcs2(); - void egprs_ul_mcs3(); - void egprs_ul_mcs4(); - void egprs_ul_mcs5(); - void egprs_ul_mcs6(); - void egprs_ul_mcs7(); - void egprs_ul_mcs8(); - void egprs_ul_mcs9(); - void ms_present(int32_t n); int32_t ms_present_get(); @@ -575,106 +486,6 @@ { return m_statg; } - -#define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ - inline void BTS::func_name(int inc) {\ - OSMO_ASSERT(m_bts.ctrs); \ - rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ - } - -#define CREATE_COUNT_INLINE(func_name, ctr_name) \ - inline void BTS::func_name() {\ - OSMO_ASSERT(m_bts.ctrs); \ - rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ - } - -CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) -CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) -CREATE_COUNT_INLINE(tbf_dl_aborted, CTR_TBF_DL_ABORTED) -CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) -CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) -CREATE_COUNT_INLINE(tbf_ul_aborted, CTR_TBF_UL_ABORTED) -CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) -CREATE_COUNT_INLINE(tbf_alloc_algo_a, CTR_TBF_ALLOC_ALGO_A) -CREATE_COUNT_INLINE(tbf_alloc_algo_b, CTR_TBF_ALLOC_ALGO_B) -CREATE_COUNT_INLINE(tbf_failed_egprs_only, CTR_TBF_FAILED_EGPRS_ONLY) -CREATE_COUNT_INLINE(rlc_sent, CTR_RLC_SENT) -CREATE_COUNT_INLINE(rlc_resent, CTR_RLC_RESENT) -CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) -CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) -CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) -CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); -CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); -CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_ack_failed, CTR_RLC_ACK_FAILED); -CREATE_COUNT_INLINE(rlc_rel_timedout, CTR_RLC_REL_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_late_block, CTR_RLC_LATE_BLOCK); -CREATE_COUNT_INLINE(rlc_sent_dummy, CTR_RLC_SENT_DUMMY); -CREATE_COUNT_INLINE(rlc_sent_control, CTR_RLC_SENT_CONTROL); -CREATE_COUNT_ADD_INLINE(rlc_dl_bytes, CTR_RLC_DL_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_dl_payload_bytes, CTR_RLC_DL_PAYLOAD_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_ul_bytes, CTR_RLC_UL_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_ul_payload_bytes, CTR_RLC_UL_PAYLOAD_BYTES); -CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) -CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) -CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) -CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) -CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); -CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); -CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); -CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); -CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); -CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); -CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); -CREATE_COUNT_INLINE(spb_uplink_first_segment, CTR_SPB_UL_FIRST_SEGMENT); -CREATE_COUNT_INLINE(spb_uplink_second_segment, CTR_SPB_UL_SECOND_SEGMENT); -CREATE_COUNT_INLINE(spb_downlink_first_segment, CTR_SPB_DL_FIRST_SEGMENT); -CREATE_COUNT_INLINE(spb_downlink_second_segment, CTR_SPB_DL_SECOND_SEGMENT); -CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); -CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); -CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); -CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); -CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); -CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); -CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); -CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); -CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); -CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); -CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); -CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); -CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); -CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); -CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); -CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); -CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); -CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); -CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); -CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); -CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); -CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); -CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); -CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); -CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); -CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); -CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); -CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); -CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); -CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); -CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); -CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); -CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); -CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); -CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); -CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); -CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); -CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); - -#undef CREATE_COUNT_INLINE #define CREATE_STAT_INLINE(func_name, func_name_get, stat_name) \ inline void BTS::func_name(int32_t val) {\ diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 2350808..e80193f 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,6 +25,10 @@ #include "pcu_utils.h" +extern "C" { +#include "pcu_ctr.h" +} + static uint32_t sched_poll(BTS *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, struct gprs_rlcmac_tbf **poll_tbf, @@ -311,23 +315,25 @@ static inline void tap_n_acc(const struct msgb *msg, const struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, uint32_t fn, enum pcu_gsmtap_category cat) { + struct rate_ctr_group *ctrs = bts->bts->bts_data()->ctrs; + if (!msg) return; switch(cat) { case PCU_GSMTAP_C_DL_CTRL: - bts->bts->rlc_sent_control(); + rlc_sent_control(ctrs); bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DATA_GPRS: - bts->bts->rlc_sent(); + rlc_sent(ctrs); /* FIXME: distinguish between GPRS and EGPRS */ bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DUMMY: - bts->bts->rlc_sent_dummy(); + rlc_sent_dummy(ctrs); bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); break; @@ -403,7 +409,7 @@ if (!msg) return -ENOMEM; /* msg is now available */ - bts->bts->rlc_dl_bytes(msg->data_len); + rlc_dl_bytes(bts->bts->bts_data()->ctrs, msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 2b08cf6..e657f3a 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -29,6 +29,10 @@ #include #include +extern "C" { +#include "pcu_ctr.h" +} + /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 @@ -485,7 +489,7 @@ ms_->set_reserved_slots(trx, 1 << ts, 1 << ts); tbf_->upgrade_to_multislot = 0; - bts->bts->tbf_alloc_algo_a(); + tbf_alloc_algo_a(bts->bts->bts_data()->ctrs); return 0; } @@ -1021,7 +1025,7 @@ } } - bts->bts->tbf_alloc_algo_b(); + tbf_alloc_algo_b(bts->bts->bts_data()->ctrs); return 0; } diff --git a/src/llc.cpp b/src/llc.cpp index 79afc37..182fdfc 100644 --- a/src/llc.cpp +++ b/src/llc.cpp @@ -25,6 +25,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include } @@ -126,7 +127,7 @@ while ((msg = msgb_dequeue(&m_queue))) { if (bts) - bts->llc_dropped_frame(); + llc_dropped_frame(bts->bts_data()->ctrs); msgb_free(msg); } diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h index 8cfada4..0baa543 100644 --- a/src/pcu_ctr.h +++ b/src/pcu_ctr.h @@ -29,6 +29,94 @@ #include #include +enum { + CTR_TBF_DL_ALLOCATED, + CTR_TBF_DL_FREED, + CTR_TBF_DL_ABORTED, + CTR_TBF_UL_ALLOCATED, + CTR_TBF_UL_FREED, + CTR_TBF_UL_ABORTED, + CTR_TBF_REUSED, + CTR_TBF_ALLOC_ALGO_A, + CTR_TBF_ALLOC_ALGO_B, + CTR_TBF_FAILED_EGPRS_ONLY, + CTR_RLC_SENT, + CTR_RLC_RESENT, + CTR_RLC_RESTARTED, + CTR_RLC_STALLED, + CTR_RLC_NACKED, + CTR_RLC_FINAL_BLOCK_RESENT, + CTR_RLC_ASS_TIMEDOUT, + CTR_RLC_ASS_FAILED, + CTR_RLC_ACK_TIMEDOUT, + CTR_RLC_ACK_FAILED, + CTR_RLC_REL_TIMEDOUT, + CTR_RLC_LATE_BLOCK, + CTR_RLC_SENT_DUMMY, + CTR_RLC_SENT_CONTROL, + CTR_RLC_DL_BYTES, + CTR_RLC_DL_PAYLOAD_BYTES, + CTR_RLC_UL_BYTES, + CTR_RLC_UL_PAYLOAD_BYTES, + CTR_DECODE_ERRORS, + CTR_SBA_ALLOCATED, + CTR_SBA_FREED, + CTR_SBA_TIMEDOUT, + CTR_LLC_FRAME_TIMEDOUT, + CTR_LLC_FRAME_DROPPED, + CTR_LLC_FRAME_SCHED, + CTR_LLC_DL_BYTES, + CTR_LLC_UL_BYTES, + CTR_RACH_REQUESTS, + CTR_11BIT_RACH_REQUESTS, + CTR_SPB_UL_FIRST_SEGMENT, + CTR_SPB_UL_SECOND_SEGMENT, + CTR_SPB_DL_FIRST_SEGMENT, + CTR_SPB_DL_SECOND_SEGMENT, + CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_REJ, + CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_CHANNEL_REQUEST_DESCRIPTION, + CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_ACCESS_REJ, + CTR_PKT_DL_ASSIGNMENT, + CTR_RLC_RECV_CONTROL, + CTR_PUA_POLL_TIMEDOUT, + CTR_PUA_POLL_FAILED, + CTR_PDA_POLL_TIMEDOUT, + CTR_PDA_POLL_FAILED, + CTR_PUAN_POLL_TIMEDOUT, + CTR_PUAN_POLL_FAILED, + CTR_PDAN_POLL_TIMEDOUT, + CTR_PDAN_POLL_FAILED, + CTR_GPRS_DL_CS1, + CTR_GPRS_DL_CS2, + CTR_GPRS_DL_CS3, + CTR_GPRS_DL_CS4, + CTR_EGPRS_DL_MCS1, + CTR_EGPRS_DL_MCS2, + CTR_EGPRS_DL_MCS3, + CTR_EGPRS_DL_MCS4, + CTR_EGPRS_DL_MCS5, + CTR_EGPRS_DL_MCS6, + CTR_EGPRS_DL_MCS7, + CTR_EGPRS_DL_MCS8, + CTR_EGPRS_DL_MCS9, + CTR_GPRS_UL_CS1, + CTR_GPRS_UL_CS2, + CTR_GPRS_UL_CS3, + CTR_GPRS_UL_CS4, + CTR_EGPRS_UL_MCS1, + CTR_EGPRS_UL_MCS2, + CTR_EGPRS_UL_MCS3, + CTR_EGPRS_UL_MCS4, + CTR_EGPRS_UL_MCS5, + CTR_EGPRS_UL_MCS6, + CTR_EGPRS_UL_MCS7, + CTR_EGPRS_UL_MCS8, + CTR_EGPRS_UL_MCS9, +}; + static const struct rate_ctr_desc bts_ctr_description[] = { { "tbf.dl.alloc", "TBF DL Allocated "}, { "tbf.dl.freed", "TBF DL Freed "}, @@ -118,3 +206,101 @@ }; struct rate_ctr_group *pcu_ctr_init(); + +#define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ + inline void func_name(struct rate_ctr_group *ctrs, int inc) { \ + OSMO_ASSERT(ctrs); \ + rate_ctr_add(&ctrs->ctr[ctr_name], inc); \ + } + +#define CREATE_COUNT_INLINE(func_name, ctr_name) \ + static inline void func_name(struct rate_ctr_group *ctrs) {\ + OSMO_ASSERT(ctrs); \ + rate_ctr_inc(&ctrs->ctr[ctr_name]); \ + } + +CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) +CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) +CREATE_COUNT_INLINE(tbf_dl_aborted, CTR_TBF_DL_ABORTED) +CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) +CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) +CREATE_COUNT_INLINE(tbf_ul_aborted, CTR_TBF_UL_ABORTED) +CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) +CREATE_COUNT_INLINE(tbf_alloc_algo_a, CTR_TBF_ALLOC_ALGO_A) +CREATE_COUNT_INLINE(tbf_alloc_algo_b, CTR_TBF_ALLOC_ALGO_B) +CREATE_COUNT_INLINE(tbf_failed_egprs_only, CTR_TBF_FAILED_EGPRS_ONLY) +CREATE_COUNT_INLINE(rlc_sent, CTR_RLC_SENT) +CREATE_COUNT_INLINE(rlc_resent, CTR_RLC_RESENT) +CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) +CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) +CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) +CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); +CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); +CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_ack_failed, CTR_RLC_ACK_FAILED); +CREATE_COUNT_INLINE(rlc_rel_timedout, CTR_RLC_REL_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_late_block, CTR_RLC_LATE_BLOCK); +CREATE_COUNT_INLINE(rlc_sent_dummy, CTR_RLC_SENT_DUMMY); +CREATE_COUNT_INLINE(rlc_sent_control, CTR_RLC_SENT_CONTROL); +CREATE_COUNT_ADD_INLINE(rlc_dl_bytes, CTR_RLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_dl_payload_bytes, CTR_RLC_DL_PAYLOAD_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_bytes, CTR_RLC_UL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_payload_bytes, CTR_RLC_UL_PAYLOAD_BYTES); +CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) +CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) +CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) +CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) +CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); +CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); +CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); +CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); +CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); +CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); +CREATE_COUNT_INLINE(spb_uplink_first_segment, CTR_SPB_UL_FIRST_SEGMENT); +CREATE_COUNT_INLINE(spb_uplink_second_segment, CTR_SPB_UL_SECOND_SEGMENT); +CREATE_COUNT_INLINE(spb_downlink_first_segment, CTR_SPB_DL_FIRST_SEGMENT); +CREATE_COUNT_INLINE(spb_downlink_second_segment, CTR_SPB_DL_SECOND_SEGMENT); +CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); +CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); +CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); +CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); +CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); +CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); +CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); +CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); +CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); +CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); +CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); +CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); +CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); +CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); +CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); +CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); +CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); +CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); +CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); +CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); +CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); +CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); +CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); +CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); +CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); +CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); +CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); +CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); +CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); +CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); +CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); +CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); +CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); diff --git a/src/rlc.cpp b/src/rlc.cpp index acd4169..560bbbf 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -23,6 +23,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include } @@ -154,7 +155,7 @@ } else { LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); - bts->rlc_nacked(); + rlc_nacked(bts->bts_data()->ctrs); *lost += 1; } } @@ -178,7 +179,7 @@ } else { LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); - bts->rlc_nacked(); + rlc_nacked(bts->bts_data()->ctrs); *lost += 1; } } diff --git a/src/sba.cpp b/src/sba.cpp index 56a7543..450cdc6 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -26,6 +26,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include #include } @@ -84,7 +85,7 @@ sba->ta = ta; llist_add(&sba->list, &m_sbas); - m_bts.sba_allocated(); + sba_allocated(m_bts.bts_data()->ctrs); *_trx = trx; *_ts = ts; @@ -130,14 +131,14 @@ LOGP(DRLCMAC, LOGL_NOTICE, "Poll timeout for SBA (TRX=%u, TS=%u, FN=%u, TA=%u)\n", sba->trx_no, sba->ts_no, sba->fn, sba->ta); - m_bts.sba_timedout(); + sba_timedout(m_bts.bts_data()->ctrs); free_sba(sba); return 0; } void SBAController::free_sba(gprs_rlcmac_sba *sba) { - m_bts.sba_freed(); + sba_freed(m_bts.bts_data()->ctrs); llist_del(&sba->list); talloc_free(sba); } diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..1dd190f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -31,6 +31,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include #include #include @@ -421,9 +422,9 @@ /* update counters */ if (tbf->direction == GPRS_RLCMAC_UL_TBF) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf); - tbf->bts->tbf_ul_freed(); + tbf_ul_freed(tbf->bts->bts_data()->ctrs); if (tbf->state_is(GPRS_RLCMAC_FLOW)) - tbf->bts->tbf_ul_aborted(); + tbf_ul_aborted(tbf->bts->bts_data()->ctrs); rate_ctr_group_free(ul_tbf->m_ul_egprs_ctrs); rate_ctr_group_free(ul_tbf->m_ul_gprs_ctrs); } else { @@ -433,9 +434,9 @@ } else { rate_ctr_group_free(dl_tbf->m_dl_gprs_ctrs); } - tbf->bts->tbf_dl_freed(); + tbf_dl_freed(tbf->bts->bts_data()->ctrs); if (tbf->state_is(GPRS_RLCMAC_FLOW)) - tbf->bts->tbf_dl_aborted(); + tbf_dl_aborted(tbf->bts->bts_data()->ctrs); } /* Give final measurement report */ @@ -653,14 +654,14 @@ LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling PACKET CONTROL ACK for PACKET UPLINK ACK\n"); rlcmac_diag(); } - bts->rlc_ack_timedout(); - bts->pkt_ul_ack_nack_poll_timedout(); + rlc_ack_timedout(bts->bts_data()->ctrs); + pkt_ul_ack_nack_poll_timedout(bts->bts_data()->ctrs); if (state_is(GPRS_RLCMAC_FINISHED)) { ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); - bts->pkt_ul_ack_nack_poll_failed(); + pkt_ul_ack_nack_poll_failed(bts->bts_data()->ctrs); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); return; @@ -679,14 +680,14 @@ } ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; - bts->rlc_ass_timedout(); - bts->pua_poll_timedout(); + rlc_ass_timedout(bts->bts_data()->ctrs); + pua_poll_timedout(bts->bts_data()->ctrs); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); - bts->rlc_ass_failed(); - bts->pua_poll_failed(); + rlc_ass_failed(bts->bts_data()->ctrs); + pua_poll_failed(bts->bts_data()->ctrs); return; } /* reschedule UL assignment */ @@ -701,14 +702,14 @@ } dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; - bts->rlc_ass_timedout(); - bts->pda_poll_timedout(); + rlc_ass_timedout(bts->bts_data()->ctrs); + pda_poll_timedout(bts->bts_data()->ctrs); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); - bts->rlc_ass_failed(); - bts->pda_poll_failed(); + rlc_ass_failed(bts->bts_data()->ctrs); + pda_poll_failed(bts->bts_data()->ctrs); return; } /* reschedule DL assignment */ @@ -724,17 +725,17 @@ } dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) - bts->rlc_rel_timedout(); + rlc_rel_timedout(bts->bts_data()->ctrs); else { - bts->rlc_ack_timedout(); - bts->pkt_dl_ack_nack_poll_timedout(); + rlc_ack_timedout(bts->bts_data()->ctrs); + pkt_dl_ack_nack_poll_timedout(bts->bts_data()->ctrs); } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(dl_tbf, 3195, dl_tbf->bts_data()->t3195, 0); - bts->pkt_dl_ack_nack_poll_failed(); - bts->rlc_ack_failed(); + pkt_dl_ack_nack_poll_failed(bts->bts_data()->ctrs); + rlc_ack_failed(bts->bts_data()->ctrs); return; } /* resend IMM.ASS on CCCH on timeout */ @@ -840,7 +841,7 @@ if (egprs_ms_class == 0 && bts->egprs_enabled) { LOGP(DRLCMAC, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n"); - bts->bts->tbf_failed_egprs_only(); + tbf_failed_egprs_only(bts->bts->bts_data()->ctrs); return NULL; } @@ -887,7 +888,7 @@ } llist_add(&tbf->list(), &bts->bts->ul_tbfs()); - tbf->bts->tbf_ul_created(); + tbf_ul_created(tbf->bts->bts_data()->ctrs); return tbf; } @@ -932,7 +933,7 @@ if (ms_class > 0) { LOGP(DRLCMAC, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n"); - bts->bts->tbf_failed_egprs_only(); + tbf_failed_egprs_only(bts->bts->bts_data()->ctrs); return NULL; } egprs_ms_class = 1; @@ -986,7 +987,7 @@ } llist_add(&tbf->list(), &bts->bts->dl_tbfs()); - tbf->bts->tbf_dl_created(); + tbf_dl_created(tbf->bts->bts_data()->ctrs); tbf->m_last_dl_poll_fn = -1; tbf->m_last_dl_drained_fn = -1; @@ -1180,7 +1181,7 @@ encode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); - bts->pkt_dl_assignemnt(); + pkt_dl_assignemnt(bts->bts_data()->ctrs); bitvec_pack(ass_vec, msgb_put(msg, 23)); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1213,7 +1214,7 @@ Encoding::write_packet_access_reject( packet_access_rej, tlli()); - bts->pkt_access_reject(); + pkt_access_reject(bts->bts_data()->ctrs); bitvec_pack(packet_access_rej, msgb_put(msg, 23)); @@ -1279,7 +1280,7 @@ decode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); - bts->pkt_ul_assignment(); + pkt_ul_assignment(bts->bts_data()->ctrs); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1312,7 +1313,7 @@ { struct gprs_rlcmac_dl_tbf *new_tbf = NULL; - bts->tbf_reused(); + tbf_reused(bts->bts_data()->ctrs); new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), @@ -1468,7 +1469,7 @@ ms->set_tlli(tlli); llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); - ul_tbf->bts->tbf_ul_created(); + tbf_ul_created(ul_tbf->bts->bts_data()->ctrs); ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 3d27883..deeb89e 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -32,6 +32,7 @@ #include "pcu_utils.h" extern "C" { +#include "pcu_ctr.h" #include #include #include @@ -295,12 +296,12 @@ break; } - bts->llc_timedout_frame(); + llc_timedout_frame(bts->bts_data()->ctrs); drop_frame: frames++; octets += msg->len; msgb_free(msg); - bts->llc_dropped_frame(); + llc_dropped_frame(bts->bts_data()->ctrs); continue; } @@ -407,19 +408,19 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Resending BSN %d\n", bsn); /* re-send block with negative aknowlegement */ m_window.m_v_b.mark_unacked(bsn); - bts->rlc_resent(); + rlc_resent(bts->bts_data()->ctrs); } else if (state_is(GPRS_RLCMAC_FINISHED)) { LOGP(DRLCMACDL, LOGL_DEBUG, "- Restarting at BSN %d, " "because all blocks have been transmitted.\n", m_window.v_a()); - bts->rlc_restarted(); + rlc_restarted(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else if (dl_window_stalled()) { LOGP(DRLCMACDL, LOGL_NOTICE, "- Restarting at BSN %d, " "because the window is stalled.\n", m_window.v_a()); - bts->rlc_stalled(); + rlc_stalled(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else if (have_data()) { @@ -435,7 +436,7 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Restarting at BSN %d, " "because all blocks have been transmitted (FLOW).\n", m_window.v_a()); - bts->rlc_restarted(); + rlc_restarted(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else { @@ -452,8 +453,8 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Nothing else to send, Re-transmit final block!\n"); bsn = m_window.v_s_mod(-1); - bts->rlc_final_block_resent(); - bts->rlc_resent(); + rlc_final_block_resent(bts->bts_data()->ctrs); + rlc_resent(bts->bts_data()->ctrs); } *may_combine = m_rlc.block(bsn)->cs_current_trans.numDataBlocks() > 1; @@ -535,7 +536,7 @@ tbf_name(this), msg->len); m_llc.put_frame(msg->data, msg->len); - bts->llc_frame_sched(); + llc_frame_sched(bts->bts_data()->ctrs); msgb_free(msg); m_last_dl_drained_fn = -1; } @@ -611,7 +612,7 @@ &m_llc, &write_offset, &num_chunks, data, is_final, &payload_written); if (payload_written > 0) - bts->rlc_dl_payload_bytes(payload_written); + rlc_dl_payload_bytes(bts->bts_data()->ctrs, payload_written); if (ar == Encoding::AR_NEED_MORE_BLOCKS) break; @@ -619,7 +620,7 @@ LOGP(DRLCMACDL, LOGL_INFO, "Complete DL frame for %s" "len=%d\n", tbf_name(this), m_llc.frame_length()); gprs_rlcmac_dl_bw(this, m_llc.frame_length()); - bts->llc_dl_bytes(m_llc.frame_length()); + llc_dl_bytes(bts->bts_data()->ctrs, m_llc.frame_length()); m_llc.reset(); if (is_final) { @@ -1359,19 +1360,19 @@ if (block_status_dl == EGPRS_RESEG_FIRST_SEG_SENT) { /* statistics */ - bts->spb_downlink_second_segment(); + spb_downlink_second_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_SEC_SEG; } else if ((cs_init.headerTypeData() == GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1) || (cs_init.headerTypeData() == GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2)) { - bts->spb_downlink_first_segment(); + spb_downlink_first_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_FIRST_SEG; } else if ((GprsCodingScheme::Scheme(cs_init) == GprsCodingScheme::MCS4) && (GprsCodingScheme::Scheme(cs_current_trans) == GprsCodingScheme::MCS1)) { - bts->spb_downlink_first_segment(); + spb_downlink_first_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_FIRST_SEG; } } @@ -1407,58 +1408,58 @@ if (cs.isGprs()) { switch (coding_scheme) { case GprsCodingScheme::CS1 : - bts->gprs_dl_cs1(); + gprs_dl_cs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS1]); break; case GprsCodingScheme::CS2 : - bts->gprs_dl_cs2(); + gprs_dl_cs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS2]); break; case GprsCodingScheme::CS3 : - bts->gprs_dl_cs3(); + gprs_dl_cs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS3]); break; case GprsCodingScheme::CS4 : - bts->gprs_dl_cs4(); + gprs_dl_cs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS4]); break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : - bts->egprs_dl_mcs1(); + egprs_dl_mcs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS1]); break; case GprsCodingScheme::MCS2 : - bts->egprs_dl_mcs2(); + egprs_dl_mcs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS2]); break; case GprsCodingScheme::MCS3 : - bts->egprs_dl_mcs3(); + egprs_dl_mcs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS3]); break; case GprsCodingScheme::MCS4 : - bts->egprs_dl_mcs4(); + egprs_dl_mcs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS4]); break; case GprsCodingScheme::MCS5 : - bts->egprs_dl_mcs5(); + egprs_dl_mcs5(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS5]); break; case GprsCodingScheme::MCS6 : - bts->egprs_dl_mcs6(); + egprs_dl_mcs6(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS6]); break; case GprsCodingScheme::MCS7 : - bts->egprs_dl_mcs7(); + egprs_dl_mcs7(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS7]); break; case GprsCodingScheme::MCS8 : - bts->egprs_dl_mcs8(); + egprs_dl_mcs8(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS8]); break; case GprsCodingScheme::MCS9 : - bts->egprs_dl_mcs9(); + egprs_dl_mcs9(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS9]); break; } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 81d3b24..1f8f0f6 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -32,6 +32,7 @@ #include "pcu_utils.h" extern "C" { +#include "pcu_ctr.h" #include #include } @@ -70,7 +71,7 @@ frame = frames + i; if (frame->length) { - bts->rlc_ul_payload_bytes(frame->length); + rlc_ul_payload_bytes(bts->bts_data()->ctrs, frame->length); LOGP(DRLCMACUL, LOGL_DEBUG, "-- Frame %d " "starts at offset %d, " @@ -87,7 +88,7 @@ LOGP(DRLCMACUL, LOGL_INFO, "%s complete UL frame len=%d\n", tbf_name(this) , m_llc.frame_length()); snd_ul_ud(); - bts->llc_ul_bytes(m_llc.frame_length()); + llc_ul_bytes(bts->bts_data()->ctrs, m_llc.frame_length()); m_llc.reset(); } } @@ -277,7 +278,7 @@ rdbi, rlc->cs, rlc_data, NULL, 0, &new_tlli); if (num_chunks < 0) { - bts->decode_error(); + decode_error(bts->bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_NOTICE, "Failed to decode TLLI of %s UL DATA " "TFI=%d.\n", rlc->cs.name(), rlc->tfi); @@ -419,7 +420,7 @@ union split_block_status *spb_status = &block->spb_status; uint8_t *rlc_data = &block->block[0]; - bts->spb_uplink_second_segment(); + spb_uplink_second_segment(bts->bts_data()->ctrs); if (spb_status->block_status_ul & EGPRS_RESEG_FIRST_SEG_RXD) { @@ -457,7 +458,7 @@ uint8_t *rlc_data = &block->block[0]; union split_block_status *spb_status = &block->spb_status; - bts->spb_uplink_first_segment(); + spb_uplink_first_segment(bts->bts_data()->ctrs); if (spb_status->block_status_ul & EGPRS_RESEG_SECOND_SEG_RXD) { LOGP(DRLCMACUL, LOGL_DEBUG, @@ -552,58 +553,58 @@ if (cs.isGprs()) { switch (coding_scheme) { case GprsCodingScheme::CS1 : - bts->gprs_ul_cs1(); + gprs_ul_cs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS1]); break; case GprsCodingScheme::CS2 : - bts->gprs_ul_cs2(); + gprs_ul_cs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS2]); break; case GprsCodingScheme::CS3 : - bts->gprs_ul_cs3(); + gprs_ul_cs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS3]); break; case GprsCodingScheme::CS4 : - bts->gprs_ul_cs4(); + gprs_ul_cs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS4]); break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : - bts->egprs_ul_mcs1(); + egprs_ul_mcs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS1]); break; case GprsCodingScheme::MCS2 : - bts->egprs_ul_mcs2(); + egprs_ul_mcs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS2]); break; case GprsCodingScheme::MCS3 : - bts->egprs_ul_mcs3(); + egprs_ul_mcs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS3]); break; case GprsCodingScheme::MCS4 : - bts->egprs_ul_mcs4(); + egprs_ul_mcs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS4]); break; case GprsCodingScheme::MCS5 : - bts->egprs_ul_mcs5(); + egprs_ul_mcs5(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS5]); break; case GprsCodingScheme::MCS6 : - bts->egprs_ul_mcs6(); + egprs_ul_mcs6(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS6]); break; case GprsCodingScheme::MCS7 : - bts->egprs_ul_mcs7(); + egprs_ul_mcs7(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS7]); break; case GprsCodingScheme::MCS8 : - bts->egprs_ul_mcs8(); + egprs_ul_mcs8(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS8]); break; case GprsCodingScheme::MCS9 : - bts->egprs_ul_mcs9(); + egprs_ul_mcs9(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS9]); break; } -- To view, visit https://gerrit.osmocom.org/4413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 15:52:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 15:52:29 +0000 Subject: [PATCH] osmo-pcu[master]: Move all rate counter related code together In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4413 to look at the new patch set (#6). Move all rate counter related code together Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Related: OS#1538 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/llc.cpp M src/pcu_ctr.h M src/rlc.cpp M src/sba.cpp M src/tbf.cpp M src/tbf_dl.cpp M src/tbf_ul.cpp 11 files changed, 302 insertions(+), 376 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/4413/6 diff --git a/src/bts.cpp b/src/bts.cpp index 0f7462a..16d9dba 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -30,6 +30,7 @@ #include extern "C" { + #include "pcu_ctr.h" #include #include #include @@ -161,7 +162,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "Late RLC block, FN delta: %d FN: %d curFN: %d\n", delay, fn, current_frame_number()); - rlc_late_block(); + rlc_late_block(bts_data()->ctrs); } m_cur_blk_fn = fn; @@ -506,10 +507,10 @@ uint16_t priority = 0; bool failure = false; - rach_frame(); + rach_frame(bts_data()->ctrs); if (is_11bit) - rach_frame_11bit(); + rach_frame_11bit(bts_data()->ctrs); /* Determine full frame number */ Fn = rfn_to_fn(Fn); @@ -590,7 +591,7 @@ plen = Encoding::write_immediate_assignment_reject( immediate_assignment, ra, Fn, burst_type); - immediate_assignment_reject(); + immediate_assignment_reject(bts_data()->ctrs); } else { LOGP(DRLCMAC, LOGL_DEBUG, @@ -605,7 +606,7 @@ } if (plen >= 0) { - immediate_assignment_ul_tbf(); + immediate_assignment_ul_tbf(bts_data()->ctrs); pcu_l1if_tx_agch(immediate_assignment, plen); } @@ -699,7 +700,7 @@ tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); if (plen >= 0) { - immediate_assignment_dl_tbf(); + immediate_assignment_dl_tbf(bts_data()->ctrs); pcu_l1if_tx_pch(immediate_assignment, plen, imsi); } @@ -1026,7 +1027,7 @@ static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) { - bts->channel_request_description(); + channel_request_description(bts->bts_data()->ctrs); /* This call will register the new TBF with the MS on success */ gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), @@ -1356,7 +1357,7 @@ else bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - bts()->rlc_rcvd_control(); + rlc_rcvd_control(bts_data()->ctrs); switch (ul_control_block->u.MESSAGE_TYPE) { case MT_PACKET_CONTROL_ACK: rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); @@ -1377,7 +1378,7 @@ /* ignoring it. change the SI to not force sending these? */ break; default: - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMAC, LOGL_NOTICE, "RX: [PCU <- BTS] unknown control block(%d) received\n", ul_control_block->u.MESSAGE_TYPE); @@ -1393,13 +1394,13 @@ { GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); if (!cs) { - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" "length: %d)\n", len); return -EINVAL; } - bts()->rlc_ul_bytes(len); + rlc_ul_bytes(bts_data()->ctrs, len); LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); @@ -1410,7 +1411,7 @@ if (cs.isEgprs()) return rcv_data_block(data, len, fn, meas, cs); - bts()->decode_error(); + decode_error(bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", cs.name()); return -EINVAL; @@ -1447,7 +1448,7 @@ LOGP(DRLCMACUL, LOGL_ERROR, "Got %s RLC block but header parsing has failed\n", cs.name()); - bts()->decode_error(); + decode_error(bts_data()->ctrs); return rc; } diff --git a/src/bts.h b/src/bts.h index 19d948a..128463e 100644 --- a/src/bts.h +++ b/src/bts.h @@ -253,94 +253,6 @@ struct BTS { public: enum { - CTR_TBF_DL_ALLOCATED, - CTR_TBF_DL_FREED, - CTR_TBF_DL_ABORTED, - CTR_TBF_UL_ALLOCATED, - CTR_TBF_UL_FREED, - CTR_TBF_UL_ABORTED, - CTR_TBF_REUSED, - CTR_TBF_ALLOC_ALGO_A, - CTR_TBF_ALLOC_ALGO_B, - CTR_TBF_FAILED_EGPRS_ONLY, - CTR_RLC_SENT, - CTR_RLC_RESENT, - CTR_RLC_RESTARTED, - CTR_RLC_STALLED, - CTR_RLC_NACKED, - CTR_RLC_FINAL_BLOCK_RESENT, - CTR_RLC_ASS_TIMEDOUT, - CTR_RLC_ASS_FAILED, - CTR_RLC_ACK_TIMEDOUT, - CTR_RLC_ACK_FAILED, - CTR_RLC_REL_TIMEDOUT, - CTR_RLC_LATE_BLOCK, - CTR_RLC_SENT_DUMMY, - CTR_RLC_SENT_CONTROL, - CTR_RLC_DL_BYTES, - CTR_RLC_DL_PAYLOAD_BYTES, - CTR_RLC_UL_BYTES, - CTR_RLC_UL_PAYLOAD_BYTES, - CTR_DECODE_ERRORS, - CTR_SBA_ALLOCATED, - CTR_SBA_FREED, - CTR_SBA_TIMEDOUT, - CTR_LLC_FRAME_TIMEDOUT, - CTR_LLC_FRAME_DROPPED, - CTR_LLC_FRAME_SCHED, - CTR_LLC_DL_BYTES, - CTR_LLC_UL_BYTES, - CTR_RACH_REQUESTS, - CTR_11BIT_RACH_REQUESTS, - CTR_SPB_UL_FIRST_SEGMENT, - CTR_SPB_UL_SECOND_SEGMENT, - CTR_SPB_DL_FIRST_SEGMENT, - CTR_SPB_DL_SECOND_SEGMENT, - CTR_IMMEDIATE_ASSIGN_UL_TBF, - CTR_IMMEDIATE_ASSIGN_REJ, - CTR_IMMEDIATE_ASSIGN_DL_TBF, - CTR_CHANNEL_REQUEST_DESCRIPTION, - CTR_PKT_UL_ASSIGNMENT, - CTR_PKT_ACCESS_REJ, - CTR_PKT_DL_ASSIGNMENT, - CTR_RLC_RECV_CONTROL, - CTR_PUA_POLL_TIMEDOUT, - CTR_PUA_POLL_FAILED, - CTR_PDA_POLL_TIMEDOUT, - CTR_PDA_POLL_FAILED, - CTR_PUAN_POLL_TIMEDOUT, - CTR_PUAN_POLL_FAILED, - CTR_PDAN_POLL_TIMEDOUT, - CTR_PDAN_POLL_FAILED, - CTR_GPRS_DL_CS1, - CTR_GPRS_DL_CS2, - CTR_GPRS_DL_CS3, - CTR_GPRS_DL_CS4, - CTR_EGPRS_DL_MCS1, - CTR_EGPRS_DL_MCS2, - CTR_EGPRS_DL_MCS3, - CTR_EGPRS_DL_MCS4, - CTR_EGPRS_DL_MCS5, - CTR_EGPRS_DL_MCS6, - CTR_EGPRS_DL_MCS7, - CTR_EGPRS_DL_MCS8, - CTR_EGPRS_DL_MCS9, - CTR_GPRS_UL_CS1, - CTR_GPRS_UL_CS2, - CTR_GPRS_UL_CS3, - CTR_GPRS_UL_CS4, - CTR_EGPRS_UL_MCS1, - CTR_EGPRS_UL_MCS2, - CTR_EGPRS_UL_MCS3, - CTR_EGPRS_UL_MCS4, - CTR_EGPRS_UL_MCS5, - CTR_EGPRS_UL_MCS6, - CTR_EGPRS_UL_MCS7, - CTR_EGPRS_UL_MCS8, - CTR_EGPRS_UL_MCS9, - }; - - enum { STAT_MS_PRESENT, }; @@ -389,95 +301,6 @@ void send_gsmtap(enum pcu_gsmtap_category categ, bool uplink, uint8_t trx_no, uint8_t ts_no, uint8_t channel, uint32_t fn, const uint8_t *data, unsigned int len); - - /* - * Statistics - */ - void tbf_dl_created(); - void tbf_dl_freed(); - void tbf_dl_aborted(); - void tbf_ul_created(); - void tbf_ul_freed(); - void tbf_ul_aborted(); - void tbf_reused(); - void tbf_alloc_algo_a(); - void tbf_alloc_algo_b(); - void tbf_failed_egprs_only(); - void rlc_sent(); - void rlc_resent(); - void rlc_restarted(); - void rlc_stalled(); - void rlc_nacked(); - void rlc_final_block_resent(); - void rlc_ass_timedout(); - void rlc_ass_failed(); - void rlc_ack_timedout(); - void rlc_ack_failed(); - void rlc_rel_timedout(); - void rlc_late_block(); - void rlc_sent_dummy(); - void rlc_sent_control(); - void rlc_dl_bytes(int bytes); - void rlc_dl_payload_bytes(int bytes); - void rlc_ul_bytes(int bytes); - void rlc_ul_payload_bytes(int bytes); - void decode_error(); - void sba_allocated(); - void sba_freed(); - void sba_timedout(); - void llc_timedout_frame(); - void llc_dropped_frame(); - void llc_frame_sched(); - void llc_dl_bytes(int bytes); - void llc_ul_bytes(int bytes); - void rach_frame(); - void rach_frame_11bit(); - void spb_uplink_first_segment(); - void spb_uplink_second_segment(); - void spb_downlink_first_segment(); - void spb_downlink_second_segment(); - void immediate_assignment_ul_tbf(); - void immediate_assignment_reject(); - void immediate_assignment_dl_tbf(); - void channel_request_description(); - void pkt_ul_assignment(); - void pkt_access_reject(); - void pkt_dl_assignemnt(); - void rlc_rcvd_control(); - void pua_poll_timedout(); - void pua_poll_failed(); - void pda_poll_timedout(); - void pda_poll_failed(); - void pkt_ul_ack_nack_poll_timedout(); - void pkt_ul_ack_nack_poll_failed(); - void pkt_dl_ack_nack_poll_timedout(); - void pkt_dl_ack_nack_poll_failed(); - void gprs_dl_cs1(); - void gprs_dl_cs2(); - void gprs_dl_cs3(); - void gprs_dl_cs4(); - void egprs_dl_mcs1(); - void egprs_dl_mcs2(); - void egprs_dl_mcs3(); - void egprs_dl_mcs4(); - void egprs_dl_mcs5(); - void egprs_dl_mcs6(); - void egprs_dl_mcs7(); - void egprs_dl_mcs8(); - void egprs_dl_mcs9(); - void gprs_ul_cs1(); - void gprs_ul_cs2(); - void gprs_ul_cs3(); - void gprs_ul_cs4(); - void egprs_ul_mcs1(); - void egprs_ul_mcs2(); - void egprs_ul_mcs3(); - void egprs_ul_mcs4(); - void egprs_ul_mcs5(); - void egprs_ul_mcs6(); - void egprs_ul_mcs7(); - void egprs_ul_mcs8(); - void egprs_ul_mcs9(); void ms_present(int32_t n); int32_t ms_present_get(); @@ -575,106 +398,6 @@ { return m_statg; } - -#define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ - inline void BTS::func_name(int inc) {\ - OSMO_ASSERT(m_bts.ctrs); \ - rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ - } - -#define CREATE_COUNT_INLINE(func_name, ctr_name) \ - inline void BTS::func_name() {\ - OSMO_ASSERT(m_bts.ctrs); \ - rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ - } - -CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) -CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) -CREATE_COUNT_INLINE(tbf_dl_aborted, CTR_TBF_DL_ABORTED) -CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) -CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) -CREATE_COUNT_INLINE(tbf_ul_aborted, CTR_TBF_UL_ABORTED) -CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) -CREATE_COUNT_INLINE(tbf_alloc_algo_a, CTR_TBF_ALLOC_ALGO_A) -CREATE_COUNT_INLINE(tbf_alloc_algo_b, CTR_TBF_ALLOC_ALGO_B) -CREATE_COUNT_INLINE(tbf_failed_egprs_only, CTR_TBF_FAILED_EGPRS_ONLY) -CREATE_COUNT_INLINE(rlc_sent, CTR_RLC_SENT) -CREATE_COUNT_INLINE(rlc_resent, CTR_RLC_RESENT) -CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) -CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) -CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) -CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); -CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); -CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_ack_failed, CTR_RLC_ACK_FAILED); -CREATE_COUNT_INLINE(rlc_rel_timedout, CTR_RLC_REL_TIMEDOUT); -CREATE_COUNT_INLINE(rlc_late_block, CTR_RLC_LATE_BLOCK); -CREATE_COUNT_INLINE(rlc_sent_dummy, CTR_RLC_SENT_DUMMY); -CREATE_COUNT_INLINE(rlc_sent_control, CTR_RLC_SENT_CONTROL); -CREATE_COUNT_ADD_INLINE(rlc_dl_bytes, CTR_RLC_DL_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_dl_payload_bytes, CTR_RLC_DL_PAYLOAD_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_ul_bytes, CTR_RLC_UL_BYTES); -CREATE_COUNT_ADD_INLINE(rlc_ul_payload_bytes, CTR_RLC_UL_PAYLOAD_BYTES); -CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) -CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) -CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) -CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) -CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); -CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); -CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); -CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); -CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); -CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); -CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); -CREATE_COUNT_INLINE(spb_uplink_first_segment, CTR_SPB_UL_FIRST_SEGMENT); -CREATE_COUNT_INLINE(spb_uplink_second_segment, CTR_SPB_UL_SECOND_SEGMENT); -CREATE_COUNT_INLINE(spb_downlink_first_segment, CTR_SPB_DL_FIRST_SEGMENT); -CREATE_COUNT_INLINE(spb_downlink_second_segment, CTR_SPB_DL_SECOND_SEGMENT); -CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); -CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); -CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); -CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); -CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); -CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); -CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); -CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); -CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); -CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); -CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); -CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); -CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); -CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); -CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); -CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); -CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); -CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); -CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); -CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); -CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); -CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); -CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); -CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); -CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); -CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); -CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); -CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); -CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); -CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); -CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); -CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); -CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); -CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); -CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); -CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); -CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); -CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); -CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); - -#undef CREATE_COUNT_INLINE #define CREATE_STAT_INLINE(func_name, func_name_get, stat_name) \ inline void BTS::func_name(int32_t val) {\ diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 2350808..e80193f 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,6 +25,10 @@ #include "pcu_utils.h" +extern "C" { +#include "pcu_ctr.h" +} + static uint32_t sched_poll(BTS *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, struct gprs_rlcmac_tbf **poll_tbf, @@ -311,23 +315,25 @@ static inline void tap_n_acc(const struct msgb *msg, const struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, uint32_t fn, enum pcu_gsmtap_category cat) { + struct rate_ctr_group *ctrs = bts->bts->bts_data()->ctrs; + if (!msg) return; switch(cat) { case PCU_GSMTAP_C_DL_CTRL: - bts->bts->rlc_sent_control(); + rlc_sent_control(ctrs); bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DATA_GPRS: - bts->bts->rlc_sent(); + rlc_sent(ctrs); /* FIXME: distinguish between GPRS and EGPRS */ bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DUMMY: - bts->bts->rlc_sent_dummy(); + rlc_sent_dummy(ctrs); bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); break; @@ -403,7 +409,7 @@ if (!msg) return -ENOMEM; /* msg is now available */ - bts->bts->rlc_dl_bytes(msg->data_len); + rlc_dl_bytes(bts->bts->bts_data()->ctrs, msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 2b08cf6..e657f3a 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -29,6 +29,10 @@ #include #include +extern "C" { +#include "pcu_ctr.h" +} + /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 @@ -485,7 +489,7 @@ ms_->set_reserved_slots(trx, 1 << ts, 1 << ts); tbf_->upgrade_to_multislot = 0; - bts->bts->tbf_alloc_algo_a(); + tbf_alloc_algo_a(bts->bts->bts_data()->ctrs); return 0; } @@ -1021,7 +1025,7 @@ } } - bts->bts->tbf_alloc_algo_b(); + tbf_alloc_algo_b(bts->bts->bts_data()->ctrs); return 0; } diff --git a/src/llc.cpp b/src/llc.cpp index 79afc37..182fdfc 100644 --- a/src/llc.cpp +++ b/src/llc.cpp @@ -25,6 +25,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include } @@ -126,7 +127,7 @@ while ((msg = msgb_dequeue(&m_queue))) { if (bts) - bts->llc_dropped_frame(); + llc_dropped_frame(bts->bts_data()->ctrs); msgb_free(msg); } diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h index 8cfada4..0baa543 100644 --- a/src/pcu_ctr.h +++ b/src/pcu_ctr.h @@ -29,6 +29,94 @@ #include #include +enum { + CTR_TBF_DL_ALLOCATED, + CTR_TBF_DL_FREED, + CTR_TBF_DL_ABORTED, + CTR_TBF_UL_ALLOCATED, + CTR_TBF_UL_FREED, + CTR_TBF_UL_ABORTED, + CTR_TBF_REUSED, + CTR_TBF_ALLOC_ALGO_A, + CTR_TBF_ALLOC_ALGO_B, + CTR_TBF_FAILED_EGPRS_ONLY, + CTR_RLC_SENT, + CTR_RLC_RESENT, + CTR_RLC_RESTARTED, + CTR_RLC_STALLED, + CTR_RLC_NACKED, + CTR_RLC_FINAL_BLOCK_RESENT, + CTR_RLC_ASS_TIMEDOUT, + CTR_RLC_ASS_FAILED, + CTR_RLC_ACK_TIMEDOUT, + CTR_RLC_ACK_FAILED, + CTR_RLC_REL_TIMEDOUT, + CTR_RLC_LATE_BLOCK, + CTR_RLC_SENT_DUMMY, + CTR_RLC_SENT_CONTROL, + CTR_RLC_DL_BYTES, + CTR_RLC_DL_PAYLOAD_BYTES, + CTR_RLC_UL_BYTES, + CTR_RLC_UL_PAYLOAD_BYTES, + CTR_DECODE_ERRORS, + CTR_SBA_ALLOCATED, + CTR_SBA_FREED, + CTR_SBA_TIMEDOUT, + CTR_LLC_FRAME_TIMEDOUT, + CTR_LLC_FRAME_DROPPED, + CTR_LLC_FRAME_SCHED, + CTR_LLC_DL_BYTES, + CTR_LLC_UL_BYTES, + CTR_RACH_REQUESTS, + CTR_11BIT_RACH_REQUESTS, + CTR_SPB_UL_FIRST_SEGMENT, + CTR_SPB_UL_SECOND_SEGMENT, + CTR_SPB_DL_FIRST_SEGMENT, + CTR_SPB_DL_SECOND_SEGMENT, + CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_REJ, + CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_CHANNEL_REQUEST_DESCRIPTION, + CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_ACCESS_REJ, + CTR_PKT_DL_ASSIGNMENT, + CTR_RLC_RECV_CONTROL, + CTR_PUA_POLL_TIMEDOUT, + CTR_PUA_POLL_FAILED, + CTR_PDA_POLL_TIMEDOUT, + CTR_PDA_POLL_FAILED, + CTR_PUAN_POLL_TIMEDOUT, + CTR_PUAN_POLL_FAILED, + CTR_PDAN_POLL_TIMEDOUT, + CTR_PDAN_POLL_FAILED, + CTR_GPRS_DL_CS1, + CTR_GPRS_DL_CS2, + CTR_GPRS_DL_CS3, + CTR_GPRS_DL_CS4, + CTR_EGPRS_DL_MCS1, + CTR_EGPRS_DL_MCS2, + CTR_EGPRS_DL_MCS3, + CTR_EGPRS_DL_MCS4, + CTR_EGPRS_DL_MCS5, + CTR_EGPRS_DL_MCS6, + CTR_EGPRS_DL_MCS7, + CTR_EGPRS_DL_MCS8, + CTR_EGPRS_DL_MCS9, + CTR_GPRS_UL_CS1, + CTR_GPRS_UL_CS2, + CTR_GPRS_UL_CS3, + CTR_GPRS_UL_CS4, + CTR_EGPRS_UL_MCS1, + CTR_EGPRS_UL_MCS2, + CTR_EGPRS_UL_MCS3, + CTR_EGPRS_UL_MCS4, + CTR_EGPRS_UL_MCS5, + CTR_EGPRS_UL_MCS6, + CTR_EGPRS_UL_MCS7, + CTR_EGPRS_UL_MCS8, + CTR_EGPRS_UL_MCS9, +}; + static const struct rate_ctr_desc bts_ctr_description[] = { { "tbf.dl.alloc", "TBF DL Allocated "}, { "tbf.dl.freed", "TBF DL Freed "}, @@ -118,3 +206,101 @@ }; struct rate_ctr_group *pcu_ctr_init(); + +#define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ + inline void func_name(struct rate_ctr_group *ctrs, int inc) { \ + OSMO_ASSERT(ctrs); \ + rate_ctr_add(&ctrs->ctr[ctr_name], inc); \ + } + +#define CREATE_COUNT_INLINE(func_name, ctr_name) \ + static inline void func_name(struct rate_ctr_group *ctrs) {\ + OSMO_ASSERT(ctrs); \ + rate_ctr_inc(&ctrs->ctr[ctr_name]); \ + } + +CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) +CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) +CREATE_COUNT_INLINE(tbf_dl_aborted, CTR_TBF_DL_ABORTED) +CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) +CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) +CREATE_COUNT_INLINE(tbf_ul_aborted, CTR_TBF_UL_ABORTED) +CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) +CREATE_COUNT_INLINE(tbf_alloc_algo_a, CTR_TBF_ALLOC_ALGO_A) +CREATE_COUNT_INLINE(tbf_alloc_algo_b, CTR_TBF_ALLOC_ALGO_B) +CREATE_COUNT_INLINE(tbf_failed_egprs_only, CTR_TBF_FAILED_EGPRS_ONLY) +CREATE_COUNT_INLINE(rlc_sent, CTR_RLC_SENT) +CREATE_COUNT_INLINE(rlc_resent, CTR_RLC_RESENT) +CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) +CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) +CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) +CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); +CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); +CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_ack_failed, CTR_RLC_ACK_FAILED); +CREATE_COUNT_INLINE(rlc_rel_timedout, CTR_RLC_REL_TIMEDOUT); +CREATE_COUNT_INLINE(rlc_late_block, CTR_RLC_LATE_BLOCK); +CREATE_COUNT_INLINE(rlc_sent_dummy, CTR_RLC_SENT_DUMMY); +CREATE_COUNT_INLINE(rlc_sent_control, CTR_RLC_SENT_CONTROL); +CREATE_COUNT_ADD_INLINE(rlc_dl_bytes, CTR_RLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_dl_payload_bytes, CTR_RLC_DL_PAYLOAD_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_bytes, CTR_RLC_UL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_payload_bytes, CTR_RLC_UL_PAYLOAD_BYTES); +CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) +CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) +CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) +CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) +CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); +CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); +CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); +CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); +CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); +CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); +CREATE_COUNT_INLINE(spb_uplink_first_segment, CTR_SPB_UL_FIRST_SEGMENT); +CREATE_COUNT_INLINE(spb_uplink_second_segment, CTR_SPB_UL_SECOND_SEGMENT); +CREATE_COUNT_INLINE(spb_downlink_first_segment, CTR_SPB_DL_FIRST_SEGMENT); +CREATE_COUNT_INLINE(spb_downlink_second_segment, CTR_SPB_DL_SECOND_SEGMENT); +CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); +CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); +CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); +CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); +CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); +CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); +CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); +CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); +CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); +CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); +CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); +CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); +CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); +CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); +CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); +CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); +CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); +CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); +CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); +CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); +CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); +CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); +CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); +CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); +CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); +CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); +CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); +CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); +CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); +CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); +CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); +CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); +CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); diff --git a/src/rlc.cpp b/src/rlc.cpp index acd4169..560bbbf 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -23,6 +23,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include } @@ -154,7 +155,7 @@ } else { LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); - bts->rlc_nacked(); + rlc_nacked(bts->bts_data()->ctrs); *lost += 1; } } @@ -178,7 +179,7 @@ } else { LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); - bts->rlc_nacked(); + rlc_nacked(bts->bts_data()->ctrs); *lost += 1; } } diff --git a/src/sba.cpp b/src/sba.cpp index 56a7543..450cdc6 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -26,6 +26,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include #include } @@ -84,7 +85,7 @@ sba->ta = ta; llist_add(&sba->list, &m_sbas); - m_bts.sba_allocated(); + sba_allocated(m_bts.bts_data()->ctrs); *_trx = trx; *_ts = ts; @@ -130,14 +131,14 @@ LOGP(DRLCMAC, LOGL_NOTICE, "Poll timeout for SBA (TRX=%u, TS=%u, FN=%u, TA=%u)\n", sba->trx_no, sba->ts_no, sba->fn, sba->ta); - m_bts.sba_timedout(); + sba_timedout(m_bts.bts_data()->ctrs); free_sba(sba); return 0; } void SBAController::free_sba(gprs_rlcmac_sba *sba) { - m_bts.sba_freed(); + sba_freed(m_bts.bts_data()->ctrs); llist_del(&sba->list); talloc_free(sba); } diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..1dd190f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -31,6 +31,7 @@ #include extern "C" { +#include "pcu_ctr.h" #include #include #include @@ -421,9 +422,9 @@ /* update counters */ if (tbf->direction == GPRS_RLCMAC_UL_TBF) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf); - tbf->bts->tbf_ul_freed(); + tbf_ul_freed(tbf->bts->bts_data()->ctrs); if (tbf->state_is(GPRS_RLCMAC_FLOW)) - tbf->bts->tbf_ul_aborted(); + tbf_ul_aborted(tbf->bts->bts_data()->ctrs); rate_ctr_group_free(ul_tbf->m_ul_egprs_ctrs); rate_ctr_group_free(ul_tbf->m_ul_gprs_ctrs); } else { @@ -433,9 +434,9 @@ } else { rate_ctr_group_free(dl_tbf->m_dl_gprs_ctrs); } - tbf->bts->tbf_dl_freed(); + tbf_dl_freed(tbf->bts->bts_data()->ctrs); if (tbf->state_is(GPRS_RLCMAC_FLOW)) - tbf->bts->tbf_dl_aborted(); + tbf_dl_aborted(tbf->bts->bts_data()->ctrs); } /* Give final measurement report */ @@ -653,14 +654,14 @@ LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling PACKET CONTROL ACK for PACKET UPLINK ACK\n"); rlcmac_diag(); } - bts->rlc_ack_timedout(); - bts->pkt_ul_ack_nack_poll_timedout(); + rlc_ack_timedout(bts->bts_data()->ctrs); + pkt_ul_ack_nack_poll_timedout(bts->bts_data()->ctrs); if (state_is(GPRS_RLCMAC_FINISHED)) { ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); - bts->pkt_ul_ack_nack_poll_failed(); + pkt_ul_ack_nack_poll_failed(bts->bts_data()->ctrs); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); return; @@ -679,14 +680,14 @@ } ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; - bts->rlc_ass_timedout(); - bts->pua_poll_timedout(); + rlc_ass_timedout(bts->bts_data()->ctrs); + pua_poll_timedout(bts->bts_data()->ctrs); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); - bts->rlc_ass_failed(); - bts->pua_poll_failed(); + rlc_ass_failed(bts->bts_data()->ctrs); + pua_poll_failed(bts->bts_data()->ctrs); return; } /* reschedule UL assignment */ @@ -701,14 +702,14 @@ } dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; - bts->rlc_ass_timedout(); - bts->pda_poll_timedout(); + rlc_ass_timedout(bts->bts_data()->ctrs); + pda_poll_timedout(bts->bts_data()->ctrs); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); - bts->rlc_ass_failed(); - bts->pda_poll_failed(); + rlc_ass_failed(bts->bts_data()->ctrs); + pda_poll_failed(bts->bts_data()->ctrs); return; } /* reschedule DL assignment */ @@ -724,17 +725,17 @@ } dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) - bts->rlc_rel_timedout(); + rlc_rel_timedout(bts->bts_data()->ctrs); else { - bts->rlc_ack_timedout(); - bts->pkt_dl_ack_nack_poll_timedout(); + rlc_ack_timedout(bts->bts_data()->ctrs); + pkt_dl_ack_nack_poll_timedout(bts->bts_data()->ctrs); } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(dl_tbf, 3195, dl_tbf->bts_data()->t3195, 0); - bts->pkt_dl_ack_nack_poll_failed(); - bts->rlc_ack_failed(); + pkt_dl_ack_nack_poll_failed(bts->bts_data()->ctrs); + rlc_ack_failed(bts->bts_data()->ctrs); return; } /* resend IMM.ASS on CCCH on timeout */ @@ -840,7 +841,7 @@ if (egprs_ms_class == 0 && bts->egprs_enabled) { LOGP(DRLCMAC, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n"); - bts->bts->tbf_failed_egprs_only(); + tbf_failed_egprs_only(bts->bts->bts_data()->ctrs); return NULL; } @@ -887,7 +888,7 @@ } llist_add(&tbf->list(), &bts->bts->ul_tbfs()); - tbf->bts->tbf_ul_created(); + tbf_ul_created(tbf->bts->bts_data()->ctrs); return tbf; } @@ -932,7 +933,7 @@ if (ms_class > 0) { LOGP(DRLCMAC, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n"); - bts->bts->tbf_failed_egprs_only(); + tbf_failed_egprs_only(bts->bts->bts_data()->ctrs); return NULL; } egprs_ms_class = 1; @@ -986,7 +987,7 @@ } llist_add(&tbf->list(), &bts->bts->dl_tbfs()); - tbf->bts->tbf_dl_created(); + tbf_dl_created(tbf->bts->bts_data()->ctrs); tbf->m_last_dl_poll_fn = -1; tbf->m_last_dl_drained_fn = -1; @@ -1180,7 +1181,7 @@ encode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); - bts->pkt_dl_assignemnt(); + pkt_dl_assignemnt(bts->bts_data()->ctrs); bitvec_pack(ass_vec, msgb_put(msg, 23)); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1213,7 +1214,7 @@ Encoding::write_packet_access_reject( packet_access_rej, tlli()); - bts->pkt_access_reject(); + pkt_access_reject(bts->bts_data()->ctrs); bitvec_pack(packet_access_rej, msgb_put(msg, 23)); @@ -1279,7 +1280,7 @@ decode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); - bts->pkt_ul_assignment(); + pkt_ul_assignment(bts->bts_data()->ctrs); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1312,7 +1313,7 @@ { struct gprs_rlcmac_dl_tbf *new_tbf = NULL; - bts->tbf_reused(); + tbf_reused(bts->bts_data()->ctrs); new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), @@ -1468,7 +1469,7 @@ ms->set_tlli(tlli); llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); - ul_tbf->bts->tbf_ul_created(); + tbf_ul_created(ul_tbf->bts->bts_data()->ctrs); ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 3d27883..deeb89e 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -32,6 +32,7 @@ #include "pcu_utils.h" extern "C" { +#include "pcu_ctr.h" #include #include #include @@ -295,12 +296,12 @@ break; } - bts->llc_timedout_frame(); + llc_timedout_frame(bts->bts_data()->ctrs); drop_frame: frames++; octets += msg->len; msgb_free(msg); - bts->llc_dropped_frame(); + llc_dropped_frame(bts->bts_data()->ctrs); continue; } @@ -407,19 +408,19 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Resending BSN %d\n", bsn); /* re-send block with negative aknowlegement */ m_window.m_v_b.mark_unacked(bsn); - bts->rlc_resent(); + rlc_resent(bts->bts_data()->ctrs); } else if (state_is(GPRS_RLCMAC_FINISHED)) { LOGP(DRLCMACDL, LOGL_DEBUG, "- Restarting at BSN %d, " "because all blocks have been transmitted.\n", m_window.v_a()); - bts->rlc_restarted(); + rlc_restarted(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else if (dl_window_stalled()) { LOGP(DRLCMACDL, LOGL_NOTICE, "- Restarting at BSN %d, " "because the window is stalled.\n", m_window.v_a()); - bts->rlc_stalled(); + rlc_stalled(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else if (have_data()) { @@ -435,7 +436,7 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Restarting at BSN %d, " "because all blocks have been transmitted (FLOW).\n", m_window.v_a()); - bts->rlc_restarted(); + rlc_restarted(bts->bts_data()->ctrs); if (restart_bsn_cycle()) return take_next_bsn(fn, previous_bsn, may_combine); } else { @@ -452,8 +453,8 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Nothing else to send, Re-transmit final block!\n"); bsn = m_window.v_s_mod(-1); - bts->rlc_final_block_resent(); - bts->rlc_resent(); + rlc_final_block_resent(bts->bts_data()->ctrs); + rlc_resent(bts->bts_data()->ctrs); } *may_combine = m_rlc.block(bsn)->cs_current_trans.numDataBlocks() > 1; @@ -535,7 +536,7 @@ tbf_name(this), msg->len); m_llc.put_frame(msg->data, msg->len); - bts->llc_frame_sched(); + llc_frame_sched(bts->bts_data()->ctrs); msgb_free(msg); m_last_dl_drained_fn = -1; } @@ -611,7 +612,7 @@ &m_llc, &write_offset, &num_chunks, data, is_final, &payload_written); if (payload_written > 0) - bts->rlc_dl_payload_bytes(payload_written); + rlc_dl_payload_bytes(bts->bts_data()->ctrs, payload_written); if (ar == Encoding::AR_NEED_MORE_BLOCKS) break; @@ -619,7 +620,7 @@ LOGP(DRLCMACDL, LOGL_INFO, "Complete DL frame for %s" "len=%d\n", tbf_name(this), m_llc.frame_length()); gprs_rlcmac_dl_bw(this, m_llc.frame_length()); - bts->llc_dl_bytes(m_llc.frame_length()); + llc_dl_bytes(bts->bts_data()->ctrs, m_llc.frame_length()); m_llc.reset(); if (is_final) { @@ -1359,19 +1360,19 @@ if (block_status_dl == EGPRS_RESEG_FIRST_SEG_SENT) { /* statistics */ - bts->spb_downlink_second_segment(); + spb_downlink_second_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_SEC_SEG; } else if ((cs_init.headerTypeData() == GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1) || (cs_init.headerTypeData() == GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2)) { - bts->spb_downlink_first_segment(); + spb_downlink_first_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_FIRST_SEG; } else if ((GprsCodingScheme::Scheme(cs_init) == GprsCodingScheme::MCS4) && (GprsCodingScheme::Scheme(cs_current_trans) == GprsCodingScheme::MCS1)) { - bts->spb_downlink_first_segment(); + spb_downlink_first_segment(bts->bts_data()->ctrs); return EGPRS_RLCMAC_DL_FIRST_SEG; } } @@ -1407,58 +1408,58 @@ if (cs.isGprs()) { switch (coding_scheme) { case GprsCodingScheme::CS1 : - bts->gprs_dl_cs1(); + gprs_dl_cs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS1]); break; case GprsCodingScheme::CS2 : - bts->gprs_dl_cs2(); + gprs_dl_cs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS2]); break; case GprsCodingScheme::CS3 : - bts->gprs_dl_cs3(); + gprs_dl_cs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS3]); break; case GprsCodingScheme::CS4 : - bts->gprs_dl_cs4(); + gprs_dl_cs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS4]); break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : - bts->egprs_dl_mcs1(); + egprs_dl_mcs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS1]); break; case GprsCodingScheme::MCS2 : - bts->egprs_dl_mcs2(); + egprs_dl_mcs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS2]); break; case GprsCodingScheme::MCS3 : - bts->egprs_dl_mcs3(); + egprs_dl_mcs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS3]); break; case GprsCodingScheme::MCS4 : - bts->egprs_dl_mcs4(); + egprs_dl_mcs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS4]); break; case GprsCodingScheme::MCS5 : - bts->egprs_dl_mcs5(); + egprs_dl_mcs5(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS5]); break; case GprsCodingScheme::MCS6 : - bts->egprs_dl_mcs6(); + egprs_dl_mcs6(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS6]); break; case GprsCodingScheme::MCS7 : - bts->egprs_dl_mcs7(); + egprs_dl_mcs7(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS7]); break; case GprsCodingScheme::MCS8 : - bts->egprs_dl_mcs8(); + egprs_dl_mcs8(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS8]); break; case GprsCodingScheme::MCS9 : - bts->egprs_dl_mcs9(); + egprs_dl_mcs9(bts->bts_data()->ctrs); rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS9]); break; } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 81d3b24..1f8f0f6 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -32,6 +32,7 @@ #include "pcu_utils.h" extern "C" { +#include "pcu_ctr.h" #include #include } @@ -70,7 +71,7 @@ frame = frames + i; if (frame->length) { - bts->rlc_ul_payload_bytes(frame->length); + rlc_ul_payload_bytes(bts->bts_data()->ctrs, frame->length); LOGP(DRLCMACUL, LOGL_DEBUG, "-- Frame %d " "starts at offset %d, " @@ -87,7 +88,7 @@ LOGP(DRLCMACUL, LOGL_INFO, "%s complete UL frame len=%d\n", tbf_name(this) , m_llc.frame_length()); snd_ul_ud(); - bts->llc_ul_bytes(m_llc.frame_length()); + llc_ul_bytes(bts->bts_data()->ctrs, m_llc.frame_length()); m_llc.reset(); } } @@ -277,7 +278,7 @@ rdbi, rlc->cs, rlc_data, NULL, 0, &new_tlli); if (num_chunks < 0) { - bts->decode_error(); + decode_error(bts->bts_data()->ctrs); LOGP(DRLCMACUL, LOGL_NOTICE, "Failed to decode TLLI of %s UL DATA " "TFI=%d.\n", rlc->cs.name(), rlc->tfi); @@ -419,7 +420,7 @@ union split_block_status *spb_status = &block->spb_status; uint8_t *rlc_data = &block->block[0]; - bts->spb_uplink_second_segment(); + spb_uplink_second_segment(bts->bts_data()->ctrs); if (spb_status->block_status_ul & EGPRS_RESEG_FIRST_SEG_RXD) { @@ -457,7 +458,7 @@ uint8_t *rlc_data = &block->block[0]; union split_block_status *spb_status = &block->spb_status; - bts->spb_uplink_first_segment(); + spb_uplink_first_segment(bts->bts_data()->ctrs); if (spb_status->block_status_ul & EGPRS_RESEG_SECOND_SEG_RXD) { LOGP(DRLCMACUL, LOGL_DEBUG, @@ -552,58 +553,58 @@ if (cs.isGprs()) { switch (coding_scheme) { case GprsCodingScheme::CS1 : - bts->gprs_ul_cs1(); + gprs_ul_cs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS1]); break; case GprsCodingScheme::CS2 : - bts->gprs_ul_cs2(); + gprs_ul_cs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS2]); break; case GprsCodingScheme::CS3 : - bts->gprs_ul_cs3(); + gprs_ul_cs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS3]); break; case GprsCodingScheme::CS4 : - bts->gprs_ul_cs4(); + gprs_ul_cs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS4]); break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : - bts->egprs_ul_mcs1(); + egprs_ul_mcs1(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS1]); break; case GprsCodingScheme::MCS2 : - bts->egprs_ul_mcs2(); + egprs_ul_mcs2(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS2]); break; case GprsCodingScheme::MCS3 : - bts->egprs_ul_mcs3(); + egprs_ul_mcs3(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS3]); break; case GprsCodingScheme::MCS4 : - bts->egprs_ul_mcs4(); + egprs_ul_mcs4(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS4]); break; case GprsCodingScheme::MCS5 : - bts->egprs_ul_mcs5(); + egprs_ul_mcs5(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS5]); break; case GprsCodingScheme::MCS6 : - bts->egprs_ul_mcs6(); + egprs_ul_mcs6(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS6]); break; case GprsCodingScheme::MCS7 : - bts->egprs_ul_mcs7(); + egprs_ul_mcs7(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS7]); break; case GprsCodingScheme::MCS8 : - bts->egprs_ul_mcs8(); + egprs_ul_mcs8(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS8]); break; case GprsCodingScheme::MCS9 : - bts->egprs_ul_mcs9(); + egprs_ul_mcs9(bts->bts_data()->ctrs); rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS9]); break; } -- To view, visit https://gerrit.osmocom.org/4413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 15:57:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 15:57:34 +0000 Subject: [PATCH] osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4411 to look at the new patch set (#7). Initialize logging before initializing rate_ctr The library code for rate counter initialization might already want to log something (particularly after Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Before the rate counters were initialized implicitly in BTS constructor which makes proper logging init impossible. Fix this by using explicit init similar to the way we do it for vty. Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 --- M src/Makefile.am M src/bts.cpp M src/bts.h A src/pcu_ctr.c A src/pcu_ctr.h M src/pcu_main.cpp M src/pcu_vty.c M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp M tests/types/TypesTest.cpp 10 files changed, 194 insertions(+), 122 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/11/4411/7 diff --git a/src/Makefile.am b/src/Makefile.am index 1543851..67291ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,7 @@ gprs_ms_storage.cpp \ gsm_timer.cpp \ pcu_l1_if.cpp \ + pcu_ctr.c \ pcu_vty.c \ pcu_vty_functions.cpp \ tbf.cpp \ @@ -79,6 +80,7 @@ gprs_ms_storage.h \ pcu_l1_if.h \ gsm_timer.h \ + pcu_ctr.h \ pcu_vty.h \ pcu_vty_functions.h \ tbf.h \ diff --git a/src/bts.cpp b/src/bts.cpp index b768569..0f7462a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -50,107 +50,6 @@ static BTS s_bts; -/** - * For gcc-4.4 compat do not use extended initializer list but keep the - * order from the enum here. Once we support GCC4.7 and up we can change - * the code below. - */ -static const struct rate_ctr_desc bts_ctr_description[] = { - { "tbf.dl.alloc", "TBF DL Allocated "}, - { "tbf.dl.freed", "TBF DL Freed "}, - { "tbf.dl.aborted", "TBF DL Aborted "}, - { "tbf.ul.alloc", "TBF UL Allocated "}, - { "tbf.ul.freed", "TBF UL Freed "}, - { "tbf.ul.aborted", "TBF UL Aborted "}, - { "tbf.reused", "TBF Reused "}, - { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, - { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, - { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, - { "rlc.sent", "RLC Sent "}, - { "rlc.resent", "RLC Resent "}, - { "rlc.restarted", "RLC Restarted "}, - { "rlc.stalled", "RLC Stalled "}, - { "rlc.nacked", "RLC Nacked "}, - { "rlc.final_block_resent", "RLC Final Blk resent "}, - { "rlc.ass.timedout", "RLC Assign Timeout "}, - { "rlc.ass.failed", "RLC Assign Failed "}, - { "rlc.ack.timedout", "RLC Ack Timeout "}, - { "rlc.ack.failed", "RLC Ack Failed "}, - { "rlc.rel.timedout", "RLC Release Timeout "}, - { "rlc.late-block", "RLC Late Block "}, - { "rlc.sent-dummy", "RLC Sent Dummy "}, - { "rlc.sent-control", "RLC Sent Control "}, - { "rlc.dl_bytes", "RLC DL Bytes "}, - { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, - { "rlc.ul_bytes", "RLC UL Bytes "}, - { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, - { "decode.errors", "Decode Errors "}, - { "sba.allocated", "SBA Allocated "}, - { "sba.freed", "SBA Freed "}, - { "sba.timedout", "SBA Timeout "}, - { "llc.timeout", "Timedout Frames "}, - { "llc.dropped", "Dropped Frames "}, - { "llc.scheduled", "Scheduled Frames "}, - { "llc.dl_bytes", "RLC encapsulated PDUs"}, - { "llc.ul_bytes", "full PDUs received "}, - { "rach.requests", "RACH requests "}, - { "11bit_rach.requests", "11BIT_RACH requests "}, - { "spb.uplink_first_segment", "First seg of UL SPB "}, - { "spb.uplink_second_segment", "Second seg of UL SPB "}, - { "spb.downlink_first_segment", "First seg of DL SPB "}, - { "spb.downlink_second_segment","Second seg of DL SPB "}, - { "immediate.assignment_UL", "Immediate Assign UL "}, - { "immediate.assignment_rej", "Immediate Assign Rej "}, - { "immediate.assignment_DL", "Immediate Assign DL "}, - { "channel.request_description","Channel Request Desc "}, - { "pkt.ul_assignment", "Packet UL Assignment "}, - { "pkt.access_reject", "Packet Access Reject "}, - { "pkt.dl_assignment", "Packet DL Assignment "}, - { "ul.control", "UL control Block "}, - { "ul.assignment_poll_timeout", "UL Assign Timeout "}, - { "ul.assignment_failed", "UL Assign Failed "}, - { "dl.assignment_timeout", "DL Assign Timeout "}, - { "dl.assignment_failed", "DL Assign Failed "}, - { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, - { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, - { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, - { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, - { "gprs.downlink_cs1", "CS1 downlink "}, - { "gprs.downlink_cs2", "CS2 downlink "}, - { "gprs.downlink_cs3", "CS3 downlink "}, - { "gprs.downlink_cs4", "CS4 downlink "}, - { "egprs.downlink_mcs1", "MCS1 downlink "}, - { "egprs.downlink_mcs2", "MCS2 downlink "}, - { "egprs.downlink_mcs3", "MCS3 downlink "}, - { "egprs.downlink_mcs4", "MCS4 downlink "}, - { "egprs.downlink_mcs5", "MCS5 downlink "}, - { "egprs.downlink_mcs6", "MCS6 downlink "}, - { "egprs.downlink_mcs7", "MCS7 downlink "}, - { "egprs.downlink_mcs8", "MCS8 downlink "}, - { "egprs.downlink_mcs9", "MCS9 downlink "}, - { "gprs.uplink_cs1", "CS1 Uplink "}, - { "gprs.uplink_cs2", "CS2 Uplink "}, - { "gprs.uplink_cs3", "CS3 Uplink "}, - { "gprs.uplink_cs4", "CS4 Uplink "}, - { "egprs.uplink_mcs1", "MCS1 Uplink "}, - { "egprs.uplink_mcs2", "MCS2 Uplink "}, - { "egprs.uplink_mcs3", "MCS3 Uplink "}, - { "egprs.uplink_mcs4", "MCS4 Uplink "}, - { "egprs.uplink_mcs5", "MCS5 Uplink "}, - { "egprs.uplink_mcs6", "MCS6 Uplink "}, - { "egprs.uplink_mcs7", "MCS7 Uplink "}, - { "egprs.uplink_mcs8", "MCS8 Uplink "}, - { "egprs.uplink_mcs9", "MCS9 Uplink "}, -}; - -static const struct rate_ctr_group_desc bts_ctrg_desc = { - "bts", - "BTS Statistics", - OSMO_STATS_CLASS_GLOBAL, - ARRAY_SIZE(bts_ctr_description), - bts_ctr_description, -}; - static const struct osmo_stat_item_desc bts_stat_item_description[] = { { "ms.present", "MS Present ", OSMO_STAT_ITEM_NO_UNIT, 4, 0}, @@ -179,11 +78,6 @@ return BTS::main_bts()->bts_data(); } -struct rate_ctr_group *bts_main_data_stats() -{ - return BTS::main_bts()->rate_counters(); -} - BTS::BTS() : m_cur_fn(0) , m_cur_blk_fn(-1) @@ -207,8 +101,6 @@ } } - m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); - OSMO_ASSERT(m_ratectrs); m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0); OSMO_ASSERT(m_statg); } @@ -219,7 +111,8 @@ * m_ms_store's destructor */ m_ms_store.cleanup(); - rate_ctr_group_free(m_ratectrs); + if (m_bts.ctrs) + rate_ctr_group_free(m_bts.ctrs); osmo_stat_item_group_free(m_statg); } diff --git a/src/bts.h b/src/bts.h index d65cd2f..607b4c1 100644 --- a/src/bts.h +++ b/src/bts.h @@ -231,6 +231,9 @@ /* State for dynamic algorithm selection */ int multislot_disabled; + /* Statistics */ + struct rate_ctr_group *ctrs; + /** * Point back to the C++ object. This is used during the transition * period. @@ -482,7 +485,6 @@ /* * Below for C interface for the VTY */ - struct rate_ctr_group *rate_counters() const; struct osmo_stat_item_group *stat_items() const; LListHead& ul_tbfs(); @@ -493,7 +495,6 @@ struct gprs_rlcmac_bts m_bts; PollController m_pollController; SBAController m_sba; - struct rate_ctr_group *m_ratectrs; struct osmo_stat_item_group *m_statg; GprsMsStorage m_ms_store; @@ -570,11 +571,6 @@ return m_assigned_tfi[dir]; } -inline struct rate_ctr_group *BTS::rate_counters() const -{ - return m_ratectrs; -} - inline struct osmo_stat_item_group *BTS::stat_items() const { return m_statg; @@ -582,12 +578,14 @@ #define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ inline void BTS::func_name(int inc) {\ - rate_ctr_add(&m_ratectrs->ctr[ctr_name], inc); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ } #define CREATE_COUNT_INLINE(func_name, ctr_name) \ inline void BTS::func_name() {\ - rate_ctr_inc(&m_ratectrs->ctr[ctr_name]); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ } CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) @@ -705,8 +703,6 @@ extern "C" { #endif struct gprs_rlcmac_bts *bts_main_data(); - struct rate_ctr_group *bts_main_data_stats(); - struct osmo_stat_item_group *bts_main_data_stat_items(); #ifdef __cplusplus } diff --git a/src/pcu_ctr.c b/src/pcu_ctr.c new file mode 100644 index 0000000..d3ed801 --- /dev/null +++ b/src/pcu_ctr.c @@ -0,0 +1,41 @@ +/* pcu_ctr.c + * + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "pcu_ctr.h" + +#include +#include +#include + +extern void *tall_pcu_ctx; + +struct rate_ctr_group *pcu_ctr_init() +{ + const struct rate_ctr_group_desc bts_ctrg_desc = { + "bts", + "BTS Statistics", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(bts_ctr_description), + bts_ctr_description, + }; + + return rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); +} diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h new file mode 100644 index 0000000..8cfada4 --- /dev/null +++ b/src/pcu_ctr.h @@ -0,0 +1,120 @@ +/* pcu_ctr.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by Sysmocom s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#include +#include + +#include +#include +#include + +static const struct rate_ctr_desc bts_ctr_description[] = { + { "tbf.dl.alloc", "TBF DL Allocated "}, + { "tbf.dl.freed", "TBF DL Freed "}, + { "tbf.dl.aborted", "TBF DL Aborted "}, + { "tbf.ul.alloc", "TBF UL Allocated "}, + { "tbf.ul.freed", "TBF UL Freed "}, + { "tbf.ul.aborted", "TBF UL Aborted "}, + { "tbf.reused", "TBF Reused "}, + { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, + { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, + { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, + { "rlc.sent", "RLC Sent "}, + { "rlc.resent", "RLC Resent "}, + { "rlc.restarted", "RLC Restarted "}, + { "rlc.stalled", "RLC Stalled "}, + { "rlc.nacked", "RLC Nacked "}, + { "rlc.final_block_resent", "RLC Final Blk resent "}, + { "rlc.ass.timedout", "RLC Assign Timeout "}, + { "rlc.ass.failed", "RLC Assign Failed "}, + { "rlc.ack.timedout", "RLC Ack Timeout "}, + { "rlc.ack.failed", "RLC Ack Failed "}, + { "rlc.rel.timedout", "RLC Release Timeout "}, + { "rlc.late-block", "RLC Late Block "}, + { "rlc.sent-dummy", "RLC Sent Dummy "}, + { "rlc.sent-control", "RLC Sent Control "}, + { "rlc.dl_bytes", "RLC DL Bytes "}, + { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, + { "rlc.ul_bytes", "RLC UL Bytes "}, + { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, + { "decode.errors", "Decode Errors "}, + { "sba.allocated", "SBA Allocated "}, + { "sba.freed", "SBA Freed "}, + { "sba.timedout", "SBA Timeout "}, + { "llc.timeout", "Timedout Frames "}, + { "llc.dropped", "Dropped Frames "}, + { "llc.scheduled", "Scheduled Frames "}, + { "llc.dl_bytes", "RLC encapsulated PDUs"}, + { "llc.ul_bytes", "full PDUs received "}, + { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "spb.uplink_first_segment", "First seg of UL SPB "}, + { "spb.uplink_second_segment", "Second seg of UL SPB "}, + { "spb.downlink_first_segment", "First seg of DL SPB "}, + { "spb.downlink_second_segment","Second seg of DL SPB "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_rej", "Immediate Assign Rej "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "channel.request_description","Channel Request Desc "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.access_reject", "Packet Access Reject "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, +}; + +struct rate_ctr_group *pcu_ctr_init(); diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b7574f9..c7dd3ed 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -30,6 +30,7 @@ #include extern "C" { #include "pcu_vty.h" +#include "pcu_ctr.h" #include #include #include @@ -251,6 +252,7 @@ vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); + bts->ctrs = pcu_ctr_init(); handle_options(argc, argv); if ((!!spoof_mcc) + (!!spoof_mnc) == 1) { diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 5ec16ea..c94f7d2 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "pcu_vty.h" #include "gprs_rlcmac.h" @@ -836,7 +837,9 @@ "show bts statistics", SHOW_STR "BTS related functionality\nStatistics\n") { - vty_out_rate_ctr_group(vty, "", bts_main_data_stats()); + struct gprs_rlcmac_bts *bts = bts_main_data(); + + vty_out_rate_ctr_group(vty, "", bts->ctrs); return CMD_SUCCESS; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..48ca24f 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } /* globals used by the code */ @@ -117,6 +118,7 @@ printf("Testing alloc_a direction(%d)\n", dir); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; struct gprs_rlcmac_trx *trx = &bts->trx[0]; @@ -195,6 +197,7 @@ printf("Testing UL then DL assignment.\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -237,6 +240,7 @@ printf("Testing DL then UL assignment followed by update\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -284,6 +288,7 @@ printf("Testing jolly example\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -345,6 +350,7 @@ gprs_rlcmac_tbf *ul_tbf, *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -389,6 +395,7 @@ gprs_rlcmac_dl_tbf *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -482,6 +489,7 @@ uint8_t trx_no = -1; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); gprs_rlcmac_tbf *tbf = NULL; @@ -663,6 +671,7 @@ printf("Going to test assignment with many TBF, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -701,6 +710,7 @@ printf("Going to test assignment with many connections, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -809,6 +819,7 @@ printf("Testing DL TS allocation for Multi UEs\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..604366e 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -30,7 +30,7 @@ extern "C" { #include "pcu_vty.h" - +#include "pcu_ctr.h" #include #include #include @@ -74,6 +74,7 @@ printf("=== start %s ===\n", __func__); + the_bts.bts_data()->ctrs = pcu_ctr_init(); the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a; the_bts.bts_data()->trx[0].pdch[2].enable(); the_bts.bts_data()->trx[0].pdch[3].enable(); @@ -148,6 +149,7 @@ gprs_rlcmac_trx *trx; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; bts->initial_cs_dl = cs; bts->initial_cs_ul = cs; diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 7d09108..25d689b 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } #define OSMO_ASSERT_STR_EQ(a, b) \ @@ -351,6 +352,7 @@ int bsn_begin, bsn_end, num_blocks; Ack_Nack_Description_t desc; + dummy_bts.bts_data()->ctrs = pcu_ctr_init(); dl_win.m_v_b.reset(); OSMO_ASSERT(dl_win.window_empty()); -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 25 16:01:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 25 Oct 2017 16:01:51 +0000 Subject: [PATCH] osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4411 to look at the new patch set (#8). Initialize logging before initializing rate_ctr The library code for rate counter initialization might already want to log something (particularly after Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Before the rate counters were initialized implicitly in BTS constructor which makes proper logging init impossible. Fix this by using explicit init similar to the way we do it for vty. Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 --- M src/Makefile.am M src/bts.cpp M src/bts.h A src/pcu_ctr.c A src/pcu_ctr.h M src/pcu_main.cpp M src/pcu_vty.c M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp M tests/types/TypesTest.cpp 10 files changed, 194 insertions(+), 122 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/11/4411/8 diff --git a/src/Makefile.am b/src/Makefile.am index 1543851..67291ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,7 @@ gprs_ms_storage.cpp \ gsm_timer.cpp \ pcu_l1_if.cpp \ + pcu_ctr.c \ pcu_vty.c \ pcu_vty_functions.cpp \ tbf.cpp \ @@ -79,6 +80,7 @@ gprs_ms_storage.h \ pcu_l1_if.h \ gsm_timer.h \ + pcu_ctr.h \ pcu_vty.h \ pcu_vty_functions.h \ tbf.h \ diff --git a/src/bts.cpp b/src/bts.cpp index b768569..0f7462a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -50,107 +50,6 @@ static BTS s_bts; -/** - * For gcc-4.4 compat do not use extended initializer list but keep the - * order from the enum here. Once we support GCC4.7 and up we can change - * the code below. - */ -static const struct rate_ctr_desc bts_ctr_description[] = { - { "tbf.dl.alloc", "TBF DL Allocated "}, - { "tbf.dl.freed", "TBF DL Freed "}, - { "tbf.dl.aborted", "TBF DL Aborted "}, - { "tbf.ul.alloc", "TBF UL Allocated "}, - { "tbf.ul.freed", "TBF UL Freed "}, - { "tbf.ul.aborted", "TBF UL Aborted "}, - { "tbf.reused", "TBF Reused "}, - { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, - { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, - { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, - { "rlc.sent", "RLC Sent "}, - { "rlc.resent", "RLC Resent "}, - { "rlc.restarted", "RLC Restarted "}, - { "rlc.stalled", "RLC Stalled "}, - { "rlc.nacked", "RLC Nacked "}, - { "rlc.final_block_resent", "RLC Final Blk resent "}, - { "rlc.ass.timedout", "RLC Assign Timeout "}, - { "rlc.ass.failed", "RLC Assign Failed "}, - { "rlc.ack.timedout", "RLC Ack Timeout "}, - { "rlc.ack.failed", "RLC Ack Failed "}, - { "rlc.rel.timedout", "RLC Release Timeout "}, - { "rlc.late-block", "RLC Late Block "}, - { "rlc.sent-dummy", "RLC Sent Dummy "}, - { "rlc.sent-control", "RLC Sent Control "}, - { "rlc.dl_bytes", "RLC DL Bytes "}, - { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, - { "rlc.ul_bytes", "RLC UL Bytes "}, - { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, - { "decode.errors", "Decode Errors "}, - { "sba.allocated", "SBA Allocated "}, - { "sba.freed", "SBA Freed "}, - { "sba.timedout", "SBA Timeout "}, - { "llc.timeout", "Timedout Frames "}, - { "llc.dropped", "Dropped Frames "}, - { "llc.scheduled", "Scheduled Frames "}, - { "llc.dl_bytes", "RLC encapsulated PDUs"}, - { "llc.ul_bytes", "full PDUs received "}, - { "rach.requests", "RACH requests "}, - { "11bit_rach.requests", "11BIT_RACH requests "}, - { "spb.uplink_first_segment", "First seg of UL SPB "}, - { "spb.uplink_second_segment", "Second seg of UL SPB "}, - { "spb.downlink_first_segment", "First seg of DL SPB "}, - { "spb.downlink_second_segment","Second seg of DL SPB "}, - { "immediate.assignment_UL", "Immediate Assign UL "}, - { "immediate.assignment_rej", "Immediate Assign Rej "}, - { "immediate.assignment_DL", "Immediate Assign DL "}, - { "channel.request_description","Channel Request Desc "}, - { "pkt.ul_assignment", "Packet UL Assignment "}, - { "pkt.access_reject", "Packet Access Reject "}, - { "pkt.dl_assignment", "Packet DL Assignment "}, - { "ul.control", "UL control Block "}, - { "ul.assignment_poll_timeout", "UL Assign Timeout "}, - { "ul.assignment_failed", "UL Assign Failed "}, - { "dl.assignment_timeout", "DL Assign Timeout "}, - { "dl.assignment_failed", "DL Assign Failed "}, - { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, - { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, - { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, - { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, - { "gprs.downlink_cs1", "CS1 downlink "}, - { "gprs.downlink_cs2", "CS2 downlink "}, - { "gprs.downlink_cs3", "CS3 downlink "}, - { "gprs.downlink_cs4", "CS4 downlink "}, - { "egprs.downlink_mcs1", "MCS1 downlink "}, - { "egprs.downlink_mcs2", "MCS2 downlink "}, - { "egprs.downlink_mcs3", "MCS3 downlink "}, - { "egprs.downlink_mcs4", "MCS4 downlink "}, - { "egprs.downlink_mcs5", "MCS5 downlink "}, - { "egprs.downlink_mcs6", "MCS6 downlink "}, - { "egprs.downlink_mcs7", "MCS7 downlink "}, - { "egprs.downlink_mcs8", "MCS8 downlink "}, - { "egprs.downlink_mcs9", "MCS9 downlink "}, - { "gprs.uplink_cs1", "CS1 Uplink "}, - { "gprs.uplink_cs2", "CS2 Uplink "}, - { "gprs.uplink_cs3", "CS3 Uplink "}, - { "gprs.uplink_cs4", "CS4 Uplink "}, - { "egprs.uplink_mcs1", "MCS1 Uplink "}, - { "egprs.uplink_mcs2", "MCS2 Uplink "}, - { "egprs.uplink_mcs3", "MCS3 Uplink "}, - { "egprs.uplink_mcs4", "MCS4 Uplink "}, - { "egprs.uplink_mcs5", "MCS5 Uplink "}, - { "egprs.uplink_mcs6", "MCS6 Uplink "}, - { "egprs.uplink_mcs7", "MCS7 Uplink "}, - { "egprs.uplink_mcs8", "MCS8 Uplink "}, - { "egprs.uplink_mcs9", "MCS9 Uplink "}, -}; - -static const struct rate_ctr_group_desc bts_ctrg_desc = { - "bts", - "BTS Statistics", - OSMO_STATS_CLASS_GLOBAL, - ARRAY_SIZE(bts_ctr_description), - bts_ctr_description, -}; - static const struct osmo_stat_item_desc bts_stat_item_description[] = { { "ms.present", "MS Present ", OSMO_STAT_ITEM_NO_UNIT, 4, 0}, @@ -179,11 +78,6 @@ return BTS::main_bts()->bts_data(); } -struct rate_ctr_group *bts_main_data_stats() -{ - return BTS::main_bts()->rate_counters(); -} - BTS::BTS() : m_cur_fn(0) , m_cur_blk_fn(-1) @@ -207,8 +101,6 @@ } } - m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); - OSMO_ASSERT(m_ratectrs); m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0); OSMO_ASSERT(m_statg); } @@ -219,7 +111,8 @@ * m_ms_store's destructor */ m_ms_store.cleanup(); - rate_ctr_group_free(m_ratectrs); + if (m_bts.ctrs) + rate_ctr_group_free(m_bts.ctrs); osmo_stat_item_group_free(m_statg); } diff --git a/src/bts.h b/src/bts.h index d65cd2f..607b4c1 100644 --- a/src/bts.h +++ b/src/bts.h @@ -231,6 +231,9 @@ /* State for dynamic algorithm selection */ int multislot_disabled; + /* Statistics */ + struct rate_ctr_group *ctrs; + /** * Point back to the C++ object. This is used during the transition * period. @@ -482,7 +485,6 @@ /* * Below for C interface for the VTY */ - struct rate_ctr_group *rate_counters() const; struct osmo_stat_item_group *stat_items() const; LListHead& ul_tbfs(); @@ -493,7 +495,6 @@ struct gprs_rlcmac_bts m_bts; PollController m_pollController; SBAController m_sba; - struct rate_ctr_group *m_ratectrs; struct osmo_stat_item_group *m_statg; GprsMsStorage m_ms_store; @@ -570,11 +571,6 @@ return m_assigned_tfi[dir]; } -inline struct rate_ctr_group *BTS::rate_counters() const -{ - return m_ratectrs; -} - inline struct osmo_stat_item_group *BTS::stat_items() const { return m_statg; @@ -582,12 +578,14 @@ #define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ inline void BTS::func_name(int inc) {\ - rate_ctr_add(&m_ratectrs->ctr[ctr_name], inc); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ } #define CREATE_COUNT_INLINE(func_name, ctr_name) \ inline void BTS::func_name() {\ - rate_ctr_inc(&m_ratectrs->ctr[ctr_name]); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ } CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) @@ -705,8 +703,6 @@ extern "C" { #endif struct gprs_rlcmac_bts *bts_main_data(); - struct rate_ctr_group *bts_main_data_stats(); - struct osmo_stat_item_group *bts_main_data_stat_items(); #ifdef __cplusplus } diff --git a/src/pcu_ctr.c b/src/pcu_ctr.c new file mode 100644 index 0000000..d3ed801 --- /dev/null +++ b/src/pcu_ctr.c @@ -0,0 +1,41 @@ +/* pcu_ctr.c + * + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "pcu_ctr.h" + +#include +#include +#include + +extern void *tall_pcu_ctx; + +struct rate_ctr_group *pcu_ctr_init() +{ + const struct rate_ctr_group_desc bts_ctrg_desc = { + "bts", + "BTS Statistics", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(bts_ctr_description), + bts_ctr_description, + }; + + return rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); +} diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h new file mode 100644 index 0000000..af735e9 --- /dev/null +++ b/src/pcu_ctr.h @@ -0,0 +1,120 @@ +/* pcu_ctr.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#include +#include + +#include +#include +#include + +static const struct rate_ctr_desc bts_ctr_description[] = { + { "tbf.dl.alloc", "TBF DL Allocated "}, + { "tbf.dl.freed", "TBF DL Freed "}, + { "tbf.dl.aborted", "TBF DL Aborted "}, + { "tbf.ul.alloc", "TBF UL Allocated "}, + { "tbf.ul.freed", "TBF UL Freed "}, + { "tbf.ul.aborted", "TBF UL Aborted "}, + { "tbf.reused", "TBF Reused "}, + { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, + { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, + { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, + { "rlc.sent", "RLC Sent "}, + { "rlc.resent", "RLC Resent "}, + { "rlc.restarted", "RLC Restarted "}, + { "rlc.stalled", "RLC Stalled "}, + { "rlc.nacked", "RLC Nacked "}, + { "rlc.final_block_resent", "RLC Final Blk resent "}, + { "rlc.ass.timedout", "RLC Assign Timeout "}, + { "rlc.ass.failed", "RLC Assign Failed "}, + { "rlc.ack.timedout", "RLC Ack Timeout "}, + { "rlc.ack.failed", "RLC Ack Failed "}, + { "rlc.rel.timedout", "RLC Release Timeout "}, + { "rlc.late-block", "RLC Late Block "}, + { "rlc.sent-dummy", "RLC Sent Dummy "}, + { "rlc.sent-control", "RLC Sent Control "}, + { "rlc.dl_bytes", "RLC DL Bytes "}, + { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, + { "rlc.ul_bytes", "RLC UL Bytes "}, + { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, + { "decode.errors", "Decode Errors "}, + { "sba.allocated", "SBA Allocated "}, + { "sba.freed", "SBA Freed "}, + { "sba.timedout", "SBA Timeout "}, + { "llc.timeout", "Timedout Frames "}, + { "llc.dropped", "Dropped Frames "}, + { "llc.scheduled", "Scheduled Frames "}, + { "llc.dl_bytes", "RLC encapsulated PDUs"}, + { "llc.ul_bytes", "full PDUs received "}, + { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "spb.uplink_first_segment", "First seg of UL SPB "}, + { "spb.uplink_second_segment", "Second seg of UL SPB "}, + { "spb.downlink_first_segment", "First seg of DL SPB "}, + { "spb.downlink_second_segment","Second seg of DL SPB "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_rej", "Immediate Assign Rej "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "channel.request_description","Channel Request Desc "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.access_reject", "Packet Access Reject "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, +}; + +struct rate_ctr_group *pcu_ctr_init(); diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b7574f9..c7dd3ed 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -30,6 +30,7 @@ #include extern "C" { #include "pcu_vty.h" +#include "pcu_ctr.h" #include #include #include @@ -251,6 +252,7 @@ vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); + bts->ctrs = pcu_ctr_init(); handle_options(argc, argv); if ((!!spoof_mcc) + (!!spoof_mnc) == 1) { diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 5ec16ea..c94f7d2 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "pcu_vty.h" #include "gprs_rlcmac.h" @@ -836,7 +837,9 @@ "show bts statistics", SHOW_STR "BTS related functionality\nStatistics\n") { - vty_out_rate_ctr_group(vty, "", bts_main_data_stats()); + struct gprs_rlcmac_bts *bts = bts_main_data(); + + vty_out_rate_ctr_group(vty, "", bts->ctrs); return CMD_SUCCESS; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..48ca24f 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } /* globals used by the code */ @@ -117,6 +118,7 @@ printf("Testing alloc_a direction(%d)\n", dir); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; struct gprs_rlcmac_trx *trx = &bts->trx[0]; @@ -195,6 +197,7 @@ printf("Testing UL then DL assignment.\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -237,6 +240,7 @@ printf("Testing DL then UL assignment followed by update\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -284,6 +288,7 @@ printf("Testing jolly example\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -345,6 +350,7 @@ gprs_rlcmac_tbf *ul_tbf, *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -389,6 +395,7 @@ gprs_rlcmac_dl_tbf *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -482,6 +489,7 @@ uint8_t trx_no = -1; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); gprs_rlcmac_tbf *tbf = NULL; @@ -663,6 +671,7 @@ printf("Going to test assignment with many TBF, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -701,6 +710,7 @@ printf("Going to test assignment with many connections, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -809,6 +819,7 @@ printf("Testing DL TS allocation for Multi UEs\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..604366e 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -30,7 +30,7 @@ extern "C" { #include "pcu_vty.h" - +#include "pcu_ctr.h" #include #include #include @@ -74,6 +74,7 @@ printf("=== start %s ===\n", __func__); + the_bts.bts_data()->ctrs = pcu_ctr_init(); the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a; the_bts.bts_data()->trx[0].pdch[2].enable(); the_bts.bts_data()->trx[0].pdch[3].enable(); @@ -148,6 +149,7 @@ gprs_rlcmac_trx *trx; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; bts->initial_cs_dl = cs; bts->initial_cs_ul = cs; diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 7d09108..25d689b 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } #define OSMO_ASSERT_STR_EQ(a, b) \ @@ -351,6 +352,7 @@ int bsn_begin, bsn_end, num_blocks; Ack_Nack_Description_t desc; + dummy_bts.bts_data()->ctrs = pcu_ctr_init(); dl_win.m_v_b.reset(); OSMO_ASSERT(dl_win.window_empty()); -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 25 16:13:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 16:13:55 +0000 Subject: osmo-mgw[master]: sdp: refactoring sdp parser/generator In-Reply-To: References: Message-ID: Patch Set 14: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324 Gerrit-PatchSet: 14 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 16:15:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 16:15:37 +0000 Subject: osmo-mgw[master]: client: add unified function to generate MGCP messages In-Reply-To: References: Message-ID: Patch Set 13: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe Gerrit-PatchSet: 13 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 16:16:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 16:16:33 +0000 Subject: osmo-mgw[master]: client: add ip address parsing to the client In-Reply-To: References: Message-ID: Patch Set 14: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a Gerrit-PatchSet: 14 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 16:51:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 25 Oct 2017 16:51:56 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: refactor Makefile build rules, don't use the FORCE In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: refactor Makefile build rules, don't use the FORCE ...................................................................... refactor Makefile build rules, don't use the FORCE The initial goal was to make sure we don't have overall FORCE rules causing unnecessary rebuilds -- annoying while writing documentation. As I looked through possible dependencies, I finally understood what's going on here. Remove code dup and nicely sort which belongs where in build/Makefile.*.inc. In each, describe in a top comment how to use it, and also unify how they are used: - Rename Makefile.inc to Makefile.docbook.inc and refactor - Add Makefile.vty-reference.inc - Add Makefile.common.inc Make sure that we accurately pick up all dependencies. Drop use of the macro called 'command', that silenced the actual command lines invoked and replaced them with short strings: it obscures what is actually going on and makes the Makefiles hard to read and understand. Each manual's makefile is greatly reduced to few definitions and a Makefile include, e.g. one for asciidoc, one for VTY reference. Move common/bsc_vty_additions.xml to OsmoBSC/vty/libbsc_vty_additions.xml, link from OsmoNITB. It applies only to OsmoBSC and OsmoNITB. Add a script that combines a VTY reference file with *all* additions files found in a manual's vty/ dir. Call this from Makefile.vty-reference.inc. Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 --- M OsmoBSC/Makefile R OsmoBSC/vty/libbsc_vty_additions.xml M OsmoBTS/Makefile M OsmoGGSN/Makefile M OsmoGSMTester/Makefile M OsmoHLR/Makefile M OsmoMGCP/Makefile M OsmoMSC/Makefile M OsmoNAT/Makefile M OsmoNITB/Makefile A OsmoNITB/vty/bsc_vty_additions.xml M OsmoPCU/Makefile M OsmoSGSN/Makefile M build/Makefile.asciidoc.inc A build/Makefile.common.inc A build/Makefile.docbook.inc D build/Makefile.inc A build/Makefile.vty-reference.inc A build/vty_reference_combine.sh 19 files changed, 206 insertions(+), 443 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index 35f50da..1533482 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -1,54 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. - -EXTRA_DEPS = gen-bsc-vty-docbook - -topdir = . -bsc_reference = $(topdir)/osmobsc-vty-reference.xml -manuals = $(bsc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobsc-usermanual osmux-reference aoip-mgw-options - +ASCIIDOC = osmobsc-usermanual.adoc osmux-reference.adoc aoip-mgw-options.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmobsc-usermanual.pdf: chapters/*.adoc -osmux-reference.pdf: osmux-reference.adoc -aoip-mgw-options.pdf: aoip-mgw-options.adoc +aoip-mgw-options.pdf: aoip-mgw-options.adoc mgw/*.msc -clean: - -rm -rf $(cleanfiles) - -rm osmobsc-usermanual__*.png - -rm osmobsc-usermanual__*.svg - -rm osmobsc-usermanual*.check - -rm osmux-reference*.check - -rm aoip-mgw-options*.png - -rm aoip-mgw-options*.svg - -rm aoip-mgw-options*.check - -rm osmux-reference__*.svg - -rm osmux-reference__*.png - -rm osmux-reference__*.check +VTY_REFERENCE = osmobsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bsc-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bsc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/common/bsc_vty_additions.xml b/OsmoBSC/vty/libbsc_vty_additions.xml similarity index 100% rename from common/bsc_vty_additions.xml rename to OsmoBSC/vty/libbsc_vty_additions.xml diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 58df0e3..e1ff214 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -1,50 +1,12 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-bts-vty-docbook - -topdir = . -bts_reference = $(topdir)/osmobts-vty-reference.xml -manuals = $(bts_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmobts-usermanual osmobts-abis rtp-amr - +ASCIIDOC = osmobts-usermanual.adoc osmobts-abis.adoc rtp-amr.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - -osmobts-abis.pdf: abis/*.adoc abis/*.msc osmobts-usermanual.pdf: chapters/*.adoc +osmobts-abis.pdf: abis/*.adoc abis/*.msc +rtp-amr.pdf: dtx.dot -clean: - -rm -rf $(cleanfiles) - -rm osmobts-abis__*.png - -rm osmobts-abis__*.svg - -rm rtp-amr__*.png - -rm rtp-amr__*.svg - -rm osmobts-usermanual__*.png - -rm osmobts-usermanual__*.svg - -rm osmobts-abis*.check - -rm osmobts-usermanual*.check +VTY_REFERENCE = osmobts-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-bts-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/bts_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/bts_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging BTS VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting BTS VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile index 2dfedb2..e809632 100644 --- a/OsmoGGSN/Makefile +++ b/OsmoGGSN/Makefile @@ -1,39 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-ggsn-vty-docbook - -topdir = . -ggsn_reference = $(topdir)/osmoggsn-vty-reference.xml -manuals = $(ggsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmoggsn-usermanual - +ASCIIDOC = osmoggsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmoggsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmoggsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmoggsn-usermanual__*.svg osmoggsn-usermanual__*.png - -rm osmoggsn-usermanual.check - -gen-ggsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/ggsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/ggsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging GGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting GGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoGSMTester/Makefile b/OsmoGSMTester/Makefile index 79d414f..43c5a37 100644 --- a/OsmoGSMTester/Makefile +++ b/OsmoGSMTester/Makefile @@ -1,12 +1,7 @@ -TOPDIR := .. -ASCIIDOCS := osmo-gsm-tester-manual +TOPDIR = .. +ASCIIDOC = osmo-gsm-tester-manual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmo-gsm-tester-manual.pdf: chapters/*.adoc - -clean: - -rm -rf $(cleanfiles) - -rm osmo-gsm-tester-manual__*.svg - -rm osmo-gsm-tester-manual__*.png +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile index eba5fa3..a9dc393 100644 --- a/OsmoHLR/Makefile +++ b/OsmoHLR/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -hlr_reference = $(topdir)/osmohlr-vty-reference.xml -manuals = $(hlr_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmohlr-usermanual - +ASCIIDOC = osmohlr-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc *.vty *.ctrl include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmohlr-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmohlr-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmohlr-usermanual__*.svg - -rm osmohlr-usermanual__*.png - -rm osmohlr-usermanual.check - -generated/docbook_vty.xml: osmohlr-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/hlr_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/hlr_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging HLR VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting HLR VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMGCP/Makefile b/OsmoMGCP/Makefile index 9aff12b..e2a5e37 100644 --- a/OsmoMGCP/Makefile +++ b/OsmoMGCP/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-mgcp-vty-docbook +VTY_REFERENCE = osmomgcp-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -mgcp_reference = $(topdir)/osmomgcp-vty-reference.xml -manuals = $(mgcp_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-mgcp-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/mgcp_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/mgcp_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging MGCP VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MGCP VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile index febf7d1..c9edcef 100644 --- a/OsmoMSC/Makefile +++ b/OsmoMSC/Makefile @@ -1,42 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -topdir = . -msc_reference = $(topdir)/osmomsc-vty-reference.xml -manuals = $(msc_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmomsc-usermanual - +ASCIIDOC = osmomsc-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml +VTY_REFERENCE = osmomsc-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmomsc-usermanual__*.svg - -rm osmomsc-usermanual__*.png - -rm osmomsc-usermanual.check - -generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/msc_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/msc_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging MSC VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting MSC VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNAT/Makefile b/OsmoNAT/Makefile index d7302e6..fde7132 100644 --- a/OsmoNAT/Makefile +++ b/OsmoNAT/Makefile @@ -1,31 +1,6 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nat-vty-docbook +VTY_REFERENCE = osmonat-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -topdir = . -nat_reference = $(topdir)/osmonat-vty-reference.xml -manuals = $(nat_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -include ../build/Makefile.inc - -clean: - -rm -rf $(cleanfiles) - -gen-nat-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nat_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/nat_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging NAT VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NAT VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/Makefile b/OsmoNITB/Makefile index 99cd317..0cd260d 100644 --- a/OsmoNITB/Makefile +++ b/OsmoNITB/Makefile @@ -1,44 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-nitb-vty-docbook - -topdir = . -nitb_reference = $(topdir)/osmonitb-vty-reference.xml -manuals = $(nitb_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmonitb-usermanual - +ASCIIDOC = osmonitb-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmonitb-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmonitb-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmonitb-usermanual__*.svg - -rm osmonitb-usermanual__*.png - -rm osmonitb-usermanual.check - -gen-nitb-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/nitb_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common BSC VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/nitb_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging NITB VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting NITB VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoNITB/vty/bsc_vty_additions.xml b/OsmoNITB/vty/bsc_vty_additions.xml new file mode 120000 index 0000000..5def5f1 --- /dev/null +++ b/OsmoNITB/vty/bsc_vty_additions.xml @@ -0,0 +1 @@ +../../OsmoBSC/vty/bsc_vty_additions.xml \ No newline at end of file diff --git a/OsmoPCU/Makefile b/OsmoPCU/Makefile index a83b909..7a1acc0 100644 --- a/OsmoPCU/Makefile +++ b/OsmoPCU/Makefile @@ -1,45 +1,11 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-vty-docbook - -topdir = . -pcu_reference = $(topdir)/osmopcu-vty-reference.xml -manuals = $(bts_manual) $(pcu_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmopcu-usermanual osmopcu-gb - +ASCIIDOC = osmopcu-usermanual.adoc osmopcu-gb.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc - osmopcu-gb.pdf: gb/*.adoc gb/*.msc osmopcu-usermanual.pdf: chapters/*.adoc -clean: - -rm -rf $(cleanfiles) - -rm -rf gen-vty-docbook - -rm osmopcu-usermanual__*.png - -rm osmopcu-usermanual__*.svg - -rm osmopcu-usermanual.check +VTY_REFERENCE = osmopcu-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -gen-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/osmo-pcu_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/vty/osmo-pcu_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging PCU VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting PCU VTY to DocBook) - - - +include $(TOPDIR)/build/Makefile.common.inc diff --git a/OsmoSGSN/Makefile b/OsmoSGSN/Makefile index 6f7d28d..baa1a49 100644 --- a/OsmoSGSN/Makefile +++ b/OsmoSGSN/Makefile @@ -1,43 +1,10 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals +TOPDIR = .. -EXTRA_DEPS = gen-sgsn-vty-docbook - -topdir = . -sgsn_reference = $(topdir)/osmosgsn-vty-reference.xml -manuals = $(sgsn_reference) -# types = pdf txt rtf ps xhtml html man tex texi dvi -# types = pdf txt -types = $(docbooktotypes) -docbooktotypes = pdf -# htmlcssfile = -# htmlcss = - -TOPDIR := .. -ASCIIDOCS := osmosgsn-usermanual - +ASCIIDOC = osmosgsn-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc include $(TOPDIR)/build/Makefile.asciidoc.inc -include $(TOPDIR)/build/Makefile.inc -osmosgsn-usermanual.pdf: chapters/*.adoc +VTY_REFERENCE = osmosgsn-vty-reference.xml +include $(TOPDIR)/build/Makefile.vty-reference.inc -clean: - -rm -rf $(cleanfiles) - -rm osmosgsn-usermanual__*.svg osmosgsn-usermanual__*.png - -rm osmosgsn-usermanual.check - -gen-sgsn-vty-docbook: FORCE - $(call command,xsltproc -o generated/combined1.xml \ - --stringparam with $(PWD)/../common/vty_additions.xml \ - $(MERGE_DOC) vty/sgsn_vty_reference.xml, \ - XSLTPROC,Merging Common VTY) - $(call command,xsltproc -o generated/combined2.xml \ - --stringparam with $(PWD)/../common/ns_vty_additions.xml \ - $(MERGE_DOC) generated/combined1.xml, \ - XSLTPROC,Merging Common NS VTY) - $(call command,xsltproc -o generated/combined3.xml \ - --stringparam with $(PWD)/vty/sgsn_vty_additions.xml \ - $(MERGE_DOC) generated/combined2.xml, \ - XSLTPROC,Merging SGSN VTY) - $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ - XSLTPROC,Converting SGSN VTY to DocBook) +include $(TOPDIR)/build/Makefile.common.inc diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index e088624..a28a5bb 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -1,19 +1,38 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'ASCIIDOC' all root .adoc files, +# - optionally define in 'ASCIIDOC_DEPS' all dependencies common to all .adocs, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# ASCIIDOC = osmo_yada.adoc osmo_moo.adoc +# ASCIIDOC_DEPS = for_all/*.adoc +# include $(TOPDIR)/build/Makefile.asciidoc.inc +# osmo_yada.pdf: yada/*.adoc yada/*.msc + BUILDDIR = $(TOPDIR)/build GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags) GIT_DATE := $(shell $(TOPDIR)/build/unix-time-to-fmt.py `git log -n 1 "--pretty=%at" ../.`) # prepend the document name with the version numbe suffix -#DOCS_VER = $(foreach P, $(ASCIIDOCS), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) +#DOCS_VER = $(foreach P, $(ASCIIDOC_NAME), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null)) #PDFS = $(DOCS_VER:%=%.pdf) # generate list of PDFs that we're supposed to render -ASCIIDOCPDFS = $(ASCIIDOCS:%=%.pdf) -ASCIIDOC_CHECKS = $(ASCIIDOCS:%=%.check) +ASCIIDOC_NAME = $(patsubst %.adoc,%,$(ASCIIDOC)) +ASCIIDOC_PDF = $(ASCIIDOC_NAME:%=%.pdf) +ASCIIDOC_CHECKS = $(ASCIIDOC_NAME:%=%.check) ASCIIDOCSTYLE ?= $(BUILDDIR)/custom-dblatex.sty -cleanfiles += $(ASCIIDOCPDFS) +CLEAN_FILES += $(ASCIIDOC_NAME:%=%__*.png) $(ASCIIDOC_NAME:%=%__*.svg) $(ASCIIDOC_CHECKS) +CLEAN_FILES += $(ASCIIDOC_PDF) +UPLOAD_FILES += $(ASCIIDOC_PDF) ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -f $(BUILDDIR)/python2-filter.conf DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0 @@ -27,9 +46,13 @@ A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" --dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(REVNUMBER)" -a revdate="$(GIT_DATE)" -all: $(ASCIIDOCPDFS) +all: $(ASCIIDOC_PDF) -$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc +$(ASCIIDOC_PDF): %.pdf: %.adoc %-docinfo.xml \ + $(ASCIIDOC_DEPS) \ + $(ASCIIDOCSTYLE) \ + $(TOPDIR)/common/*/*.adoc \ + $(TOPDIR)/common/images/* @test -n "$(BUILD_RELEASE)" && echo -e "\n\n\ NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\ and remove three lines starting with '% \"DRAFT\" on first page'\n" \ diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc new file mode 100644 index 0000000..e624b5f --- /dev/null +++ b/build/Makefile.common.inc @@ -0,0 +1,14 @@ +# Usage: +# +# Other makefiles like Makefile.asciidoc.inc and Makefile.vty-reference.inc add +# entries to UPLOAD_FILES and CLEAN_FILES. +# +# Include this file at the end to have 'upload' and 'clean' targets. + +UPLOAD_PATH ?= generic at sysmocom-downloads:documents + +upload: $(UPLOAD_FILES) + rsync -avz $(UPLOAD_FILES) $(UPLOAD_PATH)/ + +clean: + -rm -rf $(CLEAN_FILES) diff --git a/build/Makefile.docbook.inc b/build/Makefile.docbook.inc new file mode 100644 index 0000000..70dfafa --- /dev/null +++ b/build/Makefile.docbook.inc @@ -0,0 +1,35 @@ +# USAGE: +# +# - define 'TOPDIR' to point at the git root, +# - define in 'DOCBOOKS' all root .xml files, +# - optionally define in 'DOCBOOKS_DEPS' all dependencies common to all .xmls, +# - include this file, +# - optionally define further dependencies for individual .pdf targets. +# +# e.g. +# +# TOPDIR = .. +# DOCBOOKS = osmo_yada.xml osmo_moo.xml +# ASCIIDOC_DEPS = for_all/*.xml +# include $(TOPDIR)/build/Makefile.docbook.inc +# osmo_yada.pdf: yada/*.xml +# +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals, edited. + +DOCBOOKS_PDF = $(patsubst %.xml,%.pdf,$(DOCBOOKS)) +lint = $(patsubst %.xml,%.lint,$(DOCBOOKS)) + +CLEAN_FILES += $(DOCBOOKS_PDF) $(lint) +UPLOAD_FILES += $(DOCBOOKS_PDF) + +all: $(DOCBOOKS_PDF) + +# Lint the file +%.xml-lint: %.xml + xmllint --xinclude --postvalid --noout $< + +# Create a PDF file and lint it before +%.pdf: %.xml %.xml-lint $(DOCBOOKS_DEPS) + dblatex $(dblatex_quiet) -P draft.mode=no $< + diff --git a/build/Makefile.inc b/build/Makefile.inc deleted file mode 100644 index 3905cb0..0000000 --- a/build/Makefile.inc +++ /dev/null @@ -1,47 +0,0 @@ -# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ -# Makefile from BitBake/OpenEmbedded manuals - -LIBOSMO_DIR ?= ~/source/gsm/libosmocore -MERGE_DOC := $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl -UPLOAD_PATH ?= generic at sysmocom-downloads:documents - -pdfs = $(patsubst %.xml,%.pdf,$(manuals)) -lint = $(patsubst %.xml,%.xml-lint,$(manuals)) - -#cleanfiles = $(foreach i,$(types),$(topdir)/$(i)) -cleanfiles += $(pdfs) $(lint) - -ifdef DEBUG -dblatex_quiet = -define command - $(1) -endef -else -dblatex_quiet = -q -define command - @echo $(2) $(3) - @$(1) -endef -endif - -all: $(types) - - -$(types): FORCE - - -pdf: $(pdfs) $(manuals) - - -# Lint the file -%.xml-lint: %.xml FORCE - $(call command,xmllint --xinclude --postvalid --noout $<,XMLLINT,$<) - -# Create a PDF file and lint it before -%.pdf: %.xml %.xml-lint $(EXTRA_DEPS) FORCE - $(call command,dblatex $(dblatex_quiet) -P draft.mode=no $<,DBLATEX,$<) - -upload: $(pdfs) $(ASCIIDOCPDFS) - rsync -avz $(pdfs) $(ASCIIDOCPDFS) $(UPLOAD_PATH)/ - -FORCE: diff --git a/build/Makefile.vty-reference.inc b/build/Makefile.vty-reference.inc new file mode 100644 index 0000000..baf9cf5 --- /dev/null +++ b/build/Makefile.vty-reference.inc @@ -0,0 +1,42 @@ +# Usage: +# Have files: +# - osmoyada-vty-reference.xml +# A docbook root XML including a &chapter-vty; reference. +# - vty/*additions*.xml +# Manual additions to specific VTY nodes, any number of files. +# - vty/*_reference.xml +# Export from VTY 'show online-help', exactly one file. +# +# In your Makefile, +# - define 'TOPDIR' to point at the git root, +# - define the (single) name of the vty-reference source in VTY_REFERENCE, +# - include this file. +# +# e.g. +# +# TOPDIR = .. +# VTY_REFERENCE = osmofoo-vty-reference +# include $(TOPDIR)/build/Makefile.vty-reference.inc +# +# This uses the Makefile.docbook.inc, you should not mix uses of +# Makefile.vty-reference.inc and Makefile.docbook.inc. + +DOCBOOKS = $(VTY_REFERENCE) +DOCBOOKS_DEPS = generated/docbook_vty.xml +include $(TOPDIR)/build/Makefile.docbook.inc + +LIBOSMO_DIR ?= ~/source/gsm/libosmocore +MERGE_DOC = $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl + +CLEAN_FILES += generated + +generated/docbook_vty.xml: \ + vty/*xml \ + $(TOPDIR)/common/vty_additions.xml \ + $(TOPDIR)/common/chapters/vty.xml \ + $(TOPDIR)/vty_reference.xsl + $(TOPDIR)/build/vty_reference_combine.sh "$(MERGE_DOC)" \ + $(TOPDIR)/common/vty_additions.xml \ + vty/*additions*.xml + xsltproc $(TOPDIR)/vty_reference.xsl generated/combined.xml \ + > generated/docbook_vty.xml diff --git a/build/vty_reference_combine.sh b/build/vty_reference_combine.sh new file mode 100755 index 0000000..be234a7 --- /dev/null +++ b/build/vty_reference_combine.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +# the first argument should point at libosmocore/doc/vty/merge_doc.xsl +MERGE_DOC="$1" +shift + +combined="generated/combined.xml" +combine_src="generated/combine_src.xml" + +reference="vty/*reference.xml" +test "$(ls -1 $reference | wc -l)" = "1" + +set -x +mkdir -p generated +cp $reference "$combined" + +while [ -n "$1" ]; do + addition="$(realpath "$1")" + shift + mv "$combined" "$combine_src" + xsltproc -o "$combined" \ + --stringparam with "$addition" \ + "$MERGE_DOC" "$combine_src" +done -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 8 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 25 17:17:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 25 Oct 2017 17:17:51 +0000 Subject: [PATCH] osmo-hlr[master]: db api: fix/add API docs Message-ID: Review at https://gerrit.osmocom.org/4415 db api: fix/add API docs Change-Id: I854fafd8e56bd0b8394f8ed79d023c11c2fdbdca --- M src/db_hlr.c 1 file changed, 76 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/4415/1 diff --git a/src/db_hlr.c b/src/db_hlr.c index e8db7d2..73ff1f8 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -43,6 +43,11 @@ x[sizeof(x)-1] = '\0'; \ } while (0) +/*! Add new subscriber record to the HLR database. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits, is validated. + * \returns 0 on success, -EINVAL on invalid IMSI, -EIO on database error. + */ int db_subscr_create(struct db_context *dbc, const char *imsi) { sqlite3_stmt *stmt; @@ -71,6 +76,15 @@ return 0; } +/*! Completely delete a subscriber record from the HLR database. + * Also removes authentication data. + * Future todo: also drop from all other database tables, which aren't used yet + * at the time of writing this. + * \param[in,out] dbc database context. + * \param[in] subscr_id ID of the subscriber in the HLR db. + * \returns if the subscriber was found and removed, -EIO on database error, + * -ENOENT if no such subscriber data exists. + */ int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id) { int rc; @@ -127,6 +141,13 @@ return ret; } +/*! Set a subscriber's MSISDN in the HLR database. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits. + * \param[in] msisdn ASCII string of MSISDN digits. + * \returns 0 on success, -EINVAL in case of invalid MSISDN string, -EIO on + * database failure, -ENOENT if no such subscriber exists. + */ int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, const char *msisdn) { @@ -175,14 +196,17 @@ } -/* Insert or update 2G or 3G authentication tokens in the database. +/** Insert or update 2G or 3G authentication tokens in the database. * If aud->type is OSMO_AUTH_TYPE_GSM, the auc_2g table entry for the * subscriber will be added or modified; if aud->algo is OSMO_AUTH_ALG_NONE, * however, the auc_2g entry for the subscriber is deleted. If aud->type is * OSMO_AUTH_TYPE_UMTS, the auc_3g table is updated; again, if aud->algo is * OSMO_AUTH_ALG_NONE, the auc_3g entry is deleted. - * Returns 0 if successful, -EINVAL for unknown aud->type, -ENOENT for unknown - * subscr_id, -EIO for SQL errors. + * \param[in,out] dbc database context. + * \param[in] subscr_id DB ID of the subscriber. + * \param[in] aud Pointer to new auth data (in ASCII string form). + * \returns 0 on success, -EINVAL for invalid aud, -ENOENT for unknown + * subscr_id, -EIO for database errors. */ int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id, const struct sub_auth_data_str *aud) @@ -417,6 +441,13 @@ return ret; } +/*! Retrieve subscriber data from the HLR database. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits. + * \param[out] subscr place retrieved data in this struct. + * \returns 0 on success, -ENOENT if no such subscriber was found, -EIO on + * database error. + */ int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr) { @@ -434,6 +465,13 @@ return rc; } +/*! Retrieve subscriber data from the HLR database. + * \param[in,out] dbc database context. + * \param[in] msisdn ASCII string of MSISDN digits. + * \param[out] subscr place retrieved data in this struct. + * \returns 0 on success, -ENOENT if no such subscriber was found, -EIO on + * database error. + */ int db_subscr_get_by_msisdn(struct db_context *dbc, const char *msisdn, struct hlr_subscriber *subscr) { @@ -451,6 +489,13 @@ return rc; } +/*! Retrieve subscriber data from the HLR database. + * \param[in,out] dbc database context. + * \param[in] id ID of the subscriber in the HLR db. + * \param[out] subscr place retrieved data in this struct. + * \returns 0 on success, -ENOENT if no such subscriber was found, -EIO on + * database error. + */ int db_subscr_get_by_id(struct db_context *dbc, int64_t id, struct hlr_subscriber *subscr) { @@ -468,12 +513,14 @@ return rc; } -/* Enable or disable PS or CS for a subscriber. - * For the subscriber with the given imsi, set nam_ps (when is_ps == true) or - * nam_cs (when is_ps == false) to nam_val in the database. - * Returns 0 on success, -ENOENT when the given IMSI does not exist, -EINVAL if - * the SQL statement could not be composed, -ENOEXEC if running the SQL - * statement failed, -EIO if the amount of rows modified is unexpected. +/*! You should use hlr_subscr_nam() instead; enable or disable PS or CS for a + * subscriber without notifying GSUP clients. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits. + * \param[in] nam_val True to enable CS/PS, false to disable. + * \param[in] is_ps when true, set nam_ps, else set nam_cs. + * \returns 0 on success, -ENOENT when the given IMSI does not exist, -EIO on + * database errors. */ int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps) { @@ -522,6 +569,14 @@ return ret; } +/*! Record a Location Updating in the database. + * \param[in,out] dbc database context. + * \param[in] subscr_id ID of the subscriber in the HLR db. + * \param[in] vlr_or_sgsn_number ASCII string of identifier digits. + * \param[in] is_ps when true, set sgsn_number, else set vlr_number. + * \returns 0 on success, -ENOENT when the given subscriber does not exist, + * -EIO on database errors. + */ int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, const char *vlr_or_sgsn_number, bool is_ps) { @@ -565,6 +620,14 @@ return ret; } +/*! Set the ms_purged_cs or ms_purged_ps values in the database. + * \param[in,out] dbc database context. + * \param[in] by_imsi ASCII string of IMSI digits. + * \param[in] purge_val true to purge, false to un-purge. + * \param[in] is_ps when true, set ms_purged_ps, else set ms_purged_cs. + * \returns 0 on success, -ENOENT when the given IMSI does not exist, -EIO on + * database errors. + */ int db_subscr_purge(struct db_context *dbc, const char *by_imsi, bool purge_val, bool is_ps) { @@ -614,10 +677,10 @@ } /*! Update nam_cs/nam_ps in the db and trigger notifications to GSUP clients. - * \param hlr Global hlr context. - * \param subscr Subscriber from a fresh db_subscr_get_by_*() call. - * \param nam_val True to enable CS/PS, false to disable. - * \param is_ps True to enable/disable PS, false for CS. + * \param[in,out] hlr Global hlr context. + * \param[in] subscr Subscriber from a fresh db_subscr_get_by_*() call. + * \param[in] nam_val True to enable CS/PS, false to disable. + * \param[in] is_ps True to enable/disable PS, false for CS. * \returns 0 on success, ENOEXEC if there is no need to change, a negative * value on error. */ -- To view, visit https://gerrit.osmocom.org/4415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I854fafd8e56bd0b8394f8ed79d023c11c2fdbdca Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 25 17:21:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 25 Oct 2017 17:21:44 +0000 Subject: [PATCH] osmo-hlr[master]: db api: fix/add API docs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4415 to look at the new patch set (#2). db api: fix/add API docs Change-Id: I854fafd8e56bd0b8394f8ed79d023c11c2fdbdca --- M src/db_hlr.c 1 file changed, 76 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/4415/2 diff --git a/src/db_hlr.c b/src/db_hlr.c index e8db7d2..ef01428 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -43,6 +43,11 @@ x[sizeof(x)-1] = '\0'; \ } while (0) +/*! Add new subscriber record to the HLR database. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits, is validated. + * \returns 0 on success, -EINVAL on invalid IMSI, -EIO on database error. + */ int db_subscr_create(struct db_context *dbc, const char *imsi) { sqlite3_stmt *stmt; @@ -71,6 +76,15 @@ return 0; } +/*! Completely delete a subscriber record from the HLR database. + * Also remove authentication data. + * Future todo: also drop from all other database tables, which aren't used yet + * at the time of writing this. + * \param[in,out] dbc database context. + * \param[in] subscr_id ID of the subscriber in the HLR db. + * \returns if the subscriber was found and removed, -EIO on database error, + * -ENOENT if no such subscriber data exists. + */ int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id) { int rc; @@ -127,6 +141,13 @@ return ret; } +/*! Set a subscriber's MSISDN in the HLR database. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits. + * \param[in] msisdn ASCII string of MSISDN digits. + * \returns 0 on success, -EINVAL in case of invalid MSISDN string, -EIO on + * database failure, -ENOENT if no such subscriber exists. + */ int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, const char *msisdn) { @@ -175,14 +196,17 @@ } -/* Insert or update 2G or 3G authentication tokens in the database. +/*! Insert or update 2G or 3G authentication tokens in the database. * If aud->type is OSMO_AUTH_TYPE_GSM, the auc_2g table entry for the * subscriber will be added or modified; if aud->algo is OSMO_AUTH_ALG_NONE, * however, the auc_2g entry for the subscriber is deleted. If aud->type is * OSMO_AUTH_TYPE_UMTS, the auc_3g table is updated; again, if aud->algo is * OSMO_AUTH_ALG_NONE, the auc_3g entry is deleted. - * Returns 0 if successful, -EINVAL for unknown aud->type, -ENOENT for unknown - * subscr_id, -EIO for SQL errors. + * \param[in,out] dbc database context. + * \param[in] subscr_id DB ID of the subscriber. + * \param[in] aud Pointer to new auth data (in ASCII string form). + * \returns 0 on success, -EINVAL for invalid aud, -ENOENT for unknown + * subscr_id, -EIO for database errors. */ int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id, const struct sub_auth_data_str *aud) @@ -417,6 +441,13 @@ return ret; } +/*! Retrieve subscriber data from the HLR database. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits. + * \param[out] subscr place retrieved data in this struct. + * \returns 0 on success, -ENOENT if no such subscriber was found, -EIO on + * database error. + */ int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr) { @@ -434,6 +465,13 @@ return rc; } +/*! Retrieve subscriber data from the HLR database. + * \param[in,out] dbc database context. + * \param[in] msisdn ASCII string of MSISDN digits. + * \param[out] subscr place retrieved data in this struct. + * \returns 0 on success, -ENOENT if no such subscriber was found, -EIO on + * database error. + */ int db_subscr_get_by_msisdn(struct db_context *dbc, const char *msisdn, struct hlr_subscriber *subscr) { @@ -451,6 +489,13 @@ return rc; } +/*! Retrieve subscriber data from the HLR database. + * \param[in,out] dbc database context. + * \param[in] id ID of the subscriber in the HLR db. + * \param[out] subscr place retrieved data in this struct. + * \returns 0 on success, -ENOENT if no such subscriber was found, -EIO on + * database error. + */ int db_subscr_get_by_id(struct db_context *dbc, int64_t id, struct hlr_subscriber *subscr) { @@ -468,12 +513,14 @@ return rc; } -/* Enable or disable PS or CS for a subscriber. - * For the subscriber with the given imsi, set nam_ps (when is_ps == true) or - * nam_cs (when is_ps == false) to nam_val in the database. - * Returns 0 on success, -ENOENT when the given IMSI does not exist, -EINVAL if - * the SQL statement could not be composed, -ENOEXEC if running the SQL - * statement failed, -EIO if the amount of rows modified is unexpected. +/*! You should use hlr_subscr_nam() instead; enable or disable PS or CS for a + * subscriber without notifying GSUP clients. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits. + * \param[in] nam_val True to enable CS/PS, false to disable. + * \param[in] is_ps when true, set nam_ps, else set nam_cs. + * \returns 0 on success, -ENOENT when the given IMSI does not exist, -EIO on + * database errors. */ int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps) { @@ -522,6 +569,14 @@ return ret; } +/*! Record a Location Updating in the database. + * \param[in,out] dbc database context. + * \param[in] subscr_id ID of the subscriber in the HLR db. + * \param[in] vlr_or_sgsn_number ASCII string of identifier digits. + * \param[in] is_ps when true, set sgsn_number, else set vlr_number. + * \returns 0 on success, -ENOENT when the given subscriber does not exist, + * -EIO on database errors. + */ int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, const char *vlr_or_sgsn_number, bool is_ps) { @@ -565,6 +620,14 @@ return ret; } +/*! Set the ms_purged_cs or ms_purged_ps values in the database. + * \param[in,out] dbc database context. + * \param[in] by_imsi ASCII string of IMSI digits. + * \param[in] purge_val true to purge, false to un-purge. + * \param[in] is_ps when true, set ms_purged_ps, else set ms_purged_cs. + * \returns 0 on success, -ENOENT when the given IMSI does not exist, -EIO on + * database errors. + */ int db_subscr_purge(struct db_context *dbc, const char *by_imsi, bool purge_val, bool is_ps) { @@ -614,10 +677,10 @@ } /*! Update nam_cs/nam_ps in the db and trigger notifications to GSUP clients. - * \param hlr Global hlr context. - * \param subscr Subscriber from a fresh db_subscr_get_by_*() call. - * \param nam_val True to enable CS/PS, false to disable. - * \param is_ps True to enable/disable PS, false for CS. + * \param[in,out] hlr Global hlr context. + * \param[in] subscr Subscriber from a fresh db_subscr_get_by_*() call. + * \param[in] nam_val True to enable CS/PS, false to disable. + * \param[in] is_ps True to enable/disable PS, false for CS. * \returns 0 on success, ENOEXEC if there is no need to change, a negative * value on error. */ -- To view, visit https://gerrit.osmocom.org/4415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I854fafd8e56bd0b8394f8ed79d023c11c2fdbdca Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 17:22:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 25 Oct 2017 17:22:10 +0000 Subject: osmo-hlr[master]: db api: fix/add API docs In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 let me just apply this without causing review cycles. -- To view, visit https://gerrit.osmocom.org/4415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I854fafd8e56bd0b8394f8ed79d023c11c2fdbdca Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 17:22:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 25 Oct 2017 17:22:54 +0000 Subject: [MERGED] osmo-hlr[master]: db api: fix/add API docs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: db api: fix/add API docs ...................................................................... db api: fix/add API docs Change-Id: I854fafd8e56bd0b8394f8ed79d023c11c2fdbdca --- M src/db_hlr.c 1 file changed, 76 insertions(+), 13 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db_hlr.c b/src/db_hlr.c index e8db7d2..ef01428 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -43,6 +43,11 @@ x[sizeof(x)-1] = '\0'; \ } while (0) +/*! Add new subscriber record to the HLR database. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits, is validated. + * \returns 0 on success, -EINVAL on invalid IMSI, -EIO on database error. + */ int db_subscr_create(struct db_context *dbc, const char *imsi) { sqlite3_stmt *stmt; @@ -71,6 +76,15 @@ return 0; } +/*! Completely delete a subscriber record from the HLR database. + * Also remove authentication data. + * Future todo: also drop from all other database tables, which aren't used yet + * at the time of writing this. + * \param[in,out] dbc database context. + * \param[in] subscr_id ID of the subscriber in the HLR db. + * \returns if the subscriber was found and removed, -EIO on database error, + * -ENOENT if no such subscriber data exists. + */ int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id) { int rc; @@ -127,6 +141,13 @@ return ret; } +/*! Set a subscriber's MSISDN in the HLR database. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits. + * \param[in] msisdn ASCII string of MSISDN digits. + * \returns 0 on success, -EINVAL in case of invalid MSISDN string, -EIO on + * database failure, -ENOENT if no such subscriber exists. + */ int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, const char *msisdn) { @@ -175,14 +196,17 @@ } -/* Insert or update 2G or 3G authentication tokens in the database. +/*! Insert or update 2G or 3G authentication tokens in the database. * If aud->type is OSMO_AUTH_TYPE_GSM, the auc_2g table entry for the * subscriber will be added or modified; if aud->algo is OSMO_AUTH_ALG_NONE, * however, the auc_2g entry for the subscriber is deleted. If aud->type is * OSMO_AUTH_TYPE_UMTS, the auc_3g table is updated; again, if aud->algo is * OSMO_AUTH_ALG_NONE, the auc_3g entry is deleted. - * Returns 0 if successful, -EINVAL for unknown aud->type, -ENOENT for unknown - * subscr_id, -EIO for SQL errors. + * \param[in,out] dbc database context. + * \param[in] subscr_id DB ID of the subscriber. + * \param[in] aud Pointer to new auth data (in ASCII string form). + * \returns 0 on success, -EINVAL for invalid aud, -ENOENT for unknown + * subscr_id, -EIO for database errors. */ int db_subscr_update_aud_by_id(struct db_context *dbc, int64_t subscr_id, const struct sub_auth_data_str *aud) @@ -417,6 +441,13 @@ return ret; } +/*! Retrieve subscriber data from the HLR database. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits. + * \param[out] subscr place retrieved data in this struct. + * \returns 0 on success, -ENOENT if no such subscriber was found, -EIO on + * database error. + */ int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr) { @@ -434,6 +465,13 @@ return rc; } +/*! Retrieve subscriber data from the HLR database. + * \param[in,out] dbc database context. + * \param[in] msisdn ASCII string of MSISDN digits. + * \param[out] subscr place retrieved data in this struct. + * \returns 0 on success, -ENOENT if no such subscriber was found, -EIO on + * database error. + */ int db_subscr_get_by_msisdn(struct db_context *dbc, const char *msisdn, struct hlr_subscriber *subscr) { @@ -451,6 +489,13 @@ return rc; } +/*! Retrieve subscriber data from the HLR database. + * \param[in,out] dbc database context. + * \param[in] id ID of the subscriber in the HLR db. + * \param[out] subscr place retrieved data in this struct. + * \returns 0 on success, -ENOENT if no such subscriber was found, -EIO on + * database error. + */ int db_subscr_get_by_id(struct db_context *dbc, int64_t id, struct hlr_subscriber *subscr) { @@ -468,12 +513,14 @@ return rc; } -/* Enable or disable PS or CS for a subscriber. - * For the subscriber with the given imsi, set nam_ps (when is_ps == true) or - * nam_cs (when is_ps == false) to nam_val in the database. - * Returns 0 on success, -ENOENT when the given IMSI does not exist, -EINVAL if - * the SQL statement could not be composed, -ENOEXEC if running the SQL - * statement failed, -EIO if the amount of rows modified is unexpected. +/*! You should use hlr_subscr_nam() instead; enable or disable PS or CS for a + * subscriber without notifying GSUP clients. + * \param[in,out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits. + * \param[in] nam_val True to enable CS/PS, false to disable. + * \param[in] is_ps when true, set nam_ps, else set nam_cs. + * \returns 0 on success, -ENOENT when the given IMSI does not exist, -EIO on + * database errors. */ int db_subscr_nam(struct db_context *dbc, const char *imsi, bool nam_val, bool is_ps) { @@ -522,6 +569,14 @@ return ret; } +/*! Record a Location Updating in the database. + * \param[in,out] dbc database context. + * \param[in] subscr_id ID of the subscriber in the HLR db. + * \param[in] vlr_or_sgsn_number ASCII string of identifier digits. + * \param[in] is_ps when true, set sgsn_number, else set vlr_number. + * \returns 0 on success, -ENOENT when the given subscriber does not exist, + * -EIO on database errors. + */ int db_subscr_lu(struct db_context *dbc, int64_t subscr_id, const char *vlr_or_sgsn_number, bool is_ps) { @@ -565,6 +620,14 @@ return ret; } +/*! Set the ms_purged_cs or ms_purged_ps values in the database. + * \param[in,out] dbc database context. + * \param[in] by_imsi ASCII string of IMSI digits. + * \param[in] purge_val true to purge, false to un-purge. + * \param[in] is_ps when true, set ms_purged_ps, else set ms_purged_cs. + * \returns 0 on success, -ENOENT when the given IMSI does not exist, -EIO on + * database errors. + */ int db_subscr_purge(struct db_context *dbc, const char *by_imsi, bool purge_val, bool is_ps) { @@ -614,10 +677,10 @@ } /*! Update nam_cs/nam_ps in the db and trigger notifications to GSUP clients. - * \param hlr Global hlr context. - * \param subscr Subscriber from a fresh db_subscr_get_by_*() call. - * \param nam_val True to enable CS/PS, false to disable. - * \param is_ps True to enable/disable PS, false for CS. + * \param[in,out] hlr Global hlr context. + * \param[in] subscr Subscriber from a fresh db_subscr_get_by_*() call. + * \param[in] nam_val True to enable CS/PS, false to disable. + * \param[in] is_ps True to enable/disable PS, false for CS. * \returns 0 on success, ENOEXEC if there is no need to change, a negative * value on error. */ -- To view, visit https://gerrit.osmocom.org/4415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I854fafd8e56bd0b8394f8ed79d023c11c2fdbdca Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Oct 25 17:27:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 25 Oct 2017 17:27:03 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 6: see https://gerrit.osmocom.org/#/c/4415/ -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 6 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 18:55:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 18:55:49 +0000 Subject: osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 8: (4 comments) https://gerrit.osmocom.org/#/c/4411/8/src/bts.cpp File src/bts.cpp: Line 54 I'm not really sure what this is actually all about, but was the removal of the comment intentional? https://gerrit.osmocom.org/#/c/4411/8/src/pcu_ctr.c File src/pcu_ctr.c: Line 22: #include "pcu_ctr.h" why not have the static const array here? https://gerrit.osmocom.org/#/c/4411/8/src/pcu_ctr.h File src/pcu_ctr.h: Line 32: static const struct rate_ctr_desc bts_ctr_description[] = { why do we have a 'static const' array in a header file? any file including this header file would get another copy of that array, is that what you intend? https://gerrit.osmocom.org/#/c/4411/8/src/pcu_main.cpp File src/pcu_main.cpp: Line 33: #include "pcu_ctr.h" now we have the static const array also here in pcu_main.o, not just in pcu_ctr.o? why would pcu_main.o need the array definition? all it needs is pcu_ctr_init(), rihgt? -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 25 18:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 18:59:21 +0000 Subject: osmo-pcu[master]: Move all rate counter related code together In-Reply-To: References: Message-ID: Patch Set 8: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4413/8/src/bts.cpp File src/bts.cpp: Line 165: rlc_late_block(bts_data()->ctrs); I'm sorry, I really think it's ugly to pass around a counter array to various functions that don't take any other argument. Either the counters can be resolved from some larger struct/object of which the counters are a member, but which makes actual sense to the related function, or the respective function like rlc_late_block() would have to be a method of an object which has access to the counters? -- To view, visit https://gerrit.osmocom.org/4413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Oct 25 19:03:01 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 25 Oct 2017 19:03:01 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 5: > deferring to neels on this one. as the patch has been sitting in > the queue for quite some time: Ping? I've created https://osmocom.org/issues/2595 It's not a simple as it looks, so I suggest this patch be abandoned until the solution is decided upon. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 19:19:00 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Wed, 25 Oct 2017 19:19:00 +0000 Subject: libosmocore[master]: Expand bitvec_write_field() In-Reply-To: References: Message-ID: Patch Set 8: > > I am applying new bitvec_write_field_ext function for encoding LH > bits of IA Rest OCtets of EDGE PKT DL IMM ASS in PCU. > > Could you please share your patch for OsmoPCU? Let's see if we can > use L/H directly as a parameter in separate function instead of > extending this one. Or maybe get rid of the function altogether and > manually update wp. Basically, I replaced encoding of "HH", "H" using bitvec_write_field by bitvec_write_field_ext (with use_lh = true) in write_ia_rest_downlink and write_ia_rest_uplink in PCU project. For sure, I will submit the patch to PCU project after finish my current task. -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From admin at opensuse.org Wed Oct 25 19:56:58 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 19:56:58 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f0ec8d4e892_718e50ef7430476d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 143s] To: [ 143s] Subject: [osmo-pcu 0.3.0.20171025] testsuite: 2 3 5 6 7 8 11 failed [ 143s] [ 143s] You may investigate any problem if you feel able to do so, in which [ 143s] case the test suite provides a good starting point. Its output may [ 143s] be found below `tests/testsuite.dir'. [ 143s] [ 143s] Makefile:1221: recipe for target 'check-local' failed [ 143s] make[3]: *** [check-local] Error 1 [ 143s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 143s] Makefile:1055: recipe for target 'check-am' failed [ 143s] make[2]: *** [check-am] Error 2 [ 143s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 143s] Makefile:460: recipe for target 'check-recursive' failed [ 143s] make[1]: *** [check-recursive] Error 1 [ 143s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 143s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 143s] debian/rules:12: recipe for target 'build' failed [ 143s] make: *** [build] Error 2 [ 143s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 143s] [ 143s] lamb63 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 19:56:37 UTC 2017. [ 143s] [ 143s] ### VM INTERACTION START ### [ 146s] [ 139.085405] reboot: Power down [ 146s] ### VM INTERACTION END ### [ 146s] [ 146s] lamb63 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 19:56:41 UTC 2017. [ 146s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 19:57:32 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 19:57:32 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f0ecc6c381d_718e50ef743049b2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 154s] To: [ 154s] Subject: [osmo-pcu 0.3.0.20171025] testsuite: 2 3 5 6 7 8 11 failed [ 154s] [ 154s] You may investigate any problem if you feel able to do so, in which [ 154s] case the test suite provides a good starting point. Its output may [ 154s] be found below `tests/testsuite.dir'. [ 154s] [ 154s] Makefile:1221: recipe for target 'check-local' failed [ 154s] make[3]: *** [check-local] Error 1 [ 154s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 154s] Makefile:1055: recipe for target 'check-am' failed [ 154s] make[2]: *** [check-am] Error 2 [ 154s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 154s] Makefile:460: recipe for target 'check-recursive' failed [ 154s] make[1]: *** [check-recursive] Error 1 [ 154s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 154s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 154s] debian/rules:12: recipe for target 'build' failed [ 154s] make: *** [build] Error 2 [ 154s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 154s] [ 154s] lamb56 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 19:57:22 UTC 2017. [ 154s] [ 154s] ### VM INTERACTION START ### [ 157s] [ 149.701347] reboot: Power down [ 157s] ### VM INTERACTION END ### [ 157s] [ 157s] lamb56 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 19:57:25 UTC 2017. [ 157s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 19:57:32 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 19:57:32 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f0ecc72c082_718e50ef74305036@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 149s] To: [ 149s] Subject: [osmo-pcu 0.3.0.20171025] testsuite: 2 3 5 6 7 8 11 failed [ 149s] [ 149s] You may investigate any problem if you feel able to do so, in which [ 149s] case the test suite provides a good starting point. Its output may [ 149s] be found below `tests/testsuite.dir'. [ 149s] [ 149s] Makefile:1221: recipe for target 'check-local' failed [ 149s] make[3]: *** [check-local] Error 1 [ 149s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 149s] Makefile:1055: recipe for target 'check-am' failed [ 149s] make[2]: *** [check-am] Error 2 [ 149s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 149s] Makefile:460: recipe for target 'check-recursive' failed [ 149s] make[1]: *** [check-recursive] Error 1 [ 149s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 149s] dh_auto_test: make -j1 check returned exit code 2 [ 149s] debian/rules:12: recipe for target 'build' failed [ 149s] make: *** [build] Error 2 [ 149s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 149s] [ 149s] lamb70 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 19:57:23 UTC 2017. [ 149s] [ 149s] ### VM INTERACTION START ### [ 152s] [ 145.038853] reboot: Power down [ 152s] ### VM INTERACTION END ### [ 152s] [ 152s] lamb70 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 19:57:27 UTC 2017. [ 152s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 19:58:06 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 19:58:06 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f0ece761828_718e50ef74305273@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 150s] To: [ 150s] Subject: [osmo-pcu 0.3.0.20171025] testsuite: 2 3 5 6 7 8 11 failed [ 150s] [ 150s] You may investigate any problem if you feel able to do so, in which [ 150s] case the test suite provides a good starting point. Its output may [ 150s] be found below `tests/testsuite.dir'. [ 150s] [ 150s] Makefile:1221: recipe for target 'check-local' failed [ 150s] make[3]: *** [check-local] Error 1 [ 150s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 150s] Makefile:1055: recipe for target 'check-am' failed [ 150s] make[2]: *** [check-am] Error 2 [ 150s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 150s] Makefile:460: recipe for target 'check-recursive' failed [ 150s] make[1]: *** [check-recursive] Error 1 [ 150s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 150s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 150s] debian/rules:12: recipe for target 'build' failed [ 150s] make: *** [build] Error 2 [ 150s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 150s] [ 150s] lamb67 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 19:57:54 UTC 2017. [ 150s] [ 150s] ### VM INTERACTION START ### [ 153s] [ 145.267840] reboot: Power down [ 153s] ### VM INTERACTION END ### [ 153s] [ 153s] lamb67 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 19:57:57 UTC 2017. [ 153s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 19:58:23 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 19:58:23 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f0ece8c1051_718e50ef743054b8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 150s] To: [ 150s] Subject: [osmo-pcu 0.3.0.20171025] testsuite: 2 3 5 6 7 8 11 failed [ 150s] [ 150s] You may investigate any problem if you feel able to do so, in which [ 150s] case the test suite provides a good starting point. Its output may [ 150s] be found below `tests/testsuite.dir'. [ 150s] [ 150s] Makefile:1221: recipe for target 'check-local' failed [ 150s] make[3]: *** [check-local] Error 1 [ 150s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 150s] Makefile:1055: recipe for target 'check-am' failed [ 150s] make[2]: *** [check-am] Error 2 [ 150s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 150s] Makefile:460: recipe for target 'check-recursive' failed [ 150s] make[1]: *** [check-recursive] Error 1 [ 150s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 150s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 150s] debian/rules:12: recipe for target 'build' failed [ 150s] make: *** [build] Error 2 [ 150s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 151s] [ 151s] lamb05 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 19:58:06 UTC 2017. [ 151s] [ 151s] ### VM INTERACTION START ### [ 154s] [ 146.571811] reboot: Power down [ 154s] ### VM INTERACTION END ### [ 154s] [ 154s] lamb05 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 19:58:09 UTC 2017. [ 154s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:00:22 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:00:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f0ed5fcf166_718e50ef7430585c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 160s] To: [ 160s] Subject: [osmo-pcu 0.3.0.20171025] testsuite: 2 3 5 6 7 8 11 failed [ 160s] [ 160s] You may investigate any problem if you feel able to do so, in which [ 160s] case the test suite provides a good starting point. Its output may [ 160s] be found below `tests/testsuite.dir'. [ 160s] [ 160s] Makefile:1221: recipe for target 'check-local' failed [ 160s] make[3]: *** [check-local] Error 1 [ 160s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 160s] Makefile:1055: recipe for target 'check-am' failed [ 160s] make[2]: *** [check-am] Error 2 [ 160s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 160s] Makefile:460: recipe for target 'check-recursive' failed [ 160s] make[1]: *** [check-recursive] Error 1 [ 160s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 160s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 160s] debian/rules:12: recipe for target 'build' failed [ 160s] make: *** [build] Error 2 [ 160s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 160s] [ 160s] lamb05 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 20:00:07 UTC 2017. [ 160s] [ 160s] ### VM INTERACTION START ### [ 163s] [ 155.917171] reboot: Power down [ 163s] ### VM INTERACTION END ### [ 163s] [ 163s] lamb05 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 20:00:10 UTC 2017. [ 163s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:00:39 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:00:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f0ed7d568cd_718e50ef74306313@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 177s] Subject: [osmo-pcu 0.3.0.20171025] testsuite: 2 3 5 6 7 8 11 failed [ 177s] [ 177s] You may investigate any problem if you feel able to do so, in which [ 177s] case the test suite provides a good starting point. Its output may [ 177s] be found below `tests/testsuite.dir'. [ 177s] [ 177s] Makefile:1208: recipe for target 'check-local' failed [ 177s] make[3]: *** [check-local] Error 1 [ 177s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 177s] Makefile:1044: recipe for target 'check-am' failed [ 177s] make[2]: *** [check-am] Error 2 [ 177s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 177s] Makefile:448: recipe for target 'check-recursive' failed [ 177s] make[1]: *** [check-recursive] Error 1 [ 177s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 177s] dh_auto_test: make -j1 check returned exit code 2 [ 177s] debian/rules:12: recipe for target 'build' failed [ 177s] make: *** [build] Error 2 [ 177s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 177s] [ 177s] lamb07 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 20:00:37 UTC 2017. [ 177s] [ 177s] ### VM INTERACTION START ### [ 178s] Powering off. [ 178s] [ 170.236575] reboot: Power down [ 178s] ### VM INTERACTION END ### [ 178s] [ 178s] lamb07 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 20:00:38 UTC 2017. [ 178s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:00:58 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:00:58 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f0ed7db0b03_718e50ef7430646b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 161s] To: [ 161s] Subject: [osmo-pcu 0.3.0.20171025] testsuite: 2 3 5 6 7 8 11 failed [ 161s] [ 161s] You may investigate any problem if you feel able to do so, in which [ 161s] case the test suite provides a good starting point. Its output may [ 161s] be found below `tests/testsuite.dir'. [ 161s] [ 161s] Makefile:1221: recipe for target 'check-local' failed [ 161s] make[3]: *** [check-local] Error 1 [ 161s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 161s] Makefile:1055: recipe for target 'check-am' failed [ 161s] make[2]: *** [check-am] Error 2 [ 161s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 161s] Makefile:460: recipe for target 'check-recursive' failed [ 161s] make[1]: *** [check-recursive] Error 1 [ 161s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 161s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 161s] debian/rules:12: recipe for target 'build' failed [ 161s] make: *** [build] Error 2 [ 161s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 161s] [ 161s] lamb27 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 20:00:37 UTC 2017. [ 161s] [ 161s] ### VM INTERACTION START ### [ 164s] [ 156.717959] sysrq: SysRq : [ 156.732987] reboot: Power down [ 164s] ### VM INTERACTION END ### [ 164s] [ 164s] lamb27 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 20:00:40 UTC 2017. [ 164s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:00:58 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:00:58 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f0ed7f191bc_718e50ef7430667d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 289s] To: [ 289s] Subject: [osmo-pcu 0.3.0.20171025] testsuite: 2 3 5 6 7 8 11 failed [ 289s] [ 289s] You may investigate any problem if you feel able to do so, in which [ 289s] case the test suite provides a good starting point. Its output may [ 289s] be found below `tests/testsuite.dir'. [ 289s] [ 289s] Makefile:1221: recipe for target 'check-local' failed [ 289s] make[3]: *** [check-local] Error 1 [ 289s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 289s] Makefile:1055: recipe for target 'check-am' failed [ 289s] make[2]: *** [check-am] Error 2 [ 289s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 289s] Makefile:460: recipe for target 'check-recursive' failed [ 289s] make[1]: *** [check-recursive] Error 1 [ 289s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 289s] dh_auto_test: make -j1 check returned exit code 2 [ 289s] debian/rules:12: recipe for target 'build' failed [ 289s] make: *** [build] Error 2 [ 289s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 289s] [ 289s] lamb21 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 20:00:48 UTC 2017. [ 289s] [ 289s] ### VM INTERACTION START ### [ 292s] [ 279.001288] reboot: Power down [ 292s] ### VM INTERACTION END ### [ 292s] [ 292s] lamb21 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 20:00:52 UTC 2017. [ 292s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:02:06 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:02:06 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f0edd6241e9_718e50ef743069c4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 229s] Subject: [osmo-pcu 0.3.0.20171025] testsuite: 2 3 5 6 7 8 11 failed [ 229s] [ 229s] You may investigate any problem if you feel able to do so, in which [ 229s] case the test suite provides a good starting point. Its output may [ 229s] be found below `tests/testsuite.dir'. [ 229s] [ 229s] Makefile:1208: recipe for target 'check-local' failed [ 229s] make[3]: *** [check-local] Error 1 [ 229s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 229s] Makefile:1044: recipe for target 'check-am' failed [ 229s] make[2]: *** [check-am] Error 2 [ 229s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 229s] Makefile:448: recipe for target 'check-recursive' failed [ 229s] make[1]: *** [check-recursive] Error 1 [ 229s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 229s] dh_auto_test: make -j1 check returned exit code 2 [ 229s] debian/rules:12: recipe for target 'build' failed [ 229s] make: *** [build] Error 2 [ 229s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 229s] [ 229s] cloud109 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 20:01:59 UTC 2017. [ 229s] [ 229s] ### VM INTERACTION START ### [ 230s] Powering off. [ 230s] [ 213.147456] reboot: Power down [ 232s] ### VM INTERACTION END ### [ 232s] [ 232s] cloud109 failed "build osmo-pcu_0.3.0.20171025.dsc" at Wed Oct 25 20:02:02 UTC 2017. [ 232s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:06:05 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:06:05 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f0eec77682a_718e50ef74307234@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 248s] [ 248s] Makefile:758: recipe for target 'check-local' failed [ 248s] make[5]: *** [check-local] Error 1 [ 248s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 248s] Makefile:608: recipe for target 'check-am' failed [ 248s] make[4]: *** [check-am] Error 2 [ 248s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 248s] Makefile:460: recipe for target 'check-recursive' failed [ 248s] make[3]: *** [check-recursive] Error 1 [ 248s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 248s] Makefile:527: recipe for target 'check-recursive' failed [ 248s] make[2]: *** [check-recursive] Error 1 [ 248s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 248s] Makefile:818: recipe for target 'check' failed [ 248s] make[1]: *** [check] Error 2 [ 248s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 248s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 248s] debian/rules:13: recipe for target 'build' failed [ 248s] make: *** [build] Error 2 [ 248s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 249s] [ 249s] cloud116 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:05:58 UTC 2017. [ 249s] [ 249s] ### VM INTERACTION START ### [ 252s] [ 227.585801] reboot: Power down [ 253s] ### VM INTERACTION END ### [ 253s] [ 253s] cloud116 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:06:03 UTC 2017. [ 253s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:06:57 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:06:57 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f0eee495b69_718e50ef74307343@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 234s] You may investigate any problem if you feel able to do so, in which [ 234s] case the test suite provides a good starting point. Its output may [ 234s] be found below `tests/testsuite.dir'. [ 234s] [ 234s] Makefile:758: recipe for target 'check-local' failed [ 234s] make[5]: *** [check-local] Error 1 [ 234s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 234s] Makefile:608: recipe for target 'check-am' failed [ 234s] make[4]: *** [check-am] Error 2 [ 234s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 234s] Makefile:460: recipe for target 'check-recursive' failed [ 234s] make[3]: *** [check-recursive] Error 1 [ 234s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 234s] Makefile:527: recipe for target 'check-recursive' failed [ 234s] make[2]: *** [check-recursive] Error 1 [ 234s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 234s] Makefile:818: recipe for target 'check' failed [ 234s] make[1]: *** [check] Error 2 [ 234s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 234s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 234s] debian/rules:13: recipe for target 'build' failed [ 234s] make: *** [build] Error 2 [ 234s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 234s] [ 234s] cloud113 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:06:38 UTC 2017. [ 234s] [ 234s] ### VM INTERACTION START ### [ 237s] [ 215.166726] reboot: Power down [ 238s] ### VM INTERACTION END ### -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:06:57 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:06:57 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f0eee59fb94_718e50ef74307559@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 193s] [ 193s] Makefile:758: recipe for target 'check-local' failed [ 193s] make[5]: *** [check-local] Error 1 [ 193s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 193s] Makefile:608: recipe for target 'check-am' failed [ 193s] make[4]: *** [check-am] Error 2 [ 193s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 193s] Makefile:460: recipe for target 'check-recursive' failed [ 193s] make[3]: *** [check-recursive] Error 1 [ 193s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 193s] Makefile:527: recipe for target 'check-recursive' failed [ 193s] make[2]: *** [check-recursive] Error 1 [ 193s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 193s] Makefile:818: recipe for target 'check' failed [ 193s] make[1]: *** [check] Error 2 [ 193s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 193s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 193s] debian/rules:13: recipe for target 'build' failed [ 193s] make: *** [build] Error 2 [ 193s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 193s] [ 193s] lamb24 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:06:47 UTC 2017. [ 193s] [ 193s] ### VM INTERACTION START ### [ 196s] [ 188.475745] reboot: Power down [ 196s] ### VM INTERACTION END ### [ 196s] [ 196s] lamb24 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:06:50 UTC 2017. [ 196s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:07:14 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:07:14 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f0ef005d1dd_718e50ef74307721@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 173s] [ 173s] Makefile:758: recipe for target 'check-local' failed [ 173s] make[5]: *** [check-local] Error 1 [ 173s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 173s] Makefile:608: recipe for target 'check-am' failed [ 173s] make[4]: *** [check-am] Error 2 [ 173s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 173s] Makefile:460: recipe for target 'check-recursive' failed [ 173s] make[3]: *** [check-recursive] Error 1 [ 173s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 173s] Makefile:527: recipe for target 'check-recursive' failed [ 173s] make[2]: *** [check-recursive] Error 1 [ 173s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 173s] Makefile:818: recipe for target 'check' failed [ 173s] make[1]: *** [check] Error 2 [ 173s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 173s] dh_auto_test: make -j1 check returned exit code 2 [ 173s] debian/rules:13: recipe for target 'build' failed [ 173s] make: *** [build] Error 2 [ 173s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 173s] [ 173s] lamb15 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:07:04 UTC 2017. [ 173s] [ 173s] ### VM INTERACTION START ### [ 176s] [ 169.640727] reboot: Power down [ 176s] ### VM INTERACTION END ### [ 176s] [ 176s] lamb15 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:07:07 UTC 2017. [ 176s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:08:39 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:08:39 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f0efd73319f_718e50ef743082da@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 177s] [ 177s] Makefile:758: recipe for target 'check-local' failed [ 177s] make[5]: *** [check-local] Error 1 [ 177s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 177s] Makefile:608: recipe for target 'check-am' failed [ 177s] make[4]: *** [check-am] Error 2 [ 177s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 177s] Makefile:460: recipe for target 'check-recursive' failed [ 177s] make[3]: *** [check-recursive] Error 1 [ 177s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 177s] Makefile:527: recipe for target 'check-recursive' failed [ 177s] make[2]: *** [check-recursive] Error 1 [ 177s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 177s] Makefile:818: recipe for target 'check' failed [ 177s] make[1]: *** [check] Error 2 [ 177s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 177s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 177s] debian/rules:13: recipe for target 'build' failed [ 177s] make: *** [build] Error 2 [ 177s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 177s] [ 177s] build85 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:08:29 UTC 2017. [ 177s] [ 177s] ### VM INTERACTION START ### [ 181s] [ 172.576295] reboot: Power down [ 181s] ### VM INTERACTION END ### [ 181s] [ 181s] build85 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:08:33 UTC 2017. [ 181s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:09:31 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:09:31 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f0efd999a8f_718e50ef743083cb@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 189s] [ 189s] Makefile:758: recipe for target 'check-local' failed [ 189s] make[5]: *** [check-local] Error 1 [ 189s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 189s] Makefile:608: recipe for target 'check-am' failed [ 189s] make[4]: *** [check-am] Error 2 [ 189s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 189s] Makefile:460: recipe for target 'check-recursive' failed [ 189s] make[3]: *** [check-recursive] Error 1 [ 189s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 189s] Makefile:527: recipe for target 'check-recursive' failed [ 189s] make[2]: *** [check-recursive] Error 1 [ 189s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 189s] Makefile:818: recipe for target 'check' failed [ 189s] make[1]: *** [check] Error 2 [ 189s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 189s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 189s] debian/rules:13: recipe for target 'build' failed [ 189s] make: *** [build] Error 2 [ 189s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 189s] [ 189s] lamb13 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:09:23 UTC 2017. [ 189s] [ 189s] ### VM INTERACTION START ### [ 192s] [ 184.312622] reboot: Power down [ 192s] ### VM INTERACTION END ### [ 192s] [ 192s] lamb13 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:09:27 UTC 2017. [ 192s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:09:31 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:09:31 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f0efdb275a0_718e50ef743085e1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 164s] [ 164s] Makefile:758: recipe for target 'check-local' failed [ 164s] make[5]: *** [check-local] Error 1 [ 164s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 164s] Makefile:608: recipe for target 'check-am' failed [ 164s] make[4]: *** [check-am] Error 2 [ 164s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 164s] Makefile:460: recipe for target 'check-recursive' failed [ 164s] make[3]: *** [check-recursive] Error 1 [ 164s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 164s] Makefile:527: recipe for target 'check-recursive' failed [ 164s] make[2]: *** [check-recursive] Error 1 [ 164s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 164s] Makefile:818: recipe for target 'check' failed [ 164s] make[1]: *** [check] Error 2 [ 164s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 164s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 164s] debian/rules:13: recipe for target 'build' failed [ 164s] make: *** [build] Error 2 [ 164s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 165s] [ 165s] build70 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:09:18 UTC 2017. [ 165s] [ 165s] ### VM INTERACTION START ### [ 168s] [ 159.653446] reboot: Power down [ 168s] ### VM INTERACTION END ### [ 168s] [ 168s] build70 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:09:22 UTC 2017. [ 168s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Oct 25 20:09:48 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 25 Oct 2017 20:09:48 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f0efddab24b_718e50ef743086ac@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_8.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 270s] Makefile:745: recipe for target 'check-local' failed [ 270s] make[5]: *** [check-local] Error 1 [ 270s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 270s] Makefile:597: recipe for target 'check-am' failed [ 270s] make[4]: *** [check-am] Error 2 [ 270s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 270s] Makefile:449: recipe for target 'check-recursive' failed [ 270s] make[3]: *** [check-recursive] Error 1 [ 270s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 270s] Makefile:516: recipe for target 'check-recursive' failed [ 270s] make[2]: *** [check-recursive] Error 1 [ 270s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 270s] Makefile:807: recipe for target 'check' failed [ 270s] make[1]: *** [check] Error 2 [ 270s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 270s] dh_auto_test: make -j1 check returned exit code 2 [ 270s] debian/rules:13: recipe for target 'build' failed [ 270s] make: *** [build] Error 2 [ 270s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 270s] [ 270s] build79 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:09:41 UTC 2017. [ 270s] [ 270s] ### VM INTERACTION START ### [ 271s] Powering off. [ 271s] [ 242.430095] reboot: Power down [ 272s] ### VM INTERACTION END ### [ 272s] [ 272s] build79 failed "build openbsc_0.15.1.20171025.dsc" at Wed Oct 25 20:09:43 UTC 2017. [ 272s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Wed Oct 25 20:22:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 20:22:03 +0000 Subject: [PATCH] openbsc[master]: Fix build after recent rate_ctr patches Message-ID: Review at https://gerrit.osmocom.org/4416 Fix build after recent rate_ctr patches It seems like recent changes expanded output of dump_rate_ctr_group(). Adjust output accordingly to fix the build. Back-port of Icc9a53d35be2b0793d7ed25e6fec5bf6c8f84d92 from osmo-sgsn.git Change-Id: I84558866b478abeb19855a771c9cb6483d04cca0 --- M openbsc/tests/gbproxy/gbproxy_test.ok 1 file changed, 248 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/16/4416/1 diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/openbsc/tests/gbproxy/gbproxy_test.ok index 737aec0..ff86b67 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.ok +++ b/openbsc/tests/gbproxy/gbproxy_test.ok @@ -38,6 +38,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Initialise BSS 1 --- @@ -96,7 +100,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 12 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Peers: @@ -170,8 +182,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 12 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -233,8 +257,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -284,8 +320,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -335,8 +383,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 13 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 67 + Bytes at NS Level (Out): 45 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -386,8 +446,20 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:4444 + Packets at NS Level ( In): 17 + Packets at NS Level (Out): 17 + Bytes at NS Level ( In): 82 + Bytes at NS Level (Out): 57 VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333 + Packets at NS Level ( In): 9 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 52 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -439,9 +511,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x00000000:0 + Packets at NS Level ( In): 10 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 64 + Bytes at NS Level (Out): 33 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -491,9 +575,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 14 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 79 + Bytes at NS Level (Out): 45 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 59 NS-VC Block count : 1 Peers: @@ -519,9 +615,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 15 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 101 + Bytes at NS Level (Out): 45 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 7 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 81 NS-VC Block count : 1 Peers: @@ -561,9 +669,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 16 + Packets at NS Level (Out): 14 + Bytes at NS Level ( In): 123 + Bytes at NS Level (Out): 54 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 7 + Packets at NS Level (Out): 8 + Bytes at NS Level ( In): 39 + Bytes at NS Level (Out): 103 NS-VC Block count : 1 Peers: @@ -603,9 +723,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 21 + Bytes at NS Level ( In): 85 + Bytes at NS Level (Out): 69 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 17 + Packets at NS Level (Out): 15 + Bytes at NS Level ( In): 145 + Bytes at NS Level (Out): 63 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 9 + Bytes at NS Level ( In): 48 + Bytes at NS Level (Out): 125 NS-VC Block count : 1 Peers: @@ -729,9 +861,21 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333 + Packets at NS Level ( In): 21 + Packets at NS Level (Out): 22 + Bytes at NS Level ( In): 107 + Bytes at NS Level (Out): 73 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 20 + Packets at NS Level (Out): 18 + Bytes at NS Level ( In): 157 + Bytes at NS Level (Out): 80 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 12 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 69 + Bytes at NS Level (Out): 159 NS-VC Block count : 1 Peers: @@ -846,6 +990,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Initialise BSS 1 --- @@ -890,7 +1038,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 15 + Bytes at NS Level (Out): 12 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Setup BVCI 1 --- @@ -1051,8 +1207,16 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 12 + Packets at NS Level (Out): 12 + Bytes at NS Level ( In): 82 + Bytes at NS Level (Out): 50 NS-VC changed NSEI count : 1 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 8 + Packets at NS Level (Out): 8 + Bytes at NS Level ( In): 38 + Bytes at NS Level (Out): 67 NS-VC Block count : 1 --- Setup BVCI 1 --- @@ -1263,10 +1427,22 @@ Current NS-VCIs: VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111 + Packets at NS Level ( In): 3 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 3 + Bytes at NS Level (Out): 12 NS-VC replaced other count: 1 VCI 0x1001, NSEI 0x2000, peer 0x00000000:0 + Packets at NS Level ( In): 18 + Packets at NS Level (Out): 16 + Bytes at NS Level ( In): 150 + Bytes at NS Level (Out): 76 NS-VC changed NSEI count : 1 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 13 + Packets at NS Level (Out): 13 + Bytes at NS Level ( In): 68 + Bytes at NS Level (Out): 123 NS-VC Block count : 1 --- Setup BVCI 1 --- @@ -1592,7 +1768,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -1879,6 +2063,10 @@ Current NS-VCIs: VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 15 NS-VC Block count : 1 --- Initialise BSS 1 --- @@ -1937,7 +2125,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 4 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 12 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 4 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 12 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Peers: @@ -2396,7 +2592,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -3116,7 +3320,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -3443,7 +3655,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -4299,9 +4519,21 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 6 + Bytes at NS Level ( In): 59 + Bytes at NS Level (Out): 30 VCI 0x0103, NSEI 0x0102, peer 0x15161718:32001 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 6 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 30 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -5490,7 +5722,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: @@ -7164,7 +7404,15 @@ Current NS-VCIs: VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 37 + Bytes at NS Level (Out): 21 VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + Packets at NS Level ( In): 5 + Packets at NS Level (Out): 5 + Bytes at NS Level ( In): 21 + Bytes at NS Level (Out): 37 NS-VC Block count : 1 Gbproxy global: -- To view, visit https://gerrit.osmocom.org/4416 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I84558866b478abeb19855a771c9cb6483d04cca0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 25 20:37:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 20:37:38 +0000 Subject: [PATCH] openbsc[master]: remove sgsn, gbproxy and gtphub from openbsc.git Message-ID: Review at https://gerrit.osmocom.org/4417 remove sgsn, gbproxy and gtphub from openbsc.git The GPRS related programs osmo-sgsn, osmo-gtphub and osmo-gbproxy have been split off into the separate osmo-sgsn repository, which can be found at git://git.osmocom.org/osmo-sgsn.git http://git.osmocom.org/osmo-sgsn/ This is technically unrelated but conceptually part of the larger NITB-split activities. I did a brief log of all changes in src/gprs and couldn't find any commits that we might have applied here but which are missing from osmo-sgsn.git. Change-Id: If60e28b23f5cfb2c4eb354951363a2bb63f3e0de --- M debian/control D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M openbsc/configure.ac M openbsc/src/Makefile.am D openbsc/src/gprs/.gitignore D openbsc/src/gprs/Makefile.am D openbsc/src/gprs/crc24.c D openbsc/src/gprs/gb_proxy.c D openbsc/src/gprs/gb_proxy_main.c D openbsc/src/gprs/gb_proxy_patch.c D openbsc/src/gprs/gb_proxy_peer.c D openbsc/src/gprs/gb_proxy_tlli.c D openbsc/src/gprs/gb_proxy_vty.c D openbsc/src/gprs/gprs_gb_parse.c D openbsc/src/gprs/gprs_gmm.c D openbsc/src/gprs/gprs_llc.c D openbsc/src/gprs/gprs_llc_parse.c D openbsc/src/gprs/gprs_llc_vty.c D openbsc/src/gprs/gprs_llc_xid.c D openbsc/src/gprs/gprs_sgsn.c D openbsc/src/gprs/gprs_sndcp.c D openbsc/src/gprs/gprs_sndcp_comp.c D openbsc/src/gprs/gprs_sndcp_dcomp.c D openbsc/src/gprs/gprs_sndcp_pcomp.c D openbsc/src/gprs/gprs_sndcp_vty.c D openbsc/src/gprs/gprs_sndcp_xid.c D openbsc/src/gprs/gprs_subscriber.c D openbsc/src/gprs/gprs_utils.c D openbsc/src/gprs/gtphub.c D openbsc/src/gprs/gtphub_ares.c D openbsc/src/gprs/gtphub_main.c D openbsc/src/gprs/gtphub_sock.c D openbsc/src/gprs/gtphub_vty.c D openbsc/src/gprs/osmo_sgsn.cfg D openbsc/src/gprs/sgsn_ares.c D openbsc/src/gprs/sgsn_auth.c D openbsc/src/gprs/sgsn_cdr.c D openbsc/src/gprs/sgsn_ctrl.c D openbsc/src/gprs/sgsn_libgtp.c D openbsc/src/gprs/sgsn_main.c D openbsc/src/gprs/sgsn_vty.c D openbsc/src/gprs/slhc.c D openbsc/src/gprs/v42bis.c M openbsc/tests/Makefile.am D openbsc/tests/gbproxy/Makefile.am D openbsc/tests/gbproxy/gbproxy_test.c D openbsc/tests/gbproxy/gbproxy_test.ok D openbsc/tests/gprs/Makefile.am D openbsc/tests/gprs/gprs_test.c D openbsc/tests/gprs/gprs_test.ok D openbsc/tests/gtphub/Makefile.am D openbsc/tests/gtphub/gtphub_test.c D openbsc/tests/gtphub/gtphub_test.ok D openbsc/tests/oap/Makefile.am D openbsc/tests/oap/oap_client_test.c D openbsc/tests/oap/oap_client_test.err D openbsc/tests/oap/oap_client_test.ok D openbsc/tests/sgsn/Makefile.am D openbsc/tests/sgsn/sgsn_test.c D openbsc/tests/sgsn/sgsn_test.ok D openbsc/tests/slhc/Makefile.am D openbsc/tests/slhc/slhc_test.c D openbsc/tests/slhc/slhc_test.ok D openbsc/tests/sndcp_xid/Makefile.am D openbsc/tests/sndcp_xid/sndcp_xid_test.c D openbsc/tests/sndcp_xid/sndcp_xid_test.ok M openbsc/tests/testsuite.at D openbsc/tests/v42bis/Makefile.am D openbsc/tests/v42bis/v42bis_test.c D openbsc/tests/v42bis/v42bis_test.ok D openbsc/tests/xid/Makefile.am D openbsc/tests/xid/xid_test.c D openbsc/tests/xid/xid_test.ok 83 files changed, 0 insertions(+), 45,004 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/17/4417/1 -- To view, visit https://gerrit.osmocom.org/4417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If60e28b23f5cfb2c4eb354951363a2bb63f3e0de Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 25 21:11:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 21:11:43 +0000 Subject: [PATCH] openbsc[master]: remove sgsn, gbproxy and gtphub from openbsc.git In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4417 to look at the new patch set (#2). remove sgsn, gbproxy and gtphub from openbsc.git The GPRS related programs osmo-sgsn, osmo-gtphub and osmo-gbproxy have been split off into the separate osmo-sgsn repository, which can be found at git://git.osmocom.org/osmo-sgsn.git http://git.osmocom.org/osmo-sgsn/ This is technically unrelated but conceptually part of the larger NITB-split activities. I did a brief log of all changes in src/gprs and couldn't find any commits that we might have applied here but which are missing from osmo-sgsn.git. Change-Id: If60e28b23f5cfb2c4eb354951363a2bb63f3e0de --- M debian/control D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M openbsc/.gitignore M openbsc/configure.ac D openbsc/contrib/gprs/gb-proxy-unblock-bug.py D openbsc/contrib/gprs/gprs-bssgp-histogram.lua D openbsc/contrib/gprs/gprs-buffer-count.lua D openbsc/contrib/gprs/gprs-split-trace-by-tlli.lua D openbsc/contrib/gprs/gprs-verify-nu.lua D openbsc/contrib/systemd/osmo-gbproxy.service D openbsc/contrib/systemd/osmo-sgsn.service D openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D openbsc/doc/examples/osmo-gtphub/gtphub-example.txt D openbsc/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg D openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg M openbsc/include/openbsc/Makefile.am D openbsc/include/openbsc/crc24.h D openbsc/include/openbsc/gb_proxy.h D openbsc/include/openbsc/gprs_gb_parse.h D openbsc/include/openbsc/gprs_gmm.h D openbsc/include/openbsc/gprs_llc.h D openbsc/include/openbsc/gprs_llc_xid.h D openbsc/include/openbsc/gprs_sgsn.h D openbsc/include/openbsc/gprs_sndcp.h D openbsc/include/openbsc/gprs_sndcp_comp.h D openbsc/include/openbsc/gprs_sndcp_dcomp.h D openbsc/include/openbsc/gprs_sndcp_pcomp.h D openbsc/include/openbsc/gprs_sndcp_xid.h D openbsc/include/openbsc/gprs_subscriber.h D openbsc/include/openbsc/gprs_utils.h M openbsc/include/openbsc/gsm_subscriber.h D openbsc/include/openbsc/gtphub.h D openbsc/include/openbsc/sgsn.h M openbsc/include/openbsc/signal.h D openbsc/include/openbsc/slhc.h D openbsc/include/openbsc/v42bis.h D openbsc/include/openbsc/v42bis_private.h M openbsc/osmoappdesc.py M openbsc/src/Makefile.am D openbsc/src/gprs/.gitignore D openbsc/src/gprs/Makefile.am D openbsc/src/gprs/crc24.c D openbsc/src/gprs/gb_proxy.c D openbsc/src/gprs/gb_proxy_main.c D openbsc/src/gprs/gb_proxy_patch.c D openbsc/src/gprs/gb_proxy_peer.c D openbsc/src/gprs/gb_proxy_tlli.c D openbsc/src/gprs/gb_proxy_vty.c D openbsc/src/gprs/gprs_gb_parse.c D openbsc/src/gprs/gprs_gmm.c D openbsc/src/gprs/gprs_llc.c D openbsc/src/gprs/gprs_llc_parse.c D openbsc/src/gprs/gprs_llc_vty.c D openbsc/src/gprs/gprs_llc_xid.c D openbsc/src/gprs/gprs_sgsn.c D openbsc/src/gprs/gprs_sndcp.c D openbsc/src/gprs/gprs_sndcp_comp.c D openbsc/src/gprs/gprs_sndcp_dcomp.c D openbsc/src/gprs/gprs_sndcp_pcomp.c D openbsc/src/gprs/gprs_sndcp_vty.c D openbsc/src/gprs/gprs_sndcp_xid.c D openbsc/src/gprs/gprs_subscriber.c D openbsc/src/gprs/gprs_utils.c D openbsc/src/gprs/gtphub.c D openbsc/src/gprs/gtphub_ares.c D openbsc/src/gprs/gtphub_main.c D openbsc/src/gprs/gtphub_sock.c D openbsc/src/gprs/gtphub_vty.c D openbsc/src/gprs/osmo_sgsn.cfg D openbsc/src/gprs/sgsn_ares.c D openbsc/src/gprs/sgsn_auth.c D openbsc/src/gprs/sgsn_cdr.c D openbsc/src/gprs/sgsn_ctrl.c D openbsc/src/gprs/sgsn_libgtp.c D openbsc/src/gprs/sgsn_main.c D openbsc/src/gprs/sgsn_vty.c D openbsc/src/gprs/slhc.c D openbsc/src/gprs/v42bis.c M openbsc/tests/Makefile.am M openbsc/tests/atlocal.in M openbsc/tests/ctrl_test_runner.py D openbsc/tests/gbproxy/Makefile.am D openbsc/tests/gbproxy/gbproxy_test.c D openbsc/tests/gbproxy/gbproxy_test.ok D openbsc/tests/gprs/Makefile.am D openbsc/tests/gprs/gprs_test.c D openbsc/tests/gprs/gprs_test.ok D openbsc/tests/gtphub/Makefile.am D openbsc/tests/gtphub/gtphub_test.c D openbsc/tests/gtphub/gtphub_test.ok M openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c D openbsc/tests/oap/Makefile.am D openbsc/tests/oap/oap_client_test.c D openbsc/tests/oap/oap_client_test.err D openbsc/tests/oap/oap_client_test.ok D openbsc/tests/sgsn/Makefile.am D openbsc/tests/sgsn/sgsn_test.c D openbsc/tests/sgsn/sgsn_test.ok D openbsc/tests/slhc/Makefile.am D openbsc/tests/slhc/slhc_test.c D openbsc/tests/slhc/slhc_test.ok D openbsc/tests/sndcp_xid/Makefile.am D openbsc/tests/sndcp_xid/sndcp_xid_test.c D openbsc/tests/sndcp_xid/sndcp_xid_test.ok M openbsc/tests/testsuite.at D openbsc/tests/v42bis/Makefile.am D openbsc/tests/v42bis/v42bis_test.c D openbsc/tests/v42bis/v42bis_test.ok M openbsc/tests/vty_test_runner.py D openbsc/tests/xid/Makefile.am D openbsc/tests/xid/xid_test.c D openbsc/tests/xid/xid_test.ok 124 files changed, 2 insertions(+), 48,826 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/17/4417/2 -- To view, visit https://gerrit.osmocom.org/4417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If60e28b23f5cfb2c4eb354951363a2bb63f3e0de Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:06:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:06:54 +0000 Subject: [PATCH] openbsc[master]: Fix nanobts_omlattr unit test Message-ID: Review at https://gerrit.osmocom.org/4418 Fix nanobts_omlattr unit test The test clearly fails unless bts->network is set correctly. Not sure why this hasn't shown up before? Port of osmo-bsc Change-Id I47786ed06ff610213d7a0b56d0ebf1c537cd7568 Change-Id: Id1cd4ce8f1e03b9715e1223414918bc69499e13d --- M openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/18/4418/1 diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c index ee138b8..fc358f5 100644 --- a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -200,6 +200,7 @@ gsm_bts_model_register(&bts_model_nanobts); bts = gsm_bts_alloc_register(net, GSM_BTS_TYPE_NANOBTS, 63); OSMO_ASSERT(bts); + bts->network = net; trx = talloc_zero(ctx, struct gsm_bts_trx); /* Parameters needed by nanobts_attr_bts_get() */ -- To view, visit https://gerrit.osmocom.org/4418 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1cd4ce8f1e03b9715e1223414918bc69499e13d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:06:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:06:58 +0000 Subject: [PATCH] openbsc[master]: nanobts_omlattra_test: Initialize logging before executing t... Message-ID: Review at https://gerrit.osmocom.org/4419 nanobts_omlattra_test: Initialize logging before executing tests ... the library code we call could want to log something, after all. Port of osmo-bsc Change-Id Ic01e9bfb63d7b6def9432103e744c23c90f0f6b9 Change-Id: Ib4be9541771e95ca4e051b778fc3958202aab9ab --- M openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/19/4419/1 diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c index fc358f5..5c6e519 100644 --- a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -192,6 +192,9 @@ struct gsm_network *net; struct gsm_bts_trx *trx; + osmo_init_logging(&log_info); + log_set_log_level(osmo_stderr_target, LOGL_INFO); + ctx = talloc_named_const(NULL, 0, "ctx"); /* Allocate environmental structs (bts, net, trx) */ -- To view, visit https://gerrit.osmocom.org/4419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib4be9541771e95ca4e051b778fc3958202aab9ab Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:06:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:06:59 +0000 Subject: [PATCH] openbsc[master]: osmo-bsc: Initialize logging before initializing rate_ctr Message-ID: Review at https://gerrit.osmocom.org/4420 osmo-bsc: Initialize logging before initializing rate_ctr The library code for rate counter initialization, which is called from the descendants of bsc_network_alloc() might already want to log something (particularly after Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f --- M openbsc/src/osmo-bsc/osmo_bsc_main.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/20/4420/1 diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 90651b9..6081460 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -195,15 +195,15 @@ tall_bsc_ctx = talloc_named_const(NULL, 1, "openbsc"); msgb_talloc_ctx_init(tall_bsc_ctx, 0); + osmo_init_logging(&log_info); + osmo_stats_init(tall_bsc_ctx); + /* Allocate global gsm_network struct */ rc = bsc_network_alloc(NULL); if (rc) { fprintf(stderr, "Allocation failed. exiting.\n"); exit(1); } - - osmo_init_logging(&log_info); - osmo_stats_init(tall_bsc_ctx); bts_init(); libosmo_abis_init(tall_bsc_ctx); -- To view, visit https://gerrit.osmocom.org/4420 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:07:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:07:19 +0000 Subject: openbsc[master]: Fix nanobts_omlattr unit test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4418 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id1cd4ce8f1e03b9715e1223414918bc69499e13d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:07:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:07:23 +0000 Subject: openbsc[master]: nanobts_omlattra_test: Initialize logging before executing t... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib4be9541771e95ca4e051b778fc3958202aab9ab Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:07:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:07:27 +0000 Subject: openbsc[master]: osmo-bsc: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4420 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:09:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:09:54 +0000 Subject: openbsc[master]: Fix nanobts_omlattr unit test In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4418 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id1cd4ce8f1e03b9715e1223414918bc69499e13d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:09:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:09:56 +0000 Subject: openbsc[master]: nanobts_omlattra_test: Initialize logging before executing t... In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib4be9541771e95ca4e051b778fc3958202aab9ab Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:09:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:09:58 +0000 Subject: openbsc[master]: osmo-bsc: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4420 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:10:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:10:02 +0000 Subject: [MERGED] openbsc[master]: osmo-bsc: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bsc: Initialize logging before initializing rate_ctr ...................................................................... osmo-bsc: Initialize logging before initializing rate_ctr The library code for rate counter initialization, which is called from the descendants of bsc_network_alloc() might already want to log something (particularly after Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f --- M openbsc/src/osmo-bsc/osmo_bsc_main.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 90651b9..6081460 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -195,15 +195,15 @@ tall_bsc_ctx = talloc_named_const(NULL, 1, "openbsc"); msgb_talloc_ctx_init(tall_bsc_ctx, 0); + osmo_init_logging(&log_info); + osmo_stats_init(tall_bsc_ctx); + /* Allocate global gsm_network struct */ rc = bsc_network_alloc(NULL); if (rc) { fprintf(stderr, "Allocation failed. exiting.\n"); exit(1); } - - osmo_init_logging(&log_info); - osmo_stats_init(tall_bsc_ctx); bts_init(); libosmo_abis_init(tall_bsc_ctx); -- To view, visit https://gerrit.osmocom.org/4420 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:10:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:10:03 +0000 Subject: [MERGED] openbsc[master]: nanobts_omlattra_test: Initialize logging before executing t... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: nanobts_omlattra_test: Initialize logging before executing tests ...................................................................... nanobts_omlattra_test: Initialize logging before executing tests ... the library code we call could want to log something, after all. Port of osmo-bsc Change-Id Ic01e9bfb63d7b6def9432103e744c23c90f0f6b9 Change-Id: Ib4be9541771e95ca4e051b778fc3958202aab9ab --- M openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c index fc358f5..5c6e519 100644 --- a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -192,6 +192,9 @@ struct gsm_network *net; struct gsm_bts_trx *trx; + osmo_init_logging(&log_info); + log_set_log_level(osmo_stderr_target, LOGL_INFO); + ctx = talloc_named_const(NULL, 0, "ctx"); /* Allocate environmental structs (bts, net, trx) */ -- To view, visit https://gerrit.osmocom.org/4419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib4be9541771e95ca4e051b778fc3958202aab9ab Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:10:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:10:03 +0000 Subject: [MERGED] openbsc[master]: Fix nanobts_omlattr unit test In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix nanobts_omlattr unit test ...................................................................... Fix nanobts_omlattr unit test The test clearly fails unless bts->network is set correctly. Not sure why this hasn't shown up before? Port of osmo-bsc Change-Id I47786ed06ff610213d7a0b56d0ebf1c537cd7568 Change-Id: Id1cd4ce8f1e03b9715e1223414918bc69499e13d --- M openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c index ee138b8..fc358f5 100644 --- a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -200,6 +200,7 @@ gsm_bts_model_register(&bts_model_nanobts); bts = gsm_bts_alloc_register(net, GSM_BTS_TYPE_NANOBTS, 63); OSMO_ASSERT(bts); + bts->network = net; trx = talloc_zero(ctx, struct gsm_bts_trx); /* Parameters needed by nanobts_attr_bts_get() */ -- To view, visit https://gerrit.osmocom.org/4418 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id1cd4ce8f1e03b9715e1223414918bc69499e13d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:18:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:18:24 +0000 Subject: openbsc[master]: remove sgsn, gbproxy and gtphub from openbsc.git In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If60e28b23f5cfb2c4eb354951363a2bb63f3e0de Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:36:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:36:08 +0000 Subject: [PATCH] openbsc[master]: rename osmo-bsc to osmo-bsc-sccplite Message-ID: Review at https://gerrit.osmocom.org/4421 rename osmo-bsc to osmo-bsc-sccplite This is to avoid naming conflicts with the new osmo-bsc, which resides in its own git repository (osmo-bsc.git) and which uses libosmo-sigtran and implements (primarily) 3GPP AoIP. Change-Id: If10d1599b62d010726336134091a4e855c380d93 --- M debian/control A debian/osmocom-bsc-sccplite.examples A debian/osmocom-bsc-sccplite.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install M debian/rules M openbsc/.gitignore M openbsc/contrib/bsc-test/msc.sh R openbsc/contrib/systemd/osmo-bsc-sccplite.service R openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg M openbsc/osmoappdesc.py M openbsc/src/osmo-bsc/Makefile.am M openbsc/src/osmo-bsc/osmo_bsc_main.c M openbsc/tests/ctrl_test_runner.py M openbsc/tests/vty_test_runner.py 15 files changed, 29 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/4421/1 diff --git a/debian/control b/debian/control index 58e8966..e31d0c4 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Vcs-Browser: http://openbsc.osmocom.org/trac/browser Homepage: https://projects.osmocom.org/projects/openbsc -Package: osmocom-bsc +Package: osmocom-bsc-sccplite Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -40,7 +40,7 @@ Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR This is the Network-in-a-Box version of OpenBSC. It has all the GSM network components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. + Mobile Switching Center (MSC) which is needed when using osmocom-bsc-sccplite. Package: osmocom-ipaccess-utils Architecture: any @@ -64,13 +64,13 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: osmocom-bsc +Recommends: osmocom-bsc-sccplite Description: Osmocom Base Station Controller Network Address Translation This NAT is useful for masquerading multiple BSCs behind one. It listens for incoming BSCs on port 5000 and connects to a specified Mobile Switching Center (MSC). . - This package is part of OpenBSC and closely related to osmocom-bsc. + This package is part of OpenBSC and closely related to osmocom-bsc-sccplite. Package: openbsc-dev Architecture: all @@ -83,11 +83,11 @@ The directory structure is copied after the structure in the repository and the header and .c file are installed into /usr/src/osmocom/openbsc/. -Package: osmocom-bsc-dbg +Package: osmocom-bsc-sccplite-dbg Architecture: any Section: debug Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} +Depends: osmocom-bsc-sccplite (= ${binary:Version}), ${misc:Depends} Description: Debug symbols for the OpenBSC BSC Make debugging possible diff --git a/debian/osmocom-bsc-sccplite.examples b/debian/osmocom-bsc-sccplite.examples new file mode 100644 index 0000000..545709b --- /dev/null +++ b/debian/osmocom-bsc-sccplite.examples @@ -0,0 +1,2 @@ +openbsc/doc/examples/osmo-bsc_mgcp +openbsc/doc/examples/osmo-bsc-sccplite diff --git a/debian/osmocom-bsc-sccplite.install b/debian/osmocom-bsc-sccplite.install new file mode 100644 index 0000000..9ce795c --- /dev/null +++ b/debian/osmocom-bsc-sccplite.install @@ -0,0 +1,2 @@ +/usr/bin/osmo-bsc_mgcp +/usr/bin/osmo-bsc-sccplite diff --git a/debian/osmocom-bsc.examples b/debian/osmocom-bsc.examples deleted file mode 100644 index a95f12b..0000000 --- a/debian/osmocom-bsc.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-bsc_mgcp diff --git a/debian/osmocom-bsc.install b/debian/osmocom-bsc.install deleted file mode 100644 index ab9459e..0000000 --- a/debian/osmocom-bsc.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-bsc_mgcp -/usr/bin/osmo-bsc diff --git a/debian/rules b/debian/rules index d1d74a5..05bbbef 100755 --- a/debian/rules +++ b/debian/rules @@ -17,7 +17,7 @@ cd openbsc && autoreconf --install --force override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg + dh_strip -posmocom-bsc-sccplite --dbg-package=osmocom-bsc-sccplite-dbg dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg diff --git a/openbsc/.gitignore b/openbsc/.gitignore index f54aa59..3a811e7 100644 --- a/openbsc/.gitignore +++ b/openbsc/.gitignore @@ -9,7 +9,7 @@ openbsc.pc src/osmo-nitb/osmo-nitb src/osmo-bsc_mgcp/osmo-bsc_mgcp -src/osmo-bsc/osmo-bsc +src/osmo-bsc/osmo-bsc-sccplite src/utils/meas_vis src/utils/meas_json src/utils/osmo-meas-pcap2db diff --git a/openbsc/contrib/bsc-test/msc.sh b/openbsc/contrib/bsc-test/msc.sh index bec011d..766603d 100755 --- a/openbsc/contrib/bsc-test/msc.sh +++ b/openbsc/contrib/bsc-test/msc.sh @@ -2,7 +2,7 @@ while true; do - echo "Kill the osmo-bsc" - /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc` + echo "Kill the osmo-bsc-sccplite" + /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc-sccplite` sleep 58s done diff --git a/openbsc/contrib/systemd/osmo-bsc.service b/openbsc/contrib/systemd/osmo-bsc-sccplite.service similarity index 65% rename from openbsc/contrib/systemd/osmo-bsc.service rename to openbsc/contrib/systemd/osmo-bsc-sccplite.service index 4047fef..70cda5f 100644 --- a/openbsc/contrib/systemd/osmo-bsc.service +++ b/openbsc/contrib/systemd/osmo-bsc-sccplite.service @@ -5,7 +5,7 @@ [Service] Type=simple Restart=always -ExecStart=/usr/bin/osmo-bsc -c /etc/osmocom/osmo-bsc.cfg -s +ExecStart=/usr/bin/osmo-bsc-sccplite -c /etc/osmocom/osmo-bsc-sccplite.cfg -s RestartSec=2 [Install] diff --git a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg b/openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg rename to openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg diff --git a/openbsc/osmoappdesc.py b/openbsc/osmoappdesc.py index ba6d954..c5b20ac 100644 --- a/openbsc/osmoappdesc.py +++ b/openbsc/osmoappdesc.py @@ -28,7 +28,7 @@ app_configs = { - "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], + "osmo-bsc-sccplite": ["doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], "mgcp": ["doc/examples/osmo-bsc_mgcp/mgcp.cfg"], "nitb": ["doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg", @@ -36,7 +36,7 @@ } -apps = [(4242, "src/osmo-bsc/osmo-bsc", "OsmoBSC", "osmo-bsc"), +apps = [(4242, "src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "osmo-bsc-sccplite"), (4244, "src/osmo-bsc_nat/osmo-bsc_nat", "OsmoBSCNAT", "nat"), (4243, "src/osmo-bsc_mgcp/osmo-bsc_mgcp", "OpenBSC MGCP", "mgcp"), (4242, "src/osmo-nitb/osmo-nitb", "OpenBSC", "nitb"), diff --git a/openbsc/src/osmo-bsc/Makefile.am b/openbsc/src/osmo-bsc/Makefile.am index ae9410c..343af70 100644 --- a/openbsc/src/osmo-bsc/Makefile.am +++ b/openbsc/src/osmo-bsc/Makefile.am @@ -21,10 +21,10 @@ $(NULL) bin_PROGRAMS = \ - osmo-bsc \ + osmo-bsc-sccplite \ $(NULL) -osmo_bsc_SOURCES = \ +osmo_bsc_sccplite_SOURCES = \ osmo_bsc_main.c \ osmo_bsc_vty.c \ osmo_bsc_api.c \ @@ -38,7 +38,7 @@ $(NULL) # once again since TRAU uses CC symbol :( -osmo_bsc_LDADD = \ +osmo_bsc_sccplite_LDADD = \ $(top_builddir)/src/libfilter/libfilter.a \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 6081460..022cd3d 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -70,7 +70,7 @@ static void print_usage() { - printf("Usage: osmo-bsc\n"); + printf("Usage: osmo-bsc-sccplite\n"); } static void print_help() diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py index 46c4dcf..b3d912d 100644 --- a/openbsc/tests/ctrl_test_runner.py +++ b/openbsc/tests/ctrl_test_runner.py @@ -155,11 +155,11 @@ os.unlink("tmp_dummy_sock") def ctrl_command(self): - return ["./src/osmo-bsc/osmo-bsc", "-r", "tmp_dummy_sock", "-c", - "doc/examples/osmo-bsc/osmo-bsc.cfg"] + return ["./src/osmo-bsc/osmo-bsc-sccplite", "-r", "tmp_dummy_sock", "-c", + "doc/examples/osmo-bsc/osmo-bsc-sccplite.cfg"] def ctrl_app(self): - return (4249, "./src/osmo-bsc/osmo-bsc", "OsmoBSC", "bsc") + return (4249, "./src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "bsc") def testCtrlErrs(self): r = self.do_get('invalid') @@ -606,7 +606,7 @@ # added. e.g. by implementing a get for the list. def add_bsc_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): + if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc-sccplite")): print("Skipping the BSC test") return test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlBSC) diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 8bec7c0..5ef32d1 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -579,11 +579,11 @@ class TestVTYBSC(TestVTYGenericBSC): def vty_command(self): - return ["./src/osmo-bsc/osmo-bsc", "-c", - "doc/examples/osmo-bsc/osmo-bsc.cfg"] + return ["./src/osmo-bsc/osmo-bsc-sccplite", "-c", + "doc/examples/osmo-bsc/osmo-bsc-sccplite.cfg"] def vty_app(self): - return (4242, "./src/osmo-bsc/osmo-bsc", "OsmoBSC", "bsc") + return (4242, "./src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "bsc") def testConfigNetworkTree(self): self._testConfigNetworkTree() @@ -1113,7 +1113,7 @@ return bsc def add_bsc_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): + if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc-sccplite")): print("Skipping the BSC test") return test = unittest.TestLoader().loadTestsFromTestCase(TestVTYBSC) -- To view, visit https://gerrit.osmocom.org/4421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If10d1599b62d010726336134091a4e855c380d93 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:42:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:42:36 +0000 Subject: [PATCH] openbsc[master]: rename osmo-bsc to osmo-bsc-sccplite In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4421 to look at the new patch set (#2). rename osmo-bsc to osmo-bsc-sccplite This is to avoid naming conflicts with the new osmo-bsc, which resides in its own git repository (osmo-bsc.git) and which uses libosmo-sigtran and implements (primarily) 3GPP AoIP. Change-Id: If10d1599b62d010726336134091a4e855c380d93 --- M debian/control A debian/osmocom-bsc-sccplite.examples A debian/osmocom-bsc-sccplite.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install M debian/rules M openbsc/.gitignore M openbsc/contrib/bsc-test/msc.sh R openbsc/contrib/systemd/osmo-bsc-sccplite.service R openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg M openbsc/osmoappdesc.py M openbsc/src/osmo-bsc/Makefile.am M openbsc/src/osmo-bsc/osmo_bsc_main.c M openbsc/tests/ctrl_test_runner.py M openbsc/tests/vty_test_runner.py 15 files changed, 29 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/4421/2 diff --git a/debian/control b/debian/control index 58e8966..e31d0c4 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Vcs-Browser: http://openbsc.osmocom.org/trac/browser Homepage: https://projects.osmocom.org/projects/openbsc -Package: osmocom-bsc +Package: osmocom-bsc-sccplite Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -40,7 +40,7 @@ Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR This is the Network-in-a-Box version of OpenBSC. It has all the GSM network components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. + Mobile Switching Center (MSC) which is needed when using osmocom-bsc-sccplite. Package: osmocom-ipaccess-utils Architecture: any @@ -64,13 +64,13 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: osmocom-bsc +Recommends: osmocom-bsc-sccplite Description: Osmocom Base Station Controller Network Address Translation This NAT is useful for masquerading multiple BSCs behind one. It listens for incoming BSCs on port 5000 and connects to a specified Mobile Switching Center (MSC). . - This package is part of OpenBSC and closely related to osmocom-bsc. + This package is part of OpenBSC and closely related to osmocom-bsc-sccplite. Package: openbsc-dev Architecture: all @@ -83,11 +83,11 @@ The directory structure is copied after the structure in the repository and the header and .c file are installed into /usr/src/osmocom/openbsc/. -Package: osmocom-bsc-dbg +Package: osmocom-bsc-sccplite-dbg Architecture: any Section: debug Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} +Depends: osmocom-bsc-sccplite (= ${binary:Version}), ${misc:Depends} Description: Debug symbols for the OpenBSC BSC Make debugging possible diff --git a/debian/osmocom-bsc-sccplite.examples b/debian/osmocom-bsc-sccplite.examples new file mode 100644 index 0000000..545709b --- /dev/null +++ b/debian/osmocom-bsc-sccplite.examples @@ -0,0 +1,2 @@ +openbsc/doc/examples/osmo-bsc_mgcp +openbsc/doc/examples/osmo-bsc-sccplite diff --git a/debian/osmocom-bsc-sccplite.install b/debian/osmocom-bsc-sccplite.install new file mode 100644 index 0000000..9ce795c --- /dev/null +++ b/debian/osmocom-bsc-sccplite.install @@ -0,0 +1,2 @@ +/usr/bin/osmo-bsc_mgcp +/usr/bin/osmo-bsc-sccplite diff --git a/debian/osmocom-bsc.examples b/debian/osmocom-bsc.examples deleted file mode 100644 index a95f12b..0000000 --- a/debian/osmocom-bsc.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-bsc_mgcp diff --git a/debian/osmocom-bsc.install b/debian/osmocom-bsc.install deleted file mode 100644 index ab9459e..0000000 --- a/debian/osmocom-bsc.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-bsc_mgcp -/usr/bin/osmo-bsc diff --git a/debian/rules b/debian/rules index d1d74a5..05bbbef 100755 --- a/debian/rules +++ b/debian/rules @@ -17,7 +17,7 @@ cd openbsc && autoreconf --install --force override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg + dh_strip -posmocom-bsc-sccplite --dbg-package=osmocom-bsc-sccplite-dbg dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg diff --git a/openbsc/.gitignore b/openbsc/.gitignore index f54aa59..3a811e7 100644 --- a/openbsc/.gitignore +++ b/openbsc/.gitignore @@ -9,7 +9,7 @@ openbsc.pc src/osmo-nitb/osmo-nitb src/osmo-bsc_mgcp/osmo-bsc_mgcp -src/osmo-bsc/osmo-bsc +src/osmo-bsc/osmo-bsc-sccplite src/utils/meas_vis src/utils/meas_json src/utils/osmo-meas-pcap2db diff --git a/openbsc/contrib/bsc-test/msc.sh b/openbsc/contrib/bsc-test/msc.sh index bec011d..766603d 100755 --- a/openbsc/contrib/bsc-test/msc.sh +++ b/openbsc/contrib/bsc-test/msc.sh @@ -2,7 +2,7 @@ while true; do - echo "Kill the osmo-bsc" - /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc` + echo "Kill the osmo-bsc-sccplite" + /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc-sccplite` sleep 58s done diff --git a/openbsc/contrib/systemd/osmo-bsc.service b/openbsc/contrib/systemd/osmo-bsc-sccplite.service similarity index 65% rename from openbsc/contrib/systemd/osmo-bsc.service rename to openbsc/contrib/systemd/osmo-bsc-sccplite.service index 4047fef..70cda5f 100644 --- a/openbsc/contrib/systemd/osmo-bsc.service +++ b/openbsc/contrib/systemd/osmo-bsc-sccplite.service @@ -5,7 +5,7 @@ [Service] Type=simple Restart=always -ExecStart=/usr/bin/osmo-bsc -c /etc/osmocom/osmo-bsc.cfg -s +ExecStart=/usr/bin/osmo-bsc-sccplite -c /etc/osmocom/osmo-bsc-sccplite.cfg -s RestartSec=2 [Install] diff --git a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg b/openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg rename to openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg diff --git a/openbsc/osmoappdesc.py b/openbsc/osmoappdesc.py index ba6d954..c5b20ac 100644 --- a/openbsc/osmoappdesc.py +++ b/openbsc/osmoappdesc.py @@ -28,7 +28,7 @@ app_configs = { - "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], + "osmo-bsc-sccplite": ["doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], "mgcp": ["doc/examples/osmo-bsc_mgcp/mgcp.cfg"], "nitb": ["doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg", @@ -36,7 +36,7 @@ } -apps = [(4242, "src/osmo-bsc/osmo-bsc", "OsmoBSC", "osmo-bsc"), +apps = [(4242, "src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "osmo-bsc-sccplite"), (4244, "src/osmo-bsc_nat/osmo-bsc_nat", "OsmoBSCNAT", "nat"), (4243, "src/osmo-bsc_mgcp/osmo-bsc_mgcp", "OpenBSC MGCP", "mgcp"), (4242, "src/osmo-nitb/osmo-nitb", "OpenBSC", "nitb"), diff --git a/openbsc/src/osmo-bsc/Makefile.am b/openbsc/src/osmo-bsc/Makefile.am index ae9410c..343af70 100644 --- a/openbsc/src/osmo-bsc/Makefile.am +++ b/openbsc/src/osmo-bsc/Makefile.am @@ -21,10 +21,10 @@ $(NULL) bin_PROGRAMS = \ - osmo-bsc \ + osmo-bsc-sccplite \ $(NULL) -osmo_bsc_SOURCES = \ +osmo_bsc_sccplite_SOURCES = \ osmo_bsc_main.c \ osmo_bsc_vty.c \ osmo_bsc_api.c \ @@ -38,7 +38,7 @@ $(NULL) # once again since TRAU uses CC symbol :( -osmo_bsc_LDADD = \ +osmo_bsc_sccplite_LDADD = \ $(top_builddir)/src/libfilter/libfilter.a \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 6081460..022cd3d 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -70,7 +70,7 @@ static void print_usage() { - printf("Usage: osmo-bsc\n"); + printf("Usage: osmo-bsc-sccplite\n"); } static void print_help() diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py index 46c4dcf..b3d912d 100644 --- a/openbsc/tests/ctrl_test_runner.py +++ b/openbsc/tests/ctrl_test_runner.py @@ -155,11 +155,11 @@ os.unlink("tmp_dummy_sock") def ctrl_command(self): - return ["./src/osmo-bsc/osmo-bsc", "-r", "tmp_dummy_sock", "-c", - "doc/examples/osmo-bsc/osmo-bsc.cfg"] + return ["./src/osmo-bsc/osmo-bsc-sccplite", "-r", "tmp_dummy_sock", "-c", + "doc/examples/osmo-bsc/osmo-bsc-sccplite.cfg"] def ctrl_app(self): - return (4249, "./src/osmo-bsc/osmo-bsc", "OsmoBSC", "bsc") + return (4249, "./src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "bsc") def testCtrlErrs(self): r = self.do_get('invalid') @@ -606,7 +606,7 @@ # added. e.g. by implementing a get for the list. def add_bsc_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): + if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc-sccplite")): print("Skipping the BSC test") return test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlBSC) diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 8bec7c0..a3161fb 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -579,11 +579,11 @@ class TestVTYBSC(TestVTYGenericBSC): def vty_command(self): - return ["./src/osmo-bsc/osmo-bsc", "-c", - "doc/examples/osmo-bsc/osmo-bsc.cfg"] + return ["./src/osmo-bsc/osmo-bsc-sccplite", "-c", + "doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg"] def vty_app(self): - return (4242, "./src/osmo-bsc/osmo-bsc", "OsmoBSC", "bsc") + return (4242, "./src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "bsc") def testConfigNetworkTree(self): self._testConfigNetworkTree() @@ -1113,7 +1113,7 @@ return bsc def add_bsc_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): + if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc-sccplite")): print("Skipping the BSC test") return test = unittest.TestLoader().loadTestsFromTestCase(TestVTYBSC) -- To view, visit https://gerrit.osmocom.org/4421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If10d1599b62d010726336134091a4e855c380d93 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:45:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:45:59 +0000 Subject: openbsc[master]: rename osmo-bsc to osmo-bsc-sccplite In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If10d1599b62d010726336134091a4e855c380d93 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Oct 25 22:50:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Oct 2017 22:50:09 +0000 Subject: [PATCH] openbsc[master]: rename osmo-bsc to osmo-bsc-sccplite In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4421 to look at the new patch set (#3). rename osmo-bsc to osmo-bsc-sccplite This is to avoid naming conflicts with the new osmo-bsc, which resides in its own git repository (osmo-bsc.git) and which uses libosmo-sigtran and implements (primarily) 3GPP AoIP. Change-Id: If10d1599b62d010726336134091a4e855c380d93 --- M debian/changelog M debian/control A debian/osmocom-bsc-sccplite.examples A debian/osmocom-bsc-sccplite.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install M debian/rules M openbsc/.gitignore M openbsc/contrib/bsc-test/msc.sh R openbsc/contrib/systemd/osmo-bsc-sccplite.service R openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg M openbsc/osmoappdesc.py M openbsc/src/osmo-bsc/Makefile.am M openbsc/src/osmo-bsc/osmo_bsc_main.c M openbsc/tests/ctrl_test_runner.py M openbsc/tests/vty_test_runner.py 16 files changed, 33 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/4421/3 diff --git a/debian/changelog b/debian/changelog index e9a4212..dd850be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,10 @@ * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. Note: such configs are broken without extra workarounds anyway. + [ Harald Welte ] + * Rename osmo-bsc to osmo-bsc-sccplite to avoid clashes with new 3GPP AoIP + osmo-bsc.git code + -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 openbsc (0.14.0) unstable; urgency=low diff --git a/debian/control b/debian/control index 58e8966..e31d0c4 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Vcs-Browser: http://openbsc.osmocom.org/trac/browser Homepage: https://projects.osmocom.org/projects/openbsc -Package: osmocom-bsc +Package: osmocom-bsc-sccplite Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -40,7 +40,7 @@ Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR This is the Network-in-a-Box version of OpenBSC. It has all the GSM network components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. + Mobile Switching Center (MSC) which is needed when using osmocom-bsc-sccplite. Package: osmocom-ipaccess-utils Architecture: any @@ -64,13 +64,13 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: osmocom-bsc +Recommends: osmocom-bsc-sccplite Description: Osmocom Base Station Controller Network Address Translation This NAT is useful for masquerading multiple BSCs behind one. It listens for incoming BSCs on port 5000 and connects to a specified Mobile Switching Center (MSC). . - This package is part of OpenBSC and closely related to osmocom-bsc. + This package is part of OpenBSC and closely related to osmocom-bsc-sccplite. Package: openbsc-dev Architecture: all @@ -83,11 +83,11 @@ The directory structure is copied after the structure in the repository and the header and .c file are installed into /usr/src/osmocom/openbsc/. -Package: osmocom-bsc-dbg +Package: osmocom-bsc-sccplite-dbg Architecture: any Section: debug Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} +Depends: osmocom-bsc-sccplite (= ${binary:Version}), ${misc:Depends} Description: Debug symbols for the OpenBSC BSC Make debugging possible diff --git a/debian/osmocom-bsc-sccplite.examples b/debian/osmocom-bsc-sccplite.examples new file mode 100644 index 0000000..545709b --- /dev/null +++ b/debian/osmocom-bsc-sccplite.examples @@ -0,0 +1,2 @@ +openbsc/doc/examples/osmo-bsc_mgcp +openbsc/doc/examples/osmo-bsc-sccplite diff --git a/debian/osmocom-bsc-sccplite.install b/debian/osmocom-bsc-sccplite.install new file mode 100644 index 0000000..9ce795c --- /dev/null +++ b/debian/osmocom-bsc-sccplite.install @@ -0,0 +1,2 @@ +/usr/bin/osmo-bsc_mgcp +/usr/bin/osmo-bsc-sccplite diff --git a/debian/osmocom-bsc.examples b/debian/osmocom-bsc.examples deleted file mode 100644 index a95f12b..0000000 --- a/debian/osmocom-bsc.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-bsc_mgcp diff --git a/debian/osmocom-bsc.install b/debian/osmocom-bsc.install deleted file mode 100644 index ab9459e..0000000 --- a/debian/osmocom-bsc.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-bsc_mgcp -/usr/bin/osmo-bsc diff --git a/debian/rules b/debian/rules index d1d74a5..05bbbef 100755 --- a/debian/rules +++ b/debian/rules @@ -17,7 +17,7 @@ cd openbsc && autoreconf --install --force override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg + dh_strip -posmocom-bsc-sccplite --dbg-package=osmocom-bsc-sccplite-dbg dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg diff --git a/openbsc/.gitignore b/openbsc/.gitignore index f54aa59..3a811e7 100644 --- a/openbsc/.gitignore +++ b/openbsc/.gitignore @@ -9,7 +9,7 @@ openbsc.pc src/osmo-nitb/osmo-nitb src/osmo-bsc_mgcp/osmo-bsc_mgcp -src/osmo-bsc/osmo-bsc +src/osmo-bsc/osmo-bsc-sccplite src/utils/meas_vis src/utils/meas_json src/utils/osmo-meas-pcap2db diff --git a/openbsc/contrib/bsc-test/msc.sh b/openbsc/contrib/bsc-test/msc.sh index bec011d..766603d 100755 --- a/openbsc/contrib/bsc-test/msc.sh +++ b/openbsc/contrib/bsc-test/msc.sh @@ -2,7 +2,7 @@ while true; do - echo "Kill the osmo-bsc" - /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc` + echo "Kill the osmo-bsc-sccplite" + /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc-sccplite` sleep 58s done diff --git a/openbsc/contrib/systemd/osmo-bsc.service b/openbsc/contrib/systemd/osmo-bsc-sccplite.service similarity index 65% rename from openbsc/contrib/systemd/osmo-bsc.service rename to openbsc/contrib/systemd/osmo-bsc-sccplite.service index 4047fef..70cda5f 100644 --- a/openbsc/contrib/systemd/osmo-bsc.service +++ b/openbsc/contrib/systemd/osmo-bsc-sccplite.service @@ -5,7 +5,7 @@ [Service] Type=simple Restart=always -ExecStart=/usr/bin/osmo-bsc -c /etc/osmocom/osmo-bsc.cfg -s +ExecStart=/usr/bin/osmo-bsc-sccplite -c /etc/osmocom/osmo-bsc-sccplite.cfg -s RestartSec=2 [Install] diff --git a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg b/openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg rename to openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg diff --git a/openbsc/osmoappdesc.py b/openbsc/osmoappdesc.py index ba6d954..c5b20ac 100644 --- a/openbsc/osmoappdesc.py +++ b/openbsc/osmoappdesc.py @@ -28,7 +28,7 @@ app_configs = { - "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], + "osmo-bsc-sccplite": ["doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], "mgcp": ["doc/examples/osmo-bsc_mgcp/mgcp.cfg"], "nitb": ["doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg", @@ -36,7 +36,7 @@ } -apps = [(4242, "src/osmo-bsc/osmo-bsc", "OsmoBSC", "osmo-bsc"), +apps = [(4242, "src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "osmo-bsc-sccplite"), (4244, "src/osmo-bsc_nat/osmo-bsc_nat", "OsmoBSCNAT", "nat"), (4243, "src/osmo-bsc_mgcp/osmo-bsc_mgcp", "OpenBSC MGCP", "mgcp"), (4242, "src/osmo-nitb/osmo-nitb", "OpenBSC", "nitb"), diff --git a/openbsc/src/osmo-bsc/Makefile.am b/openbsc/src/osmo-bsc/Makefile.am index ae9410c..343af70 100644 --- a/openbsc/src/osmo-bsc/Makefile.am +++ b/openbsc/src/osmo-bsc/Makefile.am @@ -21,10 +21,10 @@ $(NULL) bin_PROGRAMS = \ - osmo-bsc \ + osmo-bsc-sccplite \ $(NULL) -osmo_bsc_SOURCES = \ +osmo_bsc_sccplite_SOURCES = \ osmo_bsc_main.c \ osmo_bsc_vty.c \ osmo_bsc_api.c \ @@ -38,7 +38,7 @@ $(NULL) # once again since TRAU uses CC symbol :( -osmo_bsc_LDADD = \ +osmo_bsc_sccplite_LDADD = \ $(top_builddir)/src/libfilter/libfilter.a \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 6081460..022cd3d 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -70,7 +70,7 @@ static void print_usage() { - printf("Usage: osmo-bsc\n"); + printf("Usage: osmo-bsc-sccplite\n"); } static void print_help() diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py index 46c4dcf..fb69027 100644 --- a/openbsc/tests/ctrl_test_runner.py +++ b/openbsc/tests/ctrl_test_runner.py @@ -155,11 +155,11 @@ os.unlink("tmp_dummy_sock") def ctrl_command(self): - return ["./src/osmo-bsc/osmo-bsc", "-r", "tmp_dummy_sock", "-c", - "doc/examples/osmo-bsc/osmo-bsc.cfg"] + return ["./src/osmo-bsc/osmo-bsc-sccplite", "-r", "tmp_dummy_sock", "-c", + "doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg"] def ctrl_app(self): - return (4249, "./src/osmo-bsc/osmo-bsc", "OsmoBSC", "bsc") + return (4249, "./src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "bsc") def testCtrlErrs(self): r = self.do_get('invalid') @@ -606,7 +606,7 @@ # added. e.g. by implementing a get for the list. def add_bsc_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): + if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc-sccplite")): print("Skipping the BSC test") return test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlBSC) diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 8bec7c0..a3161fb 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -579,11 +579,11 @@ class TestVTYBSC(TestVTYGenericBSC): def vty_command(self): - return ["./src/osmo-bsc/osmo-bsc", "-c", - "doc/examples/osmo-bsc/osmo-bsc.cfg"] + return ["./src/osmo-bsc/osmo-bsc-sccplite", "-c", + "doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg"] def vty_app(self): - return (4242, "./src/osmo-bsc/osmo-bsc", "OsmoBSC", "bsc") + return (4242, "./src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "bsc") def testConfigNetworkTree(self): self._testConfigNetworkTree() @@ -1113,7 +1113,7 @@ return bsc def add_bsc_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): + if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc-sccplite")): print("Skipping the BSC test") return test = unittest.TestLoader().loadTestsFromTestCase(TestVTYBSC) -- To view, visit https://gerrit.osmocom.org/4421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If10d1599b62d010726336134091a4e855c380d93 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 26 09:07:19 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 09:07:19 +0000 Subject: [PATCH] osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4411 to look at the new patch set (#9). Initialize logging before initializing rate_ctr The library code for rate counter initialization might already want to log something (particularly after Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Before the rate counters were initialized implicitly in BTS constructor which makes proper logging init impossible. Fix this by using explicit init similar to the way we do it for vty. Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 --- M src/Makefile.am M src/bts.cpp M src/bts.h A src/pcu_ctr.c A src/pcu_ctr.h M src/pcu_main.cpp M src/pcu_vty.c M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp M tests/types/TypesTest.cpp 10 files changed, 194 insertions(+), 122 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/11/4411/9 diff --git a/src/Makefile.am b/src/Makefile.am index 1543851..67291ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,7 @@ gprs_ms_storage.cpp \ gsm_timer.cpp \ pcu_l1_if.cpp \ + pcu_ctr.c \ pcu_vty.c \ pcu_vty_functions.cpp \ tbf.cpp \ @@ -79,6 +80,7 @@ gprs_ms_storage.h \ pcu_l1_if.h \ gsm_timer.h \ + pcu_ctr.h \ pcu_vty.h \ pcu_vty_functions.h \ tbf.h \ diff --git a/src/bts.cpp b/src/bts.cpp index b768569..0f7462a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -50,107 +50,6 @@ static BTS s_bts; -/** - * For gcc-4.4 compat do not use extended initializer list but keep the - * order from the enum here. Once we support GCC4.7 and up we can change - * the code below. - */ -static const struct rate_ctr_desc bts_ctr_description[] = { - { "tbf.dl.alloc", "TBF DL Allocated "}, - { "tbf.dl.freed", "TBF DL Freed "}, - { "tbf.dl.aborted", "TBF DL Aborted "}, - { "tbf.ul.alloc", "TBF UL Allocated "}, - { "tbf.ul.freed", "TBF UL Freed "}, - { "tbf.ul.aborted", "TBF UL Aborted "}, - { "tbf.reused", "TBF Reused "}, - { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, - { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, - { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, - { "rlc.sent", "RLC Sent "}, - { "rlc.resent", "RLC Resent "}, - { "rlc.restarted", "RLC Restarted "}, - { "rlc.stalled", "RLC Stalled "}, - { "rlc.nacked", "RLC Nacked "}, - { "rlc.final_block_resent", "RLC Final Blk resent "}, - { "rlc.ass.timedout", "RLC Assign Timeout "}, - { "rlc.ass.failed", "RLC Assign Failed "}, - { "rlc.ack.timedout", "RLC Ack Timeout "}, - { "rlc.ack.failed", "RLC Ack Failed "}, - { "rlc.rel.timedout", "RLC Release Timeout "}, - { "rlc.late-block", "RLC Late Block "}, - { "rlc.sent-dummy", "RLC Sent Dummy "}, - { "rlc.sent-control", "RLC Sent Control "}, - { "rlc.dl_bytes", "RLC DL Bytes "}, - { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, - { "rlc.ul_bytes", "RLC UL Bytes "}, - { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, - { "decode.errors", "Decode Errors "}, - { "sba.allocated", "SBA Allocated "}, - { "sba.freed", "SBA Freed "}, - { "sba.timedout", "SBA Timeout "}, - { "llc.timeout", "Timedout Frames "}, - { "llc.dropped", "Dropped Frames "}, - { "llc.scheduled", "Scheduled Frames "}, - { "llc.dl_bytes", "RLC encapsulated PDUs"}, - { "llc.ul_bytes", "full PDUs received "}, - { "rach.requests", "RACH requests "}, - { "11bit_rach.requests", "11BIT_RACH requests "}, - { "spb.uplink_first_segment", "First seg of UL SPB "}, - { "spb.uplink_second_segment", "Second seg of UL SPB "}, - { "spb.downlink_first_segment", "First seg of DL SPB "}, - { "spb.downlink_second_segment","Second seg of DL SPB "}, - { "immediate.assignment_UL", "Immediate Assign UL "}, - { "immediate.assignment_rej", "Immediate Assign Rej "}, - { "immediate.assignment_DL", "Immediate Assign DL "}, - { "channel.request_description","Channel Request Desc "}, - { "pkt.ul_assignment", "Packet UL Assignment "}, - { "pkt.access_reject", "Packet Access Reject "}, - { "pkt.dl_assignment", "Packet DL Assignment "}, - { "ul.control", "UL control Block "}, - { "ul.assignment_poll_timeout", "UL Assign Timeout "}, - { "ul.assignment_failed", "UL Assign Failed "}, - { "dl.assignment_timeout", "DL Assign Timeout "}, - { "dl.assignment_failed", "DL Assign Failed "}, - { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, - { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, - { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, - { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, - { "gprs.downlink_cs1", "CS1 downlink "}, - { "gprs.downlink_cs2", "CS2 downlink "}, - { "gprs.downlink_cs3", "CS3 downlink "}, - { "gprs.downlink_cs4", "CS4 downlink "}, - { "egprs.downlink_mcs1", "MCS1 downlink "}, - { "egprs.downlink_mcs2", "MCS2 downlink "}, - { "egprs.downlink_mcs3", "MCS3 downlink "}, - { "egprs.downlink_mcs4", "MCS4 downlink "}, - { "egprs.downlink_mcs5", "MCS5 downlink "}, - { "egprs.downlink_mcs6", "MCS6 downlink "}, - { "egprs.downlink_mcs7", "MCS7 downlink "}, - { "egprs.downlink_mcs8", "MCS8 downlink "}, - { "egprs.downlink_mcs9", "MCS9 downlink "}, - { "gprs.uplink_cs1", "CS1 Uplink "}, - { "gprs.uplink_cs2", "CS2 Uplink "}, - { "gprs.uplink_cs3", "CS3 Uplink "}, - { "gprs.uplink_cs4", "CS4 Uplink "}, - { "egprs.uplink_mcs1", "MCS1 Uplink "}, - { "egprs.uplink_mcs2", "MCS2 Uplink "}, - { "egprs.uplink_mcs3", "MCS3 Uplink "}, - { "egprs.uplink_mcs4", "MCS4 Uplink "}, - { "egprs.uplink_mcs5", "MCS5 Uplink "}, - { "egprs.uplink_mcs6", "MCS6 Uplink "}, - { "egprs.uplink_mcs7", "MCS7 Uplink "}, - { "egprs.uplink_mcs8", "MCS8 Uplink "}, - { "egprs.uplink_mcs9", "MCS9 Uplink "}, -}; - -static const struct rate_ctr_group_desc bts_ctrg_desc = { - "bts", - "BTS Statistics", - OSMO_STATS_CLASS_GLOBAL, - ARRAY_SIZE(bts_ctr_description), - bts_ctr_description, -}; - static const struct osmo_stat_item_desc bts_stat_item_description[] = { { "ms.present", "MS Present ", OSMO_STAT_ITEM_NO_UNIT, 4, 0}, @@ -179,11 +78,6 @@ return BTS::main_bts()->bts_data(); } -struct rate_ctr_group *bts_main_data_stats() -{ - return BTS::main_bts()->rate_counters(); -} - BTS::BTS() : m_cur_fn(0) , m_cur_blk_fn(-1) @@ -207,8 +101,6 @@ } } - m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); - OSMO_ASSERT(m_ratectrs); m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0); OSMO_ASSERT(m_statg); } @@ -219,7 +111,8 @@ * m_ms_store's destructor */ m_ms_store.cleanup(); - rate_ctr_group_free(m_ratectrs); + if (m_bts.ctrs) + rate_ctr_group_free(m_bts.ctrs); osmo_stat_item_group_free(m_statg); } diff --git a/src/bts.h b/src/bts.h index d65cd2f..607b4c1 100644 --- a/src/bts.h +++ b/src/bts.h @@ -231,6 +231,9 @@ /* State for dynamic algorithm selection */ int multislot_disabled; + /* Statistics */ + struct rate_ctr_group *ctrs; + /** * Point back to the C++ object. This is used during the transition * period. @@ -482,7 +485,6 @@ /* * Below for C interface for the VTY */ - struct rate_ctr_group *rate_counters() const; struct osmo_stat_item_group *stat_items() const; LListHead& ul_tbfs(); @@ -493,7 +495,6 @@ struct gprs_rlcmac_bts m_bts; PollController m_pollController; SBAController m_sba; - struct rate_ctr_group *m_ratectrs; struct osmo_stat_item_group *m_statg; GprsMsStorage m_ms_store; @@ -570,11 +571,6 @@ return m_assigned_tfi[dir]; } -inline struct rate_ctr_group *BTS::rate_counters() const -{ - return m_ratectrs; -} - inline struct osmo_stat_item_group *BTS::stat_items() const { return m_statg; @@ -582,12 +578,14 @@ #define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ inline void BTS::func_name(int inc) {\ - rate_ctr_add(&m_ratectrs->ctr[ctr_name], inc); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \ } #define CREATE_COUNT_INLINE(func_name, ctr_name) \ inline void BTS::func_name() {\ - rate_ctr_inc(&m_ratectrs->ctr[ctr_name]); \ + OSMO_ASSERT(m_bts.ctrs); \ + rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \ } CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) @@ -705,8 +703,6 @@ extern "C" { #endif struct gprs_rlcmac_bts *bts_main_data(); - struct rate_ctr_group *bts_main_data_stats(); - struct osmo_stat_item_group *bts_main_data_stat_items(); #ifdef __cplusplus } diff --git a/src/pcu_ctr.c b/src/pcu_ctr.c new file mode 100644 index 0000000..2069f74 --- /dev/null +++ b/src/pcu_ctr.c @@ -0,0 +1,129 @@ +/* pcu_ctr.c + * + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "pcu_ctr.h" + +#include +#include +#include + +extern void *tall_pcu_ctx; + +static const struct rate_ctr_desc bts_ctr_description[] = { + { "tbf.dl.alloc", "TBF DL Allocated "}, + { "tbf.dl.freed", "TBF DL Freed "}, + { "tbf.dl.aborted", "TBF DL Aborted "}, + { "tbf.ul.alloc", "TBF UL Allocated "}, + { "tbf.ul.freed", "TBF UL Freed "}, + { "tbf.ul.aborted", "TBF UL Aborted "}, + { "tbf.reused", "TBF Reused "}, + { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, + { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, + { "tbf.failed.egprs-only", "TBF Failed EGPRS-only"}, + { "rlc.sent", "RLC Sent "}, + { "rlc.resent", "RLC Resent "}, + { "rlc.restarted", "RLC Restarted "}, + { "rlc.stalled", "RLC Stalled "}, + { "rlc.nacked", "RLC Nacked "}, + { "rlc.final_block_resent", "RLC Final Blk resent "}, + { "rlc.ass.timedout", "RLC Assign Timeout "}, + { "rlc.ass.failed", "RLC Assign Failed "}, + { "rlc.ack.timedout", "RLC Ack Timeout "}, + { "rlc.ack.failed", "RLC Ack Failed "}, + { "rlc.rel.timedout", "RLC Release Timeout "}, + { "rlc.late-block", "RLC Late Block "}, + { "rlc.sent-dummy", "RLC Sent Dummy "}, + { "rlc.sent-control", "RLC Sent Control "}, + { "rlc.dl_bytes", "RLC DL Bytes "}, + { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, + { "rlc.ul_bytes", "RLC UL Bytes "}, + { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, + { "decode.errors", "Decode Errors "}, + { "sba.allocated", "SBA Allocated "}, + { "sba.freed", "SBA Freed "}, + { "sba.timedout", "SBA Timeout "}, + { "llc.timeout", "Timedout Frames "}, + { "llc.dropped", "Dropped Frames "}, + { "llc.scheduled", "Scheduled Frames "}, + { "llc.dl_bytes", "RLC encapsulated PDUs"}, + { "llc.ul_bytes", "full PDUs received "}, + { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "spb.uplink_first_segment", "First seg of UL SPB "}, + { "spb.uplink_second_segment", "Second seg of UL SPB "}, + { "spb.downlink_first_segment", "First seg of DL SPB "}, + { "spb.downlink_second_segment","Second seg of DL SPB "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_rej", "Immediate Assign Rej "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "channel.request_description","Channel Request Desc "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.access_reject", "Packet Access Reject "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, +}; + +struct rate_ctr_group *pcu_ctr_init() +{ + const struct rate_ctr_group_desc bts_ctrg_desc = { + "bts", + "BTS Statistics", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(bts_ctr_description), + bts_ctr_description, + }; + + return rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0); +} diff --git a/src/pcu_ctr.h b/src/pcu_ctr.h new file mode 100644 index 0000000..e1d8032 --- /dev/null +++ b/src/pcu_ctr.h @@ -0,0 +1,32 @@ +/* pcu_ctr.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * Author: Max Suraev + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#include +#include + +#include +#include +#include + +struct rate_ctr_group *pcu_ctr_init(); diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b7574f9..c7dd3ed 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -30,6 +30,7 @@ #include extern "C" { #include "pcu_vty.h" +#include "pcu_ctr.h" #include #include #include @@ -251,6 +252,7 @@ vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); + bts->ctrs = pcu_ctr_init(); handle_options(argc, argv); if ((!!spoof_mcc) + (!!spoof_mnc) == 1) { diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 5ec16ea..c94f7d2 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "pcu_vty.h" #include "gprs_rlcmac.h" @@ -836,7 +837,9 @@ "show bts statistics", SHOW_STR "BTS related functionality\nStatistics\n") { - vty_out_rate_ctr_group(vty, "", bts_main_data_stats()); + struct gprs_rlcmac_bts *bts = bts_main_data(); + + vty_out_rate_ctr_group(vty, "", bts->ctrs); return CMD_SUCCESS; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..48ca24f 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } /* globals used by the code */ @@ -117,6 +118,7 @@ printf("Testing alloc_a direction(%d)\n", dir); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; struct gprs_rlcmac_trx *trx = &bts->trx[0]; @@ -195,6 +197,7 @@ printf("Testing UL then DL assignment.\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -237,6 +240,7 @@ printf("Testing DL then UL assignment followed by update\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -284,6 +288,7 @@ printf("Testing jolly example\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -345,6 +350,7 @@ gprs_rlcmac_tbf *ul_tbf, *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -389,6 +395,7 @@ gprs_rlcmac_dl_tbf *dl_tbf; bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; @@ -482,6 +489,7 @@ uint8_t trx_no = -1; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); gprs_rlcmac_tbf *tbf = NULL; @@ -663,6 +671,7 @@ printf("Going to test assignment with many TBF, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -701,6 +710,7 @@ printf("Going to test assignment with many connections, %s\n", text); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = algo; trx = &bts->trx[0]; @@ -809,6 +819,7 @@ printf("Testing DL TS allocation for Multi UEs\n"); bts = the_bts.bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_b; trx = &bts->trx[0]; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..604366e 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -30,7 +30,7 @@ extern "C" { #include "pcu_vty.h" - +#include "pcu_ctr.h" #include #include #include @@ -74,6 +74,7 @@ printf("=== start %s ===\n", __func__); + the_bts.bts_data()->ctrs = pcu_ctr_init(); the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a; the_bts.bts_data()->trx[0].pdch[2].enable(); the_bts.bts_data()->trx[0].pdch[3].enable(); @@ -148,6 +149,7 @@ gprs_rlcmac_trx *trx; bts = the_bts->bts_data(); + bts->ctrs = pcu_ctr_init(); bts->alloc_algorithm = alloc_algorithm_a; bts->initial_cs_dl = cs; bts->initial_cs_ul = cs; diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 7d09108..25d689b 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include } #define OSMO_ASSERT_STR_EQ(a, b) \ @@ -351,6 +352,7 @@ int bsn_begin, bsn_end, num_blocks; Ack_Nack_Description_t desc; + dummy_bts.bts_data()->ctrs = pcu_ctr_init(); dl_win.m_v_b.reset(); OSMO_ASSERT(dl_win.window_empty()); -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 26 09:09:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 09:09:18 +0000 Subject: osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 9: > was the removal of the comment intentional? Yes. If I've understood it correctly than after move to .c file it's not relevant anymore. Holger, could you please clarify if that's correct? -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 09:17:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 09:17:28 +0000 Subject: osmo-hlr[master]: db api: fix/add API docs In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/4415/2/src/db_hlr.c File src/db_hlr.c: Line 85: * \returns if the subscriber was found and removed, -EIO on database error, 0 is missing? -- To view, visit https://gerrit.osmocom.org/4415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I854fafd8e56bd0b8394f8ed79d023c11c2fdbdca Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 26 09:19:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 09:19:31 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/4311/6/src/ctrl.c File src/ctrl.c: Line 233: aud3g.algo = OSMO_AUTH_ALG_NONE; > ah, I think that might have come from the VTY code where I used to print "2 I think it's worth putting this clarification right here next to the code rather than leaving it as gerrit comment only. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 6 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 26 09:53:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Oct 2017 09:53:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: config: Fix crash in overlay() Message-ID: Review at https://gerrit.osmocom.org/4422 config: Fix crash in overlay() if len(src) > len(dest), then we hit an out-of-bounds crash accessing dest[i]. It is totally valid to have src and dest with different lens, as you may want to override only part of the list. Change-Id: I4f8a191810e89a4081199edcb390fb3bb27ed42f --- M src/osmo_gsm_tester/config.py 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/22/4422/1 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 0721c30..7f1e52f 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -281,9 +281,12 @@ if is_list(dest): if not is_list(src): raise ValueError('cannot combine list with a value of type: %r' % type(src)) - for i in range(len(src)): + copy_len = min(len(src),len(dest)) + for i in range(copy_len): log.ctx(idx=i) dest[i] = overlay(dest[i], src[i]) + for i in range(copy_len, len(src)): + dest.append(src[i]) return dest return src -- To view, visit https://gerrit.osmocom.org/4422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f8a191810e89a4081199edcb390fb3bb27ed42f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 26 09:53:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Oct 2017 09:53:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: util: Add setcap_net_raw API Message-ID: Review at https://gerrit.osmocom.org/4423 util: Add setcap_net_raw API Some binaries such as osmo-bts-ocpty require specific capabilities, and we need to provide them in case osmo-gsm-tester is not run as root. Change-Id: If3eb24461c02173dc80837a4cc83f9f2420c7816 --- M src/osmo_gsm_tester/util.py 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/23/4423/1 diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index c07bcf2..e0de997 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -49,6 +49,16 @@ pass return None +def setcap_net_raw(binary): + '''This functionality requires specific setup on the host running + osmo-gsm-tester. See osmo-gsm-tester manual for more information.''' + proc = subprocess.Popen(['sudo', 'osmo-gsm-tester_setcap_net_raw.sh', binary], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) + (stdoutdata, stderrdata) = proc.communicate() + if proc.returncode != 0: + print('stdout: %s' % stdoutdata) + print('stderr: %s' % stderrdata) + raise RuntimeError('setcap_net_raw subprocess finished with err code %d' % proc.returncode) + class listdict(dict): 'a dict of lists { "a": [1, 2, 3], "b": [1, 2] }' -- To view, visit https://gerrit.osmocom.org/4423 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3eb24461c02173dc80837a4cc83f9f2420c7816 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 26 09:53:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Oct 2017 09:53:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: util: Add change_elf_rpath API Message-ID: Review at https://gerrit.osmocom.org/4424 util: Add change_elf_rpath API Linux dynamic loader avoids loading shared libraries from env vars such as LD_LIBRALY_PATH for ELF binaries which have capabilitiy flags enabled for security reasons. For these binaries, we modify the RPATH of the ELF header to tell the loader where to find the libraries. Change-Id: Ibc356957fb3dbcf9947bfe96b671ec8c7ede33ff --- M src/osmo_gsm_tester/util.py 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/24/4424/1 diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index e0de997..d192719 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -38,6 +38,17 @@ return path return path + ':' + lp +def change_elf_rpath(binary, paths): + '''Change RPATH field in ELF executable binary. + This feature can be used to tell the loaded to load the trial libraries, as + LD_LIBRARY_PATH is disabled for paths with modified capabilities.''' + proc = subprocess.Popen(['patchelf', '--set-rpath', paths, binary], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) + (stdoutdata, stderrdata) = proc.communicate() + if proc.returncode != 0: + print('stdout: %s' % stdoutdata) + print('stderr: %s' % stderrdata) + raise RuntimeError('change_elf_rpath finished with err code %d' % proc.returncode) + def ip_to_iface(ip): try: for iface in os.listdir('/sys/class/net'): -- To view, visit https://gerrit.osmocom.org/4424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibc356957fb3dbcf9947bfe96b671ec8c7ede33ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 26 09:53:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Oct 2017 09:53:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add support for osmo-bts-octphy Message-ID: Review at https://gerrit.osmocom.org/4425 Add support for osmo-bts-octphy Specific parts for this class: - Runs osmo-bts-octphy binary, that requires CAP_NET_RAW capability because it uses an AF_PACKET socket. - As a consequence, it must use the previously added APIs to set the capability and modify the RPATH of the binary before launching it. These APIs require extra host setup and installed dependencies that will be documented soon in osmo-gsm-tester manual. - A num_trx() helper method is added because the binary requires that parameter. - A allocate_phy_instances() is added to help build/fill the conf dictionary to be used in the tmpl to be able to easily set up trx, phy and insances. A config to use a osmo-bts-octphy at full power is used (4 trx) is added in this commit to show how can it be configured. However our current license only has support to use 1 TRX, and so next commit drops most configurations to simplify the setup to use only 1 TRX. Change-Id: Ia350964fa539083bb68d439cad0caa8fdf85d297 --- M example/defaults.conf M example/resources.conf A src/osmo_gsm_tester/bts_octphy.py M src/osmo_gsm_tester/resource.py A src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl 5 files changed, 273 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/25/4425/1 diff --git a/example/defaults.conf b/example/defaults.conf index e2921a4..7711297 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -45,3 +45,43 @@ - phys_chan_config: TCH/F - phys_chan_config: TCH/F - phys_chan_config: TCH/F + +osmo_bts_octphy: + trx_list: + - {} + - nominal_power: 23 + max_power_red: 0 + arfcn: 869 + timeslot_list: + - phys_chan_config: CCCH+SDCCH4 + - phys_chan_config: SDCCH8 + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - nominal_power: 23 + max_power_red: 0 + arfcn: 870 + timeslot_list: + - phys_chan_config: CCCH+SDCCH4 + - phys_chan_config: SDCCH8 + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - nominal_power: 23 + max_power_red: 0 + arfcn: 871 + timeslot_list: + - phys_chan_config: CCCH+SDCCH4 + - phys_chan_config: SDCCH8 + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F + - phys_chan_config: TCH/F diff --git a/example/resources.conf b/example/resources.conf index 70c1c35..c611dea 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -31,6 +31,21 @@ trx_remote_ip: 10.42.42.112 ciphers: [a5_0, a5_1] +- label: Octphy 3500 + type: osmo-bts-octphy + ipa_unit_id: 8 + addr: 10.42.42.52 + band: GSM-1800 + trx_list: + - hw_addr: 00:0c:90:2e:80:1e + net_device: eth1 + - hw_addr: 00:0c:90:2e:80:1e + net_device: eth1 + - hw_addr: 00:0c:90:2e:87:52 + net_device: eth1 + - hw_addr: 00:0c:90:2e:87:52 + net_device: eth1 + arfcn: - arfcn: 512 band: GSM-1800 diff --git a/src/osmo_gsm_tester/bts_octphy.py b/src/osmo_gsm_tester/bts_octphy.py new file mode 100644 index 0000000..5014f40 --- /dev/null +++ b/src/osmo_gsm_tester/bts_octphy.py @@ -0,0 +1,168 @@ +# osmo_gsm_tester: specifics for running an osmo-bts-octphy +# +# Copyright (C) 2016-2017 by sysmocom - s.f.m.c. GmbH +# +# Author: Pau Espin Pedrol +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os +import pprint +import tempfile +from . import log, config, util, template, process, event_loop + +class OsmoBtsOctphy(log.Origin): + suite_run = None + bsc = None + run_dir = None + inst = None + env = None + pcu_sk_tmp_dir = None + values = None + + BIN_BTS_OCTPHY = 'osmo-bts-octphy' + + CONF_BTS_OCTPHY = 'osmo-bts-octphy.cfg' + + def __init__(self, suite_run, conf): + super().__init__(log.C_RUN, OsmoBtsOctphy.BIN_BTS_OCTPHY) + self.suite_run = suite_run + self.conf = conf + self.env = {} + self.values = {} + self.pcu_sk_tmp_dir = tempfile.mkdtemp('', 'ogtpcusk') + if len(self.pcu_socket_path().encode()) > 107: + raise log.Error('Path for pcu socket is longer than max allowed len for unix socket path (107):', self.pcu_socket_path()) + + def cleanup(self): + if self.pcu_sk_tmp_dir: + try: + os.remove(self.pcu_socket_path()) + except OSError: + pass + os.rmdir(self.pcu_sk_tmp_dir) + + def pcu_socket_path(self): + return os.path.join(self.pcu_sk_tmp_dir, 'pcu_bts') + + def remote_addr(self): + return self.conf.get('addr') + + def start(self): + if self.bsc is None: + raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') + self.suite_run.poll() + + self.log('Starting to connect to', self.bsc) + self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) + self.configure() + + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-bts'))) + btsoct_path = self.inst.child('bin', OsmoBtsOctphy.BIN_BTS_OCTPHY) + lib = self.inst.child('lib') + if not os.path.isdir(lib): + raise RuntimeError('No lib/ in %r' % self.inst) + + # setting capabilities will later disable use of LD_LIBRARY_PATH from ELF loader -> modify RPATH instead. + self.log('Setting RPATH for', OsmoBtsOctphy.BIN_BTS_OCTPHY) + util.change_elf_rpath(btsoct_path, util.prepend_library_path(lib)) + # osmo-bty-octphy requires CAP_NET_RAW to open AF_PACKET socket: + self.log('Applying CAP_NET_RAW capability to', OsmoBtsOctphy.BIN_BTS_OCTPHY) + util.setcap_net_raw(btsoct_path) + + self.launch_process(OsmoBtsOctphy.BIN_BTS_OCTPHY, '-r', '1', + '-c', os.path.abspath(self.config_file), + '-i', self.bsc.addr(), '-t', str(self.num_trx())) + #self.launch_process(OsmoBtsOctphy.BIN_PCU, '-r', '1') + self.suite_run.poll() + + def launch_process(self, binary_name, *args): + binary = os.path.abspath(self.inst.child('bin', binary_name)) + run_dir = self.run_dir.new_dir(binary_name) + if not os.path.isfile(binary): + raise RuntimeError('Binary missing: %r' % binary) + proc = process.Process(binary_name, run_dir, + (binary,) + args, + env=self.env) + self.suite_run.remember_to_stop(proc) + proc.launch() + return proc + + def num_trx(self): + return len(self.values['osmo_bts_octphy'].get('trx_list', [])) + + def allocate_phy_instances(self, c): + ''' + Generate match trx Z <-> phy X inst Y to use in vty config + + We create a new phy for each trx found with a new hwaddr. If hwaddr is + already there, increase num_instances and give last instance index to + the current trx. + ''' + phy_list = [] + for trx in c.get('trx_list', []): + hwaddr = trx.get('hw_addr', None) + netdev = trx.get('net_device', None) + if hwaddr is None: + raise log.Error('Expected hw-addr value not found!') + found = False + phy_idx = 0 + for phy in phy_list: + if phy['hw_addr'] == hwaddr: + phy['num_instances'] += 1 + found = True + break + phy_idx += 1 + if not found: + phy_list.append({'hw_addr': hwaddr, 'net_device': netdev, 'num_instances': 1}) + trx['phy_idx'] = phy_idx + trx['instance_idx'] = phy_list[phy_idx]['num_instances'] - 1 + c['phy_list'] = phy_list + + def configure(self): + if self.bsc is None: + raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be configured') + self.config_file = self.run_dir.new_file(OsmoBtsOctphy.CONF_BTS_OCTPHY) + self.dbg(config_file=self.config_file) + + values = dict(osmo_bts_octphy=config.get_defaults('osmo_bts_octphy')) + config.overlay(values, self.suite_run.config()) + config.overlay(values, { + 'osmo_bts_octphy': { + 'oml_remote_ip': self.bsc.addr(), + 'pcu_socket_path': self.pcu_socket_path(), + } + }) + config.overlay(values, { 'osmo_bts_octphy': self.conf }) + + self.allocate_phy_instances(values['osmo_bts_octphy']) + + self.dbg('OSMO-BTS-OCTPHY CONFIG:\n' + pprint.pformat(values)) + self.values = values + with open(self.config_file, 'w') as f: + r = template.render(OsmoBtsOctphy.CONF_BTS_OCTPHY, values) + self.dbg(r) + f.write(r) + + def conf_for_bsc(self): + values = config.get_defaults('bsc_bts') + config.overlay(values, config.get_defaults('osmo_bts_octphy')) + config.overlay(values, self.conf) + self.dbg(conf=values) + return values + + def set_bsc(self, bsc): + self.bsc = bsc + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 7e55129..25bb00f 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -29,7 +29,7 @@ from . import schema from . import ofono_client from . import osmo_nitb -from . import bts_sysmo, bts_osmotrx +from . import bts_sysmo, bts_osmotrx, bts_octphy from .util import is_dict, is_list @@ -83,6 +83,7 @@ KNOWN_BTS_TYPES = { 'osmo-bts-sysmo': bts_sysmo.SysmoBts, 'osmo-bts-trx': bts_osmotrx.OsmoBtsTrx, + 'osmo-bts-octphy': bts_octphy.OsmoBtsOctphy, } def register_bts_type(name, clazz): diff --git a/src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl new file mode 100644 index 0000000..13cdb1d --- /dev/null +++ b/src/osmo_gsm_tester/templates/osmo-bts-octphy.cfg.tmpl @@ -0,0 +1,48 @@ +! Configuration rendered by osmo-gsm-tester +log stderr + logging color 1 + logging print extended-timestamp 1 + logging print category 1 + logging level abis debug + logging level oml debug + logging level pag debug + logging level rll debug + logging level rr debug + logging level rsl debug +! + +%for phy in osmo_bts_octphy.phy_list: +phy ${loop.index} + octphy hw-addr ${phy.hw_addr} + octphy net-device ${phy.net_device} + octphy rx-gain 70 + %for inst in range(phy.num_instances): + instance ${loop.index} + %endfor +%endfor +bts 0 + band ${osmo_bts_octphy.band} + ipa unit-id ${osmo_bts_octphy.ipa_unit_id} 0 + oml remote-ip ${osmo_bts_octphy.oml_remote_ip} + pcu-socket ${osmo_bts_octphy.pcu_socket_path} + gsmtap-sapi bcch + gsmtap-sapi ccch + gsmtap-sapi rach + gsmtap-sapi agch + gsmtap-sapi pch + gsmtap-sapi sdcch + gsmtap-sapi tch/f + gsmtap-sapi tch/h + gsmtap-sapi pacch + gsmtap-sapi pdtch + gsmtap-sapi ptcch + gsmtap-sapi cbch + gsmtap-sapi sacch +%for trx in osmo_bts_octphy.trx_list: + trx ${loop.index} + power-ramp max-initial 23000 mdBm + power-ramp step-size 2000 mdB + power-ramp step-interval 1 + ms-power-control dsp + phy ${trx.phy_idx} instance ${trx.instance_idx} +%endfor -- To view, visit https://gerrit.osmocom.org/4425 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia350964fa539083bb68d439cad0caa8fdf85d297 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 26 09:53:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Oct 2017 09:53:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Change example config to use only 1 TRX for osmo-bts-octphy ... Message-ID: Review at https://gerrit.osmocom.org/4426 Change example config to use only 1 TRX for osmo-bts-octphy BTS. Our current Octasic license has multi-trx support disabled and the board rejects the configuration. Change-Id: Id2c415deb85187feb42fb6d24cc86273eb722936 --- M example/defaults.conf M example/resources.conf 2 files changed, 0 insertions(+), 46 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/26/4426/1 diff --git a/example/defaults.conf b/example/defaults.conf index 7711297..e2921a4 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -45,43 +45,3 @@ - phys_chan_config: TCH/F - phys_chan_config: TCH/F - phys_chan_config: TCH/F - -osmo_bts_octphy: - trx_list: - - {} - - nominal_power: 23 - max_power_red: 0 - arfcn: 869 - timeslot_list: - - phys_chan_config: CCCH+SDCCH4 - - phys_chan_config: SDCCH8 - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - nominal_power: 23 - max_power_red: 0 - arfcn: 870 - timeslot_list: - - phys_chan_config: CCCH+SDCCH4 - - phys_chan_config: SDCCH8 - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - nominal_power: 23 - max_power_red: 0 - arfcn: 871 - timeslot_list: - - phys_chan_config: CCCH+SDCCH4 - - phys_chan_config: SDCCH8 - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F - - phys_chan_config: TCH/F diff --git a/example/resources.conf b/example/resources.conf index c611dea..aaa5c60 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -39,12 +39,6 @@ trx_list: - hw_addr: 00:0c:90:2e:80:1e net_device: eth1 - - hw_addr: 00:0c:90:2e:80:1e - net_device: eth1 - - hw_addr: 00:0c:90:2e:87:52 - net_device: eth1 - - hw_addr: 00:0c:90:2e:87:52 - net_device: eth1 arfcn: - arfcn: 512 -- To view, visit https://gerrit.osmocom.org/4426 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id2c415deb85187feb42fb6d24cc86273eb722936 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 26 09:53:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Oct 2017 09:53:10 +0000 Subject: [PATCH] osmo-gsm-tester[master]: default-suites: Add test cases with octphy BTS Message-ID: Review at https://gerrit.osmocom.org/4427 default-suites: Add test cases with octphy BTS Change-Id: If8b5bda50c245ad693e7679ad44515b90a067fbb --- M example/default-suites.conf 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/27/4427/1 diff --git a/example/default-suites.conf b/example/default-suites.conf index 3fd1322..ea0ca57 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -7,6 +7,9 @@ - sms:trx-sysmocell5000 - aoip_sms:trx-sysmocell5000 - voice:trx-sysmocell5000 +- sms:octphy +- aoip_sms:octphy +- voice:octphy - smpp - aoip_smpp - aoip_encryption -- To view, visit https://gerrit.osmocom.org/4427 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8b5bda50c245ad693e7679ad44515b90a067fbb Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Oct 26 12:59:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 12:59:18 +0000 Subject: [PATCH] osmo-sgsn[master]: gbproxy: don't link to sigtran Message-ID: Review at https://gerrit.osmocom.org/4428 gbproxy: don't link to sigtran * remove sigtran include from common_vty.c because nothing uses it * remove LIBOSMOSIGTRAN_LIBS from generic OSMO_LIBS definition because it's linked explicitly when necessary Change-Id: I015a9d858bc2a95f8c9a4aedd3e0a84eadcf84e1 --- M src/gprs/Makefile.am M src/libcommon/common_vty.c 2 files changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/28/4428/1 diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index 654604b..9437225 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -34,7 +34,6 @@ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBGTP_LIBS) \ - $(LIBOSMOSIGTRAN_LIBS) \ $(NULL) bin_PROGRAMS = \ diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index ac3c7fc..e960550 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -33,7 +33,6 @@ #include #include #include -#include int bsc_vty_go_parent(struct vty *vty) -- To view, visit https://gerrit.osmocom.org/4428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I015a9d858bc2a95f8c9a4aedd3e0a84eadcf84e1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 26 13:16:18 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Oct 2017 13:16:18 +0000 Subject: [PATCH] osmo-bsc[master]: log: log the sccp message type of messages sent In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4351 to look at the new patch set (#2). log: log the sccp message type of messages sent We already log the message type of sccp messages we receive, but for transmitting the log output is missing. Also log the message type for tramsitted sccp messages. Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7 --- M src/osmo-bsc/osmo_bsc_sigtran.c 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/51/4351/2 diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 48796c1..31a8cea 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -331,6 +331,22 @@ msc = conn->msc; + /* Log the type of the message we are sending. This is just + * informative, do not stop if detecting the type fails */ + if (msg->len >= 3) { + switch (msg->data[0]) { + case BSSAP_MSG_BSS_MANAGEMENT: + LOGP(DMSC, LOGL_INFO, "Tx MSC %s\n", gsm0808_bssmap_name(msg->data[2])); + break; + case BSSAP_MSG_DTAP: + LOGP(DMSC, LOGL_INFO, "Tx MSC DTAP\n"); + break; + default: + LOGP(DMSC, LOGL_ERROR, "Tx MSC (unknwon message type)\n"); + } + } else + LOGP(DMSC, LOGL_ERROR, "Tx MSC (message too short)\n"); + if (a_reset_conn_ready(msc->a.reset) == false) { LOGP(DMSC, LOGL_ERROR, "MSC is not connected. Dropping.\n"); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/4351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 26 13:17:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Oct 2017 13:17:28 +0000 Subject: [PATCH] osmo-bsc[master]: log: output hexdump of transmitted sccp messages In-Reply-To: References: Message-ID: Hello Max, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4350 to look at the new patch set (#2). log: output hexdump of transmitted sccp messages We output a hexdump for each sccp message we receive, but not when sending. Also log the hexdump of sccp messages when sending. Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345 --- M src/osmo-bsc/osmo_bsc_sigtran.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/4350/2 diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 31a8cea..951061a 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -356,8 +356,8 @@ ss7 = osmo_ss7_instance_find(msc->a.cs7_instance); OSMO_ASSERT(ss7); - LOGP(DMSC, LOGL_DEBUG, "Sending connection (id=%i) oriented data to MSC: %si\n", - conn_id, osmo_sccp_addr_name(ss7, &msc->a.msc_addr)); + LOGP(DMSC, LOGL_DEBUG, "Sending connection (id=%i) oriented data to MSC: %s (%s)\n", + conn_id, osmo_sccp_addr_name(ss7, &msc->a.msc_addr), osmo_hexdump(msg->data, msg->len)); rc = osmo_sccp_tx_data_msg(msc->a.sccp_user, conn_id, msg); -- To view, visit https://gerrit.osmocom.org/4350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 26 13:17:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Oct 2017 13:17:28 +0000 Subject: [PATCH] osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4334 to look at the new patch set (#5). mgcp: use osmo-mgw to switch RTP streams osmo-bsc currently negotiates the RTP stream directly with the BTS and reports back the RTP IP/Port on the BTS. This works fine for a single BTS, but for Handover the port/ip pointing to the MSC side must not change, so an entity in between the BTSs and the MSC is required. Integrate the mgcp-client and use osmo-mgw to switch the RTP streams. TODO: Handover will not work yet, because there is no functionality to update the connection with the port/ip of the new BTS. Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/osmo_bsc.h A include/osmocom/bsc/osmo_bsc_mgcp.h M src/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c A src/osmo-bsc/osmo_bsc_mgcp.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c 13 files changed, 1,030 insertions(+), 65 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/34/4334/5 diff --git a/configure.ac b/configure.ac index 4edbb83..f73f33c 100644 --- a/configure.ac +++ b/configure.ac @@ -47,8 +47,9 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) +PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 1.0.0) dnl checks for header files AC_HEADER_STDC @@ -135,7 +136,6 @@ src/libfilter/Makefile src/libcommon-cs/Makefile src/osmo-bsc/Makefile - src/osmo-bsc_nat/Makefile src/ipaccess/Makefile src/utils/Makefile tests/Makefile diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 8ad2b5d..1f7cd39 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -41,6 +41,7 @@ openbscdefines.h \ osmo_bsc.h \ osmo_bsc_grace.h \ + osmo_bsc_mgcp.h \ osmo_bsc_rf.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 51b2c98..5cb7efd 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -479,6 +479,11 @@ uint8_t t3212; struct { + struct mgcp_client_conf *conf; + struct mgcp_client *client; + } mgw; + + struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; /* A list with the context information about diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h index 5ebea50..8a5cd30 100644 --- a/include/osmocom/bsc/osmo_bsc.h +++ b/include/osmocom/bsc/osmo_bsc.h @@ -29,6 +29,20 @@ uint32_t rtp_ip; int rtp_port; + /* RTP address of the remote end (assigned by MSC through assignment + * request) */ + struct sockaddr_storage aoip_rtp_addr_remote; + + /* Local RTP address (reported back to the MSC by us with the + * assignment complete message) */ + struct sockaddr_storage aoip_rtp_addr_local; + + /* storage to keep states of the MGCP connection handler, the + * handler is created when an assignment request is received + * and is terminated when the assignment complete message is + * sent */ + struct mgcp_ctx *mgcp_ctx; + /* for advanced ping/pong */ int send_ping; @@ -72,4 +86,6 @@ struct llist_head *bsc_access_lists(void); +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan); + #endif diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h new file mode 100644 index 0000000..7246dda --- /dev/null +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -0,0 +1,45 @@ +/* (C) 2017 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +/* MGCP state handler context (fsm etc..) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* RTP endpoint number */ + uint16_t rtp_endpoint; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct mgcp_client *mgcp; + + struct osmo_bsc_sccp_con *conn; + enum gsm48_chan_mode chan_mode; + bool full_rate; + struct gsm_lchan *lchan; + struct msgb *resp; +}; + +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct mgcp_client *mgcp, struct osmo_bsc_sccp_con *conn, + enum gsm48_chan_mode chan_mode, bool full_rate); +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan); diff --git a/src/Makefile.am b/src/Makefile.am index d04f025..dd1ad3d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,5 +33,4 @@ utils \ ipaccess \ osmo-bsc \ - osmo-bsc_nat \ $(NULL) diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index dfc4def..7db698c 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -15,6 +15,7 @@ $(COVERAGE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -30,6 +31,7 @@ osmo_bsc_vty.c \ osmo_bsc_api.c \ osmo_bsc_grace.c \ + osmo_bsc_mgcp.c \ osmo_bsc_msc.c \ osmo_bsc_sigtran.c \ osmo_bsc_filter.c \ @@ -53,4 +55,5 @@ $(COVERAGE_LDFLAGS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(NULL) diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index 94aa350..326703d 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -29,46 +29,9 @@ #include #include #include +#include #include - -/* Generate and send assignment complete message */ -static int send_aoip_ass_compl(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan) -{ - struct msgb *resp; - struct sockaddr_storage rtp_addr; - struct sockaddr_in rtp_addr_in; - struct gsm0808_speech_codec sc; - - OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); - - /* Package RTP-Address data */ - memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); - rtp_addr_in.sin_family = AF_INET; - rtp_addr_in.sin_port = htons(lchan->abis_ip.bound_port); - rtp_addr_in.sin_addr.s_addr = htonl(lchan->abis_ip.bound_ip); - memset(&rtp_addr, 0, sizeof(rtp_addr)); - memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); - - /* Extrapolate speech codec from speech mode */ - gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); - - /* Generate message */ - resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, - lchan->abis_ip.ass_compl.chosen_channel, - lchan->abis_ip.ass_compl.encr_alg_id, - lchan->abis_ip.ass_compl.speech_mode, - &rtp_addr, - &sc, - NULL); - - if (!resp) { - LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ - return -EINVAL; - } - - return osmo_bsc_sigtran_send(conn->sccp_con, resp); -} static int handle_abisip_signal(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) @@ -124,11 +87,9 @@ * IPA based base stations. See also osmo_bsc_api.c, * function bsc_assign_compl() */ LOGP(DMSC, LOGL_INFO, "Tx MSC ASSIGN COMPL (POSTPONED)\n"); - if (send_aoip_ass_compl(con, lchan) != 0) - return -EINVAL; + mgcp_ass_complete(con->sccp_con->mgcp_ctx, lchan); } break; - break; } return 0; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 4311250..e474b98 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -321,14 +322,29 @@ conn->conn = NULL; } - /* send the clear complete message */ + /* generate the clear complete message */ resp = gsm0808_create_clear_complete(); if (!resp) { LOGP(DMSC, LOGL_ERROR, "Sending clear complete failed.\n"); return -1; } - osmo_bsc_sigtran_send(conn, resp); + if (conn->mgcp_ctx) { + /* NOTE: This is the AoIP case, osmo-bsc has to negotiate with + * the MGCP-GW. For this an mgcp_ctx should be created that + * contains the FSM and some system data. When the connection + * is removed from the MGCP-GW, then osmo_bsc_sigtran_send() + * calls osmo_bsc_sigtran_send(). */ + mgcp_clear_complete(conn->mgcp_ctx, resp); + conn->mgcp_ctx = NULL; + } else { + /* NOTE: This is the SCCP-Lite case, since we do not handle + * the MGCP-GW switching ourselves, we may skip everything + * that is MGCP-GW related and sent the clear complete message + * directly */ + osmo_bsc_sigtran_send(conn, resp); + } + return 0; } @@ -426,7 +442,6 @@ int port, full_rate = -1; bool aoip = false; struct sockaddr_storage rtp_addr; - struct sockaddr_in *rtp_addr_in; struct gsm0808_channel_type ct; struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; @@ -531,28 +546,39 @@ get_value_string(gsm48_chan_mode_names, chan_mode), ct.ch_indctr, ct.ch_rate_type, osmo_hexdump(ct.perm_spch, ct.perm_spch_len)); - if (aoip == false) { - /* map it to a MGCP Endpoint and a RTP port */ + /* Forward the assingment request to lower layers */ + if (aoip) { + /* Store network side RTP connection information, we will + * process this address later after we have established an RTP + * connection to the BTS. This is just for organizational + * reasons, functional wise it would not matter when exactly + * the network side RTP connection is made, as long it is made + * before we return with the assignment complete message. */ + memcpy(&conn->aoip_rtp_addr_remote, &rtp_addr, sizeof(rtp_addr)); + + /* Create an assignment request using the MGCP fsm. This FSM + * is directly started when its created (now) and will also + * take care about the further processing (creating RTP + * endpoints, calling gsm0808_assign_req(), rsponding to + * the assignment request etc... */ + conn->mgcp_ctx = mgcp_assignm_req(msc->network, msc->network->mgw.client, conn, chan_mode, full_rate); + if (!conn->mgcp_ctx) { + LOGP(DMSC, LOGL_ERROR, "MGCP GW failure, rejecting assignment... (id=%i)\n", conn->conn_id); + goto reject; + } + + /* We now may return here, the FSM will do all further work */ + return 0; + } else { + /* Note: In the sccp-lite case we to not perform any mgcp operation, + * (the MSC does that for us). We set conn->rtp_ip to 0 and check + * on this later. By this we know that we have to behave accordingly + * to sccp-lite. */ port = mgcp_timeslot_to_endpoint(multiplex, timeslot); conn->rtp_port = rtp_calculate_port(port, msc->rtp_base); conn->rtp_ip = 0; - } else { - /* use address / port supplied with the AoIP - * transport address element */ - if (rtp_addr.ss_family == AF_INET) { - rtp_addr_in = (struct sockaddr_in *)&rtp_addr; - conn->rtp_port = osmo_ntohs(rtp_addr_in->sin_port); - memcpy(&conn->rtp_ip, &rtp_addr_in->sin_addr.s_addr, - IP_V4_ADDR_LEN); - conn->rtp_ip = osmo_ntohl(conn->rtp_ip); - } else { - LOGP(DMSC, LOGL_ERROR, - "Unsopported addressing scheme. (supports only IPV4)\n"); - goto reject; - } + return gsm0808_assign_req(conn->conn, chan_mode, full_rate); } - - return gsm0808_assign_req(conn->conn, chan_mode, full_rate); reject: resp = @@ -729,3 +755,39 @@ return -1; } + +/* Generate and send assignment complete message */ +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan) +{ + struct msgb *resp; + struct gsm0808_speech_codec sc; + struct gsm_subscriber_connection *conn; + + conn = lchan->conn; + + OSMO_ASSERT(lchan->abis_ip.ass_compl.valid); + OSMO_ASSERT(conn); + OSMO_ASSERT(conn->sccp_con); + + LOGP(DMSC, LOGL_DEBUG, "Sending assignment complete message... (id=%i)\n", conn->sccp_con->conn_id); + + /* Extrapolate speech codec from speech mode */ + gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); + + /* Generate message */ + resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, + lchan->abis_ip.ass_compl.chosen_channel, + lchan->abis_ip.ass_compl.encr_alg_id, + lchan->abis_ip.ass_compl.speech_mode, + &conn->sccp_con->aoip_rtp_addr_local, + &sc, + NULL); + + if (!resp) { + LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message! (id=%i)\n", + conn->sccp_con->conn_id); + return -EINVAL; + } + + return osmo_bsc_sigtran_send(conn->sccp_con, resp); +} diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 5e8f45e..aa267d4 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -44,6 +44,7 @@ #include #include +#include #define _GNU_SOURCE #include @@ -203,6 +204,9 @@ exit(1); } + bsc_gsmnet->mgw.conf = talloc_zero(bsc_gsmnet, struct mgcp_client_conf); + mgcp_client_conf_init(bsc_gsmnet->mgw.conf); + osmo_init_logging(&log_info); osmo_stats_init(tall_bsc_ctx); @@ -274,6 +278,15 @@ } } + bsc_gsmnet->mgw.client = mgcp_client_init(bsc_gsmnet, bsc_gsmnet->mgw.conf); + + if (mgcp_client_connect(bsc_gsmnet->mgw.client)) { + LOGP(DNM, LOGL_ERROR, "MGW connect failed at (%s:%u)\n", + bsc_gsmnet->mgw.conf->remote_addr, + bsc_gsmnet->mgw.conf->remote_port); + exit(1); + } + if (osmo_bsc_sigtran_init(&bsc_gsmnet->bsc_data->mscs) != 0) { LOGP(DNM, LOGL_ERROR, "Failed to initalize sigtran backhaul.\n"); exit(1); diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c new file mode 100644 index 0000000..0ba021e --- /dev/null +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -0,0 +1,853 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define CONN_ID_BTS 1 +#define CONN_ID_NET 2 + +#define MGCP_MGW_TIMEOUT 4 /* in seconds */ +#define MGCP_MGW_TIMEOUT_TIMER_NR 1 +#define MGCP_BSS_TIMEOUT 4 /* in seconds */ +#define MGCP_BSS_TIMEOUT_TIMER_NR 2 + +#define MGCP_ENDPOINT_FORMAT "%i at mgw" + +/* Some internal cause codes to indicate fault + * condition inside the FSM */ +enum int_cause_code { + MGCP_ERR_MGW_FAIL, + MGCP_ERR_MGW_INVAL_RESP, + MGCP_ERR_MGW_TX_FAIL, + MGCP_ERR_UNEXP_TEARDOWN, + MGCP_ERR_ASSGMNT_FAIL, + MGCP_ERR_UNSUPP_ADDR_FMT, + MGCP_ERR_BSS_TIMEOUT +}; + +/* Human readable respresentation of the faul codes, + * will be displayed by handle_error() */ +static const struct value_string int_cause_codes_str[] = { + {MGCP_ERR_MGW_FAIL, "operation failed on MGW"}, + {MGCP_ERR_MGW_INVAL_RESP, "invalid / unparseable response from MGW"}, + {MGCP_ERR_MGW_INVAL_RESP, "failed to transmit MGCP message to MGW"}, + {MGCP_ERR_UNEXP_TEARDOWN, "unexpected connection teardown (BSS)"}, + {MGCP_ERR_ASSGMNT_FAIL, "assignment failure (BSS)"}, + {MGCP_ERR_UNSUPP_ADDR_FMT, "unsupported network address format used (BSS)"}, + {MGCP_ERR_BSS_TIMEOUT, "assignment could not be completed in time (BSS)"}, + {0, NULL} +}; + +enum fsm_states { + ST_CRCX_BTS, + ST_ASSIGN_PROC, + ST_MDCX_BTS, + ST_CRCX_NET, + ST_ASSIGN_COMPL, + ST_DLCX, + ST_HALT +}; + +static const struct value_string fsm_state_names[] = { + {ST_CRCX_BTS, "ST_CRCX_BTS (send CRCX for BTS)"}, + {ST_ASSIGN_PROC, "ST_ASSIGN_PROC (continue assignment)"}, + {ST_MDCX_BTS, "ST_MDCX_BTS (send MDCX for BTS)"}, + {ST_CRCX_NET, "ST_CRCX_NET (send CRCX for NET)"}, + {ST_ASSIGN_COMPL, "ST_ASSIGN_COMPL (complete assignment)"}, + {ST_DLCX, "ST_DLCX (delete all rtp connections)"}, + {ST_HALT, "ST_HALT (destroy state machine)"}, + {0, NULL} +}; + +enum fsm_evt { + /* Initial event: start off the state machine */ + EV_INIT, + + /* External event: Assignment complete, event is issued shortly before + * the assignment complete message is sent via the A-Interface */ + EV_ASS_COMPLETE, + + /* External event: Teardown event, this event is used to notify the end + * of a. It is also issued in case of errors to teardown a half open + * connection. */ + EV_TEARDOWN, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the BTS side */ + EV_CRCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the BTS side */ + EV_MDCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the NET side */ + EV_CRCX_NET_RESP, + + /* Internal event: The mgcp_gw has sent its DLCX response for + * the NET and BTS side */ + EV_DLCX_ALL_RESP, +}; + +static const struct value_string fsm_evt_names[] = { + {EV_INIT, "EV_INIT (start state machine (send CRCX for BTS)"}, + {EV_ASS_COMPLETE, "EV_ASS_COMPLETE (assignment complete)"}, + {EV_TEARDOWN, "EV_TEARDOWN (teardown all connections)"}, + {EV_CRCX_BTS_RESP, "EV_CRCX_BTS_RESP (got CRCX reponse for BTS)"}, + {EV_MDCX_BTS_RESP, "EV_MDCX_BTS_RESP (got MDCX reponse for BTS)"}, + {EV_CRCX_NET_RESP, "EV_CRCX_NET_RESP (got CRCX reponse for NET)"}, + {EV_DLCX_ALL_RESP, "EV_DLCX_ALL_RESP (got DLCX reponse for BTS/NET)"}, + {0, NULL} +}; + +/* A general error handler function. On error we still have an interest to + * remove a half open connection (if possible). This function will execute + * a controlled jump to the DLCX phase. From there, the FSM will then just + * continue like the call were ended normally */ +static void handle_error(struct mgcp_ctx *mgcp_ctx, enum int_cause_code cause) +{ + struct osmo_fsm_inst *fi; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + fi = mgcp_ctx->fsm; + OSMO_ASSERT(fi); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "fsm-state: %s\n", get_value_string(fsm_state_names, fi->state)); + + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "%s -- graceful shutdown...\n", + get_value_string(int_cause_codes_str, cause)); + + /* Set the VM into the state where it waits for the call end */ + osmo_fsm_inst_state_chg(fi, ST_DLCX, 0, 0); + + /* Simulate the call end by sending a teardown event, so that + * the FSM proceeds directly with the DLCX */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_BTS: startup state machine send out CRCX for BTS side */ +static void fsm_crcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_client_next_endpoint(mgcp); + mgcp_ctx->rtp_endpoint = rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "creating connection for the BTS side on " "MGW endpoint:%x...\n", rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = conn->conn_id, + .conn_id = CONN_ID_BTS, + .conn_mode = MGCP_CONN_LOOPBACK + }; + snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/BTS: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, crcx_for_bts_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_PROC, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for BTS associated CRCX */ +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/BTS: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/BTS: Cannot parse response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/BTS: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + /* Set the connection details in the conn struct. The code that + * controls the BTS via RSL will take these values and signal them + * to the BTS via RSL/IPACC */ + conn->rtp_port = r->audio_port; + conn->rtp_ip = osmo_ntohl(inet_addr(r->audio_ip)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_BTS_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_PROC: An mgcp response has been received, proceed + * with the assignment request */ +static void fsm_proc_assignmnent_req_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + enum gsm48_chan_mode chan_mode; + bool full_rate; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + OSMO_ASSERT(conn->conn); + chan_mode = mgcp_ctx->chan_mode; + full_rate = mgcp_ctx->full_rate; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MGW proceeding assignment request...\n"); + rc = gsm0808_assign_req(conn->conn, chan_mode, full_rate); + + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_ASSGMNT_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_BTS, MGCP_BSS_TIMEOUT, MGCP_BSS_TIMEOUT_TIMER_NR); +} + +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_BTS: When the BSS has completed the assignment, + * proceed with updating the connection for the BTS side */ +static void fsm_mdcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + struct in_addr addr; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "BSS has completed the assignment, now prceed with MDCX towards BTS...\n"); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "completing connection for the BTS side on " "MGW endpoint:%x...\n", rtp_endpoint); + + addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "BTS expects RTP input on address %s:%u\n", inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = conn->conn_id, + .conn_id = CONN_ID_BTS,.conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = inet_ntoa(addr), + .audio_port = lchan->abis_ip.bound_port + }; + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MDCX/BTS: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, mdcx_for_bts_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_CRCX_NET, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for BTS associated MDCX */ +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct in_addr addr; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "MDCX/BTS: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "MDCX/BTS: Cannot parse MDCX response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MDCX/BTS: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + addr.s_addr = lchan->abis_ip.bound_ip; + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "MDCX/BTS: corresponding lchan has been bound to address %s:%u\n", + inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_BTS_RESP, mgcp_ctx); +} + +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_NET: An mgcp response has been received, proceed... */ +static void fsm_crcx_net_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + struct sockaddr_in *sin; + char *addr; + uint16_t port; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "creating connection for the NET side on " "MGW endpoint:%x...\n", rtp_endpoint); + + /* Currently we only have support for IPv4 in our MGCP software, the + * AoIP part is ready to support IPv6 in theory, because the IE + * parser/generator uses sockaddr_storage for the AoIP transport + * identifier. However, the MGCP-GW does not support IPv6 yet. This is + * why we stop here in case some MSC tries to signal IPv6 AoIP + * transport identifiers */ + if (conn->aoip_rtp_addr_remote.ss_family != AF_INET) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "endpoint:%x MSC uses unsupported address format in AoIP transport identifier -- aborting...\n", + rtp_endpoint); + handle_error(mgcp_ctx, MGCP_ERR_UNSUPP_ADDR_FMT); + return; + } + + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_remote; + addr = inet_ntoa(sin->sin_addr); + port = osmo_ntohs(sin->sin_port); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MSC expects RTP input on address %s:%u\n", addr, port); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = conn->conn_id, + .conn_id = CONN_ID_NET, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = addr, + .audio_port = port + }; + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/NET: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, crcx_for_net_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct sockaddr_in *sin; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/NET: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/NET: Cannot parse CRCX response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/NET: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + /* Store address */ + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_local; + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = inet_addr(r->audio_ip); + sin->sin_port = osmo_ntohs(r->audio_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_NET_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_COMPL: Send back assignment complete and wait until the call ends */ +static void fsm_send_assignment_complete(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + /* Send assignment completion message via AoIP, this will complete + * the circuit. The message will also contain the port and IP-Address + * where the MGW expects the RTP input from the MSC side */ + bssmap_send_aoip_ass_compl(lchan); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "call in progress, waiting for call end...\n"); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_DLCX, 0, 0); +} + +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_DLCX: Remove connection for the BTS and NET side. */ +static void fsm_dlcx_all_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "removing connection for the BTS and NET side on " "MGW endpoint:%x...\n", rtp_endpoint); + + /* We now relase the endpoint back to the pool in order to allow + * other connections to use this endpoint */ + mgcp_client_release_endpoint(rtp_endpoint, mgcp); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_DLCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID), + .call_id = conn->conn_id + }; + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "DLCX: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, dlcx_for_all_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_HALT, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + struct osmo_bsc_sccp_con *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + /* Note: We check the return code, but in case of an error there is + * not much that can be done to recover. However, at least we tryed + * to remove the connection (if there was even any) */ + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "DLCX: response yields error: %d %s\n", r->head.response_code, r->head.comment); + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "DLCX: MGW has acknowledged the removal of the connections\n"); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_DLCX_ALL_RESP, mgcp_ctx); +} + +/* Callback for ST_HALT: Terminate the state machine */ +static void fsm_halt_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Send pending sigtran message */ + if (mgcp_ctx->resp) { + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "sending pending sigtran response message...\n"); + osmo_bsc_sigtran_send(conn, mgcp_ctx->resp); + mgcp_ctx->resp = NULL; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "state machine halted\n"); + + /* Destroy the state machine and all context information */ + osmo_fsm_inst_free(mgcp_ctx->fsm); + talloc_free(mgcp_ctx); +} + +/* Timer callback to shut down in case of connectivity problems */ +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "timeout (T%i) in state %s, attempting graceful teardown...\n", + fi->T, get_value_string(fsm_state_names, fi->state)); + + /* Ensure that no sigtran response, is present. Otherwiese we might try + * to send a sigtran response when the sccp connection is already freed. */ + mgcp_ctx->resp = NULL; + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NR) { + /* Note: We were unable to communicate with the MGCP-GW, + * unfortunately there is no meaningful action we can take + * now other than giving up. */ + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "graceful teardown not possible, terminating...\n"); + + /* At least release the occupied endpoint ID */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); + } else if (fi->T == MGCP_BSS_TIMEOUT_TIMER_NR) + /* Note: If the logic that controls the BSS is unable to + * negotiate a connection, we presumably still have a + * working connection to the MGCP-GW, we will try to + * shut down gracefully. */ + handle_error(mgcp_ctx, MGCP_ERR_BSS_TIMEOUT); + else { + /* Note: Ther must not be any unsolicited timers + * in this FSM. If so, we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static struct osmo_fsm_state fsm_states[] = { + + /* Startup state machine, send CRCX to BTS. */ + [ST_CRCX_BTS] = { + .in_event_mask = (1 << EV_INIT), + .out_state_mask = (1 << ST_ASSIGN_PROC), + .name = "ST_CRCX_BTS", + .action = fsm_crcx_bts_cb, + }, + + /* When the CRCX response for the BTS side is received, then + * proceed the assignment on the BSS side. */ + [ST_ASSIGN_PROC] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_MDCX_BTS), + .name = "ST_ASSIGN_PROC", + .action = fsm_proc_assignmnent_req_cb, + }, + + /* When the BSS has processed the assignment request, + * then send the MDCX command for the BTS side in order to + * update the connections with the actual PORT/IP where the + * BTS expects the RTP input. */ + [ST_MDCX_BTS] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_ASS_COMPLETE), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_CRCX_NET), + .name = "ST_MDCX_BTS", + .action = fsm_mdcx_bts_cb, + }, + + /* When the MDCX response for the BTS siede is received, then + * directly proceed with sending the CRCX command to connect the + * network side. This is done in one phase (no MDCX needed). */ + [ST_CRCX_NET] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_MDCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_ASSIGN_COMPL), + .name = "ST_CRCX_NET", + .action = fsm_crcx_net_cb, + }, + + /* When the CRCX response for the NET side is received. Then + * send the assignment complete message via the A-Interface and + * enter wait state in order to wait for the end of the call. */ + [ST_ASSIGN_COMPL] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_NET_RESP), + .out_state_mask = (1 << ST_DLCX), + .name = "ST_ASSIGN_COMPL", + .action = fsm_send_assignment_complete, + }, + + /* When the call ends, remove all RTP connections from the + * MGCP-GW by sending a wildcarded DLCX. */ + [ST_DLCX] = { + .in_event_mask = (1 << EV_TEARDOWN), + .out_state_mask = (1 << ST_HALT), + .name = "ST_DLCX", + .action = fsm_dlcx_all_cb, + }, + + /* When the MGCP_GW confirms that the connections are terminated, + * then halt the state machine. */ + [ST_HALT] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_DLCX_ALL_RESP), + .out_state_mask = 0, + .name = "ST_HALT", + .action = fsm_halt_cb, + }, +}; + +/* State machine definition */ +static struct osmo_fsm fsm = { + .name = "MGW", + .states = fsm_states, + .num_states = ARRAY_SIZE(fsm_states), + .log_subsys = DMGCP, + .timer_cb = fsm_timeout_cb, +}; + +/* Notify that the a new call begins. This will create a connection for the + * BTS on the MGCP-GW and set up the port numbers in struct osmo_bsc_sccp_con. + * After that gsm0808_assign_req() to proceed. + * Parameter: + * ctx: talloc context + * network: associated gsm network + * conn: associated sccp connection + * chan_mode: channel mode (system data, passed through) + * full_rate: full rate flag (system data, passed through) + * Returns an mgcp_context that contains system data and the OSMO-FSM */ +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct mgcp_client *mgcp, struct osmo_bsc_sccp_con *conn, + enum gsm48_chan_mode chan_mode, bool full_rate) +{ + struct mgcp_ctx *mgcp_ctx; + char name[32]; + static bool fsm_registered = false; + + OSMO_ASSERT(mgcp); + OSMO_ASSERT(conn); + + /* Register the fsm description (if not already done) */ + if (fsm_registered == false) { + osmo_fsm_register(&fsm); + fsm_registered = true; + } + + /* Allocate and configure a new fsm instance */ + mgcp_ctx = talloc_zero(ctx, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + + snprintf(name, sizeof(name), "MGW_%i", conn->conn_id); + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm, NULL, ctx, LOGL_DEBUG, name); + OSMO_ASSERT(mgcp_ctx->fsm); + mgcp_ctx->fsm->priv = mgcp_ctx; + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MGW handler fsm created\n"); + mgcp_ctx->mgcp = mgcp; + mgcp_ctx->conn = conn; + mgcp_ctx->chan_mode = chan_mode; + mgcp_ctx->full_rate = full_rate; + + /* start state machine */ + OSMO_ASSERT(mgcp_ctx->fsm->state == ST_CRCX_BTS) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_INIT, mgcp_ctx); + + return mgcp_ctx; +} + +/* Notify that the call has ended, remove all connections from the MGCP-GW, + * then send the clear complete message and destroy the FSM instance + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * respmgcp_ctx: pending clear complete message to send via A-Interface */ +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(resp); + + mgcp_ctx->resp = resp; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +/* Notify that the BSS ready, send the assingnment complete message when the + * mgcp connection is completed + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * lchan: needed for sending the assignment complete message via A-Interface */ +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(lchan); + + mgcp_ctx->lchan = lchan; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASS_COMPLETE, mgcp_ctx); + + return; +} diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 951061a..59f5b3b 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -33,6 +33,7 @@ #include #include #include +#include /* A pointer to a list with all involved MSCs * (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */ diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index 0e7003f..3ee7534 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include @@ -971,6 +973,8 @@ int bsc_vty_init_extra(void) { + struct gsm_network *net = bsc_gsmnet; + install_element(CONFIG_NODE, &cfg_net_msc_cmd); install_element(CONFIG_NODE, &cfg_net_bsc_cmd); @@ -1035,5 +1039,7 @@ install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); + mgcp_client_vty_init(net, MSC_NODE, net->mgw.conf); + return 0; } -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 26 13:18:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 13:18:12 +0000 Subject: [PATCH] osmo-sgsn[master]: jenkins: check for IU properly Message-ID: Review at https://gerrit.osmocom.org/4429 jenkins: check for IU properly The bug fixed by I72819462db0b4656fabaa80731342d06ae91fcdf was not detected by jenkins because it installs libosmo-sccp unconditionally. Let's be more strict and install it only when necessary for IU builds to make sure we can catch such bugs in future. Change-Id: I573c7fec687edb71d79815b38a3bcf96273c03b3 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/29/4429/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index dc1a1a5..140fc63 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -26,10 +26,10 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif -osmo-build-dep.sh libosmo-sccp osmo-build-dep.sh osmo-ggsn if [ "x$IU" = "x--enable-iu" ]; then + osmo-build-dep.sh libosmo-sccp osmo-build-dep.sh libasn1c #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh osmo-build-dep.sh osmo-iuh -- To view, visit https://gerrit.osmocom.org/4429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I573c7fec687edb71d79815b38a3bcf96273c03b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 26 13:20:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Oct 2017 13:20:00 +0000 Subject: openbsc[master]: rename osmo-bsc to osmo-bsc-sccplite In-Reply-To: References: Message-ID: Patch Set 3: in the issue OS#2526, you suggested to include 'legacy' in the name -- To view, visit https://gerrit.osmocom.org/4421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If10d1599b62d010726336134091a4e855c380d93 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 13:28:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 13:28:51 +0000 Subject: [PATCH] osmo-sgsn[master]: jenkins: check for IU properly In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4429 to look at the new patch set (#2). jenkins: check for IU properly The bug fixed by Idb034bf2ae749204836ab7e02018d769bb242a9f was not detected by jenkins because it installs libosmo-sccp unconditionally. Let's be more strict and install it only when necessary for IU builds to make sure we can catch such bugs in future. Change-Id: I573c7fec687edb71d79815b38a3bcf96273c03b3 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/29/4429/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index dc1a1a5..140fc63 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -26,10 +26,10 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif -osmo-build-dep.sh libosmo-sccp osmo-build-dep.sh osmo-ggsn if [ "x$IU" = "x--enable-iu" ]; then + osmo-build-dep.sh libosmo-sccp osmo-build-dep.sh libasn1c #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh osmo-build-dep.sh osmo-iuh -- To view, visit https://gerrit.osmocom.org/4429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I573c7fec687edb71d79815b38a3bcf96273c03b3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 26 13:28:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 13:28:52 +0000 Subject: [PATCH] osmo-sgsn[master]: Fix libosmo-sigtran dependency Message-ID: Review at https://gerrit.osmocom.org/4430 Fix libosmo-sigtran dependency That's follow-up fix for I72819462db0b4656fabaa80731342d06ae91fcdf to make sure IU builds are properly conditioned. Change-Id: Idb034bf2ae749204836ab7e02018d769bb242a9f --- M src/gprs/gtphub_main.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/30/4430/1 diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index c3e25d5..33d5ff6 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -38,9 +38,9 @@ #include #include #include - +#if BUILD_IU #include - +#endif #include #include #include -- To view, visit https://gerrit.osmocom.org/4430 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idb034bf2ae749204836ab7e02018d769bb242a9f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Oct 26 13:35:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 13:35:47 +0000 Subject: [PATCH] osmo-sgsn[master]: Fix libosmo-sigtran dependency In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4430 to look at the new patch set (#2). Fix libosmo-sigtran dependency That's follow-up fix for I72819462db0b4656fabaa80731342d06ae91fcdf to make sure IU builds are properly conditioned. Change-Id: Idb034bf2ae749204836ab7e02018d769bb242a9f --- M src/gprs/gtphub_main.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/30/4430/2 diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index c3e25d5..3f7de50 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -39,14 +39,16 @@ #include #include -#include - #include #include #include #include "../../bscconfig.h" +#if BUILD_IU +#include +#endif + extern void *osmo_gtphub_ctx; void *tall_bsc_ctx; -- To view, visit https://gerrit.osmocom.org/4430 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idb034bf2ae749204836ab7e02018d769bb242a9f Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 26 13:36:14 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 26 Oct 2017 13:36:14 +0000 Subject: osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 9: Code-Review-1 The pcu was an example what happens if everyone is touching everyones members all the time. Making the ctr such a pointer again seems like a step back. The oddest part is that the BTS doesn't create the counter anymore but would free it? If it can delete it, why can't it create it? If you want to make it global that will probably work as well (tests could reset values to 0 if they are interested in the delta). -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 13:58:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 13:58:09 +0000 Subject: [PATCH] osmo-sgsn[master]: gbproxy: don't link unnecessary In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4428 to look at the new patch set (#2). gbproxy: don't link unnecessary * 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 --- M src/gprs/Makefile.am M src/libcommon/common_vty.c 2 files changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/28/4428/2 diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index 654604b..764acba 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -28,13 +28,11 @@ OSMO_LIBS = \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOABIS_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBGTP_LIBS) \ - $(LIBOSMOSIGTRAN_LIBS) \ $(NULL) bin_PROGRAMS = \ diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index ac3c7fc..e960550 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -33,7 +33,6 @@ #include #include #include -#include int bsc_vty_go_parent(struct vty *vty) -- To view, visit https://gerrit.osmocom.org/4428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I015a9d858bc2a95f8c9a4aedd3e0a84eadcf84e1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 26 14:03:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 14:03:40 +0000 Subject: osmo-sgsn[master]: gbproxy: don't link unnecessary In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I015a9d858bc2a95f8c9a4aedd3e0a84eadcf84e1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 14:04:09 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Oct 2017 14:04:09 +0000 Subject: osmo-sgsn[master]: Fix libosmo-sigtran dependency In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 > Build Successful > > http://jenkins.osmocom.org/jenkins/job/osmo-sgsn-gerrit/80/ : > SUCCESS' --verified 1 --code-review 0 -- To view, visit https://gerrit.osmocom.org/4430 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idb034bf2ae749204836ab7e02018d769bb242a9f Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 14:08:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 14:08:08 +0000 Subject: osmo-sgsn[master]: Fix libosmo-sigtran dependency In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4430 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idb034bf2ae749204836ab7e02018d769bb242a9f Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 14:08:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 14:08:26 +0000 Subject: osmo-sgsn[master]: jenkins: check for IU properly In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I573c7fec687edb71d79815b38a3bcf96273c03b3 Gerrit-PatchSet: 4 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 14:23:50 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Oct 2017 14:23:50 +0000 Subject: [PATCH] osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4334 to look at the new patch set (#6). mgcp: use osmo-mgw to switch RTP streams osmo-bsc currently negotiates the RTP stream directly with the BTS and reports back the RTP IP/Port on the BTS. This works fine for a single BTS, but for Handover the port/ip pointing to the MSC side must not change, so an entity in between the BTSs and the MSC is required. Integrate the mgcp-client and use osmo-mgw to switch the RTP streams. TODO: Handover will not work yet, because there is no functionality to update the connection with the port/ip of the new BTS. Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/osmo_bsc.h A include/osmocom/bsc/osmo_bsc_mgcp.h M src/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c A src/osmo-bsc/osmo_bsc_mgcp.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c 13 files changed, 1,030 insertions(+), 65 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/34/4334/6 diff --git a/configure.ac b/configure.ac index 4edbb83..f73f33c 100644 --- a/configure.ac +++ b/configure.ac @@ -47,8 +47,9 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) +PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 1.0.0) dnl checks for header files AC_HEADER_STDC @@ -135,7 +136,6 @@ src/libfilter/Makefile src/libcommon-cs/Makefile src/osmo-bsc/Makefile - src/osmo-bsc_nat/Makefile src/ipaccess/Makefile src/utils/Makefile tests/Makefile diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 8ad2b5d..1f7cd39 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -41,6 +41,7 @@ openbscdefines.h \ osmo_bsc.h \ osmo_bsc_grace.h \ + osmo_bsc_mgcp.h \ osmo_bsc_rf.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 51b2c98..5cb7efd 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -479,6 +479,11 @@ uint8_t t3212; struct { + struct mgcp_client_conf *conf; + struct mgcp_client *client; + } mgw; + + struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; /* A list with the context information about diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h index 5ebea50..8a5cd30 100644 --- a/include/osmocom/bsc/osmo_bsc.h +++ b/include/osmocom/bsc/osmo_bsc.h @@ -29,6 +29,20 @@ uint32_t rtp_ip; int rtp_port; + /* RTP address of the remote end (assigned by MSC through assignment + * request) */ + struct sockaddr_storage aoip_rtp_addr_remote; + + /* Local RTP address (reported back to the MSC by us with the + * assignment complete message) */ + struct sockaddr_storage aoip_rtp_addr_local; + + /* storage to keep states of the MGCP connection handler, the + * handler is created when an assignment request is received + * and is terminated when the assignment complete message is + * sent */ + struct mgcp_ctx *mgcp_ctx; + /* for advanced ping/pong */ int send_ping; @@ -72,4 +86,6 @@ struct llist_head *bsc_access_lists(void); +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan); + #endif diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h new file mode 100644 index 0000000..7246dda --- /dev/null +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -0,0 +1,45 @@ +/* (C) 2017 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +/* MGCP state handler context (fsm etc..) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* RTP endpoint number */ + uint16_t rtp_endpoint; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct mgcp_client *mgcp; + + struct osmo_bsc_sccp_con *conn; + enum gsm48_chan_mode chan_mode; + bool full_rate; + struct gsm_lchan *lchan; + struct msgb *resp; +}; + +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct mgcp_client *mgcp, struct osmo_bsc_sccp_con *conn, + enum gsm48_chan_mode chan_mode, bool full_rate); +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan); diff --git a/src/Makefile.am b/src/Makefile.am index d04f025..dd1ad3d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,5 +33,4 @@ utils \ ipaccess \ osmo-bsc \ - osmo-bsc_nat \ $(NULL) diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index dfc4def..7db698c 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -15,6 +15,7 @@ $(COVERAGE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -30,6 +31,7 @@ osmo_bsc_vty.c \ osmo_bsc_api.c \ osmo_bsc_grace.c \ + osmo_bsc_mgcp.c \ osmo_bsc_msc.c \ osmo_bsc_sigtran.c \ osmo_bsc_filter.c \ @@ -53,4 +55,5 @@ $(COVERAGE_LDFLAGS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(NULL) diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index 94aa350..326703d 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -29,46 +29,9 @@ #include #include #include +#include #include - -/* Generate and send assignment complete message */ -static int send_aoip_ass_compl(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan) -{ - struct msgb *resp; - struct sockaddr_storage rtp_addr; - struct sockaddr_in rtp_addr_in; - struct gsm0808_speech_codec sc; - - OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); - - /* Package RTP-Address data */ - memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); - rtp_addr_in.sin_family = AF_INET; - rtp_addr_in.sin_port = htons(lchan->abis_ip.bound_port); - rtp_addr_in.sin_addr.s_addr = htonl(lchan->abis_ip.bound_ip); - memset(&rtp_addr, 0, sizeof(rtp_addr)); - memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); - - /* Extrapolate speech codec from speech mode */ - gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); - - /* Generate message */ - resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, - lchan->abis_ip.ass_compl.chosen_channel, - lchan->abis_ip.ass_compl.encr_alg_id, - lchan->abis_ip.ass_compl.speech_mode, - &rtp_addr, - &sc, - NULL); - - if (!resp) { - LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ - return -EINVAL; - } - - return osmo_bsc_sigtran_send(conn->sccp_con, resp); -} static int handle_abisip_signal(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) @@ -124,11 +87,9 @@ * IPA based base stations. See also osmo_bsc_api.c, * function bsc_assign_compl() */ LOGP(DMSC, LOGL_INFO, "Tx MSC ASSIGN COMPL (POSTPONED)\n"); - if (send_aoip_ass_compl(con, lchan) != 0) - return -EINVAL; + mgcp_ass_complete(con->sccp_con->mgcp_ctx, lchan); } break; - break; } return 0; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 4311250..e474b98 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -321,14 +322,29 @@ conn->conn = NULL; } - /* send the clear complete message */ + /* generate the clear complete message */ resp = gsm0808_create_clear_complete(); if (!resp) { LOGP(DMSC, LOGL_ERROR, "Sending clear complete failed.\n"); return -1; } - osmo_bsc_sigtran_send(conn, resp); + if (conn->mgcp_ctx) { + /* NOTE: This is the AoIP case, osmo-bsc has to negotiate with + * the MGCP-GW. For this an mgcp_ctx should be created that + * contains the FSM and some system data. When the connection + * is removed from the MGCP-GW, then osmo_bsc_sigtran_send() + * calls osmo_bsc_sigtran_send(). */ + mgcp_clear_complete(conn->mgcp_ctx, resp); + conn->mgcp_ctx = NULL; + } else { + /* NOTE: This is the SCCP-Lite case, since we do not handle + * the MGCP-GW switching ourselves, we may skip everything + * that is MGCP-GW related and sent the clear complete message + * directly */ + osmo_bsc_sigtran_send(conn, resp); + } + return 0; } @@ -426,7 +442,6 @@ int port, full_rate = -1; bool aoip = false; struct sockaddr_storage rtp_addr; - struct sockaddr_in *rtp_addr_in; struct gsm0808_channel_type ct; struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; @@ -531,28 +546,39 @@ get_value_string(gsm48_chan_mode_names, chan_mode), ct.ch_indctr, ct.ch_rate_type, osmo_hexdump(ct.perm_spch, ct.perm_spch_len)); - if (aoip == false) { - /* map it to a MGCP Endpoint and a RTP port */ + /* Forward the assingment request to lower layers */ + if (aoip) { + /* Store network side RTP connection information, we will + * process this address later after we have established an RTP + * connection to the BTS. This is just for organizational + * reasons, functional wise it would not matter when exactly + * the network side RTP connection is made, as long it is made + * before we return with the assignment complete message. */ + memcpy(&conn->aoip_rtp_addr_remote, &rtp_addr, sizeof(rtp_addr)); + + /* Create an assignment request using the MGCP fsm. This FSM + * is directly started when its created (now) and will also + * take care about the further processing (creating RTP + * endpoints, calling gsm0808_assign_req(), rsponding to + * the assignment request etc... */ + conn->mgcp_ctx = mgcp_assignm_req(msc->network, msc->network->mgw.client, conn, chan_mode, full_rate); + if (!conn->mgcp_ctx) { + LOGP(DMSC, LOGL_ERROR, "MGCP GW failure, rejecting assignment... (id=%i)\n", conn->conn_id); + goto reject; + } + + /* We now may return here, the FSM will do all further work */ + return 0; + } else { + /* Note: In the sccp-lite case we to not perform any mgcp operation, + * (the MSC does that for us). We set conn->rtp_ip to 0 and check + * on this later. By this we know that we have to behave accordingly + * to sccp-lite. */ port = mgcp_timeslot_to_endpoint(multiplex, timeslot); conn->rtp_port = rtp_calculate_port(port, msc->rtp_base); conn->rtp_ip = 0; - } else { - /* use address / port supplied with the AoIP - * transport address element */ - if (rtp_addr.ss_family == AF_INET) { - rtp_addr_in = (struct sockaddr_in *)&rtp_addr; - conn->rtp_port = osmo_ntohs(rtp_addr_in->sin_port); - memcpy(&conn->rtp_ip, &rtp_addr_in->sin_addr.s_addr, - IP_V4_ADDR_LEN); - conn->rtp_ip = osmo_ntohl(conn->rtp_ip); - } else { - LOGP(DMSC, LOGL_ERROR, - "Unsopported addressing scheme. (supports only IPV4)\n"); - goto reject; - } + return gsm0808_assign_req(conn->conn, chan_mode, full_rate); } - - return gsm0808_assign_req(conn->conn, chan_mode, full_rate); reject: resp = @@ -729,3 +755,39 @@ return -1; } + +/* Generate and send assignment complete message */ +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan) +{ + struct msgb *resp; + struct gsm0808_speech_codec sc; + struct gsm_subscriber_connection *conn; + + conn = lchan->conn; + + OSMO_ASSERT(lchan->abis_ip.ass_compl.valid); + OSMO_ASSERT(conn); + OSMO_ASSERT(conn->sccp_con); + + LOGP(DMSC, LOGL_DEBUG, "Sending assignment complete message... (id=%i)\n", conn->sccp_con->conn_id); + + /* Extrapolate speech codec from speech mode */ + gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); + + /* Generate message */ + resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, + lchan->abis_ip.ass_compl.chosen_channel, + lchan->abis_ip.ass_compl.encr_alg_id, + lchan->abis_ip.ass_compl.speech_mode, + &conn->sccp_con->aoip_rtp_addr_local, + &sc, + NULL); + + if (!resp) { + LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message! (id=%i)\n", + conn->sccp_con->conn_id); + return -EINVAL; + } + + return osmo_bsc_sigtran_send(conn->sccp_con, resp); +} diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 730e1db..5d25701 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -44,6 +44,7 @@ #include #include +#include #define _GNU_SOURCE #include @@ -206,6 +207,9 @@ exit(1); } + bsc_gsmnet->mgw.conf = talloc_zero(bsc_gsmnet, struct mgcp_client_conf); + mgcp_client_conf_init(bsc_gsmnet->mgw.conf); + bts_init(); libosmo_abis_init(tall_bsc_ctx); @@ -274,6 +278,15 @@ } } + bsc_gsmnet->mgw.client = mgcp_client_init(bsc_gsmnet, bsc_gsmnet->mgw.conf); + + if (mgcp_client_connect(bsc_gsmnet->mgw.client)) { + LOGP(DNM, LOGL_ERROR, "MGW connect failed at (%s:%u)\n", + bsc_gsmnet->mgw.conf->remote_addr, + bsc_gsmnet->mgw.conf->remote_port); + exit(1); + } + if (osmo_bsc_sigtran_init(&bsc_gsmnet->bsc_data->mscs) != 0) { LOGP(DNM, LOGL_ERROR, "Failed to initalize sigtran backhaul.\n"); exit(1); diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c new file mode 100644 index 0000000..0ba021e --- /dev/null +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -0,0 +1,853 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define CONN_ID_BTS 1 +#define CONN_ID_NET 2 + +#define MGCP_MGW_TIMEOUT 4 /* in seconds */ +#define MGCP_MGW_TIMEOUT_TIMER_NR 1 +#define MGCP_BSS_TIMEOUT 4 /* in seconds */ +#define MGCP_BSS_TIMEOUT_TIMER_NR 2 + +#define MGCP_ENDPOINT_FORMAT "%i at mgw" + +/* Some internal cause codes to indicate fault + * condition inside the FSM */ +enum int_cause_code { + MGCP_ERR_MGW_FAIL, + MGCP_ERR_MGW_INVAL_RESP, + MGCP_ERR_MGW_TX_FAIL, + MGCP_ERR_UNEXP_TEARDOWN, + MGCP_ERR_ASSGMNT_FAIL, + MGCP_ERR_UNSUPP_ADDR_FMT, + MGCP_ERR_BSS_TIMEOUT +}; + +/* Human readable respresentation of the faul codes, + * will be displayed by handle_error() */ +static const struct value_string int_cause_codes_str[] = { + {MGCP_ERR_MGW_FAIL, "operation failed on MGW"}, + {MGCP_ERR_MGW_INVAL_RESP, "invalid / unparseable response from MGW"}, + {MGCP_ERR_MGW_INVAL_RESP, "failed to transmit MGCP message to MGW"}, + {MGCP_ERR_UNEXP_TEARDOWN, "unexpected connection teardown (BSS)"}, + {MGCP_ERR_ASSGMNT_FAIL, "assignment failure (BSS)"}, + {MGCP_ERR_UNSUPP_ADDR_FMT, "unsupported network address format used (BSS)"}, + {MGCP_ERR_BSS_TIMEOUT, "assignment could not be completed in time (BSS)"}, + {0, NULL} +}; + +enum fsm_states { + ST_CRCX_BTS, + ST_ASSIGN_PROC, + ST_MDCX_BTS, + ST_CRCX_NET, + ST_ASSIGN_COMPL, + ST_DLCX, + ST_HALT +}; + +static const struct value_string fsm_state_names[] = { + {ST_CRCX_BTS, "ST_CRCX_BTS (send CRCX for BTS)"}, + {ST_ASSIGN_PROC, "ST_ASSIGN_PROC (continue assignment)"}, + {ST_MDCX_BTS, "ST_MDCX_BTS (send MDCX for BTS)"}, + {ST_CRCX_NET, "ST_CRCX_NET (send CRCX for NET)"}, + {ST_ASSIGN_COMPL, "ST_ASSIGN_COMPL (complete assignment)"}, + {ST_DLCX, "ST_DLCX (delete all rtp connections)"}, + {ST_HALT, "ST_HALT (destroy state machine)"}, + {0, NULL} +}; + +enum fsm_evt { + /* Initial event: start off the state machine */ + EV_INIT, + + /* External event: Assignment complete, event is issued shortly before + * the assignment complete message is sent via the A-Interface */ + EV_ASS_COMPLETE, + + /* External event: Teardown event, this event is used to notify the end + * of a. It is also issued in case of errors to teardown a half open + * connection. */ + EV_TEARDOWN, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the BTS side */ + EV_CRCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the BTS side */ + EV_MDCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the NET side */ + EV_CRCX_NET_RESP, + + /* Internal event: The mgcp_gw has sent its DLCX response for + * the NET and BTS side */ + EV_DLCX_ALL_RESP, +}; + +static const struct value_string fsm_evt_names[] = { + {EV_INIT, "EV_INIT (start state machine (send CRCX for BTS)"}, + {EV_ASS_COMPLETE, "EV_ASS_COMPLETE (assignment complete)"}, + {EV_TEARDOWN, "EV_TEARDOWN (teardown all connections)"}, + {EV_CRCX_BTS_RESP, "EV_CRCX_BTS_RESP (got CRCX reponse for BTS)"}, + {EV_MDCX_BTS_RESP, "EV_MDCX_BTS_RESP (got MDCX reponse for BTS)"}, + {EV_CRCX_NET_RESP, "EV_CRCX_NET_RESP (got CRCX reponse for NET)"}, + {EV_DLCX_ALL_RESP, "EV_DLCX_ALL_RESP (got DLCX reponse for BTS/NET)"}, + {0, NULL} +}; + +/* A general error handler function. On error we still have an interest to + * remove a half open connection (if possible). This function will execute + * a controlled jump to the DLCX phase. From there, the FSM will then just + * continue like the call were ended normally */ +static void handle_error(struct mgcp_ctx *mgcp_ctx, enum int_cause_code cause) +{ + struct osmo_fsm_inst *fi; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + fi = mgcp_ctx->fsm; + OSMO_ASSERT(fi); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "fsm-state: %s\n", get_value_string(fsm_state_names, fi->state)); + + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "%s -- graceful shutdown...\n", + get_value_string(int_cause_codes_str, cause)); + + /* Set the VM into the state where it waits for the call end */ + osmo_fsm_inst_state_chg(fi, ST_DLCX, 0, 0); + + /* Simulate the call end by sending a teardown event, so that + * the FSM proceeds directly with the DLCX */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_BTS: startup state machine send out CRCX for BTS side */ +static void fsm_crcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_client_next_endpoint(mgcp); + mgcp_ctx->rtp_endpoint = rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "creating connection for the BTS side on " "MGW endpoint:%x...\n", rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = conn->conn_id, + .conn_id = CONN_ID_BTS, + .conn_mode = MGCP_CONN_LOOPBACK + }; + snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/BTS: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, crcx_for_bts_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_PROC, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for BTS associated CRCX */ +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/BTS: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/BTS: Cannot parse response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/BTS: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + /* Set the connection details in the conn struct. The code that + * controls the BTS via RSL will take these values and signal them + * to the BTS via RSL/IPACC */ + conn->rtp_port = r->audio_port; + conn->rtp_ip = osmo_ntohl(inet_addr(r->audio_ip)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_BTS_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_PROC: An mgcp response has been received, proceed + * with the assignment request */ +static void fsm_proc_assignmnent_req_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + enum gsm48_chan_mode chan_mode; + bool full_rate; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + OSMO_ASSERT(conn->conn); + chan_mode = mgcp_ctx->chan_mode; + full_rate = mgcp_ctx->full_rate; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MGW proceeding assignment request...\n"); + rc = gsm0808_assign_req(conn->conn, chan_mode, full_rate); + + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_ASSGMNT_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_BTS, MGCP_BSS_TIMEOUT, MGCP_BSS_TIMEOUT_TIMER_NR); +} + +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_BTS: When the BSS has completed the assignment, + * proceed with updating the connection for the BTS side */ +static void fsm_mdcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + struct in_addr addr; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "BSS has completed the assignment, now prceed with MDCX towards BTS...\n"); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "completing connection for the BTS side on " "MGW endpoint:%x...\n", rtp_endpoint); + + addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "BTS expects RTP input on address %s:%u\n", inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = conn->conn_id, + .conn_id = CONN_ID_BTS,.conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = inet_ntoa(addr), + .audio_port = lchan->abis_ip.bound_port + }; + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MDCX/BTS: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, mdcx_for_bts_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_CRCX_NET, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for BTS associated MDCX */ +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct in_addr addr; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "MDCX/BTS: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "MDCX/BTS: Cannot parse MDCX response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MDCX/BTS: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + addr.s_addr = lchan->abis_ip.bound_ip; + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "MDCX/BTS: corresponding lchan has been bound to address %s:%u\n", + inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_BTS_RESP, mgcp_ctx); +} + +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_NET: An mgcp response has been received, proceed... */ +static void fsm_crcx_net_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + struct sockaddr_in *sin; + char *addr; + uint16_t port; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "creating connection for the NET side on " "MGW endpoint:%x...\n", rtp_endpoint); + + /* Currently we only have support for IPv4 in our MGCP software, the + * AoIP part is ready to support IPv6 in theory, because the IE + * parser/generator uses sockaddr_storage for the AoIP transport + * identifier. However, the MGCP-GW does not support IPv6 yet. This is + * why we stop here in case some MSC tries to signal IPv6 AoIP + * transport identifiers */ + if (conn->aoip_rtp_addr_remote.ss_family != AF_INET) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "endpoint:%x MSC uses unsupported address format in AoIP transport identifier -- aborting...\n", + rtp_endpoint); + handle_error(mgcp_ctx, MGCP_ERR_UNSUPP_ADDR_FMT); + return; + } + + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_remote; + addr = inet_ntoa(sin->sin_addr); + port = osmo_ntohs(sin->sin_port); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MSC expects RTP input on address %s:%u\n", addr, port); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = conn->conn_id, + .conn_id = CONN_ID_NET, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = addr, + .audio_port = port + }; + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/NET: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, crcx_for_net_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct sockaddr_in *sin; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/NET: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/NET: Cannot parse CRCX response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/NET: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + /* Store address */ + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_local; + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = inet_addr(r->audio_ip); + sin->sin_port = osmo_ntohs(r->audio_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_NET_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_COMPL: Send back assignment complete and wait until the call ends */ +static void fsm_send_assignment_complete(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Bail on teardown */ + if (event == EV_TEARDOWN) { + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + /* Send assignment completion message via AoIP, this will complete + * the circuit. The message will also contain the port and IP-Address + * where the MGW expects the RTP input from the MSC side */ + bssmap_send_aoip_ass_compl(lchan); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "call in progress, waiting for call end...\n"); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_DLCX, 0, 0); +} + +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_DLCX: Remove connection for the BTS and NET side. */ +static void fsm_dlcx_all_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "removing connection for the BTS and NET side on " "MGW endpoint:%x...\n", rtp_endpoint); + + /* We now relase the endpoint back to the pool in order to allow + * other connections to use this endpoint */ + mgcp_client_release_endpoint(rtp_endpoint, mgcp); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_DLCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID), + .call_id = conn->conn_id + }; + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "DLCX: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, dlcx_for_all_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_HALT, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + struct osmo_bsc_sccp_con *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + /* Note: We check the return code, but in case of an error there is + * not much that can be done to recover. However, at least we tryed + * to remove the connection (if there was even any) */ + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "DLCX: response yields error: %d %s\n", r->head.response_code, r->head.comment); + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "DLCX: MGW has acknowledged the removal of the connections\n"); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_DLCX_ALL_RESP, mgcp_ctx); +} + +/* Callback for ST_HALT: Terminate the state machine */ +static void fsm_halt_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Send pending sigtran message */ + if (mgcp_ctx->resp) { + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "sending pending sigtran response message...\n"); + osmo_bsc_sigtran_send(conn, mgcp_ctx->resp); + mgcp_ctx->resp = NULL; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "state machine halted\n"); + + /* Destroy the state machine and all context information */ + osmo_fsm_inst_free(mgcp_ctx->fsm); + talloc_free(mgcp_ctx); +} + +/* Timer callback to shut down in case of connectivity problems */ +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "timeout (T%i) in state %s, attempting graceful teardown...\n", + fi->T, get_value_string(fsm_state_names, fi->state)); + + /* Ensure that no sigtran response, is present. Otherwiese we might try + * to send a sigtran response when the sccp connection is already freed. */ + mgcp_ctx->resp = NULL; + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NR) { + /* Note: We were unable to communicate with the MGCP-GW, + * unfortunately there is no meaningful action we can take + * now other than giving up. */ + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "graceful teardown not possible, terminating...\n"); + + /* At least release the occupied endpoint ID */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); + } else if (fi->T == MGCP_BSS_TIMEOUT_TIMER_NR) + /* Note: If the logic that controls the BSS is unable to + * negotiate a connection, we presumably still have a + * working connection to the MGCP-GW, we will try to + * shut down gracefully. */ + handle_error(mgcp_ctx, MGCP_ERR_BSS_TIMEOUT); + else { + /* Note: Ther must not be any unsolicited timers + * in this FSM. If so, we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static struct osmo_fsm_state fsm_states[] = { + + /* Startup state machine, send CRCX to BTS. */ + [ST_CRCX_BTS] = { + .in_event_mask = (1 << EV_INIT), + .out_state_mask = (1 << ST_ASSIGN_PROC), + .name = "ST_CRCX_BTS", + .action = fsm_crcx_bts_cb, + }, + + /* When the CRCX response for the BTS side is received, then + * proceed the assignment on the BSS side. */ + [ST_ASSIGN_PROC] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_MDCX_BTS), + .name = "ST_ASSIGN_PROC", + .action = fsm_proc_assignmnent_req_cb, + }, + + /* When the BSS has processed the assignment request, + * then send the MDCX command for the BTS side in order to + * update the connections with the actual PORT/IP where the + * BTS expects the RTP input. */ + [ST_MDCX_BTS] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_ASS_COMPLETE), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_CRCX_NET), + .name = "ST_MDCX_BTS", + .action = fsm_mdcx_bts_cb, + }, + + /* When the MDCX response for the BTS siede is received, then + * directly proceed with sending the CRCX command to connect the + * network side. This is done in one phase (no MDCX needed). */ + [ST_CRCX_NET] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_MDCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_ASSIGN_COMPL), + .name = "ST_CRCX_NET", + .action = fsm_crcx_net_cb, + }, + + /* When the CRCX response for the NET side is received. Then + * send the assignment complete message via the A-Interface and + * enter wait state in order to wait for the end of the call. */ + [ST_ASSIGN_COMPL] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_NET_RESP), + .out_state_mask = (1 << ST_DLCX), + .name = "ST_ASSIGN_COMPL", + .action = fsm_send_assignment_complete, + }, + + /* When the call ends, remove all RTP connections from the + * MGCP-GW by sending a wildcarded DLCX. */ + [ST_DLCX] = { + .in_event_mask = (1 << EV_TEARDOWN), + .out_state_mask = (1 << ST_HALT), + .name = "ST_DLCX", + .action = fsm_dlcx_all_cb, + }, + + /* When the MGCP_GW confirms that the connections are terminated, + * then halt the state machine. */ + [ST_HALT] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_DLCX_ALL_RESP), + .out_state_mask = 0, + .name = "ST_HALT", + .action = fsm_halt_cb, + }, +}; + +/* State machine definition */ +static struct osmo_fsm fsm = { + .name = "MGW", + .states = fsm_states, + .num_states = ARRAY_SIZE(fsm_states), + .log_subsys = DMGCP, + .timer_cb = fsm_timeout_cb, +}; + +/* Notify that the a new call begins. This will create a connection for the + * BTS on the MGCP-GW and set up the port numbers in struct osmo_bsc_sccp_con. + * After that gsm0808_assign_req() to proceed. + * Parameter: + * ctx: talloc context + * network: associated gsm network + * conn: associated sccp connection + * chan_mode: channel mode (system data, passed through) + * full_rate: full rate flag (system data, passed through) + * Returns an mgcp_context that contains system data and the OSMO-FSM */ +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct mgcp_client *mgcp, struct osmo_bsc_sccp_con *conn, + enum gsm48_chan_mode chan_mode, bool full_rate) +{ + struct mgcp_ctx *mgcp_ctx; + char name[32]; + static bool fsm_registered = false; + + OSMO_ASSERT(mgcp); + OSMO_ASSERT(conn); + + /* Register the fsm description (if not already done) */ + if (fsm_registered == false) { + osmo_fsm_register(&fsm); + fsm_registered = true; + } + + /* Allocate and configure a new fsm instance */ + mgcp_ctx = talloc_zero(ctx, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + + snprintf(name, sizeof(name), "MGW_%i", conn->conn_id); + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm, NULL, ctx, LOGL_DEBUG, name); + OSMO_ASSERT(mgcp_ctx->fsm); + mgcp_ctx->fsm->priv = mgcp_ctx; + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MGW handler fsm created\n"); + mgcp_ctx->mgcp = mgcp; + mgcp_ctx->conn = conn; + mgcp_ctx->chan_mode = chan_mode; + mgcp_ctx->full_rate = full_rate; + + /* start state machine */ + OSMO_ASSERT(mgcp_ctx->fsm->state == ST_CRCX_BTS) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_INIT, mgcp_ctx); + + return mgcp_ctx; +} + +/* Notify that the call has ended, remove all connections from the MGCP-GW, + * then send the clear complete message and destroy the FSM instance + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * respmgcp_ctx: pending clear complete message to send via A-Interface */ +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(resp); + + mgcp_ctx->resp = resp; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +/* Notify that the BSS ready, send the assingnment complete message when the + * mgcp connection is completed + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * lchan: needed for sending the assignment complete message via A-Interface */ +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(lchan); + + mgcp_ctx->lchan = lchan; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASS_COMPLETE, mgcp_ctx); + + return; +} diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 951061a..59f5b3b 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -33,6 +33,7 @@ #include #include #include +#include /* A pointer to a list with all involved MSCs * (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */ diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index b5232c4..78fce4c 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include @@ -972,6 +974,8 @@ int bsc_vty_init_extra(void) { + struct gsm_network *net = bsc_gsmnet; + install_element(CONFIG_NODE, &cfg_net_msc_cmd); install_element(CONFIG_NODE, &cfg_net_bsc_cmd); @@ -1036,5 +1040,7 @@ install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); + mgcp_client_vty_init(net, MSC_NODE, net->mgw.conf); + return 0; } -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 26 14:28:10 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Oct 2017 14:28:10 +0000 Subject: openbsc[master]: remove sgsn, gbproxy and gtphub from openbsc.git In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 > Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If60e28b23f5cfb2c4eb354951363a2bb63f3e0de Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 14:30:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 14:30:01 +0000 Subject: osmo-bsc[master]: log: log the sccp message type of messages sent In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 14:30:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 14:30:36 +0000 Subject: osmo-bsc[master]: log: output hexdump of transmitted sccp messages In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 14:31:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 14:31:19 +0000 Subject: openbsc[master]: rename osmo-bsc to osmo-bsc-sccplite In-Reply-To: References: Message-ID: Patch Set 3: > in the issue OS#2526, you suggested to include 'legacy' in the name That was just an idea. I think it's specific enough as-is. -- To view, visit https://gerrit.osmocom.org/4421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If10d1599b62d010726336134091a4e855c380d93 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 14:38:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 14:38:24 +0000 Subject: [MERGED] openbsc[master]: remove sgsn, gbproxy and gtphub from openbsc.git In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove sgsn, gbproxy and gtphub from openbsc.git ...................................................................... remove sgsn, gbproxy and gtphub from openbsc.git The GPRS related programs osmo-sgsn, osmo-gtphub and osmo-gbproxy have been split off into the separate osmo-sgsn repository, which can be found at git://git.osmocom.org/osmo-sgsn.git http://git.osmocom.org/osmo-sgsn/ This is technically unrelated but conceptually part of the larger NITB-split activities. I did a brief log of all changes in src/gprs and couldn't find any commits that we might have applied here but which are missing from osmo-sgsn.git. Change-Id: If60e28b23f5cfb2c4eb354951363a2bb63f3e0de --- M debian/control D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M openbsc/.gitignore M openbsc/configure.ac D openbsc/contrib/gprs/gb-proxy-unblock-bug.py D openbsc/contrib/gprs/gprs-bssgp-histogram.lua D openbsc/contrib/gprs/gprs-buffer-count.lua D openbsc/contrib/gprs/gprs-split-trace-by-tlli.lua D openbsc/contrib/gprs/gprs-verify-nu.lua D openbsc/contrib/systemd/osmo-gbproxy.service D openbsc/contrib/systemd/osmo-sgsn.service D openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D openbsc/doc/examples/osmo-gtphub/gtphub-example.txt D openbsc/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg D openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg M openbsc/include/openbsc/Makefile.am D openbsc/include/openbsc/crc24.h D openbsc/include/openbsc/gb_proxy.h D openbsc/include/openbsc/gprs_gb_parse.h D openbsc/include/openbsc/gprs_gmm.h D openbsc/include/openbsc/gprs_llc.h D openbsc/include/openbsc/gprs_llc_xid.h D openbsc/include/openbsc/gprs_sgsn.h D openbsc/include/openbsc/gprs_sndcp.h D openbsc/include/openbsc/gprs_sndcp_comp.h D openbsc/include/openbsc/gprs_sndcp_dcomp.h D openbsc/include/openbsc/gprs_sndcp_pcomp.h D openbsc/include/openbsc/gprs_sndcp_xid.h D openbsc/include/openbsc/gprs_subscriber.h D openbsc/include/openbsc/gprs_utils.h M openbsc/include/openbsc/gsm_subscriber.h D openbsc/include/openbsc/gtphub.h D openbsc/include/openbsc/sgsn.h M openbsc/include/openbsc/signal.h D openbsc/include/openbsc/slhc.h D openbsc/include/openbsc/v42bis.h D openbsc/include/openbsc/v42bis_private.h M openbsc/osmoappdesc.py M openbsc/src/Makefile.am D openbsc/src/gprs/.gitignore D openbsc/src/gprs/Makefile.am D openbsc/src/gprs/crc24.c D openbsc/src/gprs/gb_proxy.c D openbsc/src/gprs/gb_proxy_main.c D openbsc/src/gprs/gb_proxy_patch.c D openbsc/src/gprs/gb_proxy_peer.c D openbsc/src/gprs/gb_proxy_tlli.c D openbsc/src/gprs/gb_proxy_vty.c D openbsc/src/gprs/gprs_gb_parse.c D openbsc/src/gprs/gprs_gmm.c D openbsc/src/gprs/gprs_llc.c D openbsc/src/gprs/gprs_llc_parse.c D openbsc/src/gprs/gprs_llc_vty.c D openbsc/src/gprs/gprs_llc_xid.c D openbsc/src/gprs/gprs_sgsn.c D openbsc/src/gprs/gprs_sndcp.c D openbsc/src/gprs/gprs_sndcp_comp.c D openbsc/src/gprs/gprs_sndcp_dcomp.c D openbsc/src/gprs/gprs_sndcp_pcomp.c D openbsc/src/gprs/gprs_sndcp_vty.c D openbsc/src/gprs/gprs_sndcp_xid.c D openbsc/src/gprs/gprs_subscriber.c D openbsc/src/gprs/gprs_utils.c D openbsc/src/gprs/gtphub.c D openbsc/src/gprs/gtphub_ares.c D openbsc/src/gprs/gtphub_main.c D openbsc/src/gprs/gtphub_sock.c D openbsc/src/gprs/gtphub_vty.c D openbsc/src/gprs/osmo_sgsn.cfg D openbsc/src/gprs/sgsn_ares.c D openbsc/src/gprs/sgsn_auth.c D openbsc/src/gprs/sgsn_cdr.c D openbsc/src/gprs/sgsn_ctrl.c D openbsc/src/gprs/sgsn_libgtp.c D openbsc/src/gprs/sgsn_main.c D openbsc/src/gprs/sgsn_vty.c D openbsc/src/gprs/slhc.c D openbsc/src/gprs/v42bis.c M openbsc/tests/Makefile.am M openbsc/tests/atlocal.in M openbsc/tests/ctrl_test_runner.py D openbsc/tests/gbproxy/Makefile.am D openbsc/tests/gbproxy/gbproxy_test.c D openbsc/tests/gbproxy/gbproxy_test.ok D openbsc/tests/gprs/Makefile.am D openbsc/tests/gprs/gprs_test.c D openbsc/tests/gprs/gprs_test.ok D openbsc/tests/gtphub/Makefile.am D openbsc/tests/gtphub/gtphub_test.c D openbsc/tests/gtphub/gtphub_test.ok M openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c D openbsc/tests/oap/Makefile.am D openbsc/tests/oap/oap_client_test.c D openbsc/tests/oap/oap_client_test.err D openbsc/tests/oap/oap_client_test.ok D openbsc/tests/sgsn/Makefile.am D openbsc/tests/sgsn/sgsn_test.c D openbsc/tests/sgsn/sgsn_test.ok D openbsc/tests/slhc/Makefile.am D openbsc/tests/slhc/slhc_test.c D openbsc/tests/slhc/slhc_test.ok D openbsc/tests/sndcp_xid/Makefile.am D openbsc/tests/sndcp_xid/sndcp_xid_test.c D openbsc/tests/sndcp_xid/sndcp_xid_test.ok M openbsc/tests/testsuite.at D openbsc/tests/v42bis/Makefile.am D openbsc/tests/v42bis/v42bis_test.c D openbsc/tests/v42bis/v42bis_test.ok M openbsc/tests/vty_test_runner.py D openbsc/tests/xid/Makefile.am D openbsc/tests/xid/xid_test.c D openbsc/tests/xid/xid_test.ok 124 files changed, 2 insertions(+), 48,826 deletions(-) Approvals: dexter: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/4417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If60e28b23f5cfb2c4eb354951363a2bb63f3e0de Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From admin at opensuse.org Thu Oct 26 14:45:39 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 14:45:39 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f1f52722f8a_718e50ef7454234a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 226s] | [ 226s] | This file was extended by libosmocore config.status 0.9.6.20171026, which was [ 226s] | generated by GNU Autoconf 2.69. Invocation command line was [ 226s] | [ 226s] | CONFIG_FILES = [ 226s] | CONFIG_HEADERS = [ 226s] | CONFIG_LINKS = [ 226s] | CONFIG_COMMANDS = [ 226s] | $ ./config.status Doxyfile.core [ 226s] | [ 226s] | on build36 [ 226s] | [ 226s] | config.status:1174: creating Doxyfile.core [ 226s] [ 226s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 226s] make[1]: *** [override_dh_auto_test] Error 1 [ 226s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 226s] debian/rules:15: recipe for target 'build' failed [ 226s] make: *** [build] Error 2 [ 226s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 226s] [ 226s] build36 failed "build libosmocore_0.9.6.20171026.dsc" at Thu Oct 26 14:45:25 UTC 2017. [ 226s] [ 226s] ### VM INTERACTION START ### [ 229s] [ 218.870133] reboot: Power down [ 229s] ### VM INTERACTION END ### [ 229s] [ 229s] build36 failed "build libosmocore_0.9.6.20171026.dsc" at Thu Oct 26 14:45:29 UTC 2017. [ 229s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 14:47:22 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 14:47:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f1f5833a605_718e50ef745444ee@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 122s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 122s] [ 122s] You may investigate any problem if you feel able to do so, in which [ 122s] case the test suite provides a good starting point. Its output may [ 122s] be found below `tests/testsuite.dir'. [ 122s] [ 122s] Makefile:1208: recipe for target 'check-local' failed [ 122s] make[3]: *** [check-local] Error 1 [ 122s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 122s] Makefile:1044: recipe for target 'check-am' failed [ 122s] make[2]: *** [check-am] Error 2 [ 122s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 122s] Makefile:448: recipe for target 'check-recursive' failed [ 122s] make[1]: *** [check-recursive] Error 1 [ 122s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 122s] dh_auto_test: make -j1 check returned exit code 2 [ 122s] debian/rules:12: recipe for target 'build' failed [ 122s] make: *** [build] Error 2 [ 122s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 122s] [ 122s] lamb03 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:47:10 UTC 2017. [ 122s] [ 122s] ### VM INTERACTION START ### [ 123s] Powering off. [ 123s] [ 116.894944] reboot: Power down [ 123s] ### VM INTERACTION END ### [ 123s] [ 123s] lamb03 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:47:11 UTC 2017. [ 123s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 14:48:31 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 14:48:31 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f1f5dccebcc_718e50ef745455dd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 127s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 127s] [ 127s] You may investigate any problem if you feel able to do so, in which [ 127s] case the test suite provides a good starting point. Its output may [ 127s] be found below `tests/testsuite.dir'. [ 127s] [ 127s] Makefile:1208: recipe for target 'check-local' failed [ 127s] make[3]: *** [check-local] Error 1 [ 127s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 127s] Makefile:1044: recipe for target 'check-am' failed [ 127s] make[2]: *** [check-am] Error 2 [ 127s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 127s] Makefile:448: recipe for target 'check-recursive' failed [ 127s] make[1]: *** [check-recursive] Error 1 [ 127s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 127s] dh_auto_test: make -j1 check returned exit code 2 [ 127s] debian/rules:12: recipe for target 'build' failed [ 127s] make: *** [build] Error 2 [ 127s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 127s] [ 127s] lamb06 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:48:12 UTC 2017. [ 127s] [ 127s] ### VM INTERACTION START ### [ 129s] Powering off. [ 129s] [ 121.528518] reboot: Power down [ 129s] ### VM INTERACTION END ### [ 129s] [ 129s] lamb06 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:48:14 UTC 2017. [ 129s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 14:48:31 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 14:48:31 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f1f5dd3c0a8_718e50ef745456f6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 143s] To: [ 143s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 143s] [ 143s] You may investigate any problem if you feel able to do so, in which [ 143s] case the test suite provides a good starting point. Its output may [ 143s] be found below `tests/testsuite.dir'. [ 143s] [ 143s] Makefile:1221: recipe for target 'check-local' failed [ 143s] make[3]: *** [check-local] Error 1 [ 143s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 143s] Makefile:1055: recipe for target 'check-am' failed [ 143s] make[2]: *** [check-am] Error 2 [ 143s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 143s] Makefile:460: recipe for target 'check-recursive' failed [ 143s] make[1]: *** [check-recursive] Error 1 [ 143s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 143s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 143s] debian/rules:12: recipe for target 'build' failed [ 143s] make: *** [build] Error 2 [ 143s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 143s] [ 143s] wildcard2 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:48:20 UTC 2017. [ 143s] [ 143s] ### VM INTERACTION START ### [ 146s] [ 133.121233] reboot: Power down [ 147s] ### VM INTERACTION END ### [ 147s] [ 147s] wildcard2 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:48:25 UTC 2017. [ 147s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 14:48:31 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 14:48:31 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f1f5dd80fac_718e50ef7454575f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 145s] To: [ 145s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 145s] [ 145s] You may investigate any problem if you feel able to do so, in which [ 145s] case the test suite provides a good starting point. Its output may [ 145s] be found below `tests/testsuite.dir'. [ 145s] [ 145s] Makefile:1221: recipe for target 'check-local' failed [ 145s] make[3]: *** [check-local] Error 1 [ 145s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 145s] Makefile:1055: recipe for target 'check-am' failed [ 145s] make[2]: *** [check-am] Error 2 [ 145s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 145s] Makefile:460: recipe for target 'check-recursive' failed [ 145s] make[1]: *** [check-recursive] Error 1 [ 145s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 145s] dh_auto_test: make -j1 check returned exit code 2 [ 145s] debian/rules:12: recipe for target 'build' failed [ 145s] make: *** [build] Error 2 [ 145s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 145s] [ 145s] lamb19 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:48:22 UTC 2017. [ 145s] [ 145s] ### VM INTERACTION START ### [ 148s] [ 141.178013] reboot: Power down [ 148s] ### VM INTERACTION END ### [ 148s] [ 148s] lamb19 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:48:26 UTC 2017. [ 148s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 14:49:05 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 14:49:05 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f1f5f8bee72_718e50ef7454616a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 194s] To: [ 194s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 194s] [ 194s] You may investigate any problem if you feel able to do so, in which [ 194s] case the test suite provides a good starting point. Its output may [ 194s] be found below `tests/testsuite.dir'. [ 194s] [ 194s] Makefile:1221: recipe for target 'check-local' failed [ 194s] make[3]: *** [check-local] Error 1 [ 194s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 194s] Makefile:1055: recipe for target 'check-am' failed [ 194s] make[2]: *** [check-am] Error 2 [ 194s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 194s] Makefile:460: recipe for target 'check-recursive' failed [ 194s] make[1]: *** [check-recursive] Error 1 [ 194s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 194s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 194s] debian/rules:12: recipe for target 'build' failed [ 194s] make: *** [build] Error 2 [ 194s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 194s] [ 194s] lamb53 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:48:57 UTC 2017. [ 194s] [ 194s] ### VM INTERACTION START ### [ 197s] [ 189.414565] reboot: Power down [ 197s] ### VM INTERACTION END ### [ 197s] [ 197s] lamb53 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:49:01 UTC 2017. [ 197s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 14:49:22 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 14:49:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f1f6293eab8_718e50ef74546311@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 159s] To: [ 159s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 159s] [ 159s] You may investigate any problem if you feel able to do so, in which [ 159s] case the test suite provides a good starting point. Its output may [ 159s] be found below `tests/testsuite.dir'. [ 159s] [ 159s] Makefile:1221: recipe for target 'check-local' failed [ 159s] make[3]: *** [check-local] Error 1 [ 159s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 159s] Makefile:1055: recipe for target 'check-am' failed [ 159s] make[2]: *** [check-am] Error 2 [ 159s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 159s] Makefile:460: recipe for target 'check-recursive' failed [ 159s] make[1]: *** [check-recursive] Error 1 [ 159s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 159s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 159s] debian/rules:12: recipe for target 'build' failed [ 159s] make: *** [build] Error 2 [ 159s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 159s] [ 159s] lamb23 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:49:08 UTC 2017. [ 159s] [ 159s] ### VM INTERACTION START ### [ 162s] [ 155.512276] reboot: Power down [ 162s] ### VM INTERACTION END ### [ 162s] [ 162s] lamb23 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:49:12 UTC 2017. [ 162s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 14:49:39 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 14:49:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f1f62b8871f_718e50ef74546414@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 187s] To: [ 187s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 187s] [ 187s] You may investigate any problem if you feel able to do so, in which [ 187s] case the test suite provides a good starting point. Its output may [ 187s] be found below `tests/testsuite.dir'. [ 187s] [ 187s] Makefile:1221: recipe for target 'check-local' failed [ 187s] make[3]: *** [check-local] Error 1 [ 187s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 187s] Makefile:1055: recipe for target 'check-am' failed [ 187s] make[2]: *** [check-am] Error 2 [ 187s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 187s] Makefile:460: recipe for target 'check-recursive' failed [ 187s] make[1]: *** [check-recursive] Error 1 [ 187s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 187s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 187s] debian/rules:12: recipe for target 'build' failed [ 187s] make: *** [build] Error 2 [ 187s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 187s] [ 187s] lamb14 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:49:23 UTC 2017. [ 187s] [ 187s] ### VM INTERACTION START ### [ 190s] [ 173.975356] reboot: Power down [ 190s] ### VM INTERACTION END ### [ 190s] [ 190s] lamb14 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:49:27 UTC 2017. [ 190s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 14:49:58 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 14:49:58 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f1f65f50d46_718e50ef7454687@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 170s] To: [ 170s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 170s] [ 170s] You may investigate any problem if you feel able to do so, in which [ 170s] case the test suite provides a good starting point. Its output may [ 170s] be found below `tests/testsuite.dir'. [ 170s] [ 170s] Makefile:1221: recipe for target 'check-local' failed [ 170s] make[3]: *** [check-local] Error 1 [ 170s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 170s] Makefile:1055: recipe for target 'check-am' failed [ 170s] make[2]: *** [check-am] Error 2 [ 170s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 170s] Makefile:460: recipe for target 'check-recursive' failed [ 170s] make[1]: *** [check-recursive] Error 1 [ 170s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 170s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 170s] debian/rules:12: recipe for target 'build' failed [ 170s] make: *** [build] Error 2 [ 170s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 170s] [ 170s] lamb63 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:49:53 UTC 2017. [ 170s] [ 170s] ### VM INTERACTION START ### [ 173s] [ 166.084622] reboot: Power down [ 173s] ### VM INTERACTION END ### [ 173s] [ 173s] lamb63 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:49:57 UTC 2017. [ 173s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 14:50:15 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 14:50:15 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f1f65f88ae3_718e50ef745469d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 215s] To: [ 215s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 215s] [ 215s] You may investigate any problem if you feel able to do so, in which [ 215s] case the test suite provides a good starting point. Its output may [ 215s] be found below `tests/testsuite.dir'. [ 215s] [ 215s] Makefile:1221: recipe for target 'check-local' failed [ 215s] make[3]: *** [check-local] Error 1 [ 215s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 215s] Makefile:1055: recipe for target 'check-am' failed [ 215s] make[2]: *** [check-am] Error 2 [ 215s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 215s] Makefile:460: recipe for target 'check-recursive' failed [ 215s] make[1]: *** [check-recursive] Error 1 [ 215s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 215s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 215s] debian/rules:12: recipe for target 'build' failed [ 215s] make: *** [build] Error 2 [ 215s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 215s] [ 215s] cloud128 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:49:52 UTC 2017. [ 215s] [ 215s] ### VM INTERACTION START ### [ 218s] [ 183.149936] reboot: Power down [ 219s] ### VM INTERACTION END ### [ 220s] [ 220s] cloud128 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:49:58 UTC 2017. [ 220s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 14:50:32 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 14:50:32 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f1f6606fba0_718e50ef745470d3@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 172s] To: [ 172s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 172s] [ 172s] You may investigate any problem if you feel able to do so, in which [ 172s] case the test suite provides a good starting point. Its output may [ 172s] be found below `tests/testsuite.dir'. [ 172s] [ 172s] Makefile:1221: recipe for target 'check-local' failed [ 172s] make[3]: *** [check-local] Error 1 [ 172s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 172s] Makefile:1055: recipe for target 'check-am' failed [ 172s] make[2]: *** [check-am] Error 2 [ 172s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 172s] Makefile:460: recipe for target 'check-recursive' failed [ 172s] make[1]: *** [check-recursive] Error 1 [ 172s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 172s] dh_auto_test: make -j1 check returned exit code 2 [ 172s] debian/rules:12: recipe for target 'build' failed [ 172s] make: *** [build] Error 2 [ 172s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 172s] [ 172s] cloud107 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:50:19 UTC 2017. [ 172s] [ 172s] ### VM INTERACTION START ### [ 175s] [ 159.335234] reboot: Power down [ 176s] ### VM INTERACTION END ### [ 176s] [ 176s] cloud107 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 14:50:23 UTC 2017. [ 176s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Thu Oct 26 15:00:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 15:00:29 +0000 Subject: [MERGED] osmo-sgsn[master]: gbproxy: don't link unnecessary In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: gbproxy: don't link unnecessary ...................................................................... gbproxy: don't link unnecessary * 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 --- M src/gprs/Makefile.am M src/libcommon/common_vty.c 2 files changed, 0 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index 654604b..764acba 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -28,13 +28,11 @@ OSMO_LIBS = \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOABIS_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBGTP_LIBS) \ - $(LIBOSMOSIGTRAN_LIBS) \ $(NULL) bin_PROGRAMS = \ diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index ac3c7fc..e960550 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -33,7 +33,6 @@ #include #include #include -#include int bsc_vty_go_parent(struct vty *vty) -- To view, visit https://gerrit.osmocom.org/4428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I015a9d858bc2a95f8c9a4aedd3e0a84eadcf84e1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 26 15:00:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 15:00:31 +0000 Subject: [MERGED] osmo-sgsn[master]: jenkins: check for IU properly In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: jenkins: check for IU properly ...................................................................... jenkins: check for IU properly The bug fixed by Idb034bf2ae749204836ab7e02018d769bb242a9f was not detected by jenkins because it installs libosmo-sccp unconditionally. Let's be more strict and install it only when necessary for IU builds to make sure we can catch such bugs in future. Change-Id: I573c7fec687edb71d79815b38a3bcf96273c03b3 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index dc1a1a5..140fc63 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -26,10 +26,10 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif -osmo-build-dep.sh libosmo-sccp osmo-build-dep.sh osmo-ggsn if [ "x$IU" = "x--enable-iu" ]; then + osmo-build-dep.sh libosmo-sccp osmo-build-dep.sh libasn1c #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh osmo-build-dep.sh osmo-iuh -- To view, visit https://gerrit.osmocom.org/4429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I573c7fec687edb71d79815b38a3bcf96273c03b3 Gerrit-PatchSet: 4 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 26 15:00:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 26 Oct 2017 15:00:32 +0000 Subject: [MERGED] osmo-sgsn[master]: Fix libosmo-sigtran dependency In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix libosmo-sigtran dependency ...................................................................... Fix libosmo-sigtran dependency That's follow-up fix for I72819462db0b4656fabaa80731342d06ae91fcdf to make sure IU builds are properly conditioned. Change-Id: Idb034bf2ae749204836ab7e02018d769bb242a9f --- M src/gprs/gtphub_main.c 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: dexter: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index c3e25d5..3f7de50 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -39,14 +39,16 @@ #include #include -#include - #include #include #include #include "../../bscconfig.h" +#if BUILD_IU +#include +#endif + extern void *osmo_gtphub_ctx; void *tall_bsc_ctx; -- To view, visit https://gerrit.osmocom.org/4430 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idb034bf2ae749204836ab7e02018d769bb242a9f Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Oct 26 15:35:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Oct 2017 15:35:12 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp_scrc: fix Network Indicator in SIO composition Message-ID: Review at https://gerrit.osmocom.org/4431 sccp_scrc: fix Network Indicator in SIO composition Since the NI is in bits DC, not BA, it needs to be shifted by 6, not 4, to end up in the two most significant bits. Also, NI is two bits wide, hence & 0x3. (The m3ua.c side of this is already correct.) See ITU-T Recommendation Q.704 (07/96), 14.2 "Service information octet". Before this patch, NI was always sent as 00 == International regardless of the VTY configuration. This patch was verified to work by a wireshark trace of osmo-bsc connecting to osmo-msc, showing the NI decoded as configured by an osmo-bsc.cfg file in the BSSMAP Reset message MTP 3 / Protocol data. Change-Id: I7bb4eb6518a1e0d74313bda776d2a6acd0b02e1b --- M include/osmocom/sigtran/mtp_sap.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/31/4431/1 diff --git a/include/osmocom/sigtran/mtp_sap.h b/include/osmocom/sigtran/mtp_sap.h index 120ae91..0ae8592 100644 --- a/include/osmocom/sigtran/mtp_sap.h +++ b/include/osmocom/sigtran/mtp_sap.h @@ -31,7 +31,7 @@ OSMO_MTP_PRIM_STATUS, }; -#define MTP_SIO(service, net_ind) (((net_ind & 0xF) << 4) | (service & 0xF)) +#define MTP_SIO(service, net_ind) (((net_ind & 0x3) << 6) | (service & 0xF)) struct osmo_mtp_transfer_param { uint32_t opc; -- To view, visit https://gerrit.osmocom.org/4431 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7bb4eb6518a1e0d74313bda776d2a6acd0b02e1b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 26 15:38:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 15:38:31 +0000 Subject: libosmo-sccp[master]: sccp_scrc: fix Network Indicator in SIO composition In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4431 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7bb4eb6518a1e0d74313bda776d2a6acd0b02e1b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 15:38:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 15:38:33 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp_scrc: fix Network Indicator in SIO composition In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp_scrc: fix Network Indicator in SIO composition ...................................................................... sccp_scrc: fix Network Indicator in SIO composition Since the NI is in bits DC, not BA, it needs to be shifted by 6, not 4, to end up in the two most significant bits. Also, NI is two bits wide, hence & 0x3. (The m3ua.c side of this is already correct.) See ITU-T Recommendation Q.704 (07/96), 14.2 "Service information octet". Before this patch, NI was always sent as 00 == International regardless of the VTY configuration. This patch was verified to work by a wireshark trace of osmo-bsc connecting to osmo-msc, showing the NI decoded as configured by an osmo-bsc.cfg file in the BSSMAP Reset message MTP 3 / Protocol data. Change-Id: I7bb4eb6518a1e0d74313bda776d2a6acd0b02e1b --- M include/osmocom/sigtran/mtp_sap.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/mtp_sap.h b/include/osmocom/sigtran/mtp_sap.h index 120ae91..0ae8592 100644 --- a/include/osmocom/sigtran/mtp_sap.h +++ b/include/osmocom/sigtran/mtp_sap.h @@ -31,7 +31,7 @@ OSMO_MTP_PRIM_STATUS, }; -#define MTP_SIO(service, net_ind) (((net_ind & 0xF) << 4) | (service & 0xF)) +#define MTP_SIO(service, net_ind) (((net_ind & 0x3) << 6) | (service & 0xF)) struct osmo_mtp_transfer_param { uint32_t opc; -- To view, visit https://gerrit.osmocom.org/4431 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7bb4eb6518a1e0d74313bda776d2a6acd0b02e1b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Thu Oct 26 15:48:28 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 15:48:28 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f203cdf20dd_718e50ef7456002a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 252s] | [ 252s] | This file was extended by libosmocore config.status 0.9.6.20171026, which was [ 252s] | generated by GNU Autoconf 2.69. Invocation command line was [ 252s] | [ 252s] | CONFIG_FILES = [ 252s] | CONFIG_HEADERS = [ 252s] | CONFIG_LINKS = [ 252s] | CONFIG_COMMANDS = [ 252s] | $ ./config.status Doxyfile.core [ 252s] | [ 252s] | on build31 [ 252s] | [ 252s] | config.status:1174: creating Doxyfile.core [ 252s] [ 252s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 252s] make[1]: *** [override_dh_auto_test] Error 1 [ 252s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 252s] debian/rules:15: recipe for target 'build' failed [ 252s] make: *** [build] Error 2 [ 252s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 252s] [ 252s] build31 failed "build libosmocore_0.9.6.20171026.dsc" at Thu Oct 26 15:48:09 UTC 2017. [ 252s] [ 252s] ### VM INTERACTION START ### [ 256s] [ 245.833424] reboot: Power down [ 256s] ### VM INTERACTION END ### [ 256s] [ 256s] build31 failed "build libosmocore_0.9.6.20171026.dsc" at Thu Oct 26 15:48:14 UTC 2017. [ 256s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 15:48:45 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 15:48:45 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f203ef6fb17_718e50ef745602ee@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 144s] To: [ 144s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 144s] [ 144s] You may investigate any problem if you feel able to do so, in which [ 144s] case the test suite provides a good starting point. Its output may [ 144s] be found below `tests/testsuite.dir'. [ 144s] [ 144s] Makefile:1221: recipe for target 'check-local' failed [ 144s] make[3]: *** [check-local] Error 1 [ 144s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 144s] Makefile:1055: recipe for target 'check-am' failed [ 144s] make[2]: *** [check-am] Error 2 [ 144s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 144s] Makefile:460: recipe for target 'check-recursive' failed [ 144s] make[1]: *** [check-recursive] Error 1 [ 144s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 144s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 144s] debian/rules:12: recipe for target 'build' failed [ 144s] make: *** [build] Error 2 [ 144s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 144s] [ 144s] lamb58 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:48:36 UTC 2017. [ 144s] [ 144s] ### VM INTERACTION START ### [ 147s] [ 139.629576] reboot: Power down [ 147s] ### VM INTERACTION END ### [ 147s] [ 147s] lamb58 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:48:39 UTC 2017. [ 147s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 15:49:53 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 15:49:53 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f20429237c7_718e50ef74560430@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 170s] To: [ 170s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 170s] [ 170s] You may investigate any problem if you feel able to do so, in which [ 170s] case the test suite provides a good starting point. Its output may [ 170s] be found below `tests/testsuite.dir'. [ 170s] [ 170s] Makefile:1221: recipe for target 'check-local' failed [ 170s] make[3]: *** [check-local] Error 1 [ 170s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 170s] Makefile:1055: recipe for target 'check-am' failed [ 170s] make[2]: *** [check-am] Error 2 [ 170s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 170s] Makefile:460: recipe for target 'check-recursive' failed [ 170s] make[1]: *** [check-recursive] Error 1 [ 170s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 170s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 170s] debian/rules:12: recipe for target 'build' failed [ 170s] make: *** [build] Error 2 [ 170s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 170s] [ 170s] lamb25 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:49:36 UTC 2017. [ 170s] [ 170s] ### VM INTERACTION START ### [ 173s] [ 166.479973] reboot: Power down [ 173s] ### VM INTERACTION END ### [ 173s] [ 173s] lamb25 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:49:39 UTC 2017. [ 173s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 15:50:10 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 15:50:10 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f20448aa493_718e50ef745606a0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 125s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 125s] [ 125s] You may investigate any problem if you feel able to do so, in which [ 125s] case the test suite provides a good starting point. Its output may [ 125s] be found below `tests/testsuite.dir'. [ 125s] [ 126s] Makefile:1208: recipe for target 'check-local' failed [ 126s] make[3]: *** [check-local] Error 1 [ 126s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 126s] Makefile:1044: recipe for target 'check-am' failed [ 126s] make[2]: *** [check-am] Error 2 [ 126s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 126s] Makefile:448: recipe for target 'check-recursive' failed [ 126s] make[1]: *** [check-recursive] Error 1 [ 126s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 126s] dh_auto_test: make -j1 check returned exit code 2 [ 126s] debian/rules:12: recipe for target 'build' failed [ 126s] make: *** [build] Error 2 [ 126s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 126s] [ 126s] lamb01 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:50:03 UTC 2017. [ 126s] [ 126s] ### VM INTERACTION START ### [ 127s] Powering off. [ 127s] [ 118.946927] reboot: Power down [ 127s] ### VM INTERACTION END ### [ 127s] [ 127s] lamb01 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:50:05 UTC 2017. [ 127s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 15:50:44 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 15:50:44 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f20462a6357_718e50ef74560850@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 128s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 128s] [ 128s] You may investigate any problem if you feel able to do so, in which [ 128s] case the test suite provides a good starting point. Its output may [ 128s] be found below `tests/testsuite.dir'. [ 128s] [ 128s] Makefile:1208: recipe for target 'check-local' failed [ 128s] make[3]: *** [check-local] Error 1 [ 128s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 128s] Makefile:1044: recipe for target 'check-am' failed [ 128s] make[2]: *** [check-am] Error 2 [ 128s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 128s] Makefile:448: recipe for target 'check-recursive' failed [ 128s] make[1]: *** [check-recursive] Error 1 [ 128s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 128s] dh_auto_test: make -j1 check returned exit code 2 [ 128s] debian/rules:12: recipe for target 'build' failed [ 128s] make: *** [build] Error 2 [ 128s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 128s] [ 128s] lamb11 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:50:25 UTC 2017. [ 128s] [ 128s] ### VM INTERACTION START ### [ 129s] Powering off. [ 129s] [ 121.814332] reboot: Power down [ 129s] ### VM INTERACTION END ### [ 129s] [ 129s] lamb11 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:50:27 UTC 2017. [ 129s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 15:50:44 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 15:50:44 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f2046312261_718e50ef74560973@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 148s] To: [ 148s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 148s] [ 148s] You may investigate any problem if you feel able to do so, in which [ 148s] case the test suite provides a good starting point. Its output may [ 148s] be found below `tests/testsuite.dir'. [ 148s] [ 148s] Makefile:1221: recipe for target 'check-local' failed [ 148s] make[3]: *** [check-local] Error 1 [ 148s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 148s] Makefile:1055: recipe for target 'check-am' failed [ 148s] make[2]: *** [check-am] Error 2 [ 148s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 148s] Makefile:460: recipe for target 'check-recursive' failed [ 148s] make[1]: *** [check-recursive] Error 1 [ 148s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 148s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 148s] debian/rules:12: recipe for target 'build' failed [ 148s] make: *** [build] Error 2 [ 148s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 148s] [ 148s] lamb10 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:50:32 UTC 2017. [ 148s] [ 148s] ### VM INTERACTION START ### [ 152s] [ 143.592483] reboot: Power down [ 152s] ### VM INTERACTION END ### [ 152s] [ 152s] lamb10 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:50:36 UTC 2017. [ 152s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 15:51:01 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 15:51:01 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f20481b6366_718e50ef74561082@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 161s] To: [ 161s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 161s] [ 161s] You may investigate any problem if you feel able to do so, in which [ 161s] case the test suite provides a good starting point. Its output may [ 161s] be found below `tests/testsuite.dir'. [ 161s] [ 161s] Makefile:1221: recipe for target 'check-local' failed [ 161s] make[3]: *** [check-local] Error 1 [ 161s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 161s] Makefile:1055: recipe for target 'check-am' failed [ 161s] make[2]: *** [check-am] Error 2 [ 161s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 161s] Makefile:460: recipe for target 'check-recursive' failed [ 161s] make[1]: *** [check-recursive] Error 1 [ 161s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 161s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 161s] debian/rules:12: recipe for target 'build' failed [ 161s] make: *** [build] Error 2 [ 161s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 161s] [ 161s] lamb59 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:50:56 UTC 2017. [ 161s] [ 161s] ### VM INTERACTION START ### [ 165s] [ 157.099732] reboot: Power down [ 165s] ### VM INTERACTION END ### [ 165s] [ 165s] lamb59 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:51:00 UTC 2017. [ 165s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 15:51:18 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 15:51:18 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f2048223244_718e50ef7456111c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 156s] To: [ 156s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 156s] [ 156s] You may investigate any problem if you feel able to do so, in which [ 156s] case the test suite provides a good starting point. Its output may [ 156s] be found below `tests/testsuite.dir'. [ 156s] [ 156s] Makefile:1221: recipe for target 'check-local' failed [ 156s] make[3]: *** [check-local] Error 1 [ 156s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 156s] Makefile:1055: recipe for target 'check-am' failed [ 156s] make[2]: *** [check-am] Error 2 [ 156s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 156s] Makefile:460: recipe for target 'check-recursive' failed [ 156s] make[1]: *** [check-recursive] Error 1 [ 156s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 156s] dh_auto_test: make -j1 check returned exit code 2 [ 156s] debian/rules:12: recipe for target 'build' failed [ 156s] make: *** [build] Error 2 [ 156s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 156s] [ 156s] lamb26 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:51:05 UTC 2017. [ 156s] [ 156s] ### VM INTERACTION START ### [ 159s] [ 152.633589] reboot: Power down [ 159s] ### VM INTERACTION END ### [ 159s] [ 159s] lamb26 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:51:08 UTC 2017. [ 159s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 15:51:18 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 15:51:18 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f204826d9ac_718e50ef74561273@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 156s] To: [ 156s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 156s] [ 156s] You may investigate any problem if you feel able to do so, in which [ 156s] case the test suite provides a good starting point. Its output may [ 156s] be found below `tests/testsuite.dir'. [ 156s] [ 156s] Makefile:1221: recipe for target 'check-local' failed [ 156s] make[3]: *** [check-local] Error 1 [ 156s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 156s] Makefile:1055: recipe for target 'check-am' failed [ 156s] make[2]: *** [check-am] Error 2 [ 156s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 156s] Makefile:460: recipe for target 'check-recursive' failed [ 156s] make[1]: *** [check-recursive] Error 1 [ 156s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 156s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 156s] debian/rules:12: recipe for target 'build' failed [ 156s] make: *** [build] Error 2 [ 156s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 156s] [ 156s] lamb26 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:51:08 UTC 2017. [ 156s] [ 156s] ### VM INTERACTION START ### [ 159s] [ 151.330929] reboot: Power down [ 159s] ### VM INTERACTION END ### [ 159s] [ 159s] lamb26 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:51:12 UTC 2017. [ 159s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 15:51:18 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 15:51:18 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f20482a7da1_718e50ef745613b8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 177s] To: [ 177s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 177s] [ 177s] You may investigate any problem if you feel able to do so, in which [ 177s] case the test suite provides a good starting point. Its output may [ 177s] be found below `tests/testsuite.dir'. [ 177s] [ 177s] Makefile:1221: recipe for target 'check-local' failed [ 177s] make[3]: *** [check-local] Error 1 [ 177s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 177s] Makefile:1055: recipe for target 'check-am' failed [ 177s] make[2]: *** [check-am] Error 2 [ 177s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 177s] Makefile:460: recipe for target 'check-recursive' failed [ 177s] make[1]: *** [check-recursive] Error 1 [ 177s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 177s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 177s] debian/rules:12: recipe for target 'build' failed [ 177s] make: *** [build] Error 2 [ 177s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 177s] [ 177s] cloud127 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:51:07 UTC 2017. [ 177s] [ 177s] ### VM INTERACTION START ### [ 181s] [ 166.305744] reboot: Power down [ 182s] ### VM INTERACTION END ### [ 182s] [ 182s] cloud127 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:51:12 UTC 2017. [ 182s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 15:51:18 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 15:51:18 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f204831e8ab_718e50ef74561427@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 170s] To: [ 170s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 170s] [ 170s] You may investigate any problem if you feel able to do so, in which [ 170s] case the test suite provides a good starting point. Its output may [ 170s] be found below `tests/testsuite.dir'. [ 170s] [ 170s] Makefile:1221: recipe for target 'check-local' failed [ 170s] make[3]: *** [check-local] Error 1 [ 170s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 170s] Makefile:1055: recipe for target 'check-am' failed [ 170s] make[2]: *** [check-am] Error 2 [ 170s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 170s] Makefile:460: recipe for target 'check-recursive' failed [ 170s] make[1]: *** [check-recursive] Error 1 [ 170s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 170s] dh_auto_test: make -j1 check returned exit code 2 [ 170s] debian/rules:12: recipe for target 'build' failed [ 170s] make: *** [build] Error 2 [ 170s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 170s] [ 170s] build33 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:51:01 UTC 2017. [ 170s] [ 170s] ### VM INTERACTION START ### [ 174s] [ 163.739423] reboot: Power down [ 174s] ### VM INTERACTION END ### [ 174s] [ 174s] build33 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 15:51:05 UTC 2017. [ 174s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Thu Oct 26 16:01:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 16:01:32 +0000 Subject: [PATCH] osmo-ci[master]: osmocom:nightly OBS: remove old osmo-stp/cellmgr-ng package Message-ID: Review at https://gerrit.osmocom.org/4432 osmocom:nightly OBS: remove old osmo-stp/cellmgr-ng package this package doesn't exist in the OBS anyway, yet we continue to attempt to upload it there. Stop that :) Change-Id: I0f0726ed412e4a281dcf99047ca22b494216b4ad --- M scripts/osmocom-nightly-packages.sh 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/32/4432/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index dd84b4f..05abe60 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -20,7 +20,6 @@ git clone git://git.osmocom.org/osmo-ggsn git clone git://git.osmocom.org/openbsc git clone git://git.osmocom.org/osmo-pcap -git clone git://git.osmocom.org/cellmgr-ng osmo-stp git clone git://git.osmocom.org/osmo-trx git clone git://git.osmocom.org/osmo-bts git clone git://git.osmocom.org/osmo-pcu @@ -59,7 +58,6 @@ build osmo-sgsn build openbsc build osmo-pcap -build osmo-stp build osmo-trx build osmo-sip-connector build osmo-bts -- To view, visit https://gerrit.osmocom.org/4432 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0f0726ed412e4a281dcf99047ca22b494216b4ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Oct 26 16:01:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 16:01:34 +0000 Subject: [PATCH] osmo-ci[master]: osmocom:nightly OBS: Add osmo-msc + osmo-mgw Message-ID: Review at https://gerrit.osmocom.org/4433 osmocom:nightly OBS: Add osmo-msc + osmo-mgw Change-Id: Ie417f912f11f3a45c6efb39595d6a4d89cf3a058 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/33/4433/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 05abe60..12aa587 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -24,6 +24,8 @@ git clone git://git.osmocom.org/osmo-bts git clone git://git.osmocom.org/osmo-pcu git clone git://git.osmocom.org/osmo-hlr +git clone git://git.osmocom.org/osmo-mgw +git clone git://git.osmocom.org/osmo-msc PROJ=network:osmocom:nightly @@ -63,6 +65,8 @@ build osmo-bts build osmo-pcu build osmo-hlr +build osmo-mgw +build osmo-msc cd $PROJ osc ci -m "Snapshot $DT" -- To view, visit https://gerrit.osmocom.org/4433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie417f912f11f3a45c6efb39595d6a4d89cf3a058 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Oct 26 16:02:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 16:02:21 +0000 Subject: osmo-ci[master]: osmocom:nightly OBS: remove old osmo-stp/cellmgr-ng package In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4432 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0f0726ed412e4a281dcf99047ca22b494216b4ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 16:02:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 16:02:25 +0000 Subject: osmo-ci[master]: osmocom:nightly OBS: Add osmo-msc + osmo-mgw In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie417f912f11f3a45c6efb39595d6a4d89cf3a058 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:16:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:16:45 +0000 Subject: osmo-ci[master]: osmocom:nightly OBS: Add osmo-msc + osmo-mgw In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie417f912f11f3a45c6efb39595d6a4d89cf3a058 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:16:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:16:47 +0000 Subject: osmo-ci[master]: osmocom:nightly OBS: remove old osmo-stp/cellmgr-ng package In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4432 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0f0726ed412e4a281dcf99047ca22b494216b4ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:16:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:16:50 +0000 Subject: [MERGED] osmo-ci[master]: osmocom:nightly OBS: remove old osmo-stp/cellmgr-ng package In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmocom:nightly OBS: remove old osmo-stp/cellmgr-ng package ...................................................................... osmocom:nightly OBS: remove old osmo-stp/cellmgr-ng package this package doesn't exist in the OBS anyway, yet we continue to attempt to upload it there. Stop that :) Change-Id: I0f0726ed412e4a281dcf99047ca22b494216b4ad --- M scripts/osmocom-nightly-packages.sh 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index dd84b4f..05abe60 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -20,7 +20,6 @@ git clone git://git.osmocom.org/osmo-ggsn git clone git://git.osmocom.org/openbsc git clone git://git.osmocom.org/osmo-pcap -git clone git://git.osmocom.org/cellmgr-ng osmo-stp git clone git://git.osmocom.org/osmo-trx git clone git://git.osmocom.org/osmo-bts git clone git://git.osmocom.org/osmo-pcu @@ -59,7 +58,6 @@ build osmo-sgsn build openbsc build osmo-pcap -build osmo-stp build osmo-trx build osmo-sip-connector build osmo-bts -- To view, visit https://gerrit.osmocom.org/4432 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0f0726ed412e4a281dcf99047ca22b494216b4ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:16:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:16:50 +0000 Subject: [MERGED] osmo-ci[master]: osmocom:nightly OBS: Add osmo-msc + osmo-mgw In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmocom:nightly OBS: Add osmo-msc + osmo-mgw ...................................................................... osmocom:nightly OBS: Add osmo-msc + osmo-mgw Change-Id: Ie417f912f11f3a45c6efb39595d6a4d89cf3a058 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 05abe60..12aa587 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -24,6 +24,8 @@ git clone git://git.osmocom.org/osmo-bts git clone git://git.osmocom.org/osmo-pcu git clone git://git.osmocom.org/osmo-hlr +git clone git://git.osmocom.org/osmo-mgw +git clone git://git.osmocom.org/osmo-msc PROJ=network:osmocom:nightly @@ -63,6 +65,8 @@ build osmo-bts build osmo-pcu build osmo-hlr +build osmo-mgw +build osmo-msc cd $PROJ osc ci -m "Snapshot $DT" -- To view, visit https://gerrit.osmocom.org/4433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie417f912f11f3a45c6efb39595d6a4d89cf3a058 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:17:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:17:04 +0000 Subject: openbsc[master]: rename osmo-bsc to osmo-bsc-sccplite In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If10d1599b62d010726336134091a4e855c380d93 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:17:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:17:37 +0000 Subject: [MERGED] openbsc[master]: rename osmo-bsc to osmo-bsc-sccplite In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rename osmo-bsc to osmo-bsc-sccplite ...................................................................... rename osmo-bsc to osmo-bsc-sccplite This is to avoid naming conflicts with the new osmo-bsc, which resides in its own git repository (osmo-bsc.git) and which uses libosmo-sigtran and implements (primarily) 3GPP AoIP. Change-Id: If10d1599b62d010726336134091a4e855c380d93 --- M debian/changelog M debian/control A debian/osmocom-bsc-sccplite.examples A debian/osmocom-bsc-sccplite.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install M debian/rules M openbsc/.gitignore M openbsc/contrib/bsc-test/msc.sh R openbsc/contrib/systemd/osmo-bsc-sccplite.service R openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg M openbsc/osmoappdesc.py M openbsc/src/osmo-bsc/Makefile.am M openbsc/src/osmo-bsc/osmo_bsc_main.c M openbsc/tests/ctrl_test_runner.py M openbsc/tests/vty_test_runner.py 16 files changed, 33 insertions(+), 28 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index e9a4212..dd850be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,10 @@ * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. Note: such configs are broken without extra workarounds anyway. + [ Harald Welte ] + * Rename osmo-bsc to osmo-bsc-sccplite to avoid clashes with new 3GPP AoIP + osmo-bsc.git code + -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 openbsc (0.14.0) unstable; urgency=low diff --git a/debian/control b/debian/control index 58e8966..e31d0c4 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Vcs-Browser: http://openbsc.osmocom.org/trac/browser Homepage: https://projects.osmocom.org/projects/openbsc -Package: osmocom-bsc +Package: osmocom-bsc-sccplite Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -40,7 +40,7 @@ Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR This is the Network-in-a-Box version of OpenBSC. It has all the GSM network components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. + Mobile Switching Center (MSC) which is needed when using osmocom-bsc-sccplite. Package: osmocom-ipaccess-utils Architecture: any @@ -64,13 +64,13 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: osmocom-bsc +Recommends: osmocom-bsc-sccplite Description: Osmocom Base Station Controller Network Address Translation This NAT is useful for masquerading multiple BSCs behind one. It listens for incoming BSCs on port 5000 and connects to a specified Mobile Switching Center (MSC). . - This package is part of OpenBSC and closely related to osmocom-bsc. + This package is part of OpenBSC and closely related to osmocom-bsc-sccplite. Package: openbsc-dev Architecture: all @@ -83,11 +83,11 @@ The directory structure is copied after the structure in the repository and the header and .c file are installed into /usr/src/osmocom/openbsc/. -Package: osmocom-bsc-dbg +Package: osmocom-bsc-sccplite-dbg Architecture: any Section: debug Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} +Depends: osmocom-bsc-sccplite (= ${binary:Version}), ${misc:Depends} Description: Debug symbols for the OpenBSC BSC Make debugging possible diff --git a/debian/osmocom-bsc-sccplite.examples b/debian/osmocom-bsc-sccplite.examples new file mode 100644 index 0000000..545709b --- /dev/null +++ b/debian/osmocom-bsc-sccplite.examples @@ -0,0 +1,2 @@ +openbsc/doc/examples/osmo-bsc_mgcp +openbsc/doc/examples/osmo-bsc-sccplite diff --git a/debian/osmocom-bsc-sccplite.install b/debian/osmocom-bsc-sccplite.install new file mode 100644 index 0000000..9ce795c --- /dev/null +++ b/debian/osmocom-bsc-sccplite.install @@ -0,0 +1,2 @@ +/usr/bin/osmo-bsc_mgcp +/usr/bin/osmo-bsc-sccplite diff --git a/debian/osmocom-bsc.examples b/debian/osmocom-bsc.examples deleted file mode 100644 index a95f12b..0000000 --- a/debian/osmocom-bsc.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-bsc_mgcp diff --git a/debian/osmocom-bsc.install b/debian/osmocom-bsc.install deleted file mode 100644 index ab9459e..0000000 --- a/debian/osmocom-bsc.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-bsc_mgcp -/usr/bin/osmo-bsc diff --git a/debian/rules b/debian/rules index d1d74a5..05bbbef 100755 --- a/debian/rules +++ b/debian/rules @@ -17,7 +17,7 @@ cd openbsc && autoreconf --install --force override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg + dh_strip -posmocom-bsc-sccplite --dbg-package=osmocom-bsc-sccplite-dbg dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg diff --git a/openbsc/.gitignore b/openbsc/.gitignore index f54aa59..3a811e7 100644 --- a/openbsc/.gitignore +++ b/openbsc/.gitignore @@ -9,7 +9,7 @@ openbsc.pc src/osmo-nitb/osmo-nitb src/osmo-bsc_mgcp/osmo-bsc_mgcp -src/osmo-bsc/osmo-bsc +src/osmo-bsc/osmo-bsc-sccplite src/utils/meas_vis src/utils/meas_json src/utils/osmo-meas-pcap2db diff --git a/openbsc/contrib/bsc-test/msc.sh b/openbsc/contrib/bsc-test/msc.sh index bec011d..766603d 100755 --- a/openbsc/contrib/bsc-test/msc.sh +++ b/openbsc/contrib/bsc-test/msc.sh @@ -2,7 +2,7 @@ while true; do - echo "Kill the osmo-bsc" - /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc` + echo "Kill the osmo-bsc-sccplite" + /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc-sccplite` sleep 58s done diff --git a/openbsc/contrib/systemd/osmo-bsc.service b/openbsc/contrib/systemd/osmo-bsc-sccplite.service similarity index 65% rename from openbsc/contrib/systemd/osmo-bsc.service rename to openbsc/contrib/systemd/osmo-bsc-sccplite.service index 4047fef..70cda5f 100644 --- a/openbsc/contrib/systemd/osmo-bsc.service +++ b/openbsc/contrib/systemd/osmo-bsc-sccplite.service @@ -5,7 +5,7 @@ [Service] Type=simple Restart=always -ExecStart=/usr/bin/osmo-bsc -c /etc/osmocom/osmo-bsc.cfg -s +ExecStart=/usr/bin/osmo-bsc-sccplite -c /etc/osmocom/osmo-bsc-sccplite.cfg -s RestartSec=2 [Install] diff --git a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg b/openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg similarity index 100% rename from openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg rename to openbsc/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg diff --git a/openbsc/osmoappdesc.py b/openbsc/osmoappdesc.py index ba6d954..c5b20ac 100644 --- a/openbsc/osmoappdesc.py +++ b/openbsc/osmoappdesc.py @@ -28,7 +28,7 @@ app_configs = { - "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], + "osmo-bsc-sccplite": ["doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], "mgcp": ["doc/examples/osmo-bsc_mgcp/mgcp.cfg"], "nitb": ["doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg", @@ -36,7 +36,7 @@ } -apps = [(4242, "src/osmo-bsc/osmo-bsc", "OsmoBSC", "osmo-bsc"), +apps = [(4242, "src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "osmo-bsc-sccplite"), (4244, "src/osmo-bsc_nat/osmo-bsc_nat", "OsmoBSCNAT", "nat"), (4243, "src/osmo-bsc_mgcp/osmo-bsc_mgcp", "OpenBSC MGCP", "mgcp"), (4242, "src/osmo-nitb/osmo-nitb", "OpenBSC", "nitb"), diff --git a/openbsc/src/osmo-bsc/Makefile.am b/openbsc/src/osmo-bsc/Makefile.am index ae9410c..343af70 100644 --- a/openbsc/src/osmo-bsc/Makefile.am +++ b/openbsc/src/osmo-bsc/Makefile.am @@ -21,10 +21,10 @@ $(NULL) bin_PROGRAMS = \ - osmo-bsc \ + osmo-bsc-sccplite \ $(NULL) -osmo_bsc_SOURCES = \ +osmo_bsc_sccplite_SOURCES = \ osmo_bsc_main.c \ osmo_bsc_vty.c \ osmo_bsc_api.c \ @@ -38,7 +38,7 @@ $(NULL) # once again since TRAU uses CC symbol :( -osmo_bsc_LDADD = \ +osmo_bsc_sccplite_LDADD = \ $(top_builddir)/src/libfilter/libfilter.a \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 6081460..022cd3d 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -70,7 +70,7 @@ static void print_usage() { - printf("Usage: osmo-bsc\n"); + printf("Usage: osmo-bsc-sccplite\n"); } static void print_help() diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py index 46c4dcf..fb69027 100644 --- a/openbsc/tests/ctrl_test_runner.py +++ b/openbsc/tests/ctrl_test_runner.py @@ -155,11 +155,11 @@ os.unlink("tmp_dummy_sock") def ctrl_command(self): - return ["./src/osmo-bsc/osmo-bsc", "-r", "tmp_dummy_sock", "-c", - "doc/examples/osmo-bsc/osmo-bsc.cfg"] + return ["./src/osmo-bsc/osmo-bsc-sccplite", "-r", "tmp_dummy_sock", "-c", + "doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg"] def ctrl_app(self): - return (4249, "./src/osmo-bsc/osmo-bsc", "OsmoBSC", "bsc") + return (4249, "./src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "bsc") def testCtrlErrs(self): r = self.do_get('invalid') @@ -606,7 +606,7 @@ # added. e.g. by implementing a get for the list. def add_bsc_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): + if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc-sccplite")): print("Skipping the BSC test") return test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlBSC) diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 8bec7c0..a3161fb 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -579,11 +579,11 @@ class TestVTYBSC(TestVTYGenericBSC): def vty_command(self): - return ["./src/osmo-bsc/osmo-bsc", "-c", - "doc/examples/osmo-bsc/osmo-bsc.cfg"] + return ["./src/osmo-bsc/osmo-bsc-sccplite", "-c", + "doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg"] def vty_app(self): - return (4242, "./src/osmo-bsc/osmo-bsc", "OsmoBSC", "bsc") + return (4242, "./src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "bsc") def testConfigNetworkTree(self): self._testConfigNetworkTree() @@ -1113,7 +1113,7 @@ return bsc def add_bsc_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): + if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc-sccplite")): print("Skipping the BSC test") return test = unittest.TestLoader().loadTestsFromTestCase(TestVTYBSC) -- To view, visit https://gerrit.osmocom.org/4421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If10d1599b62d010726336134091a4e855c380d93 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:17:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:17:53 +0000 Subject: [MERGED] osmo-bsc[master]: log: log the sccp message type of messages sent In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: log: log the sccp message type of messages sent ...................................................................... log: log the sccp message type of messages sent We already log the message type of sccp messages we receive, but for transmitting the log output is missing. Also log the message type for tramsitted sccp messages. Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7 --- M src/osmo-bsc/osmo_bsc_sigtran.c 1 file changed, 16 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 48796c1..31a8cea 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -331,6 +331,22 @@ msc = conn->msc; + /* Log the type of the message we are sending. This is just + * informative, do not stop if detecting the type fails */ + if (msg->len >= 3) { + switch (msg->data[0]) { + case BSSAP_MSG_BSS_MANAGEMENT: + LOGP(DMSC, LOGL_INFO, "Tx MSC %s\n", gsm0808_bssmap_name(msg->data[2])); + break; + case BSSAP_MSG_DTAP: + LOGP(DMSC, LOGL_INFO, "Tx MSC DTAP\n"); + break; + default: + LOGP(DMSC, LOGL_ERROR, "Tx MSC (unknwon message type)\n"); + } + } else + LOGP(DMSC, LOGL_ERROR, "Tx MSC (message too short)\n"); + if (a_reset_conn_ready(msc->a.reset) == false) { LOGP(DMSC, LOGL_ERROR, "MSC is not connected. Dropping.\n"); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/4351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:17:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:17:53 +0000 Subject: [MERGED] osmo-bsc[master]: log: output hexdump of transmitted sccp messages In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: log: output hexdump of transmitted sccp messages ...................................................................... log: output hexdump of transmitted sccp messages We output a hexdump for each sccp message we receive, but not when sending. Also log the hexdump of sccp messages when sending. Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345 --- M src/osmo-bsc/osmo_bsc_sigtran.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 31a8cea..951061a 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -356,8 +356,8 @@ ss7 = osmo_ss7_instance_find(msc->a.cs7_instance); OSMO_ASSERT(ss7); - LOGP(DMSC, LOGL_DEBUG, "Sending connection (id=%i) oriented data to MSC: %si\n", - conn_id, osmo_sccp_addr_name(ss7, &msc->a.msc_addr)); + LOGP(DMSC, LOGL_DEBUG, "Sending connection (id=%i) oriented data to MSC: %s (%s)\n", + conn_id, osmo_sccp_addr_name(ss7, &msc->a.msc_addr), osmo_hexdump(msg->data, msg->len)); rc = osmo_sccp_tx_data_msg(msc->a.sccp_user, conn_id, msg); -- To view, visit https://gerrit.osmocom.org/4350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:18:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:18:18 +0000 Subject: osmo-gsm-tester[master]: config: Fix crash in overlay() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f8a191810e89a4081199edcb390fb3bb27ed42f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:18:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:18:45 +0000 Subject: osmo-gsm-tester[master]: util: Add setcap_net_raw API In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4423 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3eb24461c02173dc80837a4cc83f9f2420c7816 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:19:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:19:17 +0000 Subject: osmo-gsm-tester[master]: util: Add change_elf_rpath API In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 what a nightmare to have to jump through those hoops... -- To view, visit https://gerrit.osmocom.org/4424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibc356957fb3dbcf9947bfe96b671ec8c7ede33ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:25:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:25:28 +0000 Subject: osmo-gsm-tester[master]: Add support for osmo-bts-octphy In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4425/1/example/resources.conf File example/resources.conf: PS1, Line 34: Octphy OCTPHY is the osmo-bts- backend name and the name of the PHY library. "OCTBTS 3500" is the product name, and we also have some "OCTBTS 3000". -- To view, visit https://gerrit.osmocom.org/4425 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia350964fa539083bb68d439cad0caa8fdf85d297 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:26:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:26:48 +0000 Subject: osmo-gsm-tester[master]: Change example config to use only 1 TRX for osmo-bts-octphy ... In-Reply-To: References: Message-ID: Patch Set 1: the OCTBTS conists of two DSPs, and each of them can be single-TRX or multi-TRX. The multi-TRX license relates to running multiple soft TRXs on one DSP. Result: you should be able to run two TRXs (one on each DSP) perfectly fine with current software. -- To view, visit https://gerrit.osmocom.org/4426 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2c415deb85187feb42fb6d24cc86273eb722936 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 17:26:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 17:26:57 +0000 Subject: osmo-gsm-tester[master]: default-suites: Add test cases with octphy BTS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4427 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8b5bda50c245ad693e7679ad44515b90a067fbb Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From admin at opensuse.org Thu Oct 26 17:03:52 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:03:52 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f21ed52e15_718e50ef74583689@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 153s] To: [ 153s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 153s] [ 153s] You may investigate any problem if you feel able to do so, in which [ 153s] case the test suite provides a good starting point. Its output may [ 153s] be found below `tests/testsuite.dir'. [ 153s] [ 153s] Makefile:1221: recipe for target 'check-local' failed [ 153s] make[3]: *** [check-local] Error 1 [ 153s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 153s] Makefile:1055: recipe for target 'check-am' failed [ 153s] make[2]: *** [check-am] Error 2 [ 153s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 153s] Makefile:460: recipe for target 'check-recursive' failed [ 153s] make[1]: *** [check-recursive] Error 1 [ 153s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 153s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 153s] debian/rules:12: recipe for target 'build' failed [ 153s] make: *** [build] Error 2 [ 153s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 153s] [ 153s] lamb01 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:03:48 UTC 2017. [ 153s] [ 153s] ### VM INTERACTION START ### [ 156s] [ 148.742487] reboot: Power down [ 156s] ### VM INTERACTION END ### [ 156s] [ 156s] lamb01 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:03:51 UTC 2017. [ 156s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 17:49:02 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:49:02 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f22083c8ebb_718e50ef745925fd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 147s] To: [ 147s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 147s] [ 147s] You may investigate any problem if you feel able to do so, in which [ 147s] case the test suite provides a good starting point. Its output may [ 147s] be found below `tests/testsuite.dir'. [ 147s] [ 147s] Makefile:1221: recipe for target 'check-local' failed [ 147s] make[3]: *** [check-local] Error 1 [ 147s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 147s] Makefile:1055: recipe for target 'check-am' failed [ 147s] make[2]: *** [check-am] Error 2 [ 147s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 147s] Makefile:460: recipe for target 'check-recursive' failed [ 147s] make[1]: *** [check-recursive] Error 1 [ 147s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 147s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 147s] debian/rules:12: recipe for target 'build' failed [ 147s] make: *** [build] Error 2 [ 147s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 147s] [ 147s] lamb12 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:48:56 UTC 2017. [ 147s] [ 147s] ### VM INTERACTION START ### [ 150s] [ 142.685017] reboot: Power down [ 150s] ### VM INTERACTION END ### [ 150s] [ 150s] lamb12 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:48:59 UTC 2017. [ 150s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 17:49:19 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:49:19 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f22086c980f_718e50ef74592665@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 139s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 139s] [ 139s] You may investigate any problem if you feel able to do so, in which [ 139s] case the test suite provides a good starting point. Its output may [ 139s] be found below `tests/testsuite.dir'. [ 139s] [ 139s] Makefile:1208: recipe for target 'check-local' failed [ 139s] make[3]: *** [check-local] Error 1 [ 139s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 139s] Makefile:1044: recipe for target 'check-am' failed [ 139s] make[2]: *** [check-am] Error 2 [ 139s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 139s] Makefile:448: recipe for target 'check-recursive' failed [ 139s] make[1]: *** [check-recursive] Error 1 [ 139s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 139s] dh_auto_test: make -j1 check returned exit code 2 [ 139s] debian/rules:12: recipe for target 'build' failed [ 139s] make: *** [build] Error 2 [ 139s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 139s] [ 139s] lamb15 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:49:13 UTC 2017. [ 139s] [ 139s] ### VM INTERACTION START ### [ 140s] Powering off. [ 140s] [ 132.809873] reboot: Power down [ 140s] ### VM INTERACTION END ### [ 140s] [ 140s] lamb15 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:49:14 UTC 2017. [ 140s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 17:51:53 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:51:53 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f220d2c7a18_718e50ef74594471@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 103s] [ 103s] To: [ 103s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 103s] [ 103s] You may investigate any problem if you feel able to do so, in which [ 103s] case the test suite provides a good starting point. Its output may [ 103s] be found below `tests/testsuite.dir'. [ 103s] [ 103s] Makefile:1221: recipe for target 'check-local' failed [ 103s] make[3]: *** [check-local] Error 1 [ 103s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 103s] Makefile:1055: recipe for target 'check-am' failed [ 103s] make[2]: *** [check-am] Error 2 [ 103s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 103s] Makefile:460: recipe for target 'check-recursive' failed [ 103s] make[1]: *** [check-recursive] Error 1 [ 103s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 103s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 103s] debian/rules:12: recipe for target 'build' failed [ 103s] make: *** [build] Error 2 [ 103s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 103s] [ 103s] build85 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:51:45 UTC 2017. [ 103s] [ 103s] ### VM INTERACTION START ### [ 106s] [ 100.893922] reboot: Power down [ 107s] ### VM INTERACTION END ### [ 107s] [ 107s] build85 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:51:50 UTC 2017. -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 17:52:10 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:52:10 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f220d53e8ae_718e50ef745947aa@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 95s] To: [ 95s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 95s] [ 95s] You may investigate any problem if you feel able to do so, in which [ 95s] case the test suite provides a good starting point. Its output may [ 95s] be found below `tests/testsuite.dir'. [ 95s] [ 95s] Makefile:1221: recipe for target 'check-local' failed [ 95s] make[3]: *** [check-local] Error 1 [ 95s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 95s] Makefile:1055: recipe for target 'check-am' failed [ 95s] make[2]: *** [check-am] Error 2 [ 95s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 95s] Makefile:460: recipe for target 'check-recursive' failed [ 95s] make[1]: *** [check-recursive] Error 1 [ 95s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 95s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 95s] debian/rules:12: recipe for target 'build' failed [ 95s] make: *** [build] Error 2 [ 95s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 95s] [ 95s] build79 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:51:50 UTC 2017. [ 95s] [ 95s] ### VM INTERACTION START ### [ 99s] [ 93.595060] reboot: Power down [ 99s] ### VM INTERACTION END ### [ 99s] [ 99s] build79 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:51:53 UTC 2017. [ 99s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 17:52:28 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:52:28 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f220dcd79e8_718e50ef74594850@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 150s] To: [ 150s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 150s] [ 150s] You may investigate any problem if you feel able to do so, in which [ 150s] case the test suite provides a good starting point. Its output may [ 150s] be found below `tests/testsuite.dir'. [ 150s] [ 150s] Makefile:1221: recipe for target 'check-local' failed [ 150s] make[3]: *** [check-local] Error 1 [ 150s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 150s] Makefile:1055: recipe for target 'check-am' failed [ 150s] make[2]: *** [check-am] Error 2 [ 150s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 150s] Makefile:460: recipe for target 'check-recursive' failed [ 150s] make[1]: *** [check-recursive] Error 1 [ 150s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 150s] dh_auto_test: make -j1 check returned exit code 2 [ 150s] debian/rules:12: recipe for target 'build' failed [ 150s] make: *** [build] Error 2 [ 150s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 150s] [ 150s] lamb59 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:52:12 UTC 2017. [ 150s] [ 150s] ### VM INTERACTION START ### [ 153s] [ 146.470540] reboot: Power down [ 153s] ### VM INTERACTION END ### [ 153s] [ 153s] lamb59 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:52:15 UTC 2017. [ 153s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 17:52:45 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:52:45 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f220fe278a0_718e50ef745949d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 126s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 126s] [ 126s] You may investigate any problem if you feel able to do so, in which [ 126s] case the test suite provides a good starting point. Its output may [ 126s] be found below `tests/testsuite.dir'. [ 126s] [ 126s] Makefile:1208: recipe for target 'check-local' failed [ 126s] make[3]: *** [check-local] Error 1 [ 126s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 126s] Makefile:1044: recipe for target 'check-am' failed [ 126s] make[2]: *** [check-am] Error 2 [ 126s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 126s] Makefile:448: recipe for target 'check-recursive' failed [ 126s] make[1]: *** [check-recursive] Error 1 [ 126s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 126s] dh_auto_test: make -j1 check returned exit code 2 [ 126s] debian/rules:12: recipe for target 'build' failed [ 126s] make: *** [build] Error 2 [ 126s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 126s] [ 126s] lamb12 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:52:31 UTC 2017. [ 126s] [ 126s] ### VM INTERACTION START ### [ 127s] Powering off. [ 127s] [ 120.207903] reboot: Power down [ 127s] ### VM INTERACTION END ### [ 127s] [ 127s] lamb12 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:52:32 UTC 2017. [ 127s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 17:53:02 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:53:02 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f22119ad6a4_718e50ef745950ac@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 167s] To: [ 167s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 167s] [ 167s] You may investigate any problem if you feel able to do so, in which [ 167s] case the test suite provides a good starting point. Its output may [ 167s] be found below `tests/testsuite.dir'. [ 167s] [ 167s] Makefile:1221: recipe for target 'check-local' failed [ 167s] make[3]: *** [check-local] Error 1 [ 167s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 167s] Makefile:1055: recipe for target 'check-am' failed [ 167s] make[2]: *** [check-am] Error 2 [ 167s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 167s] Makefile:460: recipe for target 'check-recursive' failed [ 167s] make[1]: *** [check-recursive] Error 1 [ 167s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 167s] dh_auto_test: make -j1 check returned exit code 2 [ 167s] debian/rules:12: recipe for target 'build' failed [ 167s] make: *** [build] Error 2 [ 167s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 167s] [ 167s] lamb26 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:52:44 UTC 2017. [ 167s] [ 167s] ### VM INTERACTION START ### [ 171s] [ 164.043366] reboot: Power down [ 171s] ### VM INTERACTION END ### [ 171s] [ 171s] lamb26 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:52:48 UTC 2017. [ 171s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 17:53:19 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:53:19 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f2211b37190_718e50ef74595132@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 149s] To: [ 149s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 149s] [ 149s] You may investigate any problem if you feel able to do so, in which [ 149s] case the test suite provides a good starting point. Its output may [ 149s] be found below `tests/testsuite.dir'. [ 149s] [ 149s] Makefile:1221: recipe for target 'check-local' failed [ 149s] make[3]: *** [check-local] Error 1 [ 149s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 149s] Makefile:1055: recipe for target 'check-am' failed [ 149s] make[2]: *** [check-am] Error 2 [ 149s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 149s] Makefile:460: recipe for target 'check-recursive' failed [ 149s] make[1]: *** [check-recursive] Error 1 [ 149s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 149s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 149s] debian/rules:12: recipe for target 'build' failed [ 149s] make: *** [build] Error 2 [ 149s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 149s] [ 149s] lamb59 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:52:59 UTC 2017. [ 149s] [ 149s] ### VM INTERACTION START ### [ 152s] [ 144.892517] reboot: Power down [ 152s] ### VM INTERACTION END ### [ 152s] [ 152s] lamb59 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:53:03 UTC 2017. [ 152s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 17:53:19 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:53:19 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f2211c77f03_718e50ef74595363@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 152s] To: [ 152s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 152s] [ 152s] You may investigate any problem if you feel able to do so, in which [ 152s] case the test suite provides a good starting point. Its output may [ 152s] be found below `tests/testsuite.dir'. [ 152s] [ 152s] Makefile:1221: recipe for target 'check-local' failed [ 152s] make[3]: *** [check-local] Error 1 [ 152s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 152s] Makefile:1055: recipe for target 'check-am' failed [ 152s] make[2]: *** [check-am] Error 2 [ 152s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 152s] Makefile:460: recipe for target 'check-recursive' failed [ 152s] make[1]: *** [check-recursive] Error 1 [ 152s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 152s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 152s] debian/rules:12: recipe for target 'build' failed [ 152s] make: *** [build] Error 2 [ 152s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 152s] [ 152s] lamb59 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:53:04 UTC 2017. [ 152s] [ 152s] ### VM INTERACTION START ### [ 155s] [ 148.420754] reboot: Power down [ 155s] ### VM INTERACTION END ### [ 155s] [ 155s] lamb59 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:53:07 UTC 2017. [ 155s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 17:53:36 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:53:36 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f221369da0d_718e50ef745954bd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 178s] To: [ 178s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 178s] [ 178s] You may investigate any problem if you feel able to do so, in which [ 178s] case the test suite provides a good starting point. Its output may [ 178s] be found below `tests/testsuite.dir'. [ 178s] [ 178s] Makefile:1221: recipe for target 'check-local' failed [ 178s] make[3]: *** [check-local] Error 1 [ 178s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 178s] Makefile:1055: recipe for target 'check-am' failed [ 178s] make[2]: *** [check-am] Error 2 [ 178s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 178s] Makefile:460: recipe for target 'check-recursive' failed [ 178s] make[1]: *** [check-recursive] Error 1 [ 178s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 178s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 178s] debian/rules:12: recipe for target 'build' failed [ 178s] make: *** [build] Error 2 [ 178s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 178s] [ 178s] build34 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:53:24 UTC 2017. [ 178s] [ 178s] ### VM INTERACTION START ### [ 181s] [ 172.971915] reboot: Power down [ 182s] ### VM INTERACTION END ### [ 182s] [ 182s] build34 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:53:28 UTC 2017. [ 182s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 17:54:45 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 17:54:45 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f22171df6ae_718e50ef74595537@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 226s] [ 226s] Please send `tests/testsuite.log' and all information you think might help: [ 226s] [ 226s] To: [ 226s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 226s] [ 226s] You may investigate any problem if you feel able to do so, in which [ 226s] case the test suite provides a good starting point. Its output may [ 226s] be found below `tests/testsuite.dir'. [ 226s] [ 226s] Makefile:1221: recipe for target 'check-local' failed [ 226s] make[3]: *** [check-local] Error 1 [ 226s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 226s] Makefile:1055: recipe for target 'check-am' failed [ 226s] make[2]: *** [check-am] Error 2 [ 226s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 226s] Makefile:460: recipe for target 'check-recursive' failed [ 226s] make[1]: *** [check-recursive] Error 1 [ 226s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 226s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 226s] debian/rules:12: recipe for target 'build' failed [ 226s] make: *** [build] Error 2 [ 226s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 226s] [ 226s] cloud113 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 17:54:23 UTC 2017. [ 226s] [ 226s] ### VM INTERACTION START ### [ 229s] [ 212.161909] reboot: Power down [ 230s] ### VM INTERACTION END ### -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Thu Oct 26 18:53:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 18:53:15 +0000 Subject: [PATCH] osmo-ci[master]: osmocom:nightly OBS: add osmo-bsc package / remove nitb-split Message-ID: Review at https://gerrit.osmocom.org/4434 osmocom:nightly OBS: add osmo-bsc package / remove nitb-split This was the last package that we only built in osmocom:nitb-split:nightly, so we can remove the latter, too Change-Id: Ib99e0775e9db30ec3c5263bb3a364d8cab4633c3 --- D scripts/osmocom-nightly-nitb-split.sh M scripts/osmocom-nightly-packages.sh 2 files changed, 2 insertions(+), 119 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/34/4434/1 diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh deleted file mode 100755 index 3b547bf..0000000 --- a/scripts/osmocom-nightly-nitb-split.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash - -set -e -set -x - -DT=$(date +%Y%m%d) -PROJ=network:osmocom:nitb-split:nightly - -### common -checkout() { - local name=$1 - local branch=$2 - local url="git://git.osmocom.org" - - cd "$REPO" - - if [ -n "$branch" ] ; then - git clone "$url/$name" -b "$branch" - else - git clone "$url/$name" - fi - - cd - -} - -### OBS build -prepare() { - # clean up the whole space - mkdir -p "$REPO/osc/" - cd "$REPO/osc" - osc co "$PROJ" -} - -build() { - local name=$1 - local repodir=$REPO/$name - local oscdir=$REPO/osc/$PROJ/$name - - if [ -d "$oscdir" ] ; then - # remove earlier version - cd "$oscdir" - osc rm -- * || true - else - # new package - mkdir -p "$oscdir/" - cd "$REPO/osc/$PROJ/" - osc add "$name" - fi - - cd "$repodir" - - VER=$(head -1 debian/changelog | cut -d ' ' -f 2 | sed 's,(,,' | sed 's,),,') - dch -v "$VER.$DT" -m "Snapshot build" - git commit -m "$DT snapshot" debian/ - - mkdir -p "$DATA/$name" - # source code build without dependency checks and unsigned source and unsigned change log - gbp buildpackage -S -uc -us -d --git-ignore-branch "--git-export-dir=$DATA/$name" - - mv "$DATA/$name/"*.tar* "$DATA/$name/"*.dsc "$oscdir/" - - cd "$oscdir" - osc add -- *.tar* *.dsc - osc ci -m "Snapshot $name $DT" -} - -post() { - cd "$REPO/osc/$PROJ/" - osc status -} - -build_osmocom() { - BASE=$PWD - DATA=$BASE/data - REPO=$BASE/repo - - # rather than including a dangerous 'rm -rf *' here, lets delegate to the user: - if [ -n "$(ls)" ]; then - echo "ERROR: I need to run in an empty directory." - exit 1 - fi - - prepare - - checkout libosmocore - checkout libosmo-abis - checkout libosmo-netif - checkout libosmo-sccp - checkout libsmpp34 - checkout libasn1c - checkout osmo-iuh - checkout osmo-hlr - checkout osmo-ggsn - checkout osmo-mgw - checkout osmo-bsc - checkout osmo-msc - checkout osmo-sgsn - - build libosmocore - build libosmo-abis - build libosmo-netif - build libosmo-sccp - build libsmpp34 - build libasn1c - build osmo-iuh - build osmo-hlr - build osmo-ggsn - build osmo-mgw - build osmo-bsc - build osmo-msc - build osmo-sgsn - - post -} - -TMPDIR=$(mktemp -d nightly-3g_XXXXXX) -cd "$TMPDIR" -build_osmocom -rm -rf "./$TMPDIR/" diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 12aa587..6206576 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -26,6 +26,7 @@ git clone git://git.osmocom.org/osmo-hlr git clone git://git.osmocom.org/osmo-mgw git clone git://git.osmocom.org/osmo-msc +git clone git://git.osmocom.org/osmo-bsc PROJ=network:osmocom:nightly @@ -67,6 +68,7 @@ build osmo-hlr build osmo-mgw build osmo-msc +build osmo-bsc cd $PROJ osc ci -m "Snapshot $DT" -- To view, visit https://gerrit.osmocom.org/4434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib99e0775e9db30ec3c5263bb3a364d8cab4633c3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Oct 26 19:21:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 19:21:36 +0000 Subject: osmo-ci[master]: osmocom:nightly OBS: add osmo-bsc package / remove nitb-split In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib99e0775e9db30ec3c5263bb3a364d8cab4633c3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 19:21:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 19:21:37 +0000 Subject: [MERGED] osmo-ci[master]: osmocom:nightly OBS: add osmo-bsc package / remove nitb-split In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmocom:nightly OBS: add osmo-bsc package / remove nitb-split ...................................................................... osmocom:nightly OBS: add osmo-bsc package / remove nitb-split This was the last package that we only built in osmocom:nitb-split:nightly, so we can remove the latter, too Change-Id: Ib99e0775e9db30ec3c5263bb3a364d8cab4633c3 --- D scripts/osmocom-nightly-nitb-split.sh M scripts/osmocom-nightly-packages.sh 2 files changed, 2 insertions(+), 119 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh deleted file mode 100755 index 3b547bf..0000000 --- a/scripts/osmocom-nightly-nitb-split.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash - -set -e -set -x - -DT=$(date +%Y%m%d) -PROJ=network:osmocom:nitb-split:nightly - -### common -checkout() { - local name=$1 - local branch=$2 - local url="git://git.osmocom.org" - - cd "$REPO" - - if [ -n "$branch" ] ; then - git clone "$url/$name" -b "$branch" - else - git clone "$url/$name" - fi - - cd - -} - -### OBS build -prepare() { - # clean up the whole space - mkdir -p "$REPO/osc/" - cd "$REPO/osc" - osc co "$PROJ" -} - -build() { - local name=$1 - local repodir=$REPO/$name - local oscdir=$REPO/osc/$PROJ/$name - - if [ -d "$oscdir" ] ; then - # remove earlier version - cd "$oscdir" - osc rm -- * || true - else - # new package - mkdir -p "$oscdir/" - cd "$REPO/osc/$PROJ/" - osc add "$name" - fi - - cd "$repodir" - - VER=$(head -1 debian/changelog | cut -d ' ' -f 2 | sed 's,(,,' | sed 's,),,') - dch -v "$VER.$DT" -m "Snapshot build" - git commit -m "$DT snapshot" debian/ - - mkdir -p "$DATA/$name" - # source code build without dependency checks and unsigned source and unsigned change log - gbp buildpackage -S -uc -us -d --git-ignore-branch "--git-export-dir=$DATA/$name" - - mv "$DATA/$name/"*.tar* "$DATA/$name/"*.dsc "$oscdir/" - - cd "$oscdir" - osc add -- *.tar* *.dsc - osc ci -m "Snapshot $name $DT" -} - -post() { - cd "$REPO/osc/$PROJ/" - osc status -} - -build_osmocom() { - BASE=$PWD - DATA=$BASE/data - REPO=$BASE/repo - - # rather than including a dangerous 'rm -rf *' here, lets delegate to the user: - if [ -n "$(ls)" ]; then - echo "ERROR: I need to run in an empty directory." - exit 1 - fi - - prepare - - checkout libosmocore - checkout libosmo-abis - checkout libosmo-netif - checkout libosmo-sccp - checkout libsmpp34 - checkout libasn1c - checkout osmo-iuh - checkout osmo-hlr - checkout osmo-ggsn - checkout osmo-mgw - checkout osmo-bsc - checkout osmo-msc - checkout osmo-sgsn - - build libosmocore - build libosmo-abis - build libosmo-netif - build libosmo-sccp - build libsmpp34 - build libasn1c - build osmo-iuh - build osmo-hlr - build osmo-ggsn - build osmo-mgw - build osmo-bsc - build osmo-msc - build osmo-sgsn - - post -} - -TMPDIR=$(mktemp -d nightly-3g_XXXXXX) -cd "$TMPDIR" -build_osmocom -rm -rf "./$TMPDIR/" diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 12aa587..6206576 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -26,6 +26,7 @@ git clone git://git.osmocom.org/osmo-hlr git clone git://git.osmocom.org/osmo-mgw git clone git://git.osmocom.org/osmo-msc +git clone git://git.osmocom.org/osmo-bsc PROJ=network:osmocom:nightly @@ -67,6 +68,7 @@ build osmo-hlr build osmo-mgw build osmo-msc +build osmo-bsc cd $PROJ osc ci -m "Snapshot $DT" -- To view, visit https://gerrit.osmocom.org/4434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib99e0775e9db30ec3c5263bb3a364d8cab4633c3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From admin at opensuse.org Thu Oct 26 19:58:00 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 19:58:00 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f23e6425d9b_718e50ef74635773@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 173s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 173s] [ 173s] You may investigate any problem if you feel able to do so, in which [ 173s] case the test suite provides a good starting point. Its output may [ 173s] be found below `tests/testsuite.dir'. [ 173s] [ 173s] Makefile:1208: recipe for target 'check-local' failed [ 173s] make[3]: *** [check-local] Error 1 [ 173s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 173s] Makefile:1044: recipe for target 'check-am' failed [ 173s] make[2]: *** [check-am] Error 2 [ 173s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 173s] Makefile:448: recipe for target 'check-recursive' failed [ 173s] make[1]: *** [check-recursive] Error 1 [ 173s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 173s] dh_auto_test: make -j1 check returned exit code 2 [ 173s] debian/rules:12: recipe for target 'build' failed [ 173s] make: *** [build] Error 2 [ 173s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 173s] [ 173s] build34 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 19:57:46 UTC 2017. [ 173s] [ 173s] ### VM INTERACTION START ### [ 175s] Powering off. [ 175s] [ 166.667317] reboot: Power down [ 175s] ### VM INTERACTION END ### [ 175s] [ 175s] build34 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 19:57:48 UTC 2017. [ 175s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 19:59:09 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 19:59:09 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f23eb099451_718e50ef74635992@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 201s] To: [ 201s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 201s] [ 201s] You may investigate any problem if you feel able to do so, in which [ 201s] case the test suite provides a good starting point. Its output may [ 201s] be found below `tests/testsuite.dir'. [ 201s] [ 201s] Makefile:1221: recipe for target 'check-local' failed [ 201s] make[3]: *** [check-local] Error 1 [ 201s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 201s] Makefile:1055: recipe for target 'check-am' failed [ 201s] make[2]: *** [check-am] Error 2 [ 201s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 201s] Makefile:460: recipe for target 'check-recursive' failed [ 201s] make[1]: *** [check-recursive] Error 1 [ 201s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 201s] dh_auto_test: make -j1 check returned exit code 2 [ 201s] debian/rules:12: recipe for target 'build' failed [ 201s] make: *** [build] Error 2 [ 201s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 201s] [ 201s] lamb22 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 19:58:55 UTC 2017. [ 201s] [ 201s] ### VM INTERACTION START ### [ 204s] [ 196.002906] reboot: Power down [ 204s] ### VM INTERACTION END ### [ 204s] [ 204s] lamb22 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 19:58:59 UTC 2017. [ 204s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 19:59:09 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 19:59:09 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f23eb127102_718e50ef746360f7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 153s] To: [ 153s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 153s] [ 153s] You may investigate any problem if you feel able to do so, in which [ 153s] case the test suite provides a good starting point. Its output may [ 153s] be found below `tests/testsuite.dir'. [ 153s] [ 153s] Makefile:1221: recipe for target 'check-local' failed [ 153s] make[3]: *** [check-local] Error 1 [ 153s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 153s] Makefile:1055: recipe for target 'check-am' failed [ 153s] make[2]: *** [check-am] Error 2 [ 153s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 153s] Makefile:460: recipe for target 'check-recursive' failed [ 153s] make[1]: *** [check-recursive] Error 1 [ 153s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 153s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 153s] debian/rules:12: recipe for target 'build' failed [ 153s] make: *** [build] Error 2 [ 153s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 153s] [ 153s] build84 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 19:59:01 UTC 2017. [ 153s] [ 153s] ### VM INTERACTION START ### [ 156s] [ 148.837696] reboot: Power down [ 156s] ### VM INTERACTION END ### [ 156s] [ 156s] build84 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 19:59:05 UTC 2017. [ 156s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 20:00:00 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 20:00:00 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f23ed858024_718e50ef74636254@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 166s] To: [ 166s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 166s] [ 166s] You may investigate any problem if you feel able to do so, in which [ 166s] case the test suite provides a good starting point. Its output may [ 166s] be found below `tests/testsuite.dir'. [ 166s] [ 166s] Makefile:1221: recipe for target 'check-local' failed [ 166s] make[3]: *** [check-local] Error 1 [ 166s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 166s] Makefile:1055: recipe for target 'check-am' failed [ 166s] make[2]: *** [check-am] Error 2 [ 166s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 166s] Makefile:460: recipe for target 'check-recursive' failed [ 166s] make[1]: *** [check-recursive] Error 1 [ 166s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 166s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 166s] debian/rules:12: recipe for target 'build' failed [ 166s] make: *** [build] Error 2 [ 166s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 166s] [ 166s] lamb55 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 19:59:40 UTC 2017. [ 166s] [ 166s] ### VM INTERACTION START ### [ 169s] [ 162.383931] reboot: Power down [ 169s] ### VM INTERACTION END ### [ 169s] [ 169s] lamb55 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 19:59:44 UTC 2017. [ 169s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 20:00:34 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 20:00:34 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f23ef781107_718e50ef7463637f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 224s] To: [ 224s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 224s] [ 224s] You may investigate any problem if you feel able to do so, in which [ 224s] case the test suite provides a good starting point. Its output may [ 224s] be found below `tests/testsuite.dir'. [ 224s] [ 224s] Makefile:1221: recipe for target 'check-local' failed [ 224s] make[3]: *** [check-local] Error 1 [ 224s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 224s] Makefile:1055: recipe for target 'check-am' failed [ 224s] make[2]: *** [check-am] Error 2 [ 224s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 224s] Makefile:460: recipe for target 'check-recursive' failed [ 224s] make[1]: *** [check-recursive] Error 1 [ 224s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 224s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 224s] debian/rules:12: recipe for target 'build' failed [ 224s] make: *** [build] Error 2 [ 224s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 224s] [ 224s] lamb51 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:00:13 UTC 2017. [ 224s] [ 224s] ### VM INTERACTION START ### [ 227s] [ 219.590456] reboot: Power down [ 227s] ### VM INTERACTION END ### [ 227s] [ 227s] lamb51 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:00:17 UTC 2017. [ 227s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 20:08:17 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 20:08:17 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f240c1ac30d_718e50ef746381f6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 133s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 133s] [ 133s] You may investigate any problem if you feel able to do so, in which [ 133s] case the test suite provides a good starting point. Its output may [ 133s] be found below `tests/testsuite.dir'. [ 133s] [ 133s] Makefile:1208: recipe for target 'check-local' failed [ 133s] make[3]: *** [check-local] Error 1 [ 133s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 133s] Makefile:1044: recipe for target 'check-am' failed [ 133s] make[2]: *** [check-am] Error 2 [ 133s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 133s] Makefile:448: recipe for target 'check-recursive' failed [ 133s] make[1]: *** [check-recursive] Error 1 [ 133s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 133s] dh_auto_test: make -j1 check returned exit code 2 [ 133s] debian/rules:12: recipe for target 'build' failed [ 133s] make: *** [build] Error 2 [ 133s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 133s] [ 133s] lamb54 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:08:05 UTC 2017. [ 133s] [ 133s] ### VM INTERACTION START ### [ 135s] Powering off. [ 135s] [ 127.320222] reboot: Power down [ 135s] ### VM INTERACTION END ### [ 135s] [ 135s] lamb54 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:08:07 UTC 2017. [ 135s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 20:08:34 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 20:08:34 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f240de903f8_718e50ef7463841b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 154s] To: [ 154s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 154s] [ 154s] You may investigate any problem if you feel able to do so, in which [ 154s] case the test suite provides a good starting point. Its output may [ 154s] be found below `tests/testsuite.dir'. [ 154s] [ 154s] Makefile:1221: recipe for target 'check-local' failed [ 154s] make[3]: *** [check-local] Error 1 [ 154s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 154s] Makefile:1055: recipe for target 'check-am' failed [ 154s] make[2]: *** [check-am] Error 2 [ 154s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 154s] Makefile:460: recipe for target 'check-recursive' failed [ 154s] make[1]: *** [check-recursive] Error 1 [ 154s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 154s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 154s] debian/rules:12: recipe for target 'build' failed [ 154s] make: *** [build] Error 2 [ 154s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 154s] [ 154s] lamb07 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:08:23 UTC 2017. [ 154s] [ 154s] ### VM INTERACTION START ### [ 157s] [ 149.758655] reboot: Power down [ 157s] ### VM INTERACTION END ### [ 157s] [ 157s] lamb07 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:08:26 UTC 2017. [ 157s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 20:08:52 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 20:08:52 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f240e08284e_718e50ef746385e8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 146s] To: [ 146s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 146s] [ 146s] You may investigate any problem if you feel able to do so, in which [ 146s] case the test suite provides a good starting point. Its output may [ 146s] be found below `tests/testsuite.dir'. [ 146s] [ 146s] Makefile:1221: recipe for target 'check-local' failed [ 146s] make[3]: *** [check-local] Error 1 [ 146s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 146s] Makefile:1055: recipe for target 'check-am' failed [ 146s] make[2]: *** [check-am] Error 2 [ 146s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 146s] Makefile:460: recipe for target 'check-recursive' failed [ 146s] make[1]: *** [check-recursive] Error 1 [ 146s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 146s] dh_auto_test: make -j1 check returned exit code 2 [ 146s] debian/rules:12: recipe for target 'build' failed [ 146s] make: *** [build] Error 2 [ 146s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 146s] [ 146s] lamb70 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:08:45 UTC 2017. [ 146s] [ 146s] ### VM INTERACTION START ### [ 150s] [ 142.875486] reboot: Power down [ 150s] ### VM INTERACTION END ### [ 150s] [ 150s] lamb70 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:08:49 UTC 2017. [ 150s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 20:08:52 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 20:08:52 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f240e133e46_718e50ef746386b1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 148s] To: [ 148s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 148s] [ 148s] You may investigate any problem if you feel able to do so, in which [ 148s] case the test suite provides a good starting point. Its output may [ 148s] be found below `tests/testsuite.dir'. [ 148s] [ 148s] Makefile:1221: recipe for target 'check-local' failed [ 148s] make[3]: *** [check-local] Error 1 [ 148s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 148s] Makefile:1055: recipe for target 'check-am' failed [ 148s] make[2]: *** [check-am] Error 2 [ 148s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 148s] Makefile:460: recipe for target 'check-recursive' failed [ 148s] make[1]: *** [check-recursive] Error 1 [ 148s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 148s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 148s] debian/rules:12: recipe for target 'build' failed [ 148s] make: *** [build] Error 2 [ 148s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 148s] [ 148s] lamb54 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:08:34 UTC 2017. [ 148s] [ 148s] ### VM INTERACTION START ### [ 152s] [ 144.734962] reboot: Power down [ 152s] ### VM INTERACTION END ### [ 152s] [ 152s] lamb54 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:08:38 UTC 2017. [ 152s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 20:09:09 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 20:09:09 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f240f68967b_718e50ef746387f3@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 149s] To: [ 149s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 149s] [ 149s] You may investigate any problem if you feel able to do so, in which [ 149s] case the test suite provides a good starting point. Its output may [ 149s] be found below `tests/testsuite.dir'. [ 149s] [ 149s] Makefile:1221: recipe for target 'check-local' failed [ 149s] make[3]: *** [check-local] Error 1 [ 149s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 149s] Makefile:1055: recipe for target 'check-am' failed [ 149s] make[2]: *** [check-am] Error 2 [ 149s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 149s] Makefile:460: recipe for target 'check-recursive' failed [ 149s] make[1]: *** [check-recursive] Error 1 [ 149s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 149s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 149s] debian/rules:12: recipe for target 'build' failed [ 149s] make: *** [build] Error 2 [ 149s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 149s] [ 149s] lamb19 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:08:48 UTC 2017. [ 149s] [ 149s] ### VM INTERACTION START ### [ 152s] [ 145.284148] reboot: Power down [ 152s] ### VM INTERACTION END ### [ 152s] [ 152s] lamb19 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:08:52 UTC 2017. [ 152s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Oct 26 20:10:00 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Oct 2017 20:10:00 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f24130d21bf_718e50ef746388aa@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 220s] To: [ 220s] Subject: [osmo-pcu 0.3.0.20171026] testsuite: 2 3 5 6 7 8 11 failed [ 220s] [ 220s] You may investigate any problem if you feel able to do so, in which [ 220s] case the test suite provides a good starting point. Its output may [ 220s] be found below `tests/testsuite.dir'. [ 220s] [ 220s] Makefile:1221: recipe for target 'check-local' failed [ 220s] make[3]: *** [check-local] Error 1 [ 220s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 220s] Makefile:1055: recipe for target 'check-am' failed [ 220s] make[2]: *** [check-am] Error 2 [ 220s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 220s] Makefile:460: recipe for target 'check-recursive' failed [ 220s] make[1]: *** [check-recursive] Error 1 [ 220s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 220s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 220s] debian/rules:12: recipe for target 'build' failed [ 220s] make: *** [build] Error 2 [ 220s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 220s] [ 220s] lamb25 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:09:49 UTC 2017. [ 220s] [ 220s] ### VM INTERACTION START ### [ 223s] [ 214.851964] reboot: Power down [ 223s] ### VM INTERACTION END ### [ 223s] [ 223s] lamb25 failed "build osmo-pcu_0.3.0.20171026.dsc" at Thu Oct 26 20:09:52 UTC 2017. [ 223s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Thu Oct 26 22:12:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 26 Oct 2017 22:12:31 +0000 Subject: [PATCH] meta-telephony[laforge/nightly]: openbsc.git: Upstream binary now named osmo-bsc-sccplite Message-ID: Review at https://gerrit.osmocom.org/4435 openbsc.git: Upstream binary now named osmo-bsc-sccplite In Change-Id If10d1599b62d010726336134091a4e855c380d93, upstream osmocom.git has renamed osmo-bsc (and related config files, etc) to osmo-bsc-sccplite, so we don't have to rename it in the recipe anymore. Change-Id: I7e3bf1d6186fb32f4d671cbf84cad195d2776190 --- M recipes-osmocom/openbsc/openbsc.inc 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/35/4435/1 diff --git a/recipes-osmocom/openbsc/openbsc.inc b/recipes-osmocom/openbsc/openbsc.inc index e04911d..3c1b98f 100644 --- a/recipes-osmocom/openbsc/openbsc.inc +++ b/recipes-osmocom/openbsc/openbsc.inc @@ -11,7 +11,7 @@ file://osmo-bsc-sccplite.service \ " -INC_PR = "r23.${META_TELEPHONY_OSMO_INC}" +INC_PR = "r24.${META_TELEPHONY_OSMO_INC}" EXTRA_OECONF += "--enable-osmo-bsc --enable-mgcp-transcoding --with-g729" @@ -26,7 +26,7 @@ do_install_append() { install -d ${D}${sysconfdir}/osmocom install -m 0660 ${S}/doc/examples/osmo-nitb/nanobts/openbsc.cfg ${D}${sysconfdir}/osmocom/osmo-nitb.cfg - install -m 0660 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg + install -m 0660 ${S}/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg # Install sysv-init files install -d ${D}${sysconfdir}/init.d @@ -41,7 +41,6 @@ install -d ${D}/var/lib/osmocom - mv ${D}${bindir}/osmo-bsc ${D}${bindir}/osmo-bsc-sccplite } PACKAGES =+ "osmo-bsc-sccplite osmo-nitb" -- To view, visit https://gerrit.osmocom.org/4435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e3bf1d6186fb32f4d671cbf84cad195d2776190 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Oct 26 23:35:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Oct 2017 23:35:37 +0000 Subject: osmo-hlr[master]: vty: fix output of empty IMSI In-Reply-To: References: Message-ID: Patch Set 2: for char[]s, I'm accustomed to 'if (*str)' and find it quite clear, personally ... more accurate would be 'if (*str != '\0')', but there's no practical difference that I know of... -- To view, visit https://gerrit.osmocom.org/4388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72e13efefbac0495b8dd1949a39fa44ebfd46b56 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 23:45:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Oct 2017 23:45:31 +0000 Subject: libosmocore[master]: vty: Fix bad use of vector_slot() In-Reply-To: References: Message-ID: Patch Set 2: IUUC it doesn't only fix the warning, but was also an actual error. vector_slot(V,I) should amount to a void*, right? In the surrounding code, it is used as char*, and the vline vector, IIUC, is a list of string tokens, each terminated by '\0'. So this should actually be a functional change, checking whether the current token is just "\0", in contrast to before, where it checked, in effect, whether the token is NULL. Can we pinpoint a functional change from this patch / could there be fallout? -- To view, visit https://gerrit.osmocom.org/4389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaba9e3450d68c51e16a7bda2fc0fc370992ca866 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Oct 26 23:48:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Oct 2017 23:48:14 +0000 Subject: libosmocore[master]: [doc] Fix Doxygen 'param' direction: "in, out" rather than "i... In-Reply-To: References: Message-ID: Patch Set 1: there seems to be no functional difference between [inout] and [in,out], so this is a rather questionable cosmetic... -- To view, visit https://gerrit.osmocom.org/4390 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic2de1341b37453f339f0eefde3f14e14640fe3bb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 00:05:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 00:05:33 +0000 Subject: libosmocore[master]: utils: avoid segfault when calling osmo_strlcpy(src=NULL) In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) > Even in that case I still think that we have to update tests as > well. scrap the "even in that case", otherwise I agree, could add some NULL tests. https://gerrit.osmocom.org/#/c/4407/1/src/utils.c File src/utils.c: Line 375: size_t ret = src ? strlen(src) : 0; > I guess it's a good idea to still zero-terminate 'dst' even if 'src' is NUL yes, NULL is semantically like "", and zero-termination is promised by the API, and it also is what we want. -- To view, visit https://gerrit.osmocom.org/4407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieba7ba262ace2e370a4b9a550b3131fb13f07413 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 27 00:07:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 00:07:01 +0000 Subject: libosmocore[master]: utils: avoid segfault when calling osmo_strlcpy(src=NULL) In-Reply-To: References: Message-ID: Patch Set 1: > (1 comment) > > > Even in that case I still think that we have to update tests as > > well. > > scrap the "even in that case", otherwise I agree, could add some > NULL tests. well, whaddaya know, there seems to be no osmo_strlcpy test around anywhere. I'll leave it to a separate patch then, am not too eager right now. -- To view, visit https://gerrit.osmocom.org/4407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieba7ba262ace2e370a4b9a550b3131fb13f07413 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 00:07:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 00:07:30 +0000 Subject: [MERGED] libosmocore[master]: utils: avoid segfault when calling osmo_strlcpy(src=NULL) In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: utils: avoid segfault when calling osmo_strlcpy(src=NULL) ...................................................................... utils: avoid segfault when calling osmo_strlcpy(src=NULL) Change-Id: Ieba7ba262ace2e370a4b9a550b3131fb13f07413 --- M src/utils.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Objections: Max: I would prefer this is not merged as is diff --git a/src/utils.c b/src/utils.c index ef8e916..f5894d8 100644 --- a/src/utils.c +++ b/src/utils.c @@ -372,7 +372,7 @@ */ size_t osmo_strlcpy(char *dst, const char *src, size_t siz) { - size_t ret = strlen(src); + size_t ret = src ? strlen(src) : 0; if (siz) { size_t len = (ret >= siz) ? siz - 1 : ret; -- To view, visit https://gerrit.osmocom.org/4407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieba7ba262ace2e370a4b9a550b3131fb13f07413 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 00:07:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 00:07:57 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoHLR: add make target to update the example ctrl and vty ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OsmoHLR: add make target to update the example ctrl and vty files ...................................................................... OsmoHLR: add make target to update the example ctrl and vty files Change-Id: I88027396ec15101697a79aa5e964387d47abdae2 --- M OsmoHLR/Makefile 1 file changed, 41 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile index a9dc393..234a48c 100644 --- a/OsmoHLR/Makefile +++ b/OsmoHLR/Makefile @@ -8,3 +8,44 @@ include $(TOPDIR)/build/Makefile.vty-reference.inc include $(TOPDIR)/build/Makefile.common.inc + +OSMO_HLR_PATH ?= ../../osmo-hlr +TMP_DB = generated/hlr.db + +update-examples: update-examples-ctrl update-examples-vty + +.PHONY: found-update-deps +found-update-deps: + @if [ ! -f "$(OSMO_HLR_PATH)/sql/hlr.sql" ]; then \ + echo "You need to define OSMO_HLR_PATH to point at an osmo-hlr.git"; \ + exit 1; \ + fi + @if [ -z "$(shell which osmo-hlr)" ]; then \ + echo "osmo-hlr needs to be installed / available in the PATH"; \ + exit 1; \ + fi + @if [ -z "$(shell which osmo_verify_transcript_ctrl.py)" ]; then \ + echo "You need to install git.osmocom.org/python/osmo-python-tests.git"; \ + exit 1; \ + fi + @if [ -z "$(shell which osmo_verify_transcript_vty.py)" ]; then \ + echo "You need to install git.osmocom.org/python/osmo-python-tests.git"; \ + exit 1; \ + fi + +update-examples-ctrl: found-update-deps + mkdir -p generated + rm -f "$(TMP_DB)" + sqlite3 "$(TMP_DB)" < "$(OSMO_HLR_PATH)/sql/hlr.sql" + sqlite3 "$(TMP_DB)" < "$(OSMO_HLR_PATH)/tests/test_subscriber.sql" + osmo_verify_transcript_ctrl.py \ + -r "osmo-hlr -l $(TMP_DB) -c /n/s/osmo/src/osmo-hlr/doc/examples/osmo-hlr.cfg" \ + -p 4259 --update *.ctrl + +update-examples-vty: found-update-deps + mkdir -p generated + rm -f "$(TMP_DB)" + sqlite3 "$(TMP_DB)" < "$(OSMO_HLR_PATH)/sql/hlr.sql" + osmo_verify_transcript_vty.py \ + -r "osmo-hlr -l $(TMP_DB) -c /n/s/osmo/src/osmo-hlr/doc/examples/osmo-hlr.cfg" \ + -p 4258 --update *.vty -- To view, visit https://gerrit.osmocom.org/4392 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I88027396ec15101697a79aa5e964387d47abdae2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 00:07:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 00:07:57 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoHLR: update ctrl description and examples In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OsmoHLR: update ctrl description and examples ...................................................................... OsmoHLR: update ctrl description and examples The patch to refactor ctrl commands to osmo-hlr, change I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50, was tweaked. Adjust accordingly. Change-Id: Ie4da6115bb2eb005a9f95bf4de1bfe36468fd607 --- M OsmoHLR/chapters/control.adoc M OsmoHLR/example_subscriber_cs_ps_enabled.ctrl M OsmoHLR/example_subscriber_info.ctrl 3 files changed, 50 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoHLR/chapters/control.adoc b/OsmoHLR/chapters/control.adoc index 89c9c08..50fd314 100644 --- a/OsmoHLR/chapters/control.adoc +++ b/OsmoHLR/chapters/control.adoc @@ -39,8 +39,8 @@ namevalue ---- -To keep the reply as short as possible, most values are omitted if they are -empty or reflect the default. These are the returned values and their presence +To keep the reply as short as possible, some values are omitted if they are +empty. These are the returned values and their presence modalities; for their meaning, see <>: .Returned values by OsmoHLR's 'info', 'info-all' and 'info-aud' commands @@ -50,11 +50,16 @@ |'info'|id|-9223372036854775808 .. 9223372036854775807 (usually not negative)|always |'info'|imsi|6 to 15 decimal digits|always |'info'|msisdn|1 to 15 decimal digits|when non-empty -|'info'|nam_cs|'1' or '0'|when '0' -|'info'|nam_ps|'1' or '0'|when '0' +|'info'|nam_cs|'1' if CS is enabled, or '0'|always +|'info'|nam_ps|'1' if PS is enabled, or '0'|always |'info'|vlr_number|up to 15 decimal digits|when non-empty |'info'|sgsn_number|up to 15 decimal digits|when non-empty |'info'|sgsn_address||when non-empty +|'info'|ms_purged_cs|'1' if CS is purged, or '0'|always +|'info'|ms_purged_ps|'1' if PS is purged, or '0'|always +|'info'|periodic_lu_timer|0..4294967295|always +|'info'|periodic_rau_tau_timer|0..4294967295|always +|'info'|lmsi|8 hex digits|always |'info-aud'|aud2g.algo|one of 'comp128v1', 'comp128v2', 'comp128v3' or 'xor'|when valid 2G auth data is set |'info-aud'|aud2g.ki|32 hexadecimal digits|when valid 2G auth data is set |'info-aud'|aud3g.algo|so far always 'milenage'|when valid 3G auth data is set diff --git a/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl b/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl index 1a98a80..a103fb8 100644 --- a/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl +++ b/OsmoHLR/example_subscriber_cs_ps_enabled.ctrl @@ -3,6 +3,13 @@ id 3 imsi 901990000000003 msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 GET 2 subscriber.by-msisdn-103.ps-enabled GET_REPLY 2 subscriber.by-msisdn-103.ps-enabled 1 @@ -18,7 +25,13 @@ id 3 imsi 901990000000003 msisdn 103 +nam_cs 1 nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 SET 6 subscriber.by-msisdn-103.cs-enabled 0 SET_REPLY 6 subscriber.by-msisdn-103.cs-enabled OK @@ -33,6 +46,11 @@ msisdn 103 nam_cs 0 nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 SET 9 subscriber.by-msisdn-103.cs-enabled 1 SET_REPLY 9 subscriber.by-msisdn-103.cs-enabled OK @@ -44,3 +62,10 @@ id 3 imsi 901990000000003 msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 diff --git a/OsmoHLR/example_subscriber_info.ctrl b/OsmoHLR/example_subscriber_info.ctrl index 2020508..1bdf00b 100644 --- a/OsmoHLR/example_subscriber_info.ctrl +++ b/OsmoHLR/example_subscriber_info.ctrl @@ -3,6 +3,13 @@ id 3 imsi 901990000000003 msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 GET 2 subscriber.by-msisdn-103.info-aud GET_REPLY 2 subscriber.by-msisdn-103.info-aud @@ -12,17 +19,24 @@ aud3g.k 000102030405060708090a0b0c0d0e0f aud3g.opc 101112131415161718191a1b1c1d1e1f aud3g.ind_bitlen 5 -aud3g.sqn 2342 +aud3g.sqn 0 GET 3 subscriber.by-id-3.info-all GET_REPLY 3 subscriber.by-id-3.info-all id 3 imsi 901990000000003 msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 aud2g.algo COMP128v1 aud2g.ki 000102030405060708090a0b0c0d0e0f aud3g.algo MILENAGE aud3g.k 000102030405060708090a0b0c0d0e0f aud3g.opc 101112131415161718191a1b1c1d1e1f aud3g.ind_bitlen 5 -aud3g.sqn 2342 +aud3g.sqn 0 -- To view, visit https://gerrit.osmocom.org/4393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie4da6115bb2eb005a9f95bf4de1bfe36468fd607 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 00:15:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 00:15:59 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/4311/6/src/ctrl.c File src/ctrl.c: Line 233: aud3g.algo = OSMO_AUTH_ALG_NONE; > I think it's worth putting this clarification right here next to the code r ENOENT says it all: there is no such entry, and it's all over the db api docs (now it is). It goes on to print things, and each print exits if algo is none; but that's left up to the print function to decide. there is no mystery here at all. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 6 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 27 00:19:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 00:19:16 +0000 Subject: [PATCH] osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4311 to look at the new patch set (#7). ctrl: completely replace all CTRL commands The previous commands are not conforming to how the CTRL interface is intended to work: SET enable-ps SET disable-ps SET status-ps 'status-ps' is a write-only command even though it returns the status. 'enable-ps' / 'disable-ps' indicate the value instead of a variable name of an entity. The entity takes the place of the variable value. See also https://lists.osmocom.org/pipermail/openbsc/2017-September/011236.html Instead, replace with SET subscriber.by-imsi-123456.ps-enabled {0,1} GET subscriber.by-imsi-123456.ps-enabled and also provide further CTRL functions while at it: {SET,GET} subscriber.by-{imsi,msisdn,id}-123456.{cs,ps}-enabled {0,1} GET subscriber.by-{imsi,msisdn,id}-123456.{info,info-aud,info-all} Provide CTRL tests in the form of transcripts. Adjust tests/test_subscriber.sql to feature nonzero SQN, to see some values for SQN in the CTRL transcript tests. (This does not affect the VTY tests, because that creates its own subscribers, and there's no VTY command to set the SQN.) This is the first time an application uses CTRL_NODE ids that are defined outside of libosmocore, see 'Depends' below. Implementation choice: the first idea was to have a '.' between the 'by-xxx' and the value, like: subscriber.by-xxx.123456.function but the difficulty with subscribers is that they are not in RAM, and I can't just point node_data at a struct instance that is always there (like, say, a global bts[0] struct in osmo-bsc). Instead, I want to store the selector and later decide whether to read from the DB or whatever. With a '.' separating things, the only way in a ctrl function to obtain both 'by-xxx' and '123456' for picking a subscriber record would be to parse the entire variable path string elements, including 'subscriber' and 'function', which would then also clumsily fix at which node level we hook these commands; there could have been separate CTRL_NODE_SUBSCR_BY_{IMSI,MSISDN,ID} parent nodes, but we cannot introspect the current parent node dynamically within a ctrl function handler (plus I'm not sure whether it's possible and a good idea to have the same command under multiple parent nodes). Rather than that, I store the 'by-foo-123' token in the node_data pointer to have both bits of information pointed at by a single pointer; I use the incoming command parsing to get this token pre-separated from surrounding node names, and no need to re-allocate it, since the vector of tokens lives until after command execution is complete. Each leaf command obtains this token from cmd->node (aka node_data), and feeds this token to a common static function to parse selector and value from it and to retrieve a subscriber record as needed. (BTW, I have mentioned on the mailing list that this way might be necessary to avoid numeric-only CTRL node names, but we don't need to, and that is not at all related to this choice of structure.) Depends: libosmocore I1bd62ae0d4eefde7e1517db15a2155640a1bab58 libosmocore Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 --- M src/ctrl.c M src/ctrl.h M tests/test_subscriber.ctrl M tests/test_subscriber.sql M tests/test_subscriber.vty A tests/test_subscriber_errors.ctrl 6 files changed, 1,041 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/11/4311/7 diff --git a/src/ctrl.c b/src/ctrl.c index b49765d..3e81661 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -21,77 +21,362 @@ */ #include +#include +#include +#include -#include -#include +#include #include -#include "gsup_server.h" -#include "logging.h" -#include "db.h" #include "hlr.h" -#include "luop.h" #include "ctrl.h" +#include "db.h" -static int handle_cmd_ps(struct hlr *ctx, struct ctrl_cmd *cmd, bool enable) +#define SEL_BY "by-" +#define SEL_BY_IMSI SEL_BY "imsi-" +#define SEL_BY_MSISDN SEL_BY "msisdn-" +#define SEL_BY_ID SEL_BY "id-" + +#define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) + +static bool startswith(const char *str, const char *start) +{ + return strncmp(str, start, strlen(start)) == 0; +} + +static int _get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr) +{ + const char *val; + if (startswith(by_selector, SEL_BY_IMSI)) { + val = by_selector + strlen(SEL_BY_IMSI); + if (!osmo_imsi_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_imsi(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_MSISDN)) { + val = by_selector + strlen(SEL_BY_MSISDN); + if (!osmo_msisdn_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_msisdn(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_ID)) { + int64_t id; + char *endptr; + val = by_selector + strlen(SEL_BY_ID); + if (*val == '+') + return -EINVAL; + errno = 0; + id = strtoll(val, &endptr, 10); + if (errno || *endptr) + return -EINVAL; + return db_subscr_get_by_id(dbc, id, subscr); + } + return -ENOTSUP; +} + +static bool get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr, + struct ctrl_cmd *cmd) +{ + int rc = _get_subscriber(dbc, by_selector, subscr); + switch (rc) { + case 0: + return true; + case -ENOTSUP: + cmd->reply = "Not a known subscriber 'by-xxx-' selector."; + return false; + case -EINVAL: + cmd->reply = "Invalid value part of 'by-xxx-value' selector."; + return false; + case -ENOENT: + cmd->reply = "No such subscriber."; + return false; + default: + cmd->reply = "An unknown error has occured during get_subscriber()."; + return false; + } +} + +/* Optimization: if a subscriber operation is requested by-imsi, just return + * the IMSI right back. */ +static const char *get_subscriber_imsi(struct db_context *dbc, + const char *by_selector, + struct ctrl_cmd *cmd) +{ + static struct hlr_subscriber subscr; + + if (startswith(by_selector, SEL_BY_IMSI)) + return by_selector + strlen(SEL_BY_IMSI); + if (!get_subscriber(dbc, by_selector, &subscr, cmd)) + return NULL; + return subscr.imsi; +} + +/* printf fmt and arg to completely omit a string if it is empty. */ +#define FMT_S "%s%s%s%s" +#define ARG_S(name, val) \ + (val) && *(val) ? "\n" : "", \ + (val) && *(val) ? name : "", \ + (val) && *(val) ? "\t" : "", \ + (val) && *(val) ? (val) : "" \ + +/* printf fmt and arg to completely omit bool of given value. */ +#define FMT_BOOL "%s" +#define ARG_BOOL(name, val) \ + val ? "\n" name "\t1" : "\n" name "\t0" + +static void print_subscr_info(struct ctrl_cmd *cmd, + struct hlr_subscriber *subscr) +{ + ctrl_cmd_reply_printf(cmd, + "\nid\t%"PRIu64 + FMT_S + FMT_S + FMT_BOOL + FMT_BOOL + FMT_S + FMT_S + FMT_S + FMT_BOOL + FMT_BOOL + "\nperiodic_lu_timer\t%u" + "\nperiodic_rau_tau_timer\t%u" + "\nlmsi\t%08x" + , + subscr->id, + ARG_S("imsi", subscr->imsi), + ARG_S("msisdn", subscr->msisdn), + ARG_BOOL("nam_cs", subscr->nam_cs), + ARG_BOOL("nam_ps", subscr->nam_ps), + ARG_S("vlr_number", subscr->vlr_number), + ARG_S("sgsn_number", subscr->sgsn_number), + ARG_S("sgsn_address", subscr->sgsn_address), + ARG_BOOL("ms_purged_cs", subscr->ms_purged_cs), + ARG_BOOL("ms_purged_ps", subscr->ms_purged_ps), + subscr->periodic_lu_timer, + subscr->periodic_rau_tau_timer, + subscr->lmsi + ); +} + +static void print_subscr_info_aud2g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + ctrl_cmd_reply_printf(cmd, + "\naud2g.algo\t%s" + "\naud2g.ki\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.gsm.ki)); +} + +static void print_subscr_info_aud3g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + ctrl_cmd_reply_printf(cmd, + "\naud3g.algo\t%s" + "\naud3g.k\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.umts.k)); + /* hexdump uses a static string buffer, hence only one hexdump per + * printf(). */ + ctrl_cmd_reply_printf(cmd, + "\naud3g.%s\t%s" + "\naud3g.ind_bitlen\t%u" + "\naud3g.sqn\t%"PRIu64 + , + aud->u.umts.opc_is_op? "op" : "opc", + hexdump_buf(aud->u.umts.opc), + aud->u.umts.ind_bitlen, + aud->u.umts.sqn); +} + +CTRL_CMD_DEFINE_RO(subscr_info, "info"); +static int get_subscr_info(struct ctrl_cmd *cmd, void *data) { struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; - if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, &subscr) < 0) { - cmd->reply = "Subscriber Unknown in HLR"; + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + print_subscr_info(cmd, &subscr); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_aud, "info-aud"); +static int get_subscr_info_aud(struct ctrl_cmd *cmd, void *data) +{ + const char *imsi; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + /* No auth data found, tell the print*() functions about it. */ + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } - if (hlr_subscr_nam(ctx, &subscr, enable, true) < 0) { - cmd->reply = "Error updating DB"; + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_all, "info-all"); +static int get_subscr_info_all(struct ctrl_cmd *cmd, void *data) +{ + struct hlr_subscriber subscr; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, subscr.imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + /* No auth data found, tell the print*() functions about it. */ + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } + print_subscr_info(cmd, &subscr); + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +static int verify_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) +{ + if (!value || !*value + || (strcmp(value, "0") && strcmp(value, "1"))) + return 1; + return 0; +} + +static int get_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + cmd->reply = (is_ps ? subscr.nam_ps : subscr.nam_cs) + ? "1" : "0"; + return CTRL_CMD_REPLY; +} + +static int set_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + const char *imsi; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + if (db_subscr_nam(hlr->dbc, imsi, strcmp(cmd->value, "1") == 0, is_ps)) + return CTRL_CMD_ERROR; cmd->reply = "OK"; return CTRL_CMD_REPLY; } -CTRL_CMD_DEFINE_WO_NOVRF(enable_ps, "enable-ps"); -static int set_enable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_ps_enabled, "ps-enabled"); +static int verify_subscr_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, true); + return verify_subscr_cs_ps_enabled(cmd, value, data); +} +static int get_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return get_subscr_cs_ps_enabled(cmd, data, true); +} +static int set_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, true); } -CTRL_CMD_DEFINE_WO_NOVRF(disable_ps, "disable-ps"); -static int set_disable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_cs_enabled, "cs-enabled"); +static int verify_subscr_cs_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, false); + return verify_subscr_cs_ps_enabled(cmd, value, data); } - -CTRL_CMD_DEFINE_WO_NOVRF(status_ps, "status-ps"); -static int set_status_ps(struct ctrl_cmd *cmd, void *data) +static int get_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) { - struct hlr *ctx = data; - struct lu_operation *luop = lu_op_alloc(ctx->gs); - if (!luop) { - cmd->reply = "Internal HLR error"; - return CTRL_CMD_ERROR; - } - - if (!lu_op_fill_subscr(luop, ctx->dbc, cmd->value)) { - cmd->reply = "Subscriber Unknown in HLR"; - return CTRL_CMD_ERROR; - } - - cmd->reply = luop->subscr.nam_ps ? "1" : "0"; - - return CTRL_CMD_REPLY; + return get_subscr_cs_ps_enabled(cmd, data, false); +} +static int set_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, false); } int hlr_ctrl_cmds_install() { int rc = 0; - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_enable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_disable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_status_ps); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_aud); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_all); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_ps_enabled); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_cs_enabled); return rc; +} + +static int hlr_ctrl_node_lookup(void *data, vector vline, int *node_type, + void **node_data, int *i) +{ + const char *token = vector_slot(vline, *i); + + switch (*node_type) { + case CTRL_NODE_ROOT: + if (strcmp(token, "subscriber") != 0) + return 0; + *node_data = NULL; + *node_type = CTRL_NODE_SUBSCR; + break; + case CTRL_NODE_SUBSCR: + if (!startswith(token, "by-")) + return 0; + *node_data = (void*)token; + *node_type = CTRL_NODE_SUBSCR_BY; + break; + default: + return 0; + } + + return 1; } struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr) @@ -100,8 +385,8 @@ struct ctrl_handle *hdl = ctrl_interface_setup_dynip2(hlr, hlr->ctrl_bind_addr, OSMO_CTRL_PORT_HLR, - NULL, - 0); + hlr_ctrl_node_lookup, + _LAST_CTRL_NODE_HLR); if (!hdl) return NULL; diff --git a/src/ctrl.h b/src/ctrl.h index 239deea..3f9ba3f 100644 --- a/src/ctrl.h +++ b/src/ctrl.h @@ -24,7 +24,11 @@ #include -#include "gsup_server.h" +enum hlr_ctrl_node { + CTRL_NODE_SUBSCR = _LAST_CTRL_NODE, + CTRL_NODE_SUBSCR_BY, + _LAST_CTRL_NODE_HLR +}; int hlr_ctrl_cmds_install(); struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr); diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl index 3284ae5..b9be5fe 100644 --- a/tests/test_subscriber.ctrl +++ b/tests/test_subscriber.ctrl @@ -1,27 +1,598 @@ -GET 1 invalid -ERROR 1 Command not found -SET 2 invalid nonsense -ERROR 2 Command not found +GET 1 subscriber.by-imsi-901990000000001.info +GET_REPLY 1 subscriber.by-imsi-901990000000001.info +id 1 +imsi 901990000000001 +msisdn 1 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 -SET 3 enable-ps 901990000000001 -SET_REPLY 3 enable-ps OK -SET 4 status-ps 901990000000001 -SET_REPLY 4 status-ps 1 -SET 5 enable-ps 901990000000001 -SET_REPLY 5 enable-ps OK -SET 6 status-ps 901990000000001 -SET_REPLY 6 status-ps 1 +GET 2 subscriber.by-imsi-901990000000001.info-aud +GET_REPLY 2 subscriber.by-imsi-901990000000001.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 7 disable-ps 901990000000001 -SET_REPLY 7 disable-ps OK -SET 8 status-ps 901990000000001 -SET_REPLY 8 status-ps 0 -SET 9 disable-ps 901990000000001 -SET_REPLY 9 disable-ps OK -SET 10 status-ps 901990000000001 -SET_REPLY 10 status-ps 0 +GET 3 subscriber.by-imsi-901990000000001.info-all +GET_REPLY 3 subscriber.by-imsi-901990000000001.info-all +id 1 +imsi 901990000000001 +msisdn 1 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 11 enable-ps 901990000000001 -SET_REPLY 11 enable-ps OK -SET 12 status-ps 901990000000001 -SET_REPLY 12 status-ps 1 +GET 4 subscriber.by-imsi-901990000000002.info +GET_REPLY 4 subscriber.by-imsi-901990000000002.info +id 2 +imsi 901990000000002 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 5 subscriber.by-imsi-901990000000002.info-aud +GET_REPLY 5 subscriber.by-imsi-901990000000002.info-aud +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 4223 + +GET 6 subscriber.by-imsi-901990000000002.info-all +GET_REPLY 6 subscriber.by-imsi-901990000000002.info-all +id 2 +imsi 901990000000002 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 4223 + +GET 7 subscriber.by-imsi-901990000000003.info +GET_REPLY 7 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 8 subscriber.by-imsi-901990000000003.info-aud +GET_REPLY 8 subscriber.by-imsi-901990000000003.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 9 subscriber.by-imsi-901990000000003.info-all +GET_REPLY 9 subscriber.by-imsi-901990000000003.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 10 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 10 subscriber.by-imsi-901990000000003.ps-enabled 1 + +SET 11 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 11 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 12 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 12 subscriber.by-imsi-901990000000003.ps-enabled 0 + +GET 13 subscriber.by-imsi-901990000000003.info +GET_REPLY 13 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 14 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 14 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 15 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 15 subscriber.by-imsi-901990000000003.ps-enabled 0 + +SET 16 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 16 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 17 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 17 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 18 subscriber.by-imsi-901990000000003.info +GET_REPLY 18 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 19 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 19 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 20 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 20 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 21 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 21 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 22 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 22 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 23 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 23 subscriber.by-imsi-901990000000003.cs-enabled 0 + +GET 24 subscriber.by-imsi-901990000000003.info +GET_REPLY 24 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 25 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 25 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 26 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 26 subscriber.by-imsi-901990000000003.cs-enabled 0 + +SET 27 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 27 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 28 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 28 subscriber.by-imsi-901990000000003.cs-enabled 1 + +GET 29 subscriber.by-imsi-901990000000003.info +GET_REPLY 29 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 30 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 30 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 31 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 31 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 32 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 32 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 33 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 33 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 34 subscriber.by-imsi-901990000000003.info +GET_REPLY 34 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 35 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 35 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 36 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 36 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 37 subscriber.by-imsi-901990000000003.info +GET_REPLY 37 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + + + +GET 38 subscriber.by-msisdn-103.info +GET_REPLY 38 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 39 subscriber.by-msisdn-103.info-aud +GET_REPLY 39 subscriber.by-msisdn-103.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 40 subscriber.by-msisdn-103.info-all +GET_REPLY 40 subscriber.by-msisdn-103.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 41 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 41 subscriber.by-msisdn-103.ps-enabled 1 + +SET 42 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 42 subscriber.by-msisdn-103.ps-enabled OK +GET 43 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 43 subscriber.by-msisdn-103.ps-enabled 0 + +GET 44 subscriber.by-msisdn-103.info +GET_REPLY 44 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 45 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 45 subscriber.by-msisdn-103.ps-enabled OK +GET 46 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 46 subscriber.by-msisdn-103.ps-enabled 0 + +SET 47 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 47 subscriber.by-msisdn-103.ps-enabled OK +GET 48 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 48 subscriber.by-msisdn-103.ps-enabled 1 + +GET 49 subscriber.by-msisdn-103.info +GET_REPLY 49 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 50 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 50 subscriber.by-msisdn-103.ps-enabled OK +GET 51 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 51 subscriber.by-msisdn-103.ps-enabled 1 + +GET 52 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 52 subscriber.by-msisdn-103.cs-enabled 1 + +SET 53 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 53 subscriber.by-msisdn-103.cs-enabled OK +GET 54 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 54 subscriber.by-msisdn-103.cs-enabled 0 + +GET 55 subscriber.by-msisdn-103.info +GET_REPLY 55 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 56 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 56 subscriber.by-msisdn-103.cs-enabled OK +GET 57 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 57 subscriber.by-msisdn-103.cs-enabled 0 + +SET 58 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 58 subscriber.by-msisdn-103.cs-enabled OK +GET 59 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 59 subscriber.by-msisdn-103.cs-enabled 1 + +GET 60 subscriber.by-msisdn-103.info +GET_REPLY 60 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 61 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 61 subscriber.by-msisdn-103.cs-enabled OK +GET 62 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 62 subscriber.by-msisdn-103.cs-enabled 1 + +SET 63 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 63 subscriber.by-msisdn-103.ps-enabled OK +SET 64 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 64 subscriber.by-msisdn-103.cs-enabled OK +GET 65 subscriber.by-msisdn-103.info +GET_REPLY 65 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 66 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 66 subscriber.by-msisdn-103.ps-enabled OK +SET 67 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 67 subscriber.by-msisdn-103.cs-enabled OK +GET 68 subscriber.by-msisdn-103.info +GET_REPLY 68 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + + + +GET 69 subscriber.by-id-3.info +GET_REPLY 69 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 70 subscriber.by-id-3.info-aud +GET_REPLY 70 subscriber.by-id-3.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 71 subscriber.by-id-3.info-all +GET_REPLY 71 subscriber.by-id-3.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 72 subscriber.by-id-3.ps-enabled +GET_REPLY 72 subscriber.by-id-3.ps-enabled 1 + +SET 73 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 73 subscriber.by-id-3.ps-enabled OK +GET 74 subscriber.by-id-3.ps-enabled +GET_REPLY 74 subscriber.by-id-3.ps-enabled 0 + +GET 75 subscriber.by-id-3.info +GET_REPLY 75 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 76 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 76 subscriber.by-id-3.ps-enabled OK +GET 77 subscriber.by-id-3.ps-enabled +GET_REPLY 77 subscriber.by-id-3.ps-enabled 0 + +SET 78 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 78 subscriber.by-id-3.ps-enabled OK +GET 79 subscriber.by-id-3.ps-enabled +GET_REPLY 79 subscriber.by-id-3.ps-enabled 1 + +GET 80 subscriber.by-id-3.info +GET_REPLY 80 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 81 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 81 subscriber.by-id-3.ps-enabled OK +GET 82 subscriber.by-id-3.ps-enabled +GET_REPLY 82 subscriber.by-id-3.ps-enabled 1 + +GET 83 subscriber.by-id-3.cs-enabled +GET_REPLY 83 subscriber.by-id-3.cs-enabled 1 + +SET 84 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 84 subscriber.by-id-3.cs-enabled OK +GET 85 subscriber.by-id-3.cs-enabled +GET_REPLY 85 subscriber.by-id-3.cs-enabled 0 + +GET 86 subscriber.by-id-3.info +GET_REPLY 86 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 87 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 87 subscriber.by-id-3.cs-enabled OK +GET 88 subscriber.by-id-3.cs-enabled +GET_REPLY 88 subscriber.by-id-3.cs-enabled 0 + +SET 89 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 89 subscriber.by-id-3.cs-enabled OK +GET 90 subscriber.by-id-3.cs-enabled +GET_REPLY 90 subscriber.by-id-3.cs-enabled 1 + +GET 91 subscriber.by-id-3.info +GET_REPLY 91 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 92 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 92 subscriber.by-id-3.cs-enabled OK +GET 93 subscriber.by-id-3.cs-enabled +GET_REPLY 93 subscriber.by-id-3.cs-enabled 1 + +SET 94 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 94 subscriber.by-id-3.ps-enabled OK +SET 95 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 95 subscriber.by-id-3.cs-enabled OK +GET 96 subscriber.by-id-3.info +GET_REPLY 96 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 97 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 97 subscriber.by-id-3.ps-enabled OK +SET 98 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 98 subscriber.by-id-3.cs-enabled OK +GET 99 subscriber.by-id-3.info +GET_REPLY 99 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql index 0767d48..bce0af2 100644 --- a/tests/test_subscriber.sql +++ b/tests/test_subscriber.sql @@ -1,13 +1,13 @@ -- 2G only subscriber -INSERT INTO subscriber (id, imsi) VALUES (1, '901990000000001'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (1, '901990000000001', '1'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (1, 1, '000102030405060708090a0b0c0d0e0f'); -- 3G only subscriber INSERT INTO subscriber (id, imsi) VALUES (2, '901990000000002'); -INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 4223); -- 2G + 3G subscriber -INSERT INTO subscriber (id, imsi) VALUES (3, '901990000000003'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (3, '901990000000003', '103'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); -INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 2342); diff --git a/tests/test_subscriber.vty b/tests/test_subscriber.vty index 2e0bdce..2da455f 100644 --- a/tests/test_subscriber.vty +++ b/tests/test_subscriber.vty @@ -305,6 +305,7 @@ OPC=cededeffacedacefacedbadfadedbeef IND-bitlen=23 +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op C01ffedC1cadaeAc1d1f1edAcac1aB0a OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op CoiffedCicadaeAcidifiedAcaciaBoa % Invalid value for OP: 'CoiffedCicadaeAcidifiedAcaciaBoa' OsmoHLR# subscriber imsi 123456789023000 show @@ -313,8 +314,8 @@ MSISDN: 423 3G auth: MILENAGE K=deaf0ff1ced0d0dabbedd1ced1cef00d - OPC=cededeffacedacefacedbadfadedbeef - IND-bitlen=23 + OP=c01ffedc1cadaeac1d1f1edacac1ab0a + IND-bitlen=5 OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef OsmoHLR# subscriber id 1 show @@ -325,8 +326,8 @@ KI=cededeffacedacefacedbadfadedbeef 3G auth: MILENAGE K=deaf0ff1ced0d0dabbedd1ced1cef00d - OPC=cededeffacedacefacedbadfadedbeef - IND-bitlen=23 + OP=c01ffedc1cadaeac1d1f1edacac1ab0a + IND-bitlen=5 OsmoHLR# subscriber imsi 123456789023000 delete % Deleted subscriber for IMSI '123456789023000' diff --git a/tests/test_subscriber_errors.ctrl b/tests/test_subscriber_errors.ctrl new file mode 100644 index 0000000..2f64fdb --- /dev/null +++ b/tests/test_subscriber_errors.ctrl @@ -0,0 +1,107 @@ +GET 1 invalid +ERROR 1 Command not found +SET 2 invalid nonsense +ERROR 2 Command not found + +GET 3 subscriber.by-imsi-nonsense.info +ERROR 3 Invalid value part of 'by-xxx-value' selector. +GET 4 subscriber.by-msisdn-nonsense.info +ERROR 4 Invalid value part of 'by-xxx-value' selector. +GET 5 subscriber.by-id-nonsense.info +ERROR 5 Invalid value part of 'by-xxx-value' selector. + +GET 6 subscriber +ERROR 6 Command not present. +GET 7 subscriber. +ERROR 7 Command not present. +GET 8 subscriber.by-nonsense +ERROR 8 Command not present. +GET 9 subscriber.by-nonsense- +ERROR 9 Command not present. +GET 10 subscriber.by-nonsense-123456 +ERROR 10 Command not present. +GET 11 subscriber.by-nonsense-123456. +ERROR 11 Command not present. +GET 12 subscriber.by-imsi- +ERROR 12 Command not present. +GET 13 subscriber.by-imsi-. +ERROR 13 Command not present. +GET 14 subscriber.by-imsi-901990000000003 +ERROR 14 Command not present. +GET 15 subscriber.by-imsi-901990000000003. +ERROR 15 Command not present. + +GET 16 subscriber.by-nonsense-123456.info +ERROR 16 Not a known subscriber 'by-xxx-' selector. +GET 17 subscriber.by-123456.info +ERROR 17 Not a known subscriber 'by-xxx-' selector. + +GET 18 subscriber.by-imsi-.info +ERROR 18 Invalid value part of 'by-xxx-value' selector. +GET 19 subscriber.by-imsi--.info +ERROR 19 Invalid value part of 'by-xxx-value' selector. + +GET 20 subscriber.by-imsi-12345678901234567.info +ERROR 20 Invalid value part of 'by-xxx-value' selector. +GET 21 subscriber.by-imsi-12345.info +ERROR 21 Invalid value part of 'by-xxx-value' selector. +GET 22 subscriber.by-imsi-1234567890123456.info +ERROR 22 Invalid value part of 'by-xxx-value' selector. + +GET 23 subscriber.by-id-99999999999999999999999999.info +ERROR 23 Invalid value part of 'by-xxx-value' selector. +GET 24 subscriber.by-id-9223372036854775807.info +ERROR 24 No such subscriber. +GET 25 subscriber.by-id-9223372036854775808.info +ERROR 25 Invalid value part of 'by-xxx-value' selector. +GET 26 subscriber.by-id--1.info +ERROR 26 No such subscriber. +GET 27 subscriber.by-id--9223372036854775808.info +ERROR 27 No such subscriber. +GET 28 subscriber.by-id--9223372036854775809.info +ERROR 28 Invalid value part of 'by-xxx-value' selector. + +GET 29 subscriber.by-id-1+1.info +ERROR 29 Invalid value part of 'by-xxx-value' selector. +GET 30 subscriber.by-id--.info +ERROR 30 Invalid value part of 'by-xxx-value' selector. +GET 31 subscriber.by-id-+1.info +ERROR 31 Invalid value part of 'by-xxx-value' selector. +GET 32 subscriber.by-id-+-1.info +ERROR 32 Invalid value part of 'by-xxx-value' selector. +GET 33 subscriber.by-id--+1.info +ERROR 33 Invalid value part of 'by-xxx-value' selector. +GET 34 subscriber.by-id-++1.info +ERROR 34 Invalid value part of 'by-xxx-value' selector. +GET 35 subscriber.by-id---1.info +ERROR 35 Invalid value part of 'by-xxx-value' selector. + +GET 36 subscriber.by-id- 1.info +ERROR 36 Command not present. +GET 37 subscriber.by-id-+ 1.info +ERROR 37 Command not present. +GET 38 subscriber.by-id-- 1.info +ERROR 38 Command not present. + + +SET 39 subscriber.by-imsi-901990000000001.info foo +ERROR 39 Read Only attribute +SET 40 subscriber.by-imsi-901990000000001.info-aud foo +ERROR 40 Read Only attribute +SET 41 subscriber.by-imsi-901990000000001.info-all foo +ERROR 41 Read Only attribute + +SET 42 subscriber.by-imsi-901990000000001.ps-enabled nonsense +ERROR 42 Value failed verification. +SET 43 subscriber.by-imsi-901990000000001.cs-enabled nonsense +ERROR 43 Value failed verification. + +SET 44 subscriber.by-imsi-901990000000001.ps-enabled +ERROR err Command parser error. +SET 45 subscriber.by-imsi-901990000000001.cs-enabled +ERROR err Command parser error. + +GET 46 subscriber.by-imsi-1234567890123456.ps-enabled +ERROR 46 Invalid value part of 'by-xxx-value' selector. +GET 47 subscriber.by-imsi-1234567890123456.cs-enabled +ERROR 47 Invalid value part of 'by-xxx-value' selector. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 7 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 00:19:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 00:19:27 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 7: enough argued, here is your comment. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 7 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 00:30:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 00:30:25 +0000 Subject: libosmocore[master]: GPRS: check and report local address used for NSE In-Reply-To: References: Message-ID: Patch Set 2: in english: a char[] _is_ a "char*". if you have char foo[] then &foo is "just coincidentally" the same memory location as foo, syntactically it became a char**. So just passing 'foo' is the correct way in this instance. -- To view, visit https://gerrit.osmocom.org/4395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6932a29c7899d36bcc275f05dda9670b0e69bef0 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 00:35:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 00:35:02 +0000 Subject: [MERGED] osmo-hlr[master]: cosmetic: tweak params of hlr_controlif_setup() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: tweak params of hlr_controlif_setup() ...................................................................... cosmetic: tweak params of hlr_controlif_setup() Cosmetically prepare for adding new CTRL commands in hlr_controlif_setup(): - drop unused 'gs' param. - use ctrl_interface_setup_dynip2(), so far with default CTRL nodes; custom nodes will be added soon. Prepares: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Change-Id: I63004a7953b04988449697dbc5d55d7ed0c6d82d --- M src/ctrl.c M src/ctrl.h M src/hlr.c 3 files changed, 8 insertions(+), 9 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl.c b/src/ctrl.c index 3bd4d8f..b49765d 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -94,14 +94,14 @@ return rc; } -struct ctrl_handle *hlr_controlif_setup(struct hlr *ctx, - struct osmo_gsup_server *gs) +struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr) { int rc; - struct ctrl_handle *hdl = ctrl_interface_setup_dynip(ctx, - ctx->ctrl_bind_addr, - OSMO_CTRL_PORT_HLR, - NULL); + struct ctrl_handle *hdl = ctrl_interface_setup_dynip2(hlr, + hlr->ctrl_bind_addr, + OSMO_CTRL_PORT_HLR, + NULL, + 0); if (!hdl) return NULL; diff --git a/src/ctrl.h b/src/ctrl.h index 663de30..239deea 100644 --- a/src/ctrl.h +++ b/src/ctrl.h @@ -27,5 +27,4 @@ #include "gsup_server.h" int hlr_ctrl_cmds_install(); -struct ctrl_handle *hlr_controlif_setup(struct hlr *ctx, - struct osmo_gsup_server *gs); +struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr); diff --git a/src/hlr.c b/src/hlr.c index b32f709..6310526 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -474,7 +474,7 @@ } g_hlr->ctrl_bind_addr = ctrl_vty_get_bind_addr(); - g_hlr->ctrl = hlr_controlif_setup(g_hlr, g_hlr->gs); + g_hlr->ctrl = hlr_controlif_setup(g_hlr); osmo_init_ignore_signals(); signal(SIGINT, &signal_hdlr); -- To view, visit https://gerrit.osmocom.org/4396 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I63004a7953b04988449697dbc5d55d7ed0c6d82d Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 00:41:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 00:41:00 +0000 Subject: osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Patch Set 6: Code-Review-1 please merge 4375 and 4376 into this patch, as agreed before? If the build failure is due to an unmerged patch in libosmocore or something, please add a 'Depends:' tag. -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 02:10:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 02:10:17 +0000 Subject: [PATCH] osmo-hlr[master]: tests/Makefile: use test db var instead of repeating the path Message-ID: Review at https://gerrit.osmocom.org/4436 tests/Makefile: use test db var instead of repeating the path Change-Id: I9859b522b5ffa7f2c9ed33ab849199d4b4e6696c --- M tests/Makefile.am 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/36/4436/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index e71a250..2dba6a1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -54,7 +54,7 @@ sqlite3 $(VTY_TEST_DB) < $(top_srcdir)/sql/hlr.sql osmo_verify_transcript_vty.py -v \ -n OsmoHLR -p 4258 \ - -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_vty_test.db" \ + -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l $(VTY_TEST_DB)" \ $(U) $(srcdir)/*.vty -rm -f $(VTY_TEST_DB) @@ -69,7 +69,7 @@ sqlite3 $(CTRL_TEST_DB) < $(srcdir)/test_subscriber.sql osmo_verify_transcript_ctrl.py -v \ -p 4259 \ - -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_ctrl_test.db" \ + -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l $(CTRL_TEST_DB)" \ $(U) $(srcdir)/*.ctrl -rm -f $(CTRL_TEST_DB) -- To view, visit https://gerrit.osmocom.org/4436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9859b522b5ffa7f2c9ed33ab849199d4b4e6696c Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 02:10:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 02:10:18 +0000 Subject: [PATCH] osmo-hlr[master]: db_test: fix *FLAGS Message-ID: Review at https://gerrit.osmocom.org/4437 db_test: fix *FLAGS The -I includes should be in CFLAGS, not CPPFLAGS. I noticed problems with it when trying to add an -I$(builddir) in an upcoming patch that adds a BUILT_SOURCE, If77dbbfe1af3e66aaec91cb6295b687f37678636. Change-Id: Ie57a04b7efc7a1e16cf0e3625d8ad2f0ef0089b0 --- M tests/db/Makefile.am 1 file changed, 1 insertion(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/37/4437/1 diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index a1f35a7..b706bec 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -1,17 +1,11 @@ -AM_CPPFLAGS = \ +AM_CFLAGS = \ $(all_includes) \ -I$(top_srcdir)/src \ - $(NULL) - -AM_CFLAGS = \ -Wall \ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(SQLITE3_CFLAGS) \ - $(NULL) - -AM_LDFLAGS = \ $(NULL) EXTRA_DIST = \ -- To view, visit https://gerrit.osmocom.org/4437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie57a04b7efc7a1e16cf0e3625d8ad2f0ef0089b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 02:10:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 02:10:18 +0000 Subject: [PATCH] osmo-hlr[master]: automatically create db tables on osmo-hlr invocation Message-ID: Review at https://gerrit.osmocom.org/4438 automatically create db tables on osmo-hlr invocation If a database file is missing, osmo-hlr creates it, as is the default sqlite3 API behavior -- before this patch, that db file is created, but lacks useful tables. Actually also create initial tables in it, as osmo-nitb did. In effect, the 'vty-test' target in tests/Makefile.am no longer needs to create a database manually. (The 'ctrl-test' still does, because it also wants to add subscriber data on top of the bare tables.) Note: it could be desirable to bail if the desired database file does not exist. That is however a different semantic from this patch; this is not changing the fact that a db file is created, this just creates a usable one. Note: I am about to add osmo-hlr-db-tool to do database migration from osmo-nitb. For that, it is desirable to bootstrap a usable database, which is the core reason for this patch. Don't plainly duplicate hlr.sql to .c, but create db_bootstrap.h as a BUILT_SOURCE from reading in sql/hlr.sql and mangling via sed to a list of SQL statement strings. On each db_open(), run this bootstrap sequence. In sql/hlr.sql, these tweaks are necessary: * Add 'IF NOT EXISTS' to 'CREATE TABLE', so that the bootstrap sequence can be run on an already bootstrapped db. * Drop the final comment at the bottom, which ended up being an empty SQL statement and causing sqlite3 API errors, seemed to have no purpose anyway. Note: by composing the statement strings as multiline and including the SQL comments, sqlite3 actually retains the comments contained in table definitions and prints them back during 'sqlite3 hlr.db .dump'. Change-Id: If77dbbfe1af3e66aaec91cb6295b687f37678636 --- M sql/hlr.sql M src/Makefile.am M src/db.c A src/db_bootstrap.sed M tests/Makefile.am M tests/db/Makefile.am 6 files changed, 81 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/38/4438/1 diff --git a/sql/hlr.sql b/sql/hlr.sql index 5fbc712..696cf1c 100644 --- a/sql/hlr.sql +++ b/sql/hlr.sql @@ -1,6 +1,6 @@ --modelled roughly after TS 23.008 version 13.3.0 -CREATE TABLE subscriber ( +CREATE TABLE IF NOT EXISTS subscriber ( id INTEGER PRIMARY KEY, -- Chapter 2.1.1.1 imsi VARCHAR(15) UNIQUE NOT NULL, @@ -40,24 +40,24 @@ ms_purged_ps BOOLEAN NOT NULL DEFAULT 0 ); -CREATE TABLE subscriber_apn ( +CREATE TABLE IF NOT EXISTS subscriber_apn ( subscriber_id INTEGER, -- subscriber.id apn VARCHAR(256) NOT NULL ); -- Chapter 2.1.3 -CREATE TABLE subscriber_multi_msisdn ( +CREATE TABLE IF NOT EXISTS subscriber_multi_msisdn ( subscriber_id INTEGER, -- subscriber.id msisdn VARCHAR(15) NOT NULL ); -CREATE TABLE auc_2g ( +CREATE TABLE IF NOT EXISTS auc_2g ( subscriber_id INTEGER PRIMARY KEY, -- subscriber.id algo_id_2g INTEGER NOT NULL, -- enum osmo_auth_algo value ki VARCHAR(32) NOT NULL -- hex string: subscriber's secret key (128bit) ); -CREATE TABLE auc_3g ( +CREATE TABLE IF NOT EXISTS auc_3g ( subscriber_id INTEGER PRIMARY KEY, -- subscriber.id algo_id_3g INTEGER NOT NULL, -- enum osmo_auth_algo value k VARCHAR(32) NOT NULL, -- hex string: subscriber's secret key (128bit) @@ -68,4 +68,3 @@ ); CREATE UNIQUE INDEX IF NOT EXISTS idx_subscr_imsi ON subscriber (imsi); --- SELECT algo_id_2g, ki, algo_id_3g, k, op, opc, sqn FROM subscriber LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id WHERE imsi = ? diff --git a/src/Makefile.am b/src/Makefile.am index fc7c653..3b09b7b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,7 +10,13 @@ EXTRA_DIST = \ populate_hlr_db.pl \ + db_bootstrap.sed \ $(NULL) + +BUILT_SOURCES = \ + db_bootstrap.h \ + $(NULL) +CLEANFILES = $(BUILT_SOURCES) noinst_HEADERS = \ auc.h \ @@ -24,6 +30,7 @@ ctrl.h \ hlr_vty.h \ hlr_vty_subscr.h \ + db_bootstrap.h \ $(NULL) bin_PROGRAMS = \ @@ -73,3 +80,14 @@ $(LIBOSMOGSM_LIBS) \ $(SQLITE3_LIBS) \ $(NULL) + +BOOTSTRAP_SQL = $(top_srcdir)/sql/hlr.sql + +db_bootstrap.h: $(BOOTSTRAP_SQL) $(srcdir)/db_bootstrap.sed + echo "/* DO NOT EDIT THIS FILE. It is generated from osmo-hlr.git/sql/hlr.sql */" > "$@" + echo "#pragma once" >> "$@" + echo "static const char *stmt_bootstrap_sql[] = {" >> "$@" + cat "$(BOOTSTRAP_SQL)" \ + | sed -f "$(srcdir)/db_bootstrap.sed" \ + >> "$@" + echo "};" >> "$@" diff --git a/src/db.c b/src/db.c index fbf5c76..8733cf5 100644 --- a/src/db.c +++ b/src/db.c @@ -25,6 +25,7 @@ #include "logging.h" #include "db.h" +#include "db_bootstrap.h" #define SEL_COLUMNS \ "id," \ @@ -179,6 +180,35 @@ talloc_free(dbc); } +static int db_bootstrap(struct db_context *dbc) +{ + int i; + for (i = 0; i < ARRAY_SIZE(stmt_bootstrap_sql); i++) { + int rc; + sqlite3_stmt *stmt; + + rc = sqlite3_prepare_v2(dbc->db, stmt_bootstrap_sql[i], -1, + &stmt, NULL); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "Unable to prepare SQL statement '%s'\n", + stmt_bootstrap_sql[i]); + return -1; + } + + /* execute the statement */ + rc = sqlite3_step(stmt); + db_remove_reset(stmt); + if (rc != SQLITE_DONE) { + LOGP(DDB, LOGL_ERROR, "Cannot bootstrap database: SQL error: (%d) %s," + " during stmt '%s'", + rc, sqlite3_errmsg(dbc->db), + stmt_bootstrap_sql[i]); + return -1; + } + } + return 0; +} + struct db_context *db_open(void *ctx, const char *fname) { struct db_context *dbc = talloc_zero(ctx, struct db_context); @@ -231,6 +261,8 @@ LOGP(DDB, LOGL_ERROR, "Unable to set Write-Ahead Logging: %s\n", err_msg); + db_bootstrap(dbc); + /* prepare all SQL statements */ for (i = 0; i < ARRAY_SIZE(dbc->stmt); i++) { rc = sqlite3_prepare_v2(dbc->db, stmt_sql[i], -1, diff --git a/src/db_bootstrap.sed b/src/db_bootstrap.sed new file mode 100644 index 0000000..60b8243 --- /dev/null +++ b/src/db_bootstrap.sed @@ -0,0 +1,25 @@ +# Input to this is sql/hlr.sql. +# +# We want each SQL statement line wrapped in "...\n", and each end (";") to +# become a comma: +# +# SOME SQL COMMAND ( +# that may span ) +# MULTIPLE LINES; +# MORE; +# +# --> +# +# "SOME SQL COMMAND (\n" +# " that may span )\n" +# "MULTIPLE LINES\n", <--note the comma here +# "MORE\n", +# +# just replacing ';' with '\n,' won't work, since sed is bad in printing +# multiple lines. Also, how to input newlines to sed is not portable across +# platforms. + +# Match excluding a trailing ';' as \1, keep any trailing ';' in \2 +s/^\(.*[^;]\)\(;\|\)$/"\1\\n"\2/ +# Replace trailing ';' as ',' +s/;$/,/ diff --git a/tests/Makefile.am b/tests/Makefile.am index 2dba6a1..f1cc710 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -51,7 +51,6 @@ # make vty-test U=-u vty-test: -rm -f $(VTY_TEST_DB) - sqlite3 $(VTY_TEST_DB) < $(top_srcdir)/sql/hlr.sql osmo_verify_transcript_vty.py -v \ -n OsmoHLR -p 4258 \ -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l $(VTY_TEST_DB)" \ diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index b706bec..55b1655 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -1,6 +1,7 @@ AM_CFLAGS = \ $(all_includes) \ -I$(top_srcdir)/src \ + -I$(top_builddir)/src \ -Wall \ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ -- To view, visit https://gerrit.osmocom.org/4438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If77dbbfe1af3e66aaec91cb6295b687f37678636 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 02:10:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 02:10:18 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: sql/hlr.sql: move comments Message-ID: Review at https://gerrit.osmocom.org/4439 cosmetic: sql/hlr.sql: move comments By moving the comments inside the table row definitions, they are dumped back during 'sqlite3 hlr.db .dump'. When they are between SQL statements like before this patch, the comments are lost. Tweak wording. Change-Id: I280c2e2d3e9b7f1dc632722724d9e1c54d041820 --- M sql/hlr.sql 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/39/4439/1 diff --git a/sql/hlr.sql b/sql/hlr.sql index 696cf1c..80eb3e5 100644 --- a/sql/hlr.sql +++ b/sql/hlr.sql @@ -1,6 +1,5 @@ ---modelled roughly after TS 23.008 version 13.3.0 - CREATE TABLE IF NOT EXISTS subscriber ( +-- OsmoHLR's DB scheme is modelled roughly after TS 23.008 version 13.3.0 id INTEGER PRIMARY KEY, -- Chapter 2.1.1.1 imsi VARCHAR(15) UNIQUE NOT NULL, @@ -45,8 +44,8 @@ apn VARCHAR(256) NOT NULL ); --- Chapter 2.1.3 CREATE TABLE IF NOT EXISTS subscriber_multi_msisdn ( +-- Chapter 2.1.3 subscriber_id INTEGER, -- subscriber.id msisdn VARCHAR(15) NOT NULL ); -- To view, visit https://gerrit.osmocom.org/4439 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I280c2e2d3e9b7f1dc632722724d9e1c54d041820 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 02:10:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 02:10:18 +0000 Subject: [PATCH] osmo-hlr[master]: cosmetic: rename SL3_TXT macro, use osmo_strlcpy() Message-ID: Review at https://gerrit.osmocom.org/4440 cosmetic: rename SL3_TXT macro, use osmo_strlcpy() Rename SL3_TXT to more accurate copy_sqlite3_text_to_buf(), and use osmo_strlcpy() instead of essentially dup'ing it. The macro will also be used by hlr_db_tool.c in upcoming patch. This patch prepares for a move to db.h. Change-Id: I1dadeddddcfe0109195c09c0e706201b0df009cc --- M src/db_hlr.c 1 file changed, 14 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/40/4440/1 diff --git a/src/db_hlr.c b/src/db_hlr.c index ef01428..bae9a5a 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -35,12 +35,15 @@ #define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) -#define SL3_TXT(x, stmt, idx) \ - do { \ - const char *_txt = (const char *) sqlite3_column_text(stmt, idx);\ - if (_txt) \ - strncpy(x, _txt, sizeof(x)); \ - x[sizeof(x)-1] = '\0'; \ +/*! Call sqlite3_column_text() and copy result to a char[]. + * \param[out] buf A char[] used as sizeof() arg(!) and osmo_strlcpy() target. + * \param[in] stmt An sqlite3_stmt*. + * \param[in] idx Index in stmt's returned columns. + */ +#define copy_sqlite3_text_to_buf(buf, stmt, idx) \ + do { \ + const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ + osmo_strlcpy(buf, _txt, sizeof(buf)); \ } while (0) /*! Add new subscriber record to the HLR database. @@ -410,12 +413,12 @@ /* obtain the various columns */ subscr->id = sqlite3_column_int64(stmt, 0); - SL3_TXT(subscr->imsi, stmt, 1); - SL3_TXT(subscr->msisdn, stmt, 2); + copy_sqlite3_text_to_buf(subscr->imsi, stmt, 1); + copy_sqlite3_text_to_buf(subscr->msisdn, stmt, 2); /* FIXME: These should all be BLOBs as they might contain NUL */ - SL3_TXT(subscr->vlr_number, stmt, 3); - SL3_TXT(subscr->sgsn_number, stmt, 4); - SL3_TXT(subscr->sgsn_address, stmt, 5); + copy_sqlite3_text_to_buf(subscr->vlr_number, stmt, 3); + copy_sqlite3_text_to_buf(subscr->sgsn_number, stmt, 4); + copy_sqlite3_text_to_buf(subscr->sgsn_address, stmt, 5); subscr->periodic_lu_timer = sqlite3_column_int(stmt, 6); subscr->periodic_rau_tau_timer = sqlite3_column_int(stmt, 7); subscr->nam_cs = sqlite3_column_int(stmt, 8); -- To view, visit https://gerrit.osmocom.org/4440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1dadeddddcfe0109195c09c0e706201b0df009cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 02:10:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 02:10:18 +0000 Subject: [PATCH] osmo-hlr[master]: add osmo-hlr-db-tool, program to migrate from osmo-nitb db Message-ID: Review at https://gerrit.osmocom.org/4441 add osmo-hlr-db-tool, program to migrate from osmo-nitb db Move macro copy_sqlite3_text_to_buf() to db.h, so it can be used in hlr_db_tool.c. Add _dbd_decode_binary() from libdbi to avoid depending on the entire libdbi just for KI BLOB decoding. Add it in a separate file, copying its own license, the lGPL. Offer commandline option --import-nitb-db to read in an old osmo-nitb database and copy subscriber IMSIs and 2G auth data to OsmoHLR db format. Anticipate future command line options like --import-csv, so keep the code generalized. Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63 --- M src/Makefile.am M src/db.h M src/db_hlr.c A src/dbd_decode_binary.c A src/hlr_db_tool.c 5 files changed, 473 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/41/4441/1 diff --git a/src/Makefile.am b/src/Makefile.am index 3b09b7b..9fbb062 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -35,6 +35,7 @@ bin_PROGRAMS = \ osmo-hlr \ + osmo-hlr-db-tool \ $(NULL) noinst_PROGRAMS = \ @@ -66,6 +67,21 @@ $(SQLITE3_LIBS) \ $(NULL) +osmo_hlr_db_tool_SOURCES = \ + hlr_db_tool.c \ + db.c \ + db_hlr.c \ + logging.c \ + rand_urandom.c \ + dbd_decode_binary.c \ + $(NULL) + +osmo_hlr_db_tool_LDADD = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(SQLITE3_LIBS) \ + $(NULL) + db_test_SOURCES = \ auc.c \ db.c \ diff --git a/src/db.h b/src/db.h index 35e4327..fc8e511 100644 --- a/src/db.h +++ b/src/db.h @@ -129,3 +129,14 @@ bool purge_val, bool is_ps); int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps); + +/*! Call sqlite3_column_text() and copy result to a char[]. + * \param[out] buf A char[] used as sizeof() arg(!) and osmo_strlcpy() target. + * \param[in] stmt An sqlite3_stmt*. + * \param[in] idx Index in stmt's returned columns. + */ +#define copy_sqlite3_text_to_buf(buf, stmt, idx) \ + do { \ + const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ + osmo_strlcpy(buf, _txt, sizeof(buf)); \ + } while (0) diff --git a/src/db_hlr.c b/src/db_hlr.c index bae9a5a..c4d4974 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -35,17 +35,6 @@ #define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) -/*! Call sqlite3_column_text() and copy result to a char[]. - * \param[out] buf A char[] used as sizeof() arg(!) and osmo_strlcpy() target. - * \param[in] stmt An sqlite3_stmt*. - * \param[in] idx Index in stmt's returned columns. - */ -#define copy_sqlite3_text_to_buf(buf, stmt, idx) \ - do { \ - const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ - osmo_strlcpy(buf, _txt, sizeof(buf)); \ - } while (0) - /*! Add new subscriber record to the HLR database. * \param[in,out] dbc database context. * \param[in] imsi ASCII string of IMSI digits, is validated. diff --git a/src/dbd_decode_binary.c b/src/dbd_decode_binary.c new file mode 100644 index 0000000..e1a98ad --- /dev/null +++ b/src/dbd_decode_binary.c @@ -0,0 +1,42 @@ +/* This function is blatantly copied from libdbi, from + * https://sourceforge.net/p/libdbi/libdbi/ci/master/tree/src/dbd_helper.c + * to save having to depend on the entire libdbi just for KI BLOB decoding. + */ + +/* + * libdbi - database independent abstraction layer for C. + * Copyright (C) 2001-2003, David Parker and Mark Tobenkin. + * http://libdbi.sourceforge.net + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: dbd_helper.c,v 1.44 2011/08/09 11:14:14 mhoenicka Exp $ + */ + +#include + +size_t _dbd_decode_binary(const unsigned char *in, unsigned char *out){ + int i, e; + unsigned char c; + e = *(in++); + i = 0; + while( (c = *(in++))!=0 ){ + if( c==1 ){ + c = *(in++) - 1; + } + out[i++] = c + e; + } + return (size_t)i; +} diff --git a/src/hlr_db_tool.c b/src/hlr_db_tool.c new file mode 100644 index 0000000..95537b8 --- /dev/null +++ b/src/hlr_db_tool.c @@ -0,0 +1,404 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "logging.h" +#include "db.h" +#include "rand.h" + +struct hlr_db_tool_ctx { + /* DB context */ + struct db_context *dbc; +}; + +struct hlr_db_tool_ctx *g_hlr_db_tool_ctx; + +static struct { + const char *db_file; + bool bootstrap; + const char *import_nitb_db; +} cmdline_opts = { + .db_file = "hlr.db", +}; + +static void print_help() +{ + printf("Usage: osmo-hlr-db-tool [-l ] [--import-nitb-db ]\n"); + printf("Call without arguments to create a new empty ./hlr.db.\n"); + printf(" -l --database db-name The OsmoHLR database to use, default '%s'.\n", + cmdline_opts.db_file); + printf(" -n --import-nitb-db db Add OsmoNITB db's subscribers to OsmoHLR db.\n"); + printf(" Be aware that the import is lossy, only the\n"); + printf(" IMSI, MSISDN, nam_cs/ps and 2G auth data are set.\n"); + printf(" -h --help This text.\n"); + printf(" -d option --debug=DMAIN:DDB:DAUC Enable debugging.\n"); + printf(" -s --disable-color Do not print ANSI colors in the log\n"); + printf(" -T --timestamp Prefix every log line with a timestamp.\n"); + printf(" -e --log-level number Set a global loglevel.\n"); + printf(" -V --version Print the version of OsmoHLR-db-tool.\n"); +} + +static void print_version(int print_copyright) +{ + printf("OsmoHLR-db-tool version %s\n", PACKAGE_VERSION); + if (print_copyright) + printf("\n" + "Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH\n" + "License AGPLv3+: GNU AGPL version 3 or later \n" + "This is free software: you are free to change and redistribute it.\n" + "There is NO WARRANTY, to the extent permitted by law.\n" + "\n"); +} + +static void handle_options(int argc, char **argv) +{ + while (1) { + int option_index = 0, c; + static struct option long_options[] = { + {"help", 0, 0, 'h'}, + {"database", 1, 0, 'l'}, + {"import-nitb-db", 1, 0, 'n'}, + {"debug", 1, 0, 'd'}, + {"disable-color", 0, 0, 's'}, + {"timestamp", 0, 0, 'T'}, + {"log-level", 1, 0, 'e'}, + {"version", 0, 0, 'V' }, + {0, 0, 0, 0} + }; + + c = getopt_long(argc, argv, "hl:n:d:sTe:V", + long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_help(); + exit(0); + case 'l': + cmdline_opts.db_file = optarg; + break; + case 'n': + cmdline_opts.import_nitb_db = optarg; + break; + case 'd': + log_parse_category_mask(osmo_stderr_target, optarg); + break; + case 's': + log_set_use_color(osmo_stderr_target, 0); + break; + case 'T': + log_set_print_timestamp(osmo_stderr_target, 1); + break; + case 'e': + log_set_log_level(osmo_stderr_target, atoi(optarg)); + break; + case 'V': + print_version(1); + exit(0); + break; + default: + /* catch unknown options *as well as* missing arguments. */ + fprintf(stderr, "Error in command line options. Exiting.\n"); + exit(-1); + break; + } + } +} + +static void signal_hdlr(int signal) +{ + switch (signal) { + case SIGINT: + LOGP(DMAIN, LOGL_NOTICE, "Terminating due to SIGINT\n"); + db_close(g_hlr_db_tool_ctx->dbc); + log_fini(); + talloc_report_full(g_hlr_db_tool_ctx, stderr); + exit(0); + break; + case SIGUSR1: + LOGP(DMAIN, LOGL_DEBUG, "Talloc Report due to SIGUSR1\n"); + talloc_report_full(g_hlr_db_tool_ctx, stderr); + break; + } +} + +sqlite3 *open_nitb_db(const char *filename) +{ + int rc; + sqlite3 *nitb_db = NULL; + + rc = sqlite3_open(filename, &nitb_db); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "Unable to open OsmoNITB DB %s; rc = %d\n", filename, rc); + return NULL; + } + + return nitb_db; +} + +enum nitb_stmt { + NITB_SELECT_SUBSCR, + NITB_SELECT_AUTH_KEYS, +}; + +static const char *nitb_stmt_sql[] = { + [NITB_SELECT_SUBSCR] = + "SELECT imsi, id, extension, authorized" + " FROM Subscriber" + " ORDER BY id", + [NITB_SELECT_AUTH_KEYS] = + "SELECT algorithm_id, a3a8_ki from authkeys" + " WHERE subscriber_id = $subscr_id", +}; + +sqlite3_stmt *nitb_stmt[ARRAY_SIZE(nitb_stmt_sql)] = {}; + +size_t _dbd_decode_binary(const unsigned char *in, unsigned char *out); + +void import_nitb_subscr_aud(sqlite3 *nitb_db, const char *imsi, int64_t nitb_id, int64_t hlr_id) +{ + int rc; + struct db_context *dbc = g_hlr_db_tool_ctx->dbc; + sqlite3_stmt *stmt; + + int count = 0; + + stmt = nitb_stmt[NITB_SELECT_AUTH_KEYS]; + if (!db_bind_int(stmt, NULL, nitb_id)) + return; + + while ((rc = sqlite3_step(stmt)) == SQLITE_ROW) { + const void *blob; + unsigned int blob_size; + static unsigned char buf[4096]; + static char ki[128]; + int decoded_size; + struct sub_auth_data_str aud2g = { + .type = OSMO_AUTH_TYPE_GSM, + .algo = OSMO_AUTH_ALG_NONE, + .u.gsm.ki = ki, + }; + + aud2g.algo = sqlite3_column_int(stmt, 0); + + if (count) { + LOGP(DDB, LOGL_ERROR, + "Warning: subscriber has more than one auth key," + " importing only the first key, for IMSI=%s\n", + imsi); + break; + } + + blob = sqlite3_column_blob(stmt, 1); + blob_size = sqlite3_column_bytes(stmt, 1); + + if (blob_size > sizeof(buf)) { + LOGP(DDB, LOGL_ERROR, + "OsmoNITB import to %s: Cannot import auth data for IMSI %s:" + " too large blob: %u\n", + dbc->fname, imsi, blob_size); + db_remove_reset(stmt); + continue; + } + + decoded_size = _dbd_decode_binary(blob, buf); + osmo_strlcpy(ki, osmo_hexdump_nospc(buf, decoded_size), sizeof(ki)); + + db_subscr_update_aud_by_id(dbc, hlr_id, &aud2g); + count ++; + } + + if (rc != SQLITE_DONE && rc != SQLITE_ROW) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB: SQL error: (%d) %s," + " during stmt '%s'", + rc, sqlite3_errmsg(nitb_db), + nitb_stmt_sql[NITB_SELECT_AUTH_KEYS]); + } + + db_remove_reset(stmt); +} + +void import_nitb_subscr(sqlite3 *nitb_db, sqlite3_stmt *stmt) +{ + struct db_context *dbc = g_hlr_db_tool_ctx->dbc; + int rc; + struct hlr_subscriber subscr; + + int64_t nitb_id; + int64_t imsi; + char imsi_str[32]; + bool authorized; + + imsi = sqlite3_column_int64(stmt, 0); + + snprintf(imsi_str, sizeof(imsi_str), "%"PRId64, imsi); + + rc = db_subscr_create(dbc, imsi_str); + if (rc) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB import to %s: failed to create IMSI %s: %d: %s\n", + dbc->fname, + imsi_str, + rc, + strerror(rc)); + /* on error, still attempt to continue */ + } + + nitb_id = sqlite3_column_int64(stmt, 1); + copy_sqlite3_text_to_buf(subscr.msisdn, stmt, 2); + authorized = sqlite3_column_int(stmt, 3) ? true : false; + + db_subscr_update_msisdn_by_imsi(dbc, imsi_str, subscr.msisdn); + db_subscr_nam(dbc, imsi_str, authorized, true); + db_subscr_nam(dbc, imsi_str, authorized, false); + + /* find the just created id */ + rc = db_subscr_get_by_imsi(dbc, imsi_str, &subscr); + if (rc) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB import to %s: created IMSI %s," + " but failed to get new subscriber id: %d: %s\n", + dbc->fname, + imsi_str, + rc, + strerror(rc)); + return; + } + + OSMO_ASSERT(!strcmp(imsi_str, subscr.imsi)); + + import_nitb_subscr_aud(nitb_db, imsi_str, nitb_id, subscr.id); +} + +int import_nitb_db(void) +{ + int i; + int ret; + int rc; + const char *sql; + sqlite3_stmt *stmt; + + sqlite3 *nitb_db = open_nitb_db(cmdline_opts.import_nitb_db); + + if (!nitb_db) + return -1; + ret = 0; + + for (i = 0; i < ARRAY_SIZE(nitb_stmt_sql); i++) { + sql = nitb_stmt_sql[i]; + rc = sqlite3_prepare_v2(nitb_db, sql, -1, &nitb_stmt[i], NULL); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB: Unable to prepare SQL statement '%s'\n", sql); + ret = -1; + goto out_free; + } + } + + stmt = nitb_stmt[NITB_SELECT_SUBSCR]; + + while ((rc = sqlite3_step(stmt)) == SQLITE_ROW) { + import_nitb_subscr(nitb_db, stmt); + /* On failure, carry on with the rest. */ + } + if (rc != SQLITE_DONE) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB: SQL error: (%d) %s," + " during stmt '%s'", + rc, sqlite3_errmsg(nitb_db), + nitb_stmt_sql[NITB_SELECT_SUBSCR]); + goto out_free; + } + + db_remove_reset(stmt); + sqlite3_finalize(stmt); + +out_free: + sqlite3_close(nitb_db); + return ret; +} + +int main(int argc, char **argv) +{ + int rc; + int (*main_action)(void); + main_action = NULL; + + g_hlr_db_tool_ctx = talloc_zero(NULL, struct hlr_db_tool_ctx); + OSMO_ASSERT(g_hlr_db_tool_ctx); + talloc_set_name_const(g_hlr_db_tool_ctx, "OsmoHLR-db-tool"); + + rc = osmo_init_logging(&hlr_log_info); + if (rc < 0) { + fprintf(stderr, "Error initializing logging\n"); + exit(1); + } + + handle_options(argc, argv); + + if (cmdline_opts.import_nitb_db) { + if (main_action) + goto too_many_actions; + main_action = import_nitb_db; + } + /* Future: add more main_actions, besides --import-nitb-db, here. */ + + /* Just in case any db actions need randomness */ + rc = rand_init(); + if (rc < 0) { + LOGP(DMAIN, LOGL_FATAL, "Error initializing random source\n"); + exit(1); + } + + g_hlr_db_tool_ctx->dbc = db_open(g_hlr_db_tool_ctx, cmdline_opts.db_file); + if (!g_hlr_db_tool_ctx->dbc) { + LOGP(DMAIN, LOGL_FATAL, "Error opening database\n"); + exit(1); + } + + osmo_init_ignore_signals(); + signal(SIGINT, &signal_hdlr); + signal(SIGUSR1, &signal_hdlr); + + rc = 0; + if (main_action) + rc = (*main_action)(); + + db_close(g_hlr_db_tool_ctx->dbc); + log_fini(); + exit(rc); + +too_many_actions: + fprintf(stderr, "Too many actions requested.\n"); + log_fini(); + exit(1); +} + +/* stubs */ +void lu_op_alloc_conn(void) { OSMO_ASSERT(0); } +void lu_op_tx_del_subscr_data(void) { OSMO_ASSERT(0); } +void lu_op_free(void) { OSMO_ASSERT(0); } -- To view, visit https://gerrit.osmocom.org/4441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 02:10:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 02:10:19 +0000 Subject: [PATCH] osmo-hlr[master]: fix default logging levels to NOTICE, not DEBUG Message-ID: Review at https://gerrit.osmocom.org/4442 fix default logging levels to NOTICE, not DEBUG Tweak unit test binaries to still used DEBUG loglevels, so that their expected outputs remain unchanged (and nicely verbose). Adjust test_nodes.vty, now expecting the 'notice' log levels upon 'show running-config'. Change-Id: Ic061e61c9625b49cef8bc2a2c0b936e262c22268 --- M src/logging.c M tests/auc/auc_test.c M tests/auc/gen_ts_55_205_test_sets/main_template.c M tests/db/db_test.c M tests/test_nodes.vty 5 files changed, 9 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/42/4442/1 diff --git a/src/logging.c b/src/logging.c index 9b8de45..f81781d 100644 --- a/src/logging.c +++ b/src/logging.c @@ -5,19 +5,19 @@ [DMAIN] = { .name = "DMAIN", .description = "Main Program", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DDB] = { .name = "DDB", .description = "Database Layer", .color = "\033[1;31m", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DAUC] = { .name = "DAUC", .description = "Authentication Center", .color = "\033[1;33m", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, }; diff --git a/tests/auc/auc_test.c b/tests/auc/auc_test.c index f047a97..e9c114c 100644 --- a/tests/auc/auc_test.c +++ b/tests/auc/auc_test.c @@ -615,6 +615,7 @@ log_set_print_timestamp(osmo_stderr_target, 0); log_set_use_color(osmo_stderr_target, 0); log_set_print_category(osmo_stderr_target, 1); + log_parse_category_mask(osmo_stderr_target, "DMAIN,1:DDB,1:DAUC,1"); test_gen_vectors_2g_only(); test_gen_vectors_2g_plus_3g(); diff --git a/tests/auc/gen_ts_55_205_test_sets/main_template.c b/tests/auc/gen_ts_55_205_test_sets/main_template.c index e917e71..37f47c3 100644 --- a/tests/auc/gen_ts_55_205_test_sets/main_template.c +++ b/tests/auc/gen_ts_55_205_test_sets/main_template.c @@ -107,6 +107,7 @@ log_set_print_timestamp(osmo_stderr_target, 0); log_set_use_color(osmo_stderr_target, 0); log_set_print_category(osmo_stderr_target, 1); + log_parse_category_mask(osmo_stderr_target, "DMAIN,1:DDB,1:DAUC,1"); FUNCTION_CALLS diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 0a53370..389ed00 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -816,6 +816,7 @@ log_set_print_timestamp(osmo_stderr_target, 0); log_set_use_color(osmo_stderr_target, 0); log_set_print_category(osmo_stderr_target, 1); + log_parse_category_mask(osmo_stderr_target, "DMAIN,1:DDB,1:DAUC,1"); /* omit the SQLite version and compilation flags from test output */ log_set_log_level(osmo_stderr_target, LOGL_ERROR); diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty index 0de4ff4..6de673a 100644 --- a/tests/test_nodes.vty +++ b/tests/test_nodes.vty @@ -101,9 +101,9 @@ logging print category 1 logging print extended-timestamp 1 logging level all debug - logging level main debug - logging level db debug - logging level auc debug + logging level main notice + logging level db notice + logging level auc notice ... ! line vty -- To view, visit https://gerrit.osmocom.org/4442 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic061e61c9625b49cef8bc2a2c0b936e262c22268 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 07:47:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 27 Oct 2017 07:47:51 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 8 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 07:49:08 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 27 Oct 2017 07:49:08 +0000 Subject: meta-telephony[laforge/nightly]: openbsc.git: Upstream binary now named osmo-bsc-sccplite In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e3bf1d6186fb32f4d671cbf84cad195d2776190 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 08:40:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 08:40:53 +0000 Subject: meta-telephony[laforge/nightly]: openbsc.git: Upstream binary now named osmo-bsc-sccplite In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e3bf1d6186fb32f4d671cbf84cad195d2776190 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 08:40:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 08:40:55 +0000 Subject: [MERGED] meta-telephony[laforge/nightly]: openbsc.git: Upstream binary now named osmo-bsc-sccplite In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: openbsc.git: Upstream binary now named osmo-bsc-sccplite ...................................................................... openbsc.git: Upstream binary now named osmo-bsc-sccplite In Change-Id If10d1599b62d010726336134091a4e855c380d93, upstream osmocom.git has renamed osmo-bsc (and related config files, etc) to osmo-bsc-sccplite, so we don't have to rename it in the recipe anymore. Change-Id: I7e3bf1d6186fb32f4d671cbf84cad195d2776190 --- M recipes-osmocom/openbsc/openbsc.inc 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/recipes-osmocom/openbsc/openbsc.inc b/recipes-osmocom/openbsc/openbsc.inc index e04911d..3c1b98f 100644 --- a/recipes-osmocom/openbsc/openbsc.inc +++ b/recipes-osmocom/openbsc/openbsc.inc @@ -11,7 +11,7 @@ file://osmo-bsc-sccplite.service \ " -INC_PR = "r23.${META_TELEPHONY_OSMO_INC}" +INC_PR = "r24.${META_TELEPHONY_OSMO_INC}" EXTRA_OECONF += "--enable-osmo-bsc --enable-mgcp-transcoding --with-g729" @@ -26,7 +26,7 @@ do_install_append() { install -d ${D}${sysconfdir}/osmocom install -m 0660 ${S}/doc/examples/osmo-nitb/nanobts/openbsc.cfg ${D}${sysconfdir}/osmocom/osmo-nitb.cfg - install -m 0660 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg + install -m 0660 ${S}/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg # Install sysv-init files install -d ${D}${sysconfdir}/init.d @@ -41,7 +41,6 @@ install -d ${D}/var/lib/osmocom - mv ${D}${bindir}/osmo-bsc ${D}${bindir}/osmo-bsc-sccplite } PACKAGES =+ "osmo-bsc-sccplite osmo-nitb" -- To view, visit https://gerrit.osmocom.org/4435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7e3bf1d6186fb32f4d671cbf84cad195d2776190 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 27 09:22:22 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Oct 2017 09:22:22 +0000 Subject: [PATCH] osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4334 to look at the new patch set (#7). mgcp: use osmo-mgw to switch RTP streams osmo-bsc currently negotiates the RTP stream directly with the BTS and reports back the RTP IP/Port on the BTS. This works fine for a single BTS, but for Handover the port/ip pointing to the MSC side must not change, so an entity in between the BTSs and the MSC is required. Integrate the mgcp-client and use osmo-mgw to switch the RTP streams. TODO: Handover will not work yet, because there is no functionality to update the connection with the port/ip of the new BTS. Depends: osmo-mgw Ib5fcc72775bf72b489ff79ade36fb345d8d20736 Depends: osmo-mgw I44b338b09de45e1675cedf9737fa72dde72e979a Depends: osmo-mgw I29c5e2fb972896faeb771ba040f015592487fcbe Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/osmo_bsc.h A include/osmocom/bsc/osmo_bsc_mgcp.h M src/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c A src/osmo-bsc/osmo_bsc_mgcp.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c 13 files changed, 1,037 insertions(+), 65 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/34/4334/7 diff --git a/configure.ac b/configure.ac index 4edbb83..f73f33c 100644 --- a/configure.ac +++ b/configure.ac @@ -47,8 +47,9 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) +PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 1.0.0) dnl checks for header files AC_HEADER_STDC @@ -135,7 +136,6 @@ src/libfilter/Makefile src/libcommon-cs/Makefile src/osmo-bsc/Makefile - src/osmo-bsc_nat/Makefile src/ipaccess/Makefile src/utils/Makefile tests/Makefile diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 8ad2b5d..1f7cd39 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -41,6 +41,7 @@ openbscdefines.h \ osmo_bsc.h \ osmo_bsc_grace.h \ + osmo_bsc_mgcp.h \ osmo_bsc_rf.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 51b2c98..5cb7efd 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -479,6 +479,11 @@ uint8_t t3212; struct { + struct mgcp_client_conf *conf; + struct mgcp_client *client; + } mgw; + + struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; /* A list with the context information about diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h index 5ebea50..8a5cd30 100644 --- a/include/osmocom/bsc/osmo_bsc.h +++ b/include/osmocom/bsc/osmo_bsc.h @@ -29,6 +29,20 @@ uint32_t rtp_ip; int rtp_port; + /* RTP address of the remote end (assigned by MSC through assignment + * request) */ + struct sockaddr_storage aoip_rtp_addr_remote; + + /* Local RTP address (reported back to the MSC by us with the + * assignment complete message) */ + struct sockaddr_storage aoip_rtp_addr_local; + + /* storage to keep states of the MGCP connection handler, the + * handler is created when an assignment request is received + * and is terminated when the assignment complete message is + * sent */ + struct mgcp_ctx *mgcp_ctx; + /* for advanced ping/pong */ int send_ping; @@ -72,4 +86,6 @@ struct llist_head *bsc_access_lists(void); +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan); + #endif diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h new file mode 100644 index 0000000..7246dda --- /dev/null +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -0,0 +1,45 @@ +/* (C) 2017 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +/* MGCP state handler context (fsm etc..) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* RTP endpoint number */ + uint16_t rtp_endpoint; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct mgcp_client *mgcp; + + struct osmo_bsc_sccp_con *conn; + enum gsm48_chan_mode chan_mode; + bool full_rate; + struct gsm_lchan *lchan; + struct msgb *resp; +}; + +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct mgcp_client *mgcp, struct osmo_bsc_sccp_con *conn, + enum gsm48_chan_mode chan_mode, bool full_rate); +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan); diff --git a/src/Makefile.am b/src/Makefile.am index d04f025..dd1ad3d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,5 +33,4 @@ utils \ ipaccess \ osmo-bsc \ - osmo-bsc_nat \ $(NULL) diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index dfc4def..7db698c 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -15,6 +15,7 @@ $(COVERAGE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -30,6 +31,7 @@ osmo_bsc_vty.c \ osmo_bsc_api.c \ osmo_bsc_grace.c \ + osmo_bsc_mgcp.c \ osmo_bsc_msc.c \ osmo_bsc_sigtran.c \ osmo_bsc_filter.c \ @@ -53,4 +55,5 @@ $(COVERAGE_LDFLAGS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(NULL) diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index 94aa350..326703d 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -29,46 +29,9 @@ #include #include #include +#include #include - -/* Generate and send assignment complete message */ -static int send_aoip_ass_compl(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan) -{ - struct msgb *resp; - struct sockaddr_storage rtp_addr; - struct sockaddr_in rtp_addr_in; - struct gsm0808_speech_codec sc; - - OSMO_ASSERT(lchan->abis_ip.ass_compl.valid == true); - - /* Package RTP-Address data */ - memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); - rtp_addr_in.sin_family = AF_INET; - rtp_addr_in.sin_port = htons(lchan->abis_ip.bound_port); - rtp_addr_in.sin_addr.s_addr = htonl(lchan->abis_ip.bound_ip); - memset(&rtp_addr, 0, sizeof(rtp_addr)); - memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); - - /* Extrapolate speech codec from speech mode */ - gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); - - /* Generate message */ - resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, - lchan->abis_ip.ass_compl.chosen_channel, - lchan->abis_ip.ass_compl.encr_alg_id, - lchan->abis_ip.ass_compl.speech_mode, - &rtp_addr, - &sc, - NULL); - - if (!resp) { - LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message!\n"); \ - return -EINVAL; - } - - return osmo_bsc_sigtran_send(conn->sccp_con, resp); -} static int handle_abisip_signal(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) @@ -124,11 +87,9 @@ * IPA based base stations. See also osmo_bsc_api.c, * function bsc_assign_compl() */ LOGP(DMSC, LOGL_INFO, "Tx MSC ASSIGN COMPL (POSTPONED)\n"); - if (send_aoip_ass_compl(con, lchan) != 0) - return -EINVAL; + mgcp_ass_complete(con->sccp_con->mgcp_ctx, lchan); } break; - break; } return 0; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 4311250..e474b98 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -321,14 +322,29 @@ conn->conn = NULL; } - /* send the clear complete message */ + /* generate the clear complete message */ resp = gsm0808_create_clear_complete(); if (!resp) { LOGP(DMSC, LOGL_ERROR, "Sending clear complete failed.\n"); return -1; } - osmo_bsc_sigtran_send(conn, resp); + if (conn->mgcp_ctx) { + /* NOTE: This is the AoIP case, osmo-bsc has to negotiate with + * the MGCP-GW. For this an mgcp_ctx should be created that + * contains the FSM and some system data. When the connection + * is removed from the MGCP-GW, then osmo_bsc_sigtran_send() + * calls osmo_bsc_sigtran_send(). */ + mgcp_clear_complete(conn->mgcp_ctx, resp); + conn->mgcp_ctx = NULL; + } else { + /* NOTE: This is the SCCP-Lite case, since we do not handle + * the MGCP-GW switching ourselves, we may skip everything + * that is MGCP-GW related and sent the clear complete message + * directly */ + osmo_bsc_sigtran_send(conn, resp); + } + return 0; } @@ -426,7 +442,6 @@ int port, full_rate = -1; bool aoip = false; struct sockaddr_storage rtp_addr; - struct sockaddr_in *rtp_addr_in; struct gsm0808_channel_type ct; struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; @@ -531,28 +546,39 @@ get_value_string(gsm48_chan_mode_names, chan_mode), ct.ch_indctr, ct.ch_rate_type, osmo_hexdump(ct.perm_spch, ct.perm_spch_len)); - if (aoip == false) { - /* map it to a MGCP Endpoint and a RTP port */ + /* Forward the assingment request to lower layers */ + if (aoip) { + /* Store network side RTP connection information, we will + * process this address later after we have established an RTP + * connection to the BTS. This is just for organizational + * reasons, functional wise it would not matter when exactly + * the network side RTP connection is made, as long it is made + * before we return with the assignment complete message. */ + memcpy(&conn->aoip_rtp_addr_remote, &rtp_addr, sizeof(rtp_addr)); + + /* Create an assignment request using the MGCP fsm. This FSM + * is directly started when its created (now) and will also + * take care about the further processing (creating RTP + * endpoints, calling gsm0808_assign_req(), rsponding to + * the assignment request etc... */ + conn->mgcp_ctx = mgcp_assignm_req(msc->network, msc->network->mgw.client, conn, chan_mode, full_rate); + if (!conn->mgcp_ctx) { + LOGP(DMSC, LOGL_ERROR, "MGCP GW failure, rejecting assignment... (id=%i)\n", conn->conn_id); + goto reject; + } + + /* We now may return here, the FSM will do all further work */ + return 0; + } else { + /* Note: In the sccp-lite case we to not perform any mgcp operation, + * (the MSC does that for us). We set conn->rtp_ip to 0 and check + * on this later. By this we know that we have to behave accordingly + * to sccp-lite. */ port = mgcp_timeslot_to_endpoint(multiplex, timeslot); conn->rtp_port = rtp_calculate_port(port, msc->rtp_base); conn->rtp_ip = 0; - } else { - /* use address / port supplied with the AoIP - * transport address element */ - if (rtp_addr.ss_family == AF_INET) { - rtp_addr_in = (struct sockaddr_in *)&rtp_addr; - conn->rtp_port = osmo_ntohs(rtp_addr_in->sin_port); - memcpy(&conn->rtp_ip, &rtp_addr_in->sin_addr.s_addr, - IP_V4_ADDR_LEN); - conn->rtp_ip = osmo_ntohl(conn->rtp_ip); - } else { - LOGP(DMSC, LOGL_ERROR, - "Unsopported addressing scheme. (supports only IPV4)\n"); - goto reject; - } + return gsm0808_assign_req(conn->conn, chan_mode, full_rate); } - - return gsm0808_assign_req(conn->conn, chan_mode, full_rate); reject: resp = @@ -729,3 +755,39 @@ return -1; } + +/* Generate and send assignment complete message */ +int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan) +{ + struct msgb *resp; + struct gsm0808_speech_codec sc; + struct gsm_subscriber_connection *conn; + + conn = lchan->conn; + + OSMO_ASSERT(lchan->abis_ip.ass_compl.valid); + OSMO_ASSERT(conn); + OSMO_ASSERT(conn->sccp_con); + + LOGP(DMSC, LOGL_DEBUG, "Sending assignment complete message... (id=%i)\n", conn->sccp_con->conn_id); + + /* Extrapolate speech codec from speech mode */ + gsm0808_speech_codec_from_chan_type(&sc, lchan->abis_ip.ass_compl.speech_mode); + + /* Generate message */ + resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause, + lchan->abis_ip.ass_compl.chosen_channel, + lchan->abis_ip.ass_compl.encr_alg_id, + lchan->abis_ip.ass_compl.speech_mode, + &conn->sccp_con->aoip_rtp_addr_local, + &sc, + NULL); + + if (!resp) { + LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message! (id=%i)\n", + conn->sccp_con->conn_id); + return -EINVAL; + } + + return osmo_bsc_sigtran_send(conn->sccp_con, resp); +} diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 730e1db..5d25701 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -44,6 +44,7 @@ #include #include +#include #define _GNU_SOURCE #include @@ -206,6 +207,9 @@ exit(1); } + bsc_gsmnet->mgw.conf = talloc_zero(bsc_gsmnet, struct mgcp_client_conf); + mgcp_client_conf_init(bsc_gsmnet->mgw.conf); + bts_init(); libosmo_abis_init(tall_bsc_ctx); @@ -274,6 +278,15 @@ } } + bsc_gsmnet->mgw.client = mgcp_client_init(bsc_gsmnet, bsc_gsmnet->mgw.conf); + + if (mgcp_client_connect(bsc_gsmnet->mgw.client)) { + LOGP(DNM, LOGL_ERROR, "MGW connect failed at (%s:%u)\n", + bsc_gsmnet->mgw.conf->remote_addr, + bsc_gsmnet->mgw.conf->remote_port); + exit(1); + } + if (osmo_bsc_sigtran_init(&bsc_gsmnet->bsc_data->mscs) != 0) { LOGP(DNM, LOGL_ERROR, "Failed to initalize sigtran backhaul.\n"); exit(1); diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c new file mode 100644 index 0000000..1805915 --- /dev/null +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -0,0 +1,860 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define CONN_ID_BTS 1 +#define CONN_ID_NET 2 + +#define MGCP_MGW_TIMEOUT 4 /* in seconds */ +#define MGCP_MGW_TIMEOUT_TIMER_NR 1 +#define MGCP_BSS_TIMEOUT 4 /* in seconds */ +#define MGCP_BSS_TIMEOUT_TIMER_NR 2 + +#define MGCP_ENDPOINT_FORMAT "%i at mgw" + +/* Some internal cause codes to indicate fault + * condition inside the FSM */ +enum int_cause_code { + MGCP_ERR_MGW_FAIL, + MGCP_ERR_MGW_INVAL_RESP, + MGCP_ERR_MGW_TX_FAIL, + MGCP_ERR_UNEXP_TEARDOWN, + MGCP_ERR_ASSGMNT_FAIL, + MGCP_ERR_UNSUPP_ADDR_FMT, + MGCP_ERR_BSS_TIMEOUT +}; + +/* Human readable respresentation of the faul codes, + * will be displayed by handle_error() */ +static const struct value_string int_cause_codes_str[] = { + {MGCP_ERR_MGW_FAIL, "operation failed on MGW"}, + {MGCP_ERR_MGW_INVAL_RESP, "invalid / unparseable response from MGW"}, + {MGCP_ERR_MGW_INVAL_RESP, "failed to transmit MGCP message to MGW"}, + {MGCP_ERR_UNEXP_TEARDOWN, "unexpected connection teardown (BSS)"}, + {MGCP_ERR_ASSGMNT_FAIL, "assignment failure (BSS)"}, + {MGCP_ERR_UNSUPP_ADDR_FMT, "unsupported network address format used (BSS)"}, + {MGCP_ERR_BSS_TIMEOUT, "assignment could not be completed in time (BSS)"}, + {0, NULL} +}; + +enum fsm_bsc_mgcp_states { + ST_CRCX_BTS, + ST_ASSIGN_PROC, + ST_MDCX_BTS, + ST_CRCX_NET, + ST_ASSIGN_COMPL, + ST_DLCX, + ST_HALT +}; + +static const struct value_string fsm_bsc_mgcp_state_names[] = { + {ST_CRCX_BTS, "ST_CRCX_BTS (send CRCX for BTS)"}, + {ST_ASSIGN_PROC, "ST_ASSIGN_PROC (continue assignment)"}, + {ST_MDCX_BTS, "ST_MDCX_BTS (send MDCX for BTS)"}, + {ST_CRCX_NET, "ST_CRCX_NET (send CRCX for NET)"}, + {ST_ASSIGN_COMPL, "ST_ASSIGN_COMPL (complete assignment)"}, + {ST_DLCX, "ST_DLCX (delete all rtp connections)"}, + {ST_HALT, "ST_HALT (destroy state machine)"}, + {0, NULL} +}; + +enum fsm_evt { + /* Initial event: start off the state machine */ + EV_INIT, + + /* External event: Assignment complete, event is issued shortly before + * the assignment complete message is sent via the A-Interface */ + EV_ASS_COMPLETE, + + /* External event: Teardown event, this event is used to notify the end + * of a. It is also issued in case of errors to teardown a half open + * connection. */ + EV_TEARDOWN, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the BTS side */ + EV_CRCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the BTS side */ + EV_MDCX_BTS_RESP, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the NET side */ + EV_CRCX_NET_RESP, + + /* Internal event: The mgcp_gw has sent its DLCX response for + * the NET and BTS side */ + EV_DLCX_ALL_RESP, +}; + +static const struct value_string fsm_evt_names[] = { + {EV_INIT, "EV_INIT (start state machine (send CRCX for BTS)"}, + {EV_ASS_COMPLETE, "EV_ASS_COMPLETE (assignment complete)"}, + {EV_TEARDOWN, "EV_TEARDOWN (teardown all connections)"}, + {EV_CRCX_BTS_RESP, "EV_CRCX_BTS_RESP (got CRCX reponse for BTS)"}, + {EV_MDCX_BTS_RESP, "EV_MDCX_BTS_RESP (got MDCX reponse for BTS)"}, + {EV_CRCX_NET_RESP, "EV_CRCX_NET_RESP (got CRCX reponse for NET)"}, + {EV_DLCX_ALL_RESP, "EV_DLCX_ALL_RESP (got DLCX reponse for BTS/NET)"}, + {0, NULL} +}; + +/* A general error handler function. On error we still have an interest to + * remove a half open connection (if possible). This function will execute + * a controlled jump to the DLCX phase. From there, the FSM will then just + * continue like the call were ended normally */ +static void handle_error(struct mgcp_ctx *mgcp_ctx, enum int_cause_code cause) +{ + struct osmo_fsm_inst *fi; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + fi = mgcp_ctx->fsm; + OSMO_ASSERT(fi); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "fsm-state: %s\n", get_value_string(fsm_bsc_mgcp_state_names, fi->state)); + + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "%s -- graceful shutdown...\n", + get_value_string(int_cause_codes_str, cause)); + + /* Set the VM into the state where it waits for the call end */ + osmo_fsm_inst_state_chg(fi, ST_DLCX, 0, 0); + + /* Simulate the call end by sending a teardown event, so that + * the FSM proceeds directly with the DLCX */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_BTS: startup state machine send out CRCX for BTS side */ +static void fsm_crcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_client_next_endpoint(mgcp); + mgcp_ctx->rtp_endpoint = rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "creating connection for the BTS side on " "MGW endpoint:%x...\n", rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = conn->conn_id, + .conn_id = CONN_ID_BTS, + .conn_mode = MGCP_CONN_LOOPBACK + }; + snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/BTS: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, crcx_for_bts_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_PROC, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for BTS associated CRCX */ +static void crcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/BTS: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/BTS: Cannot parse response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/BTS: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + /* Set the connection details in the conn struct. The code that + * controls the BTS via RSL will take these values and signal them + * to the BTS via RSL/IPACC */ + conn->rtp_port = r->audio_port; + conn->rtp_ip = osmo_ntohl(inet_addr(r->audio_ip)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_BTS_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_PROC: An mgcp response has been received, proceed + * with the assignment request */ +static void fsm_proc_assignmnent_req_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + enum gsm48_chan_mode chan_mode; + bool full_rate; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + switch (event) { + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + case EV_CRCX_BTS_RESP: + break; + } + + OSMO_ASSERT(conn->conn); + chan_mode = mgcp_ctx->chan_mode; + full_rate = mgcp_ctx->full_rate; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MGW proceeding assignment request...\n"); + rc = gsm0808_assign_req(conn->conn, chan_mode, full_rate); + + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_ASSGMNT_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_BTS, MGCP_BSS_TIMEOUT, MGCP_BSS_TIMEOUT_TIMER_NR); +} + +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_BTS: When the BSS has completed the assignment, + * proceed with updating the connection for the BTS side */ +static void fsm_mdcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + struct in_addr addr; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + switch (event) { + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + case EV_ASS_COMPLETE: + break; + } + + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "BSS has completed the assignment, now prceed with MDCX towards BTS...\n"); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "completing connection for the BTS side on " "MGW endpoint:%x...\n", rtp_endpoint); + + addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "BTS expects RTP input on address %s:%u\n", inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = conn->conn_id, + .conn_id = CONN_ID_BTS, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = inet_ntoa(addr), + .audio_port = lchan->abis_ip.bound_port + }; + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MDCX/BTS: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, mdcx_for_bts_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_CRCX_NET, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for BTS associated MDCX */ +static void mdcx_for_bts_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct in_addr addr; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "MDCX/BTS: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "MDCX/BTS: Cannot parse MDCX response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MDCX/BTS: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + addr.s_addr = lchan->abis_ip.bound_ip; + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "MDCX/BTS: corresponding lchan has been bound to address %s:%u\n", + inet_ntoa(addr), lchan->abis_ip.bound_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_BTS_RESP, mgcp_ctx); +} + +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_NET: An mgcp response has been received, proceed... */ +static void fsm_crcx_net_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + struct sockaddr_in *sin; + char *addr; + uint16_t port; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "creating connection for the NET side on " "MGW endpoint:%x...\n", rtp_endpoint); + + /* Currently we only have support for IPv4 in our MGCP software, the + * AoIP part is ready to support IPv6 in theory, because the IE + * parser/generator uses sockaddr_storage for the AoIP transport + * identifier. However, the MGCP-GW does not support IPv6 yet. This is + * why we stop here in case some MSC tries to signal IPv6 AoIP + * transport identifiers */ + if (conn->aoip_rtp_addr_remote.ss_family != AF_INET) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "endpoint:%x MSC uses unsupported address format in AoIP transport identifier -- aborting...\n", + rtp_endpoint); + handle_error(mgcp_ctx, MGCP_ERR_UNSUPP_ADDR_FMT); + return; + } + + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_remote; + addr = inet_ntoa(sin->sin_addr); + port = osmo_ntohs(sin->sin_port); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MSC expects RTP input on address %s:%u\n", addr, port); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = conn->conn_id, + .conn_id = CONN_ID_NET, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = addr, + .audio_port = port + }; + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/NET: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, crcx_for_net_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_ASSIGN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void crcx_for_net_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct osmo_bsc_sccp_con *conn; + struct gsm_lchan *lchan; + struct sockaddr_in *sin; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/NET: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/NET: Cannot parse CRCX response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/NET: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + /* Store address */ + sin = (struct sockaddr_in *)&conn->aoip_rtp_addr_local; + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = inet_addr(r->audio_ip); + sin->sin_port = osmo_ntohs(r->audio_port); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_NET_RESP, mgcp_ctx); +} + +/* Callback for ST_ASSIGN_COMPL: Send back assignment complete and wait until the call ends */ +static void fsm_send_assignment_complete(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct gsm_lchan *lchan; + + OSMO_ASSERT(mgcp_ctx); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + switch (event) { + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + case EV_CRCX_NET_RESP: + break; + } + + lchan = mgcp_ctx->lchan; + OSMO_ASSERT(lchan); + + /* Send assignment completion message via AoIP, this will complete + * the circuit. The message will also contain the port and IP-Address + * where the MGW expects the RTP input from the MSC side */ + bssmap_send_aoip_ass_compl(lchan); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "call in progress, waiting for call end...\n"); + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_DLCX, 0, 0); +} + +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_DLCX: Remove connection for the BTS and NET side. */ +static void fsm_dlcx_all_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct osmo_bsc_sccp_con *conn; + struct msgb *msg; + struct mgcp_msg mgcp_msg; + struct mgcp_client *mgcp; + uint16_t rtp_endpoint; + int rc; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + rtp_endpoint = mgcp_ctx->rtp_endpoint; + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "removing connection for the BTS and NET side on " "MGW endpoint:%x...\n", rtp_endpoint); + + /* We now relase the endpoint back to the pool in order to allow + * other connections to use this endpoint */ + mgcp_client_release_endpoint(rtp_endpoint, mgcp); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_DLCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID), + .call_id = conn->conn_id + }; + snprintf(mgcp_msg.endpoint, sizeof(mgcp_msg.endpoint), MGCP_ENDPOINT_FORMAT, rtp_endpoint); + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "DLCX: transmitting MGCP message to MGW...\n"); + rc = mgcp_client_tx(mgcp, msg, dlcx_for_all_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(mgcp_ctx->fsm, ST_HALT, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for NET associated CRCX */ +static void dlcx_for_all_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + struct osmo_bsc_sccp_con *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + /* Note: We check the return code, but in case of an error there is + * not much that can be done to recover. However, at least we tryed + * to remove the connection (if there was even any) */ + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "DLCX: response yields error: %d %s\n", r->head.response_code, r->head.comment); + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "DLCX: MGW has acknowledged the removal of the connections\n"); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_DLCX_ALL_RESP, mgcp_ctx); +} + +/* Callback for ST_HALT: Terminate the state machine */ +static void fsm_halt_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct osmo_bsc_sccp_con *conn; + + OSMO_ASSERT(mgcp_ctx); + conn = mgcp_ctx->conn; + OSMO_ASSERT(conn); + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, + "fsm-state: %s, fsm-event: %s\n", + get_value_string(fsm_bsc_mgcp_state_names, fi->state), get_value_string(fsm_evt_names, event)); + + /* Send pending sigtran message */ + if (mgcp_ctx->resp) { + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "sending pending sigtran response message...\n"); + osmo_bsc_sigtran_send(conn, mgcp_ctx->resp); + mgcp_ctx->resp = NULL; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "state machine halted\n"); + + /* Destroy the state machine and all context information */ + osmo_fsm_inst_free(mgcp_ctx->fsm); + talloc_free(mgcp_ctx); +} + +/* Timer callback to shut down in case of connectivity problems */ +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "timeout (T%i) in state %s, attempting graceful teardown...\n", + fi->T, get_value_string(fsm_bsc_mgcp_state_names, fi->state)); + + /* Ensure that no sigtran response, is present. Otherwiese we might try + * to send a sigtran response when the sccp connection is already freed. */ + mgcp_ctx->resp = NULL; + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NR) { + /* Note: We were unable to communicate with the MGCP-GW, + * unfortunately there is no meaningful action we can take + * now other than giving up. */ + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "graceful teardown not possible, terminating...\n"); + + /* At least release the occupied endpoint ID */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); + } else if (fi->T == MGCP_BSS_TIMEOUT_TIMER_NR) + /* Note: If the logic that controls the BSS is unable to + * negotiate a connection, we presumably still have a + * working connection to the MGCP-GW, we will try to + * shut down gracefully. */ + handle_error(mgcp_ctx, MGCP_ERR_BSS_TIMEOUT); + else { + /* Note: Ther must not be any unsolicited timers + * in this FSM. If so, we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static struct osmo_fsm_state fsm_bsc_mgcp_states[] = { + + /* Startup state machine, send CRCX to BTS. */ + [ST_CRCX_BTS] = { + .in_event_mask = (1 << EV_INIT), + .out_state_mask = (1 << ST_ASSIGN_PROC), + .name = "ST_CRCX_BTS", + .action = fsm_crcx_bts_cb, + }, + + /* When the CRCX response for the BTS side is received, then + * proceed the assignment on the BSS side. */ + [ST_ASSIGN_PROC] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_MDCX_BTS), + .name = "ST_ASSIGN_PROC", + .action = fsm_proc_assignmnent_req_cb, + }, + + /* When the BSS has processed the assignment request, + * then send the MDCX command for the BTS side in order to + * update the connections with the actual PORT/IP where the + * BTS expects the RTP input. */ + [ST_MDCX_BTS] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_ASS_COMPLETE), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_CRCX_NET), + .name = "ST_MDCX_BTS", + .action = fsm_mdcx_bts_cb, + }, + + /* When the MDCX response for the BTS siede is received, then + * directly proceed with sending the CRCX command to connect the + * network side. This is done in one phase (no MDCX needed). */ + [ST_CRCX_NET] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_MDCX_BTS_RESP), + .out_state_mask = (1 << ST_DLCX) | (1 << ST_ASSIGN_COMPL), + .name = "ST_CRCX_NET", + .action = fsm_crcx_net_cb, + }, + + /* When the CRCX response for the NET side is received. Then + * send the assignment complete message via the A-Interface and + * enter wait state in order to wait for the end of the call. */ + [ST_ASSIGN_COMPL] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_CRCX_NET_RESP), + .out_state_mask = (1 << ST_DLCX), + .name = "ST_ASSIGN_COMPL", + .action = fsm_send_assignment_complete, + }, + + /* When the call ends, remove all RTP connections from the + * MGCP-GW by sending a wildcarded DLCX. */ + [ST_DLCX] = { + .in_event_mask = (1 << EV_TEARDOWN), + .out_state_mask = (1 << ST_HALT), + .name = "ST_DLCX", + .action = fsm_dlcx_all_cb, + }, + + /* When the MGCP_GW confirms that the connections are terminated, + * then halt the state machine. */ + [ST_HALT] = { + .in_event_mask = (1 << EV_TEARDOWN) | (1 << EV_DLCX_ALL_RESP), + .out_state_mask = 0, + .name = "ST_HALT", + .action = fsm_halt_cb, + }, +}; + +/* State machine definition */ +static struct osmo_fsm fsm_bsc_mgcp = { + .name = "MGW", + .states = fsm_bsc_mgcp_states, + .num_states = ARRAY_SIZE(fsm_bsc_mgcp_states), + .log_subsys = DMGCP, + .timer_cb = fsm_timeout_cb, +}; + +/* Notify that the a new call begins. This will create a connection for the + * BTS on the MGCP-GW and set up the port numbers in struct osmo_bsc_sccp_con. + * After that gsm0808_assign_req() to proceed. + * Parameter: + * ctx: talloc context + * network: associated gsm network + * conn: associated sccp connection + * chan_mode: channel mode (system data, passed through) + * full_rate: full rate flag (system data, passed through) + * Returns an mgcp_context that contains system data and the OSMO-FSM */ +struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct mgcp_client *mgcp, struct osmo_bsc_sccp_con *conn, + enum gsm48_chan_mode chan_mode, bool full_rate) +{ + struct mgcp_ctx *mgcp_ctx; + char name[32]; + static bool fsm_registered = false; + + OSMO_ASSERT(mgcp); + OSMO_ASSERT(conn); + + /* Register the fsm description (if not already done) */ + if (fsm_registered == false) { + osmo_fsm_register(&fsm_bsc_mgcp); + fsm_registered = true; + } + + /* Allocate and configure a new fsm instance */ + mgcp_ctx = talloc_zero(ctx, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + + snprintf(name, sizeof(name), "MGW_%i", conn->conn_id); + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm_bsc_mgcp, NULL, ctx, LOGL_DEBUG, name); + OSMO_ASSERT(mgcp_ctx->fsm); + mgcp_ctx->fsm->priv = mgcp_ctx; + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "MGW handler fsm created\n"); + mgcp_ctx->mgcp = mgcp; + mgcp_ctx->conn = conn; + mgcp_ctx->chan_mode = chan_mode; + mgcp_ctx->full_rate = full_rate; + + /* start state machine */ + OSMO_ASSERT(mgcp_ctx->fsm->state == ST_CRCX_BTS) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_INIT, mgcp_ctx); + + return mgcp_ctx; +} + +/* Notify that the call has ended, remove all connections from the MGCP-GW, + * then send the clear complete message and destroy the FSM instance + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * respmgcp_ctx: pending clear complete message to send via A-Interface */ +void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(resp); + + mgcp_ctx->resp = resp; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); +} + +/* Notify that the BSS ready, send the assingnment complete message when the + * mgcp connection is completed + * Parameter: + * mgcp_ctx: context information (FSM, and pointer to external system data) + * lchan: needed for sending the assignment complete message via A-Interface */ +void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan) +{ + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(lchan); + + mgcp_ctx->lchan = lchan; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASS_COMPLETE, mgcp_ctx); + + return; +} diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 951061a..59f5b3b 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -33,6 +33,7 @@ #include #include #include +#include /* A pointer to a list with all involved MSCs * (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */ diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index b5232c4..78fce4c 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include @@ -972,6 +974,8 @@ int bsc_vty_init_extra(void) { + struct gsm_network *net = bsc_gsmnet; + install_element(CONFIG_NODE, &cfg_net_msc_cmd); install_element(CONFIG_NODE, &cfg_net_bsc_cmd); @@ -1036,5 +1040,7 @@ install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); + mgcp_client_vty_init(net, MSC_NODE, net->mgw.conf); + return 0; } -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Oct 27 09:27:24 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Oct 2017 09:27:24 +0000 Subject: osmo-bsc[master]: osmo-bsc MGCP and RESET FSMs: use distinct struct names In-Reply-To: References: Message-ID: Patch Set 1: > > space in the name > > I think it would be nice to merge this patch into dexter's 4334, > submitted this mostly to share code I guess. I have integrated the changes that affect osmo_bsc_mgcp.c. I suggest to drop osmo_bsc_mgcp.c from this patch and keep the changes for osmo_bsc_reset.c. -- To view, visit https://gerrit.osmocom.org/4375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I986377a74ccd83ca3b52e7f058bbc9115f05f741 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 09:28:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Oct 2017 09:28:28 +0000 Subject: osmo-bsc[master]: osmo-bsc MGCP FSM: catch all unexpected events In-Reply-To: References: Message-ID: Patch Set 1: > Patch Set 1: Code-Review+2 I have integrated the changes from this patch into 4334 now. We can abanon this patch now. -- To view, visit https://gerrit.osmocom.org/4376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2aea11c476aa91ed5d508ec443ca7c992bda52d9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 09:29:29 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Oct 2017 09:29:29 +0000 Subject: osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Patch Set 7: (44 comments) > please merge 4375 and 4376 into this patch, as agreed before? If > the build failure is due to an unmerged patch in libosmocore or > something, please add a 'Depends:' tag. Sorry, I forgot about the patches. Thanks for reminding me. I have now integrated the changes, please have another look. https://gerrit.osmocom.org/#/c/4334/4/include/osmocom/bsc/osmo_bsc_mgcp.h File include/osmocom/bsc/osmo_bsc_mgcp.h: PS4, Line 1: Sysmocom s.f.m.c. > oh ... I (neels) didn't know about the dash, which means that all headers I Done PS4, Line 1: Sysmocom s.f.m.c. > sysmocom awalys lower-case and "-" before s.f.m.c. Done Line 28: /* RTP endpoint number */ > does it make sense to have a name inside the fms, and a name here? I would Done Line 36: enum gsm48_chan_mode chan_mode; > I don't think we want to keep an extra pointer to the network around in eve Done Line 38: struct gsm_lchan *lchan; > is this really an integer type, don't we have some enum for this? Done PS4, Line 39: c > could be a bool? Done https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 341: /* NOTE: This is the SCCP-Lite case, since we do not handle > does this version of osmo-bsc even support SCCPlite anymore? I thought the When starting to port over to AoIP we agreed on preserving the SCCPLite support. There is not much to it. Since with SCCP-Lite, the MSC controls the MGW, The BSC only has to make the right port allocation on the BTS via RSL. (Probably SCCPLite is the wrong term here, its more about the behaviour that is applied when SCCPLite is used.) Line 564: conn->mgcp_ctx = mgcp_assignm_req(msc->network, msc->network->mgw.client, conn, chan_mode, full_rate); > don't pass a NULL talloc ctx!! We don't want to create rogue root contexts, Done Line 582: > new whitspace error? Done Line 767: > new whitspace error? Done Line 768: OSMO_ASSERT(lchan->abis_ip.ass_compl.valid); > ('== true' is superfluous) Done Line 772: LOGP(DMSC, LOGL_DEBUG, "Sending assignment complete message... (id=%i)\n", conn->sccp_con->conn_id); > sending the assignment complete is an normal event, i.e. LOGL_DEBUG seems a Done Line 787: LOGP(DMSC, LOGL_ERROR, "Failed to generate assignment completed message! (id=%i)\n", > there is no context in this message at all. In a loaded network, we may be Done https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_main.c File src/osmo-bsc/osmo_bsc_main.c: Line 284: LOGP(DNM, LOGL_ERROR, "MGW connect failed at (%s:%u)\n", > useful to print the connect to *where* has failed (IP/port) Done Line 284: LOGP(DNM, LOGL_ERROR, "MGW connect failed at (%s:%u)\n", > (maybe just "MGCP" without "GW" is better? "MGCPGW" is a term that was used Done Line 287: exit(1); > new whitespace bug Done https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_mgcp.c File src/osmo-bsc/osmo_bsc_mgcp.c: Line 37: #define MGCP_MGW_TIMEOUT 4 /* in seconds */ > in english, it would be "sec", but rather write out "in seconds" to make it Done Line 40: #define MGCP_BSS_TIMEOUT_TIMER_NR 2 > ("TIMER_NO" to me reads like "Timer? No!" .. make this "TIMER_NR"?) Done Line 46: enum int_cause_code { > shouldn't below fsm_state_names[] make the comments here unnecessary? At le Done Line 71: ST_ASSIGN_PROC, > "continue", "assignment" Done Line 74: ST_ASSIGN_COMPL, > "assignment" Done Line 76: ST_HALT > nice, we get both the actual state constant name in the log as well as a hu Done Line 77: }; > (could omit the comma, nothing should ever follow the end marker) Done Line 121: {EV_INIT, "EV_INIT (start state machine (send CRCX for BTS)"}, > (the comment says the identical thing that the function name already does) Done Line 122: {EV_ASS_COMPLETE, "EV_ASS_COMPLETE (assignment complete)"}, > this is called from pretty much all the code paths; it might be nice to add Done Line 125: {EV_MDCX_BTS_RESP, "EV_MDCX_BTS_RESP (got MDCX reponse for BTS)"}, > If this comment is useful and applies to the entire function, it should go Done Line 130: > (usually it makes sense to assert non-NULL once, early in the code path, in I am not so sure about this. While developing this the OSMO_ASSERT() helped me a lot. Maybe we can decide to drop some of the OSMO_ASSERT() later, but I would not drop them now. Line 137: struct osmo_fsm_inst *fi; > * logging inside fsm's should use LOGPFSM in order to automatically print t Done Line 143: > should this have a timeout? I think even if it won't change anything, it is logically incorrect. The timeout callback can also call this function. This would create a loop, even if such a situation would never occur because we send an event in the next line. Line 173: OSMO_ASSERT(mgcp_ctx); > * all this logging is implemented by the FSM core *and* it is not a NOTICE Done Line 185: > I usually like this notation: (Note: lindent/indent has problems with that format) Line 190: mgcp_msg = (struct mgcp_msg) { > I think this snprintf should move into mgcp_msg_gen() and make mgcp_msg.end If we do this we will loose the flexibility to support any endpoint naming format. Endpoint names can get quite complex. (e.g. ann/23 at mygateway.whatever.net). See RFC3435 Appendix E. Or we just decide for one format and that our mgcp-client is only compatible with our mgw by definition. Line 193: MGCP_MSG_PRESENCE_CONN_MODE), > (would it make sense to add thin API functions like mgcp_msg_set_foo() that I do not think that we will benefit much from this. The presence field is inspired from the sccp-addresses in libosmo-sigtran. When I remember correctly we do not have anything like that there too. Line 199: msg = mgcp_msg_gen(mgcp, &mgcp_msg); > admitted, we have logging in mgcp_client_tx, but would still be nice to do Done Line 207: return; > (is a cast from void* even necessary? I think it's not warned about, is it? Done Line 250: /* Callback for ST_ASSIGN_PROC: An mgcp response has been received, proceed > (also bool according to Harald's earlier comment?) Done Line 257: bool full_rate; > LOGPFSM whenever you have a fsm_inst as context, all over this file. Done Line 271: return; > another NOTICE. Please be more careful when deciding on the log level. Th Done Line 282: > (kind of obsolete comment) Done Line 499: > when we encounter errors in parsing MGCP, shouldn't we always return some k I am not sure here, but I think this is should be catched by the client (we do not implement resends yet), which should discard the response and resent the original command. The MGW would detect this as a resend and respond with the same response again. Line 780: .timer_cb = fsm_timeout_cb, > (I'd drop the "FSM " part, we will see in logging that it is an FSM anyway) Done Line 806: fsm_registered = true; > this is a linear list traversal over all FSMs in the program at each proces Done Line 813: snprintf(name, sizeof(name), "MGW_%i", conn->conn_id); > see my other comment, if we really need the FSM name and another name in th Done Line 814: mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm_bsc_mgcp, NULL, ctx, LOGL_DEBUG, name); > this string should also be without spaces, again for ctrl interface. Probably we should have also some protection that makes it impossible to register names with white-spaces. It was not clear to me that this messes up the control interface. I Just thought that this would be only for logging. -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 27 09:45:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 09:45:34 +0000 Subject: osmo-hlr[master]: tests/Makefile: use test db var instead of repeating the path In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9859b522b5ffa7f2c9ed33ab849199d4b4e6696c Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 09:45:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 09:45:46 +0000 Subject: osmo-hlr[master]: db_test: fix *FLAGS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie57a04b7efc7a1e16cf0e3625d8ad2f0ef0089b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 09:46:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 09:46:14 +0000 Subject: osmo-hlr[master]: automatically create db tables on osmo-hlr invocation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If77dbbfe1af3e66aaec91cb6295b687f37678636 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 09:46:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 09:46:33 +0000 Subject: osmo-hlr[master]: cosmetic: sql/hlr.sql: move comments In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4439 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I280c2e2d3e9b7f1dc632722724d9e1c54d041820 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 09:46:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 09:46:50 +0000 Subject: osmo-hlr[master]: cosmetic: rename SL3_TXT macro, use osmo_strlcpy() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1dadeddddcfe0109195c09c0e706201b0df009cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 09:50:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 09:50:04 +0000 Subject: osmo-hlr[master]: add osmo-hlr-db-tool, program to migrate from osmo-nitb db In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4441/1/src/hlr_db_tool.c File src/hlr_db_tool.c: PS1, Line 53: [--import-nitb-db ] not sure what you had exactly in mind. To me, the generic name "osmo-hlr-db-tool" indicates that in the future you want to do other things with it (e.g. import of CSV files with sim card data, ...). This is great and I like that idea. However, in that case I would suggest that the actual operation (such as import-nitb-db) becomes a "command" and not an optional argument. So basically one would call the tool with a set of comamnd line arguments (generic ones?), then issue a command, and then that command could have optional arguments. So "osmo-hlr-db-tool -d -T import-nitb-db my_db_file" At that point it's clear that the command "import-nitb-db" is not an option/flag, and that there is only one for each invocation of the tool. -- To view, visit https://gerrit.osmocom.org/4441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 27 10:32:33 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Oct 2017 10:32:33 +0000 Subject: [PATCH] osmo-mgw[master]: network: add separate log category Message-ID: Review at https://gerrit.osmocom.org/4443 network: add separate log category the network (mgcp_network.c) part and the protocol part (mgcp_protoocl.c) share a single loglevel DLMGCP. This makes debuging hard because when debugging the protocol we also get the log output from the RTP packets. assign the network part a private loglevel and keep DLMGCP for the directly MGCP related code Change-Id: I55a2711798d1d1c2c9ef2f3b7ebb8fdd78bd6ea2 --- M include/osmocom/mgcp/Makefile.am M src/libosmo-mgcp/mgcp_network.c M src/osmo-mgw/mgw_main.c 3 files changed, 73 insertions(+), 64 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/43/4443/1 diff --git a/include/osmocom/mgcp/Makefile.am b/include/osmocom/mgcp/Makefile.am index cd8f599..d706807 100644 --- a/include/osmocom/mgcp/Makefile.am +++ b/include/osmocom/mgcp/Makefile.am @@ -5,4 +5,5 @@ mgcp_stat.h \ mgcp_ep.h \ mgcp_sdp.h \ + debug.h \ $(NULL) diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index dac1698..6b8f4a9 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -40,6 +40,7 @@ #include #include #include +#include #define RTP_SEQ_MOD (1 << 16) #define RTP_MAX_DROPOUT 3000 @@ -64,7 +65,7 @@ memset(&tp, 0, sizeof(tp)); if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0) - LOGP(DLMGCP, LOGL_NOTICE, "Getting the clock failed.\n"); + LOGP(DNETW, LOGL_NOTICE, "Getting the clock failed.\n"); /* convert it to 1/unit seconds */ ret = tp.tv_sec; @@ -85,7 +86,7 @@ { struct sockaddr_in out; - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "sending %i bytes length packet to %s:%u ...\n", len, inet_ntoa(*addr), ntohs(port)); @@ -109,9 +110,9 @@ OSMO_ASSERT(endp); OSMO_ASSERT(conn); - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x sending dummy packet...\n", ENDPOINT_NUMBER(endp)); - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x conn:%s\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x conn:%s\n", ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); rc = mgcp_udp_send(conn->end.rtp.fd, &conn->end.addr, @@ -131,7 +132,7 @@ return rc; failed: - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x Failed to send dummy %s packet.\n", ENDPOINT_NUMBER(endp), was_rtcp ? "RTCP" : "RTP"); @@ -172,7 +173,7 @@ if (seq == sstate->last_seq) { if (timestamp != sstate->last_timestamp) { sstate->err_ts_counter += 1; - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "The %s timestamp delta is != 0 but the sequence " "number %d is the same, " "TS offset: %d, SeqNo offset: %d " @@ -192,7 +193,7 @@ if (tsdelta == 0) { /* Don't update *tsdelta_out */ - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "The %s timestamp delta is %d " "on 0x%x SSRC: %u timestamp: %u " "from %s:%d\n", @@ -205,7 +206,7 @@ if (sstate->last_tsdelta != tsdelta) { if (sstate->last_tsdelta) { - LOGP(DLMGCP, LOGL_INFO, + LOGP(DNETW, LOGL_INFO, "The %s timestamp delta changes from %d to %d " "on 0x%x SSRC: %u timestamp: %u from %s:%d\n", text, sstate->last_tsdelta, tsdelta, @@ -222,7 +223,7 @@ if (timestamp_error) { sstate->err_ts_counter += 1; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "The %s timestamp has an alignment error of %d " "on 0x%x SSRC: %u " "SeqNo delta: %d, TS delta: %d, dTS/dSeq: %d " @@ -252,7 +253,7 @@ if (tsdelta == 0) { tsdelta = state->out_stream.last_tsdelta; if (tsdelta != 0) { - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "A fixed packet duration is not available on 0x%x, " "using last output timestamp delta instead: %d " "from %s:%d\n", @@ -260,7 +261,7 @@ inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } else { tsdelta = rtp_end->codec.rate * 20 / 1000; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "Fixed packet duration and last timestamp delta " "are not available on 0x%x, " "using fixed 20ms instead: %d " @@ -276,7 +277,7 @@ if (state->timestamp_offset != timestamp_offset) { state->timestamp_offset = timestamp_offset; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "Timestamp offset change on 0x%x SSRC: %u " "SeqNo delta: %d, TS offset: %d, " "from %s:%d\n", @@ -308,7 +309,7 @@ if (ts_error) { state->timestamp_offset += ptime - ts_error; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "Corrected timestamp alignment error of %d on 0x%x SSRC: %u " "new TS offset: %d, " "from %s:%d\n", @@ -341,7 +342,7 @@ struct mgcp_rtp_end *dst_end, char *data, int *len, int buf_size) { - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x transcoding disabled\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x transcoding disabled\n", ENDPOINT_NUMBER(endp)); return 0; } @@ -355,7 +356,7 @@ struct mgcp_rtp_end *dst_end, struct mgcp_rtp_end *src_end) { - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x transcoding disabled\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x transcoding disabled\n", ENDPOINT_NUMBER(endp)); return 0; } @@ -366,7 +367,7 @@ const char **fmtp_extra, struct mgcp_conn_rtp *conn) { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x conn:%s using format defaults\n", ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); @@ -405,7 +406,7 @@ if (seq < state->stats_max_seq) state->stats_cycles += RTP_SEQ_MOD; } else if (udelta <= RTP_SEQ_MOD - RTP_MAX_MISORDER) { - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "RTP seqno made a very large jump on 0x%x delta: %u\n", ENDPOINT_NUMBER(endp), udelta); } @@ -463,7 +464,7 @@ state->out_stream = state->in_stream; state->out_stream.last_timestamp = timestamp; state->out_stream.ssrc = ssrc - 1; /* force output SSRC change */ - LOGP(DLMGCP, LOGL_INFO, + LOGP(DNETW, LOGL_INFO, "endpoint:%x initializing stream, SSRC: %u timestamp: %u " "pkt-duration: %d, from %s:%d\n", ENDPOINT_NUMBER(endp), state->in_stream.ssrc, @@ -472,14 +473,14 @@ if (state->packet_duration == 0) { state->packet_duration = rtp_end->codec.rate * 20 / 1000; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "endpoint:%x fixed packet duration is not available, " "using fixed 20ms instead: %d from %s:%d\n", ENDPOINT_NUMBER(endp), state->packet_duration, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } } else if (state->in_stream.ssrc != ssrc) { - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "endpoint:%x SSRC changed: %u -> %u " "from %s:%d\n", ENDPOINT_NUMBER(endp), @@ -508,7 +509,7 @@ if (rtp_end->force_constant_ssrc != -1) rtp_end->force_constant_ssrc -= 1; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "endpoint:%x SSRC patching enabled, SSRC: %u " "SeqNo offset: %d, TS offset: %d " "from %s:%d\n", @@ -566,7 +567,7 @@ return; #if 0 - DEBUGP(DLMGCP, + DEBUGP(DNETW, "endpoint:%x payload hdr payload %u -> endp payload %u\n", ENDPOINT_NUMBER(endp), rtp_hdr->payload_type, payload); rtp_hdr->payload_type = payload; @@ -611,22 +612,22 @@ OSMO_ASSERT(conn_dst); if (is_rtp) { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x delivering RTP packet...\n", ENDPOINT_NUMBER(endp)); } else { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x delivering RTCP packet...\n", ENDPOINT_NUMBER(endp)); } - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x loop:%d, mode:%d ", ENDPOINT_NUMBER(endp), tcfg->audio_loop, conn_src->conn->mode); if (conn_src->conn->mode == MGCP_CONN_LOOPBACK) - LOGPC(DLMGCP, LOGL_DEBUG, "(loopback)\n"); + LOGPC(DNETW, LOGL_DEBUG, "(loopback)\n"); else - LOGPC(DLMGCP, LOGL_DEBUG, "\n"); + LOGPC(DNETW, LOGL_DEBUG, "\n"); /* Note: In case of loopback configuration, both, the source and the * destination will point to the same connection. */ @@ -636,7 +637,7 @@ if (!rtp_end->output_enabled) { rtp_end->dropped_packets += 1; - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x output disabled, drop to %s %s " "rtp_port:%u rtcp_port:%u\n", ENDPOINT_NUMBER(endp), @@ -659,7 +660,7 @@ if (addr) mgcp_patch_and_count(endp, rtp_state, rtp_end, addr, buf, buflen); - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x process/send to %s %s " "rtp_port:%u rtcp_port:%u\n", ENDPOINT_NUMBER(endp), dest_name, @@ -698,7 +699,7 @@ } while (buflen > 0); return nbytes; } else if (!tcfg->omit_rtcp) { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x send to %s %s rtp_port:%u rtcp_port:%u\n", ENDPOINT_NUMBER(endp), dest_name, @@ -740,19 +741,19 @@ rc = recvfrom(fd, buf, bufsize, 0, (struct sockaddr *)addr, &slen); - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "receiving %u bytes length packet from %s:%u ...\n", rc, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); if (rc < 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x failed to receive packet, errno: %d/%s\n", ENDPOINT_NUMBER(endp), errno, strerror(errno)); return -1; } if (tossed) { - LOGP(DLMGCP, LOGL_ERROR, "endpoint:%x packet tossed\n", + LOGP(DNETW, LOGL_ERROR, "endpoint:%x packet tossed\n", ENDPOINT_NUMBER(endp)); } @@ -771,12 +772,12 @@ * which we send our outgoing RTP traffic. */ if (memcmp(&addr->sin_addr, &conn->end.addr, sizeof(addr->sin_addr)) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x data from wrong address: %s, ", ENDPOINT_NUMBER(endp), inet_ntoa(addr->sin_addr)); - LOGPC(DLMGCP, LOGL_ERROR, "expected: %s\n", + LOGPC(DNETW, LOGL_ERROR, "expected: %s\n", inet_ntoa(conn->end.addr)); - LOGP(DLMGCP, LOGL_ERROR, "endpoint:%x packet tossed\n", + LOGP(DNETW, LOGL_ERROR, "endpoint:%x packet tossed\n", ENDPOINT_NUMBER(endp)); return -1; } @@ -787,13 +788,13 @@ * plausibility. */ if (conn->end.rtp_port != addr->sin_port && conn->end.rtcp_port != addr->sin_port) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x data from wrong source port: %d, ", ENDPOINT_NUMBER(endp), ntohs(addr->sin_port)); - LOGPC(DLMGCP, LOGL_ERROR, + LOGPC(DNETW, LOGL_ERROR, "expected: %d for RTP or %d for RTCP\n", ntohs(conn->end.rtp_port), ntohs(conn->end.rtcp_port)); - LOGP(DLMGCP, LOGL_ERROR, "endpoint:%x packet tossed\n", + LOGP(DNETW, LOGL_ERROR, "endpoint:%x packet tossed\n", ENDPOINT_NUMBER(endp)); return -1; } @@ -809,14 +810,14 @@ endp = conn->conn->endp; if (strcmp(inet_ntoa(conn->end.addr), "0.0.0.0") == 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x destination IP-address is invalid\n", ENDPOINT_NUMBER(endp)); return -1; } if (conn->end.rtp_port == 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x destination rtp port is invalid\n", ENDPOINT_NUMBER(endp)); return -1; @@ -839,7 +840,7 @@ endp = conn->conn->endp; tcfg = endp->tcfg; - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x receiving RTP/RTCP packet...\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x receiving RTP/RTCP packet...\n", ENDPOINT_NUMBER(endp)); rc = receive_from(endp, fd->fd, addr, buf, buf_size); @@ -847,11 +848,11 @@ return -1; *proto = fd == &conn->end.rtp ? MGCP_PROTO_RTP : MGCP_PROTO_RTCP; - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x ", ENDPOINT_NUMBER(endp)); - LOGPC(DLMGCP, LOGL_DEBUG, "receiveing from %s %s %d\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x ", ENDPOINT_NUMBER(endp)); + LOGPC(DNETW, LOGL_DEBUG, "receiveing from %s %s %d\n", conn->conn->name, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x conn:%s\n", ENDPOINT_NUMBER(endp), + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x conn:%s\n", ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); /* Check if the origin of the RTP packet seems plausible */ @@ -862,10 +863,10 @@ /* Filter out dummy message */ if (rc == 1 && buf[0] == MGCP_DUMMY_LOAD) { - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "endpoint:%x dummy message received\n", ENDPOINT_NUMBER(endp)); - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x packet tossed\n", ENDPOINT_NUMBER(endp)); return 0; } @@ -890,7 +891,7 @@ struct mgcp_endpoint *endp; endp = conn_src->conn->endp; - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x destin conn:%s\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x destin conn:%s\n", ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn_dst->conn)); /* Before we try to deliver the packet, we check if the destination @@ -903,7 +904,7 @@ * destination connection. */ switch (conn_dst->type) { case MGCP_RTP_DEFAULT: - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x endpoint type is MGCP_RTP_DEFAULT, " "using mgcp_send() to forward data directly\n", ENDPOINT_NUMBER(endp)); @@ -911,7 +912,7 @@ addr, buf, buf_size, conn_src, conn_dst); case MGCP_OSMUX_BSC_NAT: case MGCP_OSMUX_BSC: - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x endpoint type is MGCP_OSMUX_BSC_NAT, " "using osmux_xfrm_to_osmux() to forward data through OSMUX\n", ENDPOINT_NUMBER(endp)); @@ -921,7 +922,7 @@ /* If the data has not been handled/forwarded until here, it will * be discarded, this should not happen, normally the MGCP type * should be properly set */ - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x bad MGCP type -- data discarded!\n", ENDPOINT_NUMBER(endp)); @@ -966,7 +967,7 @@ /* There is no destination conn, stop here */ if (!conn_dst) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x unable to find destination conn\n", ENDPOINT_NUMBER(endp)); return -1; @@ -974,7 +975,7 @@ /* The destination conn is not an RTP connection */ if (conn_dst->type != MGCP_CONN_TYPE_RTP) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x unable to find suitable destination conn\n", ENDPOINT_NUMBER(endp)); return -1; @@ -1009,7 +1010,7 @@ endp = conn_src->conn->endp; OSMO_ASSERT(endp); - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x source conn:%s\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x source conn:%s\n", ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn_src->conn)); /* Receive packet */ @@ -1056,16 +1057,16 @@ fd->fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd->fd < 0) { - LOGP(DLMGCP, LOGL_ERROR, "failed to create UDP port (%s:%i).\n", + LOGP(DNETW, LOGL_ERROR, "failed to create UDP port (%s:%i).\n", source_addr, port); return -1; } else { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "created UDP port (%s:%i).\n", source_addr, port); } if (setsockopt(fd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "failed to set socket options (%s:%i).\n", source_addr, port); return -1; @@ -1079,11 +1080,11 @@ if (bind(fd->fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { close(fd->fd); fd->fd = -1; - LOGP(DLMGCP, LOGL_ERROR, "failed to bind UDP port (%s:%i).\n", + LOGP(DNETW, LOGL_ERROR, "failed to bind UDP port (%s:%i).\n", source_addr, port); return -1; } else { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "bound UDP port (%s:%i).\n", source_addr, port); } @@ -1099,7 +1100,7 @@ if (mgcp_create_bind(source_addr, &rtp_end->rtp, rtp_end->local_port) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x failed to create RTP port: %s:%d\n", endpno, source_addr, rtp_end->local_port); goto cleanup0; @@ -1107,7 +1108,7 @@ if (mgcp_create_bind(source_addr, &rtp_end->rtcp, rtp_end->local_port + 1) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x failed to create RTCP port: %s:%d\n", endpno, source_addr, rtp_end->local_port + 1); goto cleanup1; @@ -1119,7 +1120,7 @@ rtp_end->rtp.when = BSC_FD_READ; if (osmo_fd_register(&rtp_end->rtp) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x failed to register RTP port %d\n", endpno, rtp_end->local_port); goto cleanup2; @@ -1127,7 +1128,7 @@ rtp_end->rtcp.when = BSC_FD_READ; if (osmo_fd_register(&rtp_end->rtcp) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x failed to register RTCP port %d\n", endpno, rtp_end->local_port + 1); goto cleanup3; @@ -1162,7 +1163,7 @@ end = &conn->end; if (end->rtp.fd != -1 || end->rtcp.fd != -1) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x %u was already bound on conn:%s\n", ENDPOINT_NUMBER(endp), rtp_port, mgcp_conn_dump(conn->conn)); diff --git a/src/osmo-mgw/mgw_main.c b/src/osmo-mgw/mgw_main.c index aef99ae..737d57c 100644 --- a/src/osmo-mgw/mgw_main.c +++ b/src/osmo-mgw/mgw_main.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -233,6 +234,12 @@ static const struct log_info_cat log_categories[] = { /* DLMGCP is provided by the MGCP library */ + [DNETW] = { + .name = "DNETW", + .description = "Network", + .color = "\033[1;30m", + .enabled = 1,.loglevel = LOGL_NOTICE, + }, }; const struct log_info log_info = { -- To view, visit https://gerrit.osmocom.org/4443 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I55a2711798d1d1c2c9ef2f3b7ebb8fdd78bd6ea2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Oct 27 10:37:03 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Oct 2017 10:37:03 +0000 Subject: [PATCH] osmo-mgw[master]: network: add separate log category In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4443 to look at the new patch set (#2). network: add separate log category the network (mgcp_network.c) part and the protocol part (mgcp_protoocl.c) share a single loglevel DLMGCP. This makes debuging hard because when debugging the protocol we also get the log output from the RTP packets. assign the network part a private loglevel and keep DLMGCP for the directly MGCP related code Change-Id: I55a2711798d1d1c2c9ef2f3b7ebb8fdd78bd6ea2 --- M include/osmocom/mgcp/Makefile.am A include/osmocom/mgcp/debug.h M src/libosmo-mgcp/mgcp_network.c M src/osmo-mgw/mgw_main.c 4 files changed, 108 insertions(+), 64 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/43/4443/2 diff --git a/include/osmocom/mgcp/Makefile.am b/include/osmocom/mgcp/Makefile.am index cd8f599..d706807 100644 --- a/include/osmocom/mgcp/Makefile.am +++ b/include/osmocom/mgcp/Makefile.am @@ -5,4 +5,5 @@ mgcp_stat.h \ mgcp_ep.h \ mgcp_sdp.h \ + debug.h \ $(NULL) diff --git a/include/osmocom/mgcp/debug.h b/include/osmocom/mgcp/debug.h new file mode 100644 index 0000000..84e5bdf --- /dev/null +++ b/include/osmocom/mgcp/debug.h @@ -0,0 +1,35 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include +#include + +#define DEBUG +#include + +/* Debug Areas of the code */ +enum { + DNETW, + Debug_LastEntry, +}; + +extern const struct log_info log_info; diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index dac1698..6b8f4a9 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -40,6 +40,7 @@ #include #include #include +#include #define RTP_SEQ_MOD (1 << 16) #define RTP_MAX_DROPOUT 3000 @@ -64,7 +65,7 @@ memset(&tp, 0, sizeof(tp)); if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0) - LOGP(DLMGCP, LOGL_NOTICE, "Getting the clock failed.\n"); + LOGP(DNETW, LOGL_NOTICE, "Getting the clock failed.\n"); /* convert it to 1/unit seconds */ ret = tp.tv_sec; @@ -85,7 +86,7 @@ { struct sockaddr_in out; - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "sending %i bytes length packet to %s:%u ...\n", len, inet_ntoa(*addr), ntohs(port)); @@ -109,9 +110,9 @@ OSMO_ASSERT(endp); OSMO_ASSERT(conn); - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x sending dummy packet...\n", ENDPOINT_NUMBER(endp)); - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x conn:%s\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x conn:%s\n", ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); rc = mgcp_udp_send(conn->end.rtp.fd, &conn->end.addr, @@ -131,7 +132,7 @@ return rc; failed: - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x Failed to send dummy %s packet.\n", ENDPOINT_NUMBER(endp), was_rtcp ? "RTCP" : "RTP"); @@ -172,7 +173,7 @@ if (seq == sstate->last_seq) { if (timestamp != sstate->last_timestamp) { sstate->err_ts_counter += 1; - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "The %s timestamp delta is != 0 but the sequence " "number %d is the same, " "TS offset: %d, SeqNo offset: %d " @@ -192,7 +193,7 @@ if (tsdelta == 0) { /* Don't update *tsdelta_out */ - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "The %s timestamp delta is %d " "on 0x%x SSRC: %u timestamp: %u " "from %s:%d\n", @@ -205,7 +206,7 @@ if (sstate->last_tsdelta != tsdelta) { if (sstate->last_tsdelta) { - LOGP(DLMGCP, LOGL_INFO, + LOGP(DNETW, LOGL_INFO, "The %s timestamp delta changes from %d to %d " "on 0x%x SSRC: %u timestamp: %u from %s:%d\n", text, sstate->last_tsdelta, tsdelta, @@ -222,7 +223,7 @@ if (timestamp_error) { sstate->err_ts_counter += 1; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "The %s timestamp has an alignment error of %d " "on 0x%x SSRC: %u " "SeqNo delta: %d, TS delta: %d, dTS/dSeq: %d " @@ -252,7 +253,7 @@ if (tsdelta == 0) { tsdelta = state->out_stream.last_tsdelta; if (tsdelta != 0) { - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "A fixed packet duration is not available on 0x%x, " "using last output timestamp delta instead: %d " "from %s:%d\n", @@ -260,7 +261,7 @@ inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } else { tsdelta = rtp_end->codec.rate * 20 / 1000; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "Fixed packet duration and last timestamp delta " "are not available on 0x%x, " "using fixed 20ms instead: %d " @@ -276,7 +277,7 @@ if (state->timestamp_offset != timestamp_offset) { state->timestamp_offset = timestamp_offset; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "Timestamp offset change on 0x%x SSRC: %u " "SeqNo delta: %d, TS offset: %d, " "from %s:%d\n", @@ -308,7 +309,7 @@ if (ts_error) { state->timestamp_offset += ptime - ts_error; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "Corrected timestamp alignment error of %d on 0x%x SSRC: %u " "new TS offset: %d, " "from %s:%d\n", @@ -341,7 +342,7 @@ struct mgcp_rtp_end *dst_end, char *data, int *len, int buf_size) { - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x transcoding disabled\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x transcoding disabled\n", ENDPOINT_NUMBER(endp)); return 0; } @@ -355,7 +356,7 @@ struct mgcp_rtp_end *dst_end, struct mgcp_rtp_end *src_end) { - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x transcoding disabled\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x transcoding disabled\n", ENDPOINT_NUMBER(endp)); return 0; } @@ -366,7 +367,7 @@ const char **fmtp_extra, struct mgcp_conn_rtp *conn) { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x conn:%s using format defaults\n", ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); @@ -405,7 +406,7 @@ if (seq < state->stats_max_seq) state->stats_cycles += RTP_SEQ_MOD; } else if (udelta <= RTP_SEQ_MOD - RTP_MAX_MISORDER) { - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "RTP seqno made a very large jump on 0x%x delta: %u\n", ENDPOINT_NUMBER(endp), udelta); } @@ -463,7 +464,7 @@ state->out_stream = state->in_stream; state->out_stream.last_timestamp = timestamp; state->out_stream.ssrc = ssrc - 1; /* force output SSRC change */ - LOGP(DLMGCP, LOGL_INFO, + LOGP(DNETW, LOGL_INFO, "endpoint:%x initializing stream, SSRC: %u timestamp: %u " "pkt-duration: %d, from %s:%d\n", ENDPOINT_NUMBER(endp), state->in_stream.ssrc, @@ -472,14 +473,14 @@ if (state->packet_duration == 0) { state->packet_duration = rtp_end->codec.rate * 20 / 1000; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "endpoint:%x fixed packet duration is not available, " "using fixed 20ms instead: %d from %s:%d\n", ENDPOINT_NUMBER(endp), state->packet_duration, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } } else if (state->in_stream.ssrc != ssrc) { - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "endpoint:%x SSRC changed: %u -> %u " "from %s:%d\n", ENDPOINT_NUMBER(endp), @@ -508,7 +509,7 @@ if (rtp_end->force_constant_ssrc != -1) rtp_end->force_constant_ssrc -= 1; - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "endpoint:%x SSRC patching enabled, SSRC: %u " "SeqNo offset: %d, TS offset: %d " "from %s:%d\n", @@ -566,7 +567,7 @@ return; #if 0 - DEBUGP(DLMGCP, + DEBUGP(DNETW, "endpoint:%x payload hdr payload %u -> endp payload %u\n", ENDPOINT_NUMBER(endp), rtp_hdr->payload_type, payload); rtp_hdr->payload_type = payload; @@ -611,22 +612,22 @@ OSMO_ASSERT(conn_dst); if (is_rtp) { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x delivering RTP packet...\n", ENDPOINT_NUMBER(endp)); } else { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x delivering RTCP packet...\n", ENDPOINT_NUMBER(endp)); } - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x loop:%d, mode:%d ", ENDPOINT_NUMBER(endp), tcfg->audio_loop, conn_src->conn->mode); if (conn_src->conn->mode == MGCP_CONN_LOOPBACK) - LOGPC(DLMGCP, LOGL_DEBUG, "(loopback)\n"); + LOGPC(DNETW, LOGL_DEBUG, "(loopback)\n"); else - LOGPC(DLMGCP, LOGL_DEBUG, "\n"); + LOGPC(DNETW, LOGL_DEBUG, "\n"); /* Note: In case of loopback configuration, both, the source and the * destination will point to the same connection. */ @@ -636,7 +637,7 @@ if (!rtp_end->output_enabled) { rtp_end->dropped_packets += 1; - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x output disabled, drop to %s %s " "rtp_port:%u rtcp_port:%u\n", ENDPOINT_NUMBER(endp), @@ -659,7 +660,7 @@ if (addr) mgcp_patch_and_count(endp, rtp_state, rtp_end, addr, buf, buflen); - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x process/send to %s %s " "rtp_port:%u rtcp_port:%u\n", ENDPOINT_NUMBER(endp), dest_name, @@ -698,7 +699,7 @@ } while (buflen > 0); return nbytes; } else if (!tcfg->omit_rtcp) { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x send to %s %s rtp_port:%u rtcp_port:%u\n", ENDPOINT_NUMBER(endp), dest_name, @@ -740,19 +741,19 @@ rc = recvfrom(fd, buf, bufsize, 0, (struct sockaddr *)addr, &slen); - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "receiving %u bytes length packet from %s:%u ...\n", rc, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); if (rc < 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x failed to receive packet, errno: %d/%s\n", ENDPOINT_NUMBER(endp), errno, strerror(errno)); return -1; } if (tossed) { - LOGP(DLMGCP, LOGL_ERROR, "endpoint:%x packet tossed\n", + LOGP(DNETW, LOGL_ERROR, "endpoint:%x packet tossed\n", ENDPOINT_NUMBER(endp)); } @@ -771,12 +772,12 @@ * which we send our outgoing RTP traffic. */ if (memcmp(&addr->sin_addr, &conn->end.addr, sizeof(addr->sin_addr)) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x data from wrong address: %s, ", ENDPOINT_NUMBER(endp), inet_ntoa(addr->sin_addr)); - LOGPC(DLMGCP, LOGL_ERROR, "expected: %s\n", + LOGPC(DNETW, LOGL_ERROR, "expected: %s\n", inet_ntoa(conn->end.addr)); - LOGP(DLMGCP, LOGL_ERROR, "endpoint:%x packet tossed\n", + LOGP(DNETW, LOGL_ERROR, "endpoint:%x packet tossed\n", ENDPOINT_NUMBER(endp)); return -1; } @@ -787,13 +788,13 @@ * plausibility. */ if (conn->end.rtp_port != addr->sin_port && conn->end.rtcp_port != addr->sin_port) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x data from wrong source port: %d, ", ENDPOINT_NUMBER(endp), ntohs(addr->sin_port)); - LOGPC(DLMGCP, LOGL_ERROR, + LOGPC(DNETW, LOGL_ERROR, "expected: %d for RTP or %d for RTCP\n", ntohs(conn->end.rtp_port), ntohs(conn->end.rtcp_port)); - LOGP(DLMGCP, LOGL_ERROR, "endpoint:%x packet tossed\n", + LOGP(DNETW, LOGL_ERROR, "endpoint:%x packet tossed\n", ENDPOINT_NUMBER(endp)); return -1; } @@ -809,14 +810,14 @@ endp = conn->conn->endp; if (strcmp(inet_ntoa(conn->end.addr), "0.0.0.0") == 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x destination IP-address is invalid\n", ENDPOINT_NUMBER(endp)); return -1; } if (conn->end.rtp_port == 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x destination rtp port is invalid\n", ENDPOINT_NUMBER(endp)); return -1; @@ -839,7 +840,7 @@ endp = conn->conn->endp; tcfg = endp->tcfg; - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x receiving RTP/RTCP packet...\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x receiving RTP/RTCP packet...\n", ENDPOINT_NUMBER(endp)); rc = receive_from(endp, fd->fd, addr, buf, buf_size); @@ -847,11 +848,11 @@ return -1; *proto = fd == &conn->end.rtp ? MGCP_PROTO_RTP : MGCP_PROTO_RTCP; - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x ", ENDPOINT_NUMBER(endp)); - LOGPC(DLMGCP, LOGL_DEBUG, "receiveing from %s %s %d\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x ", ENDPOINT_NUMBER(endp)); + LOGPC(DNETW, LOGL_DEBUG, "receiveing from %s %s %d\n", conn->conn->name, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x conn:%s\n", ENDPOINT_NUMBER(endp), + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x conn:%s\n", ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); /* Check if the origin of the RTP packet seems plausible */ @@ -862,10 +863,10 @@ /* Filter out dummy message */ if (rc == 1 && buf[0] == MGCP_DUMMY_LOAD) { - LOGP(DLMGCP, LOGL_NOTICE, + LOGP(DNETW, LOGL_NOTICE, "endpoint:%x dummy message received\n", ENDPOINT_NUMBER(endp)); - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x packet tossed\n", ENDPOINT_NUMBER(endp)); return 0; } @@ -890,7 +891,7 @@ struct mgcp_endpoint *endp; endp = conn_src->conn->endp; - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x destin conn:%s\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x destin conn:%s\n", ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn_dst->conn)); /* Before we try to deliver the packet, we check if the destination @@ -903,7 +904,7 @@ * destination connection. */ switch (conn_dst->type) { case MGCP_RTP_DEFAULT: - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x endpoint type is MGCP_RTP_DEFAULT, " "using mgcp_send() to forward data directly\n", ENDPOINT_NUMBER(endp)); @@ -911,7 +912,7 @@ addr, buf, buf_size, conn_src, conn_dst); case MGCP_OSMUX_BSC_NAT: case MGCP_OSMUX_BSC: - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x endpoint type is MGCP_OSMUX_BSC_NAT, " "using osmux_xfrm_to_osmux() to forward data through OSMUX\n", ENDPOINT_NUMBER(endp)); @@ -921,7 +922,7 @@ /* If the data has not been handled/forwarded until here, it will * be discarded, this should not happen, normally the MGCP type * should be properly set */ - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x bad MGCP type -- data discarded!\n", ENDPOINT_NUMBER(endp)); @@ -966,7 +967,7 @@ /* There is no destination conn, stop here */ if (!conn_dst) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x unable to find destination conn\n", ENDPOINT_NUMBER(endp)); return -1; @@ -974,7 +975,7 @@ /* The destination conn is not an RTP connection */ if (conn_dst->type != MGCP_CONN_TYPE_RTP) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x unable to find suitable destination conn\n", ENDPOINT_NUMBER(endp)); return -1; @@ -1009,7 +1010,7 @@ endp = conn_src->conn->endp; OSMO_ASSERT(endp); - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x source conn:%s\n", + LOGP(DNETW, LOGL_DEBUG, "endpoint:%x source conn:%s\n", ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn_src->conn)); /* Receive packet */ @@ -1056,16 +1057,16 @@ fd->fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd->fd < 0) { - LOGP(DLMGCP, LOGL_ERROR, "failed to create UDP port (%s:%i).\n", + LOGP(DNETW, LOGL_ERROR, "failed to create UDP port (%s:%i).\n", source_addr, port); return -1; } else { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "created UDP port (%s:%i).\n", source_addr, port); } if (setsockopt(fd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "failed to set socket options (%s:%i).\n", source_addr, port); return -1; @@ -1079,11 +1080,11 @@ if (bind(fd->fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { close(fd->fd); fd->fd = -1; - LOGP(DLMGCP, LOGL_ERROR, "failed to bind UDP port (%s:%i).\n", + LOGP(DNETW, LOGL_ERROR, "failed to bind UDP port (%s:%i).\n", source_addr, port); return -1; } else { - LOGP(DLMGCP, LOGL_DEBUG, + LOGP(DNETW, LOGL_DEBUG, "bound UDP port (%s:%i).\n", source_addr, port); } @@ -1099,7 +1100,7 @@ if (mgcp_create_bind(source_addr, &rtp_end->rtp, rtp_end->local_port) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x failed to create RTP port: %s:%d\n", endpno, source_addr, rtp_end->local_port); goto cleanup0; @@ -1107,7 +1108,7 @@ if (mgcp_create_bind(source_addr, &rtp_end->rtcp, rtp_end->local_port + 1) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x failed to create RTCP port: %s:%d\n", endpno, source_addr, rtp_end->local_port + 1); goto cleanup1; @@ -1119,7 +1120,7 @@ rtp_end->rtp.when = BSC_FD_READ; if (osmo_fd_register(&rtp_end->rtp) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x failed to register RTP port %d\n", endpno, rtp_end->local_port); goto cleanup2; @@ -1127,7 +1128,7 @@ rtp_end->rtcp.when = BSC_FD_READ; if (osmo_fd_register(&rtp_end->rtcp) != 0) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x failed to register RTCP port %d\n", endpno, rtp_end->local_port + 1); goto cleanup3; @@ -1162,7 +1163,7 @@ end = &conn->end; if (end->rtp.fd != -1 || end->rtcp.fd != -1) { - LOGP(DLMGCP, LOGL_ERROR, + LOGP(DNETW, LOGL_ERROR, "endpoint:%x %u was already bound on conn:%s\n", ENDPOINT_NUMBER(endp), rtp_port, mgcp_conn_dump(conn->conn)); diff --git a/src/osmo-mgw/mgw_main.c b/src/osmo-mgw/mgw_main.c index aef99ae..737d57c 100644 --- a/src/osmo-mgw/mgw_main.c +++ b/src/osmo-mgw/mgw_main.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -233,6 +234,12 @@ static const struct log_info_cat log_categories[] = { /* DLMGCP is provided by the MGCP library */ + [DNETW] = { + .name = "DNETW", + .description = "Network", + .color = "\033[1;30m", + .enabled = 1,.loglevel = LOGL_NOTICE, + }, }; const struct log_info log_info = { -- To view, visit https://gerrit.osmocom.org/4443 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I55a2711798d1d1c2c9ef2f3b7ebb8fdd78bd6ea2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 13:00:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 13:00:01 +0000 Subject: [PATCH] libosmo-sccp[master]: osmo_sccp_addr_encode(): Check for more erroneous situations Message-ID: Review at https://gerrit.osmocom.org/4444 osmo_sccp_addr_encode(): Check for more erroneous situations ... and bail out + log an error. Change-Id: I2a419343e55edad39c59e763d11046c5a439444d --- M src/sccp2sua.c 1 file changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/44/4444/1 diff --git a/src/sccp2sua.c b/src/sccp2sua.c index ad948c9..e435d9f 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -163,13 +163,15 @@ out->gt.gti = OSMO_SCCP_GTI_TT_ONLY; out->gt.tt = *cur++; /* abort, for national use only */ + LOGP(DLSUA, LOGL_ERROR, "Unsupported national GTI %u\n", sca->global_title_indicator); return -EINVAL; case SCCP_TITLE_IND_TRANS_NUM_ENC: out->presence |= OSMO_SCCP_ADDR_T_GT; out->gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC; out->gt.tt = *cur++; out->gt.npi = *cur >> 4; - switch (*cur++ & 0xF) { + encoding = *cur++ & 0xF; + switch (encoding) { case 1: odd = true; break; @@ -177,6 +179,7 @@ odd = false; break; default: + LOGP(DLSUA, LOGL_ERROR, "Unknown GT encoding 0x%x\n", encoding); return -1; } break; @@ -237,11 +240,20 @@ if (in->presence & OSMO_SCCP_ADDR_T_PC) { sca->point_code_indicator = 1; + /* ITU-T Q.713 states that signalling point codes are 14bit */ + if (in->pc > 0x3fff) { + LOGP(DLSUA, LOGL_ERROR, "Invalid Point Code %u requested\n", in->pc); + return -EINVAL; + } msgb_put_u16le(msg, in->pc & 0x3ff); } if (in->presence & OSMO_SCCP_ADDR_T_SSN) { sca->ssn_indicator = 1; + if (in->ssn > 0xff) { + LOGP(DLSUA, LOGL_ERROR, "Invalid SSN %u requested\n", in->ssn); + return -EINVAL; + } msgb_put_u8(msg, in->ssn); } @@ -277,6 +289,9 @@ msgb_put_u8(msg, (in->gt.npi << 4) | (odd ? 1 : 2)); msgb_put_u8(msg, in->gt.nai & 0x7f); break; + default: + LOGP(DLSUA, LOGL_ERROR, "Unsupported GTI %u requested\n", in->gt.gti); + return -EINVAL; } osmo_isup_party_encode(msg, in->gt.digits); -- To view, visit https://gerrit.osmocom.org/4444 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2a419343e55edad39c59e763d11046c5a439444d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 13:00:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 13:00:02 +0000 Subject: [PATCH] libosmo-sccp[master]: osmo_sccp_addr_encode(): Fix truncation of point codes Message-ID: Review at https://gerrit.osmocom.org/4445 osmo_sccp_addr_encode(): Fix truncation of point codes In osmo_sccp_addr_encode(), we accidentially truncated all point codes to 10 bits, where in reality we should have truncated them to 14 bits: One 'f' was missing in the bit-mask. Closes: OS#2441 Change-Id: Iad67b674b5b5fd41996aa898a131e98900842dd8 --- M src/sccp2sua.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/45/4445/1 diff --git a/src/sccp2sua.c b/src/sccp2sua.c index e435d9f..ac2b2c2 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -245,7 +245,7 @@ LOGP(DLSUA, LOGL_ERROR, "Invalid Point Code %u requested\n", in->pc); return -EINVAL; } - msgb_put_u16le(msg, in->pc & 0x3ff); + msgb_put_u16le(msg, in->pc & 0x3fff); } if (in->presence & OSMO_SCCP_ADDR_T_SSN) { -- To view, visit https://gerrit.osmocom.org/4445 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad67b674b5b5fd41996aa898a131e98900842dd8 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 13:01:29 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Oct 2017 13:01:29 +0000 Subject: [PATCH] osmo-bts[master]: octphy: override firmware version check Message-ID: Review at https://gerrit.osmocom.org/4446 octphy: override firmware version check When osmo-bts detects a mismatch between the firmware of the DSP and the header version which it was compile with, a hard exit is performed. In some cases this may hinder debugging/testing things. Implement a commandline option to intentinally override the check. Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59 --- M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-octphy/main.c 2 files changed, 23 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/4446/1 diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index d1d5bf6..5846e21 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -52,6 +52,8 @@ #include #include +int no_fw_check = 0; + /* Map OSMOCOM logical channel type to OctPHY Logical channel type */ static tOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM pchan_to_logChComb[_GSM_PCHAN_MAX] = { @@ -1161,11 +1163,23 @@ "Rx APP-INFO.resp (name='%s', desc='%s', ver='%s', ver_hdr='%s')\n", air->szName, air->szDescription, air->szVersion, ver_hdr); - /* Bail if dsp firmware does not match up the header version info */ + /* Check if the firmware version of the DSP matches the header files + * that were used to compile osmo-bts */ if (strcmp(air->szVersion, ver_hdr) != 0) { LOGP(DL1C, LOGL_ERROR, - "Invalid header-file / dsp-firmware combination, exiting...\n"); - exit(1); + "Invalid header-file-version / dsp-firmware-version combination\n"); + LOGP(DL1C, LOGL_ERROR, + "Expected firmware version: %s\n", air->szVersion); + LOGP(DL1C, LOGL_ERROR, + "Actual firmware version: %s\n", ver_hdr); + + if (no_fw_check == 0) { + LOGP(DL1C, LOGL_ERROR, + "use option -I to override the check (not recommened)\n"); + LOGP(DL1C, LOGL_ERROR, + "exiting...\n"); + exit(1); + } } talloc_replace(fl1h->info.app.name, fl1h, air->szName); diff --git a/src/osmo-bts-octphy/main.c b/src/osmo-bts-octphy/main.c index 0f4d0dd..045b868 100644 --- a/src/osmo-bts-octphy/main.c +++ b/src/osmo-bts-octphy/main.c @@ -51,6 +51,7 @@ #define RF_LOCK_PATH "/var/lock/bts_rf_lock" extern int pcu_direct; +extern int no_fw_check; int bts_model_print_help() { @@ -65,15 +66,19 @@ int option_idx = 0, c; static const struct option long_options[] = { /* specific to this hardware */ + { "no-fw-check", 0, 0, 'I' }, { 0, 0, 0, 0 } }; - c = getopt_long(argc, argv, "", + c = getopt_long(argc, argv, "I", long_options, &option_idx); if (c == -1) break; switch (c) { + case 'I': + no_fw_check = 1; + break; default: num_errors++; break; -- To view, visit https://gerrit.osmocom.org/4446 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Oct 27 14:36:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 14:36:21 +0000 Subject: libosmo-sccp[master]: osmo_sccp_addr_encode(): Check for more erroneous situations In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4444 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2a419343e55edad39c59e763d11046c5a439444d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 14:36:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 14:36:24 +0000 Subject: libosmo-sccp[master]: osmo_sccp_addr_encode(): Fix truncation of point codes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4445 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iad67b674b5b5fd41996aa898a131e98900842dd8 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 14:36:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 14:36:27 +0000 Subject: [MERGED] libosmo-sccp[master]: osmo_sccp_addr_encode(): Fix truncation of point codes In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_sccp_addr_encode(): Fix truncation of point codes ...................................................................... osmo_sccp_addr_encode(): Fix truncation of point codes In osmo_sccp_addr_encode(), we accidentially truncated all point codes to 10 bits, where in reality we should have truncated them to 14 bits: One 'f' was missing in the bit-mask. Closes: OS#2441 Change-Id: Iad67b674b5b5fd41996aa898a131e98900842dd8 --- M src/sccp2sua.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp2sua.c b/src/sccp2sua.c index e435d9f..ac2b2c2 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -245,7 +245,7 @@ LOGP(DLSUA, LOGL_ERROR, "Invalid Point Code %u requested\n", in->pc); return -EINVAL; } - msgb_put_u16le(msg, in->pc & 0x3ff); + msgb_put_u16le(msg, in->pc & 0x3fff); } if (in->presence & OSMO_SCCP_ADDR_T_SSN) { -- To view, visit https://gerrit.osmocom.org/4445 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iad67b674b5b5fd41996aa898a131e98900842dd8 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 14:36:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 14:36:27 +0000 Subject: [MERGED] libosmo-sccp[master]: osmo_sccp_addr_encode(): Check for more erroneous situations In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_sccp_addr_encode(): Check for more erroneous situations ...................................................................... osmo_sccp_addr_encode(): Check for more erroneous situations ... and bail out + log an error. Change-Id: I2a419343e55edad39c59e763d11046c5a439444d --- M src/sccp2sua.c 1 file changed, 16 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp2sua.c b/src/sccp2sua.c index ad948c9..e435d9f 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -163,13 +163,15 @@ out->gt.gti = OSMO_SCCP_GTI_TT_ONLY; out->gt.tt = *cur++; /* abort, for national use only */ + LOGP(DLSUA, LOGL_ERROR, "Unsupported national GTI %u\n", sca->global_title_indicator); return -EINVAL; case SCCP_TITLE_IND_TRANS_NUM_ENC: out->presence |= OSMO_SCCP_ADDR_T_GT; out->gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC; out->gt.tt = *cur++; out->gt.npi = *cur >> 4; - switch (*cur++ & 0xF) { + encoding = *cur++ & 0xF; + switch (encoding) { case 1: odd = true; break; @@ -177,6 +179,7 @@ odd = false; break; default: + LOGP(DLSUA, LOGL_ERROR, "Unknown GT encoding 0x%x\n", encoding); return -1; } break; @@ -237,11 +240,20 @@ if (in->presence & OSMO_SCCP_ADDR_T_PC) { sca->point_code_indicator = 1; + /* ITU-T Q.713 states that signalling point codes are 14bit */ + if (in->pc > 0x3fff) { + LOGP(DLSUA, LOGL_ERROR, "Invalid Point Code %u requested\n", in->pc); + return -EINVAL; + } msgb_put_u16le(msg, in->pc & 0x3ff); } if (in->presence & OSMO_SCCP_ADDR_T_SSN) { sca->ssn_indicator = 1; + if (in->ssn > 0xff) { + LOGP(DLSUA, LOGL_ERROR, "Invalid SSN %u requested\n", in->ssn); + return -EINVAL; + } msgb_put_u8(msg, in->ssn); } @@ -277,6 +289,9 @@ msgb_put_u8(msg, (in->gt.npi << 4) | (odd ? 1 : 2)); msgb_put_u8(msg, in->gt.nai & 0x7f); break; + default: + LOGP(DLSUA, LOGL_ERROR, "Unsupported GTI %u requested\n", in->gt.gti); + return -EINVAL; } osmo_isup_party_encode(msg, in->gt.digits); -- To view, visit https://gerrit.osmocom.org/4444 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2a419343e55edad39c59e763d11046c5a439444d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 14:58:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 27 Oct 2017 14:58:22 +0000 Subject: osmo-bts[master]: octphy: override firmware version check In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/4446/1/src/osmo-bts-octphy/l1_oml.c File src/osmo-bts-octphy/l1_oml.c: Line 55: int no_fw_check = 0; It it's used as boolean, than why not use "bool" type for it to make that obvious? Line 1170: "Invalid header-file-version / dsp-firmware-version combination\n"); While at it, might make sense to print the actual versions too. -- To view, visit https://gerrit.osmocom.org/4446 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Oct 27 15:00:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 15:00:05 +0000 Subject: osmo-mgw[master]: network: add separate log category In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 I thin "newtwork" is extremely generic, as pretty much everything we do is transmitted over some type of network. Please be very clear and conscise in what this log category is about and name it accordingly. -- To view, visit https://gerrit.osmocom.org/4443 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I55a2711798d1d1c2c9ef2f3b7ebb8fdd78bd6ea2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 15:20:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 15:20:38 +0000 Subject: [PATCH] libosmocore[master]: osmo_char2bcd(): Implment hex digits a-f and A-F Message-ID: Review at https://gerrit.osmocom.org/4447 osmo_char2bcd(): Implment hex digits a-f and A-F osmo_bcd2char() has always supported both decimal and hex. However, osmo_char2bcd() use to only implement decimal digits. With this patch, it also suppots conversion of hex characters from ASCII to BCD. This would be relevant in cases where somebdoy would want to use 'code 11', 'code 12' or 'ST' signals in any addresses (SCCP GT e.g.) Change-Id: I7bbcc6de08024567ab64765c12d7de71df787a7a --- M src/utils.c 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/47/4447/1 diff --git a/src/utils.c b/src/utils.c index f5894d8..a62f5e9 100644 --- a/src/utils.c +++ b/src/utils.c @@ -117,7 +117,14 @@ */ uint8_t osmo_char2bcd(char c) { - return c - 0x30; + if (c >= '0' && c <= '9') + return c - 0x30; + else if (c >= 'A' && c <= 'F') + return 0xa + (c - 'A'); + else if (c >= 'a' && c <= 'f') + return 0xa + (c - 'a'); + else + return 0; } /*! Parse a string containing hexadecimal digits -- To view, visit https://gerrit.osmocom.org/4447 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7bbcc6de08024567ab64765c12d7de71df787a7a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 15:20:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 15:20:39 +0000 Subject: [PATCH] libosmocore[master]: Add unit tests for bcd2char and char2bcd conversion Message-ID: Review at https://gerrit.osmocom.org/4448 Add unit tests for bcd2char and char2bcd conversion Sounds stupid, but we actually didn't support hex nibbles in one of the two directions of the conversion, so let's make sure we test for this. Change-Id: I8445da54cc4f9b1cd64f286c2b238f4f7c87accb --- M tests/utils/utils_test.c M tests/utils/utils_test.ok 2 files changed, 60 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/4448/1 diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index 4a4b121..a6517f7 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -281,6 +281,47 @@ return pass; } +struct bcdcheck { + uint8_t bcd; + char ch; +}; + +static const struct bcdcheck bcdchecks[] = { + { 0, '0' }, + { 1, '1' }, + { 2, '2' }, + { 3, '3' }, + { 4, '4' }, + { 5, '5' }, + { 6, '6' }, + { 7, '7' }, + { 8, '8' }, + { 9, '9' }, + { 0xA, 'A' }, + { 0xB, 'B' }, + { 0xC, 'C' }, + { 0xD, 'D' }, + { 0xE, 'E' }, + { 0xF, 'F' }, +}; + +static void bcd_test(void) +{ + int i; + + printf("\nTesting BCD conversion\n"); + for (i = 0; i < ARRAY_SIZE(bcdchecks); i++) { + const struct bcdcheck *check = &bcdchecks[i]; + char ch = osmo_bcd2char(check->bcd); + printf("\tval=0x%x, expected=%c, found=%c\n", check->bcd, check->ch, ch); + OSMO_ASSERT(osmo_bcd2char(check->bcd) == check->ch); + /* test char -> bcd back-coversion */ + OSMO_ASSERT(osmo_char2bcd(ch) == check->bcd); + /* test for lowercase hex char */ + OSMO_ASSERT(osmo_char2bcd(tolower(ch)) == check->bcd); + } +} + int main(int argc, char **argv) { static const struct log_info log_info = {}; @@ -290,5 +331,6 @@ hexparse_test(); test_idtag_parsing(); test_is_hexstr(); + bcd_test(); return 0; } diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index 45156f7..33a185b 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -57,3 +57,21 @@ 26: pass str='BeadedBeeAced1EbbedDefacedFacade' min=32 max=32 even=1 expect=valid 27: pass str='C01ffedC1cadaeAc1d1f1edAcac1aB0a' min=32 max=32 even=0 expect=valid 28: pass str='DeafBeddedBabeAcceededFadedDecaff' min=32 max=32 even=0 expect=invalid + +Testing BCD conversion + val=0x0, expected=0, found=0 + val=0x1, expected=1, found=1 + val=0x2, expected=2, found=2 + val=0x3, expected=3, found=3 + val=0x4, expected=4, found=4 + val=0x5, expected=5, found=5 + val=0x6, expected=6, found=6 + val=0x7, expected=7, found=7 + val=0x8, expected=8, found=8 + val=0x9, expected=9, found=9 + val=0xa, expected=A, found=A + val=0xb, expected=B, found=B + val=0xc, expected=C, found=C + val=0xd, expected=D, found=D + val=0xe, expected=E, found=E + val=0xf, expected=F, found=F -- To view, visit https://gerrit.osmocom.org/4448 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8445da54cc4f9b1cd64f286c2b238f4f7c87accb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 15:22:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 15:22:12 +0000 Subject: libosmocore[master]: osmo_char2bcd(): Implment hex digits a-f and A-F In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4447 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7bbcc6de08024567ab64765c12d7de71df787a7a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 15:22:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 15:22:16 +0000 Subject: libosmocore[master]: Add unit tests for bcd2char and char2bcd conversion In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4448 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8445da54cc4f9b1cd64f286c2b238f4f7c87accb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 15:24:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 15:24:37 +0000 Subject: [PATCH] libosmocore[master]: Add unit tests for bcd2char and char2bcd conversion In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4448 to look at the new patch set (#2). Add unit tests for bcd2char and char2bcd conversion Sounds stupid, but we actually didn't support hex nibbles in one of the two directions of the conversion, so let's make sure we test for this. Change-Id: I8445da54cc4f9b1cd64f286c2b238f4f7c87accb --- M tests/utils/utils_test.c M tests/utils/utils_test.ok 2 files changed, 61 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/4448/2 diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index 4a4b121..e6d7ae8 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -26,6 +26,7 @@ #include #include +#include static void hexdump_test(void) { @@ -281,6 +282,47 @@ return pass; } +struct bcdcheck { + uint8_t bcd; + char ch; +}; + +static const struct bcdcheck bcdchecks[] = { + { 0, '0' }, + { 1, '1' }, + { 2, '2' }, + { 3, '3' }, + { 4, '4' }, + { 5, '5' }, + { 6, '6' }, + { 7, '7' }, + { 8, '8' }, + { 9, '9' }, + { 0xA, 'A' }, + { 0xB, 'B' }, + { 0xC, 'C' }, + { 0xD, 'D' }, + { 0xE, 'E' }, + { 0xF, 'F' }, +}; + +static void bcd_test(void) +{ + int i; + + printf("\nTesting BCD conversion\n"); + for (i = 0; i < ARRAY_SIZE(bcdchecks); i++) { + const struct bcdcheck *check = &bcdchecks[i]; + char ch = osmo_bcd2char(check->bcd); + printf("\tval=0x%x, expected=%c, found=%c\n", check->bcd, check->ch, ch); + OSMO_ASSERT(osmo_bcd2char(check->bcd) == check->ch); + /* test char -> bcd back-coversion */ + OSMO_ASSERT(osmo_char2bcd(ch) == check->bcd); + /* test for lowercase hex char */ + OSMO_ASSERT(osmo_char2bcd(tolower(ch)) == check->bcd); + } +} + int main(int argc, char **argv) { static const struct log_info log_info = {}; @@ -290,5 +332,6 @@ hexparse_test(); test_idtag_parsing(); test_is_hexstr(); + bcd_test(); return 0; } diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index 45156f7..33a185b 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -57,3 +57,21 @@ 26: pass str='BeadedBeeAced1EbbedDefacedFacade' min=32 max=32 even=1 expect=valid 27: pass str='C01ffedC1cadaeAc1d1f1edAcac1aB0a' min=32 max=32 even=0 expect=valid 28: pass str='DeafBeddedBabeAcceededFadedDecaff' min=32 max=32 even=0 expect=invalid + +Testing BCD conversion + val=0x0, expected=0, found=0 + val=0x1, expected=1, found=1 + val=0x2, expected=2, found=2 + val=0x3, expected=3, found=3 + val=0x4, expected=4, found=4 + val=0x5, expected=5, found=5 + val=0x6, expected=6, found=6 + val=0x7, expected=7, found=7 + val=0x8, expected=8, found=8 + val=0x9, expected=9, found=9 + val=0xa, expected=A, found=A + val=0xb, expected=B, found=B + val=0xc, expected=C, found=C + val=0xd, expected=D, found=D + val=0xe, expected=E, found=E + val=0xf, expected=F, found=F -- To view, visit https://gerrit.osmocom.org/4448 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8445da54cc4f9b1cd64f286c2b238f4f7c87accb Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 15:26:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 15:26:50 +0000 Subject: libosmocore[master]: Add unit tests for bcd2char and char2bcd conversion In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4448 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8445da54cc4f9b1cd64f286c2b238f4f7c87accb Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 15:26:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 15:26:52 +0000 Subject: [MERGED] libosmocore[master]: Add unit tests for bcd2char and char2bcd conversion In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add unit tests for bcd2char and char2bcd conversion ...................................................................... Add unit tests for bcd2char and char2bcd conversion Sounds stupid, but we actually didn't support hex nibbles in one of the two directions of the conversion, so let's make sure we test for this. Change-Id: I8445da54cc4f9b1cd64f286c2b238f4f7c87accb --- M tests/utils/utils_test.c M tests/utils/utils_test.ok 2 files changed, 61 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index 4a4b121..e6d7ae8 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -26,6 +26,7 @@ #include #include +#include static void hexdump_test(void) { @@ -281,6 +282,47 @@ return pass; } +struct bcdcheck { + uint8_t bcd; + char ch; +}; + +static const struct bcdcheck bcdchecks[] = { + { 0, '0' }, + { 1, '1' }, + { 2, '2' }, + { 3, '3' }, + { 4, '4' }, + { 5, '5' }, + { 6, '6' }, + { 7, '7' }, + { 8, '8' }, + { 9, '9' }, + { 0xA, 'A' }, + { 0xB, 'B' }, + { 0xC, 'C' }, + { 0xD, 'D' }, + { 0xE, 'E' }, + { 0xF, 'F' }, +}; + +static void bcd_test(void) +{ + int i; + + printf("\nTesting BCD conversion\n"); + for (i = 0; i < ARRAY_SIZE(bcdchecks); i++) { + const struct bcdcheck *check = &bcdchecks[i]; + char ch = osmo_bcd2char(check->bcd); + printf("\tval=0x%x, expected=%c, found=%c\n", check->bcd, check->ch, ch); + OSMO_ASSERT(osmo_bcd2char(check->bcd) == check->ch); + /* test char -> bcd back-coversion */ + OSMO_ASSERT(osmo_char2bcd(ch) == check->bcd); + /* test for lowercase hex char */ + OSMO_ASSERT(osmo_char2bcd(tolower(ch)) == check->bcd); + } +} + int main(int argc, char **argv) { static const struct log_info log_info = {}; @@ -290,5 +332,6 @@ hexparse_test(); test_idtag_parsing(); test_is_hexstr(); + bcd_test(); return 0; } diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index 45156f7..33a185b 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -57,3 +57,21 @@ 26: pass str='BeadedBeeAced1EbbedDefacedFacade' min=32 max=32 even=1 expect=valid 27: pass str='C01ffedC1cadaeAc1d1f1edAcac1aB0a' min=32 max=32 even=0 expect=valid 28: pass str='DeafBeddedBabeAcceededFadedDecaff' min=32 max=32 even=0 expect=invalid + +Testing BCD conversion + val=0x0, expected=0, found=0 + val=0x1, expected=1, found=1 + val=0x2, expected=2, found=2 + val=0x3, expected=3, found=3 + val=0x4, expected=4, found=4 + val=0x5, expected=5, found=5 + val=0x6, expected=6, found=6 + val=0x7, expected=7, found=7 + val=0x8, expected=8, found=8 + val=0x9, expected=9, found=9 + val=0xa, expected=A, found=A + val=0xb, expected=B, found=B + val=0xc, expected=C, found=C + val=0xd, expected=D, found=D + val=0xe, expected=E, found=E + val=0xf, expected=F, found=F -- To view, visit https://gerrit.osmocom.org/4448 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8445da54cc4f9b1cd64f286c2b238f4f7c87accb Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 15:26:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 15:26:52 +0000 Subject: [MERGED] libosmocore[master]: osmo_char2bcd(): Implment hex digits a-f and A-F In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_char2bcd(): Implment hex digits a-f and A-F ...................................................................... osmo_char2bcd(): Implment hex digits a-f and A-F osmo_bcd2char() has always supported both decimal and hex. However, osmo_char2bcd() use to only implement decimal digits. With this patch, it also suppots conversion of hex characters from ASCII to BCD. This would be relevant in cases where somebdoy would want to use 'code 11', 'code 12' or 'ST' signals in any addresses (SCCP GT e.g.) Change-Id: I7bbcc6de08024567ab64765c12d7de71df787a7a --- M src/utils.c 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/utils.c b/src/utils.c index f5894d8..a62f5e9 100644 --- a/src/utils.c +++ b/src/utils.c @@ -117,7 +117,14 @@ */ uint8_t osmo_char2bcd(char c) { - return c - 0x30; + if (c >= '0' && c <= '9') + return c - 0x30; + else if (c >= 'A' && c <= 'F') + return 0xa + (c - 'A'); + else if (c >= 'a' && c <= 'f') + return 0xa + (c - 'a'); + else + return 0; } /*! Parse a string containing hexadecimal digits -- To view, visit https://gerrit.osmocom.org/4447 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7bbcc6de08024567ab64765c12d7de71df787a7a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 15:41:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 15:41:30 +0000 Subject: [PATCH] libosmo-sccp[master]: implement unit tests for osmo_sccp_addr_{parse, encode}() Message-ID: Review at https://gerrit.osmocom.org/4449 implement unit tests for osmo_sccp_addr_{parse,encode}() The recent bug with chopped-off point codes in SCCP Address handling has shown that this code could need proper test cases. This patch adds a testsuite for SCCP address encoding and decoding. Related: OS#2441 Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86 --- M src/sccp2sua.c M src/xua_internal.h M tests/testsuite.at M tests/xua/xua_test.c A tests/xua/xua_test.err M tests/xua/xua_test.ok 6 files changed, 268 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/49/4449/1 diff --git a/src/sccp2sua.c b/src/sccp2sua.c index ac2b2c2..d97906e 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -262,6 +262,16 @@ goto out; } + if (in->gt.npi && (in->gt.npi > 0xF)) { + LOGP(DLSUA, LOGL_ERROR, "Unsupported Numbering Plan %u", in->gt.npi); + return -EINVAL; + } + + if (in->gt.nai && (in->gt.nai > 0x7F)) { + LOGP(DLSUA, LOGL_ERROR, "Unsupported Nature of Address %u", in->gt.nai); + return -EINVAL; + } + odd = strlen(in->gt.digits) & 1; switch (in->gt.gti) { case OSMO_SCCP_GTI_NO_GT: diff --git a/src/xua_internal.h b/src/xua_internal.h index 991110b..96bd153 100644 --- a/src/xua_internal.h +++ b/src/xua_internal.h @@ -77,3 +77,4 @@ unsigned int in_num_bytes, bool odd); int osmo_sccp_addr_parse(struct osmo_sccp_addr *out, const uint8_t *addr, unsigned int addrlen); +int osmo_sccp_addr_encode(struct msgb *msg, const struct osmo_sccp_addr *in); diff --git a/tests/testsuite.at b/tests/testsuite.at index b810bdf..ebc43e7 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -22,7 +22,8 @@ AT_SETUP([xua]) AT_KEYWORDS([xua]) cat $abs_srcdir/xua/xua_test.ok > expout -AT_CHECK([$abs_top_builddir/tests/xua/xua_test], [], [expout], [ignore]) +cat $abs_srcdir/xua/xua_test.err > experr +AT_CHECK([$abs_top_builddir/tests/xua/xua_test], [], [expout], [experr]) AT_CLEANUP AT_SETUP([ss7]) diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index c496cc4..d260e65 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -34,6 +34,7 @@ #include #include #include +#include static void test_isup_parse(void) { @@ -138,6 +139,183 @@ printf("sccp_addr_parse test case %u\n", i); test_sccp_addr_parse(&tcase->expected, tcase->bin, tcase->bin_len); } +} + +struct sccp_addr_enc_testcase { + const char *name; + struct osmo_sccp_addr addr_in; + int rc; + char *exp_out; +}; + +static const struct sccp_addr_enc_testcase enc_cases[] = { + { + .name = "NOGT-PC1024", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC, + .pc = 1024, + }, + .rc = 3, + .exp_out = "410004", + }, { + .name = "NOGT-PC16383", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC, + .pc = 16383, + }, + .rc = 3, + .exp_out = "41ff3f", + }, { + .name = "NOGT-PC16383-SSN90", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN, + .pc = 16383, + .ssn = 0x5A, + }, + .rc = 4, + .exp_out = "43ff3f5a", + }, { + .name = "GT-PC16383-NAIONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_GT, + .pc = 16383, + .gt.gti = OSMO_SCCP_GTI_NAI_ONLY, + .gt.nai = 0x7f, + }, + .rc = 4, + .exp_out = "45ff3f7f", + }, { + .name = "GT-NOPC-NAIONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_NAI_ONLY, + .gt.nai = 0x03, + }, + .rc = 2, + .exp_out = "0403", + }, { + .name = "GT-NOPC-TTONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_ONLY, + .gt.tt = 0x03, + }, + .rc = -EINVAL, + }, { + .name = "GT-NOPC-TT_NPL_ENC-ODD", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.digits = "123", + }, + .rc = 5, + .exp_out = "0c03112103", + }, { + .name = "GT-NOPC-TT_NPL_ENC-EVEN", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.digits = "1234", + }, + .rc = 5, + .exp_out = "0c03122143", + }, { + .name = "GT-NOPC-TT_NPL_ENC_NAI-EVEN", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC_NAI, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1234", + }, + .rc = 6, + .exp_out = "100312042143", + }, { + .name = "GT-NOPC-GTI_INVALID", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = 23, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1234", + }, + .rc = -EINVAL, + }, { + .name = "GT-NOPC-TT_NPL_ENC_NAI-EVEN-NONNUM", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC_NAI, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1ABF", + }, + .rc = 6, + .exp_out = "10031204a1fb", + }, + +}; + +static void testcase_sccp_addr_encdec(const struct sccp_addr_enc_testcase *tcase) +{ + struct msgb *msg = msgb_alloc(1024, "encdec"); + struct osmo_sccp_addr out; + char *str; + int rc; + + printf("\n=> %s\n", tcase->name); + + printf("input addr: %s\n", osmo_sccp_addr_dump(&tcase->addr_in)); + rc = osmo_sccp_addr_encode(msg, &tcase->addr_in); + printf("rc=%d, expected rc=%d\n", rc, tcase->rc); + OSMO_ASSERT(rc == tcase->rc); + + if (rc <= 0) { + msgb_free(msg); + return; + } + + str = osmo_hexdump_nospc(msg->data, msg->len); + printf("encoded addr: %s\n", str); + if (tcase->exp_out) { + printf("expected addr: %s\n", tcase->exp_out); + OSMO_ASSERT(!strcmp(tcase->exp_out, str)); + } + + rc = osmo_sccp_addr_parse(&out, msg->data, msg->len); + printf("decod addr: %s\n", osmo_sccp_addr_dump(&out)); + + OSMO_ASSERT(!memcmp(&out, &tcase->addr_in, sizeof(out))); + + msgb_free(msg); +} + +static void test_sccp_addr_encdec(void) +{ + int i; + + printf("Testing SCCP Address Encode/Decode\n"); + for (i = 0; i < ARRAY_SIZE(enc_cases); i++) { + testcase_sccp_addr_encdec(&enc_cases[i]); + } + printf("\n"); } /* sccp_addr_testcases[0].expected.gt transcoded into a SUA Global Title IE */ @@ -414,6 +592,7 @@ test_helpers(); test_sccp2sua(); test_rkm(); + test_sccp_addr_encdec(); printf("All tests passed.\n"); return 0; diff --git a/tests/xua/xua_test.err b/tests/xua/xua_test.err new file mode 100644 index 0000000..a7d4209 --- /dev/null +++ b/tests/xua/xua_test.err @@ -0,0 +1,3 @@ +<000f> sccp2sua.c:289 Unsupported Translation Type 2requested +<000f> sccp2sua.c:303 Unsupported GTI 23 requested + \ No newline at end of file diff --git a/tests/xua/xua_test.ok b/tests/xua/xua_test.ok index 12d817d..6b0cb33 100644 --- a/tests/xua/xua_test.ok +++ b/tests/xua/xua_test.ok @@ -132,4 +132,77 @@ SCCP Output: 09 81 03 0d 18 0a 12 07 00 12 04 53 84 09 00 17 0b 12 06 00 12 04 44 87 20 00 20 65 9a 65 81 97 48 04 26 00 01 98 49 04 51 01 03 df 6c 81 88 a1 81 85 02 01 44 02 01 07 30 80 a7 80 a0 80 04 01 2b 30 80 30 12 83 01 10 84 01 07 85 07 91 44 57 76 67 16 97 86 01 20 30 06 82 01 18 84 01 04 00 00 00 00 a3 06 04 01 42 84 01 05 a3 06 04 01 51 84 01 05 a3 06 04 01 31 84 01 05 a3 09 04 01 12 84 01 05 82 01 02 a3 09 04 01 11 84 01 05 81 01 01 a3 06 04 01 14 84 01 00 a3 0b 04 01 41 84 01 04 30 03 83 01 10 a3 0b 04 01 41 84 01 04 30 03 82 01 18 00 00 00 00 Parsing M3UA Message Parsing Nested M3UA Routing Key IE +Testing SCCP Address Encode/Decode + +=> NOGT-PC1024 +input addr: RI=2,PC=1024,GTI=0 +rc=3, expected rc=3 +encoded addr: 410004 +expected addr: 410004 +decod addr: RI=2,PC=1024,GTI=0 + +=> NOGT-PC16383 +input addr: RI=2,PC=16383,GTI=0 +rc=3, expected rc=3 +encoded addr: 41ff3f +expected addr: 41ff3f +decod addr: RI=2,PC=16383,GTI=0 + +=> NOGT-PC16383-SSN90 +input addr: RI=2,PC=16383,SSN=90,GTI=0 +rc=4, expected rc=4 +encoded addr: 43ff3f5a +expected addr: 43ff3f5a +decod addr: RI=2,PC=16383,SSN=90,GTI=0 + +=> GT-PC16383-NAIONLY +input addr: RI=2,PC=16383,GTI=1,GT=() +rc=4, expected rc=4 +encoded addr: 45ff3f7f +expected addr: 45ff3f7f +decod addr: RI=2,PC=16383,GTI=1,GT=() + +=> GT-NOPC-NAIONLY +input addr: RI=1,GTI=1,GT=() +rc=2, expected rc=2 +encoded addr: 0403 +expected addr: 0403 +decod addr: RI=1,GTI=1,GT=() + +=> GT-NOPC-TTONLY +input addr: RI=1,GTI=2,GT=(TT=3,DIG=) +rc=-22, expected rc=-22 + +=> GT-NOPC-TT_NPL_ENC-ODD +input addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) +rc=5, expected rc=5 +encoded addr: 0c03112103 +expected addr: 0c03112103 +decod addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) + +=> GT-NOPC-TT_NPL_ENC-EVEN +input addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) +rc=5, expected rc=5 +encoded addr: 0c03122143 +expected addr: 0c03122143 +decod addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) + +=> GT-NOPC-TT_NPL_ENC_NAI-EVEN +input addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) +rc=6, expected rc=6 +encoded addr: 100312042143 +expected addr: 100312042143 +decod addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) + +=> GT-NOPC-GTI_INVALID +input addr: RI=1,GTI=23,GT=(DIG=1234) +rc=-22, expected rc=-22 + +=> GT-NOPC-TT_NPL_ENC_NAI-EVEN-NONNUM +input addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) +rc=6, expected rc=6 +encoded addr: 10031204a1fb +expected addr: 10031204a1fb +decod addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) + All tests passed. -- To view, visit https://gerrit.osmocom.org/4449 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 15:55:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 15:55:25 +0000 Subject: [PATCH] libosmo-sccp[master]: implement unit tests for osmo_sccp_addr_{parse, encode}() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4449 to look at the new patch set (#2). implement unit tests for osmo_sccp_addr_{parse,encode}() The recent bug with chopped-off point codes in SCCP Address handling has shown that this code could need proper test cases. This patch adds a testsuite for SCCP address encoding and decoding. Related: OS#2441 Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86 --- M src/sccp2sua.c M src/xua_internal.h M tests/testsuite.at M tests/xua/xua_test.c A tests/xua/xua_test.err M tests/xua/xua_test.ok 6 files changed, 269 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/49/4449/2 diff --git a/src/sccp2sua.c b/src/sccp2sua.c index ac2b2c2..d97906e 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -262,6 +262,16 @@ goto out; } + if (in->gt.npi && (in->gt.npi > 0xF)) { + LOGP(DLSUA, LOGL_ERROR, "Unsupported Numbering Plan %u", in->gt.npi); + return -EINVAL; + } + + if (in->gt.nai && (in->gt.nai > 0x7F)) { + LOGP(DLSUA, LOGL_ERROR, "Unsupported Nature of Address %u", in->gt.nai); + return -EINVAL; + } + odd = strlen(in->gt.digits) & 1; switch (in->gt.gti) { case OSMO_SCCP_GTI_NO_GT: diff --git a/src/xua_internal.h b/src/xua_internal.h index 991110b..96bd153 100644 --- a/src/xua_internal.h +++ b/src/xua_internal.h @@ -77,3 +77,4 @@ unsigned int in_num_bytes, bool odd); int osmo_sccp_addr_parse(struct osmo_sccp_addr *out, const uint8_t *addr, unsigned int addrlen); +int osmo_sccp_addr_encode(struct msgb *msg, const struct osmo_sccp_addr *in); diff --git a/tests/testsuite.at b/tests/testsuite.at index b810bdf..ebc43e7 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -22,7 +22,8 @@ AT_SETUP([xua]) AT_KEYWORDS([xua]) cat $abs_srcdir/xua/xua_test.ok > expout -AT_CHECK([$abs_top_builddir/tests/xua/xua_test], [], [expout], [ignore]) +cat $abs_srcdir/xua/xua_test.err > experr +AT_CHECK([$abs_top_builddir/tests/xua/xua_test], [], [expout], [experr]) AT_CLEANUP AT_SETUP([ss7]) diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index c496cc4..5a9d0ab 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -34,6 +34,7 @@ #include #include #include +#include static void test_isup_parse(void) { @@ -138,6 +139,183 @@ printf("sccp_addr_parse test case %u\n", i); test_sccp_addr_parse(&tcase->expected, tcase->bin, tcase->bin_len); } +} + +struct sccp_addr_enc_testcase { + const char *name; + struct osmo_sccp_addr addr_in; + int rc; + char *exp_out; +}; + +static const struct sccp_addr_enc_testcase enc_cases[] = { + { + .name = "NOGT-PC1024", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC, + .pc = 1024, + }, + .rc = 3, + .exp_out = "410004", + }, { + .name = "NOGT-PC16383", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC, + .pc = 16383, + }, + .rc = 3, + .exp_out = "41ff3f", + }, { + .name = "NOGT-PC16383-SSN90", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN, + .pc = 16383, + .ssn = 0x5A, + }, + .rc = 4, + .exp_out = "43ff3f5a", + }, { + .name = "GT-PC16383-NAIONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_GT, + .pc = 16383, + .gt.gti = OSMO_SCCP_GTI_NAI_ONLY, + .gt.nai = 0x7f, + }, + .rc = 4, + .exp_out = "45ff3f7f", + }, { + .name = "GT-NOPC-NAIONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_NAI_ONLY, + .gt.nai = 0x03, + }, + .rc = 2, + .exp_out = "0403", + }, { + .name = "GT-NOPC-TTONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_ONLY, + .gt.tt = 0x03, + }, + .rc = -EINVAL, + }, { + .name = "GT-NOPC-TT_NPL_ENC-ODD", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.digits = "123", + }, + .rc = 5, + .exp_out = "0c03112103", + }, { + .name = "GT-NOPC-TT_NPL_ENC-EVEN", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.digits = "1234", + }, + .rc = 5, + .exp_out = "0c03122143", + }, { + .name = "GT-NOPC-TT_NPL_ENC_NAI-EVEN", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC_NAI, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1234", + }, + .rc = 6, + .exp_out = "100312042143", + }, { + .name = "GT-NOPC-GTI_INVALID", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = 23, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1234", + }, + .rc = -EINVAL, + }, { + .name = "GT-NOPC-TT_NPL_ENC_NAI-EVEN-NONNUM", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC_NAI, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1ABF", + }, + .rc = 6, + .exp_out = "10031204a1fb", + }, + +}; + +static void testcase_sccp_addr_encdec(const struct sccp_addr_enc_testcase *tcase) +{ + struct msgb *msg = msgb_alloc(1024, "encdec"); + struct osmo_sccp_addr out; + char *str; + int rc; + + printf("\n=> %s\n", tcase->name); + + printf("input addr: %s\n", osmo_sccp_addr_dump(&tcase->addr_in)); + rc = osmo_sccp_addr_encode(msg, &tcase->addr_in); + printf("rc=%d, expected rc=%d\n", rc, tcase->rc); + OSMO_ASSERT(rc == tcase->rc); + + if (rc <= 0) { + msgb_free(msg); + return; + } + + str = osmo_hexdump_nospc(msg->data, msg->len); + printf("encoded addr: %s\n", str); + if (tcase->exp_out) { + printf("expected addr: %s\n", tcase->exp_out); + OSMO_ASSERT(!strcmp(tcase->exp_out, str)); + } + + rc = osmo_sccp_addr_parse(&out, msg->data, msg->len); + printf("decod addr: %s\n", osmo_sccp_addr_dump(&out)); + + OSMO_ASSERT(!memcmp(&out, &tcase->addr_in, sizeof(out))); + + msgb_free(msg); +} + +static void test_sccp_addr_encdec(void) +{ + int i; + + printf("Testing SCCP Address Encode/Decode\n"); + for (i = 0; i < ARRAY_SIZE(enc_cases); i++) { + testcase_sccp_addr_encdec(&enc_cases[i]); + } + printf("\n"); } /* sccp_addr_testcases[0].expected.gt transcoded into a SUA Global Title IE */ @@ -408,12 +586,15 @@ log_init(&log_info, NULL); stderr_target = log_target_create_stderr(); log_add_target(stderr_target); + log_set_use_color(stderr_target, 0); + log_set_print_filename(stderr_target, 0); test_isup_parse(); test_sccp_addr_parser(); test_helpers(); test_sccp2sua(); test_rkm(); + test_sccp_addr_encdec(); printf("All tests passed.\n"); return 0; diff --git a/tests/xua/xua_test.err b/tests/xua/xua_test.err new file mode 100644 index 0000000..17870ee --- /dev/null +++ b/tests/xua/xua_test.err @@ -0,0 +1,2 @@ +Unsupported Translation Type 2requested +Unsupported GTI 23 requested diff --git a/tests/xua/xua_test.ok b/tests/xua/xua_test.ok index 12d817d..6b0cb33 100644 --- a/tests/xua/xua_test.ok +++ b/tests/xua/xua_test.ok @@ -132,4 +132,77 @@ SCCP Output: 09 81 03 0d 18 0a 12 07 00 12 04 53 84 09 00 17 0b 12 06 00 12 04 44 87 20 00 20 65 9a 65 81 97 48 04 26 00 01 98 49 04 51 01 03 df 6c 81 88 a1 81 85 02 01 44 02 01 07 30 80 a7 80 a0 80 04 01 2b 30 80 30 12 83 01 10 84 01 07 85 07 91 44 57 76 67 16 97 86 01 20 30 06 82 01 18 84 01 04 00 00 00 00 a3 06 04 01 42 84 01 05 a3 06 04 01 51 84 01 05 a3 06 04 01 31 84 01 05 a3 09 04 01 12 84 01 05 82 01 02 a3 09 04 01 11 84 01 05 81 01 01 a3 06 04 01 14 84 01 00 a3 0b 04 01 41 84 01 04 30 03 83 01 10 a3 0b 04 01 41 84 01 04 30 03 82 01 18 00 00 00 00 Parsing M3UA Message Parsing Nested M3UA Routing Key IE +Testing SCCP Address Encode/Decode + +=> NOGT-PC1024 +input addr: RI=2,PC=1024,GTI=0 +rc=3, expected rc=3 +encoded addr: 410004 +expected addr: 410004 +decod addr: RI=2,PC=1024,GTI=0 + +=> NOGT-PC16383 +input addr: RI=2,PC=16383,GTI=0 +rc=3, expected rc=3 +encoded addr: 41ff3f +expected addr: 41ff3f +decod addr: RI=2,PC=16383,GTI=0 + +=> NOGT-PC16383-SSN90 +input addr: RI=2,PC=16383,SSN=90,GTI=0 +rc=4, expected rc=4 +encoded addr: 43ff3f5a +expected addr: 43ff3f5a +decod addr: RI=2,PC=16383,SSN=90,GTI=0 + +=> GT-PC16383-NAIONLY +input addr: RI=2,PC=16383,GTI=1,GT=() +rc=4, expected rc=4 +encoded addr: 45ff3f7f +expected addr: 45ff3f7f +decod addr: RI=2,PC=16383,GTI=1,GT=() + +=> GT-NOPC-NAIONLY +input addr: RI=1,GTI=1,GT=() +rc=2, expected rc=2 +encoded addr: 0403 +expected addr: 0403 +decod addr: RI=1,GTI=1,GT=() + +=> GT-NOPC-TTONLY +input addr: RI=1,GTI=2,GT=(TT=3,DIG=) +rc=-22, expected rc=-22 + +=> GT-NOPC-TT_NPL_ENC-ODD +input addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) +rc=5, expected rc=5 +encoded addr: 0c03112103 +expected addr: 0c03112103 +decod addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) + +=> GT-NOPC-TT_NPL_ENC-EVEN +input addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) +rc=5, expected rc=5 +encoded addr: 0c03122143 +expected addr: 0c03122143 +decod addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) + +=> GT-NOPC-TT_NPL_ENC_NAI-EVEN +input addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) +rc=6, expected rc=6 +encoded addr: 100312042143 +expected addr: 100312042143 +decod addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) + +=> GT-NOPC-GTI_INVALID +input addr: RI=1,GTI=23,GT=(DIG=1234) +rc=-22, expected rc=-22 + +=> GT-NOPC-TT_NPL_ENC_NAI-EVEN-NONNUM +input addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) +rc=6, expected rc=6 +encoded addr: 10031204a1fb +expected addr: 10031204a1fb +decod addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) + All tests passed. -- To view, visit https://gerrit.osmocom.org/4449 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 16:00:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 16:00:17 +0000 Subject: [PATCH] libosmo-sccp[master]: implement unit tests for osmo_sccp_addr_{parse, encode}() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4449 to look at the new patch set (#3). implement unit tests for osmo_sccp_addr_{parse,encode}() The recent bug with chopped-off point codes in SCCP Address handling has shown that this code could need proper test cases. This patch adds a testsuite for SCCP address encoding and decoding. Related: OS#2441 Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86 --- M src/xua_internal.h M tests/testsuite.at M tests/xua/Makefile.am M tests/xua/xua_test.c A tests/xua/xua_test.err M tests/xua/xua_test.ok 6 files changed, 260 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/49/4449/3 diff --git a/src/xua_internal.h b/src/xua_internal.h index 991110b..96bd153 100644 --- a/src/xua_internal.h +++ b/src/xua_internal.h @@ -77,3 +77,4 @@ unsigned int in_num_bytes, bool odd); int osmo_sccp_addr_parse(struct osmo_sccp_addr *out, const uint8_t *addr, unsigned int addrlen); +int osmo_sccp_addr_encode(struct msgb *msg, const struct osmo_sccp_addr *in); diff --git a/tests/testsuite.at b/tests/testsuite.at index b810bdf..ebc43e7 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -22,7 +22,8 @@ AT_SETUP([xua]) AT_KEYWORDS([xua]) cat $abs_srcdir/xua/xua_test.ok > expout -AT_CHECK([$abs_top_builddir/tests/xua/xua_test], [], [expout], [ignore]) +cat $abs_srcdir/xua/xua_test.err > experr +AT_CHECK([$abs_top_builddir/tests/xua/xua_test], [], [expout], [experr]) AT_CLEANUP AT_SETUP([ss7]) diff --git a/tests/xua/Makefile.am b/tests/xua/Makefile.am index c6a9955..f56692b 100644 --- a/tests/xua/Makefile.am +++ b/tests/xua/Makefile.am @@ -5,7 +5,7 @@ LDADD = $(top_builddir)/src/libosmo-sigtran.la \ $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMONETIF_LIBS) $(LIBSCTP_LIBS) -EXTRA_DIST = xua_test.ok +EXTRA_DIST = xua_test.ok xua_test.err noinst_HEADERS = sccp_test_data.h noinst_PROGRAMS = xua_test diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index c496cc4..5a9d0ab 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -34,6 +34,7 @@ #include #include #include +#include static void test_isup_parse(void) { @@ -138,6 +139,183 @@ printf("sccp_addr_parse test case %u\n", i); test_sccp_addr_parse(&tcase->expected, tcase->bin, tcase->bin_len); } +} + +struct sccp_addr_enc_testcase { + const char *name; + struct osmo_sccp_addr addr_in; + int rc; + char *exp_out; +}; + +static const struct sccp_addr_enc_testcase enc_cases[] = { + { + .name = "NOGT-PC1024", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC, + .pc = 1024, + }, + .rc = 3, + .exp_out = "410004", + }, { + .name = "NOGT-PC16383", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC, + .pc = 16383, + }, + .rc = 3, + .exp_out = "41ff3f", + }, { + .name = "NOGT-PC16383-SSN90", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN, + .pc = 16383, + .ssn = 0x5A, + }, + .rc = 4, + .exp_out = "43ff3f5a", + }, { + .name = "GT-PC16383-NAIONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_GT, + .pc = 16383, + .gt.gti = OSMO_SCCP_GTI_NAI_ONLY, + .gt.nai = 0x7f, + }, + .rc = 4, + .exp_out = "45ff3f7f", + }, { + .name = "GT-NOPC-NAIONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_NAI_ONLY, + .gt.nai = 0x03, + }, + .rc = 2, + .exp_out = "0403", + }, { + .name = "GT-NOPC-TTONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_ONLY, + .gt.tt = 0x03, + }, + .rc = -EINVAL, + }, { + .name = "GT-NOPC-TT_NPL_ENC-ODD", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.digits = "123", + }, + .rc = 5, + .exp_out = "0c03112103", + }, { + .name = "GT-NOPC-TT_NPL_ENC-EVEN", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.digits = "1234", + }, + .rc = 5, + .exp_out = "0c03122143", + }, { + .name = "GT-NOPC-TT_NPL_ENC_NAI-EVEN", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC_NAI, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1234", + }, + .rc = 6, + .exp_out = "100312042143", + }, { + .name = "GT-NOPC-GTI_INVALID", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = 23, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1234", + }, + .rc = -EINVAL, + }, { + .name = "GT-NOPC-TT_NPL_ENC_NAI-EVEN-NONNUM", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC_NAI, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1ABF", + }, + .rc = 6, + .exp_out = "10031204a1fb", + }, + +}; + +static void testcase_sccp_addr_encdec(const struct sccp_addr_enc_testcase *tcase) +{ + struct msgb *msg = msgb_alloc(1024, "encdec"); + struct osmo_sccp_addr out; + char *str; + int rc; + + printf("\n=> %s\n", tcase->name); + + printf("input addr: %s\n", osmo_sccp_addr_dump(&tcase->addr_in)); + rc = osmo_sccp_addr_encode(msg, &tcase->addr_in); + printf("rc=%d, expected rc=%d\n", rc, tcase->rc); + OSMO_ASSERT(rc == tcase->rc); + + if (rc <= 0) { + msgb_free(msg); + return; + } + + str = osmo_hexdump_nospc(msg->data, msg->len); + printf("encoded addr: %s\n", str); + if (tcase->exp_out) { + printf("expected addr: %s\n", tcase->exp_out); + OSMO_ASSERT(!strcmp(tcase->exp_out, str)); + } + + rc = osmo_sccp_addr_parse(&out, msg->data, msg->len); + printf("decod addr: %s\n", osmo_sccp_addr_dump(&out)); + + OSMO_ASSERT(!memcmp(&out, &tcase->addr_in, sizeof(out))); + + msgb_free(msg); +} + +static void test_sccp_addr_encdec(void) +{ + int i; + + printf("Testing SCCP Address Encode/Decode\n"); + for (i = 0; i < ARRAY_SIZE(enc_cases); i++) { + testcase_sccp_addr_encdec(&enc_cases[i]); + } + printf("\n"); } /* sccp_addr_testcases[0].expected.gt transcoded into a SUA Global Title IE */ @@ -408,12 +586,15 @@ log_init(&log_info, NULL); stderr_target = log_target_create_stderr(); log_add_target(stderr_target); + log_set_use_color(stderr_target, 0); + log_set_print_filename(stderr_target, 0); test_isup_parse(); test_sccp_addr_parser(); test_helpers(); test_sccp2sua(); test_rkm(); + test_sccp_addr_encdec(); printf("All tests passed.\n"); return 0; diff --git a/tests/xua/xua_test.err b/tests/xua/xua_test.err new file mode 100644 index 0000000..17870ee --- /dev/null +++ b/tests/xua/xua_test.err @@ -0,0 +1,2 @@ +Unsupported Translation Type 2requested +Unsupported GTI 23 requested diff --git a/tests/xua/xua_test.ok b/tests/xua/xua_test.ok index 12d817d..6b0cb33 100644 --- a/tests/xua/xua_test.ok +++ b/tests/xua/xua_test.ok @@ -132,4 +132,77 @@ SCCP Output: 09 81 03 0d 18 0a 12 07 00 12 04 53 84 09 00 17 0b 12 06 00 12 04 44 87 20 00 20 65 9a 65 81 97 48 04 26 00 01 98 49 04 51 01 03 df 6c 81 88 a1 81 85 02 01 44 02 01 07 30 80 a7 80 a0 80 04 01 2b 30 80 30 12 83 01 10 84 01 07 85 07 91 44 57 76 67 16 97 86 01 20 30 06 82 01 18 84 01 04 00 00 00 00 a3 06 04 01 42 84 01 05 a3 06 04 01 51 84 01 05 a3 06 04 01 31 84 01 05 a3 09 04 01 12 84 01 05 82 01 02 a3 09 04 01 11 84 01 05 81 01 01 a3 06 04 01 14 84 01 00 a3 0b 04 01 41 84 01 04 30 03 83 01 10 a3 0b 04 01 41 84 01 04 30 03 82 01 18 00 00 00 00 Parsing M3UA Message Parsing Nested M3UA Routing Key IE +Testing SCCP Address Encode/Decode + +=> NOGT-PC1024 +input addr: RI=2,PC=1024,GTI=0 +rc=3, expected rc=3 +encoded addr: 410004 +expected addr: 410004 +decod addr: RI=2,PC=1024,GTI=0 + +=> NOGT-PC16383 +input addr: RI=2,PC=16383,GTI=0 +rc=3, expected rc=3 +encoded addr: 41ff3f +expected addr: 41ff3f +decod addr: RI=2,PC=16383,GTI=0 + +=> NOGT-PC16383-SSN90 +input addr: RI=2,PC=16383,SSN=90,GTI=0 +rc=4, expected rc=4 +encoded addr: 43ff3f5a +expected addr: 43ff3f5a +decod addr: RI=2,PC=16383,SSN=90,GTI=0 + +=> GT-PC16383-NAIONLY +input addr: RI=2,PC=16383,GTI=1,GT=() +rc=4, expected rc=4 +encoded addr: 45ff3f7f +expected addr: 45ff3f7f +decod addr: RI=2,PC=16383,GTI=1,GT=() + +=> GT-NOPC-NAIONLY +input addr: RI=1,GTI=1,GT=() +rc=2, expected rc=2 +encoded addr: 0403 +expected addr: 0403 +decod addr: RI=1,GTI=1,GT=() + +=> GT-NOPC-TTONLY +input addr: RI=1,GTI=2,GT=(TT=3,DIG=) +rc=-22, expected rc=-22 + +=> GT-NOPC-TT_NPL_ENC-ODD +input addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) +rc=5, expected rc=5 +encoded addr: 0c03112103 +expected addr: 0c03112103 +decod addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) + +=> GT-NOPC-TT_NPL_ENC-EVEN +input addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) +rc=5, expected rc=5 +encoded addr: 0c03122143 +expected addr: 0c03122143 +decod addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) + +=> GT-NOPC-TT_NPL_ENC_NAI-EVEN +input addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) +rc=6, expected rc=6 +encoded addr: 100312042143 +expected addr: 100312042143 +decod addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) + +=> GT-NOPC-GTI_INVALID +input addr: RI=1,GTI=23,GT=(DIG=1234) +rc=-22, expected rc=-22 + +=> GT-NOPC-TT_NPL_ENC_NAI-EVEN-NONNUM +input addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) +rc=6, expected rc=6 +encoded addr: 10031204a1fb +expected addr: 10031204a1fb +decod addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) + All tests passed. -- To view, visit https://gerrit.osmocom.org/4449 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 16:00:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 16:00:17 +0000 Subject: [PATCH] libosmo-sccp[master]: osmo_sccp_addr_encode(): Catch some more errors and log them Message-ID: Review at https://gerrit.osmocom.org/4450 osmo_sccp_addr_encode(): Catch some more errors and log them Log errors in case the user provides global title indicators or nature-of-address indicators that exceed the permitted value range Change-Id: I493b7810bdc58e448f496565ded36f9dce2c1226 --- M src/sccp2sua.c 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/50/4450/1 diff --git a/src/sccp2sua.c b/src/sccp2sua.c index ac2b2c2..d97906e 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -262,6 +262,16 @@ goto out; } + if (in->gt.npi && (in->gt.npi > 0xF)) { + LOGP(DLSUA, LOGL_ERROR, "Unsupported Numbering Plan %u", in->gt.npi); + return -EINVAL; + } + + if (in->gt.nai && (in->gt.nai > 0x7F)) { + LOGP(DLSUA, LOGL_ERROR, "Unsupported Nature of Address %u", in->gt.nai); + return -EINVAL; + } + odd = strlen(in->gt.digits) & 1; switch (in->gt.gti) { case OSMO_SCCP_GTI_NO_GT: -- To view, visit https://gerrit.osmocom.org/4450 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I493b7810bdc58e448f496565ded36f9dce2c1226 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 16:12:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 16:12:51 +0000 Subject: libosmo-sccp[master]: implement unit tests for osmo_sccp_addr_{parse, encode}() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4449 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 16:12:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 16:12:53 +0000 Subject: libosmo-sccp[master]: osmo_sccp_addr_encode(): Catch some more errors and log them In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4450 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I493b7810bdc58e448f496565ded36f9dce2c1226 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 16:12:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 16:12:55 +0000 Subject: [MERGED] libosmo-sccp[master]: osmo_sccp_addr_encode(): Catch some more errors and log them In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_sccp_addr_encode(): Catch some more errors and log them ...................................................................... osmo_sccp_addr_encode(): Catch some more errors and log them Log errors in case the user provides global title indicators or nature-of-address indicators that exceed the permitted value range Change-Id: I493b7810bdc58e448f496565ded36f9dce2c1226 --- M src/sccp2sua.c 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp2sua.c b/src/sccp2sua.c index ac2b2c2..d97906e 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -262,6 +262,16 @@ goto out; } + if (in->gt.npi && (in->gt.npi > 0xF)) { + LOGP(DLSUA, LOGL_ERROR, "Unsupported Numbering Plan %u", in->gt.npi); + return -EINVAL; + } + + if (in->gt.nai && (in->gt.nai > 0x7F)) { + LOGP(DLSUA, LOGL_ERROR, "Unsupported Nature of Address %u", in->gt.nai); + return -EINVAL; + } + odd = strlen(in->gt.digits) & 1; switch (in->gt.gti) { case OSMO_SCCP_GTI_NO_GT: -- To view, visit https://gerrit.osmocom.org/4450 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I493b7810bdc58e448f496565ded36f9dce2c1226 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 16:12:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 16:12:56 +0000 Subject: [MERGED] libosmo-sccp[master]: implement unit tests for osmo_sccp_addr_{parse, encode}() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: implement unit tests for osmo_sccp_addr_{parse,encode}() ...................................................................... implement unit tests for osmo_sccp_addr_{parse,encode}() The recent bug with chopped-off point codes in SCCP Address handling has shown that this code could need proper test cases. This patch adds a testsuite for SCCP address encoding and decoding. Related: OS#2441 Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86 --- M src/xua_internal.h M tests/testsuite.at M tests/xua/Makefile.am M tests/xua/xua_test.c A tests/xua/xua_test.err M tests/xua/xua_test.ok 6 files changed, 260 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/xua_internal.h b/src/xua_internal.h index 991110b..96bd153 100644 --- a/src/xua_internal.h +++ b/src/xua_internal.h @@ -77,3 +77,4 @@ unsigned int in_num_bytes, bool odd); int osmo_sccp_addr_parse(struct osmo_sccp_addr *out, const uint8_t *addr, unsigned int addrlen); +int osmo_sccp_addr_encode(struct msgb *msg, const struct osmo_sccp_addr *in); diff --git a/tests/testsuite.at b/tests/testsuite.at index b810bdf..ebc43e7 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -22,7 +22,8 @@ AT_SETUP([xua]) AT_KEYWORDS([xua]) cat $abs_srcdir/xua/xua_test.ok > expout -AT_CHECK([$abs_top_builddir/tests/xua/xua_test], [], [expout], [ignore]) +cat $abs_srcdir/xua/xua_test.err > experr +AT_CHECK([$abs_top_builddir/tests/xua/xua_test], [], [expout], [experr]) AT_CLEANUP AT_SETUP([ss7]) diff --git a/tests/xua/Makefile.am b/tests/xua/Makefile.am index c6a9955..f56692b 100644 --- a/tests/xua/Makefile.am +++ b/tests/xua/Makefile.am @@ -5,7 +5,7 @@ LDADD = $(top_builddir)/src/libosmo-sigtran.la \ $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMONETIF_LIBS) $(LIBSCTP_LIBS) -EXTRA_DIST = xua_test.ok +EXTRA_DIST = xua_test.ok xua_test.err noinst_HEADERS = sccp_test_data.h noinst_PROGRAMS = xua_test diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index c496cc4..5a9d0ab 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -34,6 +34,7 @@ #include #include #include +#include static void test_isup_parse(void) { @@ -138,6 +139,183 @@ printf("sccp_addr_parse test case %u\n", i); test_sccp_addr_parse(&tcase->expected, tcase->bin, tcase->bin_len); } +} + +struct sccp_addr_enc_testcase { + const char *name; + struct osmo_sccp_addr addr_in; + int rc; + char *exp_out; +}; + +static const struct sccp_addr_enc_testcase enc_cases[] = { + { + .name = "NOGT-PC1024", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC, + .pc = 1024, + }, + .rc = 3, + .exp_out = "410004", + }, { + .name = "NOGT-PC16383", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC, + .pc = 16383, + }, + .rc = 3, + .exp_out = "41ff3f", + }, { + .name = "NOGT-PC16383-SSN90", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN, + .pc = 16383, + .ssn = 0x5A, + }, + .rc = 4, + .exp_out = "43ff3f5a", + }, { + .name = "GT-PC16383-NAIONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_SSN_PC, + .presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_GT, + .pc = 16383, + .gt.gti = OSMO_SCCP_GTI_NAI_ONLY, + .gt.nai = 0x7f, + }, + .rc = 4, + .exp_out = "45ff3f7f", + }, { + .name = "GT-NOPC-NAIONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_NAI_ONLY, + .gt.nai = 0x03, + }, + .rc = 2, + .exp_out = "0403", + }, { + .name = "GT-NOPC-TTONLY", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_ONLY, + .gt.tt = 0x03, + }, + .rc = -EINVAL, + }, { + .name = "GT-NOPC-TT_NPL_ENC-ODD", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.digits = "123", + }, + .rc = 5, + .exp_out = "0c03112103", + }, { + .name = "GT-NOPC-TT_NPL_ENC-EVEN", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.digits = "1234", + }, + .rc = 5, + .exp_out = "0c03122143", + }, { + .name = "GT-NOPC-TT_NPL_ENC_NAI-EVEN", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC_NAI, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1234", + }, + .rc = 6, + .exp_out = "100312042143", + }, { + .name = "GT-NOPC-GTI_INVALID", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = 23, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1234", + }, + .rc = -EINVAL, + }, { + .name = "GT-NOPC-TT_NPL_ENC_NAI-EVEN-NONNUM", + .addr_in = { + .ri = OSMO_SCCP_RI_GT, + .presence = OSMO_SCCP_ADDR_T_GT, + .gt.gti = OSMO_SCCP_GTI_TT_NPL_ENC_NAI, + .gt.tt = 0x03, + .gt.npi = 1, + .gt.nai = 4, + .gt.digits = "1ABF", + }, + .rc = 6, + .exp_out = "10031204a1fb", + }, + +}; + +static void testcase_sccp_addr_encdec(const struct sccp_addr_enc_testcase *tcase) +{ + struct msgb *msg = msgb_alloc(1024, "encdec"); + struct osmo_sccp_addr out; + char *str; + int rc; + + printf("\n=> %s\n", tcase->name); + + printf("input addr: %s\n", osmo_sccp_addr_dump(&tcase->addr_in)); + rc = osmo_sccp_addr_encode(msg, &tcase->addr_in); + printf("rc=%d, expected rc=%d\n", rc, tcase->rc); + OSMO_ASSERT(rc == tcase->rc); + + if (rc <= 0) { + msgb_free(msg); + return; + } + + str = osmo_hexdump_nospc(msg->data, msg->len); + printf("encoded addr: %s\n", str); + if (tcase->exp_out) { + printf("expected addr: %s\n", tcase->exp_out); + OSMO_ASSERT(!strcmp(tcase->exp_out, str)); + } + + rc = osmo_sccp_addr_parse(&out, msg->data, msg->len); + printf("decod addr: %s\n", osmo_sccp_addr_dump(&out)); + + OSMO_ASSERT(!memcmp(&out, &tcase->addr_in, sizeof(out))); + + msgb_free(msg); +} + +static void test_sccp_addr_encdec(void) +{ + int i; + + printf("Testing SCCP Address Encode/Decode\n"); + for (i = 0; i < ARRAY_SIZE(enc_cases); i++) { + testcase_sccp_addr_encdec(&enc_cases[i]); + } + printf("\n"); } /* sccp_addr_testcases[0].expected.gt transcoded into a SUA Global Title IE */ @@ -408,12 +586,15 @@ log_init(&log_info, NULL); stderr_target = log_target_create_stderr(); log_add_target(stderr_target); + log_set_use_color(stderr_target, 0); + log_set_print_filename(stderr_target, 0); test_isup_parse(); test_sccp_addr_parser(); test_helpers(); test_sccp2sua(); test_rkm(); + test_sccp_addr_encdec(); printf("All tests passed.\n"); return 0; diff --git a/tests/xua/xua_test.err b/tests/xua/xua_test.err new file mode 100644 index 0000000..17870ee --- /dev/null +++ b/tests/xua/xua_test.err @@ -0,0 +1,2 @@ +Unsupported Translation Type 2requested +Unsupported GTI 23 requested diff --git a/tests/xua/xua_test.ok b/tests/xua/xua_test.ok index 12d817d..6b0cb33 100644 --- a/tests/xua/xua_test.ok +++ b/tests/xua/xua_test.ok @@ -132,4 +132,77 @@ SCCP Output: 09 81 03 0d 18 0a 12 07 00 12 04 53 84 09 00 17 0b 12 06 00 12 04 44 87 20 00 20 65 9a 65 81 97 48 04 26 00 01 98 49 04 51 01 03 df 6c 81 88 a1 81 85 02 01 44 02 01 07 30 80 a7 80 a0 80 04 01 2b 30 80 30 12 83 01 10 84 01 07 85 07 91 44 57 76 67 16 97 86 01 20 30 06 82 01 18 84 01 04 00 00 00 00 a3 06 04 01 42 84 01 05 a3 06 04 01 51 84 01 05 a3 06 04 01 31 84 01 05 a3 09 04 01 12 84 01 05 82 01 02 a3 09 04 01 11 84 01 05 81 01 01 a3 06 04 01 14 84 01 00 a3 0b 04 01 41 84 01 04 30 03 83 01 10 a3 0b 04 01 41 84 01 04 30 03 82 01 18 00 00 00 00 Parsing M3UA Message Parsing Nested M3UA Routing Key IE +Testing SCCP Address Encode/Decode + +=> NOGT-PC1024 +input addr: RI=2,PC=1024,GTI=0 +rc=3, expected rc=3 +encoded addr: 410004 +expected addr: 410004 +decod addr: RI=2,PC=1024,GTI=0 + +=> NOGT-PC16383 +input addr: RI=2,PC=16383,GTI=0 +rc=3, expected rc=3 +encoded addr: 41ff3f +expected addr: 41ff3f +decod addr: RI=2,PC=16383,GTI=0 + +=> NOGT-PC16383-SSN90 +input addr: RI=2,PC=16383,SSN=90,GTI=0 +rc=4, expected rc=4 +encoded addr: 43ff3f5a +expected addr: 43ff3f5a +decod addr: RI=2,PC=16383,SSN=90,GTI=0 + +=> GT-PC16383-NAIONLY +input addr: RI=2,PC=16383,GTI=1,GT=() +rc=4, expected rc=4 +encoded addr: 45ff3f7f +expected addr: 45ff3f7f +decod addr: RI=2,PC=16383,GTI=1,GT=() + +=> GT-NOPC-NAIONLY +input addr: RI=1,GTI=1,GT=() +rc=2, expected rc=2 +encoded addr: 0403 +expected addr: 0403 +decod addr: RI=1,GTI=1,GT=() + +=> GT-NOPC-TTONLY +input addr: RI=1,GTI=2,GT=(TT=3,DIG=) +rc=-22, expected rc=-22 + +=> GT-NOPC-TT_NPL_ENC-ODD +input addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) +rc=5, expected rc=5 +encoded addr: 0c03112103 +expected addr: 0c03112103 +decod addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) + +=> GT-NOPC-TT_NPL_ENC-EVEN +input addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) +rc=5, expected rc=5 +encoded addr: 0c03122143 +expected addr: 0c03122143 +decod addr: RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) + +=> GT-NOPC-TT_NPL_ENC_NAI-EVEN +input addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) +rc=6, expected rc=6 +encoded addr: 100312042143 +expected addr: 100312042143 +decod addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) + +=> GT-NOPC-GTI_INVALID +input addr: RI=1,GTI=23,GT=(DIG=1234) +rc=-22, expected rc=-22 + +=> GT-NOPC-TT_NPL_ENC_NAI-EVEN-NONNUM +input addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) +rc=6, expected rc=6 +encoded addr: 10031204a1fb +expected addr: 10031204a1fb +decod addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) + All tests passed. -- To view, visit https://gerrit.osmocom.org/4449 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 16:27:00 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Oct 2017 16:27:00 +0000 Subject: [PATCH] osmo-bts[master]: octphy: override firmware version check In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4446 to look at the new patch set (#2). octphy: override firmware version check When osmo-bts detects a mismatch between the firmware of the DSP and the header version which it was compile with, a hard exit is performed. In some cases this may hinder debugging/testing things. Implement a commandline option to intentinally override the check. Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59 --- M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-octphy/main.c 2 files changed, 23 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/4446/2 diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index d1d5bf6..d33166f 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -52,6 +52,8 @@ #include #include +int no_fw_check = 0; + /* Map OSMOCOM logical channel type to OctPHY Logical channel type */ static tOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM pchan_to_logChComb[_GSM_PCHAN_MAX] = { @@ -1161,11 +1163,23 @@ "Rx APP-INFO.resp (name='%s', desc='%s', ver='%s', ver_hdr='%s')\n", air->szName, air->szDescription, air->szVersion, ver_hdr); - /* Bail if dsp firmware does not match up the header version info */ + /* Check if the firmware version of the DSP matches the header files + * that were used to compile osmo-bts */ if (strcmp(air->szVersion, ver_hdr) != 0) { LOGP(DL1C, LOGL_ERROR, - "Invalid header-file / dsp-firmware combination, exiting...\n"); - exit(1); + "Invalid header-file-version / dsp-firmware-version combination\n"); + LOGP(DL1C, LOGL_ERROR, + "Expected firmware version: %s\n", ver_hdr); + LOGP(DL1C, LOGL_ERROR, + "Actual firmware version: %s\n", air->szVersion); + + if (no_fw_check == 0) { + LOGP(DL1C, LOGL_ERROR, + "use option -I to override the check (not recommened)\n"); + LOGP(DL1C, LOGL_ERROR, + "exiting...\n"); + exit(1); + } } talloc_replace(fl1h->info.app.name, fl1h, air->szName); diff --git a/src/osmo-bts-octphy/main.c b/src/osmo-bts-octphy/main.c index 0f4d0dd..045b868 100644 --- a/src/osmo-bts-octphy/main.c +++ b/src/osmo-bts-octphy/main.c @@ -51,6 +51,7 @@ #define RF_LOCK_PATH "/var/lock/bts_rf_lock" extern int pcu_direct; +extern int no_fw_check; int bts_model_print_help() { @@ -65,15 +66,19 @@ int option_idx = 0, c; static const struct option long_options[] = { /* specific to this hardware */ + { "no-fw-check", 0, 0, 'I' }, { 0, 0, 0, 0 } }; - c = getopt_long(argc, argv, "", + c = getopt_long(argc, argv, "I", long_options, &option_idx); if (c == -1) break; switch (c) { + case 'I': + no_fw_check = 1; + break; default: num_errors++; break; -- To view, visit https://gerrit.osmocom.org/4446 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 27 17:00:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 27 Oct 2017 17:00:38 +0000 Subject: [PATCH] osmo-sgsn[master]: Log GTP-U endpoints update Message-ID: Review at https://gerrit.osmocom.org/4451 Log GTP-U endpoints update * 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 --- M include/osmocom/sgsn/sgsn.h M src/gprs/gprs_gmm.c M src/gprs/sgsn_vty.c 3 files changed, 9 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/51/4451/1 diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index e4eda17..464a64f 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -10,6 +10,7 @@ #include #include +#include struct gprs_gsup_client; struct hostent; @@ -147,6 +148,7 @@ int sgsn_vty_init(struct sgsn_config *cfg); int sgsn_parse_config(const char *config_file); +char *sgsn_gtp_ntoa(struct ul16_t *ul); /* sgsn.c */ diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index d11ecce..147e001 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -120,6 +120,8 @@ { struct sgsn_pdp_ctx *pdp; llist_for_each_entry(pdp, &mm_ctx->pdp_list, list) { + LOGMMCTXP(LOGL_INFO, mm_ctx, "Changing GTP-U endpoints %s -> %s\n", + sgsn_gtp_ntoa(&pdp->lib->gsnlu), inet_ntoa(sgsn->cfg.gtp_listenaddr.sin_addr)); sgsn_pdp_upd_gtp_u(pdp, &sgsn->cfg.gtp_listenaddr.sin_addr, sizeof(sgsn->cfg.gtp_listenaddr.sin_addr)); diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index faac69b..496bd68 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -425,7 +425,7 @@ { 0, NULL } }; -static char *gtp_ntoa(struct ul16_t *ul) +char *sgsn_gtp_ntoa(struct ul16_t *ul) { if (ul->l == 4) { struct in_addr *ia = (struct in_addr *) ul; @@ -450,13 +450,13 @@ gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), VTY_NEWLINE); vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); + sgsn_gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); + sgsn_gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); + sgsn_gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + sgsn_gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); } vty_out_rate_ctr_group(vty, " ", pdp->ctrg); -- To view, visit https://gerrit.osmocom.org/4451 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I96d0f3a63cce338471cc39cc33fd44c39cd2aa73 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Oct 27 17:00:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 27 Oct 2017 17:00:38 +0000 Subject: [PATCH] osmo-sgsn[master]: Log address on GTP creation Message-ID: Review at https://gerrit.osmocom.org/4452 Log address on GTP creation Change-Id: Ic54a2ff835c9a0ceccf2f718f56371a881dd25b7 --- M src/gprs/sgsn_libgtp.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/52/4452/1 diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 04735e2..1032230 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -836,6 +836,8 @@ LOGP(DGPRS, LOGL_ERROR, "Failed to create GTP: %d\n", rc); return rc; } + LOGP(DGPRS, LOGL_NOTICE, "Created GTP on %s\n", inet_ntoa(sgi->cfg.gtp_listenaddr.sin_addr)); + gsn = sgi->gsn; if (gsn->mode != GTP_MODE_SGSN) -- To view, visit https://gerrit.osmocom.org/4452 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic54a2ff835c9a0ceccf2f718f56371a881dd25b7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From admin at opensuse.org Fri Oct 27 15:56:29 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 15:56:29 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f36e96f073e_718e50ef74959716@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 190s] To: [ 190s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 190s] [ 190s] You may investigate any problem if you feel able to do so, in which [ 190s] case the test suite provides a good starting point. Its output may [ 190s] be found below `tests/testsuite.dir'. [ 190s] [ 190s] Makefile:1221: recipe for target 'check-local' failed [ 190s] make[3]: *** [check-local] Error 1 [ 190s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 190s] Makefile:1055: recipe for target 'check-am' failed [ 190s] make[2]: *** [check-am] Error 2 [ 190s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 190s] Makefile:460: recipe for target 'check-recursive' failed [ 190s] make[1]: *** [check-recursive] Error 1 [ 190s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 190s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 190s] debian/rules:12: recipe for target 'build' failed [ 190s] make: *** [build] Error 2 [ 190s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 190s] [ 190s] lamb04 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 15:56:09 UTC 2017. [ 190s] [ 190s] ### VM INTERACTION START ### [ 193s] [ 186.212930] reboot: Power down [ 193s] ### VM INTERACTION END ### [ 193s] [ 193s] lamb04 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 15:56:12 UTC 2017. [ 193s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 15:58:12 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 15:58:12 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f36edf500b6_718e50ef7496039d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 233s] To: [ 233s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 233s] [ 233s] You may investigate any problem if you feel able to do so, in which [ 233s] case the test suite provides a good starting point. Its output may [ 233s] be found below `tests/testsuite.dir'. [ 233s] [ 233s] Makefile:1221: recipe for target 'check-local' failed [ 233s] make[3]: *** [check-local] Error 1 [ 233s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 233s] Makefile:1055: recipe for target 'check-am' failed [ 233s] make[2]: *** [check-am] Error 2 [ 233s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 233s] Makefile:460: recipe for target 'check-recursive' failed [ 233s] make[1]: *** [check-recursive] Error 1 [ 233s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 233s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 233s] debian/rules:12: recipe for target 'build' failed [ 233s] make: *** [build] Error 2 [ 233s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 233s] [ 233s] wildcard2 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 15:57:48 UTC 2017. [ 233s] [ 233s] ### VM INTERACTION START ### [ 236s] [ 175.098316] reboot: Power down [ 250s] ### VM INTERACTION END ### [ 250s] [ 250s] wildcard2 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 15:58:05 UTC 2017. [ 250s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 15:59:21 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 15:59:21 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f36ee484da_718e50ef749606b9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 132s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 132s] [ 132s] You may investigate any problem if you feel able to do so, in which [ 132s] case the test suite provides a good starting point. Its output may [ 132s] be found below `tests/testsuite.dir'. [ 132s] [ 132s] Makefile:1208: recipe for target 'check-local' failed [ 132s] make[3]: *** [check-local] Error 1 [ 132s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 132s] Makefile:1044: recipe for target 'check-am' failed [ 132s] make[2]: *** [check-am] Error 2 [ 132s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 132s] Makefile:448: recipe for target 'check-recursive' failed [ 132s] make[1]: *** [check-recursive] Error 1 [ 132s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 132s] dh_auto_test: make -j1 check returned exit code 2 [ 132s] debian/rules:12: recipe for target 'build' failed [ 132s] make: *** [build] Error 2 [ 132s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 132s] [ 132s] lamb06 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 15:59:03 UTC 2017. [ 132s] [ 132s] ### VM INTERACTION START ### [ 133s] Powering off. [ 133s] [ 125.863744] reboot: Power down [ 133s] ### VM INTERACTION END ### [ 133s] [ 133s] lamb06 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 15:59:05 UTC 2017. [ 133s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 16:00:29 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 16:00:29 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f36ee91c855_718e50ef74960989@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 157s] To: [ 157s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 157s] [ 157s] You may investigate any problem if you feel able to do so, in which [ 157s] case the test suite provides a good starting point. Its output may [ 157s] be found below `tests/testsuite.dir'. [ 157s] [ 157s] Makefile:1221: recipe for target 'check-local' failed [ 157s] make[3]: *** [check-local] Error 1 [ 157s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 157s] Makefile:1055: recipe for target 'check-am' failed [ 157s] make[2]: *** [check-am] Error 2 [ 157s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 157s] Makefile:460: recipe for target 'check-recursive' failed [ 157s] make[1]: *** [check-recursive] Error 1 [ 157s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 157s] dh_auto_test: make -j1 check returned exit code 2 [ 157s] debian/rules:12: recipe for target 'build' failed [ 157s] make: *** [build] Error 2 [ 157s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 157s] [ 157s] lamb62 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:00:08 UTC 2017. [ 157s] [ 157s] ### VM INTERACTION START ### [ 160s] [ 153.400099] reboot: Power down [ 160s] ### VM INTERACTION END ### [ 160s] [ 160s] lamb62 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:00:12 UTC 2017. [ 160s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 16:01:21 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 16:01:21 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f36eec7e0fa_718e50ef749611fa@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 169s] To: [ 169s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 169s] [ 169s] You may investigate any problem if you feel able to do so, in which [ 169s] case the test suite provides a good starting point. Its output may [ 169s] be found below `tests/testsuite.dir'. [ 169s] [ 169s] Makefile:1221: recipe for target 'check-local' failed [ 169s] make[3]: *** [check-local] Error 1 [ 169s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 169s] Makefile:1055: recipe for target 'check-am' failed [ 169s] make[2]: *** [check-am] Error 2 [ 169s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 170s] Makefile:460: recipe for target 'check-recursive' failed [ 170s] make[1]: *** [check-recursive] Error 1 [ 170s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 170s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 170s] debian/rules:12: recipe for target 'build' failed [ 170s] make: *** [build] Error 2 [ 170s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 170s] [ 170s] lamb51 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:01:12 UTC 2017. [ 170s] [ 170s] ### VM INTERACTION START ### [ 173s] [ 166.013976] reboot: Power down [ 173s] ### VM INTERACTION END ### [ 173s] [ 173s] lamb51 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:01:16 UTC 2017. [ 173s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 16:01:38 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 16:01:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f36ef5427e_718e50ef74961247@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 247s] To: [ 247s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 247s] [ 247s] You may investigate any problem if you feel able to do so, in which [ 247s] case the test suite provides a good starting point. Its output may [ 247s] be found below `tests/testsuite.dir'. [ 247s] [ 247s] Makefile:1221: recipe for target 'check-local' failed [ 247s] make[3]: *** [check-local] Error 1 [ 247s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 247s] Makefile:1055: recipe for target 'check-am' failed [ 247s] make[2]: *** [check-am] Error 2 [ 247s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 247s] Makefile:460: recipe for target 'check-recursive' failed [ 247s] make[1]: *** [check-recursive] Error 1 [ 247s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 247s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 247s] debian/rules:12: recipe for target 'build' failed [ 247s] make: *** [build] Error 2 [ 247s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 247s] [ 247s] cloud115 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:01:26 UTC 2017. [ 247s] [ 247s] ### VM INTERACTION START ### [ 250s] [ 219.900128] reboot: Power down [ 251s] ### VM INTERACTION END ### [ 251s] [ 252s] cloud115 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:01:32 UTC 2017. [ 252s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 16:01:55 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 16:01:55 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f36ef68f9ff_718e50ef749613e4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 191s] To: [ 191s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 191s] [ 191s] You may investigate any problem if you feel able to do so, in which [ 191s] case the test suite provides a good starting point. Its output may [ 191s] be found below `tests/testsuite.dir'. [ 191s] [ 191s] Makefile:1221: recipe for target 'check-local' failed [ 191s] make[3]: *** [check-local] Error 1 [ 191s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 191s] Makefile:1055: recipe for target 'check-am' failed [ 191s] make[2]: *** [check-am] Error 2 [ 191s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 191s] Makefile:460: recipe for target 'check-recursive' failed [ 191s] make[1]: *** [check-recursive] Error 1 [ 191s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 191s] dh_auto_test: make -j1 check returned exit code 2 [ 191s] debian/rules:12: recipe for target 'build' failed [ 191s] make: *** [build] Error 2 [ 191s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 191s] [ 191s] build31 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:01:48 UTC 2017. [ 191s] [ 191s] ### VM INTERACTION START ### [ 195s] [ 188.221420] reboot: Power down [ 195s] ### VM INTERACTION END ### [ 195s] [ 195s] build31 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:01:52 UTC 2017. [ 195s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 16:03:38 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 16:03:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f36f07d635f_718e50ef749619a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 158s] To: [ 158s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 158s] [ 158s] You may investigate any problem if you feel able to do so, in which [ 158s] case the test suite provides a good starting point. Its output may [ 158s] be found below `tests/testsuite.dir'. [ 158s] [ 158s] Makefile:1221: recipe for target 'check-local' failed [ 158s] make[3]: *** [check-local] Error 1 [ 158s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 158s] Makefile:1055: recipe for target 'check-am' failed [ 158s] make[2]: *** [check-am] Error 2 [ 158s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 158s] Makefile:460: recipe for target 'check-recursive' failed [ 158s] make[1]: *** [check-recursive] Error 1 [ 158s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 158s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 158s] debian/rules:12: recipe for target 'build' failed [ 158s] make: *** [build] Error 2 [ 158s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 158s] [ 158s] lamb05 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:03:29 UTC 2017. [ 158s] [ 158s] ### VM INTERACTION START ### [ 161s] [ 154.387641] reboot: Power down [ 161s] ### VM INTERACTION END ### [ 161s] [ 161s] lamb05 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:03:32 UTC 2017. [ 161s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 16:04:29 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 16:04:29 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f36f0ba0b84_718e50ef749623a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 166s] To: [ 166s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 166s] [ 166s] You may investigate any problem if you feel able to do so, in which [ 166s] case the test suite provides a good starting point. Its output may [ 166s] be found below `tests/testsuite.dir'. [ 166s] [ 166s] Makefile:1221: recipe for target 'check-local' failed [ 166s] make[3]: *** [check-local] Error 1 [ 166s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 166s] Makefile:1055: recipe for target 'check-am' failed [ 166s] make[2]: *** [check-am] Error 2 [ 166s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 166s] Makefile:460: recipe for target 'check-recursive' failed [ 166s] make[1]: *** [check-recursive] Error 1 [ 166s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 166s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 166s] debian/rules:12: recipe for target 'build' failed [ 166s] make: *** [build] Error 2 [ 166s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 166s] [ 166s] lamb27 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:04:20 UTC 2017. [ 166s] [ 166s] ### VM INTERACTION START ### [ 169s] [ 161.315733] reboot: Power down [ 169s] ### VM INTERACTION END ### [ 169s] [ 169s] lamb27 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:04:24 UTC 2017. [ 169s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 16:04:46 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 16:04:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f36f0c763df_718e50ef7496245b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 162s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 162s] [ 162s] You may investigate any problem if you feel able to do so, in which [ 162s] case the test suite provides a good starting point. Its output may [ 162s] be found below `tests/testsuite.dir'. [ 162s] [ 162s] Makefile:1208: recipe for target 'check-local' failed [ 162s] make[3]: *** [check-local] Error 1 [ 162s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 162s] Makefile:1044: recipe for target 'check-am' failed [ 162s] make[2]: *** [check-am] Error 2 [ 162s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 162s] Makefile:448: recipe for target 'check-recursive' failed [ 162s] make[1]: *** [check-recursive] Error 1 [ 162s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 162s] dh_auto_test: make -j1 check returned exit code 2 [ 162s] debian/rules:12: recipe for target 'build' failed [ 162s] make: *** [build] Error 2 [ 162s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 162s] [ 162s] lamb26 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:04:32 UTC 2017. [ 162s] [ 162s] ### VM INTERACTION START ### [ 163s] Powering off. [ 163s] [ 152.816643] reboot: Power down [ 163s] ### VM INTERACTION END ### [ 163s] [ 163s] lamb26 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:04:33 UTC 2017. [ 163s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 16:04:46 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 16:04:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f36f0d72f42_718e50ef749625ee@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 334s] To: [ 334s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 334s] [ 334s] You may investigate any problem if you feel able to do so, in which [ 334s] case the test suite provides a good starting point. Its output may [ 334s] be found below `tests/testsuite.dir'. [ 334s] [ 334s] Makefile:1221: recipe for target 'check-local' failed [ 334s] make[3]: *** [check-local] Error 1 [ 334s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 334s] Makefile:1055: recipe for target 'check-am' failed [ 334s] make[2]: *** [check-am] Error 2 [ 334s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 334s] Makefile:460: recipe for target 'check-recursive' failed [ 334s] make[1]: *** [check-recursive] Error 1 [ 334s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 334s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 334s] debian/rules:12: recipe for target 'build' failed [ 334s] make: *** [build] Error 2 [ 334s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 334s] [ 334s] lamb17 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:04:40 UTC 2017. [ 334s] [ 334s] ### VM INTERACTION START ### [ 337s] [ 319.889561] reboot: Power down [ 337s] ### VM INTERACTION END ### [ 337s] [ 337s] lamb17 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 16:04:44 UTC 2017. [ 337s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:18:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:18:45 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_libosmocore=5Bmaster=5D=3A_Bump_version=3A_0=2E9=2E6=2E447-de99_=E2=86=92_0=2E10=2E0?= Message-ID: Review at https://gerrit.osmocom.org/4453 Bump version: 0.9.6.447-de99 ? 0.10.0 It's been way too long since the last release. Almost one year and 468 commits. A brief summary of the changes below: * Doxygen for libosmo{coding,gb} * pseudotalloc for embedded builds, jenkins for arm-none-gnueabi * --disable-doxygen, --disable-ctrl, --disable-simd * update debian packaging * gsm0503 coding routines * osmo_hton[sl] * statistics.h -> counter.h * QCDIAG in gsmtap * llist_{first,last}_entry() * llist_count() * LOGPSRC() macro * msgb_pull_to_l2() * msgb_printf() * prbs * osmo_sock_init2() * osmo_sock_mcast_{name,loop_set,ttl_set,all_set,subscribe,ip}() * OSMO_STRINGIFY() * OSMO_VALUE_STRING() * OSMO_BYTES_FOR_BITS() * osmo_talloc_asprintf() * osmo_sub_auth_type_name() * osmo_sub_auth_data support for IND/SQN_MS * osmo_fsm ctrl interface * ctrl_handle_alloc2() * ctrl_interface_setup_dynip2() * OSMO_CTRL_PORT_HLR * bssgp_tx_bvc_ptp_reset() * gprs_ns_inst connect/remote_{ip,port} * osmo_gprs_{ul,dl}_block_size_{bits,bytes}() * osmo_gprs_{dl,ul}_cs_by_block_bytes() * gprs_ns_pdu_strings[] * more BSSGP cause values * abis_nm_admin_name() * AoIP support in gsm0808 * gsm_fn_as_gsmtime_str() * osmo_dump_gsmtime() * gsup charging support * ipa_ccm_make_id_resp() * ipa_ccm_make_id_resp_from_req() * struct gsm48_gprs_susp_req * gsm_04_14.h * rsl measurement preprocessing related IEs * abis_nm_event_cause_names[] * abis_nm_sw_desc and friends * more SYSINFO_TYPE_ values * osmo_earfcn_bit_size_ext() * t16lv_put() * msgb_t16lv_put() * tlvp_val16be() * tlvp_val32be() * osmo_tlvp_copy() * osmo_tlvp_merge() * many additional VTY nodes * cmd_node.name member * bitvec_set_u64() * bitvec_rl_curbit * ctrl_lookup_register() * osmo_fsm_find_by_name() * osmo_fsm_inst_find_by_name() * osmo_fsm_inst_find_by_id() Change-Id: Ieb5db2e910a90db780ea058b3280f2facbd68d76 --- M TODO-RELEASE M debian/changelog M debian/control R debian/libosmocore9.install R debian/libosmoctrl1.install R debian/libosmogb5.install R debian/libosmogsm8.install R debian/libosmovty4.install M src/Makefile.am M src/ctrl/Makefile.am M src/gb/Makefile.am M src/gsm/Makefile.am M src/sim/Makefile.am M src/vty/Makefile.am 14 files changed, 29 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/53/4453/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index e5a6f70..fb0bfea 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,9 +7,3 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -libosmocore new function osmo_sock_get_name() -libosmogsm/gsup ABI change fix AUTS length to 14, not 16 (length is implicit) -libosmogsm/oap ABI change fix AUTS length to 14, not 16 (length is implicit) -osmo-auc-gen UI change fix AUTS length to 14, not 16 (length is implicit) -libosmovty ABI change redefine _LAST_OSMOVTY_NODE as a high number to increase node space -libosmogb ABI change add struct members nsip.remote_ip, and nsip.remote_port to struct gprs_ns_inst \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index a5ca3d6..3b689e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libosmocore (0.10.0+nmu1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * New upstream release of libosmocore + + -- Harald Welte Fri, 27 Oct 2017 19:45:00 +0200 + libosmocore (0.9.6) unstable; urgency=medium * doc: osmocom-authn-protocol.txt: fix numbering, mark unused sync msgs diff --git a/debian/control b/debian/control index b19448e..8ba5583 100644 --- a/debian/control +++ b/debian/control @@ -26,11 +26,11 @@ Multi-Arch: foreign Depends: libosmocodec0 (= ${binary:Version}), libosmocoding0 (= ${binary:Version}), - libosmocore8 (= ${binary:Version}), - libosmogb4 (= ${binary:Version}), - libosmogsm7 (= ${binary:Version}), - libosmovty3 (= ${binary:Version}), - libosmoctrl0 (= ${binary:Version}), + libosmocore9 (= ${binary:Version}), + libosmogb5 (= ${binary:Version}), + libosmogsm8 (= ${binary:Version}), + libosmovty4 (= ${binary:Version}), + libosmoctrl1 (= ${binary:Version}), libosmosim0 (= ${binary:Version}), ${misc:Depends} Description: Open Source MObile COMmunications CORE library (metapackage) @@ -109,7 +109,7 @@ . This package contains the documentation for the libosmocoding library. -Package: libosmocore8 +Package: libosmocore9 Section: libs Architecture: any Multi-Arch: same @@ -123,14 +123,14 @@ (at least) other programs that are developed in the sphere of Free Software / Open Source mobile communication. . - The libosmocore8 library in particular is a collection of common code used in + The libosmocore9 library in particular is a collection of common code used in various sub-projects inside the Osmocom family of projects. Package: libosmocore-doc Architecture: all Section: doc Depends: ${misc:Depends}, - libosmocore8, + libosmocore9, libjs-jquery, libosmocodec-doc, libosmocoding-doc, @@ -145,7 +145,7 @@ . This package contains the documentation for the libosmocore library. -Package: libosmogb4 +Package: libosmogb5 Section: libs Architecture: any Multi-Arch: same @@ -166,7 +166,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmogb4, + libosmogb5, libjs-jquery Description: Documentation for the Osmo GPRS Gb library This is part of the libosmocore "meta"-library. The libosmocore library @@ -177,7 +177,7 @@ . This package contains the documentation for the libosmogb library. -Package: libosmogsm7 +Package: libosmogsm8 Section: libs Architecture: any Multi-Arch: same @@ -201,7 +201,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmogsm7, + libosmogsm8, libjs-jquery Description: Documentation for the Osmo GSM utility library This is part of the libosmocore "meta"-library. The libosmocore library @@ -212,7 +212,7 @@ . This package contains the documentation for the libosmogsm library. -Package: libosmovty3 +Package: libosmovty4 Section: libs Architecture: any Multi-Arch: same @@ -233,7 +233,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmovty3, + libosmovty4, libjs-jquery Description: Documentation for the Osmo VTY library This is part of the libosmocore "meta"-library. The libosmocore library @@ -244,7 +244,7 @@ . This package contains the documentation for the libosmovty library. -Package: libosmoctrl0 +Package: libosmoctrl1 Section: libs Architecture: any Multi-Arch: same @@ -258,7 +258,7 @@ (at least) other programs that are developed in the sphere of Free Software / Open Source mobile communication. . - The libosmoctrl library in particular contains an SNMP-like status interface. + The libosmoctrl1 library in particular contains an SNMP-like status interface. Package: libosmosim0 Section: libs diff --git a/debian/libosmocore8.install b/debian/libosmocore9.install similarity index 100% rename from debian/libosmocore8.install rename to debian/libosmocore9.install diff --git a/debian/libosmoctrl0.install b/debian/libosmoctrl1.install similarity index 100% rename from debian/libosmoctrl0.install rename to debian/libosmoctrl1.install diff --git a/debian/libosmogb4.install b/debian/libosmogb5.install similarity index 100% rename from debian/libosmogb4.install rename to debian/libosmogb5.install diff --git a/debian/libosmogsm7.install b/debian/libosmogsm8.install similarity index 100% rename from debian/libosmogsm7.install rename to debian/libosmogsm8.install diff --git a/debian/libosmovty3.install b/debian/libosmovty4.install similarity index 100% rename from debian/libosmovty3.install rename to debian/libosmovty4.install diff --git a/src/Makefile.am b/src/Makefile.am index 4925eed..cff5f44 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=8:0:0 +LIBVERSION=9:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) diff --git a/src/ctrl/Makefile.am b/src/ctrl/Makefile.am index e8d55e6..8e10c6b 100644 --- a/src/ctrl/Makefile.am +++ b/src/ctrl/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=0:0:0 +LIBVERSION=1:0:1 AM_CFLAGS = -Wall $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) diff --git a/src/gb/Makefile.am b/src/gb/Makefile.am index 68aed13..199e16e 100644 --- a/src/gb/Makefile.am +++ b/src/gb/Makefile.am @@ -1,6 +1,6 @@ # This is _NOT_ the library release version, it's an API version. # Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification -LIBVERSION=4:0:0 +LIBVERSION=5:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} -fno-strict-aliasing $(TALLOC_CFLAGS) diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 48b8b2c..9b52f03 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=7:0:1 +LIBVERSION=8:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} diff --git a/src/sim/Makefile.am b/src/sim/Makefile.am index ba23ebc..9590d6c 100644 --- a/src/sim/Makefile.am +++ b/src/sim/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=0:0:0 +LIBVERSION=0:1:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -fPIC -Wall $(PCSC_CFLAGS) $(TALLOC_CFLAGS) diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index 1dc76c3..32b38fb 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=3:0:0 +LIBVERSION=4:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) -- To view, visit https://gerrit.osmocom.org/4453 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb5db2e910a90db780ea058b3280f2facbd68d76 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:19:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:19:00 +0000 Subject: [PATCH] libosmocore[master]: Tag/Release version 0.10.0 In-Reply-To: References: Message-ID: Tag/Release version 0.10.0 It's been way too long since the last release. Almost one year and 468 commits. A brief summary of the changes below: * Doxygen for libosmo{coding,gb} * pseudotalloc for embedded builds, jenkins for arm-none-gnueabi * --disable-doxygen, --disable-ctrl, --disable-simd * update debian packaging * gsm0503 coding routines * osmo_hton[sl] * statistics.h -> counter.h * QCDIAG in gsmtap * llist_{first,last}_entry() * llist_count() * LOGPSRC() macro * msgb_pull_to_l2() * msgb_printf() * prbs * osmo_sock_init2() * osmo_sock_mcast_{name,loop_set,ttl_set,all_set,subscribe,ip}() * OSMO_STRINGIFY() * OSMO_VALUE_STRING() * OSMO_BYTES_FOR_BITS() * osmo_talloc_asprintf() * osmo_sub_auth_type_name() * osmo_sub_auth_data support for IND/SQN_MS * osmo_fsm ctrl interface * ctrl_handle_alloc2() * ctrl_interface_setup_dynip2() * OSMO_CTRL_PORT_HLR * bssgp_tx_bvc_ptp_reset() * gprs_ns_inst connect/remote_{ip,port} * osmo_gprs_{ul,dl}_block_size_{bits,bytes}() * osmo_gprs_{dl,ul}_cs_by_block_bytes() * gprs_ns_pdu_strings[] * more BSSGP cause values * abis_nm_admin_name() * AoIP support in gsm0808 * gsm_fn_as_gsmtime_str() * osmo_dump_gsmtime() * gsup charging support * ipa_ccm_make_id_resp() * ipa_ccm_make_id_resp_from_req() * struct gsm48_gprs_susp_req * gsm_04_14.h * rsl measurement preprocessing related IEs * abis_nm_event_cause_names[] * abis_nm_sw_desc and friends * more SYSINFO_TYPE_ values * osmo_earfcn_bit_size_ext() * t16lv_put() * msgb_t16lv_put() * tlvp_val16be() * tlvp_val32be() * osmo_tlvp_copy() * osmo_tlvp_merge() * many additional VTY nodes * cmd_node.name member * bitvec_set_u64() * bitvec_rl_curbit * ctrl_lookup_register() * osmo_fsm_find_by_name() * osmo_fsm_inst_find_by_name() * osmo_fsm_inst_find_by_id() Change-Id: Ieb5db2e910a90db780ea058b3280f2facbd68d76 --- M TODO-RELEASE M debian/changelog M debian/control R debian/libosmocore9.install R debian/libosmoctrl1.install R debian/libosmogb5.install R debian/libosmogsm8.install R debian/libosmovty4.install M src/Makefile.am M src/ctrl/Makefile.am M src/gb/Makefile.am M src/gsm/Makefile.am M src/sim/Makefile.am M src/vty/Makefile.am 14 files changed, 29 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/53/4453/2 diff --git a/TODO-RELEASE b/TODO-RELEASE index e5a6f70..fb0bfea 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,9 +7,3 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -libosmocore new function osmo_sock_get_name() -libosmogsm/gsup ABI change fix AUTS length to 14, not 16 (length is implicit) -libosmogsm/oap ABI change fix AUTS length to 14, not 16 (length is implicit) -osmo-auc-gen UI change fix AUTS length to 14, not 16 (length is implicit) -libosmovty ABI change redefine _LAST_OSMOVTY_NODE as a high number to increase node space -libosmogb ABI change add struct members nsip.remote_ip, and nsip.remote_port to struct gprs_ns_inst \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index a5ca3d6..3b689e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libosmocore (0.10.0+nmu1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * New upstream release of libosmocore + + -- Harald Welte Fri, 27 Oct 2017 19:45:00 +0200 + libosmocore (0.9.6) unstable; urgency=medium * doc: osmocom-authn-protocol.txt: fix numbering, mark unused sync msgs diff --git a/debian/control b/debian/control index b19448e..8ba5583 100644 --- a/debian/control +++ b/debian/control @@ -26,11 +26,11 @@ Multi-Arch: foreign Depends: libosmocodec0 (= ${binary:Version}), libosmocoding0 (= ${binary:Version}), - libosmocore8 (= ${binary:Version}), - libosmogb4 (= ${binary:Version}), - libosmogsm7 (= ${binary:Version}), - libosmovty3 (= ${binary:Version}), - libosmoctrl0 (= ${binary:Version}), + libosmocore9 (= ${binary:Version}), + libosmogb5 (= ${binary:Version}), + libosmogsm8 (= ${binary:Version}), + libosmovty4 (= ${binary:Version}), + libosmoctrl1 (= ${binary:Version}), libosmosim0 (= ${binary:Version}), ${misc:Depends} Description: Open Source MObile COMmunications CORE library (metapackage) @@ -109,7 +109,7 @@ . This package contains the documentation for the libosmocoding library. -Package: libosmocore8 +Package: libosmocore9 Section: libs Architecture: any Multi-Arch: same @@ -123,14 +123,14 @@ (at least) other programs that are developed in the sphere of Free Software / Open Source mobile communication. . - The libosmocore8 library in particular is a collection of common code used in + The libosmocore9 library in particular is a collection of common code used in various sub-projects inside the Osmocom family of projects. Package: libosmocore-doc Architecture: all Section: doc Depends: ${misc:Depends}, - libosmocore8, + libosmocore9, libjs-jquery, libosmocodec-doc, libosmocoding-doc, @@ -145,7 +145,7 @@ . This package contains the documentation for the libosmocore library. -Package: libosmogb4 +Package: libosmogb5 Section: libs Architecture: any Multi-Arch: same @@ -166,7 +166,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmogb4, + libosmogb5, libjs-jquery Description: Documentation for the Osmo GPRS Gb library This is part of the libosmocore "meta"-library. The libosmocore library @@ -177,7 +177,7 @@ . This package contains the documentation for the libosmogb library. -Package: libosmogsm7 +Package: libosmogsm8 Section: libs Architecture: any Multi-Arch: same @@ -201,7 +201,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmogsm7, + libosmogsm8, libjs-jquery Description: Documentation for the Osmo GSM utility library This is part of the libosmocore "meta"-library. The libosmocore library @@ -212,7 +212,7 @@ . This package contains the documentation for the libosmogsm library. -Package: libosmovty3 +Package: libosmovty4 Section: libs Architecture: any Multi-Arch: same @@ -233,7 +233,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmovty3, + libosmovty4, libjs-jquery Description: Documentation for the Osmo VTY library This is part of the libosmocore "meta"-library. The libosmocore library @@ -244,7 +244,7 @@ . This package contains the documentation for the libosmovty library. -Package: libosmoctrl0 +Package: libosmoctrl1 Section: libs Architecture: any Multi-Arch: same @@ -258,7 +258,7 @@ (at least) other programs that are developed in the sphere of Free Software / Open Source mobile communication. . - The libosmoctrl library in particular contains an SNMP-like status interface. + The libosmoctrl1 library in particular contains an SNMP-like status interface. Package: libosmosim0 Section: libs diff --git a/debian/libosmocore8.install b/debian/libosmocore9.install similarity index 100% rename from debian/libosmocore8.install rename to debian/libosmocore9.install diff --git a/debian/libosmoctrl0.install b/debian/libosmoctrl1.install similarity index 100% rename from debian/libosmoctrl0.install rename to debian/libosmoctrl1.install diff --git a/debian/libosmogb4.install b/debian/libosmogb5.install similarity index 100% rename from debian/libosmogb4.install rename to debian/libosmogb5.install diff --git a/debian/libosmogsm7.install b/debian/libosmogsm8.install similarity index 100% rename from debian/libosmogsm7.install rename to debian/libosmogsm8.install diff --git a/debian/libosmovty3.install b/debian/libosmovty4.install similarity index 100% rename from debian/libosmovty3.install rename to debian/libosmovty4.install diff --git a/src/Makefile.am b/src/Makefile.am index 4925eed..cff5f44 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=8:0:0 +LIBVERSION=9:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) diff --git a/src/ctrl/Makefile.am b/src/ctrl/Makefile.am index e8d55e6..8e10c6b 100644 --- a/src/ctrl/Makefile.am +++ b/src/ctrl/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=0:0:0 +LIBVERSION=1:0:1 AM_CFLAGS = -Wall $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) diff --git a/src/gb/Makefile.am b/src/gb/Makefile.am index 68aed13..199e16e 100644 --- a/src/gb/Makefile.am +++ b/src/gb/Makefile.am @@ -1,6 +1,6 @@ # This is _NOT_ the library release version, it's an API version. # Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification -LIBVERSION=4:0:0 +LIBVERSION=5:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} -fno-strict-aliasing $(TALLOC_CFLAGS) diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 48b8b2c..9b52f03 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=7:0:1 +LIBVERSION=8:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} diff --git a/src/sim/Makefile.am b/src/sim/Makefile.am index ba23ebc..9590d6c 100644 --- a/src/sim/Makefile.am +++ b/src/sim/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=0:0:0 +LIBVERSION=0:1:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -fPIC -Wall $(PCSC_CFLAGS) $(TALLOC_CFLAGS) diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index 1dc76c3..32b38fb 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=3:0:0 +LIBVERSION=4:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) -- To view, visit https://gerrit.osmocom.org/4453 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieb5db2e910a90db780ea058b3280f2facbd68d76 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:24:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:24:21 +0000 Subject: libosmocore[master]: Tag/Release version 0.10.0 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4453 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb5db2e910a90db780ea058b3280f2facbd68d76 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:24:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:24:23 +0000 Subject: [MERGED] libosmocore[master]: Tag/Release version 0.10.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release version 0.10.0 ...................................................................... Tag/Release version 0.10.0 It's been way too long since the last release. Almost one year and 468 commits. A brief summary of the changes below: * Doxygen for libosmo{coding,gb} * pseudotalloc for embedded builds, jenkins for arm-none-gnueabi * --disable-doxygen, --disable-ctrl, --disable-simd * update debian packaging * gsm0503 coding routines * osmo_hton[sl] * statistics.h -> counter.h * QCDIAG in gsmtap * llist_{first,last}_entry() * llist_count() * LOGPSRC() macro * msgb_pull_to_l2() * msgb_printf() * prbs * osmo_sock_init2() * osmo_sock_mcast_{name,loop_set,ttl_set,all_set,subscribe,ip}() * OSMO_STRINGIFY() * OSMO_VALUE_STRING() * OSMO_BYTES_FOR_BITS() * osmo_talloc_asprintf() * osmo_sub_auth_type_name() * osmo_sub_auth_data support for IND/SQN_MS * osmo_fsm ctrl interface * ctrl_handle_alloc2() * ctrl_interface_setup_dynip2() * OSMO_CTRL_PORT_HLR * bssgp_tx_bvc_ptp_reset() * gprs_ns_inst connect/remote_{ip,port} * osmo_gprs_{ul,dl}_block_size_{bits,bytes}() * osmo_gprs_{dl,ul}_cs_by_block_bytes() * gprs_ns_pdu_strings[] * more BSSGP cause values * abis_nm_admin_name() * AoIP support in gsm0808 * gsm_fn_as_gsmtime_str() * osmo_dump_gsmtime() * gsup charging support * ipa_ccm_make_id_resp() * ipa_ccm_make_id_resp_from_req() * struct gsm48_gprs_susp_req * gsm_04_14.h * rsl measurement preprocessing related IEs * abis_nm_event_cause_names[] * abis_nm_sw_desc and friends * more SYSINFO_TYPE_ values * osmo_earfcn_bit_size_ext() * t16lv_put() * msgb_t16lv_put() * tlvp_val16be() * tlvp_val32be() * osmo_tlvp_copy() * osmo_tlvp_merge() * many additional VTY nodes * cmd_node.name member * bitvec_set_u64() * bitvec_rl_curbit * ctrl_lookup_register() * osmo_fsm_find_by_name() * osmo_fsm_inst_find_by_name() * osmo_fsm_inst_find_by_id() Change-Id: Ieb5db2e910a90db780ea058b3280f2facbd68d76 --- M TODO-RELEASE M debian/changelog M debian/control R debian/libosmocore9.install R debian/libosmoctrl1.install R debian/libosmogb5.install R debian/libosmogsm8.install R debian/libosmovty4.install M src/Makefile.am M src/ctrl/Makefile.am M src/gb/Makefile.am M src/gsm/Makefile.am M src/sim/Makefile.am M src/vty/Makefile.am 14 files changed, 29 insertions(+), 28 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index e5a6f70..fb0bfea 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,9 +7,3 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -libosmocore new function osmo_sock_get_name() -libosmogsm/gsup ABI change fix AUTS length to 14, not 16 (length is implicit) -libosmogsm/oap ABI change fix AUTS length to 14, not 16 (length is implicit) -osmo-auc-gen UI change fix AUTS length to 14, not 16 (length is implicit) -libosmovty ABI change redefine _LAST_OSMOVTY_NODE as a high number to increase node space -libosmogb ABI change add struct members nsip.remote_ip, and nsip.remote_port to struct gprs_ns_inst \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index a5ca3d6..3b689e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libosmocore (0.10.0+nmu1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * New upstream release of libosmocore + + -- Harald Welte Fri, 27 Oct 2017 19:45:00 +0200 + libosmocore (0.9.6) unstable; urgency=medium * doc: osmocom-authn-protocol.txt: fix numbering, mark unused sync msgs diff --git a/debian/control b/debian/control index b19448e..8ba5583 100644 --- a/debian/control +++ b/debian/control @@ -26,11 +26,11 @@ Multi-Arch: foreign Depends: libosmocodec0 (= ${binary:Version}), libosmocoding0 (= ${binary:Version}), - libosmocore8 (= ${binary:Version}), - libosmogb4 (= ${binary:Version}), - libosmogsm7 (= ${binary:Version}), - libosmovty3 (= ${binary:Version}), - libosmoctrl0 (= ${binary:Version}), + libosmocore9 (= ${binary:Version}), + libosmogb5 (= ${binary:Version}), + libosmogsm8 (= ${binary:Version}), + libosmovty4 (= ${binary:Version}), + libosmoctrl1 (= ${binary:Version}), libosmosim0 (= ${binary:Version}), ${misc:Depends} Description: Open Source MObile COMmunications CORE library (metapackage) @@ -109,7 +109,7 @@ . This package contains the documentation for the libosmocoding library. -Package: libosmocore8 +Package: libosmocore9 Section: libs Architecture: any Multi-Arch: same @@ -123,14 +123,14 @@ (at least) other programs that are developed in the sphere of Free Software / Open Source mobile communication. . - The libosmocore8 library in particular is a collection of common code used in + The libosmocore9 library in particular is a collection of common code used in various sub-projects inside the Osmocom family of projects. Package: libosmocore-doc Architecture: all Section: doc Depends: ${misc:Depends}, - libosmocore8, + libosmocore9, libjs-jquery, libosmocodec-doc, libosmocoding-doc, @@ -145,7 +145,7 @@ . This package contains the documentation for the libosmocore library. -Package: libosmogb4 +Package: libosmogb5 Section: libs Architecture: any Multi-Arch: same @@ -166,7 +166,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmogb4, + libosmogb5, libjs-jquery Description: Documentation for the Osmo GPRS Gb library This is part of the libosmocore "meta"-library. The libosmocore library @@ -177,7 +177,7 @@ . This package contains the documentation for the libosmogb library. -Package: libosmogsm7 +Package: libosmogsm8 Section: libs Architecture: any Multi-Arch: same @@ -201,7 +201,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmogsm7, + libosmogsm8, libjs-jquery Description: Documentation for the Osmo GSM utility library This is part of the libosmocore "meta"-library. The libosmocore library @@ -212,7 +212,7 @@ . This package contains the documentation for the libosmogsm library. -Package: libosmovty3 +Package: libosmovty4 Section: libs Architecture: any Multi-Arch: same @@ -233,7 +233,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmovty3, + libosmovty4, libjs-jquery Description: Documentation for the Osmo VTY library This is part of the libosmocore "meta"-library. The libosmocore library @@ -244,7 +244,7 @@ . This package contains the documentation for the libosmovty library. -Package: libosmoctrl0 +Package: libosmoctrl1 Section: libs Architecture: any Multi-Arch: same @@ -258,7 +258,7 @@ (at least) other programs that are developed in the sphere of Free Software / Open Source mobile communication. . - The libosmoctrl library in particular contains an SNMP-like status interface. + The libosmoctrl1 library in particular contains an SNMP-like status interface. Package: libosmosim0 Section: libs diff --git a/debian/libosmocore8.install b/debian/libosmocore9.install similarity index 100% rename from debian/libosmocore8.install rename to debian/libosmocore9.install diff --git a/debian/libosmoctrl0.install b/debian/libosmoctrl1.install similarity index 100% rename from debian/libosmoctrl0.install rename to debian/libosmoctrl1.install diff --git a/debian/libosmogb4.install b/debian/libosmogb5.install similarity index 100% rename from debian/libosmogb4.install rename to debian/libosmogb5.install diff --git a/debian/libosmogsm7.install b/debian/libosmogsm8.install similarity index 100% rename from debian/libosmogsm7.install rename to debian/libosmogsm8.install diff --git a/debian/libosmovty3.install b/debian/libosmovty4.install similarity index 100% rename from debian/libosmovty3.install rename to debian/libosmovty4.install diff --git a/src/Makefile.am b/src/Makefile.am index 4925eed..cff5f44 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=8:0:0 +LIBVERSION=9:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) diff --git a/src/ctrl/Makefile.am b/src/ctrl/Makefile.am index e8d55e6..8e10c6b 100644 --- a/src/ctrl/Makefile.am +++ b/src/ctrl/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=0:0:0 +LIBVERSION=1:0:1 AM_CFLAGS = -Wall $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) diff --git a/src/gb/Makefile.am b/src/gb/Makefile.am index 68aed13..199e16e 100644 --- a/src/gb/Makefile.am +++ b/src/gb/Makefile.am @@ -1,6 +1,6 @@ # This is _NOT_ the library release version, it's an API version. # Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification -LIBVERSION=4:0:0 +LIBVERSION=5:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} -fno-strict-aliasing $(TALLOC_CFLAGS) diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 48b8b2c..9b52f03 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=7:0:1 +LIBVERSION=8:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} diff --git a/src/sim/Makefile.am b/src/sim/Makefile.am index ba23ebc..9590d6c 100644 --- a/src/sim/Makefile.am +++ b/src/sim/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=0:0:0 +LIBVERSION=0:1:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -fPIC -Wall $(PCSC_CFLAGS) $(TALLOC_CFLAGS) diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index 1dc76c3..32b38fb 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=3:0:0 +LIBVERSION=4:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) -- To view, visit https://gerrit.osmocom.org/4453 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb5db2e910a90db780ea058b3280f2facbd68d76 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:31:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:31:08 +0000 Subject: [PATCH] libosmo-netif[master]: some more Doxygen header text for datagram, osmux and stream... Message-ID: Review at https://gerrit.osmocom.org/4454 some more Doxygen header text for datagram, osmux and stream module Change-Id: Ied83e6b117a420d734a88e3aff925a874c3dd520 --- M src/datagram.c M src/osmux.c M src/stream.c 3 files changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/54/4454/1 diff --git a/src/datagram.c b/src/datagram.c index ea31cd1..89643b8 100644 --- a/src/datagram.c +++ b/src/datagram.c @@ -23,6 +23,11 @@ /*! \addtogroup datagram Osmocom Datagram Socket * @{ + * + * This code is intended to abstract any use of datagram type sockets, + * such as UDP. It offers both transmitter and receiver side + * implementations, fully integrated with the libosmocore select loop + * abstraction. */ /*! \file datagram.c diff --git a/src/osmux.c b/src/osmux.c index 7beb705..70e220d 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -25,6 +25,15 @@ /*! \addtogroup osmux Osmocom Multiplex Protocol * @{ + * + * This code implements a variety of utility functions related to the + * OSMUX user-plane multiplexing protocol, an efficient alternative to + * plain UDP/RTP streams for voice transport in back-haul of cellular + * networks. + * + * For information about the OSMUX protocol design, please see the + * OSMUX reference manual at + * http://ftp.osmocom.org/docs/latest/osmux-reference.pdf */ /*! \file osmux.c diff --git a/src/stream.c b/src/stream.c index a80d842..1abe657 100644 --- a/src/stream.c +++ b/src/stream.c @@ -30,6 +30,11 @@ /*! \addtogroup stream Osmocom Stream Socket * @{ + * + * This code is intended to abstract any use of stream-type sockets, + * such as TCP and SCTP. It offers both server and client side + * implementations, fully integrated with the libosmocore select loop + * abstraction. */ /*! \file stream.c -- To view, visit https://gerrit.osmocom.org/4454 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied83e6b117a420d734a88e3aff925a874c3dd520 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:31:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:31:09 +0000 Subject: [PATCH] libosmo-netif[master]: depend on new upstream libosmocore version 0.10.0 Message-ID: Review at https://gerrit.osmocom.org/4455 depend on new upstream libosmocore version 0.10.0 Change-Id: Id22c69f96e9b6058e4c32ffa5a77d224453711ce --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/55/4455/1 diff --git a/configure.ac b/configure.ac index 6c9ba77..5ced828 100644 --- a/configure.ac +++ b/configure.ac @@ -52,8 +52,8 @@ dnl Generate the output AM_CONFIG_HEADER(config.h) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) dnl FIXME: We depend on libosmoabis by now until we can move LAPD code here PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.0.7) -- To view, visit https://gerrit.osmocom.org/4455 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id22c69f96e9b6058e4c32ffa5a77d224453711ce Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:31:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:31:09 +0000 Subject: [PATCH] libosmo-netif[master]: Tag/Release Version 0.1.0 Message-ID: Review at https://gerrit.osmocom.org/4456 Tag/Release Version 0.1.0 Short changelog: * Add Doxygen documentation * SCTP support in stream.c * new udp-test-client and udp-test-server programs * better / more verbose error handling in examples * new osmo_dgram_tx_set_local_{addr,port}() functions * use IPA definitions from libosmogsm, rather than repeating them * encode RTP header M field of RFC3550/4867 in OSMUX header * new osmo_stream_srv_link_set_nodelay() * new osmo_stream_srv_link_set_proto() * new osmo_stream_cli_set_nodelay() * new osmo_stream_cli_set_proto() * new osmo_stream_cli_set_local_addr() * new osmo_stream_cli_set_local_port() * new osmo_stream_cli_reconnect() * new osmo_stream_cli_open2() with reconnect argument * more vrebose osmux_snprintf() * remove mistaken reference to AGPL in rs232.c * fix memory leak in osmo_stream_srv_link_set_addr() * add osmo-pcap-test for SLL and Ethernet * extend osmux-test Change-Id: Ibf75fcd6643351ce3946faa155ae1db8c33a5e35 --- M debian/changelog M debian/control R debian/libosmonetif4.install M src/Makefile.am 4 files changed, 11 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/56/4456/1 diff --git a/debian/changelog b/debian/changelog index 6cd3378..003b027 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,12 @@ -libosmo-netif (0.0.7) UNRELEASED; urgency=medium +libosmo-netif (0.1.0) unstable; urgency=medium + [ Holger Hans Peter Freyther ] * Move forward toward a new release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:06:33 +0200 + [ Harald Welte ] + * Update to upstream 0.1.0 + + -- Holger Hans Peter Freyther Fri, 27 Oct 2017 20:00:39 +0200 libosmo-netif (0.0.6) unstable; urgency=medium diff --git a/debian/control b/debian/control index 11ae7d0..9e0f26f 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Vcs-Git: git://git.osmocom.org/libosmo-netif.git Homepage: https://projects.osmocom.org/projects/libosmo-netif -Package: libosmonetif3 +Package: libosmonetif4 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -39,7 +39,7 @@ ${misc:Depends}, libosmocore-dev, libosmocore, - libosmonetif3 (= ${binary:Version}) + libosmonetif4 (= ${binary:Version}) Multi-Arch: same Description: Development headers for Osmocom network interface The libosmo-netif library is one of the libraries needed by the @@ -53,7 +53,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmonetif3, + libosmonetif4, libjs-jquery Description: Documentation for the Osmo network interface library The libosmo-netif library is one of the libraries needed by the @@ -66,7 +66,7 @@ Section: debug Architecture: any Priority: extra -Depends: libosmonetif3 (= ${binary:Version}), ${misc:Depends} +Depends: libosmonetif4 (= ${binary:Version}), ${misc:Depends} Multi-Arch: same Description: Debug symbols for Osmocom network interface library The libosmo-netif library is one of the libraries needed by the diff --git a/debian/libosmonetif3.install b/debian/libosmonetif4.install similarity index 100% rename from debian/libosmonetif3.install rename to debian/libosmonetif4.install diff --git a/src/Makefile.am b/src/Makefile.am index 4bc481e..e647090 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ # This is _NOT_ the library release version, it's an API version. # Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification -LIBVERSION=3:0:0 +LIBVERSION=4:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS) -- To view, visit https://gerrit.osmocom.org/4456 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf75fcd6643351ce3946faa155ae1db8c33a5e35 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:33:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:33:28 +0000 Subject: osmo-sgsn[master]: Log address on GTP creation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4452 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic54a2ff835c9a0ceccf2f718f56371a881dd25b7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:34:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:34:01 +0000 Subject: osmo-sgsn[master]: Log GTP-U endpoints update In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4451 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I96d0f3a63cce338471cc39cc33fd44c39cd2aa73 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:34:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:34:04 +0000 Subject: [MERGED] osmo-sgsn[master]: Log GTP-U endpoints update In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Log GTP-U endpoints update ...................................................................... Log GTP-U endpoints update * 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 --- M include/osmocom/sgsn/sgsn.h M src/gprs/gprs_gmm.c M src/gprs/sgsn_vty.c 3 files changed, 9 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index e4eda17..464a64f 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -10,6 +10,7 @@ #include #include +#include struct gprs_gsup_client; struct hostent; @@ -147,6 +148,7 @@ int sgsn_vty_init(struct sgsn_config *cfg); int sgsn_parse_config(const char *config_file); +char *sgsn_gtp_ntoa(struct ul16_t *ul); /* sgsn.c */ diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index d11ecce..147e001 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -120,6 +120,8 @@ { struct sgsn_pdp_ctx *pdp; llist_for_each_entry(pdp, &mm_ctx->pdp_list, list) { + LOGMMCTXP(LOGL_INFO, mm_ctx, "Changing GTP-U endpoints %s -> %s\n", + sgsn_gtp_ntoa(&pdp->lib->gsnlu), inet_ntoa(sgsn->cfg.gtp_listenaddr.sin_addr)); sgsn_pdp_upd_gtp_u(pdp, &sgsn->cfg.gtp_listenaddr.sin_addr, sizeof(sgsn->cfg.gtp_listenaddr.sin_addr)); diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index faac69b..496bd68 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -425,7 +425,7 @@ { 0, NULL } }; -static char *gtp_ntoa(struct ul16_t *ul) +char *sgsn_gtp_ntoa(struct ul16_t *ul) { if (ul->l == 4) { struct in_addr *ia = (struct in_addr *) ul; @@ -450,13 +450,13 @@ gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), VTY_NEWLINE); vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); + sgsn_gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); + sgsn_gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); + sgsn_gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + sgsn_gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); } vty_out_rate_ctr_group(vty, " ", pdp->ctrg); -- To view, visit https://gerrit.osmocom.org/4451 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I96d0f3a63cce338471cc39cc33fd44c39cd2aa73 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:34:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:34:04 +0000 Subject: [MERGED] osmo-sgsn[master]: Log address on GTP creation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Log address on GTP creation ...................................................................... Log address on GTP creation Change-Id: Ic54a2ff835c9a0ceccf2f718f56371a881dd25b7 --- M src/gprs/sgsn_libgtp.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 04735e2..1032230 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -836,6 +836,8 @@ LOGP(DGPRS, LOGL_ERROR, "Failed to create GTP: %d\n", rc); return rc; } + LOGP(DGPRS, LOGL_NOTICE, "Created GTP on %s\n", inet_ntoa(sgi->cfg.gtp_listenaddr.sin_addr)); + gsn = sgi->gsn; if (gsn->mode != GTP_MODE_SGSN) -- To view, visit https://gerrit.osmocom.org/4452 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic54a2ff835c9a0ceccf2f718f56371a881dd25b7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:43:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:43:32 +0000 Subject: libosmo-netif[master]: some more Doxygen header text for datagram, osmux and stream... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4454 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied83e6b117a420d734a88e3aff925a874c3dd520 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:43:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:43:44 +0000 Subject: [MERGED] libosmo-netif[master]: some more Doxygen header text for datagram, osmux and stream... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: some more Doxygen header text for datagram, osmux and stream module ...................................................................... some more Doxygen header text for datagram, osmux and stream module Change-Id: Ied83e6b117a420d734a88e3aff925a874c3dd520 --- M src/datagram.c M src/osmux.c M src/stream.c 3 files changed, 19 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/datagram.c b/src/datagram.c index ea31cd1..89643b8 100644 --- a/src/datagram.c +++ b/src/datagram.c @@ -23,6 +23,11 @@ /*! \addtogroup datagram Osmocom Datagram Socket * @{ + * + * This code is intended to abstract any use of datagram type sockets, + * such as UDP. It offers both transmitter and receiver side + * implementations, fully integrated with the libosmocore select loop + * abstraction. */ /*! \file datagram.c diff --git a/src/osmux.c b/src/osmux.c index 7beb705..70e220d 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -25,6 +25,15 @@ /*! \addtogroup osmux Osmocom Multiplex Protocol * @{ + * + * This code implements a variety of utility functions related to the + * OSMUX user-plane multiplexing protocol, an efficient alternative to + * plain UDP/RTP streams for voice transport in back-haul of cellular + * networks. + * + * For information about the OSMUX protocol design, please see the + * OSMUX reference manual at + * http://ftp.osmocom.org/docs/latest/osmux-reference.pdf */ /*! \file osmux.c diff --git a/src/stream.c b/src/stream.c index a80d842..1abe657 100644 --- a/src/stream.c +++ b/src/stream.c @@ -30,6 +30,11 @@ /*! \addtogroup stream Osmocom Stream Socket * @{ + * + * This code is intended to abstract any use of stream-type sockets, + * such as TCP and SCTP. It offers both server and client side + * implementations, fully integrated with the libosmocore select loop + * abstraction. */ /*! \file stream.c -- To view, visit https://gerrit.osmocom.org/4454 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied83e6b117a420d734a88e3aff925a874c3dd520 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:44:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:44:03 +0000 Subject: libosmo-netif[master]: Tag/Release Version 0.1.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4456 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf75fcd6643351ce3946faa155ae1db8c33a5e35 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:57:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:57:09 +0000 Subject: libosmo-netif[master]: depend on new upstream libosmocore version 0.10.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4455 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id22c69f96e9b6058e4c32ffa5a77d224453711ce Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:57:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:57:11 +0000 Subject: [MERGED] libosmo-netif[master]: depend on new upstream libosmocore version 0.10.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: depend on new upstream libosmocore version 0.10.0 ...................................................................... depend on new upstream libosmocore version 0.10.0 Change-Id: Id22c69f96e9b6058e4c32ffa5a77d224453711ce --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 6c9ba77..5ced828 100644 --- a/configure.ac +++ b/configure.ac @@ -52,8 +52,8 @@ dnl Generate the output AM_CONFIG_HEADER(config.h) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) dnl FIXME: We depend on libosmoabis by now until we can move LAPD code here PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.0.7) -- To view, visit https://gerrit.osmocom.org/4455 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id22c69f96e9b6058e4c32ffa5a77d224453711ce Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 18:57:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 18:57:12 +0000 Subject: [MERGED] libosmo-netif[master]: Tag/Release Version 0.1.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release Version 0.1.0 ...................................................................... Tag/Release Version 0.1.0 Short changelog: * Add Doxygen documentation * SCTP support in stream.c * new udp-test-client and udp-test-server programs * better / more verbose error handling in examples * new osmo_dgram_tx_set_local_{addr,port}() functions * use IPA definitions from libosmogsm, rather than repeating them * encode RTP header M field of RFC3550/4867 in OSMUX header * new osmo_stream_srv_link_set_nodelay() * new osmo_stream_srv_link_set_proto() * new osmo_stream_cli_set_nodelay() * new osmo_stream_cli_set_proto() * new osmo_stream_cli_set_local_addr() * new osmo_stream_cli_set_local_port() * new osmo_stream_cli_reconnect() * new osmo_stream_cli_open2() with reconnect argument * more vrebose osmux_snprintf() * remove mistaken reference to AGPL in rs232.c * fix memory leak in osmo_stream_srv_link_set_addr() * add osmo-pcap-test for SLL and Ethernet * extend osmux-test Change-Id: Ibf75fcd6643351ce3946faa155ae1db8c33a5e35 --- M debian/changelog M debian/control R debian/libosmonetif4.install M src/Makefile.am 4 files changed, 11 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 6cd3378..003b027 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,12 @@ -libosmo-netif (0.0.7) UNRELEASED; urgency=medium +libosmo-netif (0.1.0) unstable; urgency=medium + [ Holger Hans Peter Freyther ] * Move forward toward a new release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:06:33 +0200 + [ Harald Welte ] + * Update to upstream 0.1.0 + + -- Holger Hans Peter Freyther Fri, 27 Oct 2017 20:00:39 +0200 libosmo-netif (0.0.6) unstable; urgency=medium diff --git a/debian/control b/debian/control index 11ae7d0..9e0f26f 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Vcs-Git: git://git.osmocom.org/libosmo-netif.git Homepage: https://projects.osmocom.org/projects/libosmo-netif -Package: libosmonetif3 +Package: libosmonetif4 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -39,7 +39,7 @@ ${misc:Depends}, libosmocore-dev, libosmocore, - libosmonetif3 (= ${binary:Version}) + libosmonetif4 (= ${binary:Version}) Multi-Arch: same Description: Development headers for Osmocom network interface The libosmo-netif library is one of the libraries needed by the @@ -53,7 +53,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmonetif3, + libosmonetif4, libjs-jquery Description: Documentation for the Osmo network interface library The libosmo-netif library is one of the libraries needed by the @@ -66,7 +66,7 @@ Section: debug Architecture: any Priority: extra -Depends: libosmonetif3 (= ${binary:Version}), ${misc:Depends} +Depends: libosmonetif4 (= ${binary:Version}), ${misc:Depends} Multi-Arch: same Description: Debug symbols for Osmocom network interface library The libosmo-netif library is one of the libraries needed by the diff --git a/debian/libosmonetif3.install b/debian/libosmonetif4.install similarity index 100% rename from debian/libosmonetif3.install rename to debian/libosmonetif4.install diff --git a/src/Makefile.am b/src/Makefile.am index 4bc481e..e647090 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ # This is _NOT_ the library release version, it's an API version. # Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification -LIBVERSION=3:0:0 +LIBVERSION=4:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS) -- To view, visit https://gerrit.osmocom.org/4456 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf75fcd6643351ce3946faa155ae1db8c33a5e35 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:14:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:14:24 +0000 Subject: [PATCH] libosmo-sccp[master]: update libosmocore/libosmo-netif dependency to current versions Message-ID: Review at https://gerrit.osmocom.org/4457 update libosmocore/libosmo-netif dependency to current versions Change-Id: I084b5968dec97b0bba0344425f880077ddada440 --- M configure.ac 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/57/4457/1 diff --git a/configure.ac b/configure.ac index 5404acf..5165cdb 100644 --- a/configure.ac +++ b/configure.ac @@ -30,10 +30,10 @@ fi PKG_PROG_PKG_CONFIG([0.20]) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.6) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) old_LIBS=$LIBS AC_SEARCH_LIBS([sctp_send], [sctp], [ -- To view, visit https://gerrit.osmocom.org/4457 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I084b5968dec97b0bba0344425f880077ddada440 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:14:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:14:26 +0000 Subject: [PATCH] libosmo-sccp[master]: Doxugen: s/libosmo-sccp/libosmo-sigtran/g Message-ID: Review at https://gerrit.osmocom.org/4458 Doxugen: s/libosmo-sccp/libosmo-sigtran/g The Doxygen annotation we have in this library, and which the Doxyfile generates is actually for the shared libosmo-sigtran, and not for the legacy libosmo-sccp. Let's correct that mistake. Change-Id: Id591695f9ac9eba53259558c657df834c331e5fa --- M Doxyfile.in M Makefile.am 2 files changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/58/4458/1 diff --git a/Doxyfile.in b/Doxyfile.in index a4e10c5..2676a6f 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -25,7 +25,7 @@ # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. -PROJECT_NAME = libosmo-sccp +PROJECT_NAME = libosmo-sigtran # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or @@ -51,7 +51,7 @@ # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = doc/sccp +OUTPUT_DIRECTORY = doc/sigtran # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output @@ -1490,7 +1490,7 @@ # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. -GENERATE_TAGFILE = doc/libosmo-sccp.tag +GENERATE_TAGFILE = doc/libosmo-sigtran.tag # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes diff --git a/Makefile.am b/Makefile.am index 3b9f6ee..d1c3c21 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,21 +23,21 @@ doc: $(html_DATA) -$(html_DATA): $(top_builddir)/doc/sccp/html/index.html +$(html_DATA): $(top_builddir)/doc/sigtran/html/index.html cd $(top_builddir)/doc && tar cf html.tar */html -$(top_builddir)/doc/sccp/html/index.html: $(SOURCES) Doxyfile - @rm -rf doc/sccp - mkdir -p doc/sccp +$(top_builddir)/doc/sigtran/html/index.html: $(SOURCES) Doxyfile + @rm -rf doc/sigtran + mkdir -p doc/sigtran $(DOXYGEN) Doxyfile install-data-hook: cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar uninstall-hook: - cd $(DESTDIR)$(htmldir) && rm -rf sccp + cd $(DESTDIR)$(htmldir) && rm -rf sigtran -DX_CLEAN = doc/sccp/html/search/* doc/sccp/{html,latex}/* doc/html.tar doc/doxygen_sqlite3.db doc/sccp/doxygen_sqlite3.db doc/*.tag +DX_CLEAN = doc/sigtran/html/search/* doc/sigtran/{html,latex}/* doc/html.tar doc/doxygen_sqlite3.db doc/sigtran/doxygen_sqlite3.db doc/*.tag endif -- To view, visit https://gerrit.osmocom.org/4458 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id591695f9ac9eba53259558c657df834c331e5fa Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:14:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:14:48 +0000 Subject: libosmo-sccp[master]: Doxugen: s/libosmo-sccp/libosmo-sigtran/g In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4458 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id591695f9ac9eba53259558c657df834c331e5fa Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:14:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:14:51 +0000 Subject: libosmo-sccp[master]: update libosmocore/libosmo-netif dependency to current versions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4457 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I084b5968dec97b0bba0344425f880077ddada440 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:23:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:23:35 +0000 Subject: [MERGED] libosmo-sccp[master]: Doxugen: s/libosmo-sccp/libosmo-sigtran/g In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Doxugen: s/libosmo-sccp/libosmo-sigtran/g ...................................................................... Doxugen: s/libosmo-sccp/libosmo-sigtran/g The Doxygen annotation we have in this library, and which the Doxyfile generates is actually for the shared libosmo-sigtran, and not for the legacy libosmo-sccp. Let's correct that mistake. Change-Id: Id591695f9ac9eba53259558c657df834c331e5fa --- M Doxyfile.in M Makefile.am 2 files changed, 9 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Doxyfile.in b/Doxyfile.in index a4e10c5..2676a6f 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -25,7 +25,7 @@ # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. -PROJECT_NAME = libosmo-sccp +PROJECT_NAME = libosmo-sigtran # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or @@ -51,7 +51,7 @@ # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = doc/sccp +OUTPUT_DIRECTORY = doc/sigtran # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output @@ -1490,7 +1490,7 @@ # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. -GENERATE_TAGFILE = doc/libosmo-sccp.tag +GENERATE_TAGFILE = doc/libosmo-sigtran.tag # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes diff --git a/Makefile.am b/Makefile.am index 3b9f6ee..d1c3c21 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,21 +23,21 @@ doc: $(html_DATA) -$(html_DATA): $(top_builddir)/doc/sccp/html/index.html +$(html_DATA): $(top_builddir)/doc/sigtran/html/index.html cd $(top_builddir)/doc && tar cf html.tar */html -$(top_builddir)/doc/sccp/html/index.html: $(SOURCES) Doxyfile - @rm -rf doc/sccp - mkdir -p doc/sccp +$(top_builddir)/doc/sigtran/html/index.html: $(SOURCES) Doxyfile + @rm -rf doc/sigtran + mkdir -p doc/sigtran $(DOXYGEN) Doxyfile install-data-hook: cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar uninstall-hook: - cd $(DESTDIR)$(htmldir) && rm -rf sccp + cd $(DESTDIR)$(htmldir) && rm -rf sigtran -DX_CLEAN = doc/sccp/html/search/* doc/sccp/{html,latex}/* doc/html.tar doc/doxygen_sqlite3.db doc/sccp/doxygen_sqlite3.db doc/*.tag +DX_CLEAN = doc/sigtran/html/search/* doc/sigtran/{html,latex}/* doc/html.tar doc/doxygen_sqlite3.db doc/sigtran/doxygen_sqlite3.db doc/*.tag endif -- To view, visit https://gerrit.osmocom.org/4458 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id591695f9ac9eba53259558c657df834c331e5fa Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:23:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:23:35 +0000 Subject: [MERGED] libosmo-sccp[master]: update libosmocore/libosmo-netif dependency to current versions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: update libosmocore/libosmo-netif dependency to current versions ...................................................................... update libosmocore/libosmo-netif dependency to current versions Change-Id: I084b5968dec97b0bba0344425f880077ddada440 --- M configure.ac 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 5404acf..5165cdb 100644 --- a/configure.ac +++ b/configure.ac @@ -30,10 +30,10 @@ fi PKG_PROG_PKG_CONFIG([0.20]) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.6) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) old_LIBS=$LIBS AC_SEARCH_LIBS([sctp_send], [sctp], [ -- To view, visit https://gerrit.osmocom.org/4457 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I084b5968dec97b0bba0344425f880077ddada440 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:48:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:48:22 +0000 Subject: [PATCH] libosmo-sccp[master]: Proper Debian packaging with split packages, -dbg, -doc, ... Message-ID: Review at https://gerrit.osmocom.org/4459 Proper Debian packaging with split packages, -dbg, -doc, ... Change-Id: I58ce90a9b8e4fc41ceb6a112df1f4503008743a7 --- M debian/control A debian/libosmo-sccp-dev.install A debian/libosmo-sigtran-dev.install A debian/libosmo-sigtran-doc.install A debian/libosmo-sigtran0.install A debian/osmo-stp.install A debian/osmo-stp.service M debian/rules 8 files changed, 126 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/59/4459/1 diff --git a/debian/control b/debian/control index a59dede..8b8f66b 100644 --- a/debian/control +++ b/debian/control @@ -25,10 +25,99 @@ Depends: ${misc:Depends} Multi-Arch: same Section: libdevel -Description: Development files for libosmosccp, libosmomtp and libosmoxua +Description: Development files for libsccp, libmtp and libxua SCCP is a network layer protocol that provides extended routing, flow control, segmentation, connection-orientation, and error correction facilities in Signaling System 7 telecommunications networks. It is heavily used in cellular networks such as GSM. . This package contains the development files for the library. + +Package: libosmo-sigtran0 +Section: libs +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, + ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Description: Osmocom SIGTRAN library (SCCP, SUA, M3UA and more) + This is a shared library containing SS7/SIGTRAN related functionality, + including connection-less and connection-oriented SCCP as per ITU-T Q.71x, + M3UA (MTP3 User Adaptation) according to IETF RFC4666, + SUA (SCCP User Adpatation) according to IETF RFC3868 + as well as MTP-level routing function and handling of signaling links, + linksets, ASPs, SGs, etc. + +Package: libosmo-sigtran-dbg +Architecture: any +Section: debug +Multi-Arch: same +Depends: libosmo-sigtran0 (= ${binary:Version}), + ${misc:Depends} +Description: Documentation for the Osmocom SIGTRAN library + libosmo-sigtran is a shared library containing SS7/SIGTRAN related functionality, + including connection-less and connection-oriented SCCP as per ITU-T Q.71x, + M3UA (MTP3 User Adaptation) according to IETF RFC4666, + SUA (SCCP User Adpatation) according to IETF RFC3868 + as well as MTP-level routing function and handling of signaling links, + linksets, ASPs, SGs, etc. + + +Package: libosmo-sigtran-doc +Architecture: all +Section: doc +Depends: ${misc:Depends}, + libosmo-sigtran0 (= ${binary:Version}), + libjs-query +Description: Documentation for the Osmocom SIGTRAN library + libosmo-sigtran is a shared library containing SS7/SIGTRAN related functionality, + including connection-less and connection-oriented SCCP as per ITU-T Q.71x, + M3UA (MTP3 User Adaptation) according to IETF RFC4666, + SUA (SCCP User Adpatation) according to IETF RFC3868 + as well as MTP-level routing function and handling of signaling links, + linksets, ASPs, SGs, etc. + +Package: libosmo-sigtran-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Depends: ${misc:Depends}, + libosmo-sigtran0 (= ${binary:Version}), + libosmocore-dev, + libosmo-netif-dev +Description: Development headers for the Osmocom SIGTRAN library + libosmo-sigtran is a shared library containing SS7/SIGTRAN related functionality, + including connection-less and connection-oriented SCCP as per ITU-T Q.71x, + M3UA (MTP3 User Adaptation) according to IETF RFC4666, + SUA (SCCP User Adpatation) according to IETF RFC3868 + as well as MTP-level routing function and handling of signaling links, + linksets, ASPs, SGs, etc. + +Package: osmo-stp +Architecture: any +Multi-Arch: same +Section: net +Depends: libosmo-sigtran0, + ${shlib:Depends}, + ${misc:Depends} +Description: Osmocom SIGTRAN STP (Signaling Transfer Point) + This is the Osmocom (Open Source Mobile Communications) implementation + of a Signaling Transfer Point (STP) for SS7/SIGTRAN telecommunication + networks. At this point it is a very minimal implementation, missing + lots of the functionality usually present in a STP, such as Global Title + Routing, Global Title Translation. + +Package: osmo-stp-dbg +Architecture: any +Multi-Arch: same +Section: debug +Depends: ${misc:Depends}, + osmo-stp (= ${binary:Version}) +Description: Debug symbols for Osmocom SIGTRAN STP (Signaling Transfer Point) + This package contains debug symbols for the Osmocom SIGTRAN STP (OsmoSTP). + . + OsmoSTP is the Osmocom (Open Source Mobile Communications) implementation + of a Signaling Transfer Point (STP) for SS7/SIGTRAN telecommunication + networks. At this point it is a very minimal implementation, missing + lots of the functionality usually present in a STP, such as Global Title + Routing, Global Title Translation. diff --git a/debian/libosmo-sccp-dev.install b/debian/libosmo-sccp-dev.install new file mode 100644 index 0000000..0404a9c --- /dev/null +++ b/debian/libosmo-sccp-dev.install @@ -0,0 +1,7 @@ +usr/include/osmocom/sccp +usr/lib/*/libsccp.a +usr/lib/*/libmtp.a +usr/lib/*/libxua.a +usr/lib/*/pkgconfig/libosmo-sccp.pc +usr/lib/*/pkgconfig/libosmo-mtp.pc +usr/lib/*/pkgconfig/libosmo-xua.pc diff --git a/debian/libosmo-sigtran-dev.install b/debian/libosmo-sigtran-dev.install new file mode 100644 index 0000000..a556f90 --- /dev/null +++ b/debian/libosmo-sigtran-dev.install @@ -0,0 +1,5 @@ +usr/include/osmocom/sigtran +usr/lib/*/libosmo-sigtran*.a +usr/lib/*/libosmo-sigtran*.so +usr/lib/*/libosmo-sigtran*.la +usr/lib/*/pkgconfig/libosmo-sigtran.pc diff --git a/debian/libosmo-sigtran-doc.install b/debian/libosmo-sigtran-doc.install new file mode 100644 index 0000000..c6a1ec7 --- /dev/null +++ b/debian/libosmo-sigtran-doc.install @@ -0,0 +1 @@ +usr/share/doc/libosmo-sccp/sigtran/ diff --git a/debian/libosmo-sigtran0.install b/debian/libosmo-sigtran0.install new file mode 100644 index 0000000..9779f4c --- /dev/null +++ b/debian/libosmo-sigtran0.install @@ -0,0 +1 @@ +usr/lib/*/libosmo-sigtran*.so.* diff --git a/debian/osmo-stp.install b/debian/osmo-stp.install new file mode 100644 index 0000000..74ce048 --- /dev/null +++ b/debian/osmo-stp.install @@ -0,0 +1 @@ +/usr/bin/osmo-stp diff --git a/debian/osmo-stp.service b/debian/osmo-stp.service new file mode 120000 index 0000000..55f37c2 --- /dev/null +++ b/debian/osmo-stp.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-stp.service \ No newline at end of file diff --git a/debian/rules b/debian/rules index c42676a..279568f 100755 --- a/debian/rules +++ b/debian/rules @@ -11,15 +11,29 @@ %: dh $@ --with autoreconf -override_dh_autoreconf: - echo $(VERSION) > .tarball-version - dh_autoreconf +override_dh_strip: + dh_strip -plibosmo-sigtran0 --dbg-package=libosmo-sigtran-dbg + dh_strip -posmo-stp --dbg-package=osmo-stp-dbg -override_dh_clean: - dh_clean - rm -f .version tests/package.m4 tests/testsuite +override_dh_install: + sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'` + dh_install # Print test results in case of a failure override_dh_auto_test: dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) +override_dh_autoreconf: + echo $(VERSION) > .tarball-version + dh_autoreconf + +override_dh_auto_configure: + dh_auto_configure -- --enable-static + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) + +override_dh_clean: + dh_clean + rm -f .version tests/package.m4 tests/testsuite -- To view, visit https://gerrit.osmocom.org/4459 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I58ce90a9b8e4fc41ceb6a112df1f4503008743a7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:50:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:50:35 +0000 Subject: libosmo-sccp[master]: Proper Debian packaging with split packages, -dbg, -doc, ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4459 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58ce90a9b8e4fc41ceb6a112df1f4503008743a7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:50:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:50:36 +0000 Subject: [MERGED] libosmo-sccp[master]: Proper Debian packaging with split packages, -dbg, -doc, ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Proper Debian packaging with split packages, -dbg, -doc, ... ...................................................................... Proper Debian packaging with split packages, -dbg, -doc, ... Change-Id: I58ce90a9b8e4fc41ceb6a112df1f4503008743a7 --- M debian/control A debian/libosmo-sccp-dev.install A debian/libosmo-sigtran-dev.install A debian/libosmo-sigtran-doc.install A debian/libosmo-sigtran0.install A debian/osmo-stp.install A debian/osmo-stp.service M debian/rules 8 files changed, 126 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index a59dede..8b8f66b 100644 --- a/debian/control +++ b/debian/control @@ -25,10 +25,99 @@ Depends: ${misc:Depends} Multi-Arch: same Section: libdevel -Description: Development files for libosmosccp, libosmomtp and libosmoxua +Description: Development files for libsccp, libmtp and libxua SCCP is a network layer protocol that provides extended routing, flow control, segmentation, connection-orientation, and error correction facilities in Signaling System 7 telecommunications networks. It is heavily used in cellular networks such as GSM. . This package contains the development files for the library. + +Package: libosmo-sigtran0 +Section: libs +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, + ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Description: Osmocom SIGTRAN library (SCCP, SUA, M3UA and more) + This is a shared library containing SS7/SIGTRAN related functionality, + including connection-less and connection-oriented SCCP as per ITU-T Q.71x, + M3UA (MTP3 User Adaptation) according to IETF RFC4666, + SUA (SCCP User Adpatation) according to IETF RFC3868 + as well as MTP-level routing function and handling of signaling links, + linksets, ASPs, SGs, etc. + +Package: libosmo-sigtran-dbg +Architecture: any +Section: debug +Multi-Arch: same +Depends: libosmo-sigtran0 (= ${binary:Version}), + ${misc:Depends} +Description: Documentation for the Osmocom SIGTRAN library + libosmo-sigtran is a shared library containing SS7/SIGTRAN related functionality, + including connection-less and connection-oriented SCCP as per ITU-T Q.71x, + M3UA (MTP3 User Adaptation) according to IETF RFC4666, + SUA (SCCP User Adpatation) according to IETF RFC3868 + as well as MTP-level routing function and handling of signaling links, + linksets, ASPs, SGs, etc. + + +Package: libosmo-sigtran-doc +Architecture: all +Section: doc +Depends: ${misc:Depends}, + libosmo-sigtran0 (= ${binary:Version}), + libjs-query +Description: Documentation for the Osmocom SIGTRAN library + libosmo-sigtran is a shared library containing SS7/SIGTRAN related functionality, + including connection-less and connection-oriented SCCP as per ITU-T Q.71x, + M3UA (MTP3 User Adaptation) according to IETF RFC4666, + SUA (SCCP User Adpatation) according to IETF RFC3868 + as well as MTP-level routing function and handling of signaling links, + linksets, ASPs, SGs, etc. + +Package: libosmo-sigtran-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Depends: ${misc:Depends}, + libosmo-sigtran0 (= ${binary:Version}), + libosmocore-dev, + libosmo-netif-dev +Description: Development headers for the Osmocom SIGTRAN library + libosmo-sigtran is a shared library containing SS7/SIGTRAN related functionality, + including connection-less and connection-oriented SCCP as per ITU-T Q.71x, + M3UA (MTP3 User Adaptation) according to IETF RFC4666, + SUA (SCCP User Adpatation) according to IETF RFC3868 + as well as MTP-level routing function and handling of signaling links, + linksets, ASPs, SGs, etc. + +Package: osmo-stp +Architecture: any +Multi-Arch: same +Section: net +Depends: libosmo-sigtran0, + ${shlib:Depends}, + ${misc:Depends} +Description: Osmocom SIGTRAN STP (Signaling Transfer Point) + This is the Osmocom (Open Source Mobile Communications) implementation + of a Signaling Transfer Point (STP) for SS7/SIGTRAN telecommunication + networks. At this point it is a very minimal implementation, missing + lots of the functionality usually present in a STP, such as Global Title + Routing, Global Title Translation. + +Package: osmo-stp-dbg +Architecture: any +Multi-Arch: same +Section: debug +Depends: ${misc:Depends}, + osmo-stp (= ${binary:Version}) +Description: Debug symbols for Osmocom SIGTRAN STP (Signaling Transfer Point) + This package contains debug symbols for the Osmocom SIGTRAN STP (OsmoSTP). + . + OsmoSTP is the Osmocom (Open Source Mobile Communications) implementation + of a Signaling Transfer Point (STP) for SS7/SIGTRAN telecommunication + networks. At this point it is a very minimal implementation, missing + lots of the functionality usually present in a STP, such as Global Title + Routing, Global Title Translation. diff --git a/debian/libosmo-sccp-dev.install b/debian/libosmo-sccp-dev.install new file mode 100644 index 0000000..0404a9c --- /dev/null +++ b/debian/libosmo-sccp-dev.install @@ -0,0 +1,7 @@ +usr/include/osmocom/sccp +usr/lib/*/libsccp.a +usr/lib/*/libmtp.a +usr/lib/*/libxua.a +usr/lib/*/pkgconfig/libosmo-sccp.pc +usr/lib/*/pkgconfig/libosmo-mtp.pc +usr/lib/*/pkgconfig/libosmo-xua.pc diff --git a/debian/libosmo-sigtran-dev.install b/debian/libosmo-sigtran-dev.install new file mode 100644 index 0000000..a556f90 --- /dev/null +++ b/debian/libosmo-sigtran-dev.install @@ -0,0 +1,5 @@ +usr/include/osmocom/sigtran +usr/lib/*/libosmo-sigtran*.a +usr/lib/*/libosmo-sigtran*.so +usr/lib/*/libosmo-sigtran*.la +usr/lib/*/pkgconfig/libosmo-sigtran.pc diff --git a/debian/libosmo-sigtran-doc.install b/debian/libosmo-sigtran-doc.install new file mode 100644 index 0000000..c6a1ec7 --- /dev/null +++ b/debian/libosmo-sigtran-doc.install @@ -0,0 +1 @@ +usr/share/doc/libosmo-sccp/sigtran/ diff --git a/debian/libosmo-sigtran0.install b/debian/libosmo-sigtran0.install new file mode 100644 index 0000000..9779f4c --- /dev/null +++ b/debian/libosmo-sigtran0.install @@ -0,0 +1 @@ +usr/lib/*/libosmo-sigtran*.so.* diff --git a/debian/osmo-stp.install b/debian/osmo-stp.install new file mode 100644 index 0000000..74ce048 --- /dev/null +++ b/debian/osmo-stp.install @@ -0,0 +1 @@ +/usr/bin/osmo-stp diff --git a/debian/osmo-stp.service b/debian/osmo-stp.service new file mode 120000 index 0000000..55f37c2 --- /dev/null +++ b/debian/osmo-stp.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-stp.service \ No newline at end of file diff --git a/debian/rules b/debian/rules index c42676a..279568f 100755 --- a/debian/rules +++ b/debian/rules @@ -11,15 +11,29 @@ %: dh $@ --with autoreconf -override_dh_autoreconf: - echo $(VERSION) > .tarball-version - dh_autoreconf +override_dh_strip: + dh_strip -plibosmo-sigtran0 --dbg-package=libosmo-sigtran-dbg + dh_strip -posmo-stp --dbg-package=osmo-stp-dbg -override_dh_clean: - dh_clean - rm -f .version tests/package.m4 tests/testsuite +override_dh_install: + sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'` + dh_install # Print test results in case of a failure override_dh_auto_test: dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) +override_dh_autoreconf: + echo $(VERSION) > .tarball-version + dh_autoreconf + +override_dh_auto_configure: + dh_auto_configure -- --enable-static + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) + +override_dh_clean: + dh_clean + rm -f .version tests/package.m4 tests/testsuite -- To view, visit https://gerrit.osmocom.org/4459 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I58ce90a9b8e4fc41ceb6a112df1f4503008743a7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Fri Oct 27 19:55:18 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 19:55:18 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f38f3cba5d3_718e50ef74102647a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/x86_64 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 266s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 266s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 266s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 266s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 266s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 266s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 266s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 266s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 266s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 266s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 266s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 266s] -Success [ 266s] ./testsuite.at:69: exit code was 132, expected 0 [ 266s] 11. testsuite.at:66: 11. coding (testsuite.at:66): FAILED (testsuite.at:69) [ 266s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 266s] make[1]: *** [override_dh_auto_test] Error 1 [ 266s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 266s] debian/rules:15: recipe for target 'build' failed [ 266s] make: *** [build] Error 2 [ 266s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 266s] [ 266s] build36 failed "build libosmocore_0.10.0+nmu1.20171027.dsc" at Fri Oct 27 19:55:02 UTC 2017. [ 266s] [ 266s] ### VM INTERACTION START ### [ 269s] [ 258.838585] reboot: Power down [ 270s] ### VM INTERACTION END ### [ 270s] [ 270s] build36 failed "build libosmocore_0.10.0+nmu1.20171027.dsc" at Fri Oct 27 19:55:06 UTC 2017. [ 270s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:57:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:57:11 +0000 Subject: [PATCH] libosmo-sccp[master]: Tag/Release Version 0.8.0 Message-ID: Review at https://gerrit.osmocom.org/4460 Tag/Release Version 0.8.0 This marks the first version of this source package that includes libosmo-sigtran and osmo-stp. Misc Changelog: * Add Doxygen API documentation * Add examples for libosmo-sigtran client and server side API * Add 'struct sccp_data_unitdata_service' for UDTS * Big endian support for sccp_src_ref_to_int() and sccp_src_ref_from_int() * Fix any unintended references to AGPL in the soruce Change-Id: I390f32f289a6b7464672e6081bc189503addb92b --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/60/4460/1 diff --git a/debian/changelog b/debian/changelog index b7a0c97..b25e270 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libosmo-sccp (0.8.0) unstable; urgency=medium + + * New upstream 0.8.0 release. + + -- Harald Welte Fri, 27 Oct 2017 21:50:08 +0200 + libosmo-sccp (0.7.1) UNRELEASED; urgency=medium * Move forward towards a new release. -- To view, visit https://gerrit.osmocom.org/4460 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I390f32f289a6b7464672e6081bc189503addb92b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:58:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:58:34 +0000 Subject: libosmo-sccp[master]: Tag/Release Version 0.8.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4460 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I390f32f289a6b7464672e6081bc189503addb92b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 19:58:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 19:58:36 +0000 Subject: [MERGED] libosmo-sccp[master]: Tag/Release Version 0.8.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release Version 0.8.0 ...................................................................... Tag/Release Version 0.8.0 This marks the first version of this source package that includes libosmo-sigtran and osmo-stp. Misc Changelog: * Add Doxygen API documentation * Add examples for libosmo-sigtran client and server side API * Add 'struct sccp_data_unitdata_service' for UDTS * Big endian support for sccp_src_ref_to_int() and sccp_src_ref_from_int() * Fix any unintended references to AGPL in the soruce Change-Id: I390f32f289a6b7464672e6081bc189503addb92b --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index b7a0c97..b25e270 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libosmo-sccp (0.8.0) unstable; urgency=medium + + * New upstream 0.8.0 release. + + -- Harald Welte Fri, 27 Oct 2017 21:50:08 +0200 + libosmo-sccp (0.7.1) UNRELEASED; urgency=medium * Move forward towards a new release. -- To view, visit https://gerrit.osmocom.org/4460 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I390f32f289a6b7464672e6081bc189503addb92b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Fri Oct 27 20:05:00 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:05:00 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-netif in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f3917875197_718e50ef7410288fa@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Debian_9.0/x86_64 Package network:osmocom:nightly/libosmo-netif failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-netif Last lines of build log: [ 91s] #define HAVE_MEMORY_H 1 [ 91s] #define HAVE_STRINGS_H 1 [ 91s] #define HAVE_INTTYPES_H 1 [ 91s] #define HAVE_STDINT_H 1 [ 91s] #define HAVE_UNISTD_H 1 [ 91s] #define HAVE_DLFCN_H 1 [ 91s] #define LT_OBJDIR ".libs/" [ 91s] #define STDC_HEADERS 1 [ 91s] #define HAVE_EXECINFO_H 1 [ 91s] #define HAVE_SYS_SELECT_H 1 [ 91s] #define HAVE_SYS_SOCKET_H 1 [ 91s] #define HAVE_SYSLOG_H 1 [ 91s] #define HAVE_CTYPE_H 1 [ 91s] [ 91s] configure: exit 1 [ 91s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 91s] debian/rules:13: recipe for target 'build' failed [ 91s] make: *** [build] Error 2 [ 91s] dpkg-buildpackage: erro[ 83.044180] serial8250: too much work for irq4 [ 91s] r: debian/rules build gave error exit status 2 [ 91s] [ 91s] lamb73 failed "build libosmo-netif_0.1.0.20171027.dsc" at Fri Oct 27 20:04:45 UTC 2017. [ 91s] [ 91s] ### VM INTERACTION START ### [ 94s] [ 86.151631] reboot: Power down [ 94s] ### VM INTERACTION END ### [ 94s] [ 94s] lamb73 failed "build libosmo-netif_0.1.0.20171027.dsc" at Fri Oct 27 20:04:48 UTC 2017. [ 94s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:10:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:10:04 +0000 Subject: [PATCH] libasn1c[master]: Fix compiler warning Message-ID: Review at https://gerrit.osmocom.org/4461 Fix compiler warning In file included from asn1helpers.c:14:0: ../include/asn1c/asn1helpers.h: In function ?OCTET_STRING_noalloc?: ../include/asn1c/asn1helpers.h:26:9: warning: assignment discards ?const? qualifier from pointer target type [-Wdiscarded-qualifiers] s->buf = str; ^ Change-Id: Ie2fefe710090de779137c36b98239ef4a097b6dd --- M include/asn1c/asn1helpers.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/61/4461/1 diff --git a/include/asn1c/asn1helpers.h b/include/asn1c/asn1helpers.h index d6b5e18..2cfc000 100644 --- a/include/asn1c/asn1helpers.h +++ b/include/asn1c/asn1helpers.h @@ -23,6 +23,6 @@ static inline void OCTET_STRING_noalloc(OCTET_STRING_t *s, const uint8_t *str, int size) { - s->buf = str; + s->buf = (uint8_t *) str; s->size = size; } -- To view, visit https://gerrit.osmocom.org/4461 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2fefe710090de779137c36b98239ef4a097b6dd Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:10:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:10:04 +0000 Subject: [PATCH] libasn1c[master]: Fix compiler warning Message-ID: Review at https://gerrit.osmocom.org/4462 Fix compiler warning /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" ^~~~~~~ Change-Id: I442e60413b3bee6d365cd5df672a558d68998670 --- M src/REAL.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/62/4462/1 diff --git a/src/REAL.c b/src/REAL.c index e179152..2994b74 100644 --- a/src/REAL.c +++ b/src/REAL.c @@ -3,7 +3,7 @@ * Redistribution and modifications are permitted subject to BSD license. */ #define _ISOC99_SOURCE /* For ilogb() and quiet NAN */ -#define _BSD_SOURCE /* To reintroduce finite(3) */ +#define _DEFAULT_SOURCE /* To reintroduce finite(3) */ #if defined(__alpha) #include /* For INFINITY */ #endif -- To view, visit https://gerrit.osmocom.org/4462 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I442e60413b3bee6d365cd5df672a558d68998670 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:10:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:10:04 +0000 Subject: [PATCH] libasn1c[master]: Sync debian package version (0.9.28) with acversion Message-ID: Review at https://gerrit.osmocom.org/4463 Sync debian package version (0.9.28) with acversion All of this code is from asn1c 0.9.28, so let's make sure autoconf + debian packaging agree on the version numbering Change-Id: Ie8dc8f5df7123d4bf7579f6f4e84b7cc33d49607 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/63/4463/1 diff --git a/debian/changelog b/debian/changelog index f56c11a..20354b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libasn1c (0.9.28) UNRELEASED; urgency=low + + * Initial release. + + -- Harald Welte Fri, 27 Oct 2017 22:08:03 +0000 + libasn1c (0.1.0) UNRELEASED; urgency=low * Initial release. -- To view, visit https://gerrit.osmocom.org/4463 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie8dc8f5df7123d4bf7579f6f4e84b7cc33d49607 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte From admin at opensuse.org Fri Oct 27 20:12:43 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:12:43 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-sccp in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f3933d8c3d0_718e50ef7410307e0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-sccp/Debian_9.0/x86_64 Package network:osmocom:nightly/libosmo-sccp failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-sccp Last lines of build log: [ 102s] #define PACKAGE "libosmo-sccp" [ 102s] #define VERSION "0.7.1.20171027" [ 102s] #define STDC_HEADERS 1 [ 102s] #define HAVE_SYS_TYPES_H 1 [ 102s] #define HAVE_SYS_STAT_H 1 [ 102s] #define HAVE_STDLIB_H 1 [ 102s] #define HAVE_STRING_H 1 [ 102s] #define HAVE_MEMORY_H 1 [ 102s] #define HAVE_STRINGS_H 1 [ 102s] #define HAVE_INTTYPES_H 1 [ 102s] #define HAVE_STDINT_H 1 [ 102s] #define HAVE_UNISTD_H 1 [ 102s] #define HAVE_DLFCN_H 1 [ 102s] #define LT_OBJDIR ".libs/" [ 102s] [ 102s] configure: exit 1 [ 102s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 102s] debian/rules:12: recipe for target 'build' failed [ 102s] make: *** [build] Error 2 [ 102s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 102s] [ 102s] lamb25 failed "build libosmo-sccp_0.7.1.20171027.dsc" at Fri Oct 27 20:12:25 UTC 2017. [ 102s] [ 102s] ### VM INTERACTION START ### [ 105s] [ 97.454991] reboot: Power down [ 105s] ### VM INTERACTION END ### [ 105s] [ 105s] lamb25 failed "build libosmo-sccp_0.7.1.20171027.dsc" at Fri Oct 27 20:12:29 UTC 2017. [ 105s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 20:28:26 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:28:26 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f396fba6b23_718e50ef7410335ee@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 143s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 143s] [ 143s] You may investigate any problem if you feel able to do so, in which [ 143s] case the test suite provides a good starting point. Its output may [ 143s] be found below `tests/testsuite.dir'. [ 143s] [ 143s] Makefile:1208: recipe for target 'check-local' failed [ 143s] make[3]: *** [check-local] Error 1 [ 143s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 143s] Makefile:1044: recipe for target 'check-am' failed [ 143s] make[2]: *** [check-am] Error 2 [ 143s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 143s] Makefile:448: recipe for target 'check-recursive' failed [ 143s] make[1]: *** [check-recursive] Error 1 [ 143s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 143s] dh_auto_test: make -j1 check returned exit code 2 [ 143s] debian/rules:12: recipe for target 'build' failed [ 143s] make: *** [build] Error 2 [ 143s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 143s] [ 143s] lamb13 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:28:18 UTC 2017. [ 143s] [ 143s] ### VM INTERACTION START ### [ 144s] Powering off. [ 144s] [ 136.743117] reboot: Power down [ 144s] ### VM INTERACTION END ### [ 144s] [ 144s] lamb13 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:28:19 UTC 2017. [ 144s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 20:34:26 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:34:26 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f39860678d8_718e50ef741034796@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 165s] To: [ 165s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 165s] [ 165s] You may investigate any problem if you feel able to do so, in which [ 165s] case the test suite provides a good starting point. Its output may [ 165s] be found below `tests/testsuite.dir'. [ 165s] [ 165s] Makefile:1221: recipe for target 'check-local' failed [ 165s] make[3]: *** [check-local] Error 1 [ 165s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 165s] Makefile:1055: recipe for target 'check-am' failed [ 165s] make[2]: *** [check-am] Error 2 [ 165s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 165s] Makefile:460: recipe for target 'check-recursive' failed [ 165s] make[1]: *** [check-recursive] Error 1 [ 165s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 165s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 165s] debian/rules:12: recipe for target 'build' failed [ 165s] make: *** [build] Error 2 [ 165s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 165s] [ 165s] lamb51 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:34:08 UTC 2017. [ 165s] [ 165s] ### VM INTERACTION START ### [ 169s] [ 161.911890] reboot: Power down [ 169s] ### VM INTERACTION END ### [ 169s] [ 169s] lamb51 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:34:12 UTC 2017. [ 169s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 20:34:26 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:34:26 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f39860f237d_718e50ef741034810@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 177s] To: [ 177s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 177s] [ 177s] You may investigate any problem if you feel able to do so, in which [ 177s] case the test suite provides a good starting point. Its output may [ 177s] be found below `tests/testsuite.dir'. [ 177s] [ 177s] Makefile:1221: recipe for target 'check-local' failed [ 177s] make[3]: *** [check-local] Error 1 [ 177s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 177s] Makefile:1055: recipe for target 'check-am' failed [ 177s] make[2]: *** [check-am] Error 2 [ 177s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 177s] Makefile:460: recipe for target 'check-recursive' failed [ 177s] make[1]: *** [check-recursive] Error 1 [ 177s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 177s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 177s] debian/rules:12: recipe for target 'build' failed [ 177s] make: *** [build] Error 2 [ 177s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 177s] [ 177s] wildcard2 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:34:14 UTC 2017. [ 177s] [ 177s] ### VM INTERACTION START ### [ 180s] [ 164.278701] reboot: Power down [ 180s] ### VM INTERACTION END ### [ 180s] [ 180s] wildcard2 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:34:18 UTC 2017. [ 180s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 20:35:17 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:35:17 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f3989f8c8cf_718e50ef7410349e7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 152s] To: [ 152s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 152s] [ 152s] You may investigate any problem if you feel able to do so, in which [ 152s] case the test suite provides a good starting point. Its output may [ 152s] be found below `tests/testsuite.dir'. [ 152s] [ 152s] Makefile:1221: recipe for target 'check-local' failed [ 152s] make[3]: *** [check-local] Error 1 [ 152s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 152s] Makefile:1055: recipe for target 'check-am' failed [ 152s] make[2]: *** [check-am] Error 2 [ 152s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 152s] Makefile:460: recipe for target 'check-recursive' failed [ 152s] make[1]: *** [check-recursive] Error 1 [ 152s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 152s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 152s] debian/rules:12: recipe for target 'build' failed [ 152s] make: *** [build] Error 2 [ 152s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 152s] [ 152s] lamb69 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:35:09 UTC 2017. [ 152s] [ 152s] ### VM INTERACTION START ### [ 156s] [ 148.044532] reboot: Power down [ 156s] ### VM INTERACTION END ### [ 156s] [ 156s] lamb69 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:35:13 UTC 2017. [ 156s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:36:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:36:04 +0000 Subject: [PATCH] osmo-iuh[master]: update dependencies to latest libosmo-* releases Message-ID: Review at https://gerrit.osmocom.org/4464 update dependencies to latest libosmo-* releases Now that we have tagged releases that include the support needed in osmo-iuh, let's require them. Change-Id: I579ba94e8f0f700b598a2346c5020cce3b159f27 --- M configure.ac 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/64/4464/1 diff --git a/configure.ac b/configure.ac index 72cbb56..ff0501a 100644 --- a/configure.ac +++ b/configure.ac @@ -33,12 +33,12 @@ fi PKG_PROG_PKG_CONFIG([0.20]) -PKG_CHECK_MODULES(OSMOCORE, libosmocore) -PKG_CHECK_MODULES(OSMOGSM, libosmogsm) -PKG_CHECK_MODULES(OSMOVTY, libosmovty) -PKG_CHECK_MODULES(OSMONETIF, libosmo-netif) -PKG_CHECK_MODULES(OSMOSIGTRAN, libosmo-sigtran) -PKG_CHECK_MODULES(ASN1C, libasn1c) +PKG_CHECK_MODULES(OSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(OSMOGSM, libosmogsm >= 0.10.0) +PKG_CHECK_MODULES(OSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(OSMONETIF, libosmo-netif >= 0.1.0) +PKG_CHECK_MODULES(OSMOSIGTRAN, libosmo-sigtran >= 0.8.0) +PKG_CHECK_MODULES(ASN1C, libasn1c >= 0.9.28) AC_CONFIG_MACRO_DIR([m4]) -- To view, visit https://gerrit.osmocom.org/4464 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I579ba94e8f0f700b598a2346c5020cce3b159f27 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:36:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:36:08 +0000 Subject: [PATCH] osmo-iuh[master]: debian: depend on libosmo-sigtran-dev, not libosmo-sccp-dev Message-ID: Review at https://gerrit.osmocom.org/4465 debian: depend on libosmo-sigtran-dev, not libosmo-sccp-dev We recently fixed package naming / sub-packagign in the libosmo-sccp git repository, so now we need to depend on the proper package name. Change-Id: I6e4f8fa96e5f39f988d6993ba3931cb7df70e905 --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/65/4465/1 diff --git a/debian/control b/debian/control index 56a7667..bc9b221 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ libosmo-netif-dev, libosmocore-dev, libosmo-netif-dev, - libosmo-sccp-dev, + libosmo-sigtran-dev (>= 0.8.0), python (>= 2.7) Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/osmo-iuh.git -- To view, visit https://gerrit.osmocom.org/4465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e4f8fa96e5f39f988d6993ba3931cb7df70e905 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:36:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:36:08 +0000 Subject: [PATCH] osmo-iuh[master]: Tag/Release 0.2.0 + Update LIBVERSION + Debian packaging Message-ID: Review at https://gerrit.osmocom.org/4466 Tag/Release 0.2.0 + Update LIBVERSION + Debian packaging Change-Id: I4fe653fdde6acda59485c73cee63bfc5326edf28 --- M debian/changelog M debian/control R debian/libosmo-ranap1.install M src/Makefile.am 4 files changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/66/4466/1 diff --git a/debian/changelog b/debian/changelog index 91bd155..e8fb68e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-iuh (0.2.0) UNRELEASED; urgency=low + + * Upstream 0.2.0 release + + -- Harald Welte Fri, 27 Oct 2017 22:19:00 +0000 + osmo-iuh (0.1.0) UNRELEASED; urgency=low * Initial release. diff --git a/debian/control b/debian/control index bc9b221..3330f55 100644 --- a/debian/control +++ b/debian/control @@ -37,7 +37,7 @@ Depends: osmo-hnbgw (= ${binary:Version}), ${misc:Depends} Description: osmocom Home Node B Gateway -Package: libosmo-ranap0 +Package: libosmo-ranap1 Section: libs Architecture: any Multi-Arch: same @@ -49,12 +49,12 @@ Section: debug Architecture: any Multi-Arch: same -Depends: libosmo-ranap0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-ranap1 (= ${binary:Version}), ${misc:Depends} Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) Package: libosmo-ranap-dev Section: libdevel Architecture: any Multi-Arch: same -Depends: libosmo-ranap0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-ranap1 (= ${binary:Version}), ${misc:Depends} Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) diff --git a/debian/libosmo-ranap0.install b/debian/libosmo-ranap1.install similarity index 100% rename from debian/libosmo-ranap0.install rename to debian/libosmo-ranap1.install diff --git a/src/Makefile.am b/src/Makefile.am index 62f09e5..d815394 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -49,7 +49,7 @@ # build the shared RANAP library # -RANAP_LIBVERSION=0:0:0 +RANAP_LIBVERSION=1:0:0 lib_LTLIBRARIES = libosmo-ranap.la libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOSIGTRAN_LIBS) \ -- To view, visit https://gerrit.osmocom.org/4466 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4fe653fdde6acda59485c73cee63bfc5326edf28 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte From admin at opensuse.org Fri Oct 27 20:35:34 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:35:34 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f3990098587_718e50ef74103541f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 154s] To: [ 154s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 154s] [ 154s] You may investigate any problem if you feel able to do so, in which [ 154s] case the test suite provides a good starting point. Its output may [ 154s] be found below `tests/testsuite.dir'. [ 154s] [ 154s] Makefile:1221: recipe for target 'check-local' failed [ 154s] make[3]: *** [check-local] Error 1 [ 154s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 154s] Makefile:1055: recipe for target 'check-am' failed [ 154s] make[2]: *** [check-am] Error 2 [ 154s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 154s] Makefile:460: recipe for target 'check-recursive' failed [ 154s] make[1]: *** [check-recursive] Error 1 [ 154s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 154s] dh_auto_test: make -j1 check returned exit code 2 [ 154s] debian/rules:12: recipe for target 'build' failed [ 154s] make: *** [build] Error 2 [ 154s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 154s] [ 154s] lamb05 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:35:20 UTC 2017. [ 154s] [ 154s] ### VM INTERACTION START ### [ 158s] [ 151.127750] reboot: Power down [ 158s] ### VM INTERACTION END ### [ 158s] [ 158s] lamb05 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:35:24 UTC 2017. [ 158s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 20:38:09 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:38:09 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f3993633868_718e50ef7410359e0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 147s] To: [ 147s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 147s] [ 147s] You may investigate any problem if you feel able to do so, in which [ 147s] case the test suite provides a good starting point. Its output may [ 147s] be found below `tests/testsuite.dir'. [ 147s] [ 147s] Makefile:1221: recipe for target 'check-local' failed [ 147s] make[3]: *** [check-local] Error 1 [ 147s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 147s] Makefile:1055: recipe for target 'check-am' failed [ 147s] make[2]: *** [check-am] Error 2 [ 147s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 147s] Makefile:460: recipe for target 'check-recursive' failed [ 147s] make[1]: *** [check-recursive] Error 1 [ 147s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 147s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 147s] debian/rules:12: recipe for target 'build' failed [ 147s] make: *** [build] Error 2 [ 147s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 147s] [ 147s] lamb16 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:37:58 UTC 2017. [ 147s] [ 147s] ### VM INTERACTION START ### [ 150s] [ 143.677216] reboot: Power down [ 150s] ### VM INTERACTION END ### [ 150s] [ 150s] lamb16 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:38:01 UTC 2017. [ 150s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 20:38:26 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:38:26 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f39950abc13_718e50ef74103609d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 156s] To: [ 156s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 156s] [ 156s] You may investigate any problem if you feel able to do so, in which [ 156s] case the test suite provides a good starting point. Its output may [ 156s] be found below `tests/testsuite.dir'. [ 156s] [ 156s] Makefile:1221: recipe for target 'check-local' failed [ 156s] make[3]: *** [check-local] Error 1 [ 156s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 156s] Makefile:1055: recipe for target 'check-am' failed [ 156s] make[2]: *** [check-am] Error 2 [ 156s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 156s] Makefile:460: recipe for target 'check-recursive' failed [ 156s] make[1]: *** [check-recursive] Error 1 [ 156s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 156s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 156s] debian/rules:12: recipe for target 'build' failed [ 156s] make: *** [build] Error 2 [ 156s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 156s] [ 156s] lamb16 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:38:08 UTC 2017. [ 156s] [ 156s] ### VM INTERACTION START ### [ 159s] [ 151.487978] reboot: Power down [ 159s] ### VM INTERACTION END ### [ 159s] [ 159s] lamb16 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:38:11 UTC 2017. [ 159s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 20:39:17 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:39:17 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f3998fbac4d_718e50ef741036419@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 226s] To: [ 226s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 226s] [ 226s] You may investigate any problem if you feel able to do so, in which [ 226s] case the test suite provides a good starting point. Its output may [ 226s] be found below `tests/testsuite.dir'. [ 226s] [ 226s] Makefile:1221: recipe for target 'check-local' failed [ 226s] make[3]: *** [check-local] Error 1 [ 226s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 226s] Makefile:1055: recipe for target 'check-am' failed [ 226s] make[2]: *** [check-am] Error 2 [ 226s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 226s] Makefile:460: recipe for target 'check-recursive' failed [ 226s] make[1]: *** [check-recursive] Error 1 [ 226s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 226s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 226s] debian/rules:12: recipe for target 'build' failed [ 226s] make: *** [build] Error 2 [ 226s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 226s] [ 226s] cloud109 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:39:04 UTC 2017. [ 226s] [ 226s] ### VM INTERACTION START ### [ 229s] [ 212.460771] reboot: Power down [ 233s] ### VM INTERACTION END ### [ 233s] [ 233s] cloud109 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:39:12 UTC 2017. [ 233s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 20:39:51 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:39:51 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f399ab1ecd3_718e50ef7410365a7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 234s] To: [ 234s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 234s] [ 234s] You may investigate any problem if you feel able to do so, in which [ 234s] case the test suite provides a good starting point. Its output may [ 234s] be found below `tests/testsuite.dir'. [ 234s] [ 234s] Makefile:1221: recipe for target 'check-local' failed [ 234s] make[3]: *** [check-local] Error 1 [ 234s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 234s] Makefile:1055: recipe for target 'check-am' failed [ 234s] make[2]: *** [check-am] Error 2 [ 234s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 234s] Makefile:460: recipe for target 'check-recursive' failed [ 234s] make[1]: *** [check-recursive] Error 1 [ 234s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 234s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 234s] debian/rules:12: recipe for target 'build' failed [ 234s] make: *** [build] Error 2 [ 234s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 234s] [ 234s] wildcard2 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:39:33 UTC 2017. [ 234s] [ 234s] ### VM INTERACTION START ### [ 237s] [ 199.673842] reboot: Power down [ 240s] ### VM INTERACTION END ### [ 240s] [ 240s] wildcard2 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:39:39 UTC 2017. [ 240s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 20:41:00 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:41:00 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f399ea77aa2_718e50ef7410366be@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 189s] To: [ 189s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 189s] [ 189s] You may investigate any problem if you feel able to do so, in which [ 189s] case the test suite provides a good starting point. Its output may [ 189s] be found below `tests/testsuite.dir'. [ 189s] [ 189s] Makefile:1221: recipe for target 'check-local' failed [ 189s] make[3]: *** [check-local] Error 1 [ 189s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 189s] Makefile:1055: recipe for target 'check-am' failed [ 189s] make[2]: *** [check-am] Error 2 [ 189s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 189s] Makefile:460: recipe for target 'check-recursive' failed [ 189s] make[1]: *** [check-recursive] Error 1 [ 189s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 189s] dh_auto_test: make -j1 check returned exit code 2 [ 189s] debian/rules:12: recipe for target 'build' failed [ 189s] make: *** [build] Error 2 [ 189s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 189s] [ 189s] cloud125 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:40:45 UTC 2017. [ 189s] [ 189s] ### VM INTERACTION START ### [ 193s] [ 169.737952] reboot: Power down [ 194s] ### VM INTERACTION END ### [ 194s] [ 194s] cloud125 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:40:50 UTC 2017. [ 194s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Oct 27 20:41:17 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Oct 2017 20:41:17 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f39a048307c_718e50ef7410367ef@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 198s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 198s] [ 198s] You may investigate any problem if you feel able to do so, in which [ 198s] case the test suite provides a good starting point. Its output may [ 198s] be found below `tests/testsuite.dir'. [ 198s] [ 198s] Makefile:1208: recipe for target 'check-local' failed [ 198s] make[3]: *** [check-local] Error 1 [ 198s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 198s] Makefile:1044: recipe for target 'check-am' failed [ 198s] make[2]: *** [check-am] Error 2 [ 198s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 198s] Makefile:448: recipe for target 'check-recursive' failed [ 198s] make[1]: *** [check-recursive] Error 1 [ 198s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 198s] dh_auto_test: make -j1 check returned exit code 2 [ 198s] debian/rules:12: recipe for target 'build' failed [ 198s] make: *** [build] Error 2 [ 198s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 198s] [ 198s] cloud113 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:41:01 UTC 2017. [ 198s] [ 198s] ### VM INTERACTION START ### [ 199s] Powering off. [ 199s] [ 176.166623] reboot: Power down [ 200s] ### VM INTERACTION END ### [ 200s] [ 200s] cloud113 failed "build osmo-pcu_0.3.0.20171027.dsc" at Fri Oct 27 20:41:04 UTC 2017. [ 200s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:43:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:43:28 +0000 Subject: libasn1c[master]: Fix compiler warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4461 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie2fefe710090de779137c36b98239ef4a097b6dd Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:43:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:43:30 +0000 Subject: libasn1c[master]: Fix compiler warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4462 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I442e60413b3bee6d365cd5df672a558d68998670 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:43:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:43:32 +0000 Subject: libasn1c[master]: Sync debian package version (0.9.28) with acversion In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4463 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8dc8f5df7123d4bf7579f6f4e84b7cc33d49607 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:43:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:43:33 +0000 Subject: [MERGED] libasn1c[master]: Sync debian package version (0.9.28) with acversion In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Sync debian package version (0.9.28) with acversion ...................................................................... Sync debian package version (0.9.28) with acversion All of this code is from asn1c 0.9.28, so let's make sure autoconf + debian packaging agree on the version numbering Change-Id: Ie8dc8f5df7123d4bf7579f6f4e84b7cc33d49607 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index f56c11a..20354b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libasn1c (0.9.28) UNRELEASED; urgency=low + + * Initial release. + + -- Harald Welte Fri, 27 Oct 2017 22:08:03 +0000 + libasn1c (0.1.0) UNRELEASED; urgency=low * Initial release. -- To view, visit https://gerrit.osmocom.org/4463 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie8dc8f5df7123d4bf7579f6f4e84b7cc33d49607 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:43:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:43:33 +0000 Subject: [MERGED] libasn1c[master]: Fix compiler warning In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix compiler warning ...................................................................... Fix compiler warning /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" ^~~~~~~ Change-Id: I442e60413b3bee6d365cd5df672a558d68998670 --- M src/REAL.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/REAL.c b/src/REAL.c index e179152..2994b74 100644 --- a/src/REAL.c +++ b/src/REAL.c @@ -3,7 +3,7 @@ * Redistribution and modifications are permitted subject to BSD license. */ #define _ISOC99_SOURCE /* For ilogb() and quiet NAN */ -#define _BSD_SOURCE /* To reintroduce finite(3) */ +#define _DEFAULT_SOURCE /* To reintroduce finite(3) */ #if defined(__alpha) #include /* For INFINITY */ #endif -- To view, visit https://gerrit.osmocom.org/4462 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I442e60413b3bee6d365cd5df672a558d68998670 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:43:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:43:34 +0000 Subject: [MERGED] libasn1c[master]: Fix compiler warning In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix compiler warning ...................................................................... Fix compiler warning In file included from asn1helpers.c:14:0: ../include/asn1c/asn1helpers.h: In function ?OCTET_STRING_noalloc?: ../include/asn1c/asn1helpers.h:26:9: warning: assignment discards ?const? qualifier from pointer target type [-Wdiscarded-qualifiers] s->buf = str; ^ Change-Id: Ie2fefe710090de779137c36b98239ef4a097b6dd --- M include/asn1c/asn1helpers.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/asn1c/asn1helpers.h b/include/asn1c/asn1helpers.h index d6b5e18..2cfc000 100644 --- a/include/asn1c/asn1helpers.h +++ b/include/asn1c/asn1helpers.h @@ -23,6 +23,6 @@ static inline void OCTET_STRING_noalloc(OCTET_STRING_t *s, const uint8_t *str, int size) { - s->buf = str; + s->buf = (uint8_t *) str; s->size = size; } -- To view, visit https://gerrit.osmocom.org/4461 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie2fefe710090de779137c36b98239ef4a097b6dd Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:43:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:43:52 +0000 Subject: osmo-iuh[master]: update dependencies to latest libosmo-* releases In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4464 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I579ba94e8f0f700b598a2346c5020cce3b159f27 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:44:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:44:52 +0000 Subject: osmo-iuh[master]: Tag/Release 0.2.0 + Update LIBVERSION + Debian packaging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4466 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4fe653fdde6acda59485c73cee63bfc5326edf28 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:46:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 20:46:41 +0000 Subject: [PATCH] osmo-ci[master]: add osmo-clean-workspace.sh, use in osmo-deps.sh Message-ID: Review at https://gerrit.osmocom.org/4467 add osmo-clean-workspace.sh, use in osmo-deps.sh So far, each jenkins job does its own cleanup, more or less well. Also, jenkins git config offers the 'Clean before checkout' option, which seems to fail when there are non-writable leftovers from a failed 'make distcheck'. Furthermore, our jenkins build slaves have unused compiled binaries piling up by the gigabytes: each matrix build x each parallel build and each compiled dependency therein builds .o, .a, .so and executables plus installs them to a local prefix, and just leaves them sitting around to rot until the job runs again. Instead, we want to clean them out when building is done. All of this calls for a unified cleanup script that knows how to clean a workspace properly, to run once before and once after each jenkins build. Here it is. Use that function in osmo-deps.sh instead of duplicating cleanup steps. Change-Id: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 --- M scripts/osmo-build-dep.sh A scripts/osmo-clean-workspace.sh M scripts/osmo-deps.sh 3 files changed, 48 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/67/4467/1 diff --git a/scripts/osmo-build-dep.sh b/scripts/osmo-build-dep.sh index 2a107ed..8104ba7 100755 --- a/scripts/osmo-build-dep.sh +++ b/scripts/osmo-build-dep.sh @@ -40,7 +40,6 @@ mkdir -p "$deps" cd "$deps" -rm -rf "$project" osmo-deps.sh "$project" cd "$project" if [ -n "$branch" ]; then diff --git a/scripts/osmo-clean-workspace.sh b/scripts/osmo-clean-workspace.sh new file mode 100755 index 0000000..11a5b72 --- /dev/null +++ b/scripts/osmo-clean-workspace.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# Clean workspace. +# This should be the first and last step of every jenkins build: +# a) to make sure the workspace has no build artifacts from previous runs. +# b) to reduce disk space lost to unused binaries; parallel and/or matrix +# builds create numerous workspaces, blowing up disk usage. +# Note that if a build fails, the last steps will not run, hence calling this +# as last step cleans only in case there was no build failure, i.e. where we +# don't need to keep anything anyway. +# +# Assume $PWD is a git clone's root dir. Usually, that's also the jenkins +# workspace root. Do not wipe subdir 'layer1-headers' as well as all dirs under +# '$deps'. These are assumed to be git clones that do not need to be re-cloned +# every time. Do a 'git clean' in each of them individually. If '$deps' is not +# defined or the mentioned dirs do not exist, nothing special happens, so this +# script can be safely run in any git clone in deeper subdirs of the workspace. + +set -ex + +# make sure no write protected cruft is in the way. A failed 'make distcheck' +# has a habit of leaving a non-writable dir tree behind. +chmod -R +w . + +# wipe all local modifications +git checkout -f HEAD + +# wipe all unversioned leftovers, except deps gits. +git clean -dxf -e "$deps" -e "layer1-headers" + +# leave the deps checkouts around, to not clone entire git history every time, +# but clean each git of build artifacts. +if [ -d "$deps" ]; then + for dep_dir in "$deps"/* ; do + git checkout -f HEAD + git -C "$dep_dir" clean -dxf + done +fi + +if [ -d "layer1-headers" ]; then + git checkout -f HEAD + git -C "layer1-headers" clean -dxf +fi diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh index 86da9a6..c256a6a 100755 --- a/scripts/osmo-deps.sh +++ b/scripts/osmo-deps.sh @@ -8,5 +8,11 @@ cd $1 git fetch origin + +# Cleanup should already have happened during a global osmo-clean-workspace.sh, +# but in case the caller did not (want to) call that, let's also do cleanup in +# the dep subdir separately: +osmo-clean-workspace.sh + git reset --hard origin/master git rev-parse HEAD -- To view, visit https://gerrit.osmocom.org/4467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:46:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 20:46:41 +0000 Subject: [PATCH] osmo-ci[master]: osmo-build-dep: offload branch checkout to osmo-deps.sh Message-ID: Review at https://gerrit.osmocom.org/4468 osmo-build-dep: offload branch checkout to osmo-deps.sh In osmo-deps.sh, add second arg $branch, and also name the first one (i.e. $project). Use the passed branch or 'origin/master' by default. In osmo-build-dep.sh, it's not necessary to do a second 'git rev-parse HEAD', osmo-deps.sh already does it. Change-Id: I598c41a12352acea6e49a321ad2f665f6ea07a44 --- M scripts/osmo-build-dep.sh M scripts/osmo-deps.sh 2 files changed, 7 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/68/4468/1 diff --git a/scripts/osmo-build-dep.sh b/scripts/osmo-build-dep.sh index 8104ba7..6e9ef86 100755 --- a/scripts/osmo-build-dep.sh +++ b/scripts/osmo-build-dep.sh @@ -40,12 +40,8 @@ mkdir -p "$deps" cd "$deps" -osmo-deps.sh "$project" +osmo-deps.sh "$project" "$branch" cd "$project" -if [ -n "$branch" ]; then - git checkout "$branch" -fi -git rev-parse HEAD # log current HEAD autoreconf --install --force ./configure --prefix="$inst" $cfg diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh index c256a6a..92cf041 100755 --- a/scripts/osmo-deps.sh +++ b/scripts/osmo-deps.sh @@ -1,12 +1,14 @@ #!/bin/sh set -ex +project="$1" +branch="${2:-origin/master}" -if ! test -d $1; +if ! test -d "$project"; then - git clone git://git.osmocom.org/$1 $1 + git clone "git://git.osmocom.org/$project" "$project" fi -cd $1 +cd "$project" git fetch origin # Cleanup should already have happened during a global osmo-clean-workspace.sh, @@ -14,5 +16,5 @@ # the dep subdir separately: osmo-clean-workspace.sh -git reset --hard origin/master +git reset --hard "$branch" git rev-parse HEAD -- To view, visit https://gerrit.osmocom.org/4468 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I598c41a12352acea6e49a321ad2f665f6ea07a44 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:46:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 20:46:42 +0000 Subject: [PATCH] osmo-ci[master]: scripts: use 'git checkout -f' instead of 'reset --hard' Message-ID: Review at https://gerrit.osmocom.org/4469 scripts: use 'git checkout -f' instead of 'reset --hard' 'checkout -f' more accurately does what is intended. 'reset' changes the current branch to some hash, 'checkout -f' force-checkouts another branch. Change-Id: Ic6279ebaf8160bceb3fa2ab40eff0b888ecd5009 --- M scripts/osmo-deps.sh M scripts/osmo-layer1-headers.sh 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/69/4469/1 diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh index 92cf041..74de22b 100755 --- a/scripts/osmo-deps.sh +++ b/scripts/osmo-deps.sh @@ -16,5 +16,5 @@ # the dep subdir separately: osmo-clean-workspace.sh -git reset --hard "$branch" +git checkout -f "$branch" git rev-parse HEAD diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh index 374515e..a975396 100755 --- a/scripts/osmo-layer1-headers.sh +++ b/scripts/osmo-layer1-headers.sh @@ -44,4 +44,4 @@ cd layer1-headers git fetch origin -git reset --hard "$version" +git checkout -f "$version" -- To view, visit https://gerrit.osmocom.org/4469 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic6279ebaf8160bceb3fa2ab40eff0b888ecd5009 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:47:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 20:47:20 +0000 Subject: [PATCH] libosmocore[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4470 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I99fdd20e7b18c2f4a59a9db35e5efccca6546b77 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh M contrib/jenkins_common.sh 3 files changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/70/4470/1 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index ef116b1..acdbe3c 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -24,3 +24,5 @@ build builddir # verify build in source tree build . + +osmo-clean-workspace.sh diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index d731504..5798c95 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -29,3 +29,5 @@ # is well separated from the source tree state. $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index bc4ac65..a6ffe7f 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -8,6 +8,8 @@ exit 1 fi +osmo-clean-workspace.sh + verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") prep_build() { @@ -16,11 +18,8 @@ cd "$_src_dir" - # a failed 'make distcheck' may leave files without write permissions - chmod -R a+w . - git clean -dxf - # make absolutely sure no src files have modifications - git checkout -f HEAD + # clean again before each build variant + osmo-clean-workspace.sh autoreconf --install --force -- To view, visit https://gerrit.osmocom.org/4470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I99fdd20e7b18c2f4a59a9db35e5efccca6546b77 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:48:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:48:13 +0000 Subject: [MERGED] osmo-iuh[master]: update dependencies to latest libosmo-* releases In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: update dependencies to latest libosmo-* releases ...................................................................... update dependencies to latest libosmo-* releases Now that we have tagged releases that include the support needed in osmo-iuh, let's require them. Change-Id: I579ba94e8f0f700b598a2346c5020cce3b159f27 --- M configure.ac 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 72cbb56..ff0501a 100644 --- a/configure.ac +++ b/configure.ac @@ -33,12 +33,12 @@ fi PKG_PROG_PKG_CONFIG([0.20]) -PKG_CHECK_MODULES(OSMOCORE, libosmocore) -PKG_CHECK_MODULES(OSMOGSM, libosmogsm) -PKG_CHECK_MODULES(OSMOVTY, libosmovty) -PKG_CHECK_MODULES(OSMONETIF, libosmo-netif) -PKG_CHECK_MODULES(OSMOSIGTRAN, libosmo-sigtran) -PKG_CHECK_MODULES(ASN1C, libasn1c) +PKG_CHECK_MODULES(OSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(OSMOGSM, libosmogsm >= 0.10.0) +PKG_CHECK_MODULES(OSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(OSMONETIF, libosmo-netif >= 0.1.0) +PKG_CHECK_MODULES(OSMOSIGTRAN, libosmo-sigtran >= 0.8.0) +PKG_CHECK_MODULES(ASN1C, libasn1c >= 0.9.28) AC_CONFIG_MACRO_DIR([m4]) -- To view, visit https://gerrit.osmocom.org/4464 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I579ba94e8f0f700b598a2346c5020cce3b159f27 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:48:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 20:48:23 +0000 Subject: [PATCH] libasn1c[master]: jenkins: add missing set -e to catch build errors Message-ID: Review at https://gerrit.osmocom.org/4471 jenkins: add missing set -e to catch build errors Change-Id: I9f6b015b09c60c18d213dde5bbdcfc527096a10f --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/71/4471/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index d9901e3..d4f98f3 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash # jenkins build helper script for libasn1c. This is how we build on jenkins.osmocom.org +set -e + set +x echo echo -- To view, visit https://gerrit.osmocom.org/4471 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f6b015b09c60c18d213dde5bbdcfc527096a10f Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:48:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:48:56 +0000 Subject: osmo-iuh[master]: debian: depend on libosmo-sigtran-dev, not libosmo-sccp-dev In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e4f8fa96e5f39f988d6993ba3931cb7df70e905 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:48:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:48:58 +0000 Subject: [MERGED] osmo-iuh[master]: debian: depend on libosmo-sigtran-dev, not libosmo-sccp-dev In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian: depend on libosmo-sigtran-dev, not libosmo-sccp-dev ...................................................................... debian: depend on libosmo-sigtran-dev, not libosmo-sccp-dev We recently fixed package naming / sub-packagign in the libosmo-sccp git repository, so now we need to depend on the proper package name. Change-Id: I6e4f8fa96e5f39f988d6993ba3931cb7df70e905 --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 56a7667..bc9b221 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ libosmo-netif-dev, libosmocore-dev, libosmo-netif-dev, - libosmo-sccp-dev, + libosmo-sigtran-dev (>= 0.8.0), python (>= 2.7) Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/osmo-iuh.git -- To view, visit https://gerrit.osmocom.org/4465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e4f8fa96e5f39f988d6993ba3931cb7df70e905 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:48:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:48:58 +0000 Subject: [MERGED] osmo-iuh[master]: Tag/Release 0.2.0 + Update LIBVERSION + Debian packaging In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release 0.2.0 + Update LIBVERSION + Debian packaging ...................................................................... Tag/Release 0.2.0 + Update LIBVERSION + Debian packaging Change-Id: I4fe653fdde6acda59485c73cee63bfc5326edf28 --- M debian/changelog M debian/control R debian/libosmo-ranap1.install M src/Makefile.am 4 files changed, 10 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 91bd155..e8fb68e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-iuh (0.2.0) UNRELEASED; urgency=low + + * Upstream 0.2.0 release + + -- Harald Welte Fri, 27 Oct 2017 22:19:00 +0000 + osmo-iuh (0.1.0) UNRELEASED; urgency=low * Initial release. diff --git a/debian/control b/debian/control index bc9b221..3330f55 100644 --- a/debian/control +++ b/debian/control @@ -37,7 +37,7 @@ Depends: osmo-hnbgw (= ${binary:Version}), ${misc:Depends} Description: osmocom Home Node B Gateway -Package: libosmo-ranap0 +Package: libosmo-ranap1 Section: libs Architecture: any Multi-Arch: same @@ -49,12 +49,12 @@ Section: debug Architecture: any Multi-Arch: same -Depends: libosmo-ranap0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-ranap1 (= ${binary:Version}), ${misc:Depends} Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) Package: libosmo-ranap-dev Section: libdevel Architecture: any Multi-Arch: same -Depends: libosmo-ranap0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-ranap1 (= ${binary:Version}), ${misc:Depends} Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) diff --git a/debian/libosmo-ranap0.install b/debian/libosmo-ranap1.install similarity index 100% rename from debian/libosmo-ranap0.install rename to debian/libosmo-ranap1.install diff --git a/src/Makefile.am b/src/Makefile.am index 62f09e5..d815394 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -49,7 +49,7 @@ # build the shared RANAP library # -RANAP_LIBVERSION=0:0:0 +RANAP_LIBVERSION=1:0:0 lib_LTLIBRARIES = libosmo-ranap.la libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOSIGTRAN_LIBS) \ -- To view, visit https://gerrit.osmocom.org/4466 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4fe653fdde6acda59485c73cee63bfc5326edf28 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:49:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 20:49:31 +0000 Subject: [PATCH] libasn1c[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4472 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: If5d252dc679e47a8375361d0ff278b7b98768f26 --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/72/4472/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index d4f98f3..5f31710 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -2,6 +2,7 @@ # jenkins build helper script for libasn1c. This is how we build on jenkins.osmocom.org set -e +osmo-clean-workspace.sh set +x echo @@ -16,3 +17,5 @@ $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4472 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If5d252dc679e47a8375361d0ff278b7b98768f26 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:50:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 20:50:21 +0000 Subject: [PATCH] libosmo-abis[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4473 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I2f4c0a6b9a066160707eb7768ea9cc8b77806b9b --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/73/4473/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6ff44ee..ff83984 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -13,8 +13,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -36,3 +37,5 @@ $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4473 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f4c0a6b9a066160707eb7768ea9cc8b77806b9b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:50:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 20:50:54 +0000 Subject: [PATCH] libosmo-netif[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4474 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I6bdbd22b5f05ab75de2c6c777667bf1a63eb0b86 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/74/4474/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 3e35a46..3fb014b 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -38,3 +39,5 @@ $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4474 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6bdbd22b5f05ab75de2c6c777667bf1a63eb0b86 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:51:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 20:51:21 +0000 Subject: [PATCH] libosmo-sccp[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4475 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I6e3a24a32b8e06d89ac11b59bca052d56f00c78c --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/75/4475/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index ae850ed..adc5db7 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -39,3 +40,5 @@ $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4475 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e3a24a32b8e06d89ac11b59bca052d56f00c78c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:54:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:54:32 +0000 Subject: [PATCH] osmo-bts[master]: update dependencies to latest libosmo-* Message-ID: Review at https://gerrit.osmocom.org/4476 update dependencies to latest libosmo-* We can either try to really build with those old versions or find the minimum version, or we can simply require latest version of all libosmo*, which is the safeest choice for now. Change-Id: I08915540b92d5135b0c325e30b5b6e24f88e6282 --- M configure.ac 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/76/4476/1 diff --git a/configure.ac b/configure.ac index bda30b5..80f1afd 100644 --- a/configure.ac +++ b/configure.ac @@ -35,14 +35,14 @@ dnl Checks for typedefs, structures and compiler characteristics dnl checks for libraries -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.9) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.3.2) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.3) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl) -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis) -PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec) -PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.3.2) +PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0) PKG_CHECK_MODULES(ORTP, ortp) AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support]) -- To view, visit https://gerrit.osmocom.org/4476 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I08915540b92d5135b0c325e30b5b6e24f88e6282 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:57:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:57:00 +0000 Subject: osmo-ci[master]: add osmo-clean-workspace.sh, use in osmo-deps.sh In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:57:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:57:26 +0000 Subject: osmo-ci[master]: osmo-build-dep: offload branch checkout to osmo-deps.sh In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4468 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I598c41a12352acea6e49a321ad2f665f6ea07a44 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 20:57:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Oct 2017 20:57:46 +0000 Subject: osmo-ci[master]: scripts: use 'git checkout -f' instead of 'reset --hard' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4469 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic6279ebaf8160bceb3fa2ab40eff0b888ecd5009 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:07:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:07:18 +0000 Subject: [PATCH] libsmpp34[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4477 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I0030c8662fa87fb589582a3f6bde6ed53e8e3ef9 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/77/4477/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 79d101e..6bf176a 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -2,8 +2,12 @@ set -ex +osmo-clean-workspace.sh + autoreconf --install --force ./configure $MAKE CFLAGS="-Werror" CPPFLAGS="-Werror" # currently broken $MAKE $PARALLEL_MAKE # currently broken $MAKE distcheck + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4477 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0030c8662fa87fb589582a3f6bde6ed53e8e3ef9 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:07:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:07:23 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4478 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: Iaf8338d0d061c70f7ab3737dc425784dc7c170a4 --- M contrib/jenkins.sh 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/78/4478/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 14af8cc..290fc62 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -4,6 +4,9 @@ base="$PWD" deps="$base/deps" +export deps + +osmo-clean-workspace.sh mkdir "$deps" || true @@ -13,3 +16,5 @@ cd "$base" $MAKE $PARALLEL_MAKE LIBOSMO_DIR="$deps/libosmocore" $MAKE $PARALLEL_MAKE LIBOSMO_DIR="$deps/libosmocore" check + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4478 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf8338d0d061c70f7ab3737dc425784dc7c170a4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:07:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:07:38 +0000 Subject: [PATCH] openbsc[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4479 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: Ibafac7c8a48f46237835e91c80e72543c6841d08 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/79/4479/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 61b27be..5bab5bf 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,5 +1,7 @@ #!/bin/sh -ex +osmo-clean-workspace.sh + artifact_deps() { x="$($1 libosmocore)" @@ -56,3 +58,5 @@ fi . osmo-build.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4479 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibafac7c8a48f46237835e91c80e72543c6841d08 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:07:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:07:54 +0000 Subject: [PATCH] osmo-bsc[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4480 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I9b6afb59f0a8037d1510a7fddb63927f10d653e5 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/80/4480/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index eb302d1..57954f0 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false @@ -47,3 +48,5 @@ DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4480 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b6afb59f0a8037d1510a7fddb63927f10d653e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:07:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:07:56 +0000 Subject: [PATCH] osmo-bts[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4481 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I830b17462b636e0bf03f4d88000660409503c3e5 --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_common.sh M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 6 files changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/81/4481/1 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 47ccde3..9a181f2 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -22,3 +22,5 @@ " build_bts "osmo-bts-trx" "$configure_flags" + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index d4c3b1a..cc1b5b3 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -17,8 +17,9 @@ export deps inst +osmo-clean-workspace.sh + mkdir -p "$deps" -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index 314d85c..feef302 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -17,3 +17,5 @@ configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" build_bts "osmo-bts-lc15" "$configure_flags" + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 8a351c5..1e139af 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -17,3 +17,5 @@ configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" build_bts "osmo-bts-octphy" "$configure_flags" + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 964fb94..ac8ef6d 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -26,3 +26,5 @@ " build_bts "osmo-bts-octphy+trx" "$configure_flags" + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index ca12e76..d7caf0f 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -24,3 +24,5 @@ if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then $MAKE -C contrib/sysmobts-calib fi + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4481 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I830b17462b636e0bf03f4d88000660409503c3e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:08:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:08:03 +0000 Subject: [PATCH] osmo-ggsn[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4482 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I1424dff06c7d4f695af0936671ad6faa504aaf16 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/82/4482/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 3bfb3f5..b2f8452 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false @@ -37,3 +38,5 @@ ./configure $MAKE $PARALLEL_MAKE $MAKE distcheck + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4482 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1424dff06c7d4f695af0936671ad6faa504aaf16 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:08:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:08:06 +0000 Subject: [PATCH] osmo-hlr[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4483 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I9d35913f9cd60ff121d29f357919a0b0d62d6835 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/83/4483/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b08c63b..d159db9 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -41,3 +42,5 @@ $MAKE check || cat-testlogs.sh $MAKE distcheck || cat-testlogs.sh fi + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4483 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9d35913f9cd60ff121d29f357919a0b0d62d6835 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:08:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:08:08 +0000 Subject: [PATCH] osmo-iuh[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4484 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I7261e006163eda4bee8a4695fbd5bd29307babe6 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/84/4484/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index cda0e2c..01e3da2 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -7,8 +7,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -54,3 +55,5 @@ || cat-testlogs.sh $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4484 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7261e006163eda4bee8a4695fbd5bd29307babe6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:08:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:08:10 +0000 Subject: [PATCH] osmo-mgw[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4485 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I5a64b305dff5387cbe2462b564051f807061086d --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/85/4485/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 22b962e..44152dc 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,9 +14,9 @@ inst="$deps/install" export deps inst -mkdir "$deps" || true -rm -rf "$inst" +osmo-clean-workspace.sh +mkdir "$deps" || true osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -45,3 +45,5 @@ DISTCHECK_CONFIGURE_FLAGS="$MGCP --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4485 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a64b305dff5387cbe2462b564051f807061086d Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:08:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:08:14 +0000 Subject: [PATCH] osmo-msc[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4486 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I6ae80147b2624079b5c364dbce08194215cc4e95 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/86/4486/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 284679d..e39123c 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false @@ -55,3 +56,5 @@ DISTCHECK_CONFIGURE_FLAGS="--enable-smpp $IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ae80147b2624079b5c364dbce08194215cc4e95 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:08:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:08:25 +0000 Subject: [PATCH] osmo-sgsn[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4487 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I7c3ecd83899f873bdc771ff7445740fea15900ef --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/87/4487/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 140fc63..fa7c60e 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false @@ -53,3 +54,5 @@ DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4487 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c3ecd83899f873bdc771ff7445740fea15900ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:08:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:08:28 +0000 Subject: [PATCH] osmo-sip-connector[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4488 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I7e9f19755f55b274def9d757f72f2a08a01a4cce --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/88/4488/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2999120..a2f7ee9 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -7,8 +7,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore @@ -32,3 +33,5 @@ || cat-testlogs.sh $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4488 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e9f19755f55b274def9d757f72f2a08a01a4cce Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:09:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:09:04 +0000 Subject: [PATCH] osmo-pcu[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4489 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: If8aa657c4bf62ef62549fbe9dc15ce3fb018d8d9 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/89/4489/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b815ddd..fb529a4 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -19,8 +19,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" # Collect configure options for osmo-pcu PCU_CONFIG="" @@ -80,3 +81,5 @@ DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \ $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8aa657c4bf62ef62549fbe9dc15ce3fb018d8d9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 21:09:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 21:09:14 +0000 Subject: [PATCH] osmo-trx[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4490 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I609f7c7c88b49f26e2e48e1f1cffed76d9e6fb5e --- M contrib/jenkins.sh 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/90/4490/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 80d6612..f31579e 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,7 +1,12 @@ #!/bin/sh set -ex + +osmo-clean-workspace.sh + autoreconf --install --force ./configure $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4490 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I609f7c7c88b49f26e2e48e1f1cffed76d9e6fb5e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 23:59:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 23:59:31 +0000 Subject: osmo-ci[master]: add osmo-clean-workspace.sh, use in osmo-deps.sh In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 23:59:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 23:59:33 +0000 Subject: osmo-ci[master]: osmo-build-dep: offload branch checkout to osmo-deps.sh In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4468 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I598c41a12352acea6e49a321ad2f665f6ea07a44 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 23:59:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 23:59:37 +0000 Subject: osmo-ci[master]: scripts: use 'git checkout -f' instead of 'reset --hard' In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/4469 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic6279ebaf8160bceb3fa2ab40eff0b888ecd5009 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Oct 27 23:59:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 23:59:52 +0000 Subject: [MERGED] osmo-ci[master]: scripts: use 'git checkout -f' instead of 'reset --hard' In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: scripts: use 'git checkout -f' instead of 'reset --hard' ...................................................................... scripts: use 'git checkout -f' instead of 'reset --hard' 'checkout -f' more accurately does what is intended. 'reset' changes the current branch to some hash, 'checkout -f' force-checkouts another branch. Change-Id: Ic6279ebaf8160bceb3fa2ab40eff0b888ecd5009 --- M scripts/osmo-deps.sh M scripts/osmo-layer1-headers.sh 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh index 92cf041..74de22b 100755 --- a/scripts/osmo-deps.sh +++ b/scripts/osmo-deps.sh @@ -16,5 +16,5 @@ # the dep subdir separately: osmo-clean-workspace.sh -git reset --hard "$branch" +git checkout -f "$branch" git rev-parse HEAD diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh index 374515e..a975396 100755 --- a/scripts/osmo-layer1-headers.sh +++ b/scripts/osmo-layer1-headers.sh @@ -44,4 +44,4 @@ cd layer1-headers git fetch origin -git reset --hard "$version" +git checkout -f "$version" -- To view, visit https://gerrit.osmocom.org/4469 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic6279ebaf8160bceb3fa2ab40eff0b888ecd5009 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 23:59:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 23:59:52 +0000 Subject: [MERGED] osmo-ci[master]: osmo-build-dep: offload branch checkout to osmo-deps.sh In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo-build-dep: offload branch checkout to osmo-deps.sh ...................................................................... osmo-build-dep: offload branch checkout to osmo-deps.sh In osmo-deps.sh, add second arg $branch, and also name the first one (i.e. $project). Use the passed branch or 'origin/master' by default. In osmo-build-dep.sh, it's not necessary to do a second 'git rev-parse HEAD', osmo-deps.sh already does it. Change-Id: I598c41a12352acea6e49a321ad2f665f6ea07a44 --- M scripts/osmo-build-dep.sh M scripts/osmo-deps.sh 2 files changed, 7 insertions(+), 9 deletions(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/scripts/osmo-build-dep.sh b/scripts/osmo-build-dep.sh index 8104ba7..6e9ef86 100755 --- a/scripts/osmo-build-dep.sh +++ b/scripts/osmo-build-dep.sh @@ -40,12 +40,8 @@ mkdir -p "$deps" cd "$deps" -osmo-deps.sh "$project" +osmo-deps.sh "$project" "$branch" cd "$project" -if [ -n "$branch" ]; then - git checkout "$branch" -fi -git rev-parse HEAD # log current HEAD autoreconf --install --force ./configure --prefix="$inst" $cfg diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh index c256a6a..92cf041 100755 --- a/scripts/osmo-deps.sh +++ b/scripts/osmo-deps.sh @@ -1,12 +1,14 @@ #!/bin/sh set -ex +project="$1" +branch="${2:-origin/master}" -if ! test -d $1; +if ! test -d "$project"; then - git clone git://git.osmocom.org/$1 $1 + git clone "git://git.osmocom.org/$project" "$project" fi -cd $1 +cd "$project" git fetch origin # Cleanup should already have happened during a global osmo-clean-workspace.sh, @@ -14,5 +16,5 @@ # the dep subdir separately: osmo-clean-workspace.sh -git reset --hard origin/master +git reset --hard "$branch" git rev-parse HEAD -- To view, visit https://gerrit.osmocom.org/4468 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I598c41a12352acea6e49a321ad2f665f6ea07a44 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Oct 27 23:59:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Oct 2017 23:59:53 +0000 Subject: [MERGED] osmo-ci[master]: add osmo-clean-workspace.sh, use in osmo-deps.sh In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add osmo-clean-workspace.sh, use in osmo-deps.sh ...................................................................... add osmo-clean-workspace.sh, use in osmo-deps.sh So far, each jenkins job does its own cleanup, more or less well. Also, jenkins git config offers the 'Clean before checkout' option, which seems to fail when there are non-writable leftovers from a failed 'make distcheck'. Furthermore, our jenkins build slaves have unused compiled binaries piling up by the gigabytes: each matrix build x each parallel build and each compiled dependency therein builds .o, .a, .so and executables plus installs them to a local prefix, and just leaves them sitting around to rot until the job runs again. Instead, we want to clean them out when building is done. All of this calls for a unified cleanup script that knows how to clean a workspace properly, to run once before and once after each jenkins build. Here it is. Use that function in osmo-deps.sh instead of duplicating cleanup steps. Change-Id: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 --- M scripts/osmo-build-dep.sh A scripts/osmo-clean-workspace.sh M scripts/osmo-deps.sh 3 files changed, 48 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/scripts/osmo-build-dep.sh b/scripts/osmo-build-dep.sh index 2a107ed..8104ba7 100755 --- a/scripts/osmo-build-dep.sh +++ b/scripts/osmo-build-dep.sh @@ -40,7 +40,6 @@ mkdir -p "$deps" cd "$deps" -rm -rf "$project" osmo-deps.sh "$project" cd "$project" if [ -n "$branch" ]; then diff --git a/scripts/osmo-clean-workspace.sh b/scripts/osmo-clean-workspace.sh new file mode 100755 index 0000000..11a5b72 --- /dev/null +++ b/scripts/osmo-clean-workspace.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# Clean workspace. +# This should be the first and last step of every jenkins build: +# a) to make sure the workspace has no build artifacts from previous runs. +# b) to reduce disk space lost to unused binaries; parallel and/or matrix +# builds create numerous workspaces, blowing up disk usage. +# Note that if a build fails, the last steps will not run, hence calling this +# as last step cleans only in case there was no build failure, i.e. where we +# don't need to keep anything anyway. +# +# Assume $PWD is a git clone's root dir. Usually, that's also the jenkins +# workspace root. Do not wipe subdir 'layer1-headers' as well as all dirs under +# '$deps'. These are assumed to be git clones that do not need to be re-cloned +# every time. Do a 'git clean' in each of them individually. If '$deps' is not +# defined or the mentioned dirs do not exist, nothing special happens, so this +# script can be safely run in any git clone in deeper subdirs of the workspace. + +set -ex + +# make sure no write protected cruft is in the way. A failed 'make distcheck' +# has a habit of leaving a non-writable dir tree behind. +chmod -R +w . + +# wipe all local modifications +git checkout -f HEAD + +# wipe all unversioned leftovers, except deps gits. +git clean -dxf -e "$deps" -e "layer1-headers" + +# leave the deps checkouts around, to not clone entire git history every time, +# but clean each git of build artifacts. +if [ -d "$deps" ]; then + for dep_dir in "$deps"/* ; do + git checkout -f HEAD + git -C "$dep_dir" clean -dxf + done +fi + +if [ -d "layer1-headers" ]; then + git checkout -f HEAD + git -C "layer1-headers" clean -dxf +fi diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh index 86da9a6..c256a6a 100755 --- a/scripts/osmo-deps.sh +++ b/scripts/osmo-deps.sh @@ -8,5 +8,11 @@ cd $1 git fetch origin + +# Cleanup should already have happened during a global osmo-clean-workspace.sh, +# but in case the caller did not (want to) call that, let's also do cleanup in +# the dep subdir separately: +osmo-clean-workspace.sh + git reset --hard origin/master git rev-parse HEAD -- To view, visit https://gerrit.osmocom.org/4467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 28 02:22:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Oct 2017 02:22:56 +0000 Subject: [PATCH] osmo-ci[master]: osmo-deps.sh: make sure to not clean all deps when inside a ... Message-ID: Review at https://gerrit.osmocom.org/4491 osmo-deps.sh: make sure to not clean all deps when inside a dep dir Make sure osmo-deps.sh passes no $deps in to osmo-clean-workspace.sh. In most builds, $deps is a relative path, and when within a dir that contains no such subir, calling osmo-clean-workspace.sh has no effect. However, in some, $deps is passed in as absolute path, so when within a deps/... subdir in osmo-deps.sh, the script would still find the abspath and clean out all deps subdirs; for example in osmo-bts. Change-Id: I431d20aedefc708645a1f1862334cffaef20b928 --- M scripts/osmo-deps.sh 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/91/4491/1 diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh index 74de22b..0610037 100755 --- a/scripts/osmo-deps.sh +++ b/scripts/osmo-deps.sh @@ -13,8 +13,8 @@ # Cleanup should already have happened during a global osmo-clean-workspace.sh, # but in case the caller did not (want to) call that, let's also do cleanup in -# the dep subdir separately: -osmo-clean-workspace.sh +# this dep subdir separately, making sure to not pass in $deps as abspath. +deps="" osmo-clean-workspace.sh git checkout -f "$branch" git rev-parse HEAD -- To view, visit https://gerrit.osmocom.org/4491 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I431d20aedefc708645a1f1862334cffaef20b928 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 28 02:23:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Oct 2017 02:23:25 +0000 Subject: osmo-ci[master]: osmo-deps.sh: make sure to not clean all deps when inside a ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4491 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I431d20aedefc708645a1f1862334cffaef20b928 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 02:23:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Oct 2017 02:23:27 +0000 Subject: [MERGED] osmo-ci[master]: osmo-deps.sh: make sure to not clean all deps when inside a ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo-deps.sh: make sure to not clean all deps when inside a dep dir ...................................................................... osmo-deps.sh: make sure to not clean all deps when inside a dep dir Make sure osmo-deps.sh passes no $deps in to osmo-clean-workspace.sh. In most builds, $deps is a relative path, and when within a dir that contains no such subir, calling osmo-clean-workspace.sh has no effect. However, in some, $deps is passed in as absolute path, so when within a deps/... subdir in osmo-deps.sh, the script would still find the abspath and clean out all deps subdirs; for example in osmo-bts. Change-Id: I431d20aedefc708645a1f1862334cffaef20b928 --- M scripts/osmo-deps.sh 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh index 74de22b..0610037 100755 --- a/scripts/osmo-deps.sh +++ b/scripts/osmo-deps.sh @@ -13,8 +13,8 @@ # Cleanup should already have happened during a global osmo-clean-workspace.sh, # but in case the caller did not (want to) call that, let's also do cleanup in -# the dep subdir separately: -osmo-clean-workspace.sh +# this dep subdir separately, making sure to not pass in $deps as abspath. +deps="" osmo-clean-workspace.sh git checkout -f "$branch" git rev-parse HEAD -- To view, visit https://gerrit.osmocom.org/4491 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I431d20aedefc708645a1f1862334cffaef20b928 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 28 02:31:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Oct 2017 02:31:22 +0000 Subject: [PATCH] libasn1c[master]: fix compiler warning: drop dead code from BIT_STRING_fromBuf() Message-ID: Review at https://gerrit.osmocom.org/4492 fix compiler warning: drop dead code from BIT_STRING_fromBuf() The warning is, on FreeBSD, CC asn1helpers.lo asn1helpers.c:68:10: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] if (len < 0) ~~~ ^ ~ Change-Id: I80867da697d744d7ef4d70c8f24031f5781fb11a --- M src/asn1helpers.c 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/92/4492/1 diff --git a/src/asn1helpers.c b/src/asn1helpers.c index a4ced70..4e5e08d 100644 --- a/src/asn1helpers.c +++ b/src/asn1helpers.c @@ -65,9 +65,6 @@ return 0; } - if (len < 0) - len = strlen((char*)str); - buf = MALLOC(len); if (!buf) { errno = ENOMEM; -- To view, visit https://gerrit.osmocom.org/4492 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I80867da697d744d7ef4d70c8f24031f5781fb11a Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 28 02:36:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Oct 2017 02:36:44 +0000 Subject: osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 I assume we can merge it now ... otherwise I'll fix later -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 8 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 02:36:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Oct 2017 02:36:56 +0000 Subject: [MERGED] osmo-hlr[master]: ctrl: completely replace all CTRL commands In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: ctrl: completely replace all CTRL commands ...................................................................... ctrl: completely replace all CTRL commands The previous commands are not conforming to how the CTRL interface is intended to work: SET enable-ps SET disable-ps SET status-ps 'status-ps' is a write-only command even though it returns the status. 'enable-ps' / 'disable-ps' indicate the value instead of a variable name of an entity. The entity takes the place of the variable value. See also https://lists.osmocom.org/pipermail/openbsc/2017-September/011236.html Instead, replace with SET subscriber.by-imsi-123456.ps-enabled {0,1} GET subscriber.by-imsi-123456.ps-enabled and also provide further CTRL functions while at it: {SET,GET} subscriber.by-{imsi,msisdn,id}-123456.{cs,ps}-enabled {0,1} GET subscriber.by-{imsi,msisdn,id}-123456.{info,info-aud,info-all} Provide CTRL tests in the form of transcripts. Adjust tests/test_subscriber.sql to feature nonzero SQN, to see some values for SQN in the CTRL transcript tests. (This does not affect the VTY tests, because that creates its own subscribers, and there's no VTY command to set the SQN.) This is the first time an application uses CTRL_NODE ids that are defined outside of libosmocore, see 'Depends' below. Implementation choice: the first idea was to have a '.' between the 'by-xxx' and the value, like: subscriber.by-xxx.123456.function but the difficulty with subscribers is that they are not in RAM, and I can't just point node_data at a struct instance that is always there (like, say, a global bts[0] struct in osmo-bsc). Instead, I want to store the selector and later decide whether to read from the DB or whatever. With a '.' separating things, the only way in a ctrl function to obtain both 'by-xxx' and '123456' for picking a subscriber record would be to parse the entire variable path string elements, including 'subscriber' and 'function', which would then also clumsily fix at which node level we hook these commands; there could have been separate CTRL_NODE_SUBSCR_BY_{IMSI,MSISDN,ID} parent nodes, but we cannot introspect the current parent node dynamically within a ctrl function handler (plus I'm not sure whether it's possible and a good idea to have the same command under multiple parent nodes). Rather than that, I store the 'by-foo-123' token in the node_data pointer to have both bits of information pointed at by a single pointer; I use the incoming command parsing to get this token pre-separated from surrounding node names, and no need to re-allocate it, since the vector of tokens lives until after command execution is complete. Each leaf command obtains this token from cmd->node (aka node_data), and feeds this token to a common static function to parse selector and value from it and to retrieve a subscriber record as needed. (BTW, I have mentioned on the mailing list that this way might be necessary to avoid numeric-only CTRL node names, but we don't need to, and that is not at all related to this choice of structure.) Depends: libosmocore I1bd62ae0d4eefde7e1517db15a2155640a1bab58 libosmocore Ic9dba0e4a1eb5a7dc3cee2f181b9024ed4fc7005 Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 --- M src/ctrl.c M src/ctrl.h M tests/test_subscriber.ctrl M tests/test_subscriber.sql M tests/test_subscriber.vty A tests/test_subscriber_errors.ctrl 6 files changed, 1,041 insertions(+), 73 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl.c b/src/ctrl.c index b49765d..3e81661 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -21,77 +21,362 @@ */ #include +#include +#include +#include -#include -#include +#include #include -#include "gsup_server.h" -#include "logging.h" -#include "db.h" #include "hlr.h" -#include "luop.h" #include "ctrl.h" +#include "db.h" -static int handle_cmd_ps(struct hlr *ctx, struct ctrl_cmd *cmd, bool enable) +#define SEL_BY "by-" +#define SEL_BY_IMSI SEL_BY "imsi-" +#define SEL_BY_MSISDN SEL_BY "msisdn-" +#define SEL_BY_ID SEL_BY "id-" + +#define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) + +static bool startswith(const char *str, const char *start) +{ + return strncmp(str, start, strlen(start)) == 0; +} + +static int _get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr) +{ + const char *val; + if (startswith(by_selector, SEL_BY_IMSI)) { + val = by_selector + strlen(SEL_BY_IMSI); + if (!osmo_imsi_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_imsi(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_MSISDN)) { + val = by_selector + strlen(SEL_BY_MSISDN); + if (!osmo_msisdn_str_valid(val)) + return -EINVAL; + return db_subscr_get_by_msisdn(dbc, val, subscr); + } + if (startswith(by_selector, SEL_BY_ID)) { + int64_t id; + char *endptr; + val = by_selector + strlen(SEL_BY_ID); + if (*val == '+') + return -EINVAL; + errno = 0; + id = strtoll(val, &endptr, 10); + if (errno || *endptr) + return -EINVAL; + return db_subscr_get_by_id(dbc, id, subscr); + } + return -ENOTSUP; +} + +static bool get_subscriber(struct db_context *dbc, + const char *by_selector, + struct hlr_subscriber *subscr, + struct ctrl_cmd *cmd) +{ + int rc = _get_subscriber(dbc, by_selector, subscr); + switch (rc) { + case 0: + return true; + case -ENOTSUP: + cmd->reply = "Not a known subscriber 'by-xxx-' selector."; + return false; + case -EINVAL: + cmd->reply = "Invalid value part of 'by-xxx-value' selector."; + return false; + case -ENOENT: + cmd->reply = "No such subscriber."; + return false; + default: + cmd->reply = "An unknown error has occured during get_subscriber()."; + return false; + } +} + +/* Optimization: if a subscriber operation is requested by-imsi, just return + * the IMSI right back. */ +static const char *get_subscriber_imsi(struct db_context *dbc, + const char *by_selector, + struct ctrl_cmd *cmd) +{ + static struct hlr_subscriber subscr; + + if (startswith(by_selector, SEL_BY_IMSI)) + return by_selector + strlen(SEL_BY_IMSI); + if (!get_subscriber(dbc, by_selector, &subscr, cmd)) + return NULL; + return subscr.imsi; +} + +/* printf fmt and arg to completely omit a string if it is empty. */ +#define FMT_S "%s%s%s%s" +#define ARG_S(name, val) \ + (val) && *(val) ? "\n" : "", \ + (val) && *(val) ? name : "", \ + (val) && *(val) ? "\t" : "", \ + (val) && *(val) ? (val) : "" \ + +/* printf fmt and arg to completely omit bool of given value. */ +#define FMT_BOOL "%s" +#define ARG_BOOL(name, val) \ + val ? "\n" name "\t1" : "\n" name "\t0" + +static void print_subscr_info(struct ctrl_cmd *cmd, + struct hlr_subscriber *subscr) +{ + ctrl_cmd_reply_printf(cmd, + "\nid\t%"PRIu64 + FMT_S + FMT_S + FMT_BOOL + FMT_BOOL + FMT_S + FMT_S + FMT_S + FMT_BOOL + FMT_BOOL + "\nperiodic_lu_timer\t%u" + "\nperiodic_rau_tau_timer\t%u" + "\nlmsi\t%08x" + , + subscr->id, + ARG_S("imsi", subscr->imsi), + ARG_S("msisdn", subscr->msisdn), + ARG_BOOL("nam_cs", subscr->nam_cs), + ARG_BOOL("nam_ps", subscr->nam_ps), + ARG_S("vlr_number", subscr->vlr_number), + ARG_S("sgsn_number", subscr->sgsn_number), + ARG_S("sgsn_address", subscr->sgsn_address), + ARG_BOOL("ms_purged_cs", subscr->ms_purged_cs), + ARG_BOOL("ms_purged_ps", subscr->ms_purged_ps), + subscr->periodic_lu_timer, + subscr->periodic_rau_tau_timer, + subscr->lmsi + ); +} + +static void print_subscr_info_aud2g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + ctrl_cmd_reply_printf(cmd, + "\naud2g.algo\t%s" + "\naud2g.ki\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.gsm.ki)); +} + +static void print_subscr_info_aud3g(struct ctrl_cmd *cmd, struct osmo_sub_auth_data *aud) +{ + if (aud->algo == OSMO_AUTH_ALG_NONE) + return; + ctrl_cmd_reply_printf(cmd, + "\naud3g.algo\t%s" + "\naud3g.k\t%s" + , + osmo_auth_alg_name(aud->algo), + hexdump_buf(aud->u.umts.k)); + /* hexdump uses a static string buffer, hence only one hexdump per + * printf(). */ + ctrl_cmd_reply_printf(cmd, + "\naud3g.%s\t%s" + "\naud3g.ind_bitlen\t%u" + "\naud3g.sqn\t%"PRIu64 + , + aud->u.umts.opc_is_op? "op" : "opc", + hexdump_buf(aud->u.umts.opc), + aud->u.umts.ind_bitlen, + aud->u.umts.sqn); +} + +CTRL_CMD_DEFINE_RO(subscr_info, "info"); +static int get_subscr_info(struct ctrl_cmd *cmd, void *data) { struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; - if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, &subscr) < 0) { - cmd->reply = "Subscriber Unknown in HLR"; + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + print_subscr_info(cmd, &subscr); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_aud, "info-aud"); +static int get_subscr_info_aud(struct ctrl_cmd *cmd, void *data) +{ + const char *imsi; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + /* No auth data found, tell the print*() functions about it. */ + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } - if (hlr_subscr_nam(ctx, &subscr, enable, true) < 0) { - cmd->reply = "Error updating DB"; + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE_RO(subscr_info_all, "info-all"); +static int get_subscr_info_all(struct ctrl_cmd *cmd, void *data) +{ + struct hlr_subscriber subscr; + struct osmo_sub_auth_data aud2g; + struct osmo_sub_auth_data aud3g; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + int rc; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + rc = db_get_auth_data(hlr->dbc, subscr.imsi, &aud2g, &aud3g, NULL); + + if (rc == -ENOENT) { + /* No auth data found, tell the print*() functions about it. */ + aud2g.algo = OSMO_AUTH_ALG_NONE; + aud3g.algo = OSMO_AUTH_ALG_NONE; + } else if (rc) { + cmd->reply = "Error retrieving authentication data."; return CTRL_CMD_ERROR; } + print_subscr_info(cmd, &subscr); + print_subscr_info_aud2g(cmd, &aud2g); + print_subscr_info_aud3g(cmd, &aud3g); + + return CTRL_CMD_REPLY; +} + +static int verify_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) +{ + if (!value || !*value + || (strcmp(value, "0") && strcmp(value, "1"))) + return 1; + return 0; +} + +static int get_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + struct hlr_subscriber subscr; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + if (!get_subscriber(hlr->dbc, by_selector, &subscr, cmd)) + return CTRL_CMD_ERROR; + + cmd->reply = (is_ps ? subscr.nam_ps : subscr.nam_cs) + ? "1" : "0"; + return CTRL_CMD_REPLY; +} + +static int set_subscr_cs_ps_enabled(struct ctrl_cmd *cmd, void *data, + bool is_ps) +{ + const char *imsi; + struct hlr *hlr = data; + const char *by_selector = cmd->node; + + imsi = get_subscriber_imsi(hlr->dbc, by_selector, cmd); + if (!imsi) + return CTRL_CMD_ERROR; + if (db_subscr_nam(hlr->dbc, imsi, strcmp(cmd->value, "1") == 0, is_ps)) + return CTRL_CMD_ERROR; cmd->reply = "OK"; return CTRL_CMD_REPLY; } -CTRL_CMD_DEFINE_WO_NOVRF(enable_ps, "enable-ps"); -static int set_enable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_ps_enabled, "ps-enabled"); +static int verify_subscr_ps_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, true); + return verify_subscr_cs_ps_enabled(cmd, value, data); +} +static int get_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return get_subscr_cs_ps_enabled(cmd, data, true); +} +static int set_subscr_ps_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, true); } -CTRL_CMD_DEFINE_WO_NOVRF(disable_ps, "disable-ps"); -static int set_disable_ps(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(subscr_cs_enabled, "cs-enabled"); +static int verify_subscr_cs_enabled(struct ctrl_cmd *cmd, const char *value, void *data) { - return handle_cmd_ps(data, cmd, false); + return verify_subscr_cs_ps_enabled(cmd, value, data); } - -CTRL_CMD_DEFINE_WO_NOVRF(status_ps, "status-ps"); -static int set_status_ps(struct ctrl_cmd *cmd, void *data) +static int get_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) { - struct hlr *ctx = data; - struct lu_operation *luop = lu_op_alloc(ctx->gs); - if (!luop) { - cmd->reply = "Internal HLR error"; - return CTRL_CMD_ERROR; - } - - if (!lu_op_fill_subscr(luop, ctx->dbc, cmd->value)) { - cmd->reply = "Subscriber Unknown in HLR"; - return CTRL_CMD_ERROR; - } - - cmd->reply = luop->subscr.nam_ps ? "1" : "0"; - - return CTRL_CMD_REPLY; + return get_subscr_cs_ps_enabled(cmd, data, false); +} +static int set_subscr_cs_enabled(struct ctrl_cmd *cmd, void *data) +{ + return set_subscr_cs_ps_enabled(cmd, data, false); } int hlr_ctrl_cmds_install() { int rc = 0; - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_enable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_disable_ps); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_status_ps); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_aud); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_info_all); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_ps_enabled); + rc |= ctrl_cmd_install(CTRL_NODE_SUBSCR_BY, &cmd_subscr_cs_enabled); return rc; +} + +static int hlr_ctrl_node_lookup(void *data, vector vline, int *node_type, + void **node_data, int *i) +{ + const char *token = vector_slot(vline, *i); + + switch (*node_type) { + case CTRL_NODE_ROOT: + if (strcmp(token, "subscriber") != 0) + return 0; + *node_data = NULL; + *node_type = CTRL_NODE_SUBSCR; + break; + case CTRL_NODE_SUBSCR: + if (!startswith(token, "by-")) + return 0; + *node_data = (void*)token; + *node_type = CTRL_NODE_SUBSCR_BY; + break; + default: + return 0; + } + + return 1; } struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr) @@ -100,8 +385,8 @@ struct ctrl_handle *hdl = ctrl_interface_setup_dynip2(hlr, hlr->ctrl_bind_addr, OSMO_CTRL_PORT_HLR, - NULL, - 0); + hlr_ctrl_node_lookup, + _LAST_CTRL_NODE_HLR); if (!hdl) return NULL; diff --git a/src/ctrl.h b/src/ctrl.h index 239deea..3f9ba3f 100644 --- a/src/ctrl.h +++ b/src/ctrl.h @@ -24,7 +24,11 @@ #include -#include "gsup_server.h" +enum hlr_ctrl_node { + CTRL_NODE_SUBSCR = _LAST_CTRL_NODE, + CTRL_NODE_SUBSCR_BY, + _LAST_CTRL_NODE_HLR +}; int hlr_ctrl_cmds_install(); struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr); diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl index 3284ae5..b9be5fe 100644 --- a/tests/test_subscriber.ctrl +++ b/tests/test_subscriber.ctrl @@ -1,27 +1,598 @@ -GET 1 invalid -ERROR 1 Command not found -SET 2 invalid nonsense -ERROR 2 Command not found +GET 1 subscriber.by-imsi-901990000000001.info +GET_REPLY 1 subscriber.by-imsi-901990000000001.info +id 1 +imsi 901990000000001 +msisdn 1 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 -SET 3 enable-ps 901990000000001 -SET_REPLY 3 enable-ps OK -SET 4 status-ps 901990000000001 -SET_REPLY 4 status-ps 1 -SET 5 enable-ps 901990000000001 -SET_REPLY 5 enable-ps OK -SET 6 status-ps 901990000000001 -SET_REPLY 6 status-ps 1 +GET 2 subscriber.by-imsi-901990000000001.info-aud +GET_REPLY 2 subscriber.by-imsi-901990000000001.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 7 disable-ps 901990000000001 -SET_REPLY 7 disable-ps OK -SET 8 status-ps 901990000000001 -SET_REPLY 8 status-ps 0 -SET 9 disable-ps 901990000000001 -SET_REPLY 9 disable-ps OK -SET 10 status-ps 901990000000001 -SET_REPLY 10 status-ps 0 +GET 3 subscriber.by-imsi-901990000000001.info-all +GET_REPLY 3 subscriber.by-imsi-901990000000001.info-all +id 1 +imsi 901990000000001 +msisdn 1 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f -SET 11 enable-ps 901990000000001 -SET_REPLY 11 enable-ps OK -SET 12 status-ps 901990000000001 -SET_REPLY 12 status-ps 1 +GET 4 subscriber.by-imsi-901990000000002.info +GET_REPLY 4 subscriber.by-imsi-901990000000002.info +id 2 +imsi 901990000000002 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 5 subscriber.by-imsi-901990000000002.info-aud +GET_REPLY 5 subscriber.by-imsi-901990000000002.info-aud +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 4223 + +GET 6 subscriber.by-imsi-901990000000002.info-all +GET_REPLY 6 subscriber.by-imsi-901990000000002.info-all +id 2 +imsi 901990000000002 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 4223 + +GET 7 subscriber.by-imsi-901990000000003.info +GET_REPLY 7 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 8 subscriber.by-imsi-901990000000003.info-aud +GET_REPLY 8 subscriber.by-imsi-901990000000003.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 9 subscriber.by-imsi-901990000000003.info-all +GET_REPLY 9 subscriber.by-imsi-901990000000003.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 10 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 10 subscriber.by-imsi-901990000000003.ps-enabled 1 + +SET 11 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 11 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 12 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 12 subscriber.by-imsi-901990000000003.ps-enabled 0 + +GET 13 subscriber.by-imsi-901990000000003.info +GET_REPLY 13 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 14 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 14 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 15 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 15 subscriber.by-imsi-901990000000003.ps-enabled 0 + +SET 16 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 16 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 17 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 17 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 18 subscriber.by-imsi-901990000000003.info +GET_REPLY 18 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 19 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 19 subscriber.by-imsi-901990000000003.ps-enabled OK +GET 20 subscriber.by-imsi-901990000000003.ps-enabled +GET_REPLY 20 subscriber.by-imsi-901990000000003.ps-enabled 1 + +GET 21 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 21 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 22 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 22 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 23 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 23 subscriber.by-imsi-901990000000003.cs-enabled 0 + +GET 24 subscriber.by-imsi-901990000000003.info +GET_REPLY 24 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 25 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 25 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 26 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 26 subscriber.by-imsi-901990000000003.cs-enabled 0 + +SET 27 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 27 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 28 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 28 subscriber.by-imsi-901990000000003.cs-enabled 1 + +GET 29 subscriber.by-imsi-901990000000003.info +GET_REPLY 29 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 30 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 30 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 31 subscriber.by-imsi-901990000000003.cs-enabled +GET_REPLY 31 subscriber.by-imsi-901990000000003.cs-enabled 1 + +SET 32 subscriber.by-imsi-901990000000003.ps-enabled 0 +SET_REPLY 32 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 33 subscriber.by-imsi-901990000000003.cs-enabled 0 +SET_REPLY 33 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 34 subscriber.by-imsi-901990000000003.info +GET_REPLY 34 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 35 subscriber.by-imsi-901990000000003.ps-enabled 1 +SET_REPLY 35 subscriber.by-imsi-901990000000003.ps-enabled OK +SET 36 subscriber.by-imsi-901990000000003.cs-enabled 1 +SET_REPLY 36 subscriber.by-imsi-901990000000003.cs-enabled OK +GET 37 subscriber.by-imsi-901990000000003.info +GET_REPLY 37 subscriber.by-imsi-901990000000003.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + + + +GET 38 subscriber.by-msisdn-103.info +GET_REPLY 38 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 39 subscriber.by-msisdn-103.info-aud +GET_REPLY 39 subscriber.by-msisdn-103.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 40 subscriber.by-msisdn-103.info-all +GET_REPLY 40 subscriber.by-msisdn-103.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 41 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 41 subscriber.by-msisdn-103.ps-enabled 1 + +SET 42 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 42 subscriber.by-msisdn-103.ps-enabled OK +GET 43 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 43 subscriber.by-msisdn-103.ps-enabled 0 + +GET 44 subscriber.by-msisdn-103.info +GET_REPLY 44 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 45 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 45 subscriber.by-msisdn-103.ps-enabled OK +GET 46 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 46 subscriber.by-msisdn-103.ps-enabled 0 + +SET 47 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 47 subscriber.by-msisdn-103.ps-enabled OK +GET 48 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 48 subscriber.by-msisdn-103.ps-enabled 1 + +GET 49 subscriber.by-msisdn-103.info +GET_REPLY 49 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 50 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 50 subscriber.by-msisdn-103.ps-enabled OK +GET 51 subscriber.by-msisdn-103.ps-enabled +GET_REPLY 51 subscriber.by-msisdn-103.ps-enabled 1 + +GET 52 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 52 subscriber.by-msisdn-103.cs-enabled 1 + +SET 53 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 53 subscriber.by-msisdn-103.cs-enabled OK +GET 54 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 54 subscriber.by-msisdn-103.cs-enabled 0 + +GET 55 subscriber.by-msisdn-103.info +GET_REPLY 55 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 56 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 56 subscriber.by-msisdn-103.cs-enabled OK +GET 57 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 57 subscriber.by-msisdn-103.cs-enabled 0 + +SET 58 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 58 subscriber.by-msisdn-103.cs-enabled OK +GET 59 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 59 subscriber.by-msisdn-103.cs-enabled 1 + +GET 60 subscriber.by-msisdn-103.info +GET_REPLY 60 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 61 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 61 subscriber.by-msisdn-103.cs-enabled OK +GET 62 subscriber.by-msisdn-103.cs-enabled +GET_REPLY 62 subscriber.by-msisdn-103.cs-enabled 1 + +SET 63 subscriber.by-msisdn-103.ps-enabled 0 +SET_REPLY 63 subscriber.by-msisdn-103.ps-enabled OK +SET 64 subscriber.by-msisdn-103.cs-enabled 0 +SET_REPLY 64 subscriber.by-msisdn-103.cs-enabled OK +GET 65 subscriber.by-msisdn-103.info +GET_REPLY 65 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 66 subscriber.by-msisdn-103.ps-enabled 1 +SET_REPLY 66 subscriber.by-msisdn-103.ps-enabled OK +SET 67 subscriber.by-msisdn-103.cs-enabled 1 +SET_REPLY 67 subscriber.by-msisdn-103.cs-enabled OK +GET 68 subscriber.by-msisdn-103.info +GET_REPLY 68 subscriber.by-msisdn-103.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + + + +GET 69 subscriber.by-id-3.info +GET_REPLY 69 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 70 subscriber.by-id-3.info-aud +GET_REPLY 70 subscriber.by-id-3.info-aud +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 71 subscriber.by-id-3.info-all +GET_REPLY 71 subscriber.by-id-3.info-all +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 +aud2g.algo COMP128v1 +aud2g.ki 000102030405060708090a0b0c0d0e0f +aud3g.algo MILENAGE +aud3g.k 000102030405060708090a0b0c0d0e0f +aud3g.opc 101112131415161718191a1b1c1d1e1f +aud3g.ind_bitlen 5 +aud3g.sqn 2342 + +GET 72 subscriber.by-id-3.ps-enabled +GET_REPLY 72 subscriber.by-id-3.ps-enabled 1 + +SET 73 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 73 subscriber.by-id-3.ps-enabled OK +GET 74 subscriber.by-id-3.ps-enabled +GET_REPLY 74 subscriber.by-id-3.ps-enabled 0 + +GET 75 subscriber.by-id-3.info +GET_REPLY 75 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 76 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 76 subscriber.by-id-3.ps-enabled OK +GET 77 subscriber.by-id-3.ps-enabled +GET_REPLY 77 subscriber.by-id-3.ps-enabled 0 + +SET 78 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 78 subscriber.by-id-3.ps-enabled OK +GET 79 subscriber.by-id-3.ps-enabled +GET_REPLY 79 subscriber.by-id-3.ps-enabled 1 + +GET 80 subscriber.by-id-3.info +GET_REPLY 80 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 81 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 81 subscriber.by-id-3.ps-enabled OK +GET 82 subscriber.by-id-3.ps-enabled +GET_REPLY 82 subscriber.by-id-3.ps-enabled 1 + +GET 83 subscriber.by-id-3.cs-enabled +GET_REPLY 83 subscriber.by-id-3.cs-enabled 1 + +SET 84 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 84 subscriber.by-id-3.cs-enabled OK +GET 85 subscriber.by-id-3.cs-enabled +GET_REPLY 85 subscriber.by-id-3.cs-enabled 0 + +GET 86 subscriber.by-id-3.info +GET_REPLY 86 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 87 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 87 subscriber.by-id-3.cs-enabled OK +GET 88 subscriber.by-id-3.cs-enabled +GET_REPLY 88 subscriber.by-id-3.cs-enabled 0 + +SET 89 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 89 subscriber.by-id-3.cs-enabled OK +GET 90 subscriber.by-id-3.cs-enabled +GET_REPLY 90 subscriber.by-id-3.cs-enabled 1 + +GET 91 subscriber.by-id-3.info +GET_REPLY 91 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 92 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 92 subscriber.by-id-3.cs-enabled OK +GET 93 subscriber.by-id-3.cs-enabled +GET_REPLY 93 subscriber.by-id-3.cs-enabled 1 + +SET 94 subscriber.by-id-3.ps-enabled 0 +SET_REPLY 94 subscriber.by-id-3.ps-enabled OK +SET 95 subscriber.by-id-3.cs-enabled 0 +SET_REPLY 95 subscriber.by-id-3.cs-enabled OK +GET 96 subscriber.by-id-3.info +GET_REPLY 96 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 0 +nam_ps 0 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +SET 97 subscriber.by-id-3.ps-enabled 1 +SET_REPLY 97 subscriber.by-id-3.ps-enabled OK +SET 98 subscriber.by-id-3.cs-enabled 1 +SET_REPLY 98 subscriber.by-id-3.cs-enabled OK +GET 99 subscriber.by-id-3.info +GET_REPLY 99 subscriber.by-id-3.info +id 3 +imsi 901990000000003 +msisdn 103 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql index 0767d48..bce0af2 100644 --- a/tests/test_subscriber.sql +++ b/tests/test_subscriber.sql @@ -1,13 +1,13 @@ -- 2G only subscriber -INSERT INTO subscriber (id, imsi) VALUES (1, '901990000000001'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (1, '901990000000001', '1'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (1, 1, '000102030405060708090a0b0c0d0e0f'); -- 3G only subscriber INSERT INTO subscriber (id, imsi) VALUES (2, '901990000000002'); -INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 4223); -- 2G + 3G subscriber -INSERT INTO subscriber (id, imsi) VALUES (3, '901990000000003'); +INSERT INTO subscriber (id, imsi, msisdn) VALUES (3, '901990000000003', '103'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); -INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 2342); diff --git a/tests/test_subscriber.vty b/tests/test_subscriber.vty index 2e0bdce..2da455f 100644 --- a/tests/test_subscriber.vty +++ b/tests/test_subscriber.vty @@ -305,6 +305,7 @@ OPC=cededeffacedacefacedbadfadedbeef IND-bitlen=23 +OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op C01ffedC1cadaeAc1d1f1edAcac1aB0a OsmoHLR# subscriber imsi 123456789023000 update aud3g milenage k Deaf0ff1ceD0d0DabbedD1ced1ceF00d op CoiffedCicadaeAcidifiedAcaciaBoa % Invalid value for OP: 'CoiffedCicadaeAcidifiedAcaciaBoa' OsmoHLR# subscriber imsi 123456789023000 show @@ -313,8 +314,8 @@ MSISDN: 423 3G auth: MILENAGE K=deaf0ff1ced0d0dabbedd1ced1cef00d - OPC=cededeffacedacefacedbadfadedbeef - IND-bitlen=23 + OP=c01ffedc1cadaeac1d1f1edacac1ab0a + IND-bitlen=5 OsmoHLR# subscriber id 1 update aud2g comp128v2 ki CededEffacedAceFacedBadFadedBeef OsmoHLR# subscriber id 1 show @@ -325,8 +326,8 @@ KI=cededeffacedacefacedbadfadedbeef 3G auth: MILENAGE K=deaf0ff1ced0d0dabbedd1ced1cef00d - OPC=cededeffacedacefacedbadfadedbeef - IND-bitlen=23 + OP=c01ffedc1cadaeac1d1f1edacac1ab0a + IND-bitlen=5 OsmoHLR# subscriber imsi 123456789023000 delete % Deleted subscriber for IMSI '123456789023000' diff --git a/tests/test_subscriber_errors.ctrl b/tests/test_subscriber_errors.ctrl new file mode 100644 index 0000000..2f64fdb --- /dev/null +++ b/tests/test_subscriber_errors.ctrl @@ -0,0 +1,107 @@ +GET 1 invalid +ERROR 1 Command not found +SET 2 invalid nonsense +ERROR 2 Command not found + +GET 3 subscriber.by-imsi-nonsense.info +ERROR 3 Invalid value part of 'by-xxx-value' selector. +GET 4 subscriber.by-msisdn-nonsense.info +ERROR 4 Invalid value part of 'by-xxx-value' selector. +GET 5 subscriber.by-id-nonsense.info +ERROR 5 Invalid value part of 'by-xxx-value' selector. + +GET 6 subscriber +ERROR 6 Command not present. +GET 7 subscriber. +ERROR 7 Command not present. +GET 8 subscriber.by-nonsense +ERROR 8 Command not present. +GET 9 subscriber.by-nonsense- +ERROR 9 Command not present. +GET 10 subscriber.by-nonsense-123456 +ERROR 10 Command not present. +GET 11 subscriber.by-nonsense-123456. +ERROR 11 Command not present. +GET 12 subscriber.by-imsi- +ERROR 12 Command not present. +GET 13 subscriber.by-imsi-. +ERROR 13 Command not present. +GET 14 subscriber.by-imsi-901990000000003 +ERROR 14 Command not present. +GET 15 subscriber.by-imsi-901990000000003. +ERROR 15 Command not present. + +GET 16 subscriber.by-nonsense-123456.info +ERROR 16 Not a known subscriber 'by-xxx-' selector. +GET 17 subscriber.by-123456.info +ERROR 17 Not a known subscriber 'by-xxx-' selector. + +GET 18 subscriber.by-imsi-.info +ERROR 18 Invalid value part of 'by-xxx-value' selector. +GET 19 subscriber.by-imsi--.info +ERROR 19 Invalid value part of 'by-xxx-value' selector. + +GET 20 subscriber.by-imsi-12345678901234567.info +ERROR 20 Invalid value part of 'by-xxx-value' selector. +GET 21 subscriber.by-imsi-12345.info +ERROR 21 Invalid value part of 'by-xxx-value' selector. +GET 22 subscriber.by-imsi-1234567890123456.info +ERROR 22 Invalid value part of 'by-xxx-value' selector. + +GET 23 subscriber.by-id-99999999999999999999999999.info +ERROR 23 Invalid value part of 'by-xxx-value' selector. +GET 24 subscriber.by-id-9223372036854775807.info +ERROR 24 No such subscriber. +GET 25 subscriber.by-id-9223372036854775808.info +ERROR 25 Invalid value part of 'by-xxx-value' selector. +GET 26 subscriber.by-id--1.info +ERROR 26 No such subscriber. +GET 27 subscriber.by-id--9223372036854775808.info +ERROR 27 No such subscriber. +GET 28 subscriber.by-id--9223372036854775809.info +ERROR 28 Invalid value part of 'by-xxx-value' selector. + +GET 29 subscriber.by-id-1+1.info +ERROR 29 Invalid value part of 'by-xxx-value' selector. +GET 30 subscriber.by-id--.info +ERROR 30 Invalid value part of 'by-xxx-value' selector. +GET 31 subscriber.by-id-+1.info +ERROR 31 Invalid value part of 'by-xxx-value' selector. +GET 32 subscriber.by-id-+-1.info +ERROR 32 Invalid value part of 'by-xxx-value' selector. +GET 33 subscriber.by-id--+1.info +ERROR 33 Invalid value part of 'by-xxx-value' selector. +GET 34 subscriber.by-id-++1.info +ERROR 34 Invalid value part of 'by-xxx-value' selector. +GET 35 subscriber.by-id---1.info +ERROR 35 Invalid value part of 'by-xxx-value' selector. + +GET 36 subscriber.by-id- 1.info +ERROR 36 Command not present. +GET 37 subscriber.by-id-+ 1.info +ERROR 37 Command not present. +GET 38 subscriber.by-id-- 1.info +ERROR 38 Command not present. + + +SET 39 subscriber.by-imsi-901990000000001.info foo +ERROR 39 Read Only attribute +SET 40 subscriber.by-imsi-901990000000001.info-aud foo +ERROR 40 Read Only attribute +SET 41 subscriber.by-imsi-901990000000001.info-all foo +ERROR 41 Read Only attribute + +SET 42 subscriber.by-imsi-901990000000001.ps-enabled nonsense +ERROR 42 Value failed verification. +SET 43 subscriber.by-imsi-901990000000001.cs-enabled nonsense +ERROR 43 Value failed verification. + +SET 44 subscriber.by-imsi-901990000000001.ps-enabled +ERROR err Command parser error. +SET 45 subscriber.by-imsi-901990000000001.cs-enabled +ERROR err Command parser error. + +GET 46 subscriber.by-imsi-1234567890123456.ps-enabled +ERROR 46 Invalid value part of 'by-xxx-value' selector. +GET 47 subscriber.by-imsi-1234567890123456.cs-enabled +ERROR 47 Invalid value part of 'by-xxx-value' selector. -- To view, visit https://gerrit.osmocom.org/4311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 Gerrit-PatchSet: 8 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 28 02:36:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Oct 2017 02:36:57 +0000 Subject: [MERGED] osmo-hlr[master]: test_subscriber.ctrl: test against octal/hex interpretation ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: test_subscriber.ctrl: test against octal/hex interpretation of id ...................................................................... test_subscriber.ctrl: test against octal/hex interpretation of id Add a large enough subscriber id and add a test that ensures a leading zero is not interpreted as octal, and that a leading 0x is invalid and not interpreted as hexadecimal. Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173 --- M tests/test_subscriber.ctrl M tests/test_subscriber.sql 2 files changed, 20 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl index b9be5fe..4cefa4d 100644 --- a/tests/test_subscriber.ctrl +++ b/tests/test_subscriber.ctrl @@ -596,3 +596,19 @@ periodic_lu_timer 0 periodic_rau_tau_timer 0 lmsi 00000000 + +GET 100 subscriber.by-id-00123.info +GET_REPLY 100 subscriber.by-id-00123.info +id 123 +imsi 123123 +msisdn 123 +nam_cs 1 +nam_ps 1 +ms_purged_cs 0 +ms_purged_ps 0 +periodic_lu_timer 0 +periodic_rau_tau_timer 0 +lmsi 00000000 + +GET 101 subscriber.by-id-0x0123.info +ERROR 101 Invalid value part of 'by-xxx-value' selector. diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql index bce0af2..2b6afac 100644 --- a/tests/test_subscriber.sql +++ b/tests/test_subscriber.sql @@ -11,3 +11,7 @@ INSERT INTO subscriber (id, imsi, msisdn) VALUES (3, '901990000000003', '103'); INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 2342); + +-- A subscriber id > 7 and > 15 to check against octal and hex notations +INSERT INTO subscriber (id, imsi, msisdn) VALUES (123, '123123', '123'); +INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (123, 3, 'BeefedCafeFaceAcedAddedDecadeFee'); -- To view, visit https://gerrit.osmocom.org/4343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173 Gerrit-PatchSet: 5 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 28 02:54:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Oct 2017 02:54:59 +0000 Subject: osmo-hlr[master]: add osmo-hlr-db-tool, program to migrate from osmo-nitb db In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4441/1/src/hlr_db_tool.c File src/hlr_db_tool.c: PS1, Line 53: [--import-nitb-db ] > not sure what you had exactly in mind. To me, the generic name "osmo-hlr-d My first intention was to have a positional argument like in git commands and as you suggest here, but am not sure how to do this with the optarg API. As I was editing the optargs, I just wrote --import-nitb-db as a quick solution. The idea was to add --import-csv later and let the two conflict. Semantically, running the tool without arguments makes sure a hlr.db is created and populated with tables; on top, you can do --import-nitb-db; actually, one could also allow --import-csv in the same call, doing two imports in one call... I'm undecided, but with your comments I guess I'll explore the positional arguments way. Do you think it's worth it to do that? -- To view, visit https://gerrit.osmocom.org/4441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Oct 28 03:04:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Oct 2017 03:04:23 +0000 Subject: osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 9: > > why the extensive move / separate files are needed > > There's a ticket about getting rid of BTS singleton Getting rid of the singleton sounds good to me, but this patch doesn't seem to do that at all... I guess having one global counters pointer and not making it a BTS member makes most sense to me, and then the move to pcu_ctr.c also makes sense. -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 03:07:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Oct 2017 03:07:18 +0000 Subject: osmo-pcu[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: build fails due to current failure of master branch; the fix would be 4413, but is being discussed controversially. -- To view, visit https://gerrit.osmocom.org/4489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8aa657c4bf62ef62549fbe9dc15ce3fb018d8d9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 09:15:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 09:15:28 +0000 Subject: osmo-bts[master]: update dependencies to latest libosmo-* In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4476 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I08915540b92d5135b0c325e30b5b6e24f88e6282 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 09:15:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 09:15:34 +0000 Subject: [MERGED] osmo-bts[master]: update dependencies to latest libosmo-* In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: update dependencies to latest libosmo-* ...................................................................... update dependencies to latest libosmo-* We can either try to really build with those old versions or find the minimum version, or we can simply require latest version of all libosmo*, which is the safeest choice for now. Change-Id: I08915540b92d5135b0c325e30b5b6e24f88e6282 --- M configure.ac 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index bda30b5..80f1afd 100644 --- a/configure.ac +++ b/configure.ac @@ -35,14 +35,14 @@ dnl Checks for typedefs, structures and compiler characteristics dnl checks for libraries -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.9) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.3.2) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.3) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl) -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis) -PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec) -PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.3.2) +PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0) PKG_CHECK_MODULES(ORTP, ortp) AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support]) -- To view, visit https://gerrit.osmocom.org/4476 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I08915540b92d5135b0c325e30b5b6e24f88e6282 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Sat Oct 28 09:18:55 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 09:18:55 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f44b86d2e10_718e50ef741225987@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 151s] To: [ 151s] Subject: [osmo-pcu 0.3.0.20171027] testsuite: 2 3 5 6 7 8 11 failed [ 151s] [ 151s] You may investigate any problem if you feel able to do so, in which [ 151s] case the test suite provides a good starting point. Its output may [ 151s] be found below `tests/testsuite.dir'. [ 151s] [ 151s] Makefile:1221: recipe for target 'check-local' failed [ 151s] make[3]: *** [check-local] Error 1 [ 151s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 151s] Makefile:1055: recipe for target 'check-am' failed [ 151s] make[2]: *** [check-am] Error 2 [ 151s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 151s] Makefile:460: recipe for target 'check-recursive' failed [ 151s] make[1]: *** [check-recursive] Error 1 [ 151s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 151s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 151s] debian/rules:12: recipe for target 'build' failed [ 151s] make: *** [build] Error 2 [ 151s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 151s] [ 151s] lamb27 failed "build osmo-pcu_0.3.0.20171027.dsc" at Sat Oct 28 09:18:38 UTC 2017. [ 151s] [ 151s] ### VM INTERACTION START ### [ 154s] [ 146.110818] reboot: Power down [ 154s] ### VM INTERACTION END ### [ 154s] [ 154s] lamb27 failed "build osmo-pcu_0.3.0.20171027.dsc" at Sat Oct 28 09:18:41 UTC 2017. [ 154s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Oct 28 09:58:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 09:58:56 +0000 Subject: [PATCH] osmo-mgw[master]: configure.ac: Depend on latest tagged/released libosmo-* ver... Message-ID: Review at https://gerrit.osmocom.org/4493 configure.ac: Depend on latest tagged/released libosmo-* versions This is the safe choice, as in absence of automatic testing we don't know if we actually still build against the [sometimes] ancient dependencies. Change-Id: I8118defcd270bb487d9fd674fe30a74d379fda18 --- M configure.ac 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/93/4493/1 diff --git a/configure.ac b/configure.ac index e482cd0..dea41b1 100644 --- a/configure.ac +++ b/configure.ac @@ -39,9 +39,9 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) # Enable/disable transcoding within osmo-bsc_mgcp? AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])], -- To view, visit https://gerrit.osmocom.org/4493 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8118defcd270bb487d9fd674fe30a74d379fda18 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 09:58:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 09:58:56 +0000 Subject: [PATCH] osmo-mgw[master]: Debian: make sure osmo-bsc_mgcp ends up in its own package Message-ID: Review at https://gerrit.osmocom.org/4494 Debian: make sure osmo-bsc_mgcp ends up in its own package ... rather than being in the osmo-mgw package, which is clearly wrong. Change-Id: Ib5d19f56b611722101040639db615184fa223f82 --- A debian/osmo-bsc-mgcp.install M debian/osmo-mgw.install 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/94/4494/1 diff --git a/debian/osmo-bsc-mgcp.install b/debian/osmo-bsc-mgcp.install new file mode 100644 index 0000000..1550437 --- /dev/null +++ b/debian/osmo-bsc-mgcp.install @@ -0,0 +1 @@ +usr/bin/osmo-bsc_mgcp diff --git a/debian/osmo-mgw.install b/debian/osmo-mgw.install index e772481..5dac968 100644 --- a/debian/osmo-mgw.install +++ b/debian/osmo-mgw.install @@ -1 +1 @@ -usr/bin +usr/bin/osmo-mgw -- To view, visit https://gerrit.osmocom.org/4494 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5d19f56b611722101040639db615184fa223f82 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 09:58:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 09:58:57 +0000 Subject: [PATCH] osmo-mgw[master]: Debian: Include the osmo-bsc-mgcp systemd service in Debian ... Message-ID: Review at https://gerrit.osmocom.org/4495 Debian: Include the osmo-bsc-mgcp systemd service in Debian package Change-Id: Ife3f034ddaaba993bf27c1f9a34a1d57d1bf3e05 --- A debian/osmo-bsc-mgcp.service 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/95/4495/1 diff --git a/debian/osmo-bsc-mgcp.service b/debian/osmo-bsc-mgcp.service new file mode 120000 index 0000000..eb73b7b --- /dev/null +++ b/debian/osmo-bsc-mgcp.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-bsc-mgcp.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4495 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ife3f034ddaaba993bf27c1f9a34a1d57d1bf3e05 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:23:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:23:55 +0000 Subject: [PATCH] libosmo-netif[master]: Don't link library against libosmogsm, we don't use any symb... Message-ID: Review at https://gerrit.osmocom.org/4496 Don't link library against libosmogsm, we don't use any symbols of it This fixes a related dpkg-shlibdeps warning Change-Id: I0325e7a6dea5195f1634230930570bf4dfe3810c --- M src/Makefile.am M src/channel/abis/Makefile.am 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/96/4496/1 diff --git a/src/Makefile.am b/src/Makefile.am index e647090..81a55b4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,14 +3,14 @@ LIBVERSION=4:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS) +AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS) AM_LDFLAGS = $(COVERAGE_LDFLAGS) SUBDIRS = channel lib_LTLIBRARIES = libosmonetif.la -libosmonetif_la_LIBADD = channel/abis/libosmonetif-abis.la $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBSCTP_LIBS) +libosmonetif_la_LIBADD = channel/abis/libosmonetif-abis.la $(LIBOSMOCORE_LIBS) $(LIBSCTP_LIBS) libosmonetif_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined libosmonetif_la_SOURCES = amr.c \ diff --git a/src/channel/abis/Makefile.am b/src/channel/abis/Makefile.am index 9ccce1d..615abff 100644 --- a/src/channel/abis/Makefile.am +++ b/src/channel/abis/Makefile.am @@ -1,9 +1,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) +AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) AM_LDFLAGS = $(COVERAGE_LDFLAGS) noinst_LTLIBRARIES = libosmonetif-abis.la libosmonetif_abis_la_SOURCES = ipa_stream_server.c \ ipa_stream_client.c -libosmonetif_abis_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) +libosmonetif_abis_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) -- To view, visit https://gerrit.osmocom.org/4496 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0325e7a6dea5195f1634230930570bf4dfe3810c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:23:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:23:56 +0000 Subject: [PATCH] libosmo-netif[master]: Debian: The -dev package doesn't depend on any shared libraries Message-ID: Review at https://gerrit.osmocom.org/4497 Debian: The -dev package doesn't depend on any shared libraries This fixes: dpkg-gencontrol: warning: Depends field of package libosmo-netif-dev: unknown substitution variable ${shlibs:Depends} Change-Id: Ic57cbc8a1876e6e5449e7dd4a73f269444dd67da --- M debian/control 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/97/4497/1 diff --git a/debian/control b/debian/control index 9e0f26f..cabef7b 100644 --- a/debian/control +++ b/debian/control @@ -35,8 +35,7 @@ Package: libosmo-netif-dev Section: libdevel Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, +Depends: ${misc:Depends}, libosmocore-dev, libosmocore, libosmonetif4 (= ${binary:Version}) -- To view, visit https://gerrit.osmocom.org/4497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic57cbc8a1876e6e5449e7dd4a73f269444dd67da Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:23 +0000 Subject: [PATCH] osmo-mgw[master]: osmo-mgw: Don't link against libosmo-netif Message-ID: Review at https://gerrit.osmocom.org/4498 osmo-mgw: Don't link against libosmo-netif Change-Id: Ic62efeb3c139016aa8a1e68651442edf2044eeef dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-mgw/usr/bin/osmo-mgw was not linked against libosmonetif.so.4 (it uses none of the library's symbols) --- M src/osmo-mgw/Makefile.am 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/98/4498/1 diff --git a/src/osmo-mgw/Makefile.am b/src/osmo-mgw/Makefile.am index b6099fc..0e12beb 100644 --- a/src/osmo-mgw/Makefile.am +++ b/src/osmo-mgw/Makefile.am @@ -8,7 +8,6 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMONETIF_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -23,6 +22,5 @@ osmo_mgw_LDADD = \ $(top_builddir)/src/libosmo-mgcp/libosmo-mgcp.la \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMONETIF_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/4498 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic62efeb3c139016aa8a1e68651442edf2044eeef Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:23 +0000 Subject: [PATCH] osmo-mgw[master]: libosmo-mgcp: Don't link against libosmogsm; link against li... Message-ID: Review at https://gerrit.osmocom.org/4499 libosmo-mgcp: Don't link against libosmogsm; link against libosmovty This addresses the following dpkg-shlibdeps warnings: Change-Id: I518eb5e19cef5f261711b034d28337265c69f443 dpkg-shlibdeps: warning: symbol install_element_ve used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_read_config_file used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_install_default used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol install_element used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol install_node used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_out used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol argv_concat used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries --- M src/libosmo-mgcp/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/99/4499/1 diff --git a/src/libosmo-mgcp/Makefile.am b/src/libosmo-mgcp/Makefile.am index e121fea..a9e1b6c 100644 --- a/src/libosmo-mgcp/Makefile.am +++ b/src/libosmo-mgcp/Makefile.am @@ -14,7 +14,7 @@ AM_LDFLAGS = \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOVTY_LIBS) \ $(LIBOSMONETIF_LIBS) \ $(COVERAGE_LDFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/4499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I518eb5e19cef5f261711b034d28337265c69f443 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:24 +0000 Subject: [PATCH] osmo-mgw[master]: libosmo-mgcp-client: Don't link libosmogsm, but link libosmovty Message-ID: Review at https://gerrit.osmocom.org/4500 libosmo-mgcp-client: Don't link libosmogsm, but link libosmovty This addresses the following dpkg-shlibdeps warnings: Change-Id: I737c36402b7b88634b56725f2caab4f5f971ac51 dpkg-shlibdeps: warning: symbol install_element used by debian/libosmo-mgcp-client0/usr/lib/x86_64-linux-gnu/libosmo-mgcp-client.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_out used by debian/libosmo-mgcp-client0/usr/lib/x86_64-linux-gnu/libosmo-mgcp-client.so.0.0.0 found in none of the libraries --- M src/libosmo-mgcp-client/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/00/4500/1 diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index 3dd21db..b376cd9 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -15,7 +15,7 @@ AM_LDFLAGS = \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOVTY_LIBS) \ $(LIBOSMONETIF_LIBS) \ $(COVERAGE_LDFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/4500 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I737c36402b7b88634b56725f2caab4f5f971ac51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:24 +0000 Subject: [PATCH] osmo-mgw[master]: libosmo-mgcp-client: don't link against libosmonetif Message-ID: Review at https://gerrit.osmocom.org/4501 libosmo-mgcp-client: don't link against libosmonetif This fixes the following dpkg-shlibdeps warning: Change-Id: If60583b2bec344fc674af6f129787206540bc9fc dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/libosmo-mgcp-client0/usr/lib/x86_64-linux-gnu/libosmo-mgcp-client.so.0.0.0 was not linked against libosmonetif.so.4 (it uses none of the library's symbols) --- M src/libosmo-mgcp-client/Makefile.am 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/01/4501/1 diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index b376cd9..de35f87 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -9,14 +9,12 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMONETIF_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) AM_LDFLAGS = \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOVTY_LIBS) \ - $(LIBOSMONETIF_LIBS) \ $(COVERAGE_LDFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/4501 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If60583b2bec344fc674af6f129787206540bc9fc Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:25 +0000 Subject: [PATCH] osmo-mgw[master]: osmo-bsc_mgcp: Don't link against libosmo-netif Message-ID: Review at https://gerrit.osmocom.org/4502 osmo-bsc_mgcp: Don't link against libosmo-netif This fixes the following dpkg-shlibdeps warning: Change-Id: I1eb079aa74a56b75e881b7abae0e5d9b4d7ae9c4 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bsc-mgcp/usr/bin/osmo-bsc_mgcp was not linked against libosmonetif.so.4 (it uses none of the library's symbols) --- M src/osmo-bsc_mgcp/Makefile.am 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/02/4502/1 diff --git a/src/osmo-bsc_mgcp/Makefile.am b/src/osmo-bsc_mgcp/Makefile.am index 3e3511d..4529a33 100644 --- a/src/osmo-bsc_mgcp/Makefile.am +++ b/src/osmo-bsc_mgcp/Makefile.am @@ -8,7 +8,6 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMONETIF_CFLAGS) \ $(LIBBCG729_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -24,7 +23,6 @@ osmo_bsc_mgcp_LDADD = \ $(top_builddir)/src/libosmo-legacy-mgcp/libosmo-legacy-mgcp.la \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMONETIF_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBBCG729_LIBS) \ $(LIBRARY_GSM) \ -- To view, visit https://gerrit.osmocom.org/4502 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1eb079aa74a56b75e881b7abae0e5d9b4d7ae9c4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:25 +0000 Subject: [PATCH] osmo-mgw[master]: libosmo-legacy-mgcp: Link against libosmovty, don't link lib... Message-ID: Review at https://gerrit.osmocom.org/4503 libosmo-legacy-mgcp: Link against libosmovty, don't link libosmogsm This fixes the following dpkg-shlibdeps warnings: Change-Id: I648bbda50520808afcf2a6ce64fe710df918936c dpkg-shlibdeps: warning: symbol install_element_ve used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol argv_concat used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_out used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_install_default used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_read_config_file used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol install_element used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol install_node used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries --- M src/libosmo-legacy-mgcp/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/03/4503/1 diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index ede1da4..9160586 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -15,7 +15,7 @@ AM_LDFLAGS = \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOVTY_LIBS) \ $(LIBOSMONETIF_LIBS) \ $(COVERAGE_LDFLAGS) \ $(LIBBCG729_LIBS) \ -- To view, visit https://gerrit.osmocom.org/4503 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I648bbda50520808afcf2a6ce64fe710df918936c Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:38 +0000 Subject: osmo-mgw[master]: configure.ac: Depend on latest tagged/released libosmo-* ver... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4493 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8118defcd270bb487d9fd674fe30a74d379fda18 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:41 +0000 Subject: osmo-mgw[master]: Debian: make sure osmo-bsc_mgcp ends up in its own package In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4494 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5d19f56b611722101040639db615184fa223f82 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:45 +0000 Subject: osmo-mgw[master]: Debian: Include the osmo-bsc-mgcp systemd service in Debian ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4495 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ife3f034ddaaba993bf27c1f9a34a1d57d1bf3e05 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:56 +0000 Subject: [MERGED] osmo-mgw[master]: Debian: Include the osmo-bsc-mgcp systemd service in Debian ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Include the osmo-bsc-mgcp systemd service in Debian package ...................................................................... Debian: Include the osmo-bsc-mgcp systemd service in Debian package Change-Id: Ife3f034ddaaba993bf27c1f9a34a1d57d1bf3e05 --- A debian/osmo-bsc-mgcp.service 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-bsc-mgcp.service b/debian/osmo-bsc-mgcp.service new file mode 120000 index 0000000..eb73b7b --- /dev/null +++ b/debian/osmo-bsc-mgcp.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-bsc-mgcp.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4495 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ife3f034ddaaba993bf27c1f9a34a1d57d1bf3e05 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:56 +0000 Subject: [MERGED] osmo-mgw[master]: Debian: make sure osmo-bsc_mgcp ends up in its own package In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: make sure osmo-bsc_mgcp ends up in its own package ...................................................................... Debian: make sure osmo-bsc_mgcp ends up in its own package ... rather than being in the osmo-mgw package, which is clearly wrong. Change-Id: Ib5d19f56b611722101040639db615184fa223f82 --- A debian/osmo-bsc-mgcp.install M debian/osmo-mgw.install 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-bsc-mgcp.install b/debian/osmo-bsc-mgcp.install new file mode 100644 index 0000000..1550437 --- /dev/null +++ b/debian/osmo-bsc-mgcp.install @@ -0,0 +1 @@ +usr/bin/osmo-bsc_mgcp diff --git a/debian/osmo-mgw.install b/debian/osmo-mgw.install index e772481..5dac968 100644 --- a/debian/osmo-mgw.install +++ b/debian/osmo-mgw.install @@ -1 +1 @@ -usr/bin +usr/bin/osmo-mgw -- To view, visit https://gerrit.osmocom.org/4494 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib5d19f56b611722101040639db615184fa223f82 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:24:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:24:56 +0000 Subject: [MERGED] osmo-mgw[master]: configure.ac: Depend on latest tagged/released libosmo-* ver... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Depend on latest tagged/released libosmo-* versions ...................................................................... configure.ac: Depend on latest tagged/released libosmo-* versions This is the safe choice, as in absence of automatic testing we don't know if we actually still build against the [sometimes] ancient dependencies. Change-Id: I8118defcd270bb487d9fd674fe30a74d379fda18 --- M configure.ac 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index e482cd0..dea41b1 100644 --- a/configure.ac +++ b/configure.ac @@ -39,9 +39,9 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) # Enable/disable transcoding within osmo-bsc_mgcp? AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])], -- To view, visit https://gerrit.osmocom.org/4493 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8118defcd270bb487d9fd674fe30a74d379fda18 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:27:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:27:12 +0000 Subject: [PATCH] libosmo-sccp[master]: Debian: fix typo resulting in osmo-stp missing automatic shl... Message-ID: Review at https://gerrit.osmocom.org/4504 Debian: fix typo resulting in osmo-stp missing automatic shlib dependencies Change-Id: I0dbb57e1cc9f2b661428d0ba71ef6afc19058669 dpkg-gencontrol: warning: Depends field of package osmo-stp: unknown substitution variable ${shlib:Depends} dpkg-gencontrol: warning: package osmo-stp: unused substitution variable ${shlibs:Depends} --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/04/4504/1 diff --git a/debian/control b/debian/control index 8b8f66b..1184664 100644 --- a/debian/control +++ b/debian/control @@ -98,7 +98,7 @@ Multi-Arch: same Section: net Depends: libosmo-sigtran0, - ${shlib:Depends}, + ${shlibs:Depends}, ${misc:Depends} Description: Osmocom SIGTRAN STP (Signaling Transfer Point) This is the Osmocom (Open Source Mobile Communications) implementation -- To view, visit https://gerrit.osmocom.org/4504 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0dbb57e1cc9f2b661428d0ba71ef6afc19058669 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:12 +0000 Subject: libosmo-netif[master]: Don't link library against libosmogsm, we don't use any symb... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4496 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0325e7a6dea5195f1634230930570bf4dfe3810c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:14 +0000 Subject: libosmo-netif[master]: Debian: The -dev package doesn't depend on any shared libraries In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic57cbc8a1876e6e5449e7dd4a73f269444dd67da Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:16 +0000 Subject: [MERGED] libosmo-netif[master]: Debian: The -dev package doesn't depend on any shared libraries In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: The -dev package doesn't depend on any shared libraries ...................................................................... Debian: The -dev package doesn't depend on any shared libraries This fixes: dpkg-gencontrol: warning: Depends field of package libosmo-netif-dev: unknown substitution variable ${shlibs:Depends} Change-Id: Ic57cbc8a1876e6e5449e7dd4a73f269444dd67da --- M debian/control 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 9e0f26f..cabef7b 100644 --- a/debian/control +++ b/debian/control @@ -35,8 +35,7 @@ Package: libosmo-netif-dev Section: libdevel Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, +Depends: ${misc:Depends}, libosmocore-dev, libosmocore, libosmonetif4 (= ${binary:Version}) -- To view, visit https://gerrit.osmocom.org/4497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic57cbc8a1876e6e5449e7dd4a73f269444dd67da Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:16 +0000 Subject: [MERGED] libosmo-netif[master]: Don't link library against libosmogsm, we don't use any symb... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Don't link library against libosmogsm, we don't use any symbols of it ...................................................................... Don't link library against libosmogsm, we don't use any symbols of it This fixes a related dpkg-shlibdeps warning Change-Id: I0325e7a6dea5195f1634230930570bf4dfe3810c --- M src/Makefile.am M src/channel/abis/Makefile.am 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/Makefile.am b/src/Makefile.am index e647090..81a55b4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,14 +3,14 @@ LIBVERSION=4:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS) +AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS) AM_LDFLAGS = $(COVERAGE_LDFLAGS) SUBDIRS = channel lib_LTLIBRARIES = libosmonetif.la -libosmonetif_la_LIBADD = channel/abis/libosmonetif-abis.la $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBSCTP_LIBS) +libosmonetif_la_LIBADD = channel/abis/libosmonetif-abis.la $(LIBOSMOCORE_LIBS) $(LIBSCTP_LIBS) libosmonetif_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined libosmonetif_la_SOURCES = amr.c \ diff --git a/src/channel/abis/Makefile.am b/src/channel/abis/Makefile.am index 9ccce1d..615abff 100644 --- a/src/channel/abis/Makefile.am +++ b/src/channel/abis/Makefile.am @@ -1,9 +1,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) +AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) AM_LDFLAGS = $(COVERAGE_LDFLAGS) noinst_LTLIBRARIES = libosmonetif-abis.la libosmonetif_abis_la_SOURCES = ipa_stream_server.c \ ipa_stream_client.c -libosmonetif_abis_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) +libosmonetif_abis_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) -- To view, visit https://gerrit.osmocom.org/4496 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0325e7a6dea5195f1634230930570bf4dfe3810c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:27 +0000 Subject: osmo-mgw[master]: osmo-mgw: Don't link against libosmo-netif In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4498 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic62efeb3c139016aa8a1e68651442edf2044eeef Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:30 +0000 Subject: osmo-mgw[master]: libosmo-mgcp: Don't link against libosmogsm; link against li... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I518eb5e19cef5f261711b034d28337265c69f443 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:32 +0000 Subject: osmo-mgw[master]: libosmo-mgcp-client: Don't link libosmogsm, but link libosmovty In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4500 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I737c36402b7b88634b56725f2caab4f5f971ac51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:34 +0000 Subject: osmo-mgw[master]: libosmo-mgcp-client: don't link against libosmonetif In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4501 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If60583b2bec344fc674af6f129787206540bc9fc Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:35 +0000 Subject: osmo-mgw[master]: osmo-bsc_mgcp: Don't link against libosmo-netif In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4502 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1eb079aa74a56b75e881b7abae0e5d9b4d7ae9c4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:37 +0000 Subject: osmo-mgw[master]: libosmo-legacy-mgcp: Link against libosmovty, don't link lib... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4503 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I648bbda50520808afcf2a6ce64fe710df918936c Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:38 +0000 Subject: [MERGED] osmo-mgw[master]: libosmo-legacy-mgcp: Link against libosmovty, don't link lib... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libosmo-legacy-mgcp: Link against libosmovty, don't link libosmogsm ...................................................................... libosmo-legacy-mgcp: Link against libosmovty, don't link libosmogsm This fixes the following dpkg-shlibdeps warnings: Change-Id: I648bbda50520808afcf2a6ce64fe710df918936c dpkg-shlibdeps: warning: symbol install_element_ve used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol argv_concat used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_out used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_install_default used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_read_config_file used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol install_element used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol install_node used by debian/libosmo-legacy-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-legacy-mgcp.so.0.0.0 found in none of the libraries --- M src/libosmo-legacy-mgcp/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index ede1da4..9160586 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -15,7 +15,7 @@ AM_LDFLAGS = \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOVTY_LIBS) \ $(LIBOSMONETIF_LIBS) \ $(COVERAGE_LDFLAGS) \ $(LIBBCG729_LIBS) \ -- To view, visit https://gerrit.osmocom.org/4503 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I648bbda50520808afcf2a6ce64fe710df918936c Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:39 +0000 Subject: [MERGED] osmo-mgw[master]: osmo-bsc_mgcp: Don't link against libosmo-netif In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bsc_mgcp: Don't link against libosmo-netif ...................................................................... osmo-bsc_mgcp: Don't link against libosmo-netif This fixes the following dpkg-shlibdeps warning: Change-Id: I1eb079aa74a56b75e881b7abae0e5d9b4d7ae9c4 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bsc-mgcp/usr/bin/osmo-bsc_mgcp was not linked against libosmonetif.so.4 (it uses none of the library's symbols) --- M src/osmo-bsc_mgcp/Makefile.am 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc_mgcp/Makefile.am b/src/osmo-bsc_mgcp/Makefile.am index 3e3511d..4529a33 100644 --- a/src/osmo-bsc_mgcp/Makefile.am +++ b/src/osmo-bsc_mgcp/Makefile.am @@ -8,7 +8,6 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMONETIF_CFLAGS) \ $(LIBBCG729_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -24,7 +23,6 @@ osmo_bsc_mgcp_LDADD = \ $(top_builddir)/src/libosmo-legacy-mgcp/libosmo-legacy-mgcp.la \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMONETIF_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBBCG729_LIBS) \ $(LIBRARY_GSM) \ -- To view, visit https://gerrit.osmocom.org/4502 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1eb079aa74a56b75e881b7abae0e5d9b4d7ae9c4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:39 +0000 Subject: [MERGED] osmo-mgw[master]: libosmo-mgcp-client: don't link against libosmonetif In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libosmo-mgcp-client: don't link against libosmonetif ...................................................................... libosmo-mgcp-client: don't link against libosmonetif This fixes the following dpkg-shlibdeps warning: Change-Id: If60583b2bec344fc674af6f129787206540bc9fc dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/libosmo-mgcp-client0/usr/lib/x86_64-linux-gnu/libosmo-mgcp-client.so.0.0.0 was not linked against libosmonetif.so.4 (it uses none of the library's symbols) --- M src/libosmo-mgcp-client/Makefile.am 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index b376cd9..de35f87 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -9,14 +9,12 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMONETIF_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) AM_LDFLAGS = \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOVTY_LIBS) \ - $(LIBOSMONETIF_LIBS) \ $(COVERAGE_LDFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/4501 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If60583b2bec344fc674af6f129787206540bc9fc Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:39 +0000 Subject: [MERGED] osmo-mgw[master]: libosmo-mgcp-client: Don't link libosmogsm, but link libosmovty In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libosmo-mgcp-client: Don't link libosmogsm, but link libosmovty ...................................................................... libosmo-mgcp-client: Don't link libosmogsm, but link libosmovty This addresses the following dpkg-shlibdeps warnings: Change-Id: I737c36402b7b88634b56725f2caab4f5f971ac51 dpkg-shlibdeps: warning: symbol install_element used by debian/libosmo-mgcp-client0/usr/lib/x86_64-linux-gnu/libosmo-mgcp-client.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_out used by debian/libosmo-mgcp-client0/usr/lib/x86_64-linux-gnu/libosmo-mgcp-client.so.0.0.0 found in none of the libraries --- M src/libosmo-mgcp-client/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index 3dd21db..b376cd9 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -15,7 +15,7 @@ AM_LDFLAGS = \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOVTY_LIBS) \ $(LIBOSMONETIF_LIBS) \ $(COVERAGE_LDFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/4500 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I737c36402b7b88634b56725f2caab4f5f971ac51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:39 +0000 Subject: [MERGED] osmo-mgw[master]: libosmo-mgcp: Don't link against libosmogsm; link against li... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libosmo-mgcp: Don't link against libosmogsm; link against libosmovty ...................................................................... libosmo-mgcp: Don't link against libosmogsm; link against libosmovty This addresses the following dpkg-shlibdeps warnings: Change-Id: I518eb5e19cef5f261711b034d28337265c69f443 dpkg-shlibdeps: warning: symbol install_element_ve used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_read_config_file used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_install_default used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol install_element used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol install_node used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vty_out used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol argv_concat used by debian/libosmo-mgcp0/usr/lib/x86_64-linux-gnu/libosmo-mgcp.so.0.0.0 found in none of the libraries --- M src/libosmo-mgcp/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp/Makefile.am b/src/libosmo-mgcp/Makefile.am index e121fea..a9e1b6c 100644 --- a/src/libosmo-mgcp/Makefile.am +++ b/src/libosmo-mgcp/Makefile.am @@ -14,7 +14,7 @@ AM_LDFLAGS = \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOVTY_LIBS) \ $(LIBOSMONETIF_LIBS) \ $(COVERAGE_LDFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/4499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I518eb5e19cef5f261711b034d28337265c69f443 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:37:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:37:40 +0000 Subject: [MERGED] osmo-mgw[master]: osmo-mgw: Don't link against libosmo-netif In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-mgw: Don't link against libosmo-netif ...................................................................... osmo-mgw: Don't link against libosmo-netif Change-Id: Ic62efeb3c139016aa8a1e68651442edf2044eeef dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-mgw/usr/bin/osmo-mgw was not linked against libosmonetif.so.4 (it uses none of the library's symbols) --- M src/osmo-mgw/Makefile.am 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-mgw/Makefile.am b/src/osmo-mgw/Makefile.am index b6099fc..0e12beb 100644 --- a/src/osmo-mgw/Makefile.am +++ b/src/osmo-mgw/Makefile.am @@ -8,7 +8,6 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMONETIF_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -23,6 +22,5 @@ osmo_mgw_LDADD = \ $(top_builddir)/src/libosmo-mgcp/libosmo-mgcp.la \ $(LIBOSMOCORE_LIBS) \ - $(LIBOSMONETIF_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/4498 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic62efeb3c139016aa8a1e68651442edf2044eeef Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:40:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:40:26 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_libosmo-sccp=5Bmaster=5D=3A_Bump_version=3A_0=2E8=2E0_=E2=86=92_0=2E8=2E1?= Message-ID: Review at https://gerrit.osmocom.org/4505 Bump version: 0.8.0 ? 0.8.1 Change-Id: I5c9068859c340ac21a5c6975afb3e9bd361ecdb5 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/05/4505/1 diff --git a/debian/changelog b/debian/changelog index b25e270..64e18fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libosmo-sccp (0.8.1) unstable; urgency=medium + + * New upstream 0.8.1 release. + + -- Harald Welte Sat, 28 Oct 2017 12:40:00 +0200 + libosmo-sccp (0.8.0) unstable; urgency=medium * New upstream 0.8.0 release. -- To view, visit https://gerrit.osmocom.org/4505 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c9068859c340ac21a5c6975afb3e9bd361ecdb5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:42:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:42:03 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E1=2E0_=E2=86=92_0=2E1=2E1?= Message-ID: Review at https://gerrit.osmocom.org/4506 Bump version: 0.1.0 ? 0.1.1 Change-Id: I731fce9fd10a586c10261b23ed0f0bbcb6f3eada --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/06/4506/1 diff --git a/debian/changelog b/debian/changelog index 003b027..8958b90 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libosmo-netif (0.1.1) unstable; urgency=medium + + * New upstream release. + + -- Harald Welte Sat, 28 Oct 2017 12:41:34 +0200 + libosmo-netif (0.1.0) unstable; urgency=medium [ Holger Hans Peter Freyther ] -- To view, visit https://gerrit.osmocom.org/4506 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I731fce9fd10a586c10261b23ed0f0bbcb6f3eada Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:43:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:43:03 +0000 Subject: libosmo-sccp[master]: Debian: fix typo resulting in osmo-stp missing automatic shl... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4504 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0dbb57e1cc9f2b661428d0ba71ef6afc19058669 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:43:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:43:40 +0000 Subject: libosmo-netif[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4474 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6bdbd22b5f05ab75de2c6c777667bf1a63eb0b86 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:43:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:43:46 +0000 Subject: osmo-hlr[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4483 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9d35913f9cd60ff121d29f357919a0b0d62d6835 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:43:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:43:49 +0000 Subject: osmo-iuh[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4484 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7261e006163eda4bee8a4695fbd5bd29307babe6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:43:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:43:51 +0000 Subject: osmo-bts[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4481 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I830b17462b636e0bf03f4d88000660409503c3e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:43:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:43:53 +0000 Subject: openbsc[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4479 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibafac7c8a48f46237835e91c80e72543c6841d08 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:43:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:43:57 +0000 Subject: osmo-bsc[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4480 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b6afb59f0a8037d1510a7fddb63927f10d653e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:43:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:43:59 +0000 Subject: osmo-msc[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6ae80147b2624079b5c364dbce08194215cc4e95 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:03 +0000 Subject: libosmo-sccp[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4475 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e3a24a32b8e06d89ac11b59bca052d56f00c78c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:05 +0000 Subject: osmo-ggsn[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4482 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1424dff06c7d4f695af0936671ad6faa504aaf16 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:07 +0000 Subject: libosmocore[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99fdd20e7b18c2f4a59a9db35e5efccca6546b77 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:10 +0000 Subject: libosmo-abis[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4473 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2f4c0a6b9a066160707eb7768ea9cc8b77806b9b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:16 +0000 Subject: osmo-mgw[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4485 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5a64b305dff5387cbe2462b564051f807061086d Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:19 +0000 Subject: osmo-sgsn[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4487 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7c3ecd83899f873bdc771ff7445740fea15900ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:21 +0000 Subject: osmo-gsm-manuals[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4478 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaf8338d0d061c70f7ab3737dc425784dc7c170a4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:25 +0000 Subject: osmo-sip-connector[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4488 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e9f19755f55b274def9d757f72f2a08a01a4cce Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:29 +0000 Subject: libsmpp34[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4477 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0030c8662fa87fb589582a3f6bde6ed53e8e3ef9 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:40 +0000 Subject: =?UTF-8?Q?libosmo-sccp=5Bmaster=5D=3A_Bump_version=3A_0=2E8=2E0_=E2=86=92_0=2E8=2E1?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4505 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c9068859c340ac21a5c6975afb3e9bd361ecdb5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:42 +0000 Subject: =?UTF-8?Q?=5BMERGED=5D_libosmo-sccp=5Bmaster=5D=3A_Bump_version=3A_0=2E8=2E0_=E2=86=92_0=2E8=2E1?= In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Bump version: 0.8.0 ? 0.8.1 ...................................................................... Bump version: 0.8.0 ? 0.8.1 Change-Id: I5c9068859c340ac21a5c6975afb3e9bd361ecdb5 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index b25e270..64e18fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libosmo-sccp (0.8.1) unstable; urgency=medium + + * New upstream 0.8.1 release. + + -- Harald Welte Sat, 28 Oct 2017 12:40:00 +0200 + libosmo-sccp (0.8.0) unstable; urgency=medium * New upstream 0.8.0 release. -- To view, visit https://gerrit.osmocom.org/4505 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c9068859c340ac21a5c6975afb3e9bd361ecdb5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:44:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:44:42 +0000 Subject: [MERGED] libosmo-sccp[master]: Debian: fix typo resulting in osmo-stp missing automatic shl... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: fix typo resulting in osmo-stp missing automatic shlib dependencies ...................................................................... Debian: fix typo resulting in osmo-stp missing automatic shlib dependencies Change-Id: I0dbb57e1cc9f2b661428d0ba71ef6afc19058669 dpkg-gencontrol: warning: Depends field of package osmo-stp: unknown substitution variable ${shlib:Depends} dpkg-gencontrol: warning: package osmo-stp: unused substitution variable ${shlibs:Depends} --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 8b8f66b..1184664 100644 --- a/debian/control +++ b/debian/control @@ -98,7 +98,7 @@ Multi-Arch: same Section: net Depends: libosmo-sigtran0, - ${shlib:Depends}, + ${shlibs:Depends}, ${misc:Depends} Description: Osmocom SIGTRAN STP (Signaling Transfer Point) This is the Osmocom (Open Source Mobile Communications) implementation -- To view, visit https://gerrit.osmocom.org/4504 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0dbb57e1cc9f2b661428d0ba71ef6afc19058669 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:47:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:47:14 +0000 Subject: =?UTF-8?Q?libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E1=2E0_=E2=86=92_0=2E1=2E1?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4506 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I731fce9fd10a586c10261b23ed0f0bbcb6f3eada Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:47:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:47:17 +0000 Subject: =?UTF-8?Q?=5BMERGED=5D_libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E1=2E0_=E2=86=92_0=2E1=2E1?= In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Bump version: 0.1.0 ? 0.1.1 ...................................................................... Bump version: 0.1.0 ? 0.1.1 Change-Id: I731fce9fd10a586c10261b23ed0f0bbcb6f3eada --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 003b027..8958b90 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libosmo-netif (0.1.1) unstable; urgency=medium + + * New upstream release. + + -- Harald Welte Sat, 28 Oct 2017 12:41:34 +0200 + libosmo-netif (0.1.0) unstable; urgency=medium [ Holger Hans Peter Freyther ] -- To view, visit https://gerrit.osmocom.org/4506 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I731fce9fd10a586c10261b23ed0f0bbcb6f3eada Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:47:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:47:34 +0000 Subject: libasn1c[master]: fix compiler warning: drop dead code from BIT_STRING_fromBuf() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4492 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I80867da697d744d7ef4d70c8f24031f5781fb11a Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:47:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:47:41 +0000 Subject: libasn1c[master]: jenkins: add missing set -e to catch build errors In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4471 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f6b015b09c60c18d213dde5bbdcfc527096a10f Gerrit-PatchSet: 3 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:47:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:47:44 +0000 Subject: libasn1c[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4472 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5d252dc679e47a8375361d0ff278b7b98768f26 Gerrit-PatchSet: 3 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:57:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:57:04 +0000 Subject: [PATCH] osmo-mgw[master]: libosmo-mgcp-client: Bump LIBVERSION as interfaces have been... Message-ID: Review at https://gerrit.osmocom.org/4507 libosmo-mgcp-client: Bump LIBVERSION as interfaces have been added Change-Id: I3e00af70267563a5fbf7e2a3c1326c22481d2666 --- M debian/control R debian/libosmo-mgcp-client1.install M src/libosmo-mgcp-client/Makefile.am 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/07/4507/1 diff --git a/debian/control b/debian/control index bba88af..ef96796 100644 --- a/debian/control +++ b/debian/control @@ -34,7 +34,7 @@ Depends: libosmo-mgcp0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp: Osmocom's Media Gateway server library -Package: libosmo-mgcp-client0 +Package: libosmo-mgcp-client1 Section: libs Architecture: any Multi-Arch: same @@ -46,7 +46,7 @@ Section: libdevel Architecture: any Multi-Arch: same -Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-mgcp-client1 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities Package: osmo-bsc-mgcp diff --git a/debian/libosmo-mgcp-client0.install b/debian/libosmo-mgcp-client1.install similarity index 100% rename from debian/libosmo-mgcp-client0.install rename to debian/libosmo-mgcp-client1.install diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index de35f87..1eaa370 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -20,7 +20,7 @@ # This is not at all related to the release version, but a range of supported # API versions. Read TODO_RELEASE in the source tree's root! -MGCP_CLIENT_LIBVERSION=0:0:0 +MGCP_CLIENT_LIBVERSION=1:0:1 lib_LTLIBRARIES = \ libosmo-mgcp-client.la \ -- To view, visit https://gerrit.osmocom.org/4507 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e00af70267563a5fbf7e2a3c1326c22481d2666 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 10:57:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 10:57:05 +0000 Subject: [PATCH] osmo-mgw[master]: Tag/Release 1.1.0 Message-ID: Review at https://gerrit.osmocom.org/4508 Tag/Release 1.1.0 This marks the first release that includes the new libosmo-mgcp as well as some updates to libosmo-mgcp-client. Hence, all programs using those libraries can now depend on a proper minimum version Change-Id: I1748ed230041930b4e9f49deb03341772ab02144 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/08/4508/1 diff --git a/debian/changelog b/debian/changelog index 274f7c4..c6db93c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-mgw (1.1.0) unstable; urgency=medium + + * New upstream release + + -- Harald Welte Sat, 28 Oct 2017 12:48:41 +0200 + osmo-mgw (1.0.2) unstable; urgency=low * First release after major rename. -- To view, visit https://gerrit.osmocom.org/4508 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1748ed230041930b4e9f49deb03341772ab02144 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:02:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:02:33 +0000 Subject: osmo-mgw[master]: Tag/Release 1.1.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4508 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1748ed230041930b4e9f49deb03341772ab02144 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:02:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:02:36 +0000 Subject: osmo-mgw[master]: libosmo-mgcp-client: Bump LIBVERSION as interfaces have been... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4507 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e00af70267563a5fbf7e2a3c1326c22481d2666 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:02:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:02:39 +0000 Subject: [MERGED] osmo-mgw[master]: libosmo-mgcp-client: Bump LIBVERSION as interfaces have been... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libosmo-mgcp-client: Bump LIBVERSION as interfaces have been added ...................................................................... libosmo-mgcp-client: Bump LIBVERSION as interfaces have been added Change-Id: I3e00af70267563a5fbf7e2a3c1326c22481d2666 --- M debian/control R debian/libosmo-mgcp-client1.install M src/libosmo-mgcp-client/Makefile.am 3 files changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index bba88af..ef96796 100644 --- a/debian/control +++ b/debian/control @@ -34,7 +34,7 @@ Depends: libosmo-mgcp0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp: Osmocom's Media Gateway server library -Package: libosmo-mgcp-client0 +Package: libosmo-mgcp-client1 Section: libs Architecture: any Multi-Arch: same @@ -46,7 +46,7 @@ Section: libdevel Architecture: any Multi-Arch: same -Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-mgcp-client1 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities Package: osmo-bsc-mgcp diff --git a/debian/libosmo-mgcp-client0.install b/debian/libosmo-mgcp-client1.install similarity index 100% rename from debian/libosmo-mgcp-client0.install rename to debian/libosmo-mgcp-client1.install diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index de35f87..1eaa370 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -20,7 +20,7 @@ # This is not at all related to the release version, but a range of supported # API versions. Read TODO_RELEASE in the source tree's root! -MGCP_CLIENT_LIBVERSION=0:0:0 +MGCP_CLIENT_LIBVERSION=1:0:1 lib_LTLIBRARIES = \ libosmo-mgcp-client.la \ -- To view, visit https://gerrit.osmocom.org/4507 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e00af70267563a5fbf7e2a3c1326c22481d2666 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:02:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:02:39 +0000 Subject: [MERGED] osmo-mgw[master]: Tag/Release 1.1.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release 1.1.0 ...................................................................... Tag/Release 1.1.0 This marks the first release that includes the new libosmo-mgcp as well as some updates to libosmo-mgcp-client. Hence, all programs using those libraries can now depend on a proper minimum version Change-Id: I1748ed230041930b4e9f49deb03341772ab02144 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 274f7c4..c6db93c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-mgw (1.1.0) unstable; urgency=medium + + * New upstream release + + -- Harald Welte Sat, 28 Oct 2017 12:48:41 +0200 + osmo-mgw (1.0.2) unstable; urgency=low * First release after major rename. -- To view, visit https://gerrit.osmocom.org/4508 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1748ed230041930b4e9f49deb03341772ab02144 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:14:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:14:45 +0000 Subject: [PATCH] osmo-bsc[master]: Debian: Remove obsolete build dependencies Message-ID: Review at https://gerrit.osmocom.org/4509 Debian: Remove obsolete build dependencies Those dependencies were introduced at a different time, when GPRS related code was still in this repository Change-Id: I469909ad7c597cde3d7a7d2ec86101a9f41d3aa6 --- M debian/control 1 file changed, 1 insertion(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/4509/1 diff --git a/debian/control b/debian/control index 7b25ecc..26f5000 100644 --- a/debian/control +++ b/debian/control @@ -10,14 +10,9 @@ libtool, pkg-config, python-minimal, - libssl-dev, - libsctp-dev, libtalloc-dev, - libasn1c-dev, - libc-ares-dev, - libgtp-dev, libosmocore-dev, - libosmo-sccp-dev, + libosmo-sigtran-dev, libosmo-abis-dev, libosmo-netif-dev, libosmo-legacy-mgcp-dev -- To view, visit https://gerrit.osmocom.org/4509 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I469909ad7c597cde3d7a7d2ec86101a9f41d3aa6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:14:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:14:45 +0000 Subject: [PATCH] osmo-bsc[master]: connfigure.ac: Depend on latest versions of libosmo-* Message-ID: Review at https://gerrit.osmocom.org/4510 connfigure.ac: Depend on latest versions of libosmo-* We are using quite a number of symbols that are definitely *not* yet present in the respective library versions that we stated as dependency. Rather than figuring this out individually, simply require the latest releases. Change-Id: Iecda06d206c24390bb10f3a8f8a70ef3036381e2 --- M configure.ac 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/4510/1 diff --git a/configure.ac b/configure.ac index 4edbb83..79523d1 100644 --- a/configure.ac +++ b/configure.ac @@ -39,13 +39,13 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.3.2) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0) PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -- To view, visit https://gerrit.osmocom.org/4510 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iecda06d206c24390bb10f3a8f8a70ef3036381e2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:14:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:14:46 +0000 Subject: [PATCH] osmo-bsc[master]: osmo-bsc_nat: Don't link against libosmonetif Message-ID: Review at https://gerrit.osmocom.org/4511 osmo-bsc_nat: Don't link against libosmonetif This fixes the following dpkg-shlibdeps warning: Change-Id: I31af5fb8b52ef1fd5effb139d9cdea1ebe9a41b4 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bsc/usr/bin/osmo-bsc_nat was not linked against libosmonetif.so.4 (it uses none of the library's symbols) --- M src/osmo-bsc_nat/Makefile.am 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/11/4511/1 diff --git a/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am index 1eec7aa..71741ad 100644 --- a/src/osmo-bsc_nat/Makefile.am +++ b/src/osmo-bsc_nat/Makefile.am @@ -12,7 +12,6 @@ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOSCCP_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ - $(LIBOSMONETIF_CFLAGS) \ $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(LIBCRYPTO_CFLAGS) \ $(COVERAGE_CFLAGS) \ @@ -52,7 +51,6 @@ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOABIS_LIBS) \ - $(LIBOSMONETIF_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOLEGACYMGCP_LIBS) \ $(LIBCRYPTO_LIBS) \ -- To view, visit https://gerrit.osmocom.org/4511 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I31af5fb8b52ef1fd5effb139d9cdea1ebe9a41b4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:14:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:14:46 +0000 Subject: [PATCH] osmo-bsc[master]: Debian: split osmo-bsc-nat as a sub-package Message-ID: Review at https://gerrit.osmocom.org/4512 Debian: split osmo-bsc-nat as a sub-package Change-Id: Icf0bf80d61141ec060b6d2efcf3e65e2ef1ac2d6 --- M debian/control M debian/osmo-bsc.install 2 files changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/12/4512/1 diff --git a/debian/control b/debian/control index 26f5000..13d17ae 100644 --- a/debian/control +++ b/debian/control @@ -33,3 +33,9 @@ Multi-Arch: same Depends: osmo-bsc (= ${binary:Version}), ${misc:Depends} Description: OsmoBSC: Osmocom's Base Station Controller for 2G circuit-switched mobile networks + +Package: osmo-bsc-nat +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OsmoBSCNAT: Osmocom's BSC NAT, an Aggregator for SCCPLite A links between BSC and MSC diff --git a/debian/osmo-bsc.install b/debian/osmo-bsc.install index cce0f65..abae32f 100644 --- a/debian/osmo-bsc.install +++ b/debian/osmo-bsc.install @@ -1,2 +1,2 @@ -usr/bin +usr/bin/osmo-bsc usr/share/doc/osmo-bsc/examples/osmo-bsc -- To view, visit https://gerrit.osmocom.org/4512 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf0bf80d61141ec060b6d2efcf3e65e2ef1ac2d6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:14:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:14:46 +0000 Subject: [PATCH] osmo-bsc[master]: Debian: Package osmo-bsc systemd service Message-ID: Review at https://gerrit.osmocom.org/4513 Debian: Package osmo-bsc systemd service Change-Id: I29cb5f2132047e05448f1a4f261ef5976936be29 --- A debian/osmo-bsc.service 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/13/4513/1 diff --git a/debian/osmo-bsc.service b/debian/osmo-bsc.service new file mode 120000 index 0000000..ce03af1 --- /dev/null +++ b/debian/osmo-bsc.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-bsc.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4513 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I29cb5f2132047e05448f1a4f261ef5976936be29 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:14:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:14:46 +0000 Subject: [PATCH] osmo-bsc[master]: Don't link osmo-bsc_nat against libosmoabis Message-ID: Review at https://gerrit.osmocom.org/4514 Don't link osmo-bsc_nat against libosmoabis This fixes the following dpkg-shlibdeps warning: Change-Id: Iea00c209652e8070a59942504bef660db0999e86 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bsc-nat/usr/bin/osmo-bsc_nat was not linked against libosmoabis.so.6 (it uses none of the library's symbols) --- M src/osmo-bsc_nat/Makefile.am 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/14/4514/1 diff --git a/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am index 71741ad..23c2b67 100644 --- a/src/osmo-bsc_nat/Makefile.am +++ b/src/osmo-bsc_nat/Makefile.am @@ -11,7 +11,6 @@ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOSCCP_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(LIBCRYPTO_CFLAGS) \ $(COVERAGE_CFLAGS) \ @@ -50,7 +49,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOCTRL_LIBS) \ - $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOLEGACYMGCP_LIBS) \ $(LIBCRYPTO_LIBS) \ -- To view, visit https://gerrit.osmocom.org/4514 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iea00c209652e8070a59942504bef660db0999e86 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:15:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:15:34 +0000 Subject: [ABANDON] libosmocore[master]: [doc] Fix Doxygen 'param' direction: "in, out" rather than "i... In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: [doc] Fix Doxygen 'param' direction: "in,out" rather than "inout" ...................................................................... Abandoned apparently this is not needed. -- To view, visit https://gerrit.osmocom.org/4390 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ic2de1341b37453f339f0eefde3f14e14640fe3bb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:30:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:30:45 +0000 Subject: [PATCH] osmo-bsc[master]: Debian: Don't package osmo-bsc_nat In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4512 to look at the new patch set (#2). Debian: Don't package osmo-bsc_nat We don't want to pacakge osmo-bsc_nat from osmo-bsc.git at this point yet. It only suports SCCPlite, which is not yet fully supported by osmo-bsc. Rather, we continue to package osmo-bsc_nat from openbsc.git like we did so far. Also, the osmo-bsc_nat binary really doesn't belong into the osmo-bsc package at all. Change-Id: Icf0bf80d61141ec060b6d2efcf3e65e2ef1ac2d6 --- M debian/control M debian/osmo-bsc.install 2 files changed, 18 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/12/4512/2 diff --git a/debian/control b/debian/control index 26f5000..2c8eead 100644 --- a/debian/control +++ b/debian/control @@ -33,3 +33,20 @@ Multi-Arch: same Depends: osmo-bsc (= ${binary:Version}), ${misc:Depends} Description: OsmoBSC: Osmocom's Base Station Controller for 2G circuit-switched mobile networks + +Package: osmo-bsc-ipaccess-utils +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Command line utilities for ip.access nanoBTS + This package contains utilities that are specific for nanoBTS when being used + together with OpenBSC. It contains mainly two tools: ipaccess-config and ipaccess-proxy. + +Package: osmo-bsc-bs11-utils +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Command line utilities for Siemens BS-11 BTS + There is a tool in this package for configuring the Siemens BS-11 BTS. + Additionally, it contains one tool for making use of an ISDN-card and the + public telephone network as frequency standard for the E1 line. diff --git a/debian/osmo-bsc.install b/debian/osmo-bsc.install index cce0f65..abae32f 100644 --- a/debian/osmo-bsc.install +++ b/debian/osmo-bsc.install @@ -1,2 +1,2 @@ -usr/bin +usr/bin/osmo-bsc usr/share/doc/osmo-bsc/examples/osmo-bsc -- To view, visit https://gerrit.osmocom.org/4512 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf0bf80d61141ec060b6d2efcf3e65e2ef1ac2d6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:30:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:30:45 +0000 Subject: [PATCH] osmo-bsc[master]: Debian: Split off osmo-bsc-{bs11, ipaccess}-utils sub-packages Message-ID: Review at https://gerrit.osmocom.org/4515 Debian: Split off osmo-bsc-{bs11,ipaccess}-utils sub-packages The names and descriptions have been imported/inherited from openbsc.git Change-Id: Ia32e3645807ecf148f22cba3cab92f728074b20e --- A debian/osmo-bsc-bs11-utils.install A debian/osmo-bsc-ipaccess-utils.install M debian/osmo-bsc.install 3 files changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/15/4515/1 diff --git a/debian/osmo-bsc-bs11-utils.install b/debian/osmo-bsc-bs11-utils.install new file mode 100644 index 0000000..37cd20a --- /dev/null +++ b/debian/osmo-bsc-bs11-utils.install @@ -0,0 +1,2 @@ +usr/bin/bs11_config +usr/bin/isdnsync diff --git a/debian/osmo-bsc-ipaccess-utils.install b/debian/osmo-bsc-ipaccess-utils.install new file mode 100644 index 0000000..ff82ff6 --- /dev/null +++ b/debian/osmo-bsc-ipaccess-utils.install @@ -0,0 +1,2 @@ +usr/bin/ipaccess-config +usr/bin/ipaccess-proxy diff --git a/debian/osmo-bsc.install b/debian/osmo-bsc.install index abae32f..a7800c9 100644 --- a/debian/osmo-bsc.install +++ b/debian/osmo-bsc.install @@ -1,2 +1,3 @@ usr/bin/osmo-bsc +usr/bin/abisip-find usr/share/doc/osmo-bsc/examples/osmo-bsc -- To view, visit https://gerrit.osmocom.org/4515 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia32e3645807ecf148f22cba3cab92f728074b20e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:31:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:31:13 +0000 Subject: osmo-bsc[master]: Debian: Remove obsolete build dependencies In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4509 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I469909ad7c597cde3d7a7d2ec86101a9f41d3aa6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:31:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:31:19 +0000 Subject: osmo-bsc[master]: osmo-bsc_nat: Don't link against libosmonetif In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4511 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31af5fb8b52ef1fd5effb139d9cdea1ebe9a41b4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:34:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:34:57 +0000 Subject: [PATCH] osmo-bsc[master]: Debian: osmo-bsc-dbg should cover only the osmo-bsc package Message-ID: Review at https://gerrit.osmocom.org/4516 Debian: osmo-bsc-dbg should cover only the osmo-bsc package Change-Id: I3d2e7ce589e78bb4da6de3567462a6be4194174e --- M debian/rules 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/16/4516/1 diff --git a/debian/rules b/debian/rules index fa93cf5..71ffbf1 100755 --- a/debian/rules +++ b/debian/rules @@ -53,7 +53,7 @@ # See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: - dh_strip --dbg-package=osmo-bsc-dbg + dh_strip -posmo-bsc --dbg-package=osmo-bsc-dbg # Print test results in case of a failure override_dh_auto_test: -- To view, visit https://gerrit.osmocom.org/4516 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3d2e7ce589e78bb4da6de3567462a6be4194174e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:34:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:34:57 +0000 Subject: [PATCH] osmo-bsc[master]: Tag/Release Version 1.1.0 Message-ID: Review at https://gerrit.osmocom.org/4517 Tag/Release Version 1.1.0 Change-Id: I61661b7f392a5485172d2f7087b4eb8b82607f43 --- M debian/changelog 1 file changed, 62 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/17/4517/1 diff --git a/debian/changelog b/debian/changelog index 28b5ebf..e78680a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,66 @@ +osmo-bsc (1.1.0) unstable; urgency=medium + + [ Alexander Couzens ] + * Initial release. + * debian/rules: show testsuite.log when tests are failing + + [ Neels Hofmeyr ] + * jenkins: fix build: osmo-mgw from master, not pre_release + * drop files unrelated to osmo-bsc + * rename openbsc.pc to osmo-bsc.pc + * rewrite README + * move include/openbsc to include/osmocom/bsc + * drop MGCP client from osmo-bsc + * fix vty tests: vty no longer goes to parent node implicitly + * doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg + * add ';' after OSMO_ASSERT() + + [ Harald Welte ] + * configure.ac: No more libosmogb dependency + * configure.ac: remove --enable-osmo-bsc, --enable-nat + * configure.ac: remove smpp_mirror, which has no relation to a BSC + * contrib/jenkins.sh: MGCP is unconditional now + * configure.ac: Remove --enable-mgcp-transcoding + * configure.ac: Remove --enable-iu + * configure.ac: Remove checks for libgtp + c-ares + * configure.ac: Remove check for GMTOFF + * configure.ac: Package is now called osmo-bsc, not openbsc + * libbsc: document arguments of generate_bcch_chan_list() + * Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' + * gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx + * .gitignore: Update to post-NITB-split realities + * Remove any references to RANAP and Iu + * Fix nanobts_omlattr unit test + * nanobts_omlattra_test: Initialize logging before executing tests + * osmo-bsc: Initialize logging before initializing rate_ctr + * Rename osmo_fsm to avoid illegal space in name + more meaningful name + + [ Max ] + * Make TRX rf locking more visible + * SI13: drop PBCCH-related bits + * Wrap channel state assignment in macro + * Further cleanup leftovers from BSC/MSC split + * CTRL: cleanup write-only command functions + * Show OML link uptime in vty + * Fix repo split aftermath + * SI2q: cleanup UARFCN addition + * OML: consider RSL link state + * SI2q: fix generation for multiple UARFCNs + * Remove pkg-config file + * ctrl: add oml-uptime command + * SI1q: fix EARFCN appender + + [ Pau Espin Pedrol ] + * Remove unneeded dbi dependency + * bsc_api: Fix NULL secondary_lchan access in handle_ass_fail + * libbsc: Use correct printf formatting for uint64_t + * bsc_vty: Improve description of mid-call-text cmd + + -- Harald Welte Sat, 28 Oct 2017 11:19:03 +0200 + osmo-bsc (0.1.0) UNRELEASED; urgency=low - * Initial release. + [ Alexander Couzens ] + * Initial release. -- Alexander Couzens Tue, 08 Aug 2017 01:12:56 +0000 -- To view, visit https://gerrit.osmocom.org/4517 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61661b7f392a5485172d2f7087b4eb8b82607f43 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:35:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:35:03 +0000 Subject: osmo-bsc[master]: connfigure.ac: Depend on latest versions of libosmo-* In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4510 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iecda06d206c24390bb10f3a8f8a70ef3036381e2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:40:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:40:15 +0000 Subject: osmo-bsc[master]: Debian: Don't package osmo-bsc_nat In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4512 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0bf80d61141ec060b6d2efcf3e65e2ef1ac2d6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:40:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:40:17 +0000 Subject: osmo-bsc[master]: Debian: Package osmo-bsc systemd service In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4513 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29cb5f2132047e05448f1a4f261ef5976936be29 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:40:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:40:20 +0000 Subject: osmo-bsc[master]: Don't link osmo-bsc_nat against libosmoabis In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4514 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iea00c209652e8070a59942504bef660db0999e86 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:40:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:40:23 +0000 Subject: osmo-bsc[master]: Debian: Split off osmo-bsc-{bs11, ipaccess}-utils sub-packages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4515 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia32e3645807ecf148f22cba3cab92f728074b20e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:41:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:41:57 +0000 Subject: [MERGED] osmo-bsc[master]: Debian: Split off osmo-bsc-{bs11, ipaccess}-utils sub-packages In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Split off osmo-bsc-{bs11,ipaccess}-utils sub-packages ...................................................................... Debian: Split off osmo-bsc-{bs11,ipaccess}-utils sub-packages The names and descriptions have been imported/inherited from openbsc.git Change-Id: Ia32e3645807ecf148f22cba3cab92f728074b20e --- A debian/osmo-bsc-bs11-utils.install A debian/osmo-bsc-ipaccess-utils.install M debian/osmo-bsc.install 3 files changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-bsc-bs11-utils.install b/debian/osmo-bsc-bs11-utils.install new file mode 100644 index 0000000..37cd20a --- /dev/null +++ b/debian/osmo-bsc-bs11-utils.install @@ -0,0 +1,2 @@ +usr/bin/bs11_config +usr/bin/isdnsync diff --git a/debian/osmo-bsc-ipaccess-utils.install b/debian/osmo-bsc-ipaccess-utils.install new file mode 100644 index 0000000..ff82ff6 --- /dev/null +++ b/debian/osmo-bsc-ipaccess-utils.install @@ -0,0 +1,2 @@ +usr/bin/ipaccess-config +usr/bin/ipaccess-proxy diff --git a/debian/osmo-bsc.install b/debian/osmo-bsc.install index abae32f..a7800c9 100644 --- a/debian/osmo-bsc.install +++ b/debian/osmo-bsc.install @@ -1,2 +1,3 @@ usr/bin/osmo-bsc +usr/bin/abisip-find usr/share/doc/osmo-bsc/examples/osmo-bsc -- To view, visit https://gerrit.osmocom.org/4515 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia32e3645807ecf148f22cba3cab92f728074b20e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:41:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:41:57 +0000 Subject: [MERGED] osmo-bsc[master]: Don't link osmo-bsc_nat against libosmoabis In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Don't link osmo-bsc_nat against libosmoabis ...................................................................... Don't link osmo-bsc_nat against libosmoabis This fixes the following dpkg-shlibdeps warning: Change-Id: Iea00c209652e8070a59942504bef660db0999e86 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bsc-nat/usr/bin/osmo-bsc_nat was not linked against libosmoabis.so.6 (it uses none of the library's symbols) --- M src/osmo-bsc_nat/Makefile.am 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am index 71741ad..23c2b67 100644 --- a/src/osmo-bsc_nat/Makefile.am +++ b/src/osmo-bsc_nat/Makefile.am @@ -11,7 +11,6 @@ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOSCCP_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(LIBCRYPTO_CFLAGS) \ $(COVERAGE_CFLAGS) \ @@ -50,7 +49,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOCTRL_LIBS) \ - $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOLEGACYMGCP_LIBS) \ $(LIBCRYPTO_LIBS) \ -- To view, visit https://gerrit.osmocom.org/4514 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iea00c209652e8070a59942504bef660db0999e86 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:41:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:41:58 +0000 Subject: [MERGED] osmo-bsc[master]: Debian: Package osmo-bsc systemd service In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Package osmo-bsc systemd service ...................................................................... Debian: Package osmo-bsc systemd service Change-Id: I29cb5f2132047e05448f1a4f261ef5976936be29 --- A debian/osmo-bsc.service 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-bsc.service b/debian/osmo-bsc.service new file mode 120000 index 0000000..ce03af1 --- /dev/null +++ b/debian/osmo-bsc.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-bsc.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4513 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I29cb5f2132047e05448f1a4f261ef5976936be29 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:41:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:41:58 +0000 Subject: [MERGED] osmo-bsc[master]: Debian: Don't package osmo-bsc_nat In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Don't package osmo-bsc_nat ...................................................................... Debian: Don't package osmo-bsc_nat We don't want to pacakge osmo-bsc_nat from osmo-bsc.git at this point yet. It only suports SCCPlite, which is not yet fully supported by osmo-bsc. Rather, we continue to package osmo-bsc_nat from openbsc.git like we did so far. Also, the osmo-bsc_nat binary really doesn't belong into the osmo-bsc package at all. Change-Id: Icf0bf80d61141ec060b6d2efcf3e65e2ef1ac2d6 --- M debian/control M debian/osmo-bsc.install 2 files changed, 18 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 26f5000..2c8eead 100644 --- a/debian/control +++ b/debian/control @@ -33,3 +33,20 @@ Multi-Arch: same Depends: osmo-bsc (= ${binary:Version}), ${misc:Depends} Description: OsmoBSC: Osmocom's Base Station Controller for 2G circuit-switched mobile networks + +Package: osmo-bsc-ipaccess-utils +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Command line utilities for ip.access nanoBTS + This package contains utilities that are specific for nanoBTS when being used + together with OpenBSC. It contains mainly two tools: ipaccess-config and ipaccess-proxy. + +Package: osmo-bsc-bs11-utils +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Command line utilities for Siemens BS-11 BTS + There is a tool in this package for configuring the Siemens BS-11 BTS. + Additionally, it contains one tool for making use of an ISDN-card and the + public telephone network as frequency standard for the E1 line. diff --git a/debian/osmo-bsc.install b/debian/osmo-bsc.install index cce0f65..abae32f 100644 --- a/debian/osmo-bsc.install +++ b/debian/osmo-bsc.install @@ -1,2 +1,2 @@ -usr/bin +usr/bin/osmo-bsc usr/share/doc/osmo-bsc/examples/osmo-bsc -- To view, visit https://gerrit.osmocom.org/4512 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icf0bf80d61141ec060b6d2efcf3e65e2ef1ac2d6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:41:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:41:58 +0000 Subject: [MERGED] osmo-bsc[master]: connfigure.ac: Depend on latest versions of libosmo-* In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: connfigure.ac: Depend on latest versions of libosmo-* ...................................................................... connfigure.ac: Depend on latest versions of libosmo-* We are using quite a number of symbols that are definitely *not* yet present in the respective library versions that we stated as dependency. Rather than figuring this out individually, simply require the latest releases. Change-Id: Iecda06d206c24390bb10f3a8f8a70ef3036381e2 --- M configure.ac 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 4edbb83..79523d1 100644 --- a/configure.ac +++ b/configure.ac @@ -39,13 +39,13 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.3.2) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0) PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -- To view, visit https://gerrit.osmocom.org/4510 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iecda06d206c24390bb10f3a8f8a70ef3036381e2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:41:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:41:58 +0000 Subject: [MERGED] osmo-bsc[master]: osmo-bsc_nat: Don't link against libosmonetif In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bsc_nat: Don't link against libosmonetif ...................................................................... osmo-bsc_nat: Don't link against libosmonetif This fixes the following dpkg-shlibdeps warning: Change-Id: I31af5fb8b52ef1fd5effb139d9cdea1ebe9a41b4 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bsc/usr/bin/osmo-bsc_nat was not linked against libosmonetif.so.4 (it uses none of the library's symbols) --- M src/osmo-bsc_nat/Makefile.am 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am index 1eec7aa..71741ad 100644 --- a/src/osmo-bsc_nat/Makefile.am +++ b/src/osmo-bsc_nat/Makefile.am @@ -12,7 +12,6 @@ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOSCCP_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ - $(LIBOSMONETIF_CFLAGS) \ $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(LIBCRYPTO_CFLAGS) \ $(COVERAGE_CFLAGS) \ @@ -52,7 +51,6 @@ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOABIS_LIBS) \ - $(LIBOSMONETIF_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOLEGACYMGCP_LIBS) \ $(LIBCRYPTO_LIBS) \ -- To view, visit https://gerrit.osmocom.org/4511 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I31af5fb8b52ef1fd5effb139d9cdea1ebe9a41b4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:41:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:41:58 +0000 Subject: [MERGED] osmo-bsc[master]: Debian: Remove obsolete build dependencies In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Remove obsolete build dependencies ...................................................................... Debian: Remove obsolete build dependencies Those dependencies were introduced at a different time, when GPRS related code was still in this repository Change-Id: I469909ad7c597cde3d7a7d2ec86101a9f41d3aa6 --- M debian/control 1 file changed, 1 insertion(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 7b25ecc..26f5000 100644 --- a/debian/control +++ b/debian/control @@ -10,14 +10,9 @@ libtool, pkg-config, python-minimal, - libssl-dev, - libsctp-dev, libtalloc-dev, - libasn1c-dev, - libc-ares-dev, - libgtp-dev, libosmocore-dev, - libosmo-sccp-dev, + libosmo-sigtran-dev, libosmo-abis-dev, libosmo-netif-dev, libosmo-legacy-mgcp-dev -- To view, visit https://gerrit.osmocom.org/4509 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I469909ad7c597cde3d7a7d2ec86101a9f41d3aa6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:45:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:45:58 +0000 Subject: osmo-bsc[master]: Debian: osmo-bsc-dbg should cover only the osmo-bsc package In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4516 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d2e7ce589e78bb4da6de3567462a6be4194174e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:46:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:46:01 +0000 Subject: osmo-bsc[master]: Tag/Release Version 1.1.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4517 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61661b7f392a5485172d2f7087b4eb8b82607f43 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:46:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:46:02 +0000 Subject: [MERGED] osmo-bsc[master]: Tag/Release Version 1.1.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release Version 1.1.0 ...................................................................... Tag/Release Version 1.1.0 Change-Id: I61661b7f392a5485172d2f7087b4eb8b82607f43 --- M debian/changelog 1 file changed, 62 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 28b5ebf..e78680a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,66 @@ +osmo-bsc (1.1.0) unstable; urgency=medium + + [ Alexander Couzens ] + * Initial release. + * debian/rules: show testsuite.log when tests are failing + + [ Neels Hofmeyr ] + * jenkins: fix build: osmo-mgw from master, not pre_release + * drop files unrelated to osmo-bsc + * rename openbsc.pc to osmo-bsc.pc + * rewrite README + * move include/openbsc to include/osmocom/bsc + * drop MGCP client from osmo-bsc + * fix vty tests: vty no longer goes to parent node implicitly + * doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg + * add ';' after OSMO_ASSERT() + + [ Harald Welte ] + * configure.ac: No more libosmogb dependency + * configure.ac: remove --enable-osmo-bsc, --enable-nat + * configure.ac: remove smpp_mirror, which has no relation to a BSC + * contrib/jenkins.sh: MGCP is unconditional now + * configure.ac: Remove --enable-mgcp-transcoding + * configure.ac: Remove --enable-iu + * configure.ac: Remove checks for libgtp + c-ares + * configure.ac: Remove check for GMTOFF + * configure.ac: Package is now called osmo-bsc, not openbsc + * libbsc: document arguments of generate_bcch_chan_list() + * Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' + * gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx + * .gitignore: Update to post-NITB-split realities + * Remove any references to RANAP and Iu + * Fix nanobts_omlattr unit test + * nanobts_omlattra_test: Initialize logging before executing tests + * osmo-bsc: Initialize logging before initializing rate_ctr + * Rename osmo_fsm to avoid illegal space in name + more meaningful name + + [ Max ] + * Make TRX rf locking more visible + * SI13: drop PBCCH-related bits + * Wrap channel state assignment in macro + * Further cleanup leftovers from BSC/MSC split + * CTRL: cleanup write-only command functions + * Show OML link uptime in vty + * Fix repo split aftermath + * SI2q: cleanup UARFCN addition + * OML: consider RSL link state + * SI2q: fix generation for multiple UARFCNs + * Remove pkg-config file + * ctrl: add oml-uptime command + * SI1q: fix EARFCN appender + + [ Pau Espin Pedrol ] + * Remove unneeded dbi dependency + * bsc_api: Fix NULL secondary_lchan access in handle_ass_fail + * libbsc: Use correct printf formatting for uint64_t + * bsc_vty: Improve description of mid-call-text cmd + + -- Harald Welte Sat, 28 Oct 2017 11:19:03 +0200 + osmo-bsc (0.1.0) UNRELEASED; urgency=low - * Initial release. + [ Alexander Couzens ] + * Initial release. -- Alexander Couzens Tue, 08 Aug 2017 01:12:56 +0000 -- To view, visit https://gerrit.osmocom.org/4517 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61661b7f392a5485172d2f7087b4eb8b82607f43 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 11:46:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 11:46:02 +0000 Subject: [MERGED] osmo-bsc[master]: Debian: osmo-bsc-dbg should cover only the osmo-bsc package In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: osmo-bsc-dbg should cover only the osmo-bsc package ...................................................................... Debian: osmo-bsc-dbg should cover only the osmo-bsc package Change-Id: I3d2e7ce589e78bb4da6de3567462a6be4194174e --- M debian/rules 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index fa93cf5..71ffbf1 100755 --- a/debian/rules +++ b/debian/rules @@ -53,7 +53,7 @@ # See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: - dh_strip --dbg-package=osmo-bsc-dbg + dh_strip -posmo-bsc --dbg-package=osmo-bsc-dbg # Print test results in case of a failure override_dh_auto_test: -- To view, visit https://gerrit.osmocom.org/4516 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3d2e7ce589e78bb4da6de3567462a6be4194174e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:01:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:01:42 +0000 Subject: [PATCH] libasn1c[master]: link libasn1c against libmath, don't ask users to do it Message-ID: Review at https://gerrit.osmocom.org/4518 link libasn1c against libmath, don't ask users to do it libasn1c is using libm[ath] symbols from REAL.c and hence should be linked using '-lm' to carry a dynamic linker dependency itself. We shouldn't use a pkg-config hack to ask applications to do this on our behalf. Change-Id: Ie107f7252eeed90233468deaef57d3cee36abdf4 --- M libasn1c.pc.in M src/Makefile.am 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/18/4518/1 diff --git a/libasn1c.pc.in b/libasn1c.pc.in index 89ad53a..ab0c415 100644 --- a/libasn1c.pc.in +++ b/libasn1c.pc.in @@ -6,6 +6,6 @@ Name: asn1c runtime library Description: C Utility Library Version: @VERSION@ -Libs: -L${libdir} @LIBTALLOC_LIBS@ -lasn1c -lm +Libs: -L${libdir} @LIBTALLOC_LIBS@ -lasn1c Cflags: -I${includedir}/ -I${includedir}/asn1c @LIBTALLOC_CFLAGS@ diff --git a/src/Makefile.am b/src/Makefile.am index 0f05cce..8009c76 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,6 +11,6 @@ lib_LTLIBRARIES = libasn1c.la -libasn1c_la_LDFLAGS = $(LIBTALLOC_LIBS) +libasn1c_la_LDFLAGS = $(LIBTALLOC_LIBS) -lm libasn1c_la_SOURCES = ANY.c constraints.c GeneralizedTime.c NumericString.c T61String.c asn_codecs_prim.c constr_CHOICE.c GeneralString.c ObjectDescriptor.c TeletexString.c asn_SEQUENCE_OF.c constr_SEQUENCE.c GraphicString.c OBJECT_IDENTIFIER.c UniversalString.c asn_SET_OF.c constr_SEQUENCE_OF.c IA5String.c OCTET_STRING.c UTCTime.c ber_decoder.c constr_SET.c INTEGER.c per_decoder.c UTF8String.c ber_tlv_length.c constr_SET_OF.c ISO646String.c per_encoder.c VideotexString.c ber_tlv_tag.c constr_TYPE.c NativeEnumerated.c per_support.c VisibleString.c BIT_STRING.c NativeInteger.c PrintableString.c xer_decoder.c BMPString.c der_encoder.c NativeReal.c REAL.c xer_encoder.c BOOLEAN.c ENUMERATED.c NULL.c RELATIVE-OID.c xer_support.c per_opentype.c asn1helpers.c -- To view, visit https://gerrit.osmocom.org/4518 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie107f7252eeed90233468deaef57d3cee36abdf4 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:13:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:13:28 +0000 Subject: libasn1c[master]: link libasn1c against libmath, don't ask users to do it In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4518 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie107f7252eeed90233468deaef57d3cee36abdf4 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:13:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:13:29 +0000 Subject: [MERGED] libasn1c[master]: link libasn1c against libmath, don't ask users to do it In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: link libasn1c against libmath, don't ask users to do it ...................................................................... link libasn1c against libmath, don't ask users to do it libasn1c is using libm[ath] symbols from REAL.c and hence should be linked using '-lm' to carry a dynamic linker dependency itself. We shouldn't use a pkg-config hack to ask applications to do this on our behalf. Change-Id: Ie107f7252eeed90233468deaef57d3cee36abdf4 --- M libasn1c.pc.in M src/Makefile.am 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/libasn1c.pc.in b/libasn1c.pc.in index 89ad53a..ab0c415 100644 --- a/libasn1c.pc.in +++ b/libasn1c.pc.in @@ -6,6 +6,6 @@ Name: asn1c runtime library Description: C Utility Library Version: @VERSION@ -Libs: -L${libdir} @LIBTALLOC_LIBS@ -lasn1c -lm +Libs: -L${libdir} @LIBTALLOC_LIBS@ -lasn1c Cflags: -I${includedir}/ -I${includedir}/asn1c @LIBTALLOC_CFLAGS@ diff --git a/src/Makefile.am b/src/Makefile.am index 0f05cce..8009c76 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,6 +11,6 @@ lib_LTLIBRARIES = libasn1c.la -libasn1c_la_LDFLAGS = $(LIBTALLOC_LIBS) +libasn1c_la_LDFLAGS = $(LIBTALLOC_LIBS) -lm libasn1c_la_SOURCES = ANY.c constraints.c GeneralizedTime.c NumericString.c T61String.c asn_codecs_prim.c constr_CHOICE.c GeneralString.c ObjectDescriptor.c TeletexString.c asn_SEQUENCE_OF.c constr_SEQUENCE.c GraphicString.c OBJECT_IDENTIFIER.c UniversalString.c asn_SET_OF.c constr_SEQUENCE_OF.c IA5String.c OCTET_STRING.c UTCTime.c ber_decoder.c constr_SET.c INTEGER.c per_decoder.c UTF8String.c ber_tlv_length.c constr_SET_OF.c ISO646String.c per_encoder.c VideotexString.c ber_tlv_tag.c constr_TYPE.c NativeEnumerated.c per_support.c VisibleString.c BIT_STRING.c NativeInteger.c PrintableString.c xer_decoder.c BMPString.c der_encoder.c NativeReal.c REAL.c xer_encoder.c BOOLEAN.c ENUMERATED.c NULL.c RELATIVE-OID.c xer_support.c per_opentype.c asn1helpers.c -- To view, visit https://gerrit.osmocom.org/4518 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie107f7252eeed90233468deaef57d3cee36abdf4 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:42:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:42:59 +0000 Subject: [PATCH] osmo-msc[master]: Debian: remove obsolete Dependencies Message-ID: Review at https://gerrit.osmocom.org/4519 Debian: remove obsolete Dependencies libgtp and c-ares are GRPS dependencies; we don't have GPRS in MSC Change-Id: Ie7fb8a9417d9024e3da0e8547679f7b696c79a9f --- M debian/control 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/19/4519/1 diff --git a/debian/control b/debian/control index ce51a7d..f6ea826 100644 --- a/debian/control +++ b/debian/control @@ -12,10 +12,7 @@ libdbi-dev, libtalloc-dev, libssl-dev, - libc-ares-dev, - libgtp-dev, libasn1c-dev, - libc-ares-dev, libosmocore-dev, libosmo-sccp-dev, libosmo-abis-dev, -- To view, visit https://gerrit.osmocom.org/4519 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7fb8a9417d9024e3da0e8547679f7b696c79a9f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:43:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:43:03 +0000 Subject: [PATCH] osmo-msc[master]: configure.ac: Depend on latest tagged/released libosmo-* ver... Message-ID: Review at https://gerrit.osmocom.org/4520 configure.ac: Depend on latest tagged/released libosmo-* versions This is the safe choice, as in absence of automatic testing we don't know if we actually still build against the [sometimes] ancient dependencies. Change-Id: Idf5cad1dc17a5136d00c970c326cdf3b7ee18e3c --- M configure.ac 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/4520/1 diff --git a/configure.ac b/configure.ac index 64fead8..86bb870 100644 --- a/configure.ac +++ b/configure.ac @@ -39,15 +39,15 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0) PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.1.0) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], @@ -63,8 +63,8 @@ AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) if test "x$osmo_ac_iu" = "xyes" ; then - PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? - PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? + PKG_CHECK_MODULES(LIBASN1C, libasn1c >= 0.9.28) + PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap >= 0.2.0) AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) fi AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes") -- To view, visit https://gerrit.osmocom.org/4520 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf5cad1dc17a5136d00c970c326cdf3b7ee18e3c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:43:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:43:03 +0000 Subject: [PATCH] osmo-msc[master]: Debian: Build with enabled SMPP support Message-ID: Review at https://gerrit.osmocom.org/4521 Debian: Build with enabled SMPP support Change-Id: Ibab5ede36cf329620a66b7811c43cc73c7135ecd --- M debian/control M debian/rules 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/21/4521/1 diff --git a/debian/control b/debian/control index f6ea826..722a1bc 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,7 @@ libdbi-dev, libtalloc-dev, libssl-dev, + libsmpp34-dev, libasn1c-dev, libosmocore-dev, libosmo-sccp-dev, diff --git a/debian/rules b/debian/rules index 277d7a4..15e79da 100755 --- a/debian/rules +++ b/debian/rules @@ -46,7 +46,7 @@ # debmake generated override targets # Set options for ./configure -CONFIGURE_FLAGS += --enable-iu +CONFIGURE_FLAGS += --enable-iu --enable-smpp override_dh_auto_configure: dh_auto_configure -- $(CONFIGURE_FLAGS) # -- To view, visit https://gerrit.osmocom.org/4521 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibab5ede36cf329620a66b7811c43cc73c7135ecd Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:43:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:43:03 +0000 Subject: [PATCH] osmo-msc[master]: osmo-msc: Don't link against libasn1c Message-ID: Review at https://gerrit.osmocom.org/4522 osmo-msc: Don't link against libasn1c osmo-msc doesn't use any API/symbols of libasn1c directlry. Rather, we use libosmo-ranap which in turn uses libasn1c. Let the linker work out that dependency. This fixes the following dpkg-shlibdeps warning: Change-Id: I2f840884d8f1cc542de1e26acd3d4215bd2fd899 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-msc/usr/bin/osmo-msc was not linked against libasn1c.so.0 (it uses none of the library's symbols) --- M src/osmo-msc/Makefile.am M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am 3 files changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/22/4522/1 diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index 85a5a5a..e296f97 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -51,6 +51,5 @@ if BUILD_IU osmo_msc_LDADD += \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(NULL) endif diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index aa2b3fe..9af9870 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -43,7 +43,6 @@ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index 1f8ee7b..a912be1 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -43,7 +43,6 @@ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -- To view, visit https://gerrit.osmocom.org/4522 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f840884d8f1cc542de1e26acd3d4215bd2fd899 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:43:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:43:04 +0000 Subject: [PATCH] osmo-msc[master]: Debian: Include systemd.service in package Message-ID: Review at https://gerrit.osmocom.org/4523 Debian: Include systemd.service in package Change-Id: Iee768a0e812db782f3e23c5a1454e141eee08a74 --- A debian/osmo-msc.service 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/23/4523/1 diff --git a/debian/osmo-msc.service b/debian/osmo-msc.service new file mode 120000 index 0000000..784b8b5 --- /dev/null +++ b/debian/osmo-msc.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-msc.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4523 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee768a0e812db782f3e23c5a1454e141eee08a74 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:52:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:52:51 +0000 Subject: [PATCH] osmo-msc[master]: Debian: include all (not just one) example config files Message-ID: Review at https://gerrit.osmocom.org/4524 Debian: include all (not just one) example config files Change-Id: I19ac23898e9543081a1407da9af63ed643791d6e --- M debian/osmo-msc.install 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/24/4524/1 diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install index 3e289b2..b3d1a55 100644 --- a/debian/osmo-msc.install +++ b/debian/osmo-msc.install @@ -1,2 +1,2 @@ usr/bin/osmo-msc -usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc.cfg +usr/share/doc/osmo-msc/examples/osmo-msc -- To view, visit https://gerrit.osmocom.org/4524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I19ac23898e9543081a1407da9af63ed643791d6e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:52:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:52:51 +0000 Subject: [PATCH] osmo-msc[master]: Tag/Release Version 1.1.0 Message-ID: Review at https://gerrit.osmocom.org/4525 Tag/Release Version 1.1.0 [ Alexander Couzens ] * debian/rules: show testsuite.log when tests are failing [ Neels Hofmeyr ] * build: check for -lgsm * am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars * jenkins: fix build: osmo-mgw from master, not pre_release * jenkins: drop unused build matrix vars, always --enable-smpp * configure.ac: fix to "AC_INIT[osmo-msc]" * rewrite README * rename openbsc.pc to osmo-msc.pc * debian: fix web and VCS links, tweak osmo-msc.install * drop files unrelated to osmo-msc * rename include/openbsc to include/osmocom/msc * doc/examples: add detailed cs7 config examples * use separated libosmo-mgcp-client, apply rename to mgcp_client_* * ctrl: subscriber-list-active: list only attached subscribers * debian: fix dependency to mgcp library * main: remove cmdline args no longer available for osmo-msc * vty: fix: missing default cmds at hlr node * ctrl: remove unimplemented cmds subscriber-{modify,delete} * fix build: remove obsolete header legacy_mgcp/mgcp.h * fix debian: fix erratic doc/examples install path * fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() * fix vty tests: long timeout due to unreachable STP address * cosmetic: vlr: declare a struct in .h; drop unused header * add ';' after OSMO_ASSERT() [ Philipp Maier ] * a_iface: fix memory leaks * a_iface: fix typo [ Max ] * Remove rest_octets.h * Remove SI-related code * Remove BTS-specific attributes * Remove unused osmo_bsc_rf.h header * Remove pkg-config file [ Harald Welte ] * Update .gitignore for post-nitb-split * remove further files and autotest/autoconf bits irrelevant to osmo-msc * Rename osmo_fsm to avoid illegal space in name + more meaningful name * Debian: remove obsolete Dependencies * configure.ac: Depend on latest tagged/released libosmo-* versions * Debian: Build with enabled SMPP support * osmo-msc: Don't link against libasn1c * Debian: Include systemd.service in package * Debian: include all (not just one) example config files Change-Id: Ic24d937658e5b467c6643ae3cd54e5b6d9db3175 --- M debian/changelog 1 file changed, 55 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/25/4525/1 diff --git a/debian/changelog b/debian/changelog index a1b3dda..cdb0430 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,58 @@ +osmo-msc (1.1.0) unstable; urgency=medium + + [ Alexander Couzens ] + * Initial release. + * debian/rules: show testsuite.log when tests are failing + + [ Neels Hofmeyr ] + * build: check for -lgsm + * am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars + * jenkins: fix build: osmo-mgw from master, not pre_release + * jenkins: drop unused build matrix vars, always --enable-smpp + * configure.ac: fix to "AC_INIT[osmo-msc]" + * rewrite README + * rename openbsc.pc to osmo-msc.pc + * debian: fix web and VCS links, tweak osmo-msc.install + * drop files unrelated to osmo-msc + * rename include/openbsc to include/osmocom/msc + * doc/examples: add detailed cs7 config examples + * use separated libosmo-mgcp-client, apply rename to mgcp_client_* + * ctrl: subscriber-list-active: list only attached subscribers + * debian: fix dependency to mgcp library + * main: remove cmdline args no longer available for osmo-msc + * vty: fix: missing default cmds at hlr node + * ctrl: remove unimplemented cmds subscriber-{modify,delete} + * fix build: remove obsolete header legacy_mgcp/mgcp.h + * fix debian: fix erratic doc/examples install path + * fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() + * fix vty tests: long timeout due to unreachable STP address + * cosmetic: vlr: declare a struct in .h; drop unused header + * add ';' after OSMO_ASSERT() + + [ Philipp Maier ] + * a_iface: fix memory leaks + * a_iface: fix typo + + [ Max ] + * Remove rest_octets.h + * Remove SI-related code + * Remove BTS-specific attributes + * Remove unused osmo_bsc_rf.h header + * Remove pkg-config file + + [ Harald Welte ] + * Update .gitignore for post-nitb-split + * remove further files and autotest/autoconf bits irrelevant to osmo-msc + * Rename osmo_fsm to avoid illegal space in name + more meaningful name + * Debian: remove obsolete Dependencies + * configure.ac: Depend on latest tagged/released libosmo-* versions + * Debian: Build with enabled SMPP support + * osmo-msc: Don't link against libasn1c + * Debian: Include systemd.service in package + * Debian: include all (not just one) example config files + + -- Harald Welte Sat, 28 Oct 2017 14:45:58 +0200 + osmo-msc (0.1.0) UNRELEASED; urgency=low * Initial release. -- To view, visit https://gerrit.osmocom.org/4525 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic24d937658e5b467c6643ae3cd54e5b6d9db3175 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:52:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:52:59 +0000 Subject: osmo-msc[master]: Debian: remove obsolete Dependencies In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4519 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7fb8a9417d9024e3da0e8547679f7b696c79a9f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:56:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:56:48 +0000 Subject: [PATCH] osmo-msc[master]: configure.ac: Depend on latest tagged/released libosmo-* ver... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4520 to look at the new patch set (#2). configure.ac: Depend on latest tagged/released libosmo-* versions This is the safe choice, as in absence of automatic testing we don't know if we actually still build against the [sometimes] ancient dependencies. Would be great to automatize this, but until we have it, better be safe. Change-Id: Idf5cad1dc17a5136d00c970c326cdf3b7ee18e3c --- M configure.ac 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/4520/2 diff --git a/configure.ac b/configure.ac index 64fead8..86bb870 100644 --- a/configure.ac +++ b/configure.ac @@ -39,15 +39,15 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0) PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.1.0) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], @@ -63,8 +63,8 @@ AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) if test "x$osmo_ac_iu" = "xyes" ; then - PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? - PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? + PKG_CHECK_MODULES(LIBASN1C, libasn1c >= 0.9.28) + PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap >= 0.2.0) AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) fi AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes") -- To view, visit https://gerrit.osmocom.org/4520 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idf5cad1dc17a5136d00c970c326cdf3b7ee18e3c Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:56:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:56:48 +0000 Subject: [PATCH] osmo-msc[master]: Debian: Build with enabled SMPP support In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4521 to look at the new patch set (#2). Debian: Build with enabled SMPP support Change-Id: Ibab5ede36cf329620a66b7811c43cc73c7135ecd --- M debian/control M debian/rules 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/21/4521/2 diff --git a/debian/control b/debian/control index f6ea826..722a1bc 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,7 @@ libdbi-dev, libtalloc-dev, libssl-dev, + libsmpp34-dev, libasn1c-dev, libosmocore-dev, libosmo-sccp-dev, diff --git a/debian/rules b/debian/rules index 277d7a4..15e79da 100755 --- a/debian/rules +++ b/debian/rules @@ -46,7 +46,7 @@ # debmake generated override targets # Set options for ./configure -CONFIGURE_FLAGS += --enable-iu +CONFIGURE_FLAGS += --enable-iu --enable-smpp override_dh_auto_configure: dh_auto_configure -- $(CONFIGURE_FLAGS) # -- To view, visit https://gerrit.osmocom.org/4521 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibab5ede36cf329620a66b7811c43cc73c7135ecd Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:56:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:56:48 +0000 Subject: [PATCH] osmo-msc[master]: osmo-msc: Don't link against libasn1c In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4522 to look at the new patch set (#2). osmo-msc: Don't link against libasn1c osmo-msc doesn't use any API/symbols of libasn1c directlry. Rather, we use libosmo-ranap which in turn uses libasn1c. Let the linker work out that dependency. This fixes the following dpkg-shlibdeps warning: Change-Id: I2f840884d8f1cc542de1e26acd3d4215bd2fd899 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-msc/usr/bin/osmo-msc was not linked against libasn1c.so.0 (it uses none of the library's symbols) --- M src/osmo-msc/Makefile.am M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am 3 files changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/22/4522/2 diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index 85a5a5a..e296f97 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -51,6 +51,5 @@ if BUILD_IU osmo_msc_LDADD += \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(NULL) endif diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index aa2b3fe..9af9870 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -43,7 +43,6 @@ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index 1f8ee7b..a912be1 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -43,7 +43,6 @@ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -- To view, visit https://gerrit.osmocom.org/4522 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2f840884d8f1cc542de1e26acd3d4215bd2fd899 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:56:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:56:48 +0000 Subject: [PATCH] osmo-msc[master]: Debian: Include systemd.service in package In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4523 to look at the new patch set (#2). Debian: Include systemd.service in package Change-Id: Iee768a0e812db782f3e23c5a1454e141eee08a74 --- A debian/osmo-msc.service 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/23/4523/2 diff --git a/debian/osmo-msc.service b/debian/osmo-msc.service new file mode 120000 index 0000000..784b8b5 --- /dev/null +++ b/debian/osmo-msc.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-msc.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4523 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iee768a0e812db782f3e23c5a1454e141eee08a74 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:56:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:56:48 +0000 Subject: [PATCH] osmo-msc[master]: Debian: include all (not just one) example config files In-Reply-To: References: Message-ID: Debian: include all (not just one) example config files Change-Id: I19ac23898e9543081a1407da9af63ed643791d6e --- M debian/osmo-msc.install 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/24/4524/2 diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install index 3e289b2..b3d1a55 100644 --- a/debian/osmo-msc.install +++ b/debian/osmo-msc.install @@ -1,2 +1,2 @@ usr/bin/osmo-msc -usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc.cfg +usr/share/doc/osmo-msc/examples/osmo-msc -- To view, visit https://gerrit.osmocom.org/4524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I19ac23898e9543081a1407da9af63ed643791d6e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 12:56:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 12:56:48 +0000 Subject: [PATCH] osmo-msc[master]: Tag/Release Version 1.1.0 In-Reply-To: References: Message-ID: Tag/Release Version 1.1.0 [ Alexander Couzens ] * debian/rules: show testsuite.log when tests are failing [ Neels Hofmeyr ] * build: check for -lgsm * am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars * jenkins: fix build: osmo-mgw from master, not pre_release * jenkins: drop unused build matrix vars, always --enable-smpp * configure.ac: fix to "AC_INIT[osmo-msc]" * rewrite README * rename openbsc.pc to osmo-msc.pc * debian: fix web and VCS links, tweak osmo-msc.install * drop files unrelated to osmo-msc * rename include/openbsc to include/osmocom/msc * doc/examples: add detailed cs7 config examples * use separated libosmo-mgcp-client, apply rename to mgcp_client_* * ctrl: subscriber-list-active: list only attached subscribers * debian: fix dependency to mgcp library * main: remove cmdline args no longer available for osmo-msc * vty: fix: missing default cmds at hlr node * ctrl: remove unimplemented cmds subscriber-{modify,delete} * fix build: remove obsolete header legacy_mgcp/mgcp.h * fix debian: fix erratic doc/examples install path * fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() * fix vty tests: long timeout due to unreachable STP address * cosmetic: vlr: declare a struct in .h; drop unused header * add ';' after OSMO_ASSERT() [ Philipp Maier ] * a_iface: fix memory leaks * a_iface: fix typo [ Max ] * Remove rest_octets.h * Remove SI-related code * Remove BTS-specific attributes * Remove unused osmo_bsc_rf.h header * Remove pkg-config file [ Harald Welte ] * Update .gitignore for post-nitb-split * remove further files and autotest/autoconf bits irrelevant to osmo-msc * Rename osmo_fsm to avoid illegal space in name + more meaningful name * Debian: remove obsolete Dependencies * configure.ac: Depend on latest tagged/released libosmo-* versions * Debian: Build with enabled SMPP support * osmo-msc: Don't link against libasn1c * Debian: Include systemd.service in package * Debian: include all (not just one) example config files Change-Id: Ic24d937658e5b467c6643ae3cd54e5b6d9db3175 --- M debian/changelog 1 file changed, 55 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/25/4525/2 diff --git a/debian/changelog b/debian/changelog index a1b3dda..cdb0430 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,58 @@ +osmo-msc (1.1.0) unstable; urgency=medium + + [ Alexander Couzens ] + * Initial release. + * debian/rules: show testsuite.log when tests are failing + + [ Neels Hofmeyr ] + * build: check for -lgsm + * am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars + * jenkins: fix build: osmo-mgw from master, not pre_release + * jenkins: drop unused build matrix vars, always --enable-smpp + * configure.ac: fix to "AC_INIT[osmo-msc]" + * rewrite README + * rename openbsc.pc to osmo-msc.pc + * debian: fix web and VCS links, tweak osmo-msc.install + * drop files unrelated to osmo-msc + * rename include/openbsc to include/osmocom/msc + * doc/examples: add detailed cs7 config examples + * use separated libosmo-mgcp-client, apply rename to mgcp_client_* + * ctrl: subscriber-list-active: list only attached subscribers + * debian: fix dependency to mgcp library + * main: remove cmdline args no longer available for osmo-msc + * vty: fix: missing default cmds at hlr node + * ctrl: remove unimplemented cmds subscriber-{modify,delete} + * fix build: remove obsolete header legacy_mgcp/mgcp.h + * fix debian: fix erratic doc/examples install path + * fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() + * fix vty tests: long timeout due to unreachable STP address + * cosmetic: vlr: declare a struct in .h; drop unused header + * add ';' after OSMO_ASSERT() + + [ Philipp Maier ] + * a_iface: fix memory leaks + * a_iface: fix typo + + [ Max ] + * Remove rest_octets.h + * Remove SI-related code + * Remove BTS-specific attributes + * Remove unused osmo_bsc_rf.h header + * Remove pkg-config file + + [ Harald Welte ] + * Update .gitignore for post-nitb-split + * remove further files and autotest/autoconf bits irrelevant to osmo-msc + * Rename osmo_fsm to avoid illegal space in name + more meaningful name + * Debian: remove obsolete Dependencies + * configure.ac: Depend on latest tagged/released libosmo-* versions + * Debian: Build with enabled SMPP support + * osmo-msc: Don't link against libasn1c + * Debian: Include systemd.service in package + * Debian: include all (not just one) example config files + + -- Harald Welte Sat, 28 Oct 2017 14:45:58 +0200 + osmo-msc (0.1.0) UNRELEASED; urgency=low * Initial release. -- To view, visit https://gerrit.osmocom.org/4525 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic24d937658e5b467c6643ae3cd54e5b6d9db3175 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:01:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:01:35 +0000 Subject: [PATCH] osmo-msc[master]: Debian: Add proper description for packages. Message-ID: Review at https://gerrit.osmocom.org/4526 Debian: Add proper description for packages. Change-Id: I6cf4a6d84048e68abd7323387766acb674fd345c --- M debian/control 1 file changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/26/4526/1 diff --git a/debian/control b/debian/control index 722a1bc..4f0aafb 100644 --- a/debian/control +++ b/debian/control @@ -30,6 +30,16 @@ Multi-Arch: foreign Depends: ${misc:Depends}, ${shlibs:Depends} Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks + The Mobile Switching Center (MSC) is the heart of 2G/3G + circuit-switched services. It terminates the A-interface links from the + Base Station Controllers (BSC) and handles the MM and CC sub-layers of + the Layer 3 protocol from the phones (MS). + . + This Osmocom implementation of the MSC handles A interfaces via 3GPP + AoIP in an ASP role. It furthermore implements IETF MGCP against an + external media gateway, such as OsmoMGW. It does *not* implement MAP + towards a HLR, but the much simpler Osmocom GSUP protocol, which can + be translated to MAP if needed. Package: osmo-msc-dbg Section: debug @@ -37,3 +47,16 @@ Multi-Arch: same Depends: osmo-msc (= ${binary:Version}), ${misc:Depends} Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks + The Mobile Switching Center (MSC) is the heart of 2G/3G + circuit-switched services. It terminates the A-interface links from the + Base Station Controllers (BSC) and handles the MM and CC sub-layers of + the Layer 3 protocol from the phones (MS). + . + This Osmocom implementation of the MSC handles A interfaces via 3GPP + AoIP in an ASP role. It furthermore implements IETF MGCP against an + external media gateway, such as OsmoMGW. It does *not* implement MAP + towards a HLR, but the much simpler Osmocom GSUP protocol, which can + be translated to MAP if needed. + . + This package contains the debug symbols for osmo-mgw in order to + generate meaningful backtraces in bug-reports. -- To view, visit https://gerrit.osmocom.org/4526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6cf4a6d84048e68abd7323387766acb674fd345c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:17:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:17:58 +0000 Subject: [PATCH] osmo-msc[master]: configure.ac: Depend on latest tagged/released libosmo-* ver... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4520 to look at the new patch set (#3). configure.ac: Depend on latest tagged/released libosmo-* versions This is the safe choice, as in absence of automatic testing we don't know if we actually still build against the [sometimes] ancient dependencies. Would be great to automatize this, but until we have that, better be safe. Change-Id: Idf5cad1dc17a5136d00c970c326cdf3b7ee18e3c --- M configure.ac 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/4520/3 diff --git a/configure.ac b/configure.ac index 64fead8..86bb870 100644 --- a/configure.ac +++ b/configure.ac @@ -39,15 +39,15 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0) PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.1.0) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], @@ -63,8 +63,8 @@ AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) if test "x$osmo_ac_iu" = "xyes" ; then - PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? - PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? + PKG_CHECK_MODULES(LIBASN1C, libasn1c >= 0.9.28) + PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap >= 0.2.0) AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) fi AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes") -- To view, visit https://gerrit.osmocom.org/4520 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idf5cad1dc17a5136d00c970c326cdf3b7ee18e3c Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:17:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:17:58 +0000 Subject: [PATCH] osmo-msc[master]: Debian: Build with enabled SMPP support In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4521 to look at the new patch set (#3). Debian: Build with enabled SMPP support Change-Id: Ibab5ede36cf329620a66b7811c43cc73c7135ecd --- M debian/control M debian/rules 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/21/4521/3 diff --git a/debian/control b/debian/control index f6ea826..722a1bc 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,7 @@ libdbi-dev, libtalloc-dev, libssl-dev, + libsmpp34-dev, libasn1c-dev, libosmocore-dev, libosmo-sccp-dev, diff --git a/debian/rules b/debian/rules index 277d7a4..15e79da 100755 --- a/debian/rules +++ b/debian/rules @@ -46,7 +46,7 @@ # debmake generated override targets # Set options for ./configure -CONFIGURE_FLAGS += --enable-iu +CONFIGURE_FLAGS += --enable-iu --enable-smpp override_dh_auto_configure: dh_auto_configure -- $(CONFIGURE_FLAGS) # -- To view, visit https://gerrit.osmocom.org/4521 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibab5ede36cf329620a66b7811c43cc73c7135ecd Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:17:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:17:58 +0000 Subject: [PATCH] osmo-msc[master]: osmo-msc: Don't link against libasn1c In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4522 to look at the new patch set (#3). osmo-msc: Don't link against libasn1c osmo-msc doesn't use any API/symbols of libasn1c directlry. Rather, we use libosmo-ranap which in turn uses libasn1c. Let the linker work out that dependency. This fixes the following dpkg-shlibdeps warning: Change-Id: I2f840884d8f1cc542de1e26acd3d4215bd2fd899 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-msc/usr/bin/osmo-msc was not linked against libasn1c.so.0 (it uses none of the library's symbols) --- M src/osmo-msc/Makefile.am M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am 3 files changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/22/4522/3 diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index 85a5a5a..e296f97 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -51,6 +51,5 @@ if BUILD_IU osmo_msc_LDADD += \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(NULL) endif diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index aa2b3fe..9af9870 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -43,7 +43,6 @@ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index 1f8ee7b..a912be1 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -43,7 +43,6 @@ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -- To view, visit https://gerrit.osmocom.org/4522 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2f840884d8f1cc542de1e26acd3d4215bd2fd899 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:17:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:17:58 +0000 Subject: [PATCH] osmo-msc[master]: Debian: Include systemd.service in package In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4523 to look at the new patch set (#3). Debian: Include systemd.service in package Change-Id: Iee768a0e812db782f3e23c5a1454e141eee08a74 --- A debian/osmo-msc.service 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/23/4523/3 diff --git a/debian/osmo-msc.service b/debian/osmo-msc.service new file mode 120000 index 0000000..784b8b5 --- /dev/null +++ b/debian/osmo-msc.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-msc.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4523 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iee768a0e812db782f3e23c5a1454e141eee08a74 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:17:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:17:58 +0000 Subject: [PATCH] osmo-msc[master]: Debian: include all (not just one) example config files In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4524 to look at the new patch set (#3). Debian: include all (not just one) example config files Change-Id: I19ac23898e9543081a1407da9af63ed643791d6e --- M debian/osmo-msc.install 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/24/4524/3 diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install index 3e289b2..b3d1a55 100644 --- a/debian/osmo-msc.install +++ b/debian/osmo-msc.install @@ -1,2 +1,2 @@ usr/bin/osmo-msc -usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc.cfg +usr/share/doc/osmo-msc/examples/osmo-msc -- To view, visit https://gerrit.osmocom.org/4524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I19ac23898e9543081a1407da9af63ed643791d6e Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:17:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:17:58 +0000 Subject: [PATCH] osmo-msc[master]: Tag/Release Version 1.1.0 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4525 to look at the new patch set (#4). Tag/Release Version 1.1.0 [ Alexander Couzens ] * debian/rules: show testsuite.log when tests are failing [ Neels Hofmeyr ] * build: check for -lgsm * am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars * jenkins: fix build: osmo-mgw from master, not pre_release * jenkins: drop unused build matrix vars, always --enable-smpp * configure.ac: fix to "AC_INIT[osmo-msc]" * rewrite README * rename openbsc.pc to osmo-msc.pc * debian: fix web and VCS links, tweak osmo-msc.install * drop files unrelated to osmo-msc * rename include/openbsc to include/osmocom/msc * doc/examples: add detailed cs7 config examples * use separated libosmo-mgcp-client, apply rename to mgcp_client_* * ctrl: subscriber-list-active: list only attached subscribers * debian: fix dependency to mgcp library * main: remove cmdline args no longer available for osmo-msc * vty: fix: missing default cmds at hlr node * ctrl: remove unimplemented cmds subscriber-{modify,delete} * fix build: remove obsolete header legacy_mgcp/mgcp.h * fix debian: fix erratic doc/examples install path * fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() * fix vty tests: long timeout due to unreachable STP address * cosmetic: vlr: declare a struct in .h; drop unused header * add ';' after OSMO_ASSERT() [ Philipp Maier ] * a_iface: fix memory leaks * a_iface: fix typo [ Max ] * Remove rest_octets.h * Remove SI-related code * Remove BTS-specific attributes * Remove unused osmo_bsc_rf.h header * Remove pkg-config file [ Harald Welte ] * Update .gitignore for post-nitb-split * remove further files and autotest/autoconf bits irrelevant to osmo-msc * Rename osmo_fsm to avoid illegal space in name + more meaningful name * Debian: remove obsolete Dependencies * configure.ac: Depend on latest tagged/released libosmo-* versions * Debian: Build with enabled SMPP support * osmo-msc: Don't link against libasn1c * Debian: Include systemd.service in package * Debian: include all (not just one) example config files Change-Id: Ic24d937658e5b467c6643ae3cd54e5b6d9db3175 --- M debian/changelog 1 file changed, 55 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/25/4525/4 diff --git a/debian/changelog b/debian/changelog index a1b3dda..cdb0430 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,58 @@ +osmo-msc (1.1.0) unstable; urgency=medium + + [ Alexander Couzens ] + * Initial release. + * debian/rules: show testsuite.log when tests are failing + + [ Neels Hofmeyr ] + * build: check for -lgsm + * am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars + * jenkins: fix build: osmo-mgw from master, not pre_release + * jenkins: drop unused build matrix vars, always --enable-smpp + * configure.ac: fix to "AC_INIT[osmo-msc]" + * rewrite README + * rename openbsc.pc to osmo-msc.pc + * debian: fix web and VCS links, tweak osmo-msc.install + * drop files unrelated to osmo-msc + * rename include/openbsc to include/osmocom/msc + * doc/examples: add detailed cs7 config examples + * use separated libosmo-mgcp-client, apply rename to mgcp_client_* + * ctrl: subscriber-list-active: list only attached subscribers + * debian: fix dependency to mgcp library + * main: remove cmdline args no longer available for osmo-msc + * vty: fix: missing default cmds at hlr node + * ctrl: remove unimplemented cmds subscriber-{modify,delete} + * fix build: remove obsolete header legacy_mgcp/mgcp.h + * fix debian: fix erratic doc/examples install path + * fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() + * fix vty tests: long timeout due to unreachable STP address + * cosmetic: vlr: declare a struct in .h; drop unused header + * add ';' after OSMO_ASSERT() + + [ Philipp Maier ] + * a_iface: fix memory leaks + * a_iface: fix typo + + [ Max ] + * Remove rest_octets.h + * Remove SI-related code + * Remove BTS-specific attributes + * Remove unused osmo_bsc_rf.h header + * Remove pkg-config file + + [ Harald Welte ] + * Update .gitignore for post-nitb-split + * remove further files and autotest/autoconf bits irrelevant to osmo-msc + * Rename osmo_fsm to avoid illegal space in name + more meaningful name + * Debian: remove obsolete Dependencies + * configure.ac: Depend on latest tagged/released libosmo-* versions + * Debian: Build with enabled SMPP support + * osmo-msc: Don't link against libasn1c + * Debian: Include systemd.service in package + * Debian: include all (not just one) example config files + + -- Harald Welte Sat, 28 Oct 2017 14:45:58 +0200 + osmo-msc (0.1.0) UNRELEASED; urgency=low * Initial release. -- To view, visit https://gerrit.osmocom.org/4525 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic24d937658e5b467c6643ae3cd54e5b6d9db3175 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:17:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:17:58 +0000 Subject: [PATCH] osmo-msc[master]: Debian: Add proper description for packages. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4526 to look at the new patch set (#2). Debian: Add proper description for packages. Change-Id: I6cf4a6d84048e68abd7323387766acb674fd345c --- M debian/control 1 file changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/26/4526/2 diff --git a/debian/control b/debian/control index 722a1bc..4f0aafb 100644 --- a/debian/control +++ b/debian/control @@ -30,6 +30,16 @@ Multi-Arch: foreign Depends: ${misc:Depends}, ${shlibs:Depends} Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks + The Mobile Switching Center (MSC) is the heart of 2G/3G + circuit-switched services. It terminates the A-interface links from the + Base Station Controllers (BSC) and handles the MM and CC sub-layers of + the Layer 3 protocol from the phones (MS). + . + This Osmocom implementation of the MSC handles A interfaces via 3GPP + AoIP in an ASP role. It furthermore implements IETF MGCP against an + external media gateway, such as OsmoMGW. It does *not* implement MAP + towards a HLR, but the much simpler Osmocom GSUP protocol, which can + be translated to MAP if needed. Package: osmo-msc-dbg Section: debug @@ -37,3 +47,16 @@ Multi-Arch: same Depends: osmo-msc (= ${binary:Version}), ${misc:Depends} Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks + The Mobile Switching Center (MSC) is the heart of 2G/3G + circuit-switched services. It terminates the A-interface links from the + Base Station Controllers (BSC) and handles the MM and CC sub-layers of + the Layer 3 protocol from the phones (MS). + . + This Osmocom implementation of the MSC handles A interfaces via 3GPP + AoIP in an ASP role. It furthermore implements IETF MGCP against an + external media gateway, such as OsmoMGW. It does *not* implement MAP + towards a HLR, but the much simpler Osmocom GSUP protocol, which can + be translated to MAP if needed. + . + This package contains the debug symbols for osmo-mgw in order to + generate meaningful backtraces in bug-reports. -- To view, visit https://gerrit.osmocom.org/4526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6cf4a6d84048e68abd7323387766acb674fd345c Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:36 +0000 Subject: osmo-msc[master]: configure.ac: Depend on latest tagged/released libosmo-* ver... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4520 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf5cad1dc17a5136d00c970c326cdf3b7ee18e3c Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:38 +0000 Subject: osmo-msc[master]: Debian: Build with enabled SMPP support In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4521 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibab5ede36cf329620a66b7811c43cc73c7135ecd Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:40 +0000 Subject: osmo-msc[master]: osmo-msc: Don't link against libasn1c In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4522 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2f840884d8f1cc542de1e26acd3d4215bd2fd899 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:42 +0000 Subject: osmo-msc[master]: Debian: Include systemd.service in package In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4523 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee768a0e812db782f3e23c5a1454e141eee08a74 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:43 +0000 Subject: osmo-msc[master]: Debian: include all (not just one) example config files In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I19ac23898e9543081a1407da9af63ed643791d6e Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:45 +0000 Subject: osmo-msc[master]: Debian: Add proper description for packages. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6cf4a6d84048e68abd7323387766acb674fd345c Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:47 +0000 Subject: osmo-msc[master]: Tag/Release Version 1.1.0 In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4525 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic24d937658e5b467c6643ae3cd54e5b6d9db3175 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:48 +0000 Subject: [MERGED] osmo-msc[master]: Tag/Release Version 1.1.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release Version 1.1.0 ...................................................................... Tag/Release Version 1.1.0 [ Alexander Couzens ] * debian/rules: show testsuite.log when tests are failing [ Neels Hofmeyr ] * build: check for -lgsm * am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars * jenkins: fix build: osmo-mgw from master, not pre_release * jenkins: drop unused build matrix vars, always --enable-smpp * configure.ac: fix to "AC_INIT[osmo-msc]" * rewrite README * rename openbsc.pc to osmo-msc.pc * debian: fix web and VCS links, tweak osmo-msc.install * drop files unrelated to osmo-msc * rename include/openbsc to include/osmocom/msc * doc/examples: add detailed cs7 config examples * use separated libosmo-mgcp-client, apply rename to mgcp_client_* * ctrl: subscriber-list-active: list only attached subscribers * debian: fix dependency to mgcp library * main: remove cmdline args no longer available for osmo-msc * vty: fix: missing default cmds at hlr node * ctrl: remove unimplemented cmds subscriber-{modify,delete} * fix build: remove obsolete header legacy_mgcp/mgcp.h * fix debian: fix erratic doc/examples install path * fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() * fix vty tests: long timeout due to unreachable STP address * cosmetic: vlr: declare a struct in .h; drop unused header * add ';' after OSMO_ASSERT() [ Philipp Maier ] * a_iface: fix memory leaks * a_iface: fix typo [ Max ] * Remove rest_octets.h * Remove SI-related code * Remove BTS-specific attributes * Remove unused osmo_bsc_rf.h header * Remove pkg-config file [ Harald Welte ] * Update .gitignore for post-nitb-split * remove further files and autotest/autoconf bits irrelevant to osmo-msc * Rename osmo_fsm to avoid illegal space in name + more meaningful name * Debian: remove obsolete Dependencies * configure.ac: Depend on latest tagged/released libosmo-* versions * Debian: Build with enabled SMPP support * osmo-msc: Don't link against libasn1c * Debian: Include systemd.service in package * Debian: include all (not just one) example config files Change-Id: Ic24d937658e5b467c6643ae3cd54e5b6d9db3175 --- M debian/changelog 1 file changed, 55 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index a1b3dda..cdb0430 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,58 @@ +osmo-msc (1.1.0) unstable; urgency=medium + + [ Alexander Couzens ] + * Initial release. + * debian/rules: show testsuite.log when tests are failing + + [ Neels Hofmeyr ] + * build: check for -lgsm + * am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars + * jenkins: fix build: osmo-mgw from master, not pre_release + * jenkins: drop unused build matrix vars, always --enable-smpp + * configure.ac: fix to "AC_INIT[osmo-msc]" + * rewrite README + * rename openbsc.pc to osmo-msc.pc + * debian: fix web and VCS links, tweak osmo-msc.install + * drop files unrelated to osmo-msc + * rename include/openbsc to include/osmocom/msc + * doc/examples: add detailed cs7 config examples + * use separated libosmo-mgcp-client, apply rename to mgcp_client_* + * ctrl: subscriber-list-active: list only attached subscribers + * debian: fix dependency to mgcp library + * main: remove cmdline args no longer available for osmo-msc + * vty: fix: missing default cmds at hlr node + * ctrl: remove unimplemented cmds subscriber-{modify,delete} + * fix build: remove obsolete header legacy_mgcp/mgcp.h + * fix debian: fix erratic doc/examples install path + * fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() + * fix vty tests: long timeout due to unreachable STP address + * cosmetic: vlr: declare a struct in .h; drop unused header + * add ';' after OSMO_ASSERT() + + [ Philipp Maier ] + * a_iface: fix memory leaks + * a_iface: fix typo + + [ Max ] + * Remove rest_octets.h + * Remove SI-related code + * Remove BTS-specific attributes + * Remove unused osmo_bsc_rf.h header + * Remove pkg-config file + + [ Harald Welte ] + * Update .gitignore for post-nitb-split + * remove further files and autotest/autoconf bits irrelevant to osmo-msc + * Rename osmo_fsm to avoid illegal space in name + more meaningful name + * Debian: remove obsolete Dependencies + * configure.ac: Depend on latest tagged/released libosmo-* versions + * Debian: Build with enabled SMPP support + * osmo-msc: Don't link against libasn1c + * Debian: Include systemd.service in package + * Debian: include all (not just one) example config files + + -- Harald Welte Sat, 28 Oct 2017 14:45:58 +0200 + osmo-msc (0.1.0) UNRELEASED; urgency=low * Initial release. -- To view, visit https://gerrit.osmocom.org/4525 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic24d937658e5b467c6643ae3cd54e5b6d9db3175 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:49 +0000 Subject: [MERGED] osmo-msc[master]: Debian: Add proper description for packages. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Add proper description for packages. ...................................................................... Debian: Add proper description for packages. Change-Id: I6cf4a6d84048e68abd7323387766acb674fd345c --- M debian/control 1 file changed, 23 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 722a1bc..4f0aafb 100644 --- a/debian/control +++ b/debian/control @@ -30,6 +30,16 @@ Multi-Arch: foreign Depends: ${misc:Depends}, ${shlibs:Depends} Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks + The Mobile Switching Center (MSC) is the heart of 2G/3G + circuit-switched services. It terminates the A-interface links from the + Base Station Controllers (BSC) and handles the MM and CC sub-layers of + the Layer 3 protocol from the phones (MS). + . + This Osmocom implementation of the MSC handles A interfaces via 3GPP + AoIP in an ASP role. It furthermore implements IETF MGCP against an + external media gateway, such as OsmoMGW. It does *not* implement MAP + towards a HLR, but the much simpler Osmocom GSUP protocol, which can + be translated to MAP if needed. Package: osmo-msc-dbg Section: debug @@ -37,3 +47,16 @@ Multi-Arch: same Depends: osmo-msc (= ${binary:Version}), ${misc:Depends} Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks + The Mobile Switching Center (MSC) is the heart of 2G/3G + circuit-switched services. It terminates the A-interface links from the + Base Station Controllers (BSC) and handles the MM and CC sub-layers of + the Layer 3 protocol from the phones (MS). + . + This Osmocom implementation of the MSC handles A interfaces via 3GPP + AoIP in an ASP role. It furthermore implements IETF MGCP against an + external media gateway, such as OsmoMGW. It does *not* implement MAP + towards a HLR, but the much simpler Osmocom GSUP protocol, which can + be translated to MAP if needed. + . + This package contains the debug symbols for osmo-mgw in order to + generate meaningful backtraces in bug-reports. -- To view, visit https://gerrit.osmocom.org/4526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6cf4a6d84048e68abd7323387766acb674fd345c Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:49 +0000 Subject: [MERGED] osmo-msc[master]: Debian: include all (not just one) example config files In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: include all (not just one) example config files ...................................................................... Debian: include all (not just one) example config files Change-Id: I19ac23898e9543081a1407da9af63ed643791d6e --- M debian/osmo-msc.install 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install index 3e289b2..b3d1a55 100644 --- a/debian/osmo-msc.install +++ b/debian/osmo-msc.install @@ -1,2 +1,2 @@ usr/bin/osmo-msc -usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc.cfg +usr/share/doc/osmo-msc/examples/osmo-msc -- To view, visit https://gerrit.osmocom.org/4524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I19ac23898e9543081a1407da9af63ed643791d6e Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:49 +0000 Subject: [MERGED] osmo-msc[master]: Debian: Include systemd.service in package In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Include systemd.service in package ...................................................................... Debian: Include systemd.service in package Change-Id: Iee768a0e812db782f3e23c5a1454e141eee08a74 --- A debian/osmo-msc.service 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-msc.service b/debian/osmo-msc.service new file mode 120000 index 0000000..784b8b5 --- /dev/null +++ b/debian/osmo-msc.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-msc.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4523 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iee768a0e812db782f3e23c5a1454e141eee08a74 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:49 +0000 Subject: [MERGED] osmo-msc[master]: osmo-msc: Don't link against libasn1c In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-msc: Don't link against libasn1c ...................................................................... osmo-msc: Don't link against libasn1c osmo-msc doesn't use any API/symbols of libasn1c directlry. Rather, we use libosmo-ranap which in turn uses libasn1c. Let the linker work out that dependency. This fixes the following dpkg-shlibdeps warning: Change-Id: I2f840884d8f1cc542de1e26acd3d4215bd2fd899 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-msc/usr/bin/osmo-msc was not linked against libasn1c.so.0 (it uses none of the library's symbols) --- M src/osmo-msc/Makefile.am M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am 3 files changed, 0 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index 85a5a5a..e296f97 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -51,6 +51,5 @@ if BUILD_IU osmo_msc_LDADD += \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(NULL) endif diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index aa2b3fe..9af9870 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -43,7 +43,6 @@ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index 1f8ee7b..a912be1 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -43,7 +43,6 @@ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -- To view, visit https://gerrit.osmocom.org/4522 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2f840884d8f1cc542de1e26acd3d4215bd2fd899 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:50 +0000 Subject: [MERGED] osmo-msc[master]: Debian: Build with enabled SMPP support In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Build with enabled SMPP support ...................................................................... Debian: Build with enabled SMPP support Change-Id: Ibab5ede36cf329620a66b7811c43cc73c7135ecd --- M debian/control M debian/rules 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index f6ea826..722a1bc 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,7 @@ libdbi-dev, libtalloc-dev, libssl-dev, + libsmpp34-dev, libasn1c-dev, libosmocore-dev, libosmo-sccp-dev, diff --git a/debian/rules b/debian/rules index 277d7a4..15e79da 100755 --- a/debian/rules +++ b/debian/rules @@ -46,7 +46,7 @@ # debmake generated override targets # Set options for ./configure -CONFIGURE_FLAGS += --enable-iu +CONFIGURE_FLAGS += --enable-iu --enable-smpp override_dh_auto_configure: dh_auto_configure -- $(CONFIGURE_FLAGS) # -- To view, visit https://gerrit.osmocom.org/4521 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibab5ede36cf329620a66b7811c43cc73c7135ecd Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:50 +0000 Subject: [MERGED] osmo-msc[master]: configure.ac: Depend on latest tagged/released libosmo-* ver... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Depend on latest tagged/released libosmo-* versions ...................................................................... configure.ac: Depend on latest tagged/released libosmo-* versions This is the safe choice, as in absence of automatic testing we don't know if we actually still build against the [sometimes] ancient dependencies. Would be great to automatize this, but until we have that, better be safe. Change-Id: Idf5cad1dc17a5136d00c970c326cdf3b7ee18e3c --- M configure.ac 1 file changed, 9 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 64fead8..86bb870 100644 --- a/configure.ac +++ b/configure.ac @@ -39,15 +39,15 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0) PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.1.0) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], @@ -63,8 +63,8 @@ AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) if test "x$osmo_ac_iu" = "xyes" ; then - PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? - PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? + PKG_CHECK_MODULES(LIBASN1C, libasn1c >= 0.9.28) + PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap >= 0.2.0) AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) fi AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes") -- To view, visit https://gerrit.osmocom.org/4520 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idf5cad1dc17a5136d00c970c326cdf3b7ee18e3c Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 13:30:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 13:30:50 +0000 Subject: [MERGED] osmo-msc[master]: Debian: remove obsolete Dependencies In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: remove obsolete Dependencies ...................................................................... Debian: remove obsolete Dependencies libgtp and c-ares are GRPS dependencies; we don't have GPRS in MSC Change-Id: Ie7fb8a9417d9024e3da0e8547679f7b696c79a9f --- M debian/control 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index ce51a7d..f6ea826 100644 --- a/debian/control +++ b/debian/control @@ -12,10 +12,7 @@ libdbi-dev, libtalloc-dev, libssl-dev, - libc-ares-dev, - libgtp-dev, libasn1c-dev, - libc-ares-dev, libosmocore-dev, libosmo-sccp-dev, libosmo-abis-dev, -- To view, visit https://gerrit.osmocom.org/4519 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7fb8a9417d9024e3da0e8547679f7b696c79a9f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:07:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:07:54 +0000 Subject: [MERGED] osmo-sip-connector[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I7e9f19755f55b274def9d757f72f2a08a01a4cce --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2999120..a2f7ee9 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -7,8 +7,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore @@ -32,3 +33,5 @@ || cat-testlogs.sh $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4488 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7e9f19755f55b274def9d757f72f2a08a01a4cce Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:07:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:07:57 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: Iaf8338d0d061c70f7ab3737dc425784dc7c170a4 --- M contrib/jenkins.sh 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 14af8cc..290fc62 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -4,6 +4,9 @@ base="$PWD" deps="$base/deps" +export deps + +osmo-clean-workspace.sh mkdir "$deps" || true @@ -13,3 +16,5 @@ cd "$base" $MAKE $PARALLEL_MAKE LIBOSMO_DIR="$deps/libosmocore" $MAKE $PARALLEL_MAKE LIBOSMO_DIR="$deps/libosmocore" check + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4478 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaf8338d0d061c70f7ab3737dc425784dc7c170a4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:01 +0000 Subject: [MERGED] osmo-sgsn[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I7c3ecd83899f873bdc771ff7445740fea15900ef --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 140fc63..fa7c60e 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false @@ -53,3 +54,5 @@ DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4487 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7c3ecd83899f873bdc771ff7445740fea15900ef Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:04 +0000 Subject: [MERGED] osmo-mgw[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I5a64b305dff5387cbe2462b564051f807061086d --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 22b962e..44152dc 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,9 +14,9 @@ inst="$deps/install" export deps inst -mkdir "$deps" || true -rm -rf "$inst" +osmo-clean-workspace.sh +mkdir "$deps" || true osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -45,3 +45,5 @@ DISTCHECK_CONFIGURE_FLAGS="$MGCP --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4485 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5a64b305dff5387cbe2462b564051f807061086d Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:08 +0000 Subject: [MERGED] libosmo-abis[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I2f4c0a6b9a066160707eb7768ea9cc8b77806b9b --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6ff44ee..ff83984 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -13,8 +13,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -36,3 +37,5 @@ $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4473 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2f4c0a6b9a066160707eb7768ea9cc8b77806b9b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:14 +0000 Subject: [MERGED] libosmocore[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I99fdd20e7b18c2f4a59a9db35e5efccca6546b77 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh M contrib/jenkins_common.sh 3 files changed, 8 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index ef116b1..acdbe3c 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -24,3 +24,5 @@ build builddir # verify build in source tree build . + +osmo-clean-workspace.sh diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index d731504..5798c95 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -29,3 +29,5 @@ # is well separated from the source tree state. $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index bc4ac65..a6ffe7f 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -8,6 +8,8 @@ exit 1 fi +osmo-clean-workspace.sh + verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") prep_build() { @@ -16,11 +18,8 @@ cd "$_src_dir" - # a failed 'make distcheck' may leave files without write permissions - chmod -R a+w . - git clean -dxf - # make absolutely sure no src files have modifications - git checkout -f HEAD + # clean again before each build variant + osmo-clean-workspace.sh autoreconf --install --force -- To view, visit https://gerrit.osmocom.org/4470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I99fdd20e7b18c2f4a59a9db35e5efccca6546b77 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:18 +0000 Subject: [MERGED] osmo-ggsn[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I1424dff06c7d4f695af0936671ad6faa504aaf16 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 3bfb3f5..b2f8452 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false @@ -37,3 +38,5 @@ ./configure $MAKE $PARALLEL_MAKE $MAKE distcheck + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4482 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1424dff06c7d4f695af0936671ad6faa504aaf16 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:21 +0000 Subject: [MERGED] libosmo-sccp[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I6e3a24a32b8e06d89ac11b59bca052d56f00c78c --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index ae850ed..adc5db7 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -39,3 +40,5 @@ $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4475 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e3a24a32b8e06d89ac11b59bca052d56f00c78c Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:24 +0000 Subject: [MERGED] osmo-msc[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I6ae80147b2624079b5c364dbce08194215cc4e95 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 284679d..e39123c 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false @@ -55,3 +56,5 @@ DISTCHECK_CONFIGURE_FLAGS="--enable-smpp $IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ae80147b2624079b5c364dbce08194215cc4e95 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:27 +0000 Subject: [MERGED] osmo-bsc[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I9b6afb59f0a8037d1510a7fddb63927f10d653e5 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index eb302d1..57954f0 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false @@ -47,3 +48,5 @@ DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4480 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b6afb59f0a8037d1510a7fddb63927f10d653e5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:33 +0000 Subject: [MERGED] openbsc[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: Ibafac7c8a48f46237835e91c80e72543c6841d08 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 61b27be..5bab5bf 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,5 +1,7 @@ #!/bin/sh -ex +osmo-clean-workspace.sh + artifact_deps() { x="$($1 libosmocore)" @@ -56,3 +58,5 @@ fi . osmo-build.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4479 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibafac7c8a48f46237835e91c80e72543c6841d08 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:36 +0000 Subject: [MERGED] osmo-bts[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I830b17462b636e0bf03f4d88000660409503c3e5 --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_common.sh M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 6 files changed, 12 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 47ccde3..9a181f2 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -22,3 +22,5 @@ " build_bts "osmo-bts-trx" "$configure_flags" + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index d4c3b1a..cc1b5b3 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -17,8 +17,9 @@ export deps inst +osmo-clean-workspace.sh + mkdir -p "$deps" -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index 314d85c..feef302 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -17,3 +17,5 @@ configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" build_bts "osmo-bts-lc15" "$configure_flags" + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 8a351c5..1e139af 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -17,3 +17,5 @@ configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" build_bts "osmo-bts-octphy" "$configure_flags" + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 964fb94..ac8ef6d 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -26,3 +26,5 @@ " build_bts "osmo-bts-octphy+trx" "$configure_flags" + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index ca12e76..d7caf0f 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -24,3 +24,5 @@ if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then $MAKE -C contrib/sysmobts-calib fi + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4481 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I830b17462b636e0bf03f4d88000660409503c3e5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:39 +0000 Subject: [MERGED] osmo-iuh[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I7261e006163eda4bee8a4695fbd5bd29307babe6 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index cda0e2c..01e3da2 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -7,8 +7,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -54,3 +55,5 @@ || cat-testlogs.sh $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4484 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7261e006163eda4bee8a4695fbd5bd29307babe6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:43 +0000 Subject: [MERGED] osmo-hlr[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I9d35913f9cd60ff121d29f357919a0b0d62d6835 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b08c63b..d159db9 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -41,3 +42,5 @@ $MAKE check || cat-testlogs.sh $MAKE distcheck || cat-testlogs.sh fi + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4483 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9d35913f9cd60ff121d29f357919a0b0d62d6835 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:08:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:08:45 +0000 Subject: [MERGED] libosmo-netif[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I6bdbd22b5f05ab75de2c6c777667bf1a63eb0b86 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 3e35a46..3fb014b 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -14,8 +14,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -38,3 +39,5 @@ $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4474 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6bdbd22b5f05ab75de2c6c777667bf1a63eb0b86 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:09:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:09:05 +0000 Subject: [MERGED] libasn1c[master]: fix compiler warning: drop dead code from BIT_STRING_fromBuf() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix compiler warning: drop dead code from BIT_STRING_fromBuf() ...................................................................... fix compiler warning: drop dead code from BIT_STRING_fromBuf() The warning is, on FreeBSD, CC asn1helpers.lo asn1helpers.c:68:10: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] if (len < 0) ~~~ ^ ~ Change-Id: I80867da697d744d7ef4d70c8f24031f5781fb11a --- M src/asn1helpers.c 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/asn1helpers.c b/src/asn1helpers.c index a4ced70..4e5e08d 100644 --- a/src/asn1helpers.c +++ b/src/asn1helpers.c @@ -65,9 +65,6 @@ return 0; } - if (len < 0) - len = strlen((char*)str); - buf = MALLOC(len); if (!buf) { errno = ENOMEM; -- To view, visit https://gerrit.osmocom.org/4492 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I80867da697d744d7ef4d70c8f24031f5781fb11a Gerrit-PatchSet: 2 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 15:27:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 15:27:55 +0000 Subject: [PATCH] osmo-bsc[master]: Debian: re-introduce missing build dependency to libssl-dev Message-ID: Review at https://gerrit.osmocom.org/4527 Debian: re-introduce missing build dependency to libssl-dev In Change-Id I469909ad7c597cde3d7a7d2ec86101a9f41d3aa6 we accidentially also removed the libssl-dev dependency. osmo-bsc_nat still uses RAND_getbytes directly, so we have to keep it for now, until we switch to a future libosmocore-based mechanism that's in the works. Change-Id: I3be26c566baf05278ba51b835a72e14ce6ecf3d0 --- M debian/control 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/27/4527/1 diff --git a/debian/control b/debian/control index 2c8eead..e3f1e02 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,7 @@ libtool, pkg-config, python-minimal, + libssl-dev, libtalloc-dev, libosmocore-dev, libosmo-sigtran-dev, -- To view, visit https://gerrit.osmocom.org/4527 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3be26c566baf05278ba51b835a72e14ce6ecf3d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:20:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:20:09 +0000 Subject: [PATCH] osmo-sip-connector[master]: Fix git-version-gen Message-ID: Review at https://gerrit.osmocom.org/4528 Fix git-version-gen It seems we didn't import a proper/clean git-version-gen into the repository. Let's fix this. Change-Id: I5132d10b3ed5a75e562cdd74db02eda68d828a08 --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/28/4528/1 diff --git a/git-version-gen b/git-version-gen index f2ad4a7..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./../.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/4528 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5132d10b3ed5a75e562cdd74db02eda68d828a08 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:20:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:20:09 +0000 Subject: [PATCH] osmo-sip-connector[master]: configure.ac: Depend on latest upstream libosmo-* Message-ID: Review at https://gerrit.osmocom.org/4529 configure.ac: Depend on latest upstream libosmo-* Change-Id: I9bb7ced1197effb1082a57b2ed060d94ab9648c8 --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/29/4529/1 diff --git a/configure.ac b/configure.ac index 35a75b9..88248d4 100644 --- a/configure.ac +++ b/configure.ac @@ -22,8 +22,8 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_PROG_CC -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.8.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) PKG_CHECK_MODULES(SOFIASIP, sofia-sip-ua-glib >= 1.12.0) AC_ARG_ENABLE([vty_tests], -- To view, visit https://gerrit.osmocom.org/4529 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9bb7ced1197effb1082a57b2ed060d94ab9648c8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:20:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:20:09 +0000 Subject: [PATCH] osmo-sip-connector[master]: Tag/Release Version 1.1.0 Message-ID: Review at https://gerrit.osmocom.org/4530 Tag/Release Version 1.1.0 Change-Id: Id3876b2d940b5612788760dfeabe308f43d42ae2 --- M debian/changelog 1 file changed, 61 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/30/4530/1 diff --git a/debian/changelog b/debian/changelog index b72a761..c71377b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,64 @@ +osmo-sip-connector (1.1.0) unstable; urgency=medium + + [ Holger Hans Peter Freyther ] + * coverity: Address two issues found by coverity + * debian: Add dh-autoreconf required by the debian packaging + * app/mncc: Add "use-imsi" to allow calling by IMSI + * mncc: Only copy 15 chars to leave the last one as NULL + * mncc: Have all release go through a local method + * mncc: Reject hold requests for now + * mncc: Use snprintf correctly create format specifier + * vty: Add simple VTY output for current calls + * vty: Fix the number of documented arguments + * sip/call/mncc: Move source/dest into the call structure + * vty: Add extended show calls command with all information + * mncc: Use strcpy for these routines and not memcpy + * vty: Add VTY command about the state of the mncc connection + * jenkins: Add first CI script for the SIP connector + * distcheck/tests: Add the referenced osmoappdesc.py for testing + * distcheck: Package the logging.h file as well + * jenkins: Try to enable the vty tests as well + * jenkins: Use separate check invocation tor un the tests + * jenkins: Make it find the libosmocore library as well + * sip: Start the application even if sofia-sip is broken + * sip: Treat SIP 183 as progress too + * evpoll: Use {} in the middle of the if/else if/else block + * evpoll: Always initialize revents for the output + * evpoll: Don't try to be more smart than g_poll + * contrib: Add Dockerfile to build and configure a FreeSWITCH + * call: Fix call release handling on mncc connection loss + * mncc: Fix use after free on mncc socket disconnection + * evpoll: Add workaround for usage of IP_RECVERR in sofia-sip + * dtmf: Start handling the DTMF MNCC messages and respond + * testpbx: Enable GSM and AMR as codecs to actually be relevant + * sip: Actually honor the remote port of the pbx + * testpbx: Add another number that will just play a ringback + * dtmf: Forward DTMF from MNCC to SIP + * mncc: Enable in-band signalling for early media + * mncc/sip: Attempt to parse the media from session in progress + + [ Neels Hofmeyr ] + * log VTY telnet bind only once + * build: be robust against install-sh files above the root dir + * configure: check for pkg-config presence + * jenkins.sh: use osmo-build-dep.sh, log test failures + * jenkins: add value_string termination check + * vty: install default commands for SIP,MNCC,APP_NODE + * jenkins: use osmo-clean-workspace.sh before and after build + + [ Max ] + * Add git review config + * Use release helper from libosmocore + * Fix build after recent libosmocore update + + [ Keith ] + * sdp.c Send octet-align in fmtp + + [ Harald Welte ] + * Fix git-version-gen + + -- Harald Welte Sat, 28 Oct 2017 18:14:38 +0200 + osmo-sip-connector (1) UNRELEASED; urgency=medium * Initial release. -- To view, visit https://gerrit.osmocom.org/4530 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id3876b2d940b5612788760dfeabe308f43d42ae2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:20:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:20:56 +0000 Subject: [MERGED] libasn1c[master]: jenkins: add missing set -e to catch build errors In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: add missing set -e to catch build errors ...................................................................... jenkins: add missing set -e to catch build errors Change-Id: I9f6b015b09c60c18d213dde5bbdcfc527096a10f --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index d9901e3..d4f98f3 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash # jenkins build helper script for libasn1c. This is how we build on jenkins.osmocom.org +set -e + set +x echo echo -- To view, visit https://gerrit.osmocom.org/4471 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9f6b015b09c60c18d213dde5bbdcfc527096a10f Gerrit-PatchSet: 4 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:21:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:21:13 +0000 Subject: osmo-sip-connector[master]: Fix git-version-gen In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4528 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5132d10b3ed5a75e562cdd74db02eda68d828a08 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:24:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:24:04 +0000 Subject: osmo-sip-connector[master]: configure.ac: Depend on latest upstream libosmo-* In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4529 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9bb7ced1197effb1082a57b2ed060d94ab9648c8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:24:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:24:06 +0000 Subject: osmo-sip-connector[master]: Tag/Release Version 1.1.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4530 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3876b2d940b5612788760dfeabe308f43d42ae2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:24:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:24:07 +0000 Subject: [MERGED] osmo-sip-connector[master]: Tag/Release Version 1.1.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release Version 1.1.0 ...................................................................... Tag/Release Version 1.1.0 Change-Id: Id3876b2d940b5612788760dfeabe308f43d42ae2 --- M debian/changelog 1 file changed, 61 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index b72a761..c71377b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,64 @@ +osmo-sip-connector (1.1.0) unstable; urgency=medium + + [ Holger Hans Peter Freyther ] + * coverity: Address two issues found by coverity + * debian: Add dh-autoreconf required by the debian packaging + * app/mncc: Add "use-imsi" to allow calling by IMSI + * mncc: Only copy 15 chars to leave the last one as NULL + * mncc: Have all release go through a local method + * mncc: Reject hold requests for now + * mncc: Use snprintf correctly create format specifier + * vty: Add simple VTY output for current calls + * vty: Fix the number of documented arguments + * sip/call/mncc: Move source/dest into the call structure + * vty: Add extended show calls command with all information + * mncc: Use strcpy for these routines and not memcpy + * vty: Add VTY command about the state of the mncc connection + * jenkins: Add first CI script for the SIP connector + * distcheck/tests: Add the referenced osmoappdesc.py for testing + * distcheck: Package the logging.h file as well + * jenkins: Try to enable the vty tests as well + * jenkins: Use separate check invocation tor un the tests + * jenkins: Make it find the libosmocore library as well + * sip: Start the application even if sofia-sip is broken + * sip: Treat SIP 183 as progress too + * evpoll: Use {} in the middle of the if/else if/else block + * evpoll: Always initialize revents for the output + * evpoll: Don't try to be more smart than g_poll + * contrib: Add Dockerfile to build and configure a FreeSWITCH + * call: Fix call release handling on mncc connection loss + * mncc: Fix use after free on mncc socket disconnection + * evpoll: Add workaround for usage of IP_RECVERR in sofia-sip + * dtmf: Start handling the DTMF MNCC messages and respond + * testpbx: Enable GSM and AMR as codecs to actually be relevant + * sip: Actually honor the remote port of the pbx + * testpbx: Add another number that will just play a ringback + * dtmf: Forward DTMF from MNCC to SIP + * mncc: Enable in-band signalling for early media + * mncc/sip: Attempt to parse the media from session in progress + + [ Neels Hofmeyr ] + * log VTY telnet bind only once + * build: be robust against install-sh files above the root dir + * configure: check for pkg-config presence + * jenkins.sh: use osmo-build-dep.sh, log test failures + * jenkins: add value_string termination check + * vty: install default commands for SIP,MNCC,APP_NODE + * jenkins: use osmo-clean-workspace.sh before and after build + + [ Max ] + * Add git review config + * Use release helper from libosmocore + * Fix build after recent libosmocore update + + [ Keith ] + * sdp.c Send octet-align in fmtp + + [ Harald Welte ] + * Fix git-version-gen + + -- Harald Welte Sat, 28 Oct 2017 18:14:38 +0200 + osmo-sip-connector (1) UNRELEASED; urgency=medium * Initial release. -- To view, visit https://gerrit.osmocom.org/4530 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id3876b2d940b5612788760dfeabe308f43d42ae2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:24:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:24:08 +0000 Subject: [MERGED] osmo-sip-connector[master]: configure.ac: Depend on latest upstream libosmo-* In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Depend on latest upstream libosmo-* ...................................................................... configure.ac: Depend on latest upstream libosmo-* Change-Id: I9bb7ced1197effb1082a57b2ed060d94ab9648c8 --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 35a75b9..88248d4 100644 --- a/configure.ac +++ b/configure.ac @@ -22,8 +22,8 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_PROG_CC -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.8.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) PKG_CHECK_MODULES(SOFIASIP, sofia-sip-ua-glib >= 1.12.0) AC_ARG_ENABLE([vty_tests], -- To view, visit https://gerrit.osmocom.org/4529 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9bb7ced1197effb1082a57b2ed060d94ab9648c8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:24:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:24:08 +0000 Subject: [MERGED] osmo-sip-connector[master]: Fix git-version-gen In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix git-version-gen ...................................................................... Fix git-version-gen It seems we didn't import a proper/clean git-version-gen into the repository. Let's fix this. Change-Id: I5132d10b3ed5a75e562cdd74db02eda68d828a08 --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/git-version-gen b/git-version-gen index f2ad4a7..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./../.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/4528 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5132d10b3ed5a75e562cdd74db02eda68d828a08 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:48:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:48:20 +0000 Subject: osmo-bsc[master]: Debian: re-introduce missing build dependency to libssl-dev In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4527 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3be26c566baf05278ba51b835a72e14ce6ecf3d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:48:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:48:22 +0000 Subject: [MERGED] osmo-bsc[master]: Debian: re-introduce missing build dependency to libssl-dev In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: re-introduce missing build dependency to libssl-dev ...................................................................... Debian: re-introduce missing build dependency to libssl-dev In Change-Id I469909ad7c597cde3d7a7d2ec86101a9f41d3aa6 we accidentially also removed the libssl-dev dependency. osmo-bsc_nat still uses RAND_getbytes directly, so we have to keep it for now, until we switch to a future libosmocore-based mechanism that's in the works. Change-Id: I3be26c566baf05278ba51b835a72e14ce6ecf3d0 --- M debian/control 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 2c8eead..e3f1e02 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,7 @@ libtool, pkg-config, python-minimal, + libssl-dev, libtalloc-dev, libosmocore-dev, libosmo-sigtran-dev, -- To view, visit https://gerrit.osmocom.org/4527 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3be26c566baf05278ba51b835a72e14ce6ecf3d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:48:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:48:32 +0000 Subject: [MERGED] libasn1c[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: If5d252dc679e47a8375361d0ff278b7b98768f26 --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index d4f98f3..5f31710 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -2,6 +2,7 @@ # jenkins build helper script for libasn1c. This is how we build on jenkins.osmocom.org set -e +osmo-clean-workspace.sh set +x echo @@ -16,3 +17,5 @@ $MAKE $PARALLEL_MAKE $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4472 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If5d252dc679e47a8375361d0ff278b7b98768f26 Gerrit-PatchSet: 4 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:48:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:48:37 +0000 Subject: [MERGED] libsmpp34[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I0030c8662fa87fb589582a3f6bde6ed53e8e3ef9 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 79d101e..6bf176a 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -2,8 +2,12 @@ set -ex +osmo-clean-workspace.sh + autoreconf --install --force ./configure $MAKE CFLAGS="-Werror" CPPFLAGS="-Werror" # currently broken $MAKE $PARALLEL_MAKE # currently broken $MAKE distcheck + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4477 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0030c8662fa87fb589582a3f6bde6ed53e8e3ef9 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:49:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:49:16 +0000 Subject: osmo-hlr[master]: fix default logging levels to NOTICE, not DEBUG In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4442 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic061e61c9625b49cef8bc2a2c0b936e262c22268 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:49:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:49:33 +0000 Subject: [MERGED] osmo-hlr[master]: cosmetic: rename SL3_TXT macro, use osmo_strlcpy() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: rename SL3_TXT macro, use osmo_strlcpy() ...................................................................... cosmetic: rename SL3_TXT macro, use osmo_strlcpy() Rename SL3_TXT to more accurate copy_sqlite3_text_to_buf(), and use osmo_strlcpy() instead of essentially dup'ing it. The macro will also be used by hlr_db_tool.c in upcoming patch. This patch prepares for a move to db.h. Change-Id: I1dadeddddcfe0109195c09c0e706201b0df009cc --- M src/db_hlr.c 1 file changed, 14 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db_hlr.c b/src/db_hlr.c index ef01428..bae9a5a 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -35,12 +35,15 @@ #define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) -#define SL3_TXT(x, stmt, idx) \ - do { \ - const char *_txt = (const char *) sqlite3_column_text(stmt, idx);\ - if (_txt) \ - strncpy(x, _txt, sizeof(x)); \ - x[sizeof(x)-1] = '\0'; \ +/*! Call sqlite3_column_text() and copy result to a char[]. + * \param[out] buf A char[] used as sizeof() arg(!) and osmo_strlcpy() target. + * \param[in] stmt An sqlite3_stmt*. + * \param[in] idx Index in stmt's returned columns. + */ +#define copy_sqlite3_text_to_buf(buf, stmt, idx) \ + do { \ + const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ + osmo_strlcpy(buf, _txt, sizeof(buf)); \ } while (0) /*! Add new subscriber record to the HLR database. @@ -410,12 +413,12 @@ /* obtain the various columns */ subscr->id = sqlite3_column_int64(stmt, 0); - SL3_TXT(subscr->imsi, stmt, 1); - SL3_TXT(subscr->msisdn, stmt, 2); + copy_sqlite3_text_to_buf(subscr->imsi, stmt, 1); + copy_sqlite3_text_to_buf(subscr->msisdn, stmt, 2); /* FIXME: These should all be BLOBs as they might contain NUL */ - SL3_TXT(subscr->vlr_number, stmt, 3); - SL3_TXT(subscr->sgsn_number, stmt, 4); - SL3_TXT(subscr->sgsn_address, stmt, 5); + copy_sqlite3_text_to_buf(subscr->vlr_number, stmt, 3); + copy_sqlite3_text_to_buf(subscr->sgsn_number, stmt, 4); + copy_sqlite3_text_to_buf(subscr->sgsn_address, stmt, 5); subscr->periodic_lu_timer = sqlite3_column_int(stmt, 6); subscr->periodic_rau_tau_timer = sqlite3_column_int(stmt, 7); subscr->nam_cs = sqlite3_column_int(stmt, 8); -- To view, visit https://gerrit.osmocom.org/4440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1dadeddddcfe0109195c09c0e706201b0df009cc Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:49:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:49:33 +0000 Subject: [MERGED] osmo-hlr[master]: cosmetic: sql/hlr.sql: move comments In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: sql/hlr.sql: move comments ...................................................................... cosmetic: sql/hlr.sql: move comments By moving the comments inside the table row definitions, they are dumped back during 'sqlite3 hlr.db .dump'. When they are between SQL statements like before this patch, the comments are lost. Tweak wording. Change-Id: I280c2e2d3e9b7f1dc632722724d9e1c54d041820 --- M sql/hlr.sql 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sql/hlr.sql b/sql/hlr.sql index 696cf1c..80eb3e5 100644 --- a/sql/hlr.sql +++ b/sql/hlr.sql @@ -1,6 +1,5 @@ ---modelled roughly after TS 23.008 version 13.3.0 - CREATE TABLE IF NOT EXISTS subscriber ( +-- OsmoHLR's DB scheme is modelled roughly after TS 23.008 version 13.3.0 id INTEGER PRIMARY KEY, -- Chapter 2.1.1.1 imsi VARCHAR(15) UNIQUE NOT NULL, @@ -45,8 +44,8 @@ apn VARCHAR(256) NOT NULL ); --- Chapter 2.1.3 CREATE TABLE IF NOT EXISTS subscriber_multi_msisdn ( +-- Chapter 2.1.3 subscriber_id INTEGER, -- subscriber.id msisdn VARCHAR(15) NOT NULL ); -- To view, visit https://gerrit.osmocom.org/4439 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I280c2e2d3e9b7f1dc632722724d9e1c54d041820 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:49:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:49:33 +0000 Subject: [MERGED] osmo-hlr[master]: automatically create db tables on osmo-hlr invocation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: automatically create db tables on osmo-hlr invocation ...................................................................... automatically create db tables on osmo-hlr invocation If a database file is missing, osmo-hlr creates it, as is the default sqlite3 API behavior -- before this patch, that db file is created, but lacks useful tables. Actually also create initial tables in it, as osmo-nitb did. In effect, the 'vty-test' target in tests/Makefile.am no longer needs to create a database manually. (The 'ctrl-test' still does, because it also wants to add subscriber data on top of the bare tables.) Note: it could be desirable to bail if the desired database file does not exist. That is however a different semantic from this patch; this is not changing the fact that a db file is created, this just creates a usable one. Note: I am about to add osmo-hlr-db-tool to do database migration from osmo-nitb. For that, it is desirable to bootstrap a usable database, which is the core reason for this patch. Don't plainly duplicate hlr.sql to .c, but create db_bootstrap.h as a BUILT_SOURCE from reading in sql/hlr.sql and mangling via sed to a list of SQL statement strings. On each db_open(), run this bootstrap sequence. In sql/hlr.sql, these tweaks are necessary: * Add 'IF NOT EXISTS' to 'CREATE TABLE', so that the bootstrap sequence can be run on an already bootstrapped db. * Drop the final comment at the bottom, which ended up being an empty SQL statement and causing sqlite3 API errors, seemed to have no purpose anyway. Note: by composing the statement strings as multiline and including the SQL comments, sqlite3 actually retains the comments contained in table definitions and prints them back during 'sqlite3 hlr.db .dump'. Change-Id: If77dbbfe1af3e66aaec91cb6295b687f37678636 --- M sql/hlr.sql M src/Makefile.am M src/db.c A src/db_bootstrap.sed M tests/Makefile.am M tests/db/Makefile.am 6 files changed, 81 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sql/hlr.sql b/sql/hlr.sql index 5fbc712..696cf1c 100644 --- a/sql/hlr.sql +++ b/sql/hlr.sql @@ -1,6 +1,6 @@ --modelled roughly after TS 23.008 version 13.3.0 -CREATE TABLE subscriber ( +CREATE TABLE IF NOT EXISTS subscriber ( id INTEGER PRIMARY KEY, -- Chapter 2.1.1.1 imsi VARCHAR(15) UNIQUE NOT NULL, @@ -40,24 +40,24 @@ ms_purged_ps BOOLEAN NOT NULL DEFAULT 0 ); -CREATE TABLE subscriber_apn ( +CREATE TABLE IF NOT EXISTS subscriber_apn ( subscriber_id INTEGER, -- subscriber.id apn VARCHAR(256) NOT NULL ); -- Chapter 2.1.3 -CREATE TABLE subscriber_multi_msisdn ( +CREATE TABLE IF NOT EXISTS subscriber_multi_msisdn ( subscriber_id INTEGER, -- subscriber.id msisdn VARCHAR(15) NOT NULL ); -CREATE TABLE auc_2g ( +CREATE TABLE IF NOT EXISTS auc_2g ( subscriber_id INTEGER PRIMARY KEY, -- subscriber.id algo_id_2g INTEGER NOT NULL, -- enum osmo_auth_algo value ki VARCHAR(32) NOT NULL -- hex string: subscriber's secret key (128bit) ); -CREATE TABLE auc_3g ( +CREATE TABLE IF NOT EXISTS auc_3g ( subscriber_id INTEGER PRIMARY KEY, -- subscriber.id algo_id_3g INTEGER NOT NULL, -- enum osmo_auth_algo value k VARCHAR(32) NOT NULL, -- hex string: subscriber's secret key (128bit) @@ -68,4 +68,3 @@ ); CREATE UNIQUE INDEX IF NOT EXISTS idx_subscr_imsi ON subscriber (imsi); --- SELECT algo_id_2g, ki, algo_id_3g, k, op, opc, sqn FROM subscriber LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id WHERE imsi = ? diff --git a/src/Makefile.am b/src/Makefile.am index fc7c653..3b09b7b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,7 +10,13 @@ EXTRA_DIST = \ populate_hlr_db.pl \ + db_bootstrap.sed \ $(NULL) + +BUILT_SOURCES = \ + db_bootstrap.h \ + $(NULL) +CLEANFILES = $(BUILT_SOURCES) noinst_HEADERS = \ auc.h \ @@ -24,6 +30,7 @@ ctrl.h \ hlr_vty.h \ hlr_vty_subscr.h \ + db_bootstrap.h \ $(NULL) bin_PROGRAMS = \ @@ -73,3 +80,14 @@ $(LIBOSMOGSM_LIBS) \ $(SQLITE3_LIBS) \ $(NULL) + +BOOTSTRAP_SQL = $(top_srcdir)/sql/hlr.sql + +db_bootstrap.h: $(BOOTSTRAP_SQL) $(srcdir)/db_bootstrap.sed + echo "/* DO NOT EDIT THIS FILE. It is generated from osmo-hlr.git/sql/hlr.sql */" > "$@" + echo "#pragma once" >> "$@" + echo "static const char *stmt_bootstrap_sql[] = {" >> "$@" + cat "$(BOOTSTRAP_SQL)" \ + | sed -f "$(srcdir)/db_bootstrap.sed" \ + >> "$@" + echo "};" >> "$@" diff --git a/src/db.c b/src/db.c index fbf5c76..8733cf5 100644 --- a/src/db.c +++ b/src/db.c @@ -25,6 +25,7 @@ #include "logging.h" #include "db.h" +#include "db_bootstrap.h" #define SEL_COLUMNS \ "id," \ @@ -179,6 +180,35 @@ talloc_free(dbc); } +static int db_bootstrap(struct db_context *dbc) +{ + int i; + for (i = 0; i < ARRAY_SIZE(stmt_bootstrap_sql); i++) { + int rc; + sqlite3_stmt *stmt; + + rc = sqlite3_prepare_v2(dbc->db, stmt_bootstrap_sql[i], -1, + &stmt, NULL); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "Unable to prepare SQL statement '%s'\n", + stmt_bootstrap_sql[i]); + return -1; + } + + /* execute the statement */ + rc = sqlite3_step(stmt); + db_remove_reset(stmt); + if (rc != SQLITE_DONE) { + LOGP(DDB, LOGL_ERROR, "Cannot bootstrap database: SQL error: (%d) %s," + " during stmt '%s'", + rc, sqlite3_errmsg(dbc->db), + stmt_bootstrap_sql[i]); + return -1; + } + } + return 0; +} + struct db_context *db_open(void *ctx, const char *fname) { struct db_context *dbc = talloc_zero(ctx, struct db_context); @@ -231,6 +261,8 @@ LOGP(DDB, LOGL_ERROR, "Unable to set Write-Ahead Logging: %s\n", err_msg); + db_bootstrap(dbc); + /* prepare all SQL statements */ for (i = 0; i < ARRAY_SIZE(dbc->stmt); i++) { rc = sqlite3_prepare_v2(dbc->db, stmt_sql[i], -1, diff --git a/src/db_bootstrap.sed b/src/db_bootstrap.sed new file mode 100644 index 0000000..60b8243 --- /dev/null +++ b/src/db_bootstrap.sed @@ -0,0 +1,25 @@ +# Input to this is sql/hlr.sql. +# +# We want each SQL statement line wrapped in "...\n", and each end (";") to +# become a comma: +# +# SOME SQL COMMAND ( +# that may span ) +# MULTIPLE LINES; +# MORE; +# +# --> +# +# "SOME SQL COMMAND (\n" +# " that may span )\n" +# "MULTIPLE LINES\n", <--note the comma here +# "MORE\n", +# +# just replacing ';' with '\n,' won't work, since sed is bad in printing +# multiple lines. Also, how to input newlines to sed is not portable across +# platforms. + +# Match excluding a trailing ';' as \1, keep any trailing ';' in \2 +s/^\(.*[^;]\)\(;\|\)$/"\1\\n"\2/ +# Replace trailing ';' as ',' +s/;$/,/ diff --git a/tests/Makefile.am b/tests/Makefile.am index 2dba6a1..f1cc710 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -51,7 +51,6 @@ # make vty-test U=-u vty-test: -rm -f $(VTY_TEST_DB) - sqlite3 $(VTY_TEST_DB) < $(top_srcdir)/sql/hlr.sql osmo_verify_transcript_vty.py -v \ -n OsmoHLR -p 4258 \ -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l $(VTY_TEST_DB)" \ diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index b706bec..55b1655 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -1,6 +1,7 @@ AM_CFLAGS = \ $(all_includes) \ -I$(top_srcdir)/src \ + -I$(top_builddir)/src \ -Wall \ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ -- To view, visit https://gerrit.osmocom.org/4438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If77dbbfe1af3e66aaec91cb6295b687f37678636 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:49:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:49:34 +0000 Subject: [MERGED] osmo-hlr[master]: db_test: fix *FLAGS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: db_test: fix *FLAGS ...................................................................... db_test: fix *FLAGS The -I includes should be in CFLAGS, not CPPFLAGS. I noticed problems with it when trying to add an -I$(builddir) in an upcoming patch that adds a BUILT_SOURCE, If77dbbfe1af3e66aaec91cb6295b687f37678636. Change-Id: Ie57a04b7efc7a1e16cf0e3625d8ad2f0ef0089b0 --- M tests/db/Makefile.am 1 file changed, 1 insertion(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index a1f35a7..b706bec 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -1,17 +1,11 @@ -AM_CPPFLAGS = \ +AM_CFLAGS = \ $(all_includes) \ -I$(top_srcdir)/src \ - $(NULL) - -AM_CFLAGS = \ -Wall \ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(SQLITE3_CFLAGS) \ - $(NULL) - -AM_LDFLAGS = \ $(NULL) EXTRA_DIST = \ -- To view, visit https://gerrit.osmocom.org/4437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie57a04b7efc7a1e16cf0e3625d8ad2f0ef0089b0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 16:49:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 16:49:34 +0000 Subject: [MERGED] osmo-hlr[master]: tests/Makefile: use test db var instead of repeating the path In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests/Makefile: use test db var instead of repeating the path ...................................................................... tests/Makefile: use test db var instead of repeating the path Change-Id: I9859b522b5ffa7f2c9ed33ab849199d4b4e6696c --- M tests/Makefile.am 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/Makefile.am b/tests/Makefile.am index e71a250..2dba6a1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -54,7 +54,7 @@ sqlite3 $(VTY_TEST_DB) < $(top_srcdir)/sql/hlr.sql osmo_verify_transcript_vty.py -v \ -n OsmoHLR -p 4258 \ - -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_vty_test.db" \ + -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l $(VTY_TEST_DB)" \ $(U) $(srcdir)/*.vty -rm -f $(VTY_TEST_DB) @@ -69,7 +69,7 @@ sqlite3 $(CTRL_TEST_DB) < $(srcdir)/test_subscriber.sql osmo_verify_transcript_ctrl.py -v \ -p 4259 \ - -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l hlr_ctrl_test.db" \ + -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l $(CTRL_TEST_DB)" \ $(U) $(srcdir)/*.ctrl -rm -f $(CTRL_TEST_DB) -- To view, visit https://gerrit.osmocom.org/4436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9859b522b5ffa7f2c9ed33ab849199d4b4e6696c Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:02:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:02:22 +0000 Subject: [PATCH] osmo-ggsn[master]: Debian: libgtp is libgtp2 for some time, not libgtp1 anymore Message-ID: Review at https://gerrit.osmocom.org/4531 Debian: libgtp is libgtp2 for some time, not libgtp1 anymore In Change-Id Ie631880155513b1b78d1e9dd473dc5dc50e05943 we changed LIBVERSION but didn't update debian/control. Change-Id: I7a1349e9609cb455c0fe9d63d085e7c44dff96ef --- M debian/control R debian/libgtp2.install 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/31/4531/1 diff --git a/debian/control b/debian/control index bed17e2..1dceabe 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,7 @@ operators as the interface between the Internet and the rest of the mobile network infrastructure. -Package: libgtp1 +Package: libgtp2 Architecture: any Multi-Arch: same Section: libs @@ -41,7 +41,7 @@ Multi-Arch: same Section: libdevel Depends: ${misc:Depends}, - libgtp1 (= ${binary:Version}) + libgtp2 (= ${binary:Version}) Description: Development files for libgtp OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the @@ -54,6 +54,6 @@ Section: debug Architecture: any Priority: extra -Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), osmo-ggsn (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp2 (= ${binary:Version}), osmo-ggsn (= ${binary:Version}) Multi-Arch: same Description: Debug symbols for OsmoGGSN diff --git a/debian/libgtp1.install b/debian/libgtp2.install similarity index 100% rename from debian/libgtp1.install rename to debian/libgtp2.install -- To view, visit https://gerrit.osmocom.org/4531 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a1349e9609cb455c0fe9d63d085e7c44dff96ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:02:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:02:23 +0000 Subject: [PATCH] osmo-ggsn[master]: Debian: package libgtp debug symbols as libgtp-dbg Message-ID: Review at https://gerrit.osmocom.org/4532 Debian: package libgtp debug symbols as libgtp-dbg ... and some more Description for debian/control Change-Id: I099735f8550134441a77c29e8c4d4d3c2490e379 --- M debian/control M debian/rules 2 files changed, 19 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/32/4532/1 diff --git a/debian/control b/debian/control index 1dceabe..f31248e 100644 --- a/debian/control +++ b/debian/control @@ -57,3 +57,20 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp2 (= ${binary:Version}), osmo-ggsn (= ${binary:Version}) Multi-Arch: same Description: Debug symbols for OsmoGGSN + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + operators as the interface between the Internet and the rest of the + mobile network infrastructure. + +Package: libgtp-dbg +Section: debug +Architecture: any +Priority: extra +Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp2 (= ${binary:Version}) +Multi-Arch: same +Description: Debug symbols for OsmoGGSN + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + operators as the interface between the Internet and the rest of the + mobile network infrastructure. + . + The library libgtp implements the GTP protocol between SGSN and GGSN + and this package contains the development files for this library. diff --git a/debian/rules b/debian/rules index 6f27da9..57fe24c 100755 --- a/debian/rules +++ b/debian/rules @@ -15,7 +15,8 @@ dh $@ --with autoreconf override_dh_strip: - dh_strip --dbg-package=osmo-ggsn-dbg + dh_strip -posmo-ggsn --dbg-package=osmo-ggsn-dbg + dh_strip -plibgtp2 --dbg-package=libgtp-dbg override_dh_autoreconf: echo $(VERSION) > .tarball-version -- To view, visit https://gerrit.osmocom.org/4532 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I099735f8550134441a77c29e8c4d4d3c2490e379 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:02:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:02:23 +0000 Subject: [PATCH] osmo-ggsn[master]: Debian: include the systemd service file for osmo-ggsn Message-ID: Review at https://gerrit.osmocom.org/4533 Debian: include the systemd service file for osmo-ggsn Change-Id: I5ebee0135e638b7327a16218bdce466ada9aee56 --- A debian/osmo-ggsn.service 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/33/4533/1 diff --git a/debian/osmo-ggsn.service b/debian/osmo-ggsn.service new file mode 120000 index 0000000..3bc7d3d --- /dev/null +++ b/debian/osmo-ggsn.service @@ -0,0 +1 @@ +../contrib/osmo-ggsn.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4533 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ebee0135e638b7327a16218bdce466ada9aee56 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:02:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:02:23 +0000 Subject: [PATCH] osmo-ggsn[master]: Tag/Release Version 1.1.0 Message-ID: Review at https://gerrit.osmocom.org/4534 Tag/Release Version 1.1.0 Change-Id: I30a9e72fa9c3d6fc755c5531844b663c08c3ac06 --- M TODO-RELEASE M debian/changelog 2 files changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/34/4534/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 1009c44..d0852fc 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,5 +7,3 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -libgtp pdp.h Addition of new tx_gpdu_seq struct member member -libgtp pdp.h add LOGPDPX() helper to public API diff --git a/debian/changelog b/debian/changelog index 5953e6f..47e02f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +osmo-ggsn (1.1.0) unstable; urgency=medium + + * libgtp: pdp.h: Addition of new tx_gpdu_seq struct member member + * libgtp: pdp.h: add LOGPDPX() helper to public API + + -- Harald Welte Sat, 28 Oct 2017 19:00:23 +0200 + osmo-ggsn (1.0.0) unstable; urgency=medium * Transition to OsmoGGSN -- To view, visit https://gerrit.osmocom.org/4534 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I30a9e72fa9c3d6fc755c5531844b663c08c3ac06 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:09:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:09:35 +0000 Subject: [PATCH] osmo-sgsn[master]: Debian: Add systemd service files for osmo-sgsn and osmo-gbp... Message-ID: Review at https://gerrit.osmocom.org/4535 Debian: Add systemd service files for osmo-sgsn and osmo-gbproxy Change-Id: I5a5a80bb19c521e8f20241ed8c02d65b4c937f23 --- A debian/osmo-gbproxy.service A debian/osmo-sgsn.service 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/35/4535/1 diff --git a/debian/osmo-gbproxy.service b/debian/osmo-gbproxy.service new file mode 120000 index 0000000..d23c649 --- /dev/null +++ b/debian/osmo-gbproxy.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-gbproxy.service \ No newline at end of file diff --git a/debian/osmo-sgsn.service b/debian/osmo-sgsn.service new file mode 120000 index 0000000..de22d90 --- /dev/null +++ b/debian/osmo-sgsn.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-sgsn.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4535 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a5a80bb19c521e8f20241ed8c02d65b4c937f23 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:09:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:09:35 +0000 Subject: [PATCH] osmo-sgsn[master]: Debian: fix dh_strip rules for creating one -dbg per program Message-ID: Review at https://gerrit.osmocom.org/4536 Debian: fix dh_strip rules for creating one -dbg per program Before this patch, all debug symbols end up in osmo-sgsn-dbg, with osmo-{gbproxy,gtphub}-dbg being empty. Change-Id: Ib2ceecb3527855350b69d7413efe42274dc6febd --- M debian/rules 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/36/4536/1 diff --git a/debian/rules b/debian/rules index dbe582b..58ea9bb 100755 --- a/debian/rules +++ b/debian/rules @@ -56,9 +56,9 @@ # See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: - dh_strip --dbg-package=osmo-sgsn-dbg - dh_strip --dbg-package=osmo-gtphub-dbg - dh_strip --dbg-package=osmo-gbproxy-dbg + dh_strip -posmo-sgsn --dbg-package=osmo-sgsn-dbg + dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg + dh_strip -posmo-gbproxy --dbg-package=osmo-gbproxy-dbg # Print test results in case of a failure override_dh_auto_test: -- To view, visit https://gerrit.osmocom.org/4536 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib2ceecb3527855350b69d7413efe42274dc6febd Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:09:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:09:35 +0000 Subject: [PATCH] osmo-sgsn[master]: Tag/Release Version 1.2.0 Message-ID: Review at https://gerrit.osmocom.org/4537 Tag/Release Version 1.2.0 Change-Id: I44bee346fd698bd51ef305813084afdce0099907 --- M debian/changelog 1 file changed, 52 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/37/4537/1 diff --git a/debian/changelog b/debian/changelog index 6216695..0b56541 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,55 @@ +osmo-sgsn (1.2.0) unstable; urgency=medium + + [ Neels Hofmeyr ] + * jenkins: fix build: remove unused dependencies + * debian: fix osmo-sgsn.install, tweak VCS link and descriptions + * drop files unrelated to osmo-sgsn + * rewrite README + * configure.ac: set name to osmo-sgsn, fix ML addr + * move openbsc.pc to osmo-sgsn.pc + * move include/openbsc to include/osmocom/sgsn + * jenkins.sh: fix echo string to say osmo-sgsn, not msc + * jenkins: use osmo-clean-workspace.sh before and after build + + [ Alexander Couzens ] + * debian: fix paths of examples + * debian/rules: show testsuite.log when tests are failing + + [ Max ] + * Remove rest_octets.h + * gbproxy: ensure peer allocation result + * jenkins: use osmo-ggsn for tests + * Cleanup configure checks + * Use extended logging for PDP contexts + * deb: fix copyright file issues + * Move P-TMSI alloc/update into separate function + * Check for correct P-TMSI allocation + * Use new FSF address in license header + * SGSN: uncomment BSSGP vty tests + * SGSN: print additional GTP-related info + * SGSN: check that GSN is created in proper mode + * Fix APN printing + * Fix build after recent rate_ctr patches + * gbproxy: don't link unnecessary + * Fix libosmo-sigtran dependency + * jenkins: check for IU properly + * Log GTP-U endpoints update + * Log address on GTP creation + + [ Pau Espin Pedrol ] + * Remove unneeded dep libdbi + + [ Philipp Maier ] + * log: fix default loglevels + * non-iu-build: guard vty libosmo-sigtran function calls. + * configure: fix libosmo-sigtran dependency + + [ Harald Welte ] + * Debian: Add systemd service files for osmo-sgsn and osmo-gbproxy + * Debian: fix dh_strip rules for creating one -dbg per program + + -- Harald Welte Sat, 28 Oct 2017 19:07:48 +0200 + osmo-sgsn (0.1.0) unstable; urgency=low * Initial release. -- To view, visit https://gerrit.osmocom.org/4537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I44bee346fd698bd51ef305813084afdce0099907 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:09:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:09:43 +0000 Subject: osmo-ggsn[master]: Debian: libgtp is libgtp2 for some time, not libgtp1 anymore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4531 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a1349e9609cb455c0fe9d63d085e7c44dff96ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:09:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:09:44 +0000 Subject: osmo-ggsn[master]: Debian: package libgtp debug symbols as libgtp-dbg In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4532 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I099735f8550134441a77c29e8c4d4d3c2490e379 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:09:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:09:46 +0000 Subject: osmo-ggsn[master]: Debian: include the systemd service file for osmo-ggsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4533 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ebee0135e638b7327a16218bdce466ada9aee56 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:09:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:09:48 +0000 Subject: osmo-ggsn[master]: Tag/Release Version 1.1.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4534 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I30a9e72fa9c3d6fc755c5531844b663c08c3ac06 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:09:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:09:50 +0000 Subject: [MERGED] osmo-ggsn[master]: Tag/Release Version 1.1.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release Version 1.1.0 ...................................................................... Tag/Release Version 1.1.0 Change-Id: I30a9e72fa9c3d6fc755c5531844b663c08c3ac06 --- M TODO-RELEASE M debian/changelog 2 files changed, 7 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index 1009c44..d0852fc 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,5 +7,3 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -libgtp pdp.h Addition of new tx_gpdu_seq struct member member -libgtp pdp.h add LOGPDPX() helper to public API diff --git a/debian/changelog b/debian/changelog index 5953e6f..47e02f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +osmo-ggsn (1.1.0) unstable; urgency=medium + + * libgtp: pdp.h: Addition of new tx_gpdu_seq struct member member + * libgtp: pdp.h: add LOGPDPX() helper to public API + + -- Harald Welte Sat, 28 Oct 2017 19:00:23 +0200 + osmo-ggsn (1.0.0) unstable; urgency=medium * Transition to OsmoGGSN -- To view, visit https://gerrit.osmocom.org/4534 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I30a9e72fa9c3d6fc755c5531844b663c08c3ac06 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:09:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:09:50 +0000 Subject: [MERGED] osmo-ggsn[master]: Debian: include the systemd service file for osmo-ggsn In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: include the systemd service file for osmo-ggsn ...................................................................... Debian: include the systemd service file for osmo-ggsn Change-Id: I5ebee0135e638b7327a16218bdce466ada9aee56 --- A debian/osmo-ggsn.service 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-ggsn.service b/debian/osmo-ggsn.service new file mode 120000 index 0000000..3bc7d3d --- /dev/null +++ b/debian/osmo-ggsn.service @@ -0,0 +1 @@ +../contrib/osmo-ggsn.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4533 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ebee0135e638b7327a16218bdce466ada9aee56 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:09:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:09:50 +0000 Subject: [MERGED] osmo-ggsn[master]: Debian: package libgtp debug symbols as libgtp-dbg In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: package libgtp debug symbols as libgtp-dbg ...................................................................... Debian: package libgtp debug symbols as libgtp-dbg ... and some more Description for debian/control Change-Id: I099735f8550134441a77c29e8c4d4d3c2490e379 --- M debian/control M debian/rules 2 files changed, 19 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 1dceabe..f31248e 100644 --- a/debian/control +++ b/debian/control @@ -57,3 +57,20 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp2 (= ${binary:Version}), osmo-ggsn (= ${binary:Version}) Multi-Arch: same Description: Debug symbols for OsmoGGSN + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + operators as the interface between the Internet and the rest of the + mobile network infrastructure. + +Package: libgtp-dbg +Section: debug +Architecture: any +Priority: extra +Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp2 (= ${binary:Version}) +Multi-Arch: same +Description: Debug symbols for OsmoGGSN + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + operators as the interface between the Internet and the rest of the + mobile network infrastructure. + . + The library libgtp implements the GTP protocol between SGSN and GGSN + and this package contains the development files for this library. diff --git a/debian/rules b/debian/rules index 6f27da9..57fe24c 100755 --- a/debian/rules +++ b/debian/rules @@ -15,7 +15,8 @@ dh $@ --with autoreconf override_dh_strip: - dh_strip --dbg-package=osmo-ggsn-dbg + dh_strip -posmo-ggsn --dbg-package=osmo-ggsn-dbg + dh_strip -plibgtp2 --dbg-package=libgtp-dbg override_dh_autoreconf: echo $(VERSION) > .tarball-version -- To view, visit https://gerrit.osmocom.org/4532 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I099735f8550134441a77c29e8c4d4d3c2490e379 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:09:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:09:50 +0000 Subject: [MERGED] osmo-ggsn[master]: Debian: libgtp is libgtp2 for some time, not libgtp1 anymore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: libgtp is libgtp2 for some time, not libgtp1 anymore ...................................................................... Debian: libgtp is libgtp2 for some time, not libgtp1 anymore In Change-Id Ie631880155513b1b78d1e9dd473dc5dc50e05943 we changed LIBVERSION but didn't update debian/control. Change-Id: I7a1349e9609cb455c0fe9d63d085e7c44dff96ef --- M debian/control R debian/libgtp2.install 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index bed17e2..1dceabe 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,7 @@ operators as the interface between the Internet and the rest of the mobile network infrastructure. -Package: libgtp1 +Package: libgtp2 Architecture: any Multi-Arch: same Section: libs @@ -41,7 +41,7 @@ Multi-Arch: same Section: libdevel Depends: ${misc:Depends}, - libgtp1 (= ${binary:Version}) + libgtp2 (= ${binary:Version}) Description: Development files for libgtp OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the @@ -54,6 +54,6 @@ Section: debug Architecture: any Priority: extra -Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), osmo-ggsn (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp2 (= ${binary:Version}), osmo-ggsn (= ${binary:Version}) Multi-Arch: same Description: Debug symbols for OsmoGGSN diff --git a/debian/libgtp1.install b/debian/libgtp2.install similarity index 100% rename from debian/libgtp1.install rename to debian/libgtp2.install -- To view, visit https://gerrit.osmocom.org/4531 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a1349e9609cb455c0fe9d63d085e7c44dff96ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:10:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:10:42 +0000 Subject: [MERGED] osmo-hlr[master]: fix default logging levels to NOTICE, not DEBUG In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix default logging levels to NOTICE, not DEBUG ...................................................................... fix default logging levels to NOTICE, not DEBUG Tweak unit test binaries to still used DEBUG loglevels, so that their expected outputs remain unchanged (and nicely verbose). Adjust test_nodes.vty, now expecting the 'notice' log levels upon 'show running-config'. Change-Id: Ic061e61c9625b49cef8bc2a2c0b936e262c22268 --- M src/logging.c M tests/auc/auc_test.c M tests/auc/gen_ts_55_205_test_sets/main_template.c M tests/db/db_test.c M tests/test_nodes.vty 5 files changed, 9 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/logging.c b/src/logging.c index 9b8de45..f81781d 100644 --- a/src/logging.c +++ b/src/logging.c @@ -5,19 +5,19 @@ [DMAIN] = { .name = "DMAIN", .description = "Main Program", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DDB] = { .name = "DDB", .description = "Database Layer", .color = "\033[1;31m", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, [DAUC] = { .name = "DAUC", .description = "Authentication Center", .color = "\033[1;33m", - .enabled = 1, .loglevel = LOGL_DEBUG, + .enabled = 1, .loglevel = LOGL_NOTICE, }, }; diff --git a/tests/auc/auc_test.c b/tests/auc/auc_test.c index f047a97..e9c114c 100644 --- a/tests/auc/auc_test.c +++ b/tests/auc/auc_test.c @@ -615,6 +615,7 @@ log_set_print_timestamp(osmo_stderr_target, 0); log_set_use_color(osmo_stderr_target, 0); log_set_print_category(osmo_stderr_target, 1); + log_parse_category_mask(osmo_stderr_target, "DMAIN,1:DDB,1:DAUC,1"); test_gen_vectors_2g_only(); test_gen_vectors_2g_plus_3g(); diff --git a/tests/auc/gen_ts_55_205_test_sets/main_template.c b/tests/auc/gen_ts_55_205_test_sets/main_template.c index e917e71..37f47c3 100644 --- a/tests/auc/gen_ts_55_205_test_sets/main_template.c +++ b/tests/auc/gen_ts_55_205_test_sets/main_template.c @@ -107,6 +107,7 @@ log_set_print_timestamp(osmo_stderr_target, 0); log_set_use_color(osmo_stderr_target, 0); log_set_print_category(osmo_stderr_target, 1); + log_parse_category_mask(osmo_stderr_target, "DMAIN,1:DDB,1:DAUC,1"); FUNCTION_CALLS diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 0a53370..389ed00 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -816,6 +816,7 @@ log_set_print_timestamp(osmo_stderr_target, 0); log_set_use_color(osmo_stderr_target, 0); log_set_print_category(osmo_stderr_target, 1); + log_parse_category_mask(osmo_stderr_target, "DMAIN,1:DDB,1:DAUC,1"); /* omit the SQLite version and compilation flags from test output */ log_set_log_level(osmo_stderr_target, LOGL_ERROR); diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty index 0de4ff4..6de673a 100644 --- a/tests/test_nodes.vty +++ b/tests/test_nodes.vty @@ -101,9 +101,9 @@ logging print category 1 logging print extended-timestamp 1 logging level all debug - logging level main debug - logging level db debug - logging level auc debug + logging level main notice + logging level db notice + logging level auc notice ... ! line vty -- To view, visit https://gerrit.osmocom.org/4442 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic061e61c9625b49cef8bc2a2c0b936e262c22268 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:59:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:59:11 +0000 Subject: osmo-sgsn[master]: Debian: Add systemd service files for osmo-sgsn and osmo-gbp... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4535 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5a5a80bb19c521e8f20241ed8c02d65b4c937f23 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:59:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:59:14 +0000 Subject: osmo-sgsn[master]: Debian: fix dh_strip rules for creating one -dbg per program In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4536 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib2ceecb3527855350b69d7413efe42274dc6febd Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:59:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:59:17 +0000 Subject: osmo-sgsn[master]: Tag/Release Version 1.2.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44bee346fd698bd51ef305813084afdce0099907 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:59:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:59:18 +0000 Subject: [MERGED] osmo-sgsn[master]: Tag/Release Version 1.2.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release Version 1.2.0 ...................................................................... Tag/Release Version 1.2.0 Change-Id: I44bee346fd698bd51ef305813084afdce0099907 --- M debian/changelog 1 file changed, 52 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 6216695..0b56541 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,55 @@ +osmo-sgsn (1.2.0) unstable; urgency=medium + + [ Neels Hofmeyr ] + * jenkins: fix build: remove unused dependencies + * debian: fix osmo-sgsn.install, tweak VCS link and descriptions + * drop files unrelated to osmo-sgsn + * rewrite README + * configure.ac: set name to osmo-sgsn, fix ML addr + * move openbsc.pc to osmo-sgsn.pc + * move include/openbsc to include/osmocom/sgsn + * jenkins.sh: fix echo string to say osmo-sgsn, not msc + * jenkins: use osmo-clean-workspace.sh before and after build + + [ Alexander Couzens ] + * debian: fix paths of examples + * debian/rules: show testsuite.log when tests are failing + + [ Max ] + * Remove rest_octets.h + * gbproxy: ensure peer allocation result + * jenkins: use osmo-ggsn for tests + * Cleanup configure checks + * Use extended logging for PDP contexts + * deb: fix copyright file issues + * Move P-TMSI alloc/update into separate function + * Check for correct P-TMSI allocation + * Use new FSF address in license header + * SGSN: uncomment BSSGP vty tests + * SGSN: print additional GTP-related info + * SGSN: check that GSN is created in proper mode + * Fix APN printing + * Fix build after recent rate_ctr patches + * gbproxy: don't link unnecessary + * Fix libosmo-sigtran dependency + * jenkins: check for IU properly + * Log GTP-U endpoints update + * Log address on GTP creation + + [ Pau Espin Pedrol ] + * Remove unneeded dep libdbi + + [ Philipp Maier ] + * log: fix default loglevels + * non-iu-build: guard vty libosmo-sigtran function calls. + * configure: fix libosmo-sigtran dependency + + [ Harald Welte ] + * Debian: Add systemd service files for osmo-sgsn and osmo-gbproxy + * Debian: fix dh_strip rules for creating one -dbg per program + + -- Harald Welte Sat, 28 Oct 2017 19:07:48 +0200 + osmo-sgsn (0.1.0) unstable; urgency=low * Initial release. -- To view, visit https://gerrit.osmocom.org/4537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I44bee346fd698bd51ef305813084afdce0099907 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:59:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:59:18 +0000 Subject: [MERGED] osmo-sgsn[master]: Debian: fix dh_strip rules for creating one -dbg per program In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: fix dh_strip rules for creating one -dbg per program ...................................................................... Debian: fix dh_strip rules for creating one -dbg per program Before this patch, all debug symbols end up in osmo-sgsn-dbg, with osmo-{gbproxy,gtphub}-dbg being empty. Change-Id: Ib2ceecb3527855350b69d7413efe42274dc6febd --- M debian/rules 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index dbe582b..58ea9bb 100755 --- a/debian/rules +++ b/debian/rules @@ -56,9 +56,9 @@ # See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: - dh_strip --dbg-package=osmo-sgsn-dbg - dh_strip --dbg-package=osmo-gtphub-dbg - dh_strip --dbg-package=osmo-gbproxy-dbg + dh_strip -posmo-sgsn --dbg-package=osmo-sgsn-dbg + dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg + dh_strip -posmo-gbproxy --dbg-package=osmo-gbproxy-dbg # Print test results in case of a failure override_dh_auto_test: -- To view, visit https://gerrit.osmocom.org/4536 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib2ceecb3527855350b69d7413efe42274dc6febd Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 17:59:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 17:59:18 +0000 Subject: [MERGED] osmo-sgsn[master]: Debian: Add systemd service files for osmo-sgsn and osmo-gbp... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Add systemd service files for osmo-sgsn and osmo-gbproxy ...................................................................... Debian: Add systemd service files for osmo-sgsn and osmo-gbproxy Change-Id: I5a5a80bb19c521e8f20241ed8c02d65b4c937f23 --- A debian/osmo-gbproxy.service A debian/osmo-sgsn.service 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-gbproxy.service b/debian/osmo-gbproxy.service new file mode 120000 index 0000000..d23c649 --- /dev/null +++ b/debian/osmo-gbproxy.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-gbproxy.service \ No newline at end of file diff --git a/debian/osmo-sgsn.service b/debian/osmo-sgsn.service new file mode 120000 index 0000000..de22d90 --- /dev/null +++ b/debian/osmo-sgsn.service @@ -0,0 +1 @@ +../contrib/systemd/osmo-sgsn.service \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/4535 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5a5a80bb19c521e8f20241ed8c02d65b4c937f23 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:34:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:34:37 +0000 Subject: [PATCH] osmo-hlr[master]: add osmo-hlr-db-tool, program to migrate from osmo-nitb db In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4441 to look at the new patch set (#2). add osmo-hlr-db-tool, program to migrate from osmo-nitb db Move macro copy_sqlite3_text_to_buf() to db.h, so it can be used in hlr_db_tool.c. Add _dbd_decode_binary() from libdbi to avoid depending on the entire libdbi just for KI BLOB decoding. Add it in a separate file, copying its own license, the lGPL. Offer commandline option "import-nitb-db" to read in an old osmo-nitb database and copy subscriber IMSIs and 2G auth data to OsmoHLR db format. Anticipate future command line options like "import-csv", so keep the code generalized. Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63 --- M src/Makefile.am M src/db.h M src/db_hlr.c A src/dbd_decode_binary.c A src/hlr_db_tool.c 5 files changed, 495 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/41/4441/2 diff --git a/src/Makefile.am b/src/Makefile.am index 3b09b7b..9fbb062 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -35,6 +35,7 @@ bin_PROGRAMS = \ osmo-hlr \ + osmo-hlr-db-tool \ $(NULL) noinst_PROGRAMS = \ @@ -66,6 +67,21 @@ $(SQLITE3_LIBS) \ $(NULL) +osmo_hlr_db_tool_SOURCES = \ + hlr_db_tool.c \ + db.c \ + db_hlr.c \ + logging.c \ + rand_urandom.c \ + dbd_decode_binary.c \ + $(NULL) + +osmo_hlr_db_tool_LDADD = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(SQLITE3_LIBS) \ + $(NULL) + db_test_SOURCES = \ auc.c \ db.c \ diff --git a/src/db.h b/src/db.h index 35e4327..fc8e511 100644 --- a/src/db.h +++ b/src/db.h @@ -129,3 +129,14 @@ bool purge_val, bool is_ps); int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps); + +/*! Call sqlite3_column_text() and copy result to a char[]. + * \param[out] buf A char[] used as sizeof() arg(!) and osmo_strlcpy() target. + * \param[in] stmt An sqlite3_stmt*. + * \param[in] idx Index in stmt's returned columns. + */ +#define copy_sqlite3_text_to_buf(buf, stmt, idx) \ + do { \ + const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ + osmo_strlcpy(buf, _txt, sizeof(buf)); \ + } while (0) diff --git a/src/db_hlr.c b/src/db_hlr.c index bae9a5a..c4d4974 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -35,17 +35,6 @@ #define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) -/*! Call sqlite3_column_text() and copy result to a char[]. - * \param[out] buf A char[] used as sizeof() arg(!) and osmo_strlcpy() target. - * \param[in] stmt An sqlite3_stmt*. - * \param[in] idx Index in stmt's returned columns. - */ -#define copy_sqlite3_text_to_buf(buf, stmt, idx) \ - do { \ - const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ - osmo_strlcpy(buf, _txt, sizeof(buf)); \ - } while (0) - /*! Add new subscriber record to the HLR database. * \param[in,out] dbc database context. * \param[in] imsi ASCII string of IMSI digits, is validated. diff --git a/src/dbd_decode_binary.c b/src/dbd_decode_binary.c new file mode 100644 index 0000000..e1a98ad --- /dev/null +++ b/src/dbd_decode_binary.c @@ -0,0 +1,42 @@ +/* This function is blatantly copied from libdbi, from + * https://sourceforge.net/p/libdbi/libdbi/ci/master/tree/src/dbd_helper.c + * to save having to depend on the entire libdbi just for KI BLOB decoding. + */ + +/* + * libdbi - database independent abstraction layer for C. + * Copyright (C) 2001-2003, David Parker and Mark Tobenkin. + * http://libdbi.sourceforge.net + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: dbd_helper.c,v 1.44 2011/08/09 11:14:14 mhoenicka Exp $ + */ + +#include + +size_t _dbd_decode_binary(const unsigned char *in, unsigned char *out){ + int i, e; + unsigned char c; + e = *(in++); + i = 0; + while( (c = *(in++))!=0 ){ + if( c==1 ){ + c = *(in++) - 1; + } + out[i++] = c + e; + } + return (size_t)i; +} diff --git a/src/hlr_db_tool.c b/src/hlr_db_tool.c new file mode 100644 index 0000000..8982739 --- /dev/null +++ b/src/hlr_db_tool.c @@ -0,0 +1,426 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "logging.h" +#include "db.h" +#include "rand.h" + +struct hlr_db_tool_ctx { + /* DB context */ + struct db_context *dbc; +}; + +struct hlr_db_tool_ctx *g_hlr_db_tool_ctx; + +static struct { + const char *db_file; + bool bootstrap; + const char *import_nitb_db; +} cmdline_opts = { + .db_file = "hlr.db", +}; + +static void print_help() +{ + printf("\n"); + printf("Usage: osmo-hlr-db-tool [-l ] import-nitb-db ]\n"); + printf("Call without arguments to create a new empty ./hlr.db.\n"); + printf(" -l --database db-name The OsmoHLR database to use, default '%s'.\n", + cmdline_opts.db_file); + printf(" -h --help This text.\n"); + printf(" -d option --debug=DMAIN:DDB:DAUC Enable debugging.\n"); + printf(" -s --disable-color Do not print ANSI colors in the log\n"); + printf(" -T --timestamp Prefix every log line with a timestamp.\n"); + printf(" -e --log-level number Set a global loglevel.\n"); + printf(" -V --version Print the version of OsmoHLR-db-tool.\n"); + printf("\n"); + printf(" import-nitb-db db Add OsmoNITB db's subscribers to OsmoHLR db.\n"); + printf(" Be aware that the import is lossy, only the\n"); + printf(" IMSI, MSISDN, nam_cs/ps and 2G auth data are set.\n"); +} + +static void print_version(int print_copyright) +{ + printf("OsmoHLR-db-tool version %s\n", PACKAGE_VERSION); + if (print_copyright) + printf("\n" + "Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH\n" + "License AGPLv3+: GNU AGPL version 3 or later \n" + "This is free software: you are free to change and redistribute it.\n" + "There is NO WARRANTY, to the extent permitted by law.\n" + "\n"); +} + +static void handle_options(int argc, char **argv) +{ + const char *cmd; + + while (1) { + int option_index = 0, c; + static struct option long_options[] = { + {"help", 0, 0, 'h'}, + {"database", 1, 0, 'l'}, + {"debug", 1, 0, 'd'}, + {"disable-color", 0, 0, 's'}, + {"timestamp", 0, 0, 'T'}, + {"log-level", 1, 0, 'e'}, + {"version", 0, 0, 'V' }, + {0, 0, 0, 0} + }; + + c = getopt_long(argc, argv, "hl:d:sTe:V", + long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_help(); + exit(EXIT_SUCCESS); + case 'l': + cmdline_opts.db_file = optarg; + break; + case 'd': + log_parse_category_mask(osmo_stderr_target, optarg); + break; + case 's': + log_set_use_color(osmo_stderr_target, 0); + break; + case 'T': + log_set_print_timestamp(osmo_stderr_target, 1); + break; + case 'e': + log_set_log_level(osmo_stderr_target, atoi(optarg)); + break; + case 'V': + print_version(1); + exit(EXIT_SUCCESS); + break; + default: + /* catch unknown options *as well as* missing arguments. */ + fprintf(stderr, "Error in command line options. Exiting.\n"); + exit(EXIT_FAILURE); + break; + } + } + + if (argc - optind <= 0) { + fprintf(stderr, "Error: You must specify a command.\n"); + print_help(); + exit(EXIT_FAILURE); + } + + cmd = argv[optind++]; + printf("command '%s', %d extra arguments\n", cmd, argc - optind); + + if (!strcmp(cmd, "import-nitb-db")) { + if (argc - optind < 1) { + fprintf(stderr, "You must specify an input db file\n"); + print_help(); + exit(EXIT_FAILURE); + } + cmdline_opts.import_nitb_db = argv[optind++]; + } else { + fprintf(stderr, "Error: Unknown command `%s'\n", cmd); + print_help(); + exit(EXIT_FAILURE); + } +} + +static void signal_hdlr(int signal) +{ + switch (signal) { + case SIGINT: + LOGP(DMAIN, LOGL_NOTICE, "Terminating due to SIGINT\n"); + db_close(g_hlr_db_tool_ctx->dbc); + log_fini(); + talloc_report_full(g_hlr_db_tool_ctx, stderr); + exit(EXIT_SUCCESS); + break; + case SIGUSR1: + LOGP(DMAIN, LOGL_DEBUG, "Talloc Report due to SIGUSR1\n"); + talloc_report_full(g_hlr_db_tool_ctx, stderr); + break; + } +} + +sqlite3 *open_nitb_db(const char *filename) +{ + int rc; + sqlite3 *nitb_db = NULL; + + rc = sqlite3_open(filename, &nitb_db); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "Unable to open OsmoNITB DB %s; rc = %d\n", filename, rc); + return NULL; + } + + return nitb_db; +} + +enum nitb_stmt { + NITB_SELECT_SUBSCR, + NITB_SELECT_AUTH_KEYS, +}; + +static const char *nitb_stmt_sql[] = { + [NITB_SELECT_SUBSCR] = + "SELECT imsi, id, extension, authorized" + " FROM Subscriber" + " ORDER BY id", + [NITB_SELECT_AUTH_KEYS] = + "SELECT algorithm_id, a3a8_ki from authkeys" + " WHERE subscriber_id = $subscr_id", +}; + +sqlite3_stmt *nitb_stmt[ARRAY_SIZE(nitb_stmt_sql)] = {}; + +size_t _dbd_decode_binary(const unsigned char *in, unsigned char *out); + +void import_nitb_subscr_aud(sqlite3 *nitb_db, const char *imsi, int64_t nitb_id, int64_t hlr_id) +{ + int rc; + struct db_context *dbc = g_hlr_db_tool_ctx->dbc; + sqlite3_stmt *stmt; + + int count = 0; + + stmt = nitb_stmt[NITB_SELECT_AUTH_KEYS]; + if (!db_bind_int(stmt, NULL, nitb_id)) + return; + + while ((rc = sqlite3_step(stmt)) == SQLITE_ROW) { + const void *blob; + unsigned int blob_size; + static unsigned char buf[4096]; + static char ki[128]; + int decoded_size; + struct sub_auth_data_str aud2g = { + .type = OSMO_AUTH_TYPE_GSM, + .algo = OSMO_AUTH_ALG_NONE, + .u.gsm.ki = ki, + }; + + aud2g.algo = sqlite3_column_int(stmt, 0); + + if (count) { + LOGP(DDB, LOGL_ERROR, + "Warning: subscriber has more than one auth key," + " importing only the first key, for IMSI=%s\n", + imsi); + break; + } + + blob = sqlite3_column_blob(stmt, 1); + blob_size = sqlite3_column_bytes(stmt, 1); + + if (blob_size > sizeof(buf)) { + LOGP(DDB, LOGL_ERROR, + "OsmoNITB import to %s: Cannot import auth data for IMSI %s:" + " too large blob: %u\n", + dbc->fname, imsi, blob_size); + db_remove_reset(stmt); + continue; + } + + decoded_size = _dbd_decode_binary(blob, buf); + osmo_strlcpy(ki, osmo_hexdump_nospc(buf, decoded_size), sizeof(ki)); + + db_subscr_update_aud_by_id(dbc, hlr_id, &aud2g); + count ++; + } + + if (rc != SQLITE_DONE && rc != SQLITE_ROW) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB: SQL error: (%d) %s," + " during stmt '%s'", + rc, sqlite3_errmsg(nitb_db), + nitb_stmt_sql[NITB_SELECT_AUTH_KEYS]); + } + + db_remove_reset(stmt); +} + +void import_nitb_subscr(sqlite3 *nitb_db, sqlite3_stmt *stmt) +{ + struct db_context *dbc = g_hlr_db_tool_ctx->dbc; + int rc; + struct hlr_subscriber subscr; + + int64_t nitb_id; + int64_t imsi; + char imsi_str[32]; + bool authorized; + + imsi = sqlite3_column_int64(stmt, 0); + + snprintf(imsi_str, sizeof(imsi_str), "%"PRId64, imsi); + + rc = db_subscr_create(dbc, imsi_str); + if (rc) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB import to %s: failed to create IMSI %s: %d: %s\n", + dbc->fname, + imsi_str, + rc, + strerror(rc)); + /* on error, still attempt to continue */ + } + + nitb_id = sqlite3_column_int64(stmt, 1); + copy_sqlite3_text_to_buf(subscr.msisdn, stmt, 2); + authorized = sqlite3_column_int(stmt, 3) ? true : false; + + db_subscr_update_msisdn_by_imsi(dbc, imsi_str, subscr.msisdn); + db_subscr_nam(dbc, imsi_str, authorized, true); + db_subscr_nam(dbc, imsi_str, authorized, false); + + /* find the just created id */ + rc = db_subscr_get_by_imsi(dbc, imsi_str, &subscr); + if (rc) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB import to %s: created IMSI %s," + " but failed to get new subscriber id: %d: %s\n", + dbc->fname, + imsi_str, + rc, + strerror(rc)); + return; + } + + OSMO_ASSERT(!strcmp(imsi_str, subscr.imsi)); + + import_nitb_subscr_aud(nitb_db, imsi_str, nitb_id, subscr.id); +} + +int import_nitb_db(void) +{ + int i; + int ret; + int rc; + const char *sql; + sqlite3_stmt *stmt; + + sqlite3 *nitb_db = open_nitb_db(cmdline_opts.import_nitb_db); + + if (!nitb_db) + return -1; + ret = 0; + + for (i = 0; i < ARRAY_SIZE(nitb_stmt_sql); i++) { + sql = nitb_stmt_sql[i]; + rc = sqlite3_prepare_v2(nitb_db, sql, -1, &nitb_stmt[i], NULL); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB: Unable to prepare SQL statement '%s'\n", sql); + ret = -1; + goto out_free; + } + } + + stmt = nitb_stmt[NITB_SELECT_SUBSCR]; + + while ((rc = sqlite3_step(stmt)) == SQLITE_ROW) { + import_nitb_subscr(nitb_db, stmt); + /* On failure, carry on with the rest. */ + } + if (rc != SQLITE_DONE) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB: SQL error: (%d) %s," + " during stmt '%s'", + rc, sqlite3_errmsg(nitb_db), + nitb_stmt_sql[NITB_SELECT_SUBSCR]); + goto out_free; + } + + db_remove_reset(stmt); + sqlite3_finalize(stmt); + +out_free: + sqlite3_close(nitb_db); + return ret; +} + +int main(int argc, char **argv) +{ + int rc; + int (*main_action)(void); + main_action = NULL; + + g_hlr_db_tool_ctx = talloc_zero(NULL, struct hlr_db_tool_ctx); + OSMO_ASSERT(g_hlr_db_tool_ctx); + talloc_set_name_const(g_hlr_db_tool_ctx, "OsmoHLR-db-tool"); + + rc = osmo_init_logging(&hlr_log_info); + if (rc < 0) { + fprintf(stderr, "Error initializing logging\n"); + exit(EXIT_FAILURE); + } + + handle_options(argc, argv); + + if (cmdline_opts.import_nitb_db) { + if (main_action) + goto too_many_actions; + main_action = import_nitb_db; + } + /* Future: add more main_actions, besides --import-nitb-db, here. */ + + /* Just in case any db actions need randomness */ + rc = rand_init(); + if (rc < 0) { + LOGP(DMAIN, LOGL_FATAL, "Error initializing random source\n"); + exit(EXIT_FAILURE); + } + + g_hlr_db_tool_ctx->dbc = db_open(g_hlr_db_tool_ctx, cmdline_opts.db_file); + if (!g_hlr_db_tool_ctx->dbc) { + LOGP(DMAIN, LOGL_FATAL, "Error opening database\n"); + exit(EXIT_FAILURE); + } + + osmo_init_ignore_signals(); + signal(SIGINT, &signal_hdlr); + signal(SIGUSR1, &signal_hdlr); + + rc = 0; + if (main_action) + rc = (*main_action)(); + + db_close(g_hlr_db_tool_ctx->dbc); + log_fini(); + exit(rc ? EXIT_FAILURE : EXIT_SUCCESS); + +too_many_actions: + fprintf(stderr, "Too many actions requested.\n"); + log_fini(); + exit(EXIT_FAILURE); +} + +/* stubs */ +void lu_op_alloc_conn(void) { OSMO_ASSERT(0); } +void lu_op_tx_del_subscr_data(void) { OSMO_ASSERT(0); } +void lu_op_free(void) { OSMO_ASSERT(0); } -- To view, visit https://gerrit.osmocom.org/4441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:35:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:35:48 +0000 Subject: osmo-hlr[master]: add osmo-hlr-db-tool, program to migrate from osmo-nitb db In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4441/1/src/hlr_db_tool.c File src/hlr_db_tool.c: PS1, Line 53: [--import-nitb-db ] > My first intention was to have a positional argument like in git commands a how to do this: getopt_long() leaves "optind" at the last option it has parsed, so "argc - optind" tells you the number of remaining positional arguments. You can then index argv[] from there. I implemented it in the next version of the patch because I wanted this to be merged before tagging an osmo-hlr release just now. -- To view, visit https://gerrit.osmocom.org/4441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:36:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:36:53 +0000 Subject: osmo-hlr[master]: add osmo-hlr-db-tool, program to migrate from osmo-nitb db In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:36:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:36:55 +0000 Subject: [MERGED] osmo-hlr[master]: add osmo-hlr-db-tool, program to migrate from osmo-nitb db In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add osmo-hlr-db-tool, program to migrate from osmo-nitb db ...................................................................... add osmo-hlr-db-tool, program to migrate from osmo-nitb db Move macro copy_sqlite3_text_to_buf() to db.h, so it can be used in hlr_db_tool.c. Add _dbd_decode_binary() from libdbi to avoid depending on the entire libdbi just for KI BLOB decoding. Add it in a separate file, copying its own license, the lGPL. Offer commandline option "import-nitb-db" to read in an old osmo-nitb database and copy subscriber IMSIs and 2G auth data to OsmoHLR db format. Anticipate future command line options like "import-csv", so keep the code generalized. Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63 --- M src/Makefile.am M src/db.h M src/db_hlr.c A src/dbd_decode_binary.c A src/hlr_db_tool.c 5 files changed, 495 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/Makefile.am b/src/Makefile.am index 3b09b7b..9fbb062 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -35,6 +35,7 @@ bin_PROGRAMS = \ osmo-hlr \ + osmo-hlr-db-tool \ $(NULL) noinst_PROGRAMS = \ @@ -66,6 +67,21 @@ $(SQLITE3_LIBS) \ $(NULL) +osmo_hlr_db_tool_SOURCES = \ + hlr_db_tool.c \ + db.c \ + db_hlr.c \ + logging.c \ + rand_urandom.c \ + dbd_decode_binary.c \ + $(NULL) + +osmo_hlr_db_tool_LDADD = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(SQLITE3_LIBS) \ + $(NULL) + db_test_SOURCES = \ auc.c \ db.c \ diff --git a/src/db.h b/src/db.h index 35e4327..fc8e511 100644 --- a/src/db.h +++ b/src/db.h @@ -129,3 +129,14 @@ bool purge_val, bool is_ps); int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps); + +/*! Call sqlite3_column_text() and copy result to a char[]. + * \param[out] buf A char[] used as sizeof() arg(!) and osmo_strlcpy() target. + * \param[in] stmt An sqlite3_stmt*. + * \param[in] idx Index in stmt's returned columns. + */ +#define copy_sqlite3_text_to_buf(buf, stmt, idx) \ + do { \ + const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ + osmo_strlcpy(buf, _txt, sizeof(buf)); \ + } while (0) diff --git a/src/db_hlr.c b/src/db_hlr.c index bae9a5a..c4d4974 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -35,17 +35,6 @@ #define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args) -/*! Call sqlite3_column_text() and copy result to a char[]. - * \param[out] buf A char[] used as sizeof() arg(!) and osmo_strlcpy() target. - * \param[in] stmt An sqlite3_stmt*. - * \param[in] idx Index in stmt's returned columns. - */ -#define copy_sqlite3_text_to_buf(buf, stmt, idx) \ - do { \ - const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \ - osmo_strlcpy(buf, _txt, sizeof(buf)); \ - } while (0) - /*! Add new subscriber record to the HLR database. * \param[in,out] dbc database context. * \param[in] imsi ASCII string of IMSI digits, is validated. diff --git a/src/dbd_decode_binary.c b/src/dbd_decode_binary.c new file mode 100644 index 0000000..e1a98ad --- /dev/null +++ b/src/dbd_decode_binary.c @@ -0,0 +1,42 @@ +/* This function is blatantly copied from libdbi, from + * https://sourceforge.net/p/libdbi/libdbi/ci/master/tree/src/dbd_helper.c + * to save having to depend on the entire libdbi just for KI BLOB decoding. + */ + +/* + * libdbi - database independent abstraction layer for C. + * Copyright (C) 2001-2003, David Parker and Mark Tobenkin. + * http://libdbi.sourceforge.net + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: dbd_helper.c,v 1.44 2011/08/09 11:14:14 mhoenicka Exp $ + */ + +#include + +size_t _dbd_decode_binary(const unsigned char *in, unsigned char *out){ + int i, e; + unsigned char c; + e = *(in++); + i = 0; + while( (c = *(in++))!=0 ){ + if( c==1 ){ + c = *(in++) - 1; + } + out[i++] = c + e; + } + return (size_t)i; +} diff --git a/src/hlr_db_tool.c b/src/hlr_db_tool.c new file mode 100644 index 0000000..8982739 --- /dev/null +++ b/src/hlr_db_tool.c @@ -0,0 +1,426 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "logging.h" +#include "db.h" +#include "rand.h" + +struct hlr_db_tool_ctx { + /* DB context */ + struct db_context *dbc; +}; + +struct hlr_db_tool_ctx *g_hlr_db_tool_ctx; + +static struct { + const char *db_file; + bool bootstrap; + const char *import_nitb_db; +} cmdline_opts = { + .db_file = "hlr.db", +}; + +static void print_help() +{ + printf("\n"); + printf("Usage: osmo-hlr-db-tool [-l ] import-nitb-db ]\n"); + printf("Call without arguments to create a new empty ./hlr.db.\n"); + printf(" -l --database db-name The OsmoHLR database to use, default '%s'.\n", + cmdline_opts.db_file); + printf(" -h --help This text.\n"); + printf(" -d option --debug=DMAIN:DDB:DAUC Enable debugging.\n"); + printf(" -s --disable-color Do not print ANSI colors in the log\n"); + printf(" -T --timestamp Prefix every log line with a timestamp.\n"); + printf(" -e --log-level number Set a global loglevel.\n"); + printf(" -V --version Print the version of OsmoHLR-db-tool.\n"); + printf("\n"); + printf(" import-nitb-db db Add OsmoNITB db's subscribers to OsmoHLR db.\n"); + printf(" Be aware that the import is lossy, only the\n"); + printf(" IMSI, MSISDN, nam_cs/ps and 2G auth data are set.\n"); +} + +static void print_version(int print_copyright) +{ + printf("OsmoHLR-db-tool version %s\n", PACKAGE_VERSION); + if (print_copyright) + printf("\n" + "Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH\n" + "License AGPLv3+: GNU AGPL version 3 or later \n" + "This is free software: you are free to change and redistribute it.\n" + "There is NO WARRANTY, to the extent permitted by law.\n" + "\n"); +} + +static void handle_options(int argc, char **argv) +{ + const char *cmd; + + while (1) { + int option_index = 0, c; + static struct option long_options[] = { + {"help", 0, 0, 'h'}, + {"database", 1, 0, 'l'}, + {"debug", 1, 0, 'd'}, + {"disable-color", 0, 0, 's'}, + {"timestamp", 0, 0, 'T'}, + {"log-level", 1, 0, 'e'}, + {"version", 0, 0, 'V' }, + {0, 0, 0, 0} + }; + + c = getopt_long(argc, argv, "hl:d:sTe:V", + long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_help(); + exit(EXIT_SUCCESS); + case 'l': + cmdline_opts.db_file = optarg; + break; + case 'd': + log_parse_category_mask(osmo_stderr_target, optarg); + break; + case 's': + log_set_use_color(osmo_stderr_target, 0); + break; + case 'T': + log_set_print_timestamp(osmo_stderr_target, 1); + break; + case 'e': + log_set_log_level(osmo_stderr_target, atoi(optarg)); + break; + case 'V': + print_version(1); + exit(EXIT_SUCCESS); + break; + default: + /* catch unknown options *as well as* missing arguments. */ + fprintf(stderr, "Error in command line options. Exiting.\n"); + exit(EXIT_FAILURE); + break; + } + } + + if (argc - optind <= 0) { + fprintf(stderr, "Error: You must specify a command.\n"); + print_help(); + exit(EXIT_FAILURE); + } + + cmd = argv[optind++]; + printf("command '%s', %d extra arguments\n", cmd, argc - optind); + + if (!strcmp(cmd, "import-nitb-db")) { + if (argc - optind < 1) { + fprintf(stderr, "You must specify an input db file\n"); + print_help(); + exit(EXIT_FAILURE); + } + cmdline_opts.import_nitb_db = argv[optind++]; + } else { + fprintf(stderr, "Error: Unknown command `%s'\n", cmd); + print_help(); + exit(EXIT_FAILURE); + } +} + +static void signal_hdlr(int signal) +{ + switch (signal) { + case SIGINT: + LOGP(DMAIN, LOGL_NOTICE, "Terminating due to SIGINT\n"); + db_close(g_hlr_db_tool_ctx->dbc); + log_fini(); + talloc_report_full(g_hlr_db_tool_ctx, stderr); + exit(EXIT_SUCCESS); + break; + case SIGUSR1: + LOGP(DMAIN, LOGL_DEBUG, "Talloc Report due to SIGUSR1\n"); + talloc_report_full(g_hlr_db_tool_ctx, stderr); + break; + } +} + +sqlite3 *open_nitb_db(const char *filename) +{ + int rc; + sqlite3 *nitb_db = NULL; + + rc = sqlite3_open(filename, &nitb_db); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "Unable to open OsmoNITB DB %s; rc = %d\n", filename, rc); + return NULL; + } + + return nitb_db; +} + +enum nitb_stmt { + NITB_SELECT_SUBSCR, + NITB_SELECT_AUTH_KEYS, +}; + +static const char *nitb_stmt_sql[] = { + [NITB_SELECT_SUBSCR] = + "SELECT imsi, id, extension, authorized" + " FROM Subscriber" + " ORDER BY id", + [NITB_SELECT_AUTH_KEYS] = + "SELECT algorithm_id, a3a8_ki from authkeys" + " WHERE subscriber_id = $subscr_id", +}; + +sqlite3_stmt *nitb_stmt[ARRAY_SIZE(nitb_stmt_sql)] = {}; + +size_t _dbd_decode_binary(const unsigned char *in, unsigned char *out); + +void import_nitb_subscr_aud(sqlite3 *nitb_db, const char *imsi, int64_t nitb_id, int64_t hlr_id) +{ + int rc; + struct db_context *dbc = g_hlr_db_tool_ctx->dbc; + sqlite3_stmt *stmt; + + int count = 0; + + stmt = nitb_stmt[NITB_SELECT_AUTH_KEYS]; + if (!db_bind_int(stmt, NULL, nitb_id)) + return; + + while ((rc = sqlite3_step(stmt)) == SQLITE_ROW) { + const void *blob; + unsigned int blob_size; + static unsigned char buf[4096]; + static char ki[128]; + int decoded_size; + struct sub_auth_data_str aud2g = { + .type = OSMO_AUTH_TYPE_GSM, + .algo = OSMO_AUTH_ALG_NONE, + .u.gsm.ki = ki, + }; + + aud2g.algo = sqlite3_column_int(stmt, 0); + + if (count) { + LOGP(DDB, LOGL_ERROR, + "Warning: subscriber has more than one auth key," + " importing only the first key, for IMSI=%s\n", + imsi); + break; + } + + blob = sqlite3_column_blob(stmt, 1); + blob_size = sqlite3_column_bytes(stmt, 1); + + if (blob_size > sizeof(buf)) { + LOGP(DDB, LOGL_ERROR, + "OsmoNITB import to %s: Cannot import auth data for IMSI %s:" + " too large blob: %u\n", + dbc->fname, imsi, blob_size); + db_remove_reset(stmt); + continue; + } + + decoded_size = _dbd_decode_binary(blob, buf); + osmo_strlcpy(ki, osmo_hexdump_nospc(buf, decoded_size), sizeof(ki)); + + db_subscr_update_aud_by_id(dbc, hlr_id, &aud2g); + count ++; + } + + if (rc != SQLITE_DONE && rc != SQLITE_ROW) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB: SQL error: (%d) %s," + " during stmt '%s'", + rc, sqlite3_errmsg(nitb_db), + nitb_stmt_sql[NITB_SELECT_AUTH_KEYS]); + } + + db_remove_reset(stmt); +} + +void import_nitb_subscr(sqlite3 *nitb_db, sqlite3_stmt *stmt) +{ + struct db_context *dbc = g_hlr_db_tool_ctx->dbc; + int rc; + struct hlr_subscriber subscr; + + int64_t nitb_id; + int64_t imsi; + char imsi_str[32]; + bool authorized; + + imsi = sqlite3_column_int64(stmt, 0); + + snprintf(imsi_str, sizeof(imsi_str), "%"PRId64, imsi); + + rc = db_subscr_create(dbc, imsi_str); + if (rc) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB import to %s: failed to create IMSI %s: %d: %s\n", + dbc->fname, + imsi_str, + rc, + strerror(rc)); + /* on error, still attempt to continue */ + } + + nitb_id = sqlite3_column_int64(stmt, 1); + copy_sqlite3_text_to_buf(subscr.msisdn, stmt, 2); + authorized = sqlite3_column_int(stmt, 3) ? true : false; + + db_subscr_update_msisdn_by_imsi(dbc, imsi_str, subscr.msisdn); + db_subscr_nam(dbc, imsi_str, authorized, true); + db_subscr_nam(dbc, imsi_str, authorized, false); + + /* find the just created id */ + rc = db_subscr_get_by_imsi(dbc, imsi_str, &subscr); + if (rc) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB import to %s: created IMSI %s," + " but failed to get new subscriber id: %d: %s\n", + dbc->fname, + imsi_str, + rc, + strerror(rc)); + return; + } + + OSMO_ASSERT(!strcmp(imsi_str, subscr.imsi)); + + import_nitb_subscr_aud(nitb_db, imsi_str, nitb_id, subscr.id); +} + +int import_nitb_db(void) +{ + int i; + int ret; + int rc; + const char *sql; + sqlite3_stmt *stmt; + + sqlite3 *nitb_db = open_nitb_db(cmdline_opts.import_nitb_db); + + if (!nitb_db) + return -1; + ret = 0; + + for (i = 0; i < ARRAY_SIZE(nitb_stmt_sql); i++) { + sql = nitb_stmt_sql[i]; + rc = sqlite3_prepare_v2(nitb_db, sql, -1, &nitb_stmt[i], NULL); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB: Unable to prepare SQL statement '%s'\n", sql); + ret = -1; + goto out_free; + } + } + + stmt = nitb_stmt[NITB_SELECT_SUBSCR]; + + while ((rc = sqlite3_step(stmt)) == SQLITE_ROW) { + import_nitb_subscr(nitb_db, stmt); + /* On failure, carry on with the rest. */ + } + if (rc != SQLITE_DONE) { + LOGP(DDB, LOGL_ERROR, "OsmoNITB DB: SQL error: (%d) %s," + " during stmt '%s'", + rc, sqlite3_errmsg(nitb_db), + nitb_stmt_sql[NITB_SELECT_SUBSCR]); + goto out_free; + } + + db_remove_reset(stmt); + sqlite3_finalize(stmt); + +out_free: + sqlite3_close(nitb_db); + return ret; +} + +int main(int argc, char **argv) +{ + int rc; + int (*main_action)(void); + main_action = NULL; + + g_hlr_db_tool_ctx = talloc_zero(NULL, struct hlr_db_tool_ctx); + OSMO_ASSERT(g_hlr_db_tool_ctx); + talloc_set_name_const(g_hlr_db_tool_ctx, "OsmoHLR-db-tool"); + + rc = osmo_init_logging(&hlr_log_info); + if (rc < 0) { + fprintf(stderr, "Error initializing logging\n"); + exit(EXIT_FAILURE); + } + + handle_options(argc, argv); + + if (cmdline_opts.import_nitb_db) { + if (main_action) + goto too_many_actions; + main_action = import_nitb_db; + } + /* Future: add more main_actions, besides --import-nitb-db, here. */ + + /* Just in case any db actions need randomness */ + rc = rand_init(); + if (rc < 0) { + LOGP(DMAIN, LOGL_FATAL, "Error initializing random source\n"); + exit(EXIT_FAILURE); + } + + g_hlr_db_tool_ctx->dbc = db_open(g_hlr_db_tool_ctx, cmdline_opts.db_file); + if (!g_hlr_db_tool_ctx->dbc) { + LOGP(DMAIN, LOGL_FATAL, "Error opening database\n"); + exit(EXIT_FAILURE); + } + + osmo_init_ignore_signals(); + signal(SIGINT, &signal_hdlr); + signal(SIGUSR1, &signal_hdlr); + + rc = 0; + if (main_action) + rc = (*main_action)(); + + db_close(g_hlr_db_tool_ctx->dbc); + log_fini(); + exit(rc ? EXIT_FAILURE : EXIT_SUCCESS); + +too_many_actions: + fprintf(stderr, "Too many actions requested.\n"); + log_fini(); + exit(EXIT_FAILURE); +} + +/* stubs */ +void lu_op_alloc_conn(void) { OSMO_ASSERT(0); } +void lu_op_tx_del_subscr_data(void) { OSMO_ASSERT(0); } +void lu_op_free(void) { OSMO_ASSERT(0); } -- To view, visit https://gerrit.osmocom.org/4441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:43:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:43:18 +0000 Subject: [PATCH] osmo-hlr[master]: Debian: Make sure we include osmo-hlr-db-tool in the package Message-ID: Review at https://gerrit.osmocom.org/4538 Debian: Make sure we include osmo-hlr-db-tool in the package Change-Id: Ia67ae6d4b1af982db8c342f2d8fd29deb83ccaff --- M debian/osmo-hlr.install 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/38/4538/1 diff --git a/debian/osmo-hlr.install b/debian/osmo-hlr.install index 114df0b..0e2a1c4 100644 --- a/debian/osmo-hlr.install +++ b/debian/osmo-hlr.install @@ -1,2 +1,3 @@ /usr/bin/osmo-hlr +/usr/bin/osmo-hlr-db-tool /usr/share/doc/osmo-hlr/hlr.sql -- To view, visit https://gerrit.osmocom.org/4538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia67ae6d4b1af982db8c342f2d8fd29deb83ccaff Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:43:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:43:19 +0000 Subject: [PATCH] osmo-hlr[master]: Tag/Release version 0.1.0 Message-ID: Review at https://gerrit.osmocom.org/4539 Tag/Release version 0.1.0 This is the first real version tag of osmo-hlr. Change-Id: Ie0aff33ab9c36cd9219258a4d869de36612b6095 --- M debian/changelog 1 file changed, 136 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/39/4539/1 diff --git a/debian/changelog b/debian/changelog index 9706926..7d8b208 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,139 @@ +osmo-hlr (0.1.0) unstable; urgency=medium + + [ Neels Hofmeyr ] + * build with autoconf/automake, add jenkins.sh script + * fix build on FreeBSD: eliminate implicitly declared functions + * fix various compiler warnings + * fix DLGSUP logging cat after change in libosmocore + * build: recoin db_test as non-installable program + * build: actually make sqlite mandatory + * bump required libosmocore version to 0.9.5 + * gsup: send subscriber MSISDN + * debug log: log computed vector kinds + * log: move a log from info to debug level + * hlr.sql: typo in comment + * auc.c: typo in comment + * main: add and use root talloc ctx + * main: add option parsing with db file and default options + * main: add VTY and '-c config-file' option + * sql: fix 3g_auc's column K data type + * cosmetic: sql: indicate VARCHAR size of key columns as 32 + * sql: auc_3g: set sqn NOT NULL DEFAULT 0 + * comment: sql: describe auc_2g and auc_3g columns + * Add test suite skeleton with empty test (auc_3g_test) + * tests: auc_3g_test: implement vector generation test + * auth: verify test sets from 3GPP TS 55.205 + * sql: add unique constraints to IMSI and MSISDN + * UMTS AKA resync: fix argument ordering + * auc_3g_test: add AUTS resync test + * auc_gen_vectors(): ensure sane arguments, test + * auc_3g_test: allow to inc fake rand bytes upon rand request + * auc_3g_test: add AUTS test with N vectors, to show bug + * cosmetic: refactor auc_compute_vectors(), add debug log + * auc_compute_vectors(): fix AUTS resync for multiple vectors + * cosmetic: auc_3g_test: improve test debugging tools + * cosmetic: rename auc_3g_test.c to auc_test.c + * fix: properly handle error rc by osmo_gsup_conn_ccm_get() + * auc tests: adjust cosmetically to prepare for SQN changes + * auc tests: fix after SQN scheme changes from libosmocore + * fix debug log: adjust to new SQN increment scheme + * UMTS AKA: implement SQN increment according to SEQ and IND + * debug log: output ind slot, previous sqn, and sqn db update + * jenkins: add value_string termination check + * fix db_subscr_ps error handling + * add config example (mostly empty) + * install hlr.sql in prefix/doc/osmo-hlr/ + * use OSMO_GSUP_PORT == 4222 instead of hardcoded 2222 + * add basic CTRL interface tests + * add CTRL tests for enable-/disable-/status-ps + * cosmetic: prepend DB_STMT_ to enum stmt_idx entries + * cosmetic: rename db_subscr_get() to db_subscr_get_by_imsi() + * cosmetic: refactor db_bind_imsi() as db_bind_text() + * cosmetic: multi-line DB_STMT_AUC_BY_IMSI + * cosmetic: log IMSI='', log "no such subscriber" + * cosmetic: log: "SQLite" with capital L + * cosmetic: db_hlr: SL3_TXT: clarify indenting + * ctrl_test_runner.py: use proper constant as test db path + * gitignore: tests/package.m4 + * cosmetic: don't log about missing SQLite log cb + * add db_bind_int() and db_bind_int64() + * add db_subscr_create(), db_subscr_delete(), db_subscr_update_msisdn_by_imsi() + * add initial db_test: creating and deleting subscribers + * less noise: simplify db_remove_reset() + * db: use int64_t as subscriber id + * add db_subscr_get_by_msisdn() and db_subscr_get_by_id() + * refactor db_subscr_ps() to db_subscr_nam() + * refactor db_subscr_lu() + * refactor db_subscr_purge + * add db_subscr_update_aud_by_id(), complete db_subscr_delete_by_id() + * refactor db_get_auth_data return val + * code undup: use db_remove_reset() in db_auc.c + * fix db_update_sqn(): reset stmt in all error cases + * code undup: use db_bind_text() in db_get_auth_data() + * debian: 'make check' needs sqlite3, add to Build-Depends + * fix db_subscr_get_by_*(): clear output data; test in db_test.c + * implement subscriber vty interface, tests + * add test_nodes.vty + * replace ctrl_test_runner.py with transcript test_subscriber.ctrl + * add lu_op_free(), use in luop.c + * luop: fix mem leak upon error in lu_op_alloc_conn() + * fix mem leak in handle_cmd_ps(): free luop + * api doc: say that lu_op_tx_del_subscr_data() doesn't free + * add hlr_subsrc_nam to put GSUP client notification in proper API + * vty: fix output of empty IMSI + * db api: fix/add API docs + * cosmetic: tweak params of hlr_controlif_setup() + * ctrl: completely replace all CTRL commands + * test_subscriber.ctrl: test against octal/hex interpretation of id + * jenkins: use osmo-clean-workspace.sh before and after build + * tests/Makefile: use test db var instead of repeating the path + * db_test: fix *FLAGS + * automatically create db tables on osmo-hlr invocation + * cosmetic: sql/hlr.sql: move comments + * cosmetic: rename SL3_TXT macro, use osmo_strlcpy() + * fix default logging levels to NOTICE, not DEBUG + * add osmo-hlr-db-tool, program to migrate from osmo-nitb db + + [ Max ] + * Add gerrit settings + * Add hardcoded APN + * Log error cause as a string + * Move GSUP msg init into separate function + * Use strings for GSUP message type + * Move lu_operation into separate file + * db: move duplicated code into helper functions + * Fix compiler's warning about printf security + * Add routines to update nam_ps + * Add global HLR struct + * Make subscr parameter to db_subscr_get() optional + * Add CTRL interface + * CTRL: add enable/disable packet service cmds + * Add .deb packaging + * deb: fix OBS build + * debian: remove obsolete dependency + * Attempt to fix .deb package + * deb: use python in shebang + * Another attempt at fixing .deb + * Use release helper from libosmocore + * Use value string check from osmo-ci + + [ Daniel Willmann ] + * Add systemd service file + * hlr_data.sql: Insert ki and opc instead of op to example data + * tests/auc: Don't require python3 + + [ Pau Espin Pedrol ] + * VTY: Add hlr node and bind ip field + * debian: remove unneeded dependency libdbd-sqlite3 + + [ Harald Welte ] + * jenkins.sh: Proper error message if local environment isn't set up + + [ Alexander Couzens ] + * debian/rules: show testsuite.log when tests are failing + + -- Harald Welte Sat, 28 Oct 2017 20:37:33 +0200 + osmo-hlr (0.0.1) UNRELEASED; urgency=low * Initial release (Closes: OS#1948) -- To view, visit https://gerrit.osmocom.org/4539 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0aff33ab9c36cd9219258a4d869de36612b6095 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:44:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:44:31 +0000 Subject: osmo-hlr[master]: Debian: Make sure we include osmo-hlr-db-tool in the package In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia67ae6d4b1af982db8c342f2d8fd29deb83ccaff Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:44:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:44:37 +0000 Subject: [MERGED] osmo-hlr[master]: Debian: Make sure we include osmo-hlr-db-tool in the package In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Make sure we include osmo-hlr-db-tool in the package ...................................................................... Debian: Make sure we include osmo-hlr-db-tool in the package Change-Id: Ia67ae6d4b1af982db8c342f2d8fd29deb83ccaff --- M debian/osmo-hlr.install 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-hlr.install b/debian/osmo-hlr.install index 114df0b..0e2a1c4 100644 --- a/debian/osmo-hlr.install +++ b/debian/osmo-hlr.install @@ -1,2 +1,3 @@ /usr/bin/osmo-hlr +/usr/bin/osmo-hlr-db-tool /usr/share/doc/osmo-hlr/hlr.sql -- To view, visit https://gerrit.osmocom.org/4538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia67ae6d4b1af982db8c342f2d8fd29deb83ccaff Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:46:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:46:26 +0000 Subject: osmo-hlr[master]: Tag/Release version 0.1.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4539 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0aff33ab9c36cd9219258a4d869de36612b6095 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:46:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:46:28 +0000 Subject: [MERGED] osmo-hlr[master]: Tag/Release version 0.1.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release version 0.1.0 ...................................................................... Tag/Release version 0.1.0 This is the first real version tag of osmo-hlr. Change-Id: Ie0aff33ab9c36cd9219258a4d869de36612b6095 --- M debian/changelog 1 file changed, 136 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 9706926..7d8b208 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,139 @@ +osmo-hlr (0.1.0) unstable; urgency=medium + + [ Neels Hofmeyr ] + * build with autoconf/automake, add jenkins.sh script + * fix build on FreeBSD: eliminate implicitly declared functions + * fix various compiler warnings + * fix DLGSUP logging cat after change in libosmocore + * build: recoin db_test as non-installable program + * build: actually make sqlite mandatory + * bump required libosmocore version to 0.9.5 + * gsup: send subscriber MSISDN + * debug log: log computed vector kinds + * log: move a log from info to debug level + * hlr.sql: typo in comment + * auc.c: typo in comment + * main: add and use root talloc ctx + * main: add option parsing with db file and default options + * main: add VTY and '-c config-file' option + * sql: fix 3g_auc's column K data type + * cosmetic: sql: indicate VARCHAR size of key columns as 32 + * sql: auc_3g: set sqn NOT NULL DEFAULT 0 + * comment: sql: describe auc_2g and auc_3g columns + * Add test suite skeleton with empty test (auc_3g_test) + * tests: auc_3g_test: implement vector generation test + * auth: verify test sets from 3GPP TS 55.205 + * sql: add unique constraints to IMSI and MSISDN + * UMTS AKA resync: fix argument ordering + * auc_3g_test: add AUTS resync test + * auc_gen_vectors(): ensure sane arguments, test + * auc_3g_test: allow to inc fake rand bytes upon rand request + * auc_3g_test: add AUTS test with N vectors, to show bug + * cosmetic: refactor auc_compute_vectors(), add debug log + * auc_compute_vectors(): fix AUTS resync for multiple vectors + * cosmetic: auc_3g_test: improve test debugging tools + * cosmetic: rename auc_3g_test.c to auc_test.c + * fix: properly handle error rc by osmo_gsup_conn_ccm_get() + * auc tests: adjust cosmetically to prepare for SQN changes + * auc tests: fix after SQN scheme changes from libosmocore + * fix debug log: adjust to new SQN increment scheme + * UMTS AKA: implement SQN increment according to SEQ and IND + * debug log: output ind slot, previous sqn, and sqn db update + * jenkins: add value_string termination check + * fix db_subscr_ps error handling + * add config example (mostly empty) + * install hlr.sql in prefix/doc/osmo-hlr/ + * use OSMO_GSUP_PORT == 4222 instead of hardcoded 2222 + * add basic CTRL interface tests + * add CTRL tests for enable-/disable-/status-ps + * cosmetic: prepend DB_STMT_ to enum stmt_idx entries + * cosmetic: rename db_subscr_get() to db_subscr_get_by_imsi() + * cosmetic: refactor db_bind_imsi() as db_bind_text() + * cosmetic: multi-line DB_STMT_AUC_BY_IMSI + * cosmetic: log IMSI='', log "no such subscriber" + * cosmetic: log: "SQLite" with capital L + * cosmetic: db_hlr: SL3_TXT: clarify indenting + * ctrl_test_runner.py: use proper constant as test db path + * gitignore: tests/package.m4 + * cosmetic: don't log about missing SQLite log cb + * add db_bind_int() and db_bind_int64() + * add db_subscr_create(), db_subscr_delete(), db_subscr_update_msisdn_by_imsi() + * add initial db_test: creating and deleting subscribers + * less noise: simplify db_remove_reset() + * db: use int64_t as subscriber id + * add db_subscr_get_by_msisdn() and db_subscr_get_by_id() + * refactor db_subscr_ps() to db_subscr_nam() + * refactor db_subscr_lu() + * refactor db_subscr_purge + * add db_subscr_update_aud_by_id(), complete db_subscr_delete_by_id() + * refactor db_get_auth_data return val + * code undup: use db_remove_reset() in db_auc.c + * fix db_update_sqn(): reset stmt in all error cases + * code undup: use db_bind_text() in db_get_auth_data() + * debian: 'make check' needs sqlite3, add to Build-Depends + * fix db_subscr_get_by_*(): clear output data; test in db_test.c + * implement subscriber vty interface, tests + * add test_nodes.vty + * replace ctrl_test_runner.py with transcript test_subscriber.ctrl + * add lu_op_free(), use in luop.c + * luop: fix mem leak upon error in lu_op_alloc_conn() + * fix mem leak in handle_cmd_ps(): free luop + * api doc: say that lu_op_tx_del_subscr_data() doesn't free + * add hlr_subsrc_nam to put GSUP client notification in proper API + * vty: fix output of empty IMSI + * db api: fix/add API docs + * cosmetic: tweak params of hlr_controlif_setup() + * ctrl: completely replace all CTRL commands + * test_subscriber.ctrl: test against octal/hex interpretation of id + * jenkins: use osmo-clean-workspace.sh before and after build + * tests/Makefile: use test db var instead of repeating the path + * db_test: fix *FLAGS + * automatically create db tables on osmo-hlr invocation + * cosmetic: sql/hlr.sql: move comments + * cosmetic: rename SL3_TXT macro, use osmo_strlcpy() + * fix default logging levels to NOTICE, not DEBUG + * add osmo-hlr-db-tool, program to migrate from osmo-nitb db + + [ Max ] + * Add gerrit settings + * Add hardcoded APN + * Log error cause as a string + * Move GSUP msg init into separate function + * Use strings for GSUP message type + * Move lu_operation into separate file + * db: move duplicated code into helper functions + * Fix compiler's warning about printf security + * Add routines to update nam_ps + * Add global HLR struct + * Make subscr parameter to db_subscr_get() optional + * Add CTRL interface + * CTRL: add enable/disable packet service cmds + * Add .deb packaging + * deb: fix OBS build + * debian: remove obsolete dependency + * Attempt to fix .deb package + * deb: use python in shebang + * Another attempt at fixing .deb + * Use release helper from libosmocore + * Use value string check from osmo-ci + + [ Daniel Willmann ] + * Add systemd service file + * hlr_data.sql: Insert ki and opc instead of op to example data + * tests/auc: Don't require python3 + + [ Pau Espin Pedrol ] + * VTY: Add hlr node and bind ip field + * debian: remove unneeded dependency libdbd-sqlite3 + + [ Harald Welte ] + * jenkins.sh: Proper error message if local environment isn't set up + + [ Alexander Couzens ] + * debian/rules: show testsuite.log when tests are failing + + -- Harald Welte Sat, 28 Oct 2017 20:37:33 +0200 + osmo-hlr (0.0.1) UNRELEASED; urgency=low * Initial release (Closes: OS#1948) -- To view, visit https://gerrit.osmocom.org/4539 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie0aff33ab9c36cd9219258a4d869de36612b6095 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:46:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:46:46 +0000 Subject: osmo-trx[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4490 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I609f7c7c88b49f26e2e48e1f1cffed76d9e6fb5e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:52:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:52:26 +0000 Subject: [PATCH] osmo-bts[master]: configure.ac: Fix Mailing list address Message-ID: Review at https://gerrit.osmocom.org/4540 configure.ac: Fix Mailing list address We've had openbsc.org ages ago but have moved everything to osmocom.org at some point in 2010/2011. This should have been updated back then Change-Id: I5da8e9fba8f15719414fa81e2a6211f906329c2e --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/40/4540/1 diff --git a/configure.ac b/configure.ac index 80f1afd..e3ea9ca 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script AC_INIT([osmo-bts], m4_esyscmd([./git-version-gen .tarball-version]), - [openbsc-devel at lists.openbsc.org]) + [openbsc at lists.osmocom.org]) dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ AC_CONFIG_AUX_DIR([.]) -- To view, visit https://gerrit.osmocom.org/4540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5da8e9fba8f15719414fa81e2a6211f906329c2e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:54:46 +0000 Subject: [PATCH] osmo-bts[master]: Tag/Release 0.7.0 Message-ID: Review at https://gerrit.osmocom.org/4541 Tag/Release 0.7.0 This marks a new release that's compatible with libosmocore >= 0.10.0, and which no longer depends on openbsc-dev. Change-Id: I67405cb5f0f4dea85c67febfdef80f49ae1d41a6 --- M debian/changelog 1 file changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/41/4541/1 diff --git a/debian/changelog b/debian/changelog index 61c46c6..1f6e970 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,39 @@ +osmo-bts (0.7.0) unstable; urgency=medium + + [ Max ] + * Use value string check from osmo-ci + * Support sending SI13 to PCU + * Support removing SI13 from PCU + * trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT + * Check readv() return value to prevent crash + * OML: print actual type of report sent to BSC + * Replace dead code + * vty: print version and description for each phy + * Remove build dependency on legacy OpenBSC + * Fix multiple SI2q reception + * jenkins: remove openbsc dependency + * sysmo: use clock calibration source wrapper + * sysmo: don't override clock source with defaults + * Fix race condition in attribute reporting + * Move power loop to generic tests + * Make power test more verbose + + [ Neels Hofmeyr ] + * vty: mgr: sysmobts, lc15: install default commands for ACT_NORM_NODE + * osmo-bts-trx: vty: various fixes of 'write file' and doc + * jenkins: use osmo-clean-workspace.sh before and after build + + [ Pau Espin Pedrol ] + * l1sap: Improve log msg when frame diff >1 + * vty: Print string for Administrative state + + [ Harald Welte ] + * Fix Downlink AMR FSM name to avoid illegal space character + * update dependencies to latest libosmo-* + * configure.ac: Fix Mailing list address + + -- Harald Welte Sat, 28 Oct 2017 20:53:21 +0200 + osmo-bts (0.6.0) unstable; urgency=medium [ Holger Hans Peter Freyther ] -- To view, visit https://gerrit.osmocom.org/4541 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67405cb5f0f4dea85c67febfdef80f49ae1d41a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:55:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:55:07 +0000 Subject: osmo-bts[master]: configure.ac: Fix Mailing list address In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5da8e9fba8f15719414fa81e2a6211f906329c2e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 18:55:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 18:55:13 +0000 Subject: osmo-bts[master]: Tag/Release 0.7.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4541 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I67405cb5f0f4dea85c67febfdef80f49ae1d41a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:03:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:03:23 +0000 Subject: [MERGED] osmo-bts[master]: Tag/Release 0.7.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release 0.7.0 ...................................................................... Tag/Release 0.7.0 This marks a new release that's compatible with libosmocore >= 0.10.0, and which no longer depends on openbsc-dev. Change-Id: I67405cb5f0f4dea85c67febfdef80f49ae1d41a6 --- M debian/changelog 1 file changed, 36 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 61c46c6..1f6e970 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,39 @@ +osmo-bts (0.7.0) unstable; urgency=medium + + [ Max ] + * Use value string check from osmo-ci + * Support sending SI13 to PCU + * Support removing SI13 from PCU + * trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT + * Check readv() return value to prevent crash + * OML: print actual type of report sent to BSC + * Replace dead code + * vty: print version and description for each phy + * Remove build dependency on legacy OpenBSC + * Fix multiple SI2q reception + * jenkins: remove openbsc dependency + * sysmo: use clock calibration source wrapper + * sysmo: don't override clock source with defaults + * Fix race condition in attribute reporting + * Move power loop to generic tests + * Make power test more verbose + + [ Neels Hofmeyr ] + * vty: mgr: sysmobts, lc15: install default commands for ACT_NORM_NODE + * osmo-bts-trx: vty: various fixes of 'write file' and doc + * jenkins: use osmo-clean-workspace.sh before and after build + + [ Pau Espin Pedrol ] + * l1sap: Improve log msg when frame diff >1 + * vty: Print string for Administrative state + + [ Harald Welte ] + * Fix Downlink AMR FSM name to avoid illegal space character + * update dependencies to latest libosmo-* + * configure.ac: Fix Mailing list address + + -- Harald Welte Sat, 28 Oct 2017 20:53:21 +0200 + osmo-bts (0.6.0) unstable; urgency=medium [ Holger Hans Peter Freyther ] -- To view, visit https://gerrit.osmocom.org/4541 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I67405cb5f0f4dea85c67febfdef80f49ae1d41a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:03:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:03:23 +0000 Subject: [MERGED] osmo-bts[master]: configure.ac: Fix Mailing list address In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Fix Mailing list address ...................................................................... configure.ac: Fix Mailing list address We've had openbsc.org ages ago but have moved everything to osmocom.org at some point in 2010/2011. This should have been updated back then Change-Id: I5da8e9fba8f15719414fa81e2a6211f906329c2e --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 80f1afd..e3ea9ca 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script AC_INIT([osmo-bts], m4_esyscmd([./git-version-gen .tarball-version]), - [openbsc-devel at lists.openbsc.org]) + [openbsc at lists.osmocom.org]) dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ AC_CONFIG_AUX_DIR([.]) -- To view, visit https://gerrit.osmocom.org/4540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5da8e9fba8f15719414fa81e2a6211f906329c2e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:22:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:22:07 +0000 Subject: [PATCH] openbsc[master]: Tag/Release Version 1.0.0 Message-ID: Review at https://gerrit.osmocom.org/4542 Tag/Release Version 1.0.0 This marks the first tagged source code revision after the repository split and subsequent removal of GPRS related code. Change-Id: I5d19269983c9281bf36a7279151891902eff0013 --- M debian/changelog 1 file changed, 955 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/42/4542/1 diff --git a/debian/changelog b/debian/changelog index dd850be..08636ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,958 @@ +openbsc (1.0.0) UNRELEASED; urgency=medium + + [ Holger Hans Peter Freyther ] + * Revert "gprs: Use RAND_bytes for p-tmsi" + * sgsn: Fix pattern for too long msisdn + * osmux: Allow to listen to a specific address + * sgsn: Fix up the VTY doc strings + * stats/mgcp: Initialize the statistics for MGCP as well + * gbproxy: Count more GSM 04.08 messages + * gtp: Fix Makefile.am so maybe distcheck is now going to work + * gtphub: Fix the VTY prompt to make the tests move forward + * bsc/vty: Provide a hint of available input + * gtphub: Fix compilation using gcc5 + * dahdi: The driver has moved to libosmo-abis + * gtphub: Make the two setter static as well + * db: Avoid undefined behavior when copying cm2/cm3 from the db + * gtphub: Fix use after free on failure + * gsm0408: Provide unique strings for the gsm 04.08 message + * msc: Remove oversimplified todo entry and add a comment + * meas: Do not retry to close the database + * mgcp: Fix compiler warnings on size_t on AMD64 + * abis: Send the message without enforcing to wait for a response + * bsc: Add code to send ip.access reboot command to nanoBTS + * bsc: Add parameter to restart a bts + * subscr: Add testcase creating an already created subscriber + * subscr: Make db_create_subscriber fail on duplicates + * db: If creating a subscriber in the db fails, return NULL + * ctrl: Extend ctrl command to optionally handle alg+ki + * jenkins: Add the build script from jenkins here + * nat/vty: Don't assume one can magically add IPv4 addresses to lo + * nat/vty: Use different port for the mock MSC + * nat/vty: Convert into str for the VTY command + * nat/vty: And move to a different port.. + * nat/vty: Remove second assumption about lo and binding + * nat/vty: Fix construct not working with python 2.6 + * nat/vty: Do not print token update statement + * nat/ussd: Add an example of the USSD gateway side-channel + * debian: Make upgrading from debian SID easier + * filter/nat: Fix the context for the imsi assignment + * bsc: Create minimal SI6 rest octets + * ci: Attempt to disable doxygen warnings of dependencies + * lchan: Release channel in case of late activation ack + * ussd: Add band-aid for interrogationSS + * debian: Install header and source file to different directory + * debian: Require libgtp-dev after the SO version bump + * sgsn: Fix deeply flawed copying logic for PDP context activation + * sgsn: Fill the cch_pdp with a value coming from the tlv structure + * sgsn: Convert cch_pdp to host order for libgtp + + [ Jacob Erlbeck ] + * sgsn/test: Add and call cleanup_test function + * sgsn/test: Really parse received DL LLC messages + * stats: Enable stats for sgsn, gbproxy, nitb, bsc, nat + * stats: Set class_id in rate_ctr group descriptions + * sgsn: Remove tlli_foreign2local + * sgsn/test: Add bssgp_raid parameter to send_0408_message + * sgsn: Make ra_id_equals available as gprs_ra_id_equals + * sgsn: Only look at TLLIs in sgsn_mm_ctx_by_tlli + * sgsn: Change handling of missing mmctx in gsm48_rx_gmm_ra_upd_req + * sgsn/test: Add test case test_gmm_routing_areas + * sgsn: Re-add searching for MM ctx based on TLLI / P-TMSI matches + + [ Daniel Willmann ] + * gprs: Use RAND_bytes for p-tmsi + * gbproxy/test: Add and call cleanup_test function + * gprs/gb_proxy: Use RAND_bytes for gbproxy TLLI/TMSI allocation + * rename enum gprs_mm_state to gprs_gmm_state + * rename enum gprs_mm_state to gprs_gmm_state + * create_pdp_conf(): factor out PDP context accept dispatch as send_act_pdp_cont_acc() + * sgsn_mm_ctx_cleanup_free(): clean up LLME iff present (Gb, not Iu) + * gprs: more conditionals for Gb specific actions + * configure.ac: add --enable-iu with deps asn1c, ranap, sigtran + * add DRANAP debug constant + * add DSUA debug constant + * osmux: Add negotiation state so race conditions can't disable osmux + * gprs_gmm: Fix bit mask when determining update/attach type + * IuPS: track msg->dst aka ue_conn_ctx, comment + * IuPS: osmo-sgsn: add core IuPS impl, call iu_init() + * IuPS: redirect Iu in various places, link Iu in sgsn-test + * IuPS: add Iu response to create_pdp_conf() + * IuPS: add Iu response to delete_pdp_conf() + * IuPS: dev hack: init hardcoded Ki on ATT REQ + * IuPS: send Security Mode Command, track the new_key flag. + * IuPS: add GMM Service Request rx and tx + * IuPS: RA UPD: make sure to authorize, for Iu Integrity Protection + * IuPS: sgsn_mm_ctx: add enum gprs_pmm_state field, track PMM state + * IuPS: GMM Attach: reset MM ctx pending_req + * IuPS: Introduce function to change PMM state + * IuPS: Change GTP-U endpoint to SGSN in PMM_IDLE and page UE when data arrives + * gbproxy: Check whether gbproxy_update_link_state_after() deletes the link_info + * test/gbproxy: Test for possible memory corruption when link_info is freed + + [ Harald Welte ] + * SGSN: Fix typo in VTY license statement. + * meas_db.c: fix compiler warnings + * Depend on libgtp >= 0.92, as previous versions don't have gtpie.h installed + * oap and gtphub tests must only be compiled of LIBGTP is present! + * Fix TSC/BSIC handling bug and remove bts->tsc + * vty: Print NCC/BCC and not just integer value of BSIC + * Fix compilation with no libc-ares present on the system + * tests/smpp: Fix linking order + * gsm_data_shared: compute/sprintf the lchan name only once + * remove old obsolete linux kernel and wireshark patches + * AUTHORS: Add Jacob and Neels + * bring the README into the 21st century + * mncc.c: Convert mncc_names[] to 'struct value_string' + * mncc: introduce 'struct gsm_mncc_bridge' for MNCC_BRIDGE + * indicate the GSM 04.08 channel mode in 'show lchan' + * add DOT graph showing NITB data structures and their references + * rename ipaccess-find into abisip-find + * Revert "move to hex TMSI representation" + * Start to use struct osmo_auth_vector from gsm_auth_tuple + * move gsm_04_08_gprs.h to libosmocore + * use new libosmocore gsm_23_003.h for IMEI/IMSI length + * Rename gprs_gsup_* to osmo_gsup_* + * rename gprs_shift_*() to osmo_shift_*() + * move osmo_shift_* / osmo_match_shift_* to libosmogsm + * gsup_messages: Add UMTS AKA related encoding/decoding support + * osmo_gsup_messge.[ch] documentation update (doxygen) + * move utils.h functions to libosmocore + * Move osmo_gsup_messages.[ch] to libosmocore + * oap_message.h: Remove dependency to openbsc include + * OAP: use osmo_oap_ prefix for OAP, rather than plain oap_ + * OAP: Various coding style fixes + * osmo_oap_decode(): Use common argument ordering + * sgsn/GSUP: Support MAP-style nested LU/ISD + * Add human-readable name of SGSN_AUTH_AUTHENTICATE + * sgsn_test: Adapt test case to now-existing InsertSubscriberData + * subscr_name(): Handle case for subscr == NULL + * rtp_proxy.c: Ensure msgb_alloc is large enough for largest AMR frame + * prepare sgsn_mm_ctx for Gb and Iu mode (UMTS) + * rename gsm0408_gprs_rcvmsg() to gsm0408_gprs_rcvmsg_gb() + * gprs_gmm.c: Make TLLI handling specific to Gb interface + * gprs_gmm.c: Perform LLME operations only if we have one + * remove old copy of documentation that now is in osmo-gsm-manuals.git + * add example config for sysmobts + * add .mailmap file for mapping git author name/mail in shortlog + * osmo-nitb: generate backtrace on SIGABRT + * COSMETIC: 'if' is not a function, so there is space before '(' + * mncc_builtin: Properly reject DTMF + * WIP: OM2000: Full state machine implementation using osmo_fsm + * OM2000: Fix state machien for CF/TRXC on START Result + * SGSN: Use dummy all-zero MSISDN value in PDP Context Act on GTP + * RBS2000: re-establish any lost signalling links + * talloc_cxt: Fix compiler warning / missing #include + * bs11_config: remove compiler waring about unused variable + * RBS2000: Avoid segfault if ts->lapd instance doesn't exist + * RBS2000: Ensure the is-connection-list command is only used on RBS2000 + * Support configuration of CON MO Groups/Paths from VTY + * OM2000: CON MO: Allow larger range for CCP and CI values + * OM2000: Add three IEs to TCH activation about which we have no clue + * OM2000: Fix missing dynamic TCH initialization + * abis_nm: Fix possible not-null-terminated buffer + * abis_nm: Fix non-null terminated buffer + * libmsc/db: avoid subscr->name without terminating NULL char + * Fix possible non-null-terminated buffer + * ipaccess-config: Handle setsockopt return value + * ipaccess-proxy: Check setsockopt() return value + * abis_nm: ceck fseek() return code in is_last_line() + * bsc_msc.c: Check setsockopt() return value + * sgsn_test: Fix missing = in == type check + * abisip-find: check bsc_fd_register() result + * bsc_ctrl: Ensure we don't pass NULL string into strtok_r() + * mgcp_protocol: Ensure we don't call strtok_r with NULL data + * cfg_bts_si2quater_neigh_add(): Don't call strerror() on negative value + * gsm0408_test.c: Don't pass negative value to strerror() + * channel_mode_from_lchan(): Add missing break statement + * add gsup_test_client program + * move OAP messages implementations to libosmocore + * bsc_vty: Fix missing break statements in switch() + * sgsn: Add GTP information to "show pdp-context" + * remove unused struct members of 'struct sgsn_pdp_ctx' + * Implement VTY configuration to control Early Classmark Sending + * OM2000: use assoc_so *only* for TS objects + * VTY: Print 3G auth tuples, not just 2G auth tuples + * OM2000: Add FIXME comments for missing resolving of RX/TX MO! + * OM2000: Change the order of MO initialization + * OM2000: Send ALTCRQ for SuperChannel after receiving IS Enable Req Ack + * RBS2000: Add the P-GSL Timer IE to RSL CHAN ACT for PDCH + * RBS2000 RSL: Support for sending RSL PAGING CMD for GPRS + * pcu_sock: Don't re-implement core functionality like gsm_bts_trx_num() + * pcu_sock: get rid of magic numbers and use ARRAY_SIZE() for array iteration + * pcu_sock: Forward paging request from PCU via RSL to BTS + * pcu_sock: Send non-NULL hLayer1 to PCU + * Use new e1inp_signal_names from libosmo-abis to print input signal names + * costmetic: Document gsm48_multirate_config() + const-ify input + * bsc_api.c: Documentation for handle_mr_config() + * bsc_vty: Factor vty_get_ts() out of pdch_act_cmd() + * bsc_vty.c: Further simplify vty_get_ts() + * bsc_vty.c: Add command for manual [de]actiovation of logical channels + * bsc_vty: Add command to manually issue IPAC MDCX + * libbsc: Create pcu-socket only as specified in config file + * don't re-implement osmo_talloc_replace_string() + * Add vty command "radio-link-timeout infinite" for uplink rx testing + * jenkins.sh: Proper error message if local environment isn't set up + * Support for TS 04.14 conformance test commands + * Add VTY commands for experimentation with TS 04.14 commands + * bsc_api: Fix copy+paste error in printing name of RR STATUS PDU + * libbsc: Add VTY command to re-send the SYSTEM INFORMATION to BTS + * check for missing result of rate_ctr_group_alloc() + * Fix regression causing loss of static system-information messages + (Closes: #2367) + * RSL: Allow disabling of BCCH/SACCH filling for given SI type + * gsm_bts_trx_set_system_infos(): Disable non-existing SI + * gtphob: check for missing result of rate_ctr_group_alloc() + * bsc_vty: Add VTY command to test CTRL TRAP feature + * GSM timers: User reasonable defaults; don't save if equal default + * bsc_vty: Don't allow timers of zero (0) + * remove code disabling T3109 if configured to 0 + * SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE + * Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH + * sgsn_vty: Don't assume pdp->lib is always valid + * Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() + * increase libsmpp34 version requirement to 1.12 + * NITB: remove 'help' output about '-a' option that is removed for ages + * Treat SIGTERM just like SIGINT in our programs + * Use verify_value_string_arrays_are_terminated from osmo-ci + * libbsc: document arguments of generate_bcch_chan_list() + * Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' + * gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx + * Fix nanobts_omlattr unit test + * nanobts_omlattra_test: Initialize logging before executing tests + * osmo-bsc: Initialize logging before initializing rate_ctr + * remove sgsn, gbproxy and gtphub from openbsc.git + * rename osmo-bsc to osmo-bsc-sccplite + * Bump version: 0.15.1 ? 1.0.0 + + [ Neels Hofmeyr ] + * libcommon: soak up three static functions. + * oap: implement initial OAP API. + * oap: add oap testsuite skeleton + * oap: add OAP API test + * gsup/oap: add OAP to GSUP client. + * oap: add OAP config to VTY + * sgsn_vty.c: fix typo + * Add GTP hub initial code base. + * gtphub: add first bits of GRX ares + * gtphub: fix Echo behavior: respond directly. + * gtphub: add/fix IMSI and APN IE error handling + * gtphub: make test code reusable for future tests. + * gtphub: fix User plane decoding, add unit test. + * gtphub: fix handling of sender from nonstandard port. + * gtphub: Add logging for ares queries. + * gtphub: fix numerous segfaults, and other stupidities. + * gtphub: don't always try to do GGSN resolution. + * gtphub: add logging labels to bind struct. + * gtphub: review log levels, add level arg to LOG(). + * gtphub: cosmetic: break long lines. + * fix build: remove obsolete gtphub EXTRA_DIST. + * gtphub: fix gtphub_read() semantics. + * gtphub: fix fatal log msg for SGSN proxy. + * gtphub: fix three oversights (thanks to coverity). + * gtphub: fix echo reply to SGSNs: wrong fd. Add test. + * gtphub: lose obsolete comment. + * gtphub: fix ares segfault: add missing initialization. + * gtphub: add enable_gtphub_test to atlocal.in. + * gtphub: remove another obsolete comment. + * gtphub_test: build only when c-ares and gtp are present. + * gtphub: add to debian build + * gtphub: add to osmoappdesc.py + * gtphub: fix number map range for TEIs. + * gtphub: nr_map: add min,max and wrap. + * gtphub: cosmetic: rename a file. + * gtphub: review some logging. + * gtphub: ares vty and init + * gtphub: ensure cleanup of peer addresses. + * gtphub: add explicit cleanup handles. + * gtphub: cosmetic: clarify bind pointer naming. + * gtphub: add first rate counters + * gtphub: first vty show commands. + * gtphub: cosmetic: fix an argument name. + * gtphub: move timestamp into packet struct. + * gtphub: cosmetic/prepare: add nr_map_refresh(). + * gtphub: add assertion to ensure expiry ordering. + * gtphub: cosmetic/prepare: rename expiry queues. + * gtphub: track tunnels explicitly. + * gtphub: avoid segfault for incomplete tunnels. + * gtphub: fix a conditional for log output + * gtphub: complain about excess cmdline args. + * gtphub: implement restart counter properly. + * gtphub: cosmetic: for_each_side,_plane macros. + * gtphub: use a single TEI pool across planes. + * gtphub: make sure mapped TEIs aren't occupied (incomplete). + * gtphub: refactor: use side_idx everywhere. + * gtphub: vty: add missing SGSN-proxy output. + * gtphub: add two stubs for Delete PDP msgs + * gtphub: fix some style complaints from cppcheck + * gtphub: be more fatal about not finding an unused TEI. + * gtphub: fix segfault when empty config. + * gtphub: remove obsolete todo comment + * gtphub: handle Delete PDP Context. + * gtphub_test: add some cleanup asserts. + * gtphub_test: add test for Del PDP from GGSN side. + * gtphub: cosmetic + * gtphub: monitor GSNs' restart counters. + * gtphub: cosmetic: early continue for less indent + * gtphub: fix: add a missing NULL check + * gtphub: add test for reused TEI. + * gtphub: Add a debug log + * gtphub: add restart counter test + * gtphub: fix use after free. + * gtphub: wrap gtphub_write() for test suite. + * gtphub: fix restart cleanup peer matching. + * gtphub: cosmetic + * gtphub: improve logging for invalid packet + * gtphub: check TEI presence in Create PDP Ctx Response + * tests: fix condition to run sgsn, oap, gtphub tests + * gtphub: Del PDP: replace unnecessary lookup with asserts. + * gtphub: tweak an error log message + * gtphub: prepare: keep tunnel ref in gtp_packet_desc. + * gtphub: implement sgsn_use_sender for NAT. + * gtphub_test: tweak test_user_data(): no seq routing. + * gtphub: add test for SGSN behind NAT + * gtphub: tweak startup log for sgsn_use_sender + * gtphub: add gtphub-example.txt + * gtphub: enhance gtphub-example.txt + * gtphub: fix missing newline in log output + * gtphub: logging: have one newline per log. + * gtphub: tweak logging. + * gtphub: be strict about unknown cmdline args + * gtphub: add more detailed I/O rate counters. + * gtphub: log: add side str to msg for reused TEI + * gtphub_test: add test_parallel_context_creation() + * gtphub: log: add TEI reuse msg, fix another TEI msg. + * gtphub: fix: when checking TEIs, skip 0. + * gtphub: simplify/fix: one TEI mapping per tunnel. + * gtphub: log most common message type names. + * gtphub: improve handling of restarted peer. + * gtphub: add VTY show for peers and peer stats. + * gtphub: log: limit length of hex dumps. + * osmoappdesc.py: fix wrong index introduced by gtphub. + * gtphub VTY test: use only 127.0.0.1. + * gtphub VTY: fix doc strings for show cmds + * gtphub VTY: add newlines to some VTY docs' final lines + * fix bsc_vty out: timeslot indented too deeply. + * remove src/libgb/Makefile.am + * Add README.vty-tests + * openbsc/README: some fixes, add CSCN and Iu* + * gtphub: include ports.h instead of redefining OSMO_VTY_PORT_GTPHUB + * gtphub: tweak default logging level + * osmo-bsc: fix checking wrong pointer for ctrl setup success + * minor fixes in bsc_vty.c and bsc_nat.c + * bsc_nat: fail if VTY telnet port cannot be bound, clarify comment + * ipaccess_rcvmsg: fix returncode, add partial write warning + * gsm340_rx_tpdu: comment-out two unused vars + * enable telnet VTY bind address config for various programs + * osmo-nitb: add -M to pass specific MNCC socket path + * osmo-nitb: cosmetic: rename to rf_ctrl_path, following mncc_sock_path + * osmo-nitb: be strict about cmdline args + * enable ctrl bind config for various programs + * smpp: refactor initialization, add bind address + * bsc_test.c: fix tz.override val and note a FIXME + * osmo_bsc_filter.c: add fixme note + * minor comment + * use sqlite3_close() instead of sqlite3_close_v2() + * check return value of sqlite3_close(), retry up to three times. + * db: evaluate return value of sqlite3_finalize(), tweak log output. + * channel_test: don't segfault if paging fails + * 04.08: apply new bitmask functions, fix bitmask use + * 04.08: apply new transaction id inline functions + * bsc_scan_msc_msg: check protocol discriminator + * fix confusing typo in constant (THAN -> THEN) + * osmo-bsc: fix compiler warning: store struct in vty->index + * Add MM Auth test; add auth_action_str() function + * MM Auth test: add two tests for AUTH_THEN_CIPH + * MM Auth test: add test to re-use existing auth + * MM Auth: introduce AUTH_ERROR constant. + * MM Auth: return AUTH_NOT_AVAIL instead of hardcoded zero + * Fix MM Auth: disallow key_seq mismatch + * Fix MM Auth: zero-initialize auth tuple before first use + * gtphub_unmap_header_tei(): don't dereference unmapped_tei arg if not present (CID #57687) + * bsc_nat: forward_sccp_to_msc(): assert con presence (CID #57872) + * gbproxy_test: assert msg allocation (CID #57873) + * drop unneccessary duplicate linking: osmo-bsc + * drop unneccessary duplicate/unused linking: ipaccess + * drop unneccessary duplicate linking: osmo-nitb + * drop unneccessary duplicate linking: tests/gsm0408 + * gsm04_08_clear_request(): release loc with arg release=0 + * tweak db debug log: log TMSI as hex + * gprs_gmm.c: Don't try to de-reference NULL mmctx + * comment tweak for bsc_handover_start() + * debug log: cosmetic fixes + * gprs_gmm.c: don't transmit NOTEXIST when mmctx is NULL + * lchan_alloc(): on alloc failure, report original type + * dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots + * dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable + * dyn PDCH: TS flags: rename one, add three, as enum + * dyn PDCH: fix: clear PDCH flags on TS reconnect (e.g. BTS re-connect) + * dyn PDCH: track pending PDCH de-/activation + * dyn PDCH: add lchan sanity checks in PDCH DE/ACT ACK + * dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACT + * bsc_version.c: update copyright date, add contributor + * configure: require libgsm for --enable-mgcp-transcoding + * rm dup: use channel type names from libosmocore + * typo in sgsn_test + * dyn PDCH: enable PDCH only after release due to error + * vty: show lchan summary: also show lchan->state + * debug log: log all lchan state transitions + * dyn PDCH: cosmetic: clarify lchan rel with assertion and comment + * err log: tweak dyn pdch ack error logging + * jenkins.sh: remove code dup + * jenkins.sh: add --enable-iu matrix build + * cosmetic: dyn_pdch_init(): flatten if-logic, add comments + * dyn pdch: don't PDCH ACT if gprs mode is none + * fix ctrl test: dyn TS: use new GSM_PCHAN_TCH_F_TCH_H_PDCH + * fix: create_pdp_conf(): unset reject_cause after unknown ran_type + * comments: clarify some dynamic TS comments + * cosmetic: rsl_rx_rf_chan_rel_ack(): use local ts var for brevity + * cosmetic: act lchan type: use constant instead of 0x00 + * cosmetic: rsl_rx_chan_act_ack(): use local lchan var in 14 instances + * dyn TS: add ts->dyn state + * gsm_data_shared: add gsm_ts_and_pchan_name() for dyn ts logging + * code dup: join [rsl_]lchan_lookup() from libbsc and osmo-bts + * error log: abis_rsl.c: log errors in channel_mode_from_lchan() + * log lchan_alloc() result + * debug log: fix line endings for abis_rsl_rx_rll logging + * gsm_ts2chan_nr(): add assertions for lchan_nr + * cosmetic: dyn_pdch_init(): debug log: use new gsm_ts_and_pchan_name() + * error log: rsl_chan_activate_lchan: log channel mode error + * prepare dyn TS: act lchan: fetch the channel mode a bit later + * dyn TS: rename lchan->dyn_pdch to lchan->dyn + * dyn TS: gsm_lchan2chan_nr(): decouple from ts->pchan + * dyn TS: rsl *2chan_nr(): handle TCH/F_TCH/H_PDCH + * dyn TS: verify_chan_comb(): handle new dyn TS NM_CHANC_* + * dyn TS: rsl_lchan_lookup(): add dyn PCHAN + * dyn TS: enhance channel allocator for dynamic TS + * dyn TS: chan act: set chan_nr according to dyn pchan type + * dyn TS: implement pchan switchover logic + * dyn TS: split dyn_pdch_init() for new dyn type and rename + * dyn TS: Rename bsc_dyn_pdch.c to bsc_dyn_ts.c + * dyn TS: OS#1778 workaround: disable TCH/F on dyn TS for nitb + * gsm_pchan2chan_nr: disable a chan_nr assert in BTS, to not break octphy + * gsm_pchan2chan_nr(): fix uninitialized cbits + * comment: gsm48_gmm_sendmsg(): add spec reference on encryptable + * dyn TS: bts_chan_load: use correct nr of subslots for dyn ts + * chan_alloc.c: use ts_subslots() instead of subslots_per_pchan[] + * move ts_sublots() to gsm_data_shared.c, it will be used by osmo-bts + * dyn TS: move check whether to switch to PDCH to separate function + * dyn TS: fix error recovery: switch to PDCH after lchan error state + * dyn TS: clearly use lchan[0], fixing minor confusion + * dyn TS: fix: properly run an lchan activation timeout + * dyn TS: fix OS#1798: on late RF CHAN REL ACK, activate PDCH + * dyn TS: debug log 'switchover complete' only when there was a switchover + * dyn TS: debug log: if still in use, also log lchan type and state + * log: improve for rsl_lchan_mark_broken() + * log: rsl notice: tiny tweak for readability + * add libiu + * cosmetic: gprs_sgsn.c: move pdp.h include to top + * IuPS: add VTY config for asn_debug + * log: abis_rsl: don't log 'error' when there is no error + * log causing rx event for lchan_lookup errors + * properly #include from gsm_subscriber.h + * remove unused bsc_copyright from bsc_vty.c + * vty l3 help: fix typo 'comamnds'; fix english s/his// + * utils/Makefile.am: remove unused LIBOSMOVTY_CFLAGS + * cosmetic: various comment, whitespace tweaks + * Sanity fixes for gsm0408_dispatch(): rc, assertions + * debug log for sms: fix/add + * cosmetic: transaction.h: 1 comment typo, 1 whitespace + * cosmetic fixes in libcommon/talloc_ctx.c + * mscsplit: bsc_init: don't pass telnet dummy conn + * mscsplit: move subscriber conns list into struct gsm_network + * mscsplit: gsm_network_init(): add explicit root talloc ctx + * mscsplit: talloc_ctx_init(): decouple from global tall_bsc_ctx + * mscsplit: bsc_vty_init(): decouple from global bsc_gsmnet + * mscsplit: abis vty: decouple from global bsc_gsmnet variable + * mscsplit: add gsm_network backpointer to gsm_subscriber_connection + * mscsplit: directly access gsm_network backpointer from gsm_subscriber_connection + * cosmetic: vty_test_runner.py: add comment for vim auto settings + * vty_test_runner.py: raise exception when MSC socket connection fails + * log VTY telnet bind only once + * cosmetic: comment typo on e1_config.c + * channel test: prepare to add another test function + * channel_test: test nr of subslots for dyn pchan, with error + * Revert "bts: extend bts_chan_load to allow counting tch only" + * dyn TS: fix: ts_subslots() for TCH/F_PDCH in PDCH mode + * dyn TS: fix: abis_om2000: also handle dyn TS as TCH + * dyn TS: fix: e1_config.c: switch(pchan) for dyn TS + * cosmetic: bs11: also use ts_is_tch() + * vty_test_runner.py: fix nat_msc_test(): socket attach: reduce timeout, retry + * fix: send SNDCP XID only on GERAN Gb contexts + * log CTRL bind only once + * vty_test_runner.py: make unittest print all output by default + * vty_test_runner.py: fix indents to use spaces, fix vim comment + * build: be robust against install-sh files above the root dir + * configure: check for pkg-config presence + * Revert "bsc: count the usage of codec by setting the lchan active" + * abis_rsl_rx_dchan(): guard against lchan_lookup() returning NULL + * gsm_trx_name(): don't break if trx is NULL + * jenkins.sh: use osmo-build-dep.sh, log test failures + * ipaccess-config: initialize root talloc ctx with name + * bs11_config: initialize bs11 tall ctx, use instead of bsc ctx + * meas_pcap2db.c: remove unused include of msgb.h + * gtphub_test.c: remove unused include of msgb.h + * msgb talloc ctx: initialize in all main() scopes + * msgb ctx: use new msgb_talloc_ctx_init(), don't access talloc_msgb_ctx + * info log: iu: add line break to and tweak rx RAB Ass Resp log + * log: count_codecs(): drop logging of non-TCH lchan types + * bsc_vty: include dyn TS info in vty show lchan + * fix use after free in bsc_config_free + * OM2000: for TS conf of dyn TS, always send TCH/F chan comb + * OM2000: disallow ip.access style TCH/F_PDCH pchan type + * Add empty libcommon-cs + * define mncc_recv_cb_t to avoid code dup + * move to libcommon-cs: net init 1: rename to bsc_network_init + * move to libcommon-cs: net init 2: move bsc_network_init decl to new .h + * move to libcommon-cs: net init 3: actual move + * move to libcommon-cs: gsm48_create_mm_serv_rej(), gsm48_create_loc_upd_rej() + * IuPS: properly update ra_id on GMM Attach Request + * factor out gen of USSD notify and release complete to libosmocore + * factor out & introduce struct gsm_encr, in common_cs.h + * sms_next_rp_msg_ref(): use direct pointer to next_rp_ref counter + * tests: drop unused libmsc, unneeded duplicate libbsc linking + * split bsc_bootstrap_network() in alloc and config + * global gsm_network: move allocation further up + * move to libcommon-cs: global vty gsm_network pointer + * move to libcommon-cs: network VTY that isn't BSC-specific + * bsc vty: rename show_net_cmd to bsc_show_net_cmd + * reinvent connection_for_subscr() and move to libmsc + * Move timezone settings up to network level + * move to libcommon-cs: net timezone VTY config + * split subscr_con_allocate()/_free() in bsc_ and msc_ + * osmo-nitb: exit when MNCC socket init failed + * gsm_subscriber_connection: mark BSC specific items + * abis_om2k: fix typo that declared non-existent struct gsm_bts_trx_s + * lchan release in error state: SACCH deact only for SACCH pchans + * cosmetic: chan_alloc: use switch instead of if-cascade + * Fix TCH/F_PDCH: no need to check ts subslots for PDCH + * Revert "Support Deactivate PDP Context Request from network" + * build: bump required libosmocore, libosmogsm to 0.9.4, for GSUP + * comments: gsup client: rename to Generic, adjust copyright and authors + * gprs_gsup_client*: remove the gprs_ prefix + * rename gprs_gsup_client.h to gsup_client.h + * gsup client, gsup_test_client: move logging to DLGSUP category + * oap: rename public API from oap_ to oap_client_ + * rename oap.h to oap_client.h + * move gprs/oap.c to libcommon/oap_client.c + * move grps_gsup_client.c to libcommon/gsup_client.c + * oap_test.c: rename to avoid clash with libosmocore oap_test.c + * oap_client_test: print test descr to stderr, check stderr + * oap_client: move logging to DLOAP logging category + * oap_client_test: show bug: disabled state does not reject message + * oap_client: reject all messages in disabled/uninitialized state + * oap_client: make use of OAP optional: disable for NULL config + * fix: missing terminator in two value_string arrays + * gtphub: fix possible NULL deref: don't print NULL tunnel + * build: osmo-nitb: fix missing LIBCRYPTO_FLAGS + * build: remove obsolete $LIBCRYPT in two places + * gitignore: gsup_test_client binary + * use new OSMO_VALUE_STRING + * fix 'osmo-nitb --version' segfault + * Revert "Turn some warnings into errors" + * gprs subscr: fix: intended strcmp(), but is strcpy() + * undup: gtphub_test: use libosmocore's llist_count() + * fix strncpy() invocation in vty_interface_layer3.c and 3 tests + * cosmetic: use osmo_strlcpy() everywhere + * various comment / whitespace tweaks (libmsc, gprs, libcommon-cs) + * osmo_bsc_grace.h: use '<>' include, not '""' + * paging.h: use '<>' include, not '""' + * compiler warning: bsc_vty: remove two unused vars + * gsm0408_rcv_cc: guard against NULL subscriber + * vty tests: attempt to get at sporadic 'Broken Pipe' error + * vty tests: more attempts to resolve sporadic 'Broken Pipe' error + * vty tests: testBSCreload: ipa_handle_small: ensure rx of 4 bytes + * gsm48_tx_mm_auth_req(): support UMTS AUTN + * Revert "vty tests: more attempts to resolve sporadic 'Broken Pipe' error" + * gsm_04_08: implement parsing of UMTS Auth responses + * vty tests: more attempts to resolve 'Broken Pipe' error + * vty tests: more attempts to resolve 'Broken Pipe' error (3) + * vty tests: more attempts to resolve 'Broken Pipe' error (2) + * remove compiler warning: unused rc in vty_interface_layer3 + * subscr_update_expire_lu(): fix (obscure) segfault + * logging: use central filter and ctx consts from libosmocore + * debug.h/c: remove unused cruft / cosmetic tweaks + * logging fixup: shorter names for LOGGING_FILTER_* and LOGGING_CTX_* + * cosmetic: remove unused scall_signal_data.subscr + * vty_test_runner.py: fix socket leak + * vty: fix subscr ref count leak in 'subscriber name' cmd + * cosmetic: gsm_data.h, README: rename CSCN to MSC + * cosmetic: clarify BSC's remote MSC data vs. OsmoMSC + * cosmetic: rename osmo_msc_data.h to bsc_msc_data.h + * cosmetic: rename struct osmo_msc_data to bsc_msc_data + * add struct gprs_subscr, separating gprs from gsm_subscriber + * vty_rest_runner.py: remove debug monitoring for TCP sockets + * python tests: remove process 'Launch' message, now at osmoutil + * smpp_test_runner.py: fix socket leak + * SGSN: Integrate support for UMTS AKA + * SGSN VTY: make missing GSUP server address+port fatal + * vty test: nat_msc_test: setsockopt REUSE to avoid TIME_WAIT problems + * ctrl_test_runner: speed up more than 10 fold by sleeping less + * fix: gprs_gmm, gprs_llc_vty: two unterminated value_string arrays + * subscriber conn: add indicator for originating RAN + * vty tests: allow picking specific tests to run by name + * vty tests: close msc socket after nat_msc_test + * add struct bsc_subscr, separating libbsc from gsm_subscriber + * python tests: vty and smpp: speed up >10 times + * oap tests: fix after SQN scheme changes from libosmocore + * jenkins: add value_string termination check + * bsc_/gprs_subscriber: fix: use osmo_strlcpy() to safely copy IMSI + * python tests: allow running from separate build dir + * LU counters: count completion and failure, not messages sent + * jenkins.sh: Iu: use libosmo-sccp,-netif master + * build: iu: use libosmo-sccp tag 'old_sua' + * fix VTY parsing: subscriber-create-on-demand random + * fix subscriber random extension allocation range + * fix '/include/openbsc ' to have no trailing space + * ipaccess-config: properly create swload + * jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' + * cosmetic: vty for timers: remove obsolete range check + * vty: add 'default' keyword to timer config + * timer vty: also print the default value in cmd doc + * Revert "factor out & introduce struct gsm_encr, in common_cs.h" + * fix vty tests: vty no longer goes to parent node implicitly + * jenkins: use osmo-clean-workspace.sh before and after build + + [ Pablo Neira Ayuso ] + * mgcp_osmux: available circuit IDs from 0 to 255, not from 0 to 128 + * libmsc: use GSM411_RP_CAUSE_MO_NUM_UNASSIGNED as return value + * libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP + * src: use osmo_timer_setup() + * gsm_04_11: get rid of unused parameter in sms_route_mt_sms() + * libmsc: do not leak pending SMPP command object on error path + * libmsc: remove dead code in sms_route_mt_sms() + * libmsc: remove duplicate lines in deliver_to_esme() + * libmsc: remove 'deferred' parameter in sms_route_mt_sms() + * libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() + * libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM messages + * libmsc: report status report request flag from SMPP SUBMIT_SM + * libmsc: missing bit shift in status report flag when stored in sms object + * utils: smpp_mirror: set registered_delivery field in SMPP SUBMIT_SM + * utils: smpp_mirror: temporarily munch SMPP delivery receipts + * utils: smpp_mirror: reflect message reference TLV + * libmsc: add support for SMPP delivery receipts + * libmsc: update database to accomodate SMS status-report fields + * utils: smpp_mirror: bounce Delivery Receipts as Delivery Acknowledgments + * libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report + * libmsc: support GSM 03.40 status report for nitb + * libmsc: gsm340_gen_oa_sub() may return negative value + * libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling + * libmsc: use new smpp34 esm_class definitions + * libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 + * libmsc: annotate esme route in the sms object from deliver_to_esme() + * libmsc: sms_route_mt_sms() may return uninitialized return value + + [ Martin Hauke ] + * Fix no-return-in-nonvoid-function meas_vis.c + * Fix Warning: openbsc implicit-pointer-decl meas_udp2db.c:50 + + [ Alexander Huemer ] + * tests/oap: depend on libgtp + * tests/abis: fix format specifiers + * gprs: use libgtp cflags + * Consistenly format variables in */Makefile.am files + * Build fixes + * Add missing _CFLAGS and _LIBS + + [ Ruben Undheim ] + * Patch to make openbsc find libsmpp34 + * Fix some typos in stdout output + * deb: unbreak nightly builds + + [ Vadim Yanitskiy ] + * move to hex TMSI representation + * db.c: implemented incremental migration + * mncc_sock: use osmo_sock_unix_init() from libosmocore + * VTY: add the dyn_ts_allow_tch_f option + + [ Max ] + * Ignore vty test byproducts + * Fix segfault with broken config + * NAT: vty command to display number of BSCs + * NAT: extend debug output for ipaccess errors + * Remove trivial wrapper function + * NAT: allow allocating BSC in arbitrary order + * vty_test_runner: update ipa sending code + * NAT: move BSC config into separate file + * NAT: reload BSCs config dynamically + * Add SI2quater support to SI3 + * Refactor SI-related code + * Add basic SI2quater support + * Fix documentation for command parameters + * Fix earfcn deletion + * Cleanup shared data structure + * Add basic UARFCN support + * Add vty check for max si2quater size + * Add extra debug output with channel mode and type + * Add missing include + * Fix comment typo + * Adjust si2quater ranges + * Disconnect calls with incompatible channel types / modes + * Ignore extended test leftovers + * Cleanup db test + * Move DTX settings to BTS + * Use proper measurement for handover + * Make extending subscriber creation easier + * Fix copy-paste error in SI6 + * Make si2q scheduling optional + * Store last used FN for TCH + * Add regexp authorization policy for IMSI + * Add warning for unsupported DTX configurations + * Add DTXd indicator to gsm_lchan + * DTX: add data necessary for scheduling + * Add talkspurt indicator for gsm_lchan + * Fix SIGABRT on wrong AMR payload + * Make random extension range configurable + * Fix vty tests with subscriber deletion + * SGSN: force GSUP CN domain to PS + * SGSN: add vty config for choosing GPRS encryption + * SGSN: move TLLI unassignment into separate function + * Make random MSISDN assignment optional + * SGSN: prevent starting with inconsistent config + * SGSN: use unique AUTH REQ reference + * SGSN: split GEA key management from TLLI + * SGSN: add preliminary support for GPRS encryption + * SGSN: encrypt/decrypt only necessary frames + * SGSN: move cipher application to separate function + * Fix default subscriber regexp + * Improve code re-use + * Use random operation id + * Add python functions to get/set ctrl variables + * Add web proxy for control interface + * Modify SI 13 field for control_ack_type + * DTX: extend SID cache + * DTX: add flag for AMR HR P* + * DTX DL: use FSM for AMR + * Log use of incompatible BS-AG-BLKS-RES value + * Replace magic number with define + * DTX DL: Add FACCH cache + * Decrease count_codecs logging verbosity + * abisip-find: use protocol constant + * Replace duplicated code with macro call + * Add IPA multiplex + * Use IPA module for vty tests + * Add twisted-based IPA multiplex + * bsc_control.py: style corrections + * bsc_control.py: use ipa.py module + * bsc_control.py: remove unused -i option + * Improve GPRS logging + * Integrate Debian packaging changes + * Cosmetic fixes around SI generation + * Turn some warnings into errors + * Log expected SRES on GPRS AUTH REJECT + * Turn some compiler warnings into errors + * Print subcriber when skipping auth + * Improve OML failure report + * bsc_control.py: fix blocking + * Prevent segfault in range encoding + * SI2q: add support for multiple UARFCNs + * CTRL: remove boilerplate + * Remove dependency to autoconf-archive + * Attempt to fix nightly builds + * vty: remove ignored logging parameters + * Expand chan allocation logging + * Remove duplicating define + * Add support for extended SI2q parameters + * Handle DSD from HLR + * Fix potential segfault in sgsn_libgtp.c + * Add MS time. offset to gsm_lchan + * examples: remove logging level * everything + * Don't drop OML links for Get Attributes NACK + * twisted_ipa.py: bump version properly + * twisted_ipa.py: make debug logging more robust + * Add simple CTRL2SOAP proxy + * Handle PCU version received via OML alert + * python: fix Null logger + * abis: log known ACKs and unknown messages + * gsm_bts: add version and variant details + * Fix MS TO measurement representation + * Remove libs from openbsc.pc + * gbproxy: add example .service + * deb: install openbsc.pc + * Save PCU version reported by BTS + * Prepare for extended SI2quater support + * Add gsm_bts_type_variant to gsm_bts struct + * Make pcap dependency optional + * Fix vty warnings for GEA0 + * ctrl: remove boilerplate code + * deb: install python scripts from contrib/ + * Gb: use textual representation for parse log + * Use ipa.py for ctrl tests + * Use libosmocore for SW Description parsing + * Make BTS type and variant converters shareable + * Add forgotten items to .gitignore + * Use define for limit on number of BTS features + * Prepare for BTS attribute reporting via OML + * Restructure SI2quater generation + * SI2quater: fix EARFCN inclusion check + * Get basic BTS attributes + * Remove errorneous include + * Adjust BTS model feature check + * Add remote BTS feature storage and helpers + * Get TRX attributes + * Request and parse BTS feature list via OML + * OML: fix potential OOB memory access + * Move SI-related defines + * Update SI data structures and generation + * bsc_init: Forget which SIs are valid for the trx + * Fix BTS features length check + * Enable optional static builds + * Fix BTS attribute requests + * gbproxy: log unhandled BSSGP PDU as text + * gbproxy: log signal value as text + * Remove common_cs.h from .deb + * Use release helper from libosmocore + * SI13: drop PBCCH-related bits + * CTRL: cleanup write-only command functions + * Show OML link uptime in vty + * Make TRX rf locking more visible + + [ Alexander Couzens ] + * add .gitreview + * gprs: use new uint8_t * for kv in gprs_cipher_run() + * libbsc: skip channel state LCHAN_S_INACTIVE while handover + * gprs_gmm: remove duplicated start of T3395 + * bs11_config: add brackets to fix warning in argument parsing + * sgsn: add statistics counter for GPRS and PDP packets + * sgsn: add statistics counter for LLC packets + * libbsc/libmsc: convert old osmo counter into rate_ctrgs + * libmsc: add missing count of sms no receiver when using smpp_first + * libmsc/bsc: split rate counters into bsc and msc group + * bsc/netinit: correct mistyped rate counter + * gprs/gsm0408_gprs_force_reattach_oldmsg: check llme before use + * gprs/gprs_llc: fix null pointer deref in gprs_llc_rcvmsg + * sms: change rp err cause of smpp_try_deliver errors + * bts: extend bts_chan_load to allow counting tch only + * bsc: count the usage of codec by setting the lchan active + * msc: add counters to track call attempts/active/success/failed + * gprs/gprs_llc: count UI frames over SAPI in the statistics + * fix mistypes, spaces and tabs + * bsc: count the usage of codec by setting the lchan active + * gprs/sgsn: rename gprs->mm_state -> gmm_state + * gprs/sgsn: rename sgsn_mm_ctx_alloc() -> sgsn_mm_ctx_alloc_gb() + * gprs/gprs_mm: add value_strings for PMM & MM states + * gprs/sgsn_mm_ctx_alloc(): initialize MM state to IDLE + * gprs/sgsn_vty: fix typo in comment + * libmsc/update_db_revision_3(): free memleaking db result + * unixsocket: start sabm for UNIXSOCKET + * gprs_sgsn.c: initialize ptmsi with 0xdeadbeef + * libbsc: add chreq type for CHREQ_T_PDCH_ONE_PHASE & CHREQ_T_PDCH_TWO_PHASE + * abis_om2k: protect MO FSMs by NULL check + * libbsc: add rsl_ericsson_imm_assign_cmd() which reply with a confirmation message + * pcu_sock: set flag PCU_IF_FLAG_SYSMO by setting pcu_direct = 1 + * pcu_sock: pcu_tx_info_ind allow to use TRX not starting from 0 + * pcu_sock: implement direct tlli on AGCH + * abis_rsl: fix off-by-one length check when parsing ericson tlli field + * abis_rsl: use msgb_pull to parse tlli from msg + + [ Andreas Eversberg ] + * dyn PDCH: Fix free slot search for chan_alloc_reverse == true + * dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channel + + [ Dieter Spaar ] + * SGSN: fix FCS calculation for encrypted frames + + [ bhargava ] + * Modify SI 13 field to support 11 bit RACH + + [ Philipp ] + * Adding LLC-XID encoder / decoder and unit test + * Moving grs_sndcp.h header file to include + * Adding LLC-XID related modifications in LLC + * SNDCP: add SNDCP-XID encoder/decoder and unit test + * RFC1144: add slhc code from linux kernel + * RFC1144: integration and unit-test + * SNDCP: add RFC1144 header compression functionality + * V.42bis: add sourcecode from IAXmodem (SPANDSP) + * V.42bis: integration and unit test + * SNDCP: add V.42bis data compression functionality + * SLHC: Improving slhc (RFC1144) testcase + * SGSN: Fixing build config + * sndcp: Fixups for sndcp layer based on coverity-scan suggestions + * OML: Improve OML attribute handling + * gsm0408: Adding log output for 3g specific RR messages + * Cosmetic: Add missing switch to usage help + * OM2000: Add fault report parsing + * om2000: added support for ericssons sabm negotiation + * OM2000: Throw error when MO can not be enabled + * SNDCP: Fixup based on Coverity Scan suggestion + * rbs2000: Add missing bts feature definitions + * OM2000: Fixup based on Coverity Scan suggestion + * rsl: support for ericssons propritary SI13 format + * sndcp: fixup for coverity scan defect CID 149097 + * LLC: Fixup element order in LLC-XID + * sndcp: Allow empty SNDCP-XID indications + * cosmetic: Rename phone to ms + + [ root ] + * om2000: Add support for querying RBS capabilities + + [ Pravin Kumarvel ] + * Correct Logging macro for pdpctx_timer_start + * Add support for pdpctx_timer_stop + * Support Deactivate PDP Context Request from network + + [ Keith ] + * Pass actual smpp_avail_status through to smpp in alert_all_esme() + * Add VTY command to immediately expire user (set expire_lu to now) + * meas_json: fix NEIGH: missing array braces + * libmsc: Map SMPP command status to GSM 04.11 cause + * LIBMSC: Place correct dst address in status report + * LIBMSC: Use sms->text, not sms->user_data to construct report body + * libmsc: Use actual delivery time in delivery reports. + * libmsc: Log Rx DELIVER-SM RESP before calling gsm411_send_rp_ack + + [ Philipp Maier ] + * compression: Fix nullpointer deref + * gprs: Fix compiler warning about uninitalized cause code + * om2000: add VTY command to delete CON groups + * XID: resend xid with pdp-ctx-ack messages + * silent_call: remove unfinished fuzzer interface + * sgsn: fix problem with leading-zero-IMSIs + * cosmetic: add copyright header to bsc_control.py + * cosmetic: Add commandline option to display version + * gprs: fix T3186 encoding in Sysinfo 13 + * gsm_data_shared: add value strings for gsm_chreq + * libbsc: add debug log message to S_L_INP_* callbacks + * pcu_sock: add basic pcu interface support + * pcu_sock: Forward imm.ass PCU originated messages + * pcu_sock: Fix broken paging command + + [ Minh-Quang Nguyen ] + * rsl: Fix dropping of LAPDm UA message. + + [ Alexander Chemeris ] + * utils: 'meas_json' utility to convert measurement feed into a JSON feed. + * libmsc: Fix VTY output for handover counters. + * libcommon: Fix log output for bts>0. + + [ Pau Espin Pedrol ] + * nat: Use equal func in bsc_sccp + * nat: Fix initial buffer size parameter for getline + * smpp_smsc.c: Log on sending deliver_sm message + * libmsc: Remove comment not applying anymore + * mgcp_osmux: Remove unused parameter + * mgcp: Fix uplink activation of Osmux stream + * sgsn_test: Fix wrong definition of wrap func + * smpp: Fix compilation warning + * libmsc: Fix wrong handling of user_message_reference parameter + * bsc_api: Fix NULL secondary_lchan access in handle_ass_fail + * libbsc: Use correct printf formatting for uint64_t + + [ Benoit Bolsee ] + * smpp: fix return cause + * 04.08: find a portable way to obtain the timezone offset + * transaction: reject calls from unidentified subscribers + + [ Ivan Kluchnikov ] + * handover_logic: set correct link to bts for subscriber_connection in case of moving this connection to another bts + * handover_decision: Fix condition for power budget handover attempt + + [ Andr? Boddenberg ] + * Make use of osmo-build.sh to use dependency artifacts for builds. + + -- Harald Welte Sat, 28 Oct 2017 21:17:34 +0200 + openbsc (0.15.1) UNRELEASED; urgency=medium * Move forward toward a new release. -- To view, visit https://gerrit.osmocom.org/4542 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5d19269983c9281bf36a7279151891902eff0013 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:24:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:24:10 +0000 Subject: openbsc[master]: Tag/Release Version 1.0.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4542 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5d19269983c9281bf36a7279151891902eff0013 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:33:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:33:00 +0000 Subject: [MERGED] openbsc[master]: Tag/Release Version 1.0.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release Version 1.0.0 ...................................................................... Tag/Release Version 1.0.0 This marks the first tagged source code revision after the repository split and subsequent removal of GPRS related code. Change-Id: I5d19269983c9281bf36a7279151891902eff0013 --- M debian/changelog 1 file changed, 955 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index dd850be..08636ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,958 @@ +openbsc (1.0.0) UNRELEASED; urgency=medium + + [ Holger Hans Peter Freyther ] + * Revert "gprs: Use RAND_bytes for p-tmsi" + * sgsn: Fix pattern for too long msisdn + * osmux: Allow to listen to a specific address + * sgsn: Fix up the VTY doc strings + * stats/mgcp: Initialize the statistics for MGCP as well + * gbproxy: Count more GSM 04.08 messages + * gtp: Fix Makefile.am so maybe distcheck is now going to work + * gtphub: Fix the VTY prompt to make the tests move forward + * bsc/vty: Provide a hint of available input + * gtphub: Fix compilation using gcc5 + * dahdi: The driver has moved to libosmo-abis + * gtphub: Make the two setter static as well + * db: Avoid undefined behavior when copying cm2/cm3 from the db + * gtphub: Fix use after free on failure + * gsm0408: Provide unique strings for the gsm 04.08 message + * msc: Remove oversimplified todo entry and add a comment + * meas: Do not retry to close the database + * mgcp: Fix compiler warnings on size_t on AMD64 + * abis: Send the message without enforcing to wait for a response + * bsc: Add code to send ip.access reboot command to nanoBTS + * bsc: Add parameter to restart a bts + * subscr: Add testcase creating an already created subscriber + * subscr: Make db_create_subscriber fail on duplicates + * db: If creating a subscriber in the db fails, return NULL + * ctrl: Extend ctrl command to optionally handle alg+ki + * jenkins: Add the build script from jenkins here + * nat/vty: Don't assume one can magically add IPv4 addresses to lo + * nat/vty: Use different port for the mock MSC + * nat/vty: Convert into str for the VTY command + * nat/vty: And move to a different port.. + * nat/vty: Remove second assumption about lo and binding + * nat/vty: Fix construct not working with python 2.6 + * nat/vty: Do not print token update statement + * nat/ussd: Add an example of the USSD gateway side-channel + * debian: Make upgrading from debian SID easier + * filter/nat: Fix the context for the imsi assignment + * bsc: Create minimal SI6 rest octets + * ci: Attempt to disable doxygen warnings of dependencies + * lchan: Release channel in case of late activation ack + * ussd: Add band-aid for interrogationSS + * debian: Install header and source file to different directory + * debian: Require libgtp-dev after the SO version bump + * sgsn: Fix deeply flawed copying logic for PDP context activation + * sgsn: Fill the cch_pdp with a value coming from the tlv structure + * sgsn: Convert cch_pdp to host order for libgtp + + [ Jacob Erlbeck ] + * sgsn/test: Add and call cleanup_test function + * sgsn/test: Really parse received DL LLC messages + * stats: Enable stats for sgsn, gbproxy, nitb, bsc, nat + * stats: Set class_id in rate_ctr group descriptions + * sgsn: Remove tlli_foreign2local + * sgsn/test: Add bssgp_raid parameter to send_0408_message + * sgsn: Make ra_id_equals available as gprs_ra_id_equals + * sgsn: Only look at TLLIs in sgsn_mm_ctx_by_tlli + * sgsn: Change handling of missing mmctx in gsm48_rx_gmm_ra_upd_req + * sgsn/test: Add test case test_gmm_routing_areas + * sgsn: Re-add searching for MM ctx based on TLLI / P-TMSI matches + + [ Daniel Willmann ] + * gprs: Use RAND_bytes for p-tmsi + * gbproxy/test: Add and call cleanup_test function + * gprs/gb_proxy: Use RAND_bytes for gbproxy TLLI/TMSI allocation + * rename enum gprs_mm_state to gprs_gmm_state + * rename enum gprs_mm_state to gprs_gmm_state + * create_pdp_conf(): factor out PDP context accept dispatch as send_act_pdp_cont_acc() + * sgsn_mm_ctx_cleanup_free(): clean up LLME iff present (Gb, not Iu) + * gprs: more conditionals for Gb specific actions + * configure.ac: add --enable-iu with deps asn1c, ranap, sigtran + * add DRANAP debug constant + * add DSUA debug constant + * osmux: Add negotiation state so race conditions can't disable osmux + * gprs_gmm: Fix bit mask when determining update/attach type + * IuPS: track msg->dst aka ue_conn_ctx, comment + * IuPS: osmo-sgsn: add core IuPS impl, call iu_init() + * IuPS: redirect Iu in various places, link Iu in sgsn-test + * IuPS: add Iu response to create_pdp_conf() + * IuPS: add Iu response to delete_pdp_conf() + * IuPS: dev hack: init hardcoded Ki on ATT REQ + * IuPS: send Security Mode Command, track the new_key flag. + * IuPS: add GMM Service Request rx and tx + * IuPS: RA UPD: make sure to authorize, for Iu Integrity Protection + * IuPS: sgsn_mm_ctx: add enum gprs_pmm_state field, track PMM state + * IuPS: GMM Attach: reset MM ctx pending_req + * IuPS: Introduce function to change PMM state + * IuPS: Change GTP-U endpoint to SGSN in PMM_IDLE and page UE when data arrives + * gbproxy: Check whether gbproxy_update_link_state_after() deletes the link_info + * test/gbproxy: Test for possible memory corruption when link_info is freed + + [ Harald Welte ] + * SGSN: Fix typo in VTY license statement. + * meas_db.c: fix compiler warnings + * Depend on libgtp >= 0.92, as previous versions don't have gtpie.h installed + * oap and gtphub tests must only be compiled of LIBGTP is present! + * Fix TSC/BSIC handling bug and remove bts->tsc + * vty: Print NCC/BCC and not just integer value of BSIC + * Fix compilation with no libc-ares present on the system + * tests/smpp: Fix linking order + * gsm_data_shared: compute/sprintf the lchan name only once + * remove old obsolete linux kernel and wireshark patches + * AUTHORS: Add Jacob and Neels + * bring the README into the 21st century + * mncc.c: Convert mncc_names[] to 'struct value_string' + * mncc: introduce 'struct gsm_mncc_bridge' for MNCC_BRIDGE + * indicate the GSM 04.08 channel mode in 'show lchan' + * add DOT graph showing NITB data structures and their references + * rename ipaccess-find into abisip-find + * Revert "move to hex TMSI representation" + * Start to use struct osmo_auth_vector from gsm_auth_tuple + * move gsm_04_08_gprs.h to libosmocore + * use new libosmocore gsm_23_003.h for IMEI/IMSI length + * Rename gprs_gsup_* to osmo_gsup_* + * rename gprs_shift_*() to osmo_shift_*() + * move osmo_shift_* / osmo_match_shift_* to libosmogsm + * gsup_messages: Add UMTS AKA related encoding/decoding support + * osmo_gsup_messge.[ch] documentation update (doxygen) + * move utils.h functions to libosmocore + * Move osmo_gsup_messages.[ch] to libosmocore + * oap_message.h: Remove dependency to openbsc include + * OAP: use osmo_oap_ prefix for OAP, rather than plain oap_ + * OAP: Various coding style fixes + * osmo_oap_decode(): Use common argument ordering + * sgsn/GSUP: Support MAP-style nested LU/ISD + * Add human-readable name of SGSN_AUTH_AUTHENTICATE + * sgsn_test: Adapt test case to now-existing InsertSubscriberData + * subscr_name(): Handle case for subscr == NULL + * rtp_proxy.c: Ensure msgb_alloc is large enough for largest AMR frame + * prepare sgsn_mm_ctx for Gb and Iu mode (UMTS) + * rename gsm0408_gprs_rcvmsg() to gsm0408_gprs_rcvmsg_gb() + * gprs_gmm.c: Make TLLI handling specific to Gb interface + * gprs_gmm.c: Perform LLME operations only if we have one + * remove old copy of documentation that now is in osmo-gsm-manuals.git + * add example config for sysmobts + * add .mailmap file for mapping git author name/mail in shortlog + * osmo-nitb: generate backtrace on SIGABRT + * COSMETIC: 'if' is not a function, so there is space before '(' + * mncc_builtin: Properly reject DTMF + * WIP: OM2000: Full state machine implementation using osmo_fsm + * OM2000: Fix state machien for CF/TRXC on START Result + * SGSN: Use dummy all-zero MSISDN value in PDP Context Act on GTP + * RBS2000: re-establish any lost signalling links + * talloc_cxt: Fix compiler warning / missing #include + * bs11_config: remove compiler waring about unused variable + * RBS2000: Avoid segfault if ts->lapd instance doesn't exist + * RBS2000: Ensure the is-connection-list command is only used on RBS2000 + * Support configuration of CON MO Groups/Paths from VTY + * OM2000: CON MO: Allow larger range for CCP and CI values + * OM2000: Add three IEs to TCH activation about which we have no clue + * OM2000: Fix missing dynamic TCH initialization + * abis_nm: Fix possible not-null-terminated buffer + * abis_nm: Fix non-null terminated buffer + * libmsc/db: avoid subscr->name without terminating NULL char + * Fix possible non-null-terminated buffer + * ipaccess-config: Handle setsockopt return value + * ipaccess-proxy: Check setsockopt() return value + * abis_nm: ceck fseek() return code in is_last_line() + * bsc_msc.c: Check setsockopt() return value + * sgsn_test: Fix missing = in == type check + * abisip-find: check bsc_fd_register() result + * bsc_ctrl: Ensure we don't pass NULL string into strtok_r() + * mgcp_protocol: Ensure we don't call strtok_r with NULL data + * cfg_bts_si2quater_neigh_add(): Don't call strerror() on negative value + * gsm0408_test.c: Don't pass negative value to strerror() + * channel_mode_from_lchan(): Add missing break statement + * add gsup_test_client program + * move OAP messages implementations to libosmocore + * bsc_vty: Fix missing break statements in switch() + * sgsn: Add GTP information to "show pdp-context" + * remove unused struct members of 'struct sgsn_pdp_ctx' + * Implement VTY configuration to control Early Classmark Sending + * OM2000: use assoc_so *only* for TS objects + * VTY: Print 3G auth tuples, not just 2G auth tuples + * OM2000: Add FIXME comments for missing resolving of RX/TX MO! + * OM2000: Change the order of MO initialization + * OM2000: Send ALTCRQ for SuperChannel after receiving IS Enable Req Ack + * RBS2000: Add the P-GSL Timer IE to RSL CHAN ACT for PDCH + * RBS2000 RSL: Support for sending RSL PAGING CMD for GPRS + * pcu_sock: Don't re-implement core functionality like gsm_bts_trx_num() + * pcu_sock: get rid of magic numbers and use ARRAY_SIZE() for array iteration + * pcu_sock: Forward paging request from PCU via RSL to BTS + * pcu_sock: Send non-NULL hLayer1 to PCU + * Use new e1inp_signal_names from libosmo-abis to print input signal names + * costmetic: Document gsm48_multirate_config() + const-ify input + * bsc_api.c: Documentation for handle_mr_config() + * bsc_vty: Factor vty_get_ts() out of pdch_act_cmd() + * bsc_vty.c: Further simplify vty_get_ts() + * bsc_vty.c: Add command for manual [de]actiovation of logical channels + * bsc_vty: Add command to manually issue IPAC MDCX + * libbsc: Create pcu-socket only as specified in config file + * don't re-implement osmo_talloc_replace_string() + * Add vty command "radio-link-timeout infinite" for uplink rx testing + * jenkins.sh: Proper error message if local environment isn't set up + * Support for TS 04.14 conformance test commands + * Add VTY commands for experimentation with TS 04.14 commands + * bsc_api: Fix copy+paste error in printing name of RR STATUS PDU + * libbsc: Add VTY command to re-send the SYSTEM INFORMATION to BTS + * check for missing result of rate_ctr_group_alloc() + * Fix regression causing loss of static system-information messages + (Closes: #2367) + * RSL: Allow disabling of BCCH/SACCH filling for given SI type + * gsm_bts_trx_set_system_infos(): Disable non-existing SI + * gtphob: check for missing result of rate_ctr_group_alloc() + * bsc_vty: Add VTY command to test CTRL TRAP feature + * GSM timers: User reasonable defaults; don't save if equal default + * bsc_vty: Don't allow timers of zero (0) + * remove code disabling T3109 if configured to 0 + * SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE + * Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH + * sgsn_vty: Don't assume pdp->lib is always valid + * Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() + * increase libsmpp34 version requirement to 1.12 + * NITB: remove 'help' output about '-a' option that is removed for ages + * Treat SIGTERM just like SIGINT in our programs + * Use verify_value_string_arrays_are_terminated from osmo-ci + * libbsc: document arguments of generate_bcch_chan_list() + * Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1' + * gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx + * Fix nanobts_omlattr unit test + * nanobts_omlattra_test: Initialize logging before executing tests + * osmo-bsc: Initialize logging before initializing rate_ctr + * remove sgsn, gbproxy and gtphub from openbsc.git + * rename osmo-bsc to osmo-bsc-sccplite + * Bump version: 0.15.1 ? 1.0.0 + + [ Neels Hofmeyr ] + * libcommon: soak up three static functions. + * oap: implement initial OAP API. + * oap: add oap testsuite skeleton + * oap: add OAP API test + * gsup/oap: add OAP to GSUP client. + * oap: add OAP config to VTY + * sgsn_vty.c: fix typo + * Add GTP hub initial code base. + * gtphub: add first bits of GRX ares + * gtphub: fix Echo behavior: respond directly. + * gtphub: add/fix IMSI and APN IE error handling + * gtphub: make test code reusable for future tests. + * gtphub: fix User plane decoding, add unit test. + * gtphub: fix handling of sender from nonstandard port. + * gtphub: Add logging for ares queries. + * gtphub: fix numerous segfaults, and other stupidities. + * gtphub: don't always try to do GGSN resolution. + * gtphub: add logging labels to bind struct. + * gtphub: review log levels, add level arg to LOG(). + * gtphub: cosmetic: break long lines. + * fix build: remove obsolete gtphub EXTRA_DIST. + * gtphub: fix gtphub_read() semantics. + * gtphub: fix fatal log msg for SGSN proxy. + * gtphub: fix three oversights (thanks to coverity). + * gtphub: fix echo reply to SGSNs: wrong fd. Add test. + * gtphub: lose obsolete comment. + * gtphub: fix ares segfault: add missing initialization. + * gtphub: add enable_gtphub_test to atlocal.in. + * gtphub: remove another obsolete comment. + * gtphub_test: build only when c-ares and gtp are present. + * gtphub: add to debian build + * gtphub: add to osmoappdesc.py + * gtphub: fix number map range for TEIs. + * gtphub: nr_map: add min,max and wrap. + * gtphub: cosmetic: rename a file. + * gtphub: review some logging. + * gtphub: ares vty and init + * gtphub: ensure cleanup of peer addresses. + * gtphub: add explicit cleanup handles. + * gtphub: cosmetic: clarify bind pointer naming. + * gtphub: add first rate counters + * gtphub: first vty show commands. + * gtphub: cosmetic: fix an argument name. + * gtphub: move timestamp into packet struct. + * gtphub: cosmetic/prepare: add nr_map_refresh(). + * gtphub: add assertion to ensure expiry ordering. + * gtphub: cosmetic/prepare: rename expiry queues. + * gtphub: track tunnels explicitly. + * gtphub: avoid segfault for incomplete tunnels. + * gtphub: fix a conditional for log output + * gtphub: complain about excess cmdline args. + * gtphub: implement restart counter properly. + * gtphub: cosmetic: for_each_side,_plane macros. + * gtphub: use a single TEI pool across planes. + * gtphub: make sure mapped TEIs aren't occupied (incomplete). + * gtphub: refactor: use side_idx everywhere. + * gtphub: vty: add missing SGSN-proxy output. + * gtphub: add two stubs for Delete PDP msgs + * gtphub: fix some style complaints from cppcheck + * gtphub: be more fatal about not finding an unused TEI. + * gtphub: fix segfault when empty config. + * gtphub: remove obsolete todo comment + * gtphub: handle Delete PDP Context. + * gtphub_test: add some cleanup asserts. + * gtphub_test: add test for Del PDP from GGSN side. + * gtphub: cosmetic + * gtphub: monitor GSNs' restart counters. + * gtphub: cosmetic: early continue for less indent + * gtphub: fix: add a missing NULL check + * gtphub: add test for reused TEI. + * gtphub: Add a debug log + * gtphub: add restart counter test + * gtphub: fix use after free. + * gtphub: wrap gtphub_write() for test suite. + * gtphub: fix restart cleanup peer matching. + * gtphub: cosmetic + * gtphub: improve logging for invalid packet + * gtphub: check TEI presence in Create PDP Ctx Response + * tests: fix condition to run sgsn, oap, gtphub tests + * gtphub: Del PDP: replace unnecessary lookup with asserts. + * gtphub: tweak an error log message + * gtphub: prepare: keep tunnel ref in gtp_packet_desc. + * gtphub: implement sgsn_use_sender for NAT. + * gtphub_test: tweak test_user_data(): no seq routing. + * gtphub: add test for SGSN behind NAT + * gtphub: tweak startup log for sgsn_use_sender + * gtphub: add gtphub-example.txt + * gtphub: enhance gtphub-example.txt + * gtphub: fix missing newline in log output + * gtphub: logging: have one newline per log. + * gtphub: tweak logging. + * gtphub: be strict about unknown cmdline args + * gtphub: add more detailed I/O rate counters. + * gtphub: log: add side str to msg for reused TEI + * gtphub_test: add test_parallel_context_creation() + * gtphub: log: add TEI reuse msg, fix another TEI msg. + * gtphub: fix: when checking TEIs, skip 0. + * gtphub: simplify/fix: one TEI mapping per tunnel. + * gtphub: log most common message type names. + * gtphub: improve handling of restarted peer. + * gtphub: add VTY show for peers and peer stats. + * gtphub: log: limit length of hex dumps. + * osmoappdesc.py: fix wrong index introduced by gtphub. + * gtphub VTY test: use only 127.0.0.1. + * gtphub VTY: fix doc strings for show cmds + * gtphub VTY: add newlines to some VTY docs' final lines + * fix bsc_vty out: timeslot indented too deeply. + * remove src/libgb/Makefile.am + * Add README.vty-tests + * openbsc/README: some fixes, add CSCN and Iu* + * gtphub: include ports.h instead of redefining OSMO_VTY_PORT_GTPHUB + * gtphub: tweak default logging level + * osmo-bsc: fix checking wrong pointer for ctrl setup success + * minor fixes in bsc_vty.c and bsc_nat.c + * bsc_nat: fail if VTY telnet port cannot be bound, clarify comment + * ipaccess_rcvmsg: fix returncode, add partial write warning + * gsm340_rx_tpdu: comment-out two unused vars + * enable telnet VTY bind address config for various programs + * osmo-nitb: add -M to pass specific MNCC socket path + * osmo-nitb: cosmetic: rename to rf_ctrl_path, following mncc_sock_path + * osmo-nitb: be strict about cmdline args + * enable ctrl bind config for various programs + * smpp: refactor initialization, add bind address + * bsc_test.c: fix tz.override val and note a FIXME + * osmo_bsc_filter.c: add fixme note + * minor comment + * use sqlite3_close() instead of sqlite3_close_v2() + * check return value of sqlite3_close(), retry up to three times. + * db: evaluate return value of sqlite3_finalize(), tweak log output. + * channel_test: don't segfault if paging fails + * 04.08: apply new bitmask functions, fix bitmask use + * 04.08: apply new transaction id inline functions + * bsc_scan_msc_msg: check protocol discriminator + * fix confusing typo in constant (THAN -> THEN) + * osmo-bsc: fix compiler warning: store struct in vty->index + * Add MM Auth test; add auth_action_str() function + * MM Auth test: add two tests for AUTH_THEN_CIPH + * MM Auth test: add test to re-use existing auth + * MM Auth: introduce AUTH_ERROR constant. + * MM Auth: return AUTH_NOT_AVAIL instead of hardcoded zero + * Fix MM Auth: disallow key_seq mismatch + * Fix MM Auth: zero-initialize auth tuple before first use + * gtphub_unmap_header_tei(): don't dereference unmapped_tei arg if not present (CID #57687) + * bsc_nat: forward_sccp_to_msc(): assert con presence (CID #57872) + * gbproxy_test: assert msg allocation (CID #57873) + * drop unneccessary duplicate linking: osmo-bsc + * drop unneccessary duplicate/unused linking: ipaccess + * drop unneccessary duplicate linking: osmo-nitb + * drop unneccessary duplicate linking: tests/gsm0408 + * gsm04_08_clear_request(): release loc with arg release=0 + * tweak db debug log: log TMSI as hex + * gprs_gmm.c: Don't try to de-reference NULL mmctx + * comment tweak for bsc_handover_start() + * debug log: cosmetic fixes + * gprs_gmm.c: don't transmit NOTEXIST when mmctx is NULL + * lchan_alloc(): on alloc failure, report original type + * dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots + * dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable + * dyn PDCH: TS flags: rename one, add three, as enum + * dyn PDCH: fix: clear PDCH flags on TS reconnect (e.g. BTS re-connect) + * dyn PDCH: track pending PDCH de-/activation + * dyn PDCH: add lchan sanity checks in PDCH DE/ACT ACK + * dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACT + * bsc_version.c: update copyright date, add contributor + * configure: require libgsm for --enable-mgcp-transcoding + * rm dup: use channel type names from libosmocore + * typo in sgsn_test + * dyn PDCH: enable PDCH only after release due to error + * vty: show lchan summary: also show lchan->state + * debug log: log all lchan state transitions + * dyn PDCH: cosmetic: clarify lchan rel with assertion and comment + * err log: tweak dyn pdch ack error logging + * jenkins.sh: remove code dup + * jenkins.sh: add --enable-iu matrix build + * cosmetic: dyn_pdch_init(): flatten if-logic, add comments + * dyn pdch: don't PDCH ACT if gprs mode is none + * fix ctrl test: dyn TS: use new GSM_PCHAN_TCH_F_TCH_H_PDCH + * fix: create_pdp_conf(): unset reject_cause after unknown ran_type + * comments: clarify some dynamic TS comments + * cosmetic: rsl_rx_rf_chan_rel_ack(): use local ts var for brevity + * cosmetic: act lchan type: use constant instead of 0x00 + * cosmetic: rsl_rx_chan_act_ack(): use local lchan var in 14 instances + * dyn TS: add ts->dyn state + * gsm_data_shared: add gsm_ts_and_pchan_name() for dyn ts logging + * code dup: join [rsl_]lchan_lookup() from libbsc and osmo-bts + * error log: abis_rsl.c: log errors in channel_mode_from_lchan() + * log lchan_alloc() result + * debug log: fix line endings for abis_rsl_rx_rll logging + * gsm_ts2chan_nr(): add assertions for lchan_nr + * cosmetic: dyn_pdch_init(): debug log: use new gsm_ts_and_pchan_name() + * error log: rsl_chan_activate_lchan: log channel mode error + * prepare dyn TS: act lchan: fetch the channel mode a bit later + * dyn TS: rename lchan->dyn_pdch to lchan->dyn + * dyn TS: gsm_lchan2chan_nr(): decouple from ts->pchan + * dyn TS: rsl *2chan_nr(): handle TCH/F_TCH/H_PDCH + * dyn TS: verify_chan_comb(): handle new dyn TS NM_CHANC_* + * dyn TS: rsl_lchan_lookup(): add dyn PCHAN + * dyn TS: enhance channel allocator for dynamic TS + * dyn TS: chan act: set chan_nr according to dyn pchan type + * dyn TS: implement pchan switchover logic + * dyn TS: split dyn_pdch_init() for new dyn type and rename + * dyn TS: Rename bsc_dyn_pdch.c to bsc_dyn_ts.c + * dyn TS: OS#1778 workaround: disable TCH/F on dyn TS for nitb + * gsm_pchan2chan_nr: disable a chan_nr assert in BTS, to not break octphy + * gsm_pchan2chan_nr(): fix uninitialized cbits + * comment: gsm48_gmm_sendmsg(): add spec reference on encryptable + * dyn TS: bts_chan_load: use correct nr of subslots for dyn ts + * chan_alloc.c: use ts_subslots() instead of subslots_per_pchan[] + * move ts_sublots() to gsm_data_shared.c, it will be used by osmo-bts + * dyn TS: move check whether to switch to PDCH to separate function + * dyn TS: fix error recovery: switch to PDCH after lchan error state + * dyn TS: clearly use lchan[0], fixing minor confusion + * dyn TS: fix: properly run an lchan activation timeout + * dyn TS: fix OS#1798: on late RF CHAN REL ACK, activate PDCH + * dyn TS: debug log 'switchover complete' only when there was a switchover + * dyn TS: debug log: if still in use, also log lchan type and state + * log: improve for rsl_lchan_mark_broken() + * log: rsl notice: tiny tweak for readability + * add libiu + * cosmetic: gprs_sgsn.c: move pdp.h include to top + * IuPS: add VTY config for asn_debug + * log: abis_rsl: don't log 'error' when there is no error + * log causing rx event for lchan_lookup errors + * properly #include from gsm_subscriber.h + * remove unused bsc_copyright from bsc_vty.c + * vty l3 help: fix typo 'comamnds'; fix english s/his// + * utils/Makefile.am: remove unused LIBOSMOVTY_CFLAGS + * cosmetic: various comment, whitespace tweaks + * Sanity fixes for gsm0408_dispatch(): rc, assertions + * debug log for sms: fix/add + * cosmetic: transaction.h: 1 comment typo, 1 whitespace + * cosmetic fixes in libcommon/talloc_ctx.c + * mscsplit: bsc_init: don't pass telnet dummy conn + * mscsplit: move subscriber conns list into struct gsm_network + * mscsplit: gsm_network_init(): add explicit root talloc ctx + * mscsplit: talloc_ctx_init(): decouple from global tall_bsc_ctx + * mscsplit: bsc_vty_init(): decouple from global bsc_gsmnet + * mscsplit: abis vty: decouple from global bsc_gsmnet variable + * mscsplit: add gsm_network backpointer to gsm_subscriber_connection + * mscsplit: directly access gsm_network backpointer from gsm_subscriber_connection + * cosmetic: vty_test_runner.py: add comment for vim auto settings + * vty_test_runner.py: raise exception when MSC socket connection fails + * log VTY telnet bind only once + * cosmetic: comment typo on e1_config.c + * channel test: prepare to add another test function + * channel_test: test nr of subslots for dyn pchan, with error + * Revert "bts: extend bts_chan_load to allow counting tch only" + * dyn TS: fix: ts_subslots() for TCH/F_PDCH in PDCH mode + * dyn TS: fix: abis_om2000: also handle dyn TS as TCH + * dyn TS: fix: e1_config.c: switch(pchan) for dyn TS + * cosmetic: bs11: also use ts_is_tch() + * vty_test_runner.py: fix nat_msc_test(): socket attach: reduce timeout, retry + * fix: send SNDCP XID only on GERAN Gb contexts + * log CTRL bind only once + * vty_test_runner.py: make unittest print all output by default + * vty_test_runner.py: fix indents to use spaces, fix vim comment + * build: be robust against install-sh files above the root dir + * configure: check for pkg-config presence + * Revert "bsc: count the usage of codec by setting the lchan active" + * abis_rsl_rx_dchan(): guard against lchan_lookup() returning NULL + * gsm_trx_name(): don't break if trx is NULL + * jenkins.sh: use osmo-build-dep.sh, log test failures + * ipaccess-config: initialize root talloc ctx with name + * bs11_config: initialize bs11 tall ctx, use instead of bsc ctx + * meas_pcap2db.c: remove unused include of msgb.h + * gtphub_test.c: remove unused include of msgb.h + * msgb talloc ctx: initialize in all main() scopes + * msgb ctx: use new msgb_talloc_ctx_init(), don't access talloc_msgb_ctx + * info log: iu: add line break to and tweak rx RAB Ass Resp log + * log: count_codecs(): drop logging of non-TCH lchan types + * bsc_vty: include dyn TS info in vty show lchan + * fix use after free in bsc_config_free + * OM2000: for TS conf of dyn TS, always send TCH/F chan comb + * OM2000: disallow ip.access style TCH/F_PDCH pchan type + * Add empty libcommon-cs + * define mncc_recv_cb_t to avoid code dup + * move to libcommon-cs: net init 1: rename to bsc_network_init + * move to libcommon-cs: net init 2: move bsc_network_init decl to new .h + * move to libcommon-cs: net init 3: actual move + * move to libcommon-cs: gsm48_create_mm_serv_rej(), gsm48_create_loc_upd_rej() + * IuPS: properly update ra_id on GMM Attach Request + * factor out gen of USSD notify and release complete to libosmocore + * factor out & introduce struct gsm_encr, in common_cs.h + * sms_next_rp_msg_ref(): use direct pointer to next_rp_ref counter + * tests: drop unused libmsc, unneeded duplicate libbsc linking + * split bsc_bootstrap_network() in alloc and config + * global gsm_network: move allocation further up + * move to libcommon-cs: global vty gsm_network pointer + * move to libcommon-cs: network VTY that isn't BSC-specific + * bsc vty: rename show_net_cmd to bsc_show_net_cmd + * reinvent connection_for_subscr() and move to libmsc + * Move timezone settings up to network level + * move to libcommon-cs: net timezone VTY config + * split subscr_con_allocate()/_free() in bsc_ and msc_ + * osmo-nitb: exit when MNCC socket init failed + * gsm_subscriber_connection: mark BSC specific items + * abis_om2k: fix typo that declared non-existent struct gsm_bts_trx_s + * lchan release in error state: SACCH deact only for SACCH pchans + * cosmetic: chan_alloc: use switch instead of if-cascade + * Fix TCH/F_PDCH: no need to check ts subslots for PDCH + * Revert "Support Deactivate PDP Context Request from network" + * build: bump required libosmocore, libosmogsm to 0.9.4, for GSUP + * comments: gsup client: rename to Generic, adjust copyright and authors + * gprs_gsup_client*: remove the gprs_ prefix + * rename gprs_gsup_client.h to gsup_client.h + * gsup client, gsup_test_client: move logging to DLGSUP category + * oap: rename public API from oap_ to oap_client_ + * rename oap.h to oap_client.h + * move gprs/oap.c to libcommon/oap_client.c + * move grps_gsup_client.c to libcommon/gsup_client.c + * oap_test.c: rename to avoid clash with libosmocore oap_test.c + * oap_client_test: print test descr to stderr, check stderr + * oap_client: move logging to DLOAP logging category + * oap_client_test: show bug: disabled state does not reject message + * oap_client: reject all messages in disabled/uninitialized state + * oap_client: make use of OAP optional: disable for NULL config + * fix: missing terminator in two value_string arrays + * gtphub: fix possible NULL deref: don't print NULL tunnel + * build: osmo-nitb: fix missing LIBCRYPTO_FLAGS + * build: remove obsolete $LIBCRYPT in two places + * gitignore: gsup_test_client binary + * use new OSMO_VALUE_STRING + * fix 'osmo-nitb --version' segfault + * Revert "Turn some warnings into errors" + * gprs subscr: fix: intended strcmp(), but is strcpy() + * undup: gtphub_test: use libosmocore's llist_count() + * fix strncpy() invocation in vty_interface_layer3.c and 3 tests + * cosmetic: use osmo_strlcpy() everywhere + * various comment / whitespace tweaks (libmsc, gprs, libcommon-cs) + * osmo_bsc_grace.h: use '<>' include, not '""' + * paging.h: use '<>' include, not '""' + * compiler warning: bsc_vty: remove two unused vars + * gsm0408_rcv_cc: guard against NULL subscriber + * vty tests: attempt to get at sporadic 'Broken Pipe' error + * vty tests: more attempts to resolve sporadic 'Broken Pipe' error + * vty tests: testBSCreload: ipa_handle_small: ensure rx of 4 bytes + * gsm48_tx_mm_auth_req(): support UMTS AUTN + * Revert "vty tests: more attempts to resolve sporadic 'Broken Pipe' error" + * gsm_04_08: implement parsing of UMTS Auth responses + * vty tests: more attempts to resolve 'Broken Pipe' error + * vty tests: more attempts to resolve 'Broken Pipe' error (3) + * vty tests: more attempts to resolve 'Broken Pipe' error (2) + * remove compiler warning: unused rc in vty_interface_layer3 + * subscr_update_expire_lu(): fix (obscure) segfault + * logging: use central filter and ctx consts from libosmocore + * debug.h/c: remove unused cruft / cosmetic tweaks + * logging fixup: shorter names for LOGGING_FILTER_* and LOGGING_CTX_* + * cosmetic: remove unused scall_signal_data.subscr + * vty_test_runner.py: fix socket leak + * vty: fix subscr ref count leak in 'subscriber name' cmd + * cosmetic: gsm_data.h, README: rename CSCN to MSC + * cosmetic: clarify BSC's remote MSC data vs. OsmoMSC + * cosmetic: rename osmo_msc_data.h to bsc_msc_data.h + * cosmetic: rename struct osmo_msc_data to bsc_msc_data + * add struct gprs_subscr, separating gprs from gsm_subscriber + * vty_rest_runner.py: remove debug monitoring for TCP sockets + * python tests: remove process 'Launch' message, now at osmoutil + * smpp_test_runner.py: fix socket leak + * SGSN: Integrate support for UMTS AKA + * SGSN VTY: make missing GSUP server address+port fatal + * vty test: nat_msc_test: setsockopt REUSE to avoid TIME_WAIT problems + * ctrl_test_runner: speed up more than 10 fold by sleeping less + * fix: gprs_gmm, gprs_llc_vty: two unterminated value_string arrays + * subscriber conn: add indicator for originating RAN + * vty tests: allow picking specific tests to run by name + * vty tests: close msc socket after nat_msc_test + * add struct bsc_subscr, separating libbsc from gsm_subscriber + * python tests: vty and smpp: speed up >10 times + * oap tests: fix after SQN scheme changes from libosmocore + * jenkins: add value_string termination check + * bsc_/gprs_subscriber: fix: use osmo_strlcpy() to safely copy IMSI + * python tests: allow running from separate build dir + * LU counters: count completion and failure, not messages sent + * jenkins.sh: Iu: use libosmo-sccp,-netif master + * build: iu: use libosmo-sccp tag 'old_sua' + * fix VTY parsing: subscriber-create-on-demand random + * fix subscriber random extension allocation range + * fix '/include/openbsc ' to have no trailing space + * ipaccess-config: properly create swload + * jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua' + * cosmetic: vty for timers: remove obsolete range check + * vty: add 'default' keyword to timer config + * timer vty: also print the default value in cmd doc + * Revert "factor out & introduce struct gsm_encr, in common_cs.h" + * fix vty tests: vty no longer goes to parent node implicitly + * jenkins: use osmo-clean-workspace.sh before and after build + + [ Pablo Neira Ayuso ] + * mgcp_osmux: available circuit IDs from 0 to 255, not from 0 to 128 + * libmsc: use GSM411_RP_CAUSE_MO_NUM_UNASSIGNED as return value + * libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP + * src: use osmo_timer_setup() + * gsm_04_11: get rid of unused parameter in sms_route_mt_sms() + * libmsc: do not leak pending SMPP command object on error path + * libmsc: remove dead code in sms_route_mt_sms() + * libmsc: remove duplicate lines in deliver_to_esme() + * libmsc: remove 'deferred' parameter in sms_route_mt_sms() + * libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() + * libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM messages + * libmsc: report status report request flag from SMPP SUBMIT_SM + * libmsc: missing bit shift in status report flag when stored in sms object + * utils: smpp_mirror: set registered_delivery field in SMPP SUBMIT_SM + * utils: smpp_mirror: temporarily munch SMPP delivery receipts + * utils: smpp_mirror: reflect message reference TLV + * libmsc: add support for SMPP delivery receipts + * libmsc: update database to accomodate SMS status-report fields + * utils: smpp_mirror: bounce Delivery Receipts as Delivery Acknowledgments + * libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report + * libmsc: support GSM 03.40 status report for nitb + * libmsc: gsm340_gen_oa_sub() may return negative value + * libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling + * libmsc: use new smpp34 esm_class definitions + * libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 + * libmsc: annotate esme route in the sms object from deliver_to_esme() + * libmsc: sms_route_mt_sms() may return uninitialized return value + + [ Martin Hauke ] + * Fix no-return-in-nonvoid-function meas_vis.c + * Fix Warning: openbsc implicit-pointer-decl meas_udp2db.c:50 + + [ Alexander Huemer ] + * tests/oap: depend on libgtp + * tests/abis: fix format specifiers + * gprs: use libgtp cflags + * Consistenly format variables in */Makefile.am files + * Build fixes + * Add missing _CFLAGS and _LIBS + + [ Ruben Undheim ] + * Patch to make openbsc find libsmpp34 + * Fix some typos in stdout output + * deb: unbreak nightly builds + + [ Vadim Yanitskiy ] + * move to hex TMSI representation + * db.c: implemented incremental migration + * mncc_sock: use osmo_sock_unix_init() from libosmocore + * VTY: add the dyn_ts_allow_tch_f option + + [ Max ] + * Ignore vty test byproducts + * Fix segfault with broken config + * NAT: vty command to display number of BSCs + * NAT: extend debug output for ipaccess errors + * Remove trivial wrapper function + * NAT: allow allocating BSC in arbitrary order + * vty_test_runner: update ipa sending code + * NAT: move BSC config into separate file + * NAT: reload BSCs config dynamically + * Add SI2quater support to SI3 + * Refactor SI-related code + * Add basic SI2quater support + * Fix documentation for command parameters + * Fix earfcn deletion + * Cleanup shared data structure + * Add basic UARFCN support + * Add vty check for max si2quater size + * Add extra debug output with channel mode and type + * Add missing include + * Fix comment typo + * Adjust si2quater ranges + * Disconnect calls with incompatible channel types / modes + * Ignore extended test leftovers + * Cleanup db test + * Move DTX settings to BTS + * Use proper measurement for handover + * Make extending subscriber creation easier + * Fix copy-paste error in SI6 + * Make si2q scheduling optional + * Store last used FN for TCH + * Add regexp authorization policy for IMSI + * Add warning for unsupported DTX configurations + * Add DTXd indicator to gsm_lchan + * DTX: add data necessary for scheduling + * Add talkspurt indicator for gsm_lchan + * Fix SIGABRT on wrong AMR payload + * Make random extension range configurable + * Fix vty tests with subscriber deletion + * SGSN: force GSUP CN domain to PS + * SGSN: add vty config for choosing GPRS encryption + * SGSN: move TLLI unassignment into separate function + * Make random MSISDN assignment optional + * SGSN: prevent starting with inconsistent config + * SGSN: use unique AUTH REQ reference + * SGSN: split GEA key management from TLLI + * SGSN: add preliminary support for GPRS encryption + * SGSN: encrypt/decrypt only necessary frames + * SGSN: move cipher application to separate function + * Fix default subscriber regexp + * Improve code re-use + * Use random operation id + * Add python functions to get/set ctrl variables + * Add web proxy for control interface + * Modify SI 13 field for control_ack_type + * DTX: extend SID cache + * DTX: add flag for AMR HR P* + * DTX DL: use FSM for AMR + * Log use of incompatible BS-AG-BLKS-RES value + * Replace magic number with define + * DTX DL: Add FACCH cache + * Decrease count_codecs logging verbosity + * abisip-find: use protocol constant + * Replace duplicated code with macro call + * Add IPA multiplex + * Use IPA module for vty tests + * Add twisted-based IPA multiplex + * bsc_control.py: style corrections + * bsc_control.py: use ipa.py module + * bsc_control.py: remove unused -i option + * Improve GPRS logging + * Integrate Debian packaging changes + * Cosmetic fixes around SI generation + * Turn some warnings into errors + * Log expected SRES on GPRS AUTH REJECT + * Turn some compiler warnings into errors + * Print subcriber when skipping auth + * Improve OML failure report + * bsc_control.py: fix blocking + * Prevent segfault in range encoding + * SI2q: add support for multiple UARFCNs + * CTRL: remove boilerplate + * Remove dependency to autoconf-archive + * Attempt to fix nightly builds + * vty: remove ignored logging parameters + * Expand chan allocation logging + * Remove duplicating define + * Add support for extended SI2q parameters + * Handle DSD from HLR + * Fix potential segfault in sgsn_libgtp.c + * Add MS time. offset to gsm_lchan + * examples: remove logging level * everything + * Don't drop OML links for Get Attributes NACK + * twisted_ipa.py: bump version properly + * twisted_ipa.py: make debug logging more robust + * Add simple CTRL2SOAP proxy + * Handle PCU version received via OML alert + * python: fix Null logger + * abis: log known ACKs and unknown messages + * gsm_bts: add version and variant details + * Fix MS TO measurement representation + * Remove libs from openbsc.pc + * gbproxy: add example .service + * deb: install openbsc.pc + * Save PCU version reported by BTS + * Prepare for extended SI2quater support + * Add gsm_bts_type_variant to gsm_bts struct + * Make pcap dependency optional + * Fix vty warnings for GEA0 + * ctrl: remove boilerplate code + * deb: install python scripts from contrib/ + * Gb: use textual representation for parse log + * Use ipa.py for ctrl tests + * Use libosmocore for SW Description parsing + * Make BTS type and variant converters shareable + * Add forgotten items to .gitignore + * Use define for limit on number of BTS features + * Prepare for BTS attribute reporting via OML + * Restructure SI2quater generation + * SI2quater: fix EARFCN inclusion check + * Get basic BTS attributes + * Remove errorneous include + * Adjust BTS model feature check + * Add remote BTS feature storage and helpers + * Get TRX attributes + * Request and parse BTS feature list via OML + * OML: fix potential OOB memory access + * Move SI-related defines + * Update SI data structures and generation + * bsc_init: Forget which SIs are valid for the trx + * Fix BTS features length check + * Enable optional static builds + * Fix BTS attribute requests + * gbproxy: log unhandled BSSGP PDU as text + * gbproxy: log signal value as text + * Remove common_cs.h from .deb + * Use release helper from libosmocore + * SI13: drop PBCCH-related bits + * CTRL: cleanup write-only command functions + * Show OML link uptime in vty + * Make TRX rf locking more visible + + [ Alexander Couzens ] + * add .gitreview + * gprs: use new uint8_t * for kv in gprs_cipher_run() + * libbsc: skip channel state LCHAN_S_INACTIVE while handover + * gprs_gmm: remove duplicated start of T3395 + * bs11_config: add brackets to fix warning in argument parsing + * sgsn: add statistics counter for GPRS and PDP packets + * sgsn: add statistics counter for LLC packets + * libbsc/libmsc: convert old osmo counter into rate_ctrgs + * libmsc: add missing count of sms no receiver when using smpp_first + * libmsc/bsc: split rate counters into bsc and msc group + * bsc/netinit: correct mistyped rate counter + * gprs/gsm0408_gprs_force_reattach_oldmsg: check llme before use + * gprs/gprs_llc: fix null pointer deref in gprs_llc_rcvmsg + * sms: change rp err cause of smpp_try_deliver errors + * bts: extend bts_chan_load to allow counting tch only + * bsc: count the usage of codec by setting the lchan active + * msc: add counters to track call attempts/active/success/failed + * gprs/gprs_llc: count UI frames over SAPI in the statistics + * fix mistypes, spaces and tabs + * bsc: count the usage of codec by setting the lchan active + * gprs/sgsn: rename gprs->mm_state -> gmm_state + * gprs/sgsn: rename sgsn_mm_ctx_alloc() -> sgsn_mm_ctx_alloc_gb() + * gprs/gprs_mm: add value_strings for PMM & MM states + * gprs/sgsn_mm_ctx_alloc(): initialize MM state to IDLE + * gprs/sgsn_vty: fix typo in comment + * libmsc/update_db_revision_3(): free memleaking db result + * unixsocket: start sabm for UNIXSOCKET + * gprs_sgsn.c: initialize ptmsi with 0xdeadbeef + * libbsc: add chreq type for CHREQ_T_PDCH_ONE_PHASE & CHREQ_T_PDCH_TWO_PHASE + * abis_om2k: protect MO FSMs by NULL check + * libbsc: add rsl_ericsson_imm_assign_cmd() which reply with a confirmation message + * pcu_sock: set flag PCU_IF_FLAG_SYSMO by setting pcu_direct = 1 + * pcu_sock: pcu_tx_info_ind allow to use TRX not starting from 0 + * pcu_sock: implement direct tlli on AGCH + * abis_rsl: fix off-by-one length check when parsing ericson tlli field + * abis_rsl: use msgb_pull to parse tlli from msg + + [ Andreas Eversberg ] + * dyn PDCH: Fix free slot search for chan_alloc_reverse == true + * dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channel + + [ Dieter Spaar ] + * SGSN: fix FCS calculation for encrypted frames + + [ bhargava ] + * Modify SI 13 field to support 11 bit RACH + + [ Philipp ] + * Adding LLC-XID encoder / decoder and unit test + * Moving grs_sndcp.h header file to include + * Adding LLC-XID related modifications in LLC + * SNDCP: add SNDCP-XID encoder/decoder and unit test + * RFC1144: add slhc code from linux kernel + * RFC1144: integration and unit-test + * SNDCP: add RFC1144 header compression functionality + * V.42bis: add sourcecode from IAXmodem (SPANDSP) + * V.42bis: integration and unit test + * SNDCP: add V.42bis data compression functionality + * SLHC: Improving slhc (RFC1144) testcase + * SGSN: Fixing build config + * sndcp: Fixups for sndcp layer based on coverity-scan suggestions + * OML: Improve OML attribute handling + * gsm0408: Adding log output for 3g specific RR messages + * Cosmetic: Add missing switch to usage help + * OM2000: Add fault report parsing + * om2000: added support for ericssons sabm negotiation + * OM2000: Throw error when MO can not be enabled + * SNDCP: Fixup based on Coverity Scan suggestion + * rbs2000: Add missing bts feature definitions + * OM2000: Fixup based on Coverity Scan suggestion + * rsl: support for ericssons propritary SI13 format + * sndcp: fixup for coverity scan defect CID 149097 + * LLC: Fixup element order in LLC-XID + * sndcp: Allow empty SNDCP-XID indications + * cosmetic: Rename phone to ms + + [ root ] + * om2000: Add support for querying RBS capabilities + + [ Pravin Kumarvel ] + * Correct Logging macro for pdpctx_timer_start + * Add support for pdpctx_timer_stop + * Support Deactivate PDP Context Request from network + + [ Keith ] + * Pass actual smpp_avail_status through to smpp in alert_all_esme() + * Add VTY command to immediately expire user (set expire_lu to now) + * meas_json: fix NEIGH: missing array braces + * libmsc: Map SMPP command status to GSM 04.11 cause + * LIBMSC: Place correct dst address in status report + * LIBMSC: Use sms->text, not sms->user_data to construct report body + * libmsc: Use actual delivery time in delivery reports. + * libmsc: Log Rx DELIVER-SM RESP before calling gsm411_send_rp_ack + + [ Philipp Maier ] + * compression: Fix nullpointer deref + * gprs: Fix compiler warning about uninitalized cause code + * om2000: add VTY command to delete CON groups + * XID: resend xid with pdp-ctx-ack messages + * silent_call: remove unfinished fuzzer interface + * sgsn: fix problem with leading-zero-IMSIs + * cosmetic: add copyright header to bsc_control.py + * cosmetic: Add commandline option to display version + * gprs: fix T3186 encoding in Sysinfo 13 + * gsm_data_shared: add value strings for gsm_chreq + * libbsc: add debug log message to S_L_INP_* callbacks + * pcu_sock: add basic pcu interface support + * pcu_sock: Forward imm.ass PCU originated messages + * pcu_sock: Fix broken paging command + + [ Minh-Quang Nguyen ] + * rsl: Fix dropping of LAPDm UA message. + + [ Alexander Chemeris ] + * utils: 'meas_json' utility to convert measurement feed into a JSON feed. + * libmsc: Fix VTY output for handover counters. + * libcommon: Fix log output for bts>0. + + [ Pau Espin Pedrol ] + * nat: Use equal func in bsc_sccp + * nat: Fix initial buffer size parameter for getline + * smpp_smsc.c: Log on sending deliver_sm message + * libmsc: Remove comment not applying anymore + * mgcp_osmux: Remove unused parameter + * mgcp: Fix uplink activation of Osmux stream + * sgsn_test: Fix wrong definition of wrap func + * smpp: Fix compilation warning + * libmsc: Fix wrong handling of user_message_reference parameter + * bsc_api: Fix NULL secondary_lchan access in handle_ass_fail + * libbsc: Use correct printf formatting for uint64_t + + [ Benoit Bolsee ] + * smpp: fix return cause + * 04.08: find a portable way to obtain the timezone offset + * transaction: reject calls from unidentified subscribers + + [ Ivan Kluchnikov ] + * handover_logic: set correct link to bts for subscriber_connection in case of moving this connection to another bts + * handover_decision: Fix condition for power budget handover attempt + + [ Andr? Boddenberg ] + * Make use of osmo-build.sh to use dependency artifacts for builds. + + -- Harald Welte Sat, 28 Oct 2017 21:17:34 +0200 + openbsc (0.15.1) UNRELEASED; urgency=medium * Move forward toward a new release. -- To view, visit https://gerrit.osmocom.org/4542 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5d19269983c9281bf36a7279151891902eff0013 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:49:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:49:27 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_osmo-bsc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E0=2E2-0ae59_=E2=86=92_1=2E1=2E1?= Message-ID: Review at https://gerrit.osmocom.org/4543 Bump version: 1.1.0.2-0ae59 ? 1.1.1 Change-Id: I6aefde159b83608679000239cc1603ef076db219 --- M debian/changelog 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/43/4543/1 diff --git a/debian/changelog b/debian/changelog index e78680a..c20b9b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +osmo-bsc (1.1.1) unstable; urgency=medium + + [ Neels Hofmeyr ] + * jenkins: use osmo-clean-workspace.sh before and after build + + [ Harald Welte ] + * Debian: re-introduce missing build dependency to libssl-dev + + -- Harald Welte Sat, 28 Oct 2017 21:49:00 +0200 + osmo-bsc (1.1.0) unstable; urgency=medium [ Alexander Couzens ] -- To view, visit https://gerrit.osmocom.org/4543 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6aefde159b83608679000239cc1603ef076db219 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:54:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:54:21 +0000 Subject: =?UTF-8?Q?osmo-bsc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E0=2E2-0ae59_=E2=86=92_1=2E1=2E1?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4543 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6aefde159b83608679000239cc1603ef076db219 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:54:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:54:22 +0000 Subject: =?UTF-8?Q?=5BMERGED=5D_osmo-bsc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E0=2E2-0ae59_=E2=86=92_1=2E1=2E1?= In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Bump version: 1.1.0.2-0ae59 ? 1.1.1 ...................................................................... Bump version: 1.1.0.2-0ae59 ? 1.1.1 Change-Id: I6aefde159b83608679000239cc1603ef076db219 --- M debian/changelog 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/debian/changelog b/debian/changelog index e78680a..c20b9b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +osmo-bsc (1.1.1) unstable; urgency=medium + + [ Neels Hofmeyr ] + * jenkins: use osmo-clean-workspace.sh before and after build + + [ Harald Welte ] + * Debian: re-introduce missing build dependency to libssl-dev + + -- Harald Welte Sat, 28 Oct 2017 21:49:00 +0200 + osmo-bsc (1.1.0) unstable; urgency=medium [ Alexander Couzens ] -- To view, visit https://gerrit.osmocom.org/4543 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6aefde159b83608679000239cc1603ef076db219 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Sat Oct 28 19:57:10 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 19:57:10 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f4e11f423a_718e50ef741329062@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 127s] To: [ 127s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 127s] [ 127s] You may investigate any problem if you feel able to do so, in which [ 127s] case the test suite provides a good starting point. Its output may [ 127s] be found below `tests/testsuite.dir'. [ 127s] [ 127s] Makefile:1221: recipe for target 'check-local' failed [ 127s] make[3]: *** [check-local] Error 1 [ 127s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 127s] Makefile:1055: recipe for target 'check-am' failed [ 127s] make[2]: *** [check-am] Error 2 [ 127s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 127s] Makefile:460: recipe for target 'check-recursive' failed [ 127s] make[1]: *** [check-recursive] Error 1 [ 127s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 127s] dh_auto_test: make -j1 check returned exit code 2 [ 127s] debian/rules:12: recipe for target 'build' failed [ 127s] make: *** [build] Error 2 [ 127s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 127s] [ 127s] build85 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:56:50 UTC 2017. [ 127s] [ 127s] ### VM INTERACTION START ### [ 131s] [ 124.053288] reboot: Power down [ 131s] ### VM INTERACTION END ### [ 131s] [ 131s] build85 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:56:54 UTC 2017. [ 131s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:57:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:57:41 +0000 Subject: [PATCH] osmo-msc[master]: Debian: Depend on libosmo-sigtran-dev, not libsomo-sccp-dev! Message-ID: Review at https://gerrit.osmocom.org/4544 Debian: Depend on libosmo-sigtran-dev, not libsomo-sccp-dev! Change-Id: I478e28ba5f7e39cecea8912183e288ecb2f03337 --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/44/4544/1 diff --git a/debian/control b/debian/control index 4f0aafb..c017e16 100644 --- a/debian/control +++ b/debian/control @@ -15,7 +15,7 @@ libsmpp34-dev, libasn1c-dev, libosmocore-dev, - libosmo-sccp-dev, + libosmo-sigtran-dev, libosmo-abis-dev, libosmo-mgcp-client-dev, libosmo-netif-dev, -- To view, visit https://gerrit.osmocom.org/4544 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I478e28ba5f7e39cecea8912183e288ecb2f03337 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:57:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:57:41 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_osmo-msc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E0=2E1-6299_=E2=86=92_1=2E1=2E1?= Message-ID: Review at https://gerrit.osmocom.org/4545 Bump version: 1.1.0.1-6299 ? 1.1.1 Change-Id: I0143cbf462d8685bb7388024dddbc0eb9b3883dc --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/45/4545/1 diff --git a/debian/changelog b/debian/changelog index cdb0430..7c6e1de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-msc (1.1.1) unstable; urgency=medium + + * Debian: Depend on libosmo-sigtran-dev, not libsomo-sccp-dev! + + -- Harald Welte Sat, 28 Oct 2017 21:57:22 +0200 + osmo-msc (1.1.0) unstable; urgency=medium [ Alexander Couzens ] -- To view, visit https://gerrit.osmocom.org/4545 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0143cbf462d8685bb7388024dddbc0eb9b3883dc Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:58:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:58:04 +0000 Subject: osmo-msc[master]: Debian: Depend on libosmo-sigtran-dev, not libsomo-sccp-dev! In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4544 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I478e28ba5f7e39cecea8912183e288ecb2f03337 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:58:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:58:08 +0000 Subject: =?UTF-8?Q?osmo-msc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E0=2E1-6299_=E2=86=92_1=2E1=2E1?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4545 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0143cbf462d8685bb7388024dddbc0eb9b3883dc Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:58:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:58:11 +0000 Subject: =?UTF-8?Q?=5BMERGED=5D_osmo-msc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E0=2E1-6299_=E2=86=92_1=2E1=2E1?= In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Bump version: 1.1.0.1-6299 ? 1.1.1 ...................................................................... Bump version: 1.1.0.1-6299 ? 1.1.1 Change-Id: I0143cbf462d8685bb7388024dddbc0eb9b3883dc --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/debian/changelog b/debian/changelog index cdb0430..7c6e1de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-msc (1.1.1) unstable; urgency=medium + + * Debian: Depend on libosmo-sigtran-dev, not libsomo-sccp-dev! + + -- Harald Welte Sat, 28 Oct 2017 21:57:22 +0200 + osmo-msc (1.1.0) unstable; urgency=medium [ Alexander Couzens ] -- To view, visit https://gerrit.osmocom.org/4545 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0143cbf462d8685bb7388024dddbc0eb9b3883dc Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 19:58:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 19:58:11 +0000 Subject: [MERGED] osmo-msc[master]: Debian: Depend on libosmo-sigtran-dev, not libsomo-sccp-dev! In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Depend on libosmo-sigtran-dev, not libsomo-sccp-dev! ...................................................................... Debian: Depend on libosmo-sigtran-dev, not libsomo-sccp-dev! Change-Id: I478e28ba5f7e39cecea8912183e288ecb2f03337 --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/debian/control b/debian/control index 4f0aafb..c017e16 100644 --- a/debian/control +++ b/debian/control @@ -15,7 +15,7 @@ libsmpp34-dev, libasn1c-dev, libosmocore-dev, - libosmo-sccp-dev, + libosmo-sigtran-dev, libosmo-abis-dev, libosmo-mgcp-client-dev, libosmo-netif-dev, -- To view, visit https://gerrit.osmocom.org/4544 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I478e28ba5f7e39cecea8912183e288ecb2f03337 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Sat Oct 28 19:58:03 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 19:58:03 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f4e159e61ef_718e50ef7413294d5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 152s] To: [ 152s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 152s] [ 152s] You may investigate any problem if you feel able to do so, in which [ 152s] case the test suite provides a good starting point. Its output may [ 152s] be found below `tests/testsuite.dir'. [ 152s] [ 152s] Makefile:1221: recipe for target 'check-local' failed [ 152s] make[3]: *** [check-local] Error 1 [ 152s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 152s] Makefile:1055: recipe for target 'check-am' failed [ 152s] make[2]: *** [check-am] Error 2 [ 152s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 152s] Makefile:460: recipe for target 'check-recursive' failed [ 152s] make[1]: *** [check-recursive] Error 1 [ 152s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 152s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 152s] debian/rules:12: recipe for target 'build' failed [ 152s] make: *** [build] Error 2 [ 152s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 152s] [ 152s] lamb54 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:57:43 UTC 2017. [ 152s] [ 152s] ### VM INTERACTION START ### [ 156s] [ 148.620656] reboot: Power down [ 156s] ### VM INTERACTION END ### [ 156s] [ 156s] lamb54 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:57:47 UTC 2017. [ 156s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 19:58:54 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 19:58:54 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f4e19571506_718e50ef7413300a1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 145s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 145s] [ 145s] You may investigate any problem if you feel able to do so, in which [ 145s] case the test suite provides a good starting point. Its output may [ 145s] be found below `tests/testsuite.dir'. [ 145s] [ 145s] Makefile:1208: recipe for target 'check-local' failed [ 145s] make[3]: *** [check-local] Error 1 [ 145s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 145s] Makefile:1044: recipe for target 'check-am' failed [ 145s] make[2]: *** [check-am] Error 2 [ 145s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 145s] Makefile:448: recipe for target 'check-recursive' failed [ 145s] make[1]: *** [check-recursive] Error 1 [ 145s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 145s] dh_auto_test: make -j1 check returned exit code 2 [ 145s] debian/rules:12: recipe for target 'build' failed [ 145s] make: *** [build] Error 2 [ 145s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 145s] [ 145s] lamb06 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:58:38 UTC 2017. [ 145s] [ 145s] ### VM INTERACTION START ### [ 146s] Powering off. [ 146s] [ 139.007460] reboot: Power down [ 146s] ### VM INTERACTION END ### [ 146s] [ 146s] lamb06 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:58:39 UTC 2017. [ 146s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 19:58:54 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 19:58:54 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f4e196676_718e50ef7413301a6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 129s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 129s] [ 129s] You may investigate any problem if you feel able to do so, in which [ 129s] case the test suite provides a good starting point. Its output may [ 129s] be found below `tests/testsuite.dir'. [ 129s] [ 129s] Makefile:1208: recipe for target 'check-local' failed [ 129s] make[3]: *** [check-local] Error 1 [ 129s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 129s] Makefile:1044: recipe for target 'check-am' failed [ 129s] make[2]: *** [check-am] Error 2 [ 129s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 129s] Makefile:448: recipe for target 'check-recursive' failed [ 129s] make[1]: *** [check-recursive] Error 1 [ 129s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 129s] dh_auto_test: make -j1 check returned exit code 2 [ 129s] debian/rules:12: recipe for target 'build' failed [ 129s] make: *** [build] Error 2 [ 129s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 129s] [ 129s] lamb63 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:58:39 UTC 2017. [ 129s] [ 129s] ### VM INTERACTION START ### [ 130s] Powering off. [ 130s] [ 122.862726] reboot: Power down [ 130s] ### VM INTERACTION END ### [ 130s] [ 130s] lamb63 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:58:41 UTC 2017. [ 130s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 19:59:11 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 19:59:11 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f4e1977cad_718e50ef7413304e6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 151s] To: [ 151s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 151s] [ 151s] You may investigate any problem if you feel able to do so, in which [ 151s] case the test suite provides a good starting point. Its output may [ 151s] be found below `tests/testsuite.dir'. [ 151s] [ 151s] Makefile:1221: recipe for target 'check-local' failed [ 151s] make[3]: *** [check-local] Error 1 [ 151s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 151s] Makefile:1055: recipe for target 'check-am' failed [ 151s] make[2]: *** [check-am] Error 2 [ 151s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 151s] Makefile:460: recipe for target 'check-recursive' failed [ 151s] make[1]: *** [check-recursive] Error 1 [ 151s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 151s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 151s] debian/rules:12: recipe for target 'build' failed [ 151s] make: *** [build] Error 2 [ 151s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 151s] [ 151s] lamb11 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:58:55 UTC 2017. [ 151s] [ 151s] ### VM INTERACTION START ### [ 155s] [ 146.857944] reboot: Power down [ 155s] ### VM INTERACTION END ### [ 155s] [ 155s] lamb11 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:58:59 UTC 2017. [ 155s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 19:59:45 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 19:59:45 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f4e1d2c7f0d_718e50ef74133097c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 192s] To: [ 192s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 192s] [ 192s] You may investigate any problem if you feel able to do so, in which [ 192s] case the test suite provides a good starting point. Its output may [ 192s] be found below `tests/testsuite.dir'. [ 192s] [ 192s] Makefile:1221: recipe for target 'check-local' failed [ 192s] make[3]: *** [check-local] Error 1 [ 192s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 192s] Makefile:1055: recipe for target 'check-am' failed [ 192s] make[2]: *** [check-am] Error 2 [ 192s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 192s] Makefile:460: recipe for target 'check-recursive' failed [ 192s] make[1]: *** [check-recursive] Error 1 [ 192s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 192s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 192s] debian/rules:12: recipe for target 'build' failed [ 192s] make: *** [build] Error 2 [ 192s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 192s] [ 192s] build32 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:59:36 UTC 2017. [ 192s] [ 192s] ### VM INTERACTION START ### [ 195s] [ 186.097762] reboot: Power down [ 195s] ### VM INTERACTION END ### [ 195s] [ 195s] build32 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:59:40 UTC 2017. [ 195s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:00:02 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:00:02 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f4e1d33456c_718e50ef7413310e4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 155s] To: [ 155s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 155s] [ 155s] You may investigate any problem if you feel able to do so, in which [ 155s] case the test suite provides a good starting point. Its output may [ 155s] be found below `tests/testsuite.dir'. [ 155s] [ 155s] Makefile:1221: recipe for target 'check-local' failed [ 155s] make[3]: *** [check-local] Error 1 [ 155s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 155s] Makefile:1055: recipe for target 'check-am' failed [ 155s] make[2]: *** [check-am] Error 2 [ 155s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 156s] Makefile:460: recipe for target 'check-recursive' failed [ 156s] make[1]: *** [check-recursive] Error 1 [ 156s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 156s] dh_auto_test: make -j1 check returned exit code 2 [ 156s] debian/rules:12: recipe for target 'build' failed [ 156s] make: *** [build] Error 2 [ 156s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 156s] [ 156s] lamb11 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:59:52 UTC 2017. [ 156s] [ 156s] ### VM INTERACTION START ### [ 159s] [ 151.244433] reboot: Power down [ 159s] ### VM INTERACTION END ### [ 159s] [ 159s] lamb11 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 19:59:56 UTC 2017. [ 159s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Oct 28 20:00:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 20:00:27 +0000 Subject: [PATCH] osmo-bsc[master]: Debian: depend on libosmo-sigtran (bsc) and libosmo-sccp (bs... Message-ID: Review at https://gerrit.osmocom.org/4546 Debian: depend on libosmo-sigtran (bsc) and libosmo-sccp (bsc-nat) Change-Id: I59c959a977b8ad4312766d86be879b16b34587cf --- M debian/control 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/46/4546/1 diff --git a/debian/control b/debian/control index e3f1e02..575c6bb 100644 --- a/debian/control +++ b/debian/control @@ -13,6 +13,7 @@ libssl-dev, libtalloc-dev, libosmocore-dev, + libosmo-sccp-dev, libosmo-sigtran-dev, libosmo-abis-dev, libosmo-netif-dev, -- To view, visit https://gerrit.osmocom.org/4546 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I59c959a977b8ad4312766d86be879b16b34587cf Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From admin at opensuse.org Sat Oct 28 20:00:36 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:00:36 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f4e1ef6bdd3_718e50ef741331190@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 222s] To: [ 222s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 222s] [ 222s] You may investigate any problem if you feel able to do so, in which [ 222s] case the test suite provides a good starting point. Its output may [ 222s] be found below `tests/testsuite.dir'. [ 222s] [ 222s] Makefile:1221: recipe for target 'check-local' failed [ 222s] make[3]: *** [check-local] Error 1 [ 222s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 222s] Makefile:1055: recipe for target 'check-am' failed [ 222s] make[2]: *** [check-am] Error 2 [ 222s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 222s] Makefile:460: recipe for target 'check-recursive' failed [ 222s] make[1]: *** [check-recursive] Error 1 [ 222s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 222s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 222s] debian/rules:12: recipe for target 'build' failed [ 222s] make: *** [build] Error 2 [ 222s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 222s] [ 222s] lamb25 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:00:29 UTC 2017. [ 222s] [ 222s] ### VM INTERACTION START ### [ 226s] [ 217.162107] reboot: Power down [ 226s] ### VM INTERACTION END ### [ 226s] [ 226s] lamb25 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:00:33 UTC 2017. [ 226s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:01:10 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:01:10 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f4e213e042b_718e50ef7413314ac@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 160s] To: [ 160s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 160s] [ 160s] You may investigate any problem if you feel able to do so, in which [ 160s] case the test suite provides a good starting point. Its output may [ 161s] be found below `tests/testsuite.dir'. [ 161s] [ 161s] Makefile:1221: recipe for target 'check-local' failed [ 161s] make[3]: *** [check-local] Error 1 [ 161s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 161s] Makefile:1055: recipe for target 'check-am' failed [ 161s] make[2]: *** [check-am] Error 2 [ 161s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 161s] Makefile:460: recipe for target 'check-recursive' failed [ 161s] make[1]: *** [check-recursive] Error 1 [ 161s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 161s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 161s] debian/rules:12: recipe for target 'build' failed [ 161s] make: *** [build] Error 2 [ 161s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 161s] [ 161s] lamb04 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:01:05 UTC 2017. [ 161s] [ 161s] ### VM INTERACTION START ### [ 164s] [ 156.511759] reboot: Power down [ 164s] ### VM INTERACTION END ### [ 164s] [ 164s] lamb04 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:01:08 UTC 2017. [ 164s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:01:27 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:01:27 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f4e22f77751_718e50ef74133155b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 216s] To: [ 216s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 216s] [ 216s] You may investigate any problem if you feel able to do so, in which [ 216s] case the test suite provides a good starting point. Its output may [ 216s] be found below `tests/testsuite.dir'. [ 216s] [ 216s] Makefile:1221: recipe for target 'check-local' failed [ 216s] make[3]: *** [check-local] Error 1 [ 216s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 216s] Makefile:1055: recipe for target 'check-am' failed [ 216s] make[2]: *** [check-am] Error 2 [ 216s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 216s] Makefile:460: recipe for target 'check-recursive' failed [ 216s] make[1]: *** [check-recursive] Error 1 [ 216s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 216s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 216s] debian/rules:12: recipe for target 'build' failed [ 216s] make: *** [build] Error 2 [ 216s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 216s] [ 216s] lamb51 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:01:13 UTC 2017. [ 216s] [ 216s] ### VM INTERACTION START ### [ 219s] [ 211.921013] reboot: Power down [ 219s] ### VM INTERACTION END ### [ 219s] [ 219s] lamb51 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:01:16 UTC 2017. [ 219s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:01:46 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:01:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f4e2311659f_718e50ef7413316a3@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 211s] To: [ 211s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 211s] [ 211s] You may investigate any problem if you feel able to do so, in which [ 211s] case the test suite provides a good starting point. Its output may [ 211s] be found below `tests/testsuite.dir'. [ 211s] [ 211s] Makefile:1221: recipe for target 'check-local' failed [ 211s] make[3]: *** [check-local] Error 1 [ 211s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 211s] Makefile:1055: recipe for target 'check-am' failed [ 211s] make[2]: *** [check-am] Error 2 [ 211s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 211s] Makefile:460: recipe for target 'check-recursive' failed [ 211s] make[1]: *** [check-recursive] Error 1 [ 211s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 211s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 211s] debian/rules:12: recipe for target 'build' failed [ 211s] make: *** [build] Error 2 [ 211s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 211s] [ 211s] lamb51 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:01:35 UTC 2017. [ 211s] [ 211s] ### VM INTERACTION START ### [ 214s] [ 206.643222] reboot: Power down [ 214s] ### VM INTERACTION END ### [ 214s] [ 214s] lamb51 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:01:38 UTC 2017. [ 214s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Oct 28 20:03:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 20:03:31 +0000 Subject: osmo-bsc[master]: Debian: depend on libosmo-sigtran (bsc) and libosmo-sccp (bs... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4546 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59c959a977b8ad4312766d86be879b16b34587cf Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From admin at opensuse.org Sat Oct 28 20:03:28 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:03:28 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f4e2a66a95c_718e50ef741331966@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 102s] #define HAVE_SYS_TYPES_H 1 [ 102s] #define HAVE_SYS_STAT_H 1 [ 102s] #define HAVE_STDLIB_H 1 [ 102s] #define HAVE_STRING_H 1 [ 102s] #define HAVE_MEMORY_H 1 [ 102s] #define HAVE_STRINGS_H 1 [ 102s] #define HAVE_INTTYPES_H 1 [ 102s] #define HAVE_STDINT_H 1 [ 102s] #define HAVE_UNISTD_H 1 [ 102s] #define HAVE_DLFCN_H 1 [ 102s] #define LT_OBJDIR ".libs/" [ 102s] [ 102s] configure: exit 1 [ 102s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 102s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 102s] make[1]: *** [override_dh_auto_configure] Error 255 [ 102s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 102s] debian/rules:45: recipe for target 'build' failed [ 102s] make: *** [build] Error 2 [ 102s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 102s] [ 102s] lamb20 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:03:13 UTC 2017. [ 102s] [ 102s] ### VM INTERACTION START ### [ 105s] [ 98.726897] reboot: Power down [ 105s] ### VM INTERACTION END ### [ 105s] [ 105s] lamb20 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:03:16 UTC 2017. [ 105s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:05:11 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:05:11 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f4e300e1f3a_718e50ef741332135@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 100s] #define HAVE_SYS_STAT_H 1 [ 100s] #define HAVE_STDLIB_H 1 [ 100s] #define HAVE_STRING_H 1 [ 100s] #define HAVE_MEMORY_H 1 [ 100s] #define HAVE_STRINGS_H 1 [ 100s] #define HAVE_INTTYPES_H 1 [ 100s] #define HAVE_STDINT_H 1 [ 100s] #define HAVE_UNISTD_H 1 [ 100s] #define HAVE_DLFCN_H 1 [ 100s] #define LT_OBJDIR ".libs/" [ 100s] [ 100s] configure: exit 1 [ 100s] dh_auto_configure: ./configure --build=i586-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 100s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 100s] make[1]: *** [override_dh_auto_configure] Error 255 [ 100s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 100s] debian/rules:45: recipe for target 'build' failed [ 100s] make: *** [build] Error 2 [ 100s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 100s] [ 100s] wildcard2 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:04:48 UTC 2017. [ 100s] [ 100s] ### VM INTERACTION START ### [ 101s] Powering off. [ 101s] [ 84.781581] reboot: Power down [ 107s] ### VM INTERACTION END ### [ 107s] [ 107s] wildcard2 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:04:55 UTC 2017. [ 107s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:05:11 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:05:11 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f4e301c320c_718e50ef7413322a0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 71s] #define HAVE_SYS_TYPES_H 1 [ 71s] #define HAVE_SYS_STAT_H 1 [ 71s] #define HAVE_STDLIB_H 1 [ 71s] #define HAVE_STRING_H 1 [ 71s] #define HAVE_MEMORY_H 1 [ 71s] #define HAVE_STRINGS_H 1 [ 71s] #define HAVE_INTTYPES_H 1 [ 71s] #define HAVE_STDINT_H 1 [ 71s] #define HAVE_UNISTD_H 1 [ 71s] #define HAVE_DLFCN_H 1 [ 71s] #define LT_OBJDIR ".libs/" [ 71s] [ 71s] configure: exit 1 [ 71s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 71s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 71s] make[1]: *** [override_dh_auto_configure] Error 2 [ 71s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 71s] debian/rules:45: recipe for target 'build' failed [ 71s] make: *** [build] Error 2 [ 71s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 71s] [ 71s] lamb01 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:05:05 UTC 2017. [ 71s] [ 71s] ### VM INTERACTION START ### [ 74s] [ 67.275264] reboot: Power down [ 74s] ### VM INTERACTION END ### [ 74s] [ 74s] lamb01 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:05:08 UTC 2017. [ 74s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:05:28 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:05:28 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f4e31b67d85_718e50ef741332325@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 76s] #define HAVE_SYS_TYPES_H 1 [ 76s] #define HAVE_SYS_STAT_H 1 [ 76s] #define HAVE_STDLIB_H 1 [ 76s] #define HAVE_STRING_H 1 [ 76s] #define HAVE_MEMORY_H 1 [ 76s] #define HAVE_STRINGS_H 1 [ 76s] #define HAVE_INTTYPES_H 1 [ 76s] #define HAVE_STDINT_H 1 [ 76s] #define HAVE_UNISTD_H 1 [ 76s] #define HAVE_DLFCN_H 1 [ 76s] #define LT_OBJDIR ".libs/" [ 76s] [ 76s] configure: exit 1 [ 76s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 76s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 76s] make[1]: *** [override_dh_auto_configure] Error 2 [ 76s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 76s] debian/rules:45: recipe for target 'build' failed [ 76s] make: *** [build] Error 2 [ 76s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 76s] [ 76s] lamb60 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:05:12 UTC 2017. [ 76s] [ 76s] ### VM INTERACTION START ### [ 79s] [ 71.953298] reboot: Power down [ 79s] ### VM INTERACTION END ### [ 79s] [ 79s] lamb60 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:05:16 UTC 2017. [ 79s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:06:20 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:06:20 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f4e3567cb7d_718e50ef741332853@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 79s] #define HAVE_SYS_STAT_H 1 [ 79s] #define HAVE_STDLIB_H 1 [ 79s] #define HAVE_STRING_H 1 [ 79s] #define HAVE_MEMORY_H 1 [ 79s] #define HAVE_STRINGS_H 1 [ 79s] #define HAVE_INTTYPES_H 1 [ 79s] #define HAVE_STDINT_H 1 [ 79s] #define HAVE_UNISTD_H 1 [ 79s] #define HAVE_DLFCN_H 1 [ 79s] #define LT_OBJDIR ".libs/" [ 79s] [ 79s] configure: exit 1 [ 79s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 79s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 79s] make[1]: *** [override_dh_auto_configure] Error 255 [ 79s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 79s] debian/rules:45: recipe for target 'build' failed [ 79s] make: *** [build] Error 2 [ 79s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 79s] [ 79s] lamb78 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:06:10 UTC 2017. [ 79s] [ 79s] ### VM INTERACTION START ### [ 80s] Powering off. [ 80s] [ 74.264193] reboot: Power down [ 80s] ### VM INTERACTION END ### [ 80s] [ 80s] lamb78 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:06:12 UTC 2017. [ 80s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Oct 28 20:07:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 20:07:06 +0000 Subject: [MERGED] osmo-bsc[master]: Debian: depend on libosmo-sigtran (bsc) and libosmo-sccp (bs... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: depend on libosmo-sigtran (bsc) and libosmo-sccp (bsc-nat) ...................................................................... Debian: depend on libosmo-sigtran (bsc) and libosmo-sccp (bsc-nat) Change-Id: I59c959a977b8ad4312766d86be879b16b34587cf --- M debian/control 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/debian/control b/debian/control index e3f1e02..575c6bb 100644 --- a/debian/control +++ b/debian/control @@ -13,6 +13,7 @@ libssl-dev, libtalloc-dev, libosmocore-dev, + libosmo-sccp-dev, libosmo-sigtran-dev, libosmo-abis-dev, libosmo-netif-dev, -- To view, visit https://gerrit.osmocom.org/4546 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I59c959a977b8ad4312766d86be879b16b34587cf Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Sat Oct 28 20:07:28 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:07:28 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f4e3955d60f_718e50ef7413329ba@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 89s] #define HAVE_SYS_TYPES_H 1 [ 89s] #define HAVE_SYS_STAT_H 1 [ 89s] #define HAVE_STDLIB_H 1 [ 89s] #define HAVE_STRING_H 1 [ 89s] #define HAVE_MEMORY_H 1 [ 89s] #define HAVE_STRINGS_H 1 [ 89s] #define HAVE_INTTYPES_H 1 [ 89s] #define HAVE_STDINT_H 1 [ 89s] #define HAVE_UNISTD_H 1 [ 89s] #define HAVE_DLFCN_H 1 [ 89s] #define LT_OBJDIR ".libs/" [ 89s] [ 89s] configure: exit 1 [ 89s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 89s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 89s] make[1]: *** [override_dh_auto_configure] Error 2 [ 89s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 89s] debian/rules:45: recipe for target 'build' failed [ 89s] make: *** [build] Error 2 [ 89s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 89s] [ 89s] lamb59 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:07:12 UTC 2017. [ 89s] [ 89s] ### VM INTERACTION START ### [ 92s] [ 84.354544] reboot: Power down [ 92s] ### VM INTERACTION END ### [ 92s] [ 92s] lamb59 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:07:15 UTC 2017. [ 92s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:07:46 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:07:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f4e396c55f_718e50ef741333015@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 97s] #define HAVE_SYS_TYPES_H 1 [ 97s] #define HAVE_SYS_STAT_H 1 [ 97s] #define HAVE_STDLIB_H 1 [ 97s] #define HAVE_STRING_H 1 [ 97s] #define HAVE_MEMORY_H 1 [ 97s] #define HAVE_STRINGS_H 1 [ 97s] #define HAVE_INTTYPES_H 1 [ 97s] #define HAVE_STDINT_H 1 [ 97s] #define HAVE_UNISTD_H 1 [ 97s] #define HAVE_DLFCN_H 1 [ 97s] #define LT_OBJDIR ".libs/" [ 97s] [ 97s] configure: exit 1 [ 97s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 97s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 97s] make[1]: *** [override_dh_auto_configure] Error 2 [ 97s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 97s] debian/rules:45: recipe for target 'build' failed [ 97s] make: *** [build] Error 2 [ 97s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 97s] [ 97s] cloud129 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:07:25 UTC 2017. [ 97s] [ 97s] ### VM INTERACTION START ### [ 100s] [ 83.958891] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 101s] [ 101s] cloud129 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:07:30 UTC 2017. [ 101s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:07:46 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:07:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f4e396646ef_718e50ef74133314b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 81s] #define HAVE_SYS_TYPES_H 1 [ 81s] #define HAVE_SYS_STAT_H 1 [ 81s] #define HAVE_STDLIB_H 1 [ 81s] #define HAVE_STRING_H 1 [ 81s] #define HAVE_MEMORY_H 1 [ 81s] #define HAVE_STRINGS_H 1 [ 81s] #define HAVE_INTTYPES_H 1 [ 81s] #define HAVE_STDINT_H 1 [ 81s] #define HAVE_UNISTD_H 1 [ 81s] #define HAVE_DLFCN_H 1 [ 81s] #define LT_OBJDIR ".libs/" [ 81s] [ 81s] configure: exit 1 [ 81s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 81s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 81s] make[1]: *** [override_dh_auto_configure] Error 2 [ 81s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 81s] debian/rules:45: recipe for target 'build' failed [ 81s] make: *** [build] Error 2 [ 81s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 81s] [ 81s] lamb21 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:07:28 UTC 2017. [ 81s] [ 81s] ### VM INTERACTION START ### [ 84s] [ 76.179630] reboot: Power down [ 84s] ### VM INTERACTION END ### [ 84s] [ 84s] lamb21 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:07:32 UTC 2017. [ 84s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:08:20 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:08:20 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f4e3d0c045d_718e50ef7413334b5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 93s] #define HAVE_SYS_TYPES_H 1 [ 93s] #define HAVE_SYS_STAT_H 1 [ 93s] #define HAVE_STDLIB_H 1 [ 93s] #define HAVE_STRING_H 1 [ 93s] #define HAVE_MEMORY_H 1 [ 93s] #define HAVE_STRINGS_H 1 [ 93s] #define HAVE_INTTYPES_H 1 [ 93s] #define HAVE_STDINT_H 1 [ 93s] #define HAVE_UNISTD_H 1 [ 93s] #define HAVE_DLFCN_H 1 [ 93s] #define LT_OBJDIR ".libs/" [ 93s] [ 93s] configure: exit 1 [ 93s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 93s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 93s] make[1]: *** [override_dh_auto_configure] Error 255 [ 93s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 93s] debian/rules:45: recipe for target 'build' failed [ 93s] make: *** [build] Error 2 [ 93s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 93s] [ 93s] lamb59 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:08:01 UTC 2017. [ 93s] [ 93s] ### VM INTERACTION START ### [ 96s] [ 89.587120] reboot: Power down [ 97s] ### VM INTERACTION END ### [ 97s] [ 97s] lamb59 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:08:05 UTC 2017. [ 97s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:08:20 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:08:20 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f4e3d16982_718e50ef74133353a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 87s] #define HAVE_SYS_TYPES_H 1 [ 87s] #define HAVE_SYS_STAT_H 1 [ 87s] #define HAVE_STDLIB_H 1 [ 87s] #define HAVE_STRING_H 1 [ 87s] #define HAVE_MEMORY_H 1 [ 87s] #define HAVE_STRINGS_H 1 [ 87s] #define HAVE_INTTYPES_H 1 [ 87s] #define HAVE_STDINT_H 1 [ 87s] #define HAVE_UNISTD_H 1 [ 87s] #define HAVE_DLFCN_H 1 [ 87s] #define LT_OBJDIR ".libs/" [ 87s] [ 87s] configure: exit 1 [ 87s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 87s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 87s] make[1]: *** [override_dh_auto_configure] Error 2 [ 87s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 87s] debian/rules:45: recipe for target 'build' failed [ 87s] make: *** [build] Error 2 [ 87s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 87s] [ 87s] lamb28 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:08:02 UTC 2017. [ 87s] [ 87s] ### VM INTERACTION START ### [ 91s] [ 83.433125] reboot: Power down [ 91s] ### VM INTERACTION END ### [ 91s] [ 91s] lamb28 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:08:05 UTC 2017. [ 91s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:09:28 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:09:28 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f4e40b694b1_718e50ef7413336cc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 71s] #define HAVE_SYS_TYPES_H 1 [ 71s] #define HAVE_SYS_STAT_H 1 [ 71s] #define HAVE_STDLIB_H 1 [ 71s] #define HAVE_STRING_H 1 [ 71s] #define HAVE_MEMORY_H 1 [ 71s] #define HAVE_STRINGS_H 1 [ 71s] #define HAVE_INTTYPES_H 1 [ 71s] #define HAVE_STDINT_H 1 [ 71s] #define HAVE_UNISTD_H 1 [ 71s] #define HAVE_DLFCN_H 1 [ 71s] #define LT_OBJDIR ".libs/" [ 71s] [ 71s] configure: exit 1 [ 71s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 71s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 71s] make[1]: *** [override_dh_auto_configure] Error 2 [ 71s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 71s] debian/rules:45: recipe for target 'build' failed [ 71s] make: *** [build] Error 2 [ 71s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 71s] [ 71s] lamb51 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:09:23 UTC 2017. [ 71s] [ 71s] ### VM INTERACTION START ### [ 74s] [ 66.900517] reboot: Power down [ 74s] ### VM INTERACTION END ### [ 74s] [ 74s] lamb51 failed "build osmo-bsc_1.1.0.20171028.dsc" at Sat Oct 28 20:09:26 UTC 2017. [ 74s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Oct 28 20:09:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 20:09:49 +0000 Subject: [PATCH] osmo-trx[master]: Import git-version-gen and update AC_INIT() Message-ID: Review at https://gerrit.osmocom.org/4547 Import git-version-gen and update AC_INIT() In AC_INIT(), it still stated openbts. Let's clean this up and use the same method of version generation that we use in all other osmocom projects, too. Change-Id: Ie7ae0585955aebdc3950b1dd8bff0d1fff3be212 --- M configure.ac A git-version-gen 2 files changed, 154 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/47/4547/1 diff --git a/configure.ac b/configure.ac index 43b5403..6e59fa2 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,9 @@ dnl along with this program. If not, see . dnl -AC_INIT(openbts,P2.8TRUNK) +AC_INIT([osmo-trx], + m4_esyscmd([./git-version-gen .tarball-veresion]), + [openbsc at lists.osmocom.org]) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([Transceiver52M/Makefile.am]) AC_CONFIG_AUX_DIR([.]) diff --git a/git-version-gen b/git-version-gen new file mode 100755 index 0000000..42cf3d2 --- /dev/null +++ b/git-version-gen @@ -0,0 +1,151 @@ +#!/bin/sh +# Print a version string. +scriptversion=2010-01-28.01 + +# Copyright (C) 2007-2010 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. +# It may be run two ways: +# - from a git repository in which the "git describe" command below +# produces useful output (thus requiring at least one signed tag) +# - from a non-git-repo directory containing a .tarball-version file, which +# presumes this script is invoked like "./git-version-gen .tarball-version". + +# In order to use intra-version strings in your project, you will need two +# separate generated version string files: +# +# .tarball-version - present only in a distribution tarball, and not in +# a checked-out repository. Created with contents that were learned at +# the last time autoconf was run, and used by git-version-gen. Must not +# be present in either $(srcdir) or $(builddir) for git-version-gen to +# give accurate answers during normal development with a checked out tree, +# but must be present in a tarball when there is no version control system. +# Therefore, it cannot be used in any dependencies. GNUmakefile has +# hooks to force a reconfigure at distribution time to get the value +# correct, without penalizing normal development with extra reconfigures. +# +# .version - present in a checked-out repository and in a distribution +# tarball. Usable in dependencies, particularly for files that don't +# want to depend on config.h but do want to track version changes. +# Delete this file prior to any autoconf run where you want to rebuild +# files to pick up a version string change; and leave it stale to +# minimize rebuild time after unrelated changes to configure sources. +# +# It is probably wise to add these two files to .gitignore, so that you +# don't accidentally commit either generated file. +# +# Use the following line in your configure.ac, so that $(VERSION) will +# automatically be up-to-date each time configure is run (and note that +# since configure.ac no longer includes a version string, Makefile rules +# should not depend on configure.ac for version updates). +# +# AC_INIT([GNU project], +# m4_esyscmd([build-aux/git-version-gen .tarball-version]), +# [bug-project at example]) +# +# Then use the following lines in your Makefile.am, so that .version +# will be present for dependencies, and so that .tarball-version will +# exist in distribution tarballs. +# +# BUILT_SOURCES = $(top_srcdir)/.version +# $(top_srcdir)/.version: +# echo $(VERSION) > $@-t && mv $@-t $@ +# dist-hook: +# echo $(VERSION) > $(distdir)/.tarball-version + +case $# in + 1) ;; + *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;; +esac + +tarball_version_file=$1 +nl=' +' + +# First see if there is a tarball-only version file. +# then try "git describe", then default. +if test -f $tarball_version_file +then + v=`cat $tarball_version_file` || exit 1 + case $v in + *$nl*) v= ;; # reject multi-line output + [0-9]*) ;; + *) v= ;; + esac + test -z "$v" \ + && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2 +fi + +if test -n "$v" +then + : # use $v +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ + || git describe --abbrev=4 HEAD 2>/dev/null` \ + && case $v in + [0-9]*) ;; + v[0-9]*) ;; + *) (exit 1) ;; + esac +then + # Is this a new git that lists number of commits since the last + # tag or the previous older version that did not? + # Newer: v6.10-77-g0f8faeb + # Older: v6.10-g0f8faeb + case $v in + *-*-*) : git describe is okay three part flavor ;; + *-*) + : git describe is older two part flavor + # Recreate the number of commits and rewrite such that the + # result is the same as if we were using the newer version + # of git describe. + vtag=`echo "$v" | sed 's/-.*//'` + numcommits=`git rev-list "$vtag"..HEAD | wc -l` + v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; + ;; + esac + + # Change the first '-' to a '.', so version-comparing tools work properly. + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; +else + v=UNKNOWN +fi + +v=`echo "$v" |sed 's/^v//'` + +# Don't declare a version "dirty" merely because a time stamp has changed. +git status > /dev/null 2>&1 + +dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= +case "$dirty" in + '') ;; + *) # Append the suffix only if there isn't one already. + case $v in + *-dirty) ;; + *) v="$v-dirty" ;; + esac ;; +esac + +# Omit the trailing newline, so that m4_esyscmd can use the result directly. +echo "$v" | tr -d '\012' + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: -- To view, visit https://gerrit.osmocom.org/4547 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7ae0585955aebdc3950b1dd8bff0d1fff3be212 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 20:09:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 20:09:49 +0000 Subject: [PATCH] osmo-trx[master]: Tag/Release 0.2.0 Message-ID: Review at https://gerrit.osmocom.org/4548 Tag/Release 0.2.0 This is the first real tagged Osmocom release of OsmoTRX. [ Alexander Chemeris ] * EDGE: Add support for UmTRX. * Common: Get rid of a compilation warning. * Common: Make sure gLogEarly() log to the same facilities as the normal log. * transceiver: Properly handle MAXDLY. * transceiver: Add an option to generate random Access Bursts. * osmo-trx: Output Rx SPS as a part of configuration output. * transceiver: Do not pass transceiver state struct to function where it's not used. * makefile: Fix build from an external path. * radioDevice: GSMRATE macro must have parentheses around its definition. * uhd: Fix comment. * radioInterface: Initialize power scale with a meaningful default. * transceiver: Log channel number in DEBUG output of demoded bursts. * transceiver: Add an option to emulate a RACH delay in random filler mode. * UHD: Initial LimeSDR support. * CommonLibs: Remove unused files. * sigProcLib: Typo sybols -> symbols * radioBuffer: Remove extra ; at the end of inline function definitions. * sigProcLib: Fix documentation, sync argument names in .cpp and .h files. * sigProcLib: make energyDetect() simpler by returning actual energy. * sigProcLib: Rename demodulateBurst() to demodGmskBurst() for clarity. * sigProcLib: Slice SoftVector instead of signalVector for GMSK demod. * Call vectorSlicer() right before packing bits for transmission to osmo-bts. * CommonLibs: Print soft bits with less confidence to console when printing a soft vector. * BitVector: Remove convolutional codec - we don't use it in osmo-trx. * BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits. * signalVector: Implement segment(). * vector: Introduce segmentMove() method to move data inside of a vector. * vector: Introduce shrink() function to shrink vector size without loosing data. * Move CorrType type from Transceiver to sigProcLib. * sigProcLib: rename signalError type to SignalError. * Move Transceiver::detectBurst() to sigProcLib to make it reusable. * Move BURST_THRESH from Transceiver.cpp to sigProcLib.h to make it reusable. * sigProcLib: Add operator<< to print CorrType to a string. * sigProcLib.h: Fix whitespaces. No non-whitespace changes. * Move Transceiver::demodulate() to sigProcLib to make it reusable. * sigProcLib: constify signalVector arguments for detectBurst() functions. * sigProcLib: Constify demodulation functions burst argument. * sigProcLib: Fix number of tail bits in random Normal Bursts and zero Stealing Bits. * Configuration: Variables allocated with 'new' must be freed with 'delete'. * BitVector: Remove Generator class. * PRBS: a Pseudo-random binary sequence (PRBS) generator class. [ Tom Tsou ] * EDGE: Fix USRP B210 device support * uhd: Correct timing alignment in 8-PSK and GMSK downlink bursts * EDGE: Fix demodulation slicer input * common: Restrict UDP binding to localhost only * common: Add mandatory length field to UDP receive calls * uhd: Update default E3XX settings * uhd: Set default Tx sampling to 4 sps * uhd: Make device offset check a private method * uhd: Set minimum UHD version requirement for E3XX * sigproc: Expand RACH, TSC, and EDGE correlation windows * transceiver: Do not report error on SETTSC when radio is on * transceiver: Add Rx samples-per-symbol option * radioInterface: Convert diversity argument to general type * iface: Add inner ring-buffer implementation * mcbts: Add multi-ARFCN channelizing filters * mcbts: Add multi-ARFCN radio support * sigproc: Adjust burst detection threshold criteria * egprs: Enable 8-PSK length vectors on the Tx interface * egprs: Enable 8-PSK burst detection when EDGE is enabled * transceiver: Remove HANDOVER warnings * mcbts: Allow out of order channel setup * radioInterface: Fix multi-channel buffer index bug * uhd: Add command line option for GPS reference * transceiver: Fix mixed GSMK / 8-PSK transmission * transceiver: Fix 4 SPS receive TOA value * sigproc: Fix missing 8-PSK tail symbols * uhd: Update USRP2/N200/N210 for 4 SPS Rx * sigproc: Match differential GMSK start/end bits to tail bits * uhd: Add missing B200 sample timing for 4 SPS receive * transceiver: Fix command build warning * uhd: Set minimum supported version to 3.9.0 * uhd: Add X300 sample timing for 4 SPS * Revert "uhd: Set minimum supported version to 3.9.0" * uhd: Add support for UHD-3.11 logging control * uhd: Increase MC-BTS FPGA clock rate to 51.2 MHz * Resampler: Fix initialization return checking * sigProcLib: Remove unreachable code and no-effect checks * sigProcLib: Check return status on downsampling * sigProcLib: Fix negative value check on unsigned value * Resampler: Fix non-array delete for filter taps * Transceiver: Remove unsigned negative compares * Configuration: Fix const and signedness compile warnings * config: Remove OpenBTS style sqlite configuration * radioInterface: Remove UmTRX 'diversity' option * build: Require and check for gcc C++11 support * uhd: Use map container for for device parameter access * sigProcLib: Remove unused functions from public interface * uhd: Add non-UmTRX channel swap support * uhd: Fix Tx-RX timing offset setting * uhd: Fix USRP2/N200/N210 device detection * transceiver: Fix POWEROFF crash on USRP2/N200/X300 devices * sigProcLib: Fix complex/real vector flag in Laurent modulator * sigProcLib: Remove heap based signal vector allocations * common: Declare explicit Vector move constructor * sigProcLib: Remove trigonometric tables * sigProcLib: Use explicit NaN check in sinc table generation * sigProcLib: Replace dynamically allocated resampling buffers * sigProcLib: Specify standard namespace for isnan() * uhd: Always specify samples-per-symbol for device lookup * LimeSDR: set approximate tx offset value to make GSM work [ Neels Hofmeyr ] * add basic .gitignore * configure.ac: check for boost/config.hpp header * The INSTALL file is being overwritten by autoreconf, but it is committed as empty file. As a result, the INSTALL file always shows as modified. Instead, remove INSTALL from git and ignore it. * add contrib/jenkins.sh, for gerrit build bot [ pierre.baudry ] * transceiver: Fix mismatched allocations and deallocations [ Holger Hans Peter Freyther ] * debian: Require fftw3 header files for osmo-trx [ Max ] * Add gerrit settings * Integrate Debian packaging changes * Remove embedded sqlite3 * Fix building against sqlite3 * Add autoconf-archive to dependencies * debian: remove obsolete dependency * deb: remove unused dependency * Remove redundant explicit dependency * Use release helper from libosmocore [ Ruben Undheim ] * Do not embed sqlite3 when building [ Philipp Maier ] * buildenv: Turn off native architecture builds * cosmetic: Make parameter lists uniform * Add test program to verify convolution implementation * ssedetect: Add runtime CPU detection * cosmetic: remove code duplication * buildenv: Make build CPU invariant * buildenv: Split up SSE3 and SSE4.1 code * cosmetic: Add info about SSE support [ Vadim Yanitskiy ] * buildenv: correct the ax_sse macro description * buildenv: actually strip unused cpuid functionality * buildenv: fix build on systems without SIMD support * buildenv: cosmetic changes * buildenv: check for __builtin_cpu_supports call support * ssedetect: call __builtin_cpu_supports() only if supported [ Pau Espin Pedrol ] * cosmetic: transciever: Remove trailing whitespaces * transceiver: Avoid sending clock indications when trx is not powered on * Add -j option to bind to specific address [ ignasj ] * LimeSDR: Change device detection to work with USB and PCIe versions * LimeSDR: change tx window type to TX_WINDOW_FIXED * LimeSDR: Fix sample value range [ Harald Welte ] * Add '-t' command line option to enable SCHED_RR * Import git-version-gen and update AC_INIT() Change-Id: Ibf3be6cc25e9b20d625b1f67972114b7f613f05c --- M debian/changelog 1 file changed, 167 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/48/4548/1 diff --git a/debian/changelog b/debian/changelog index 511fcb7..ec65036 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,170 @@ +osmo-trx (0.2.0) unstable; urgency=medium + + [ Alexander Chemeris ] + * EDGE: Add support for UmTRX. + * Common: Get rid of a compilation warning. + * Common: Make sure gLogEarly() log to the same facilities as the normal log. + * transceiver: Properly handle MAXDLY. + * transceiver: Add an option to generate random Access Bursts. + * osmo-trx: Output Rx SPS as a part of configuration output. + * transceiver: Do not pass transceiver state struct to function where it's not used. + * makefile: Fix build from an external path. + * radioDevice: GSMRATE macro must have parentheses around its definition. + * uhd: Fix comment. + * radioInterface: Initialize power scale with a meaningful default. + * transceiver: Log channel number in DEBUG output of demoded bursts. + * transceiver: Add an option to emulate a RACH delay in random filler mode. + * UHD: Initial LimeSDR support. + * CommonLibs: Remove unused files. + * sigProcLib: Typo sybols -> symbols + * radioBuffer: Remove extra ; at the end of inline function definitions. + * sigProcLib: Fix documentation, sync argument names in .cpp and .h files. + * sigProcLib: make energyDetect() simpler by returning actual energy. + * sigProcLib: Rename demodulateBurst() to demodGmskBurst() for clarity. + * sigProcLib: Slice SoftVector instead of signalVector for GMSK demod. + * Call vectorSlicer() right before packing bits for transmission to osmo-bts. + * CommonLibs: Print soft bits with less confidence to console when printing a soft vector. + * BitVector: Remove convolutional codec - we don't use it in osmo-trx. + * BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits. + * signalVector: Implement segment(). + * vector: Introduce segmentMove() method to move data inside of a vector. + * vector: Introduce shrink() function to shrink vector size without loosing data. + * Move CorrType type from Transceiver to sigProcLib. + * sigProcLib: rename signalError type to SignalError. + * Move Transceiver::detectBurst() to sigProcLib to make it reusable. + * Move BURST_THRESH from Transceiver.cpp to sigProcLib.h to make it reusable. + * sigProcLib: Add operator<< to print CorrType to a string. + * sigProcLib.h: Fix whitespaces. No non-whitespace changes. + * Move Transceiver::demodulate() to sigProcLib to make it reusable. + * sigProcLib: constify signalVector arguments for detectBurst() functions. + * sigProcLib: Constify demodulation functions burst argument. + * sigProcLib: Fix number of tail bits in random Normal Bursts and zero Stealing Bits. + * Configuration: Variables allocated with 'new' must be freed with 'delete'. + * BitVector: Remove Generator class. + * PRBS: a Pseudo-random binary sequence (PRBS) generator class. + + [ Tom Tsou ] + * EDGE: Fix USRP B210 device support + * uhd: Correct timing alignment in 8-PSK and GMSK downlink bursts + * EDGE: Fix demodulation slicer input + * common: Restrict UDP binding to localhost only + * common: Add mandatory length field to UDP receive calls + * uhd: Update default E3XX settings + * uhd: Set default Tx sampling to 4 sps + * uhd: Make device offset check a private method + * uhd: Set minimum UHD version requirement for E3XX + * sigproc: Expand RACH, TSC, and EDGE correlation windows + * transceiver: Do not report error on SETTSC when radio is on + * transceiver: Add Rx samples-per-symbol option + * radioInterface: Convert diversity argument to general type + * iface: Add inner ring-buffer implementation + * mcbts: Add multi-ARFCN channelizing filters + * mcbts: Add multi-ARFCN radio support + * sigproc: Adjust burst detection threshold criteria + * egprs: Enable 8-PSK length vectors on the Tx interface + * egprs: Enable 8-PSK burst detection when EDGE is enabled + * transceiver: Remove HANDOVER warnings + * mcbts: Allow out of order channel setup + * radioInterface: Fix multi-channel buffer index bug + * uhd: Add command line option for GPS reference + * transceiver: Fix mixed GSMK / 8-PSK transmission + * transceiver: Fix 4 SPS receive TOA value + * sigproc: Fix missing 8-PSK tail symbols + * uhd: Update USRP2/N200/N210 for 4 SPS Rx + * sigproc: Match differential GMSK start/end bits to tail bits + * uhd: Add missing B200 sample timing for 4 SPS receive + * transceiver: Fix command build warning + * uhd: Set minimum supported version to 3.9.0 + * uhd: Add X300 sample timing for 4 SPS + * Revert "uhd: Set minimum supported version to 3.9.0" + * uhd: Add support for UHD-3.11 logging control + * uhd: Increase MC-BTS FPGA clock rate to 51.2 MHz + * Resampler: Fix initialization return checking + * sigProcLib: Remove unreachable code and no-effect checks + * sigProcLib: Check return status on downsampling + * sigProcLib: Fix negative value check on unsigned value + * Resampler: Fix non-array delete for filter taps + * Transceiver: Remove unsigned negative compares + * Configuration: Fix const and signedness compile warnings + * config: Remove OpenBTS style sqlite configuration + * radioInterface: Remove UmTRX 'diversity' option + * build: Require and check for gcc C++11 support + * uhd: Use map container for for device parameter access + * sigProcLib: Remove unused functions from public interface + * uhd: Add non-UmTRX channel swap support + * uhd: Fix Tx-RX timing offset setting + * uhd: Fix USRP2/N200/N210 device detection + * transceiver: Fix POWEROFF crash on USRP2/N200/X300 devices + * sigProcLib: Fix complex/real vector flag in Laurent modulator + * sigProcLib: Remove heap based signal vector allocations + * common: Declare explicit Vector move constructor + * sigProcLib: Remove trigonometric tables + * sigProcLib: Use explicit NaN check in sinc table generation + * sigProcLib: Replace dynamically allocated resampling buffers + * sigProcLib: Specify standard namespace for isnan() + * uhd: Always specify samples-per-symbol for device lookup + * LimeSDR: set approximate tx offset value to make GSM work + + [ Neels Hofmeyr ] + * add basic .gitignore + * configure.ac: check for boost/config.hpp header + * The INSTALL file is being overwritten by autoreconf, but it is committed as empty file. As a result, the INSTALL file always shows as modified. Instead, remove INSTALL from git and ignore it. + * add contrib/jenkins.sh, for gerrit build bot + + [ pierre.baudry ] + * transceiver: Fix mismatched allocations and deallocations + + [ Holger Hans Peter Freyther ] + * debian: Require fftw3 header files for osmo-trx + + [ Max ] + * Add gerrit settings + * Integrate Debian packaging changes + * Remove embedded sqlite3 + * Fix building against sqlite3 + * Add autoconf-archive to dependencies + * debian: remove obsolete dependency + * deb: remove unused dependency + * Remove redundant explicit dependency + * Use release helper from libosmocore + + [ Ruben Undheim ] + * Do not embed sqlite3 when building + + [ Philipp Maier ] + * buildenv: Turn off native architecture builds + * cosmetic: Make parameter lists uniform + * Add test program to verify convolution implementation + * ssedetect: Add runtime CPU detection + * cosmetic: remove code duplication + * buildenv: Make build CPU invariant + * buildenv: Split up SSE3 and SSE4.1 code + * cosmetic: Add info about SSE support + + [ Vadim Yanitskiy ] + * buildenv: correct the ax_sse macro description + * buildenv: actually strip unused cpuid functionality + * buildenv: fix build on systems without SIMD support + * buildenv: cosmetic changes + * buildenv: check for __builtin_cpu_supports call support + * ssedetect: call __builtin_cpu_supports() only if supported + + [ Pau Espin Pedrol ] + * cosmetic: transciever: Remove trailing whitespaces + * transceiver: Avoid sending clock indications when trx is not powered on + * Add -j option to bind to specific address + + [ ignasj ] + * LimeSDR: Change device detection to work with USB and PCIe versions + * LimeSDR: change tx window type to TX_WINDOW_FIXED + * LimeSDR: Fix sample value range + + [ Harald Welte ] + * Add '-t' command line option to enable SCHED_RR + * Import git-version-gen and update AC_INIT() + + -- Harald Welte Sat, 28 Oct 2017 17:52:32 +0200 + osmo-trx (0.1.9) trusty; urgency=medium * Ask Ivan, really -- To view, visit https://gerrit.osmocom.org/4548 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf3be6cc25e9b20d625b1f67972114b7f613f05c Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte From admin at opensuse.org Sat Oct 28 20:10:03 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:10:03 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f4e44360805_718e50ef74133391e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-msc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 84s] #define HAVE_STDLIB_H 1 [ 84s] #define HAVE_STRING_H 1 [ 84s] #define HAVE_MEMORY_H 1 [ 84s] #define HAVE_STRINGS_H 1 [ 84s] #define HAVE_INTTYPES_H 1 [ 84s] #define HAVE_STDINT_H 1 [ 84s] #define HAVE_UNISTD_H 1 [ 84s] #define HAVE_DLFCN_H 1 [ 84s] #define LT_OBJDIR ".libs/" [ 84s] [ 84s] configure: exit 1 [ 84s] dh_auto_configure: ./configure --build=i586-linux[ 77.092276] serial8250: too much work for irq4 [ 84s] -gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --enable-iu --enable-smpp returned exit code 1 [ 84s] debian/rules:51: recipe for target 'override_dh_auto_configure' failed [ 84s] make[1]: *** [override_dh_auto_configure] Error 255 [ 84s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 84s] debian/rules:45: recipe for target 'build' failed [ 84s] make: *** [build] Error 2 [ 84s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 84s] [ 84s] lamb02 failed "build osmo-msc_1.1.0.20171028.dsc" at Sat Oct 28 20:09:58 UTC 2017. [ 84s] [ 84s] ### VM INTERACTION START ### [ 85s] Powering off. [ 85s] [ 78.122221] reboot: Power down [ 85s] ### VM INTERACTION END ### [ 85s] [ 85s] lamb02 failed "build osmo-msc_1.1.0.20171028.dsc" at Sat Oct 28 20:09:59 UTC 2017. [ 85s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Oct 28 20:11:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 20:11:46 +0000 Subject: osmo-trx[master]: Tag/Release 0.2.0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4548 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf3be6cc25e9b20d625b1f67972114b7f613f05c Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 20:11:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 20:11:47 +0000 Subject: osmo-trx[master]: Import git-version-gen and update AC_INIT() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4547 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7ae0585955aebdc3950b1dd8bff0d1fff3be212 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 20:11:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 20:11:49 +0000 Subject: [MERGED] osmo-trx[master]: Import git-version-gen and update AC_INIT() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Import git-version-gen and update AC_INIT() ...................................................................... Import git-version-gen and update AC_INIT() In AC_INIT(), it still stated openbts. Let's clean this up and use the same method of version generation that we use in all other osmocom projects, too. Change-Id: Ie7ae0585955aebdc3950b1dd8bff0d1fff3be212 --- M configure.ac A git-version-gen 2 files changed, 154 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 43b5403..6e59fa2 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,9 @@ dnl along with this program. If not, see . dnl -AC_INIT(openbts,P2.8TRUNK) +AC_INIT([osmo-trx], + m4_esyscmd([./git-version-gen .tarball-veresion]), + [openbsc at lists.osmocom.org]) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([Transceiver52M/Makefile.am]) AC_CONFIG_AUX_DIR([.]) diff --git a/git-version-gen b/git-version-gen new file mode 100755 index 0000000..42cf3d2 --- /dev/null +++ b/git-version-gen @@ -0,0 +1,151 @@ +#!/bin/sh +# Print a version string. +scriptversion=2010-01-28.01 + +# Copyright (C) 2007-2010 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. +# It may be run two ways: +# - from a git repository in which the "git describe" command below +# produces useful output (thus requiring at least one signed tag) +# - from a non-git-repo directory containing a .tarball-version file, which +# presumes this script is invoked like "./git-version-gen .tarball-version". + +# In order to use intra-version strings in your project, you will need two +# separate generated version string files: +# +# .tarball-version - present only in a distribution tarball, and not in +# a checked-out repository. Created with contents that were learned at +# the last time autoconf was run, and used by git-version-gen. Must not +# be present in either $(srcdir) or $(builddir) for git-version-gen to +# give accurate answers during normal development with a checked out tree, +# but must be present in a tarball when there is no version control system. +# Therefore, it cannot be used in any dependencies. GNUmakefile has +# hooks to force a reconfigure at distribution time to get the value +# correct, without penalizing normal development with extra reconfigures. +# +# .version - present in a checked-out repository and in a distribution +# tarball. Usable in dependencies, particularly for files that don't +# want to depend on config.h but do want to track version changes. +# Delete this file prior to any autoconf run where you want to rebuild +# files to pick up a version string change; and leave it stale to +# minimize rebuild time after unrelated changes to configure sources. +# +# It is probably wise to add these two files to .gitignore, so that you +# don't accidentally commit either generated file. +# +# Use the following line in your configure.ac, so that $(VERSION) will +# automatically be up-to-date each time configure is run (and note that +# since configure.ac no longer includes a version string, Makefile rules +# should not depend on configure.ac for version updates). +# +# AC_INIT([GNU project], +# m4_esyscmd([build-aux/git-version-gen .tarball-version]), +# [bug-project at example]) +# +# Then use the following lines in your Makefile.am, so that .version +# will be present for dependencies, and so that .tarball-version will +# exist in distribution tarballs. +# +# BUILT_SOURCES = $(top_srcdir)/.version +# $(top_srcdir)/.version: +# echo $(VERSION) > $@-t && mv $@-t $@ +# dist-hook: +# echo $(VERSION) > $(distdir)/.tarball-version + +case $# in + 1) ;; + *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;; +esac + +tarball_version_file=$1 +nl=' +' + +# First see if there is a tarball-only version file. +# then try "git describe", then default. +if test -f $tarball_version_file +then + v=`cat $tarball_version_file` || exit 1 + case $v in + *$nl*) v= ;; # reject multi-line output + [0-9]*) ;; + *) v= ;; + esac + test -z "$v" \ + && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2 +fi + +if test -n "$v" +then + : # use $v +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ + || git describe --abbrev=4 HEAD 2>/dev/null` \ + && case $v in + [0-9]*) ;; + v[0-9]*) ;; + *) (exit 1) ;; + esac +then + # Is this a new git that lists number of commits since the last + # tag or the previous older version that did not? + # Newer: v6.10-77-g0f8faeb + # Older: v6.10-g0f8faeb + case $v in + *-*-*) : git describe is okay three part flavor ;; + *-*) + : git describe is older two part flavor + # Recreate the number of commits and rewrite such that the + # result is the same as if we were using the newer version + # of git describe. + vtag=`echo "$v" | sed 's/-.*//'` + numcommits=`git rev-list "$vtag"..HEAD | wc -l` + v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; + ;; + esac + + # Change the first '-' to a '.', so version-comparing tools work properly. + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; +else + v=UNKNOWN +fi + +v=`echo "$v" |sed 's/^v//'` + +# Don't declare a version "dirty" merely because a time stamp has changed. +git status > /dev/null 2>&1 + +dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= +case "$dirty" in + '') ;; + *) # Append the suffix only if there isn't one already. + case $v in + *-dirty) ;; + *) v="$v-dirty" ;; + esac ;; +esac + +# Omit the trailing newline, so that m4_esyscmd can use the result directly. +echo "$v" | tr -d '\012' + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: -- To view, visit https://gerrit.osmocom.org/4547 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7ae0585955aebdc3950b1dd8bff0d1fff3be212 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Oct 28 20:11:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 20:11:50 +0000 Subject: [MERGED] osmo-trx[master]: Tag/Release 0.2.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release 0.2.0 ...................................................................... Tag/Release 0.2.0 This is the first real tagged Osmocom release of OsmoTRX. [ Alexander Chemeris ] * EDGE: Add support for UmTRX. * Common: Get rid of a compilation warning. * Common: Make sure gLogEarly() log to the same facilities as the normal log. * transceiver: Properly handle MAXDLY. * transceiver: Add an option to generate random Access Bursts. * osmo-trx: Output Rx SPS as a part of configuration output. * transceiver: Do not pass transceiver state struct to function where it's not used. * makefile: Fix build from an external path. * radioDevice: GSMRATE macro must have parentheses around its definition. * uhd: Fix comment. * radioInterface: Initialize power scale with a meaningful default. * transceiver: Log channel number in DEBUG output of demoded bursts. * transceiver: Add an option to emulate a RACH delay in random filler mode. * UHD: Initial LimeSDR support. * CommonLibs: Remove unused files. * sigProcLib: Typo sybols -> symbols * radioBuffer: Remove extra ; at the end of inline function definitions. * sigProcLib: Fix documentation, sync argument names in .cpp and .h files. * sigProcLib: make energyDetect() simpler by returning actual energy. * sigProcLib: Rename demodulateBurst() to demodGmskBurst() for clarity. * sigProcLib: Slice SoftVector instead of signalVector for GMSK demod. * Call vectorSlicer() right before packing bits for transmission to osmo-bts. * CommonLibs: Print soft bits with less confidence to console when printing a soft vector. * BitVector: Remove convolutional codec - we don't use it in osmo-trx. * BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits. * signalVector: Implement segment(). * vector: Introduce segmentMove() method to move data inside of a vector. * vector: Introduce shrink() function to shrink vector size without loosing data. * Move CorrType type from Transceiver to sigProcLib. * sigProcLib: rename signalError type to SignalError. * Move Transceiver::detectBurst() to sigProcLib to make it reusable. * Move BURST_THRESH from Transceiver.cpp to sigProcLib.h to make it reusable. * sigProcLib: Add operator<< to print CorrType to a string. * sigProcLib.h: Fix whitespaces. No non-whitespace changes. * Move Transceiver::demodulate() to sigProcLib to make it reusable. * sigProcLib: constify signalVector arguments for detectBurst() functions. * sigProcLib: Constify demodulation functions burst argument. * sigProcLib: Fix number of tail bits in random Normal Bursts and zero Stealing Bits. * Configuration: Variables allocated with 'new' must be freed with 'delete'. * BitVector: Remove Generator class. * PRBS: a Pseudo-random binary sequence (PRBS) generator class. [ Tom Tsou ] * EDGE: Fix USRP B210 device support * uhd: Correct timing alignment in 8-PSK and GMSK downlink bursts * EDGE: Fix demodulation slicer input * common: Restrict UDP binding to localhost only * common: Add mandatory length field to UDP receive calls * uhd: Update default E3XX settings * uhd: Set default Tx sampling to 4 sps * uhd: Make device offset check a private method * uhd: Set minimum UHD version requirement for E3XX * sigproc: Expand RACH, TSC, and EDGE correlation windows * transceiver: Do not report error on SETTSC when radio is on * transceiver: Add Rx samples-per-symbol option * radioInterface: Convert diversity argument to general type * iface: Add inner ring-buffer implementation * mcbts: Add multi-ARFCN channelizing filters * mcbts: Add multi-ARFCN radio support * sigproc: Adjust burst detection threshold criteria * egprs: Enable 8-PSK length vectors on the Tx interface * egprs: Enable 8-PSK burst detection when EDGE is enabled * transceiver: Remove HANDOVER warnings * mcbts: Allow out of order channel setup * radioInterface: Fix multi-channel buffer index bug * uhd: Add command line option for GPS reference * transceiver: Fix mixed GSMK / 8-PSK transmission * transceiver: Fix 4 SPS receive TOA value * sigproc: Fix missing 8-PSK tail symbols * uhd: Update USRP2/N200/N210 for 4 SPS Rx * sigproc: Match differential GMSK start/end bits to tail bits * uhd: Add missing B200 sample timing for 4 SPS receive * transceiver: Fix command build warning * uhd: Set minimum supported version to 3.9.0 * uhd: Add X300 sample timing for 4 SPS * Revert "uhd: Set minimum supported version to 3.9.0" * uhd: Add support for UHD-3.11 logging control * uhd: Increase MC-BTS FPGA clock rate to 51.2 MHz * Resampler: Fix initialization return checking * sigProcLib: Remove unreachable code and no-effect checks * sigProcLib: Check return status on downsampling * sigProcLib: Fix negative value check on unsigned value * Resampler: Fix non-array delete for filter taps * Transceiver: Remove unsigned negative compares * Configuration: Fix const and signedness compile warnings * config: Remove OpenBTS style sqlite configuration * radioInterface: Remove UmTRX 'diversity' option * build: Require and check for gcc C++11 support * uhd: Use map container for for device parameter access * sigProcLib: Remove unused functions from public interface * uhd: Add non-UmTRX channel swap support * uhd: Fix Tx-RX timing offset setting * uhd: Fix USRP2/N200/N210 device detection * transceiver: Fix POWEROFF crash on USRP2/N200/X300 devices * sigProcLib: Fix complex/real vector flag in Laurent modulator * sigProcLib: Remove heap based signal vector allocations * common: Declare explicit Vector move constructor * sigProcLib: Remove trigonometric tables * sigProcLib: Use explicit NaN check in sinc table generation * sigProcLib: Replace dynamically allocated resampling buffers * sigProcLib: Specify standard namespace for isnan() * uhd: Always specify samples-per-symbol for device lookup * LimeSDR: set approximate tx offset value to make GSM work [ Neels Hofmeyr ] * add basic .gitignore * configure.ac: check for boost/config.hpp header * The INSTALL file is being overwritten by autoreconf, but it is committed as empty file. As a result, the INSTALL file always shows as modified. Instead, remove INSTALL from git and ignore it. * add contrib/jenkins.sh, for gerrit build bot [ pierre.baudry ] * transceiver: Fix mismatched allocations and deallocations [ Holger Hans Peter Freyther ] * debian: Require fftw3 header files for osmo-trx [ Max ] * Add gerrit settings * Integrate Debian packaging changes * Remove embedded sqlite3 * Fix building against sqlite3 * Add autoconf-archive to dependencies * debian: remove obsolete dependency * deb: remove unused dependency * Remove redundant explicit dependency * Use release helper from libosmocore [ Ruben Undheim ] * Do not embed sqlite3 when building [ Philipp Maier ] * buildenv: Turn off native architecture builds * cosmetic: Make parameter lists uniform * Add test program to verify convolution implementation * ssedetect: Add runtime CPU detection * cosmetic: remove code duplication * buildenv: Make build CPU invariant * buildenv: Split up SSE3 and SSE4.1 code * cosmetic: Add info about SSE support [ Vadim Yanitskiy ] * buildenv: correct the ax_sse macro description * buildenv: actually strip unused cpuid functionality * buildenv: fix build on systems without SIMD support * buildenv: cosmetic changes * buildenv: check for __builtin_cpu_supports call support * ssedetect: call __builtin_cpu_supports() only if supported [ Pau Espin Pedrol ] * cosmetic: transciever: Remove trailing whitespaces * transceiver: Avoid sending clock indications when trx is not powered on * Add -j option to bind to specific address [ ignasj ] * LimeSDR: Change device detection to work with USB and PCIe versions * LimeSDR: change tx window type to TX_WINDOW_FIXED * LimeSDR: Fix sample value range [ Harald Welte ] * Add '-t' command line option to enable SCHED_RR * Import git-version-gen and update AC_INIT() Change-Id: Ibf3be6cc25e9b20d625b1f67972114b7f613f05c --- M debian/changelog 1 file changed, 167 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 511fcb7..ec65036 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,170 @@ +osmo-trx (0.2.0) unstable; urgency=medium + + [ Alexander Chemeris ] + * EDGE: Add support for UmTRX. + * Common: Get rid of a compilation warning. + * Common: Make sure gLogEarly() log to the same facilities as the normal log. + * transceiver: Properly handle MAXDLY. + * transceiver: Add an option to generate random Access Bursts. + * osmo-trx: Output Rx SPS as a part of configuration output. + * transceiver: Do not pass transceiver state struct to function where it's not used. + * makefile: Fix build from an external path. + * radioDevice: GSMRATE macro must have parentheses around its definition. + * uhd: Fix comment. + * radioInterface: Initialize power scale with a meaningful default. + * transceiver: Log channel number in DEBUG output of demoded bursts. + * transceiver: Add an option to emulate a RACH delay in random filler mode. + * UHD: Initial LimeSDR support. + * CommonLibs: Remove unused files. + * sigProcLib: Typo sybols -> symbols + * radioBuffer: Remove extra ; at the end of inline function definitions. + * sigProcLib: Fix documentation, sync argument names in .cpp and .h files. + * sigProcLib: make energyDetect() simpler by returning actual energy. + * sigProcLib: Rename demodulateBurst() to demodGmskBurst() for clarity. + * sigProcLib: Slice SoftVector instead of signalVector for GMSK demod. + * Call vectorSlicer() right before packing bits for transmission to osmo-bts. + * CommonLibs: Print soft bits with less confidence to console when printing a soft vector. + * BitVector: Remove convolutional codec - we don't use it in osmo-trx. + * BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits. + * signalVector: Implement segment(). + * vector: Introduce segmentMove() method to move data inside of a vector. + * vector: Introduce shrink() function to shrink vector size without loosing data. + * Move CorrType type from Transceiver to sigProcLib. + * sigProcLib: rename signalError type to SignalError. + * Move Transceiver::detectBurst() to sigProcLib to make it reusable. + * Move BURST_THRESH from Transceiver.cpp to sigProcLib.h to make it reusable. + * sigProcLib: Add operator<< to print CorrType to a string. + * sigProcLib.h: Fix whitespaces. No non-whitespace changes. + * Move Transceiver::demodulate() to sigProcLib to make it reusable. + * sigProcLib: constify signalVector arguments for detectBurst() functions. + * sigProcLib: Constify demodulation functions burst argument. + * sigProcLib: Fix number of tail bits in random Normal Bursts and zero Stealing Bits. + * Configuration: Variables allocated with 'new' must be freed with 'delete'. + * BitVector: Remove Generator class. + * PRBS: a Pseudo-random binary sequence (PRBS) generator class. + + [ Tom Tsou ] + * EDGE: Fix USRP B210 device support + * uhd: Correct timing alignment in 8-PSK and GMSK downlink bursts + * EDGE: Fix demodulation slicer input + * common: Restrict UDP binding to localhost only + * common: Add mandatory length field to UDP receive calls + * uhd: Update default E3XX settings + * uhd: Set default Tx sampling to 4 sps + * uhd: Make device offset check a private method + * uhd: Set minimum UHD version requirement for E3XX + * sigproc: Expand RACH, TSC, and EDGE correlation windows + * transceiver: Do not report error on SETTSC when radio is on + * transceiver: Add Rx samples-per-symbol option + * radioInterface: Convert diversity argument to general type + * iface: Add inner ring-buffer implementation + * mcbts: Add multi-ARFCN channelizing filters + * mcbts: Add multi-ARFCN radio support + * sigproc: Adjust burst detection threshold criteria + * egprs: Enable 8-PSK length vectors on the Tx interface + * egprs: Enable 8-PSK burst detection when EDGE is enabled + * transceiver: Remove HANDOVER warnings + * mcbts: Allow out of order channel setup + * radioInterface: Fix multi-channel buffer index bug + * uhd: Add command line option for GPS reference + * transceiver: Fix mixed GSMK / 8-PSK transmission + * transceiver: Fix 4 SPS receive TOA value + * sigproc: Fix missing 8-PSK tail symbols + * uhd: Update USRP2/N200/N210 for 4 SPS Rx + * sigproc: Match differential GMSK start/end bits to tail bits + * uhd: Add missing B200 sample timing for 4 SPS receive + * transceiver: Fix command build warning + * uhd: Set minimum supported version to 3.9.0 + * uhd: Add X300 sample timing for 4 SPS + * Revert "uhd: Set minimum supported version to 3.9.0" + * uhd: Add support for UHD-3.11 logging control + * uhd: Increase MC-BTS FPGA clock rate to 51.2 MHz + * Resampler: Fix initialization return checking + * sigProcLib: Remove unreachable code and no-effect checks + * sigProcLib: Check return status on downsampling + * sigProcLib: Fix negative value check on unsigned value + * Resampler: Fix non-array delete for filter taps + * Transceiver: Remove unsigned negative compares + * Configuration: Fix const and signedness compile warnings + * config: Remove OpenBTS style sqlite configuration + * radioInterface: Remove UmTRX 'diversity' option + * build: Require and check for gcc C++11 support + * uhd: Use map container for for device parameter access + * sigProcLib: Remove unused functions from public interface + * uhd: Add non-UmTRX channel swap support + * uhd: Fix Tx-RX timing offset setting + * uhd: Fix USRP2/N200/N210 device detection + * transceiver: Fix POWEROFF crash on USRP2/N200/X300 devices + * sigProcLib: Fix complex/real vector flag in Laurent modulator + * sigProcLib: Remove heap based signal vector allocations + * common: Declare explicit Vector move constructor + * sigProcLib: Remove trigonometric tables + * sigProcLib: Use explicit NaN check in sinc table generation + * sigProcLib: Replace dynamically allocated resampling buffers + * sigProcLib: Specify standard namespace for isnan() + * uhd: Always specify samples-per-symbol for device lookup + * LimeSDR: set approximate tx offset value to make GSM work + + [ Neels Hofmeyr ] + * add basic .gitignore + * configure.ac: check for boost/config.hpp header + * The INSTALL file is being overwritten by autoreconf, but it is committed as empty file. As a result, the INSTALL file always shows as modified. Instead, remove INSTALL from git and ignore it. + * add contrib/jenkins.sh, for gerrit build bot + + [ pierre.baudry ] + * transceiver: Fix mismatched allocations and deallocations + + [ Holger Hans Peter Freyther ] + * debian: Require fftw3 header files for osmo-trx + + [ Max ] + * Add gerrit settings + * Integrate Debian packaging changes + * Remove embedded sqlite3 + * Fix building against sqlite3 + * Add autoconf-archive to dependencies + * debian: remove obsolete dependency + * deb: remove unused dependency + * Remove redundant explicit dependency + * Use release helper from libosmocore + + [ Ruben Undheim ] + * Do not embed sqlite3 when building + + [ Philipp Maier ] + * buildenv: Turn off native architecture builds + * cosmetic: Make parameter lists uniform + * Add test program to verify convolution implementation + * ssedetect: Add runtime CPU detection + * cosmetic: remove code duplication + * buildenv: Make build CPU invariant + * buildenv: Split up SSE3 and SSE4.1 code + * cosmetic: Add info about SSE support + + [ Vadim Yanitskiy ] + * buildenv: correct the ax_sse macro description + * buildenv: actually strip unused cpuid functionality + * buildenv: fix build on systems without SIMD support + * buildenv: cosmetic changes + * buildenv: check for __builtin_cpu_supports call support + * ssedetect: call __builtin_cpu_supports() only if supported + + [ Pau Espin Pedrol ] + * cosmetic: transciever: Remove trailing whitespaces + * transceiver: Avoid sending clock indications when trx is not powered on + * Add -j option to bind to specific address + + [ ignasj ] + * LimeSDR: Change device detection to work with USB and PCIe versions + * LimeSDR: change tx window type to TX_WINDOW_FIXED + * LimeSDR: Fix sample value range + + [ Harald Welte ] + * Add '-t' command line option to enable SCHED_RR + * Import git-version-gen and update AC_INIT() + + -- Harald Welte Sat, 28 Oct 2017 17:52:32 +0200 + osmo-trx (0.1.9) trusty; urgency=medium * Ask Ivan, really -- To view, visit https://gerrit.osmocom.org/4548 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf3be6cc25e9b20d625b1f67972114b7f613f05c Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Sat Oct 28 20:16:36 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:16:36 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f4e5af16358_718e50ef741335269@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 129s] To: [ 129s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 129s] [ 129s] You may investigate any problem if you feel able to do so, in which [ 129s] case the test suite provides a good starting point. Its output may [ 129s] be found below `tests/testsuite.dir'. [ 129s] [ 129s] Makefile:1221: recipe for target 'check-local' failed [ 129s] make[3]: *** [check-local] Error 1 [ 129s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 129s] Makefile:1055: recipe for target 'check-am' failed [ 129s] make[2]: *** [check-am] Error 2 [ 129s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 129s] Makefile:460: recipe for target 'check-recursive' failed [ 129s] make[1]: *** [check-recursive] Error 1 [ 129s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 129s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 129s] debian/rules:12: recipe for target 'build' failed [ 129s] make: *** [build] Error 2 [ 129s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 129s] [ 129s] build84 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:16:22 UTC 2017. [ 129s] [ 129s] ### VM INTERACTION START ### [ 132s] [ 125.323085] reboot: Power down [ 132s] ### VM INTERACTION END ### [ 132s] [ 132s] build84 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:16:25 UTC 2017. [ 132s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:16:36 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:16:36 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f4e5afd11a3_718e50ef7413354f4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 129s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 129s] [ 129s] You may investigate any problem if you feel able to do so, in which [ 129s] case the test suite provides a good starting point. Its output may [ 129s] be found below `tests/testsuite.dir'. [ 129s] [ 129s] Makefile:1208: recipe for target 'check-local' failed [ 129s] make[3]: *** [check-local] Error 1 [ 129s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 129s] Makefile:1044: recipe for target 'check-am' failed [ 129s] make[2]: *** [check-am] Error 2 [ 129s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 129s] Makefile:448: recipe for target 'check-recursive' failed [ 129s] make[1]: *** [check-recursive] Error 1 [ 129s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 129s] dh_auto_test: make -j1 check returned exit code 2 [ 129s] debian/rules:12: recipe for target 'build' failed [ 129s] make: *** [build] Error 2 [ 129s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 129s] [ 129s] lamb02 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:16:31 UTC 2017. [ 129s] [ 130s] ### VM INTERACTION START ### [ 131s] Powering off. [ 131s] [ 123.777797] reboot: Power down [ 131s] ### VM INTERACTION END ### [ 131s] [ 131s] lamb02 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:16:33 UTC 2017. [ 131s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:16:36 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:16:36 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f4e5af92051_718e50ef741335380@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 85s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 85s] [ 85s] You may investigate any problem if you feel able to do so, in which [ 85s] case the test suite provides a good starting point. Its output may [ 85s] be found below `tests/testsuite.dir'. [ 85s] [ 85s] Makefile:1208: recipe for target 'check-local' failed [ 85s] make[3]: *** [check-local] Error 1 [ 85s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 85s] Makefile:1044: recipe for target 'check-am' failed [ 85s] make[2]: *** [check-am] Error 2 [ 85s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 85s] Makefile:448: recipe for target 'check-recursive' failed [ 85s] make[1]: *** [check-recursive] Error 1 [ 85s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 85s] dh_auto_test: make -j1 check returned exit code 2 [ 85s] debian/rules:12: recipe for target 'build' failed [ 85s] make: *** [build] Error 2 [ 85s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 85s] [ 85s] build82 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:16:30 UTC 2017. [ 85s] [ 85s] ### VM INTERACTION START ### [ 86s] Powering off. [ 86s] [ 80.852838] reboot: Power down [ 86s] ### VM INTERACTION END ### [ 86s] [ 86s] build82 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:16:31 UTC 2017. [ 86s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:16:53 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:16:53 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f4e5cf51e9c_718e50ef7413357e9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 149s] To: [ 149s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 149s] [ 149s] You may investigate any problem if you feel able to do so, in which [ 149s] case the test suite provides a good starting point. Its output may [ 149s] be found below `tests/testsuite.dir'. [ 149s] [ 149s] Makefile:1221: recipe for target 'check-local' failed [ 149s] make[3]: *** [check-local] Error 1 [ 149s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 149s] Makefile:1055: recipe for target 'check-am' failed [ 149s] make[2]: *** [check-am] Error 2 [ 149s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 149s] Makefile:460: recipe for target 'check-recursive' failed [ 149s] make[1]: *** [check-recursive] Error 1 [ 149s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 149s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 149s] debian/rules:12: recipe for target 'build' failed [ 149s] make: *** [build] Error 2 [ 149s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 149s] [ 149s] lamb60 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:16:42 UTC 2017. [ 149s] [ 149s] ### VM INTERACTION START ### [ 152s] [ 144.160176] reboot: Power down [ 152s] ### VM INTERACTION END ### [ 152s] [ 152s] lamb60 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:16:46 UTC 2017. [ 152s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:17:27 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:17:27 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f4e5ec2369_718e50ef7413366f9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 157s] To: [ 157s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 157s] [ 157s] You may investigate any problem if you feel able to do so, in which [ 157s] case the test suite provides a good starting point. Its output may [ 157s] be found below `tests/testsuite.dir'. [ 157s] [ 157s] Makefile:1221: recipe for target 'check-local' failed [ 157s] make[3]: *** [check-local] Error 1 [ 157s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 157s] Makefile:1055: recipe for target 'check-am' failed [ 157s] make[2]: *** [check-am] Error 2 [ 157s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 157s] Makefile:460: recipe for target 'check-recursive' failed [ 157s] make[1]: *** [check-recursive] Error 1 [ 157s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 157s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 157s] debian/rules:12: recipe for target 'build' failed [ 157s] make: *** [build] Error 2 [ 157s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 157s] [ 157s] lamb09 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:16 UTC 2017. [ 157s] [ 157s] ### VM INTERACTION START ### [ 160s] [ 152.724796] reboot: Power down [ 160s] ### VM INTERACTION END ### [ 160s] [ 160s] lamb09 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:19 UTC 2017. [ 160s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:17:27 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:17:27 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f4e5ecd01bc_718e50ef7413368c8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 145s] To: [ 145s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 145s] [ 145s] You may investigate any problem if you feel able to do so, in which [ 145s] case the test suite provides a good starting point. Its output may [ 145s] be found below `tests/testsuite.dir'. [ 145s] [ 145s] Makefile:1221: recipe for target 'check-local' failed [ 145s] make[3]: *** [check-local] Error 1 [ 145s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 145s] Makefile:1055: recipe for target 'check-am' failed [ 145s] make[2]: *** [check-am] Error 2 [ 145s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 145s] Makefile:460: recipe for target 'check-recursive' failed [ 145s] make[1]: *** [check-recursive] Error 1 [ 145s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 145s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 145s] debian/rules:12: recipe for target 'build' failed [ 145s] make: *** [build] Error 2 [ 145s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 145s] [ 145s] lamb19 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:16 UTC 2017. [ 145s] [ 145s] ### VM INTERACTION START ### [ 148s] [ 141.490824] reboot: Power down [ 148s] ### VM INTERACTION END ### [ 148s] [ 148s] lamb19 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:20 UTC 2017. [ 148s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:17:46 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:17:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f4e5ed3ee28_718e50ef741336914@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 160s] To: [ 160s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 160s] [ 160s] You may investigate any problem if you feel able to do so, in which [ 160s] case the test suite provides a good starting point. Its output may [ 160s] be found below `tests/testsuite.dir'. [ 160s] [ 160s] Makefile:1221: recipe for target 'check-local' failed [ 160s] make[3]: *** [check-local] Error 1 [ 160s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 160s] Makefile:1055: recipe for target 'check-am' failed [ 160s] make[2]: *** [check-am] Error 2 [ 160s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 160s] Makefile:460: recipe for target 'check-recursive' failed [ 160s] make[1]: *** [check-recursive] Error 1 [ 160s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 160s] dh_auto_test: make -j1 check returned exit code 2 [ 160s] debian/rules:12: recipe for target 'build' failed [ 160s] make: *** [build] Error 2 [ 161s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 161s] [ 161s] lamb55 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:23 UTC 2017. [ 161s] [ 161s] ### VM INTERACTION START ### [ 164s] [ 157.041188] reboot: Power down [ 164s] ### VM INTERACTION END ### [ 164s] [ 164s] lamb55 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:27 UTC 2017. [ 164s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:17:46 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:17:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f4e5ed899b7_718e50ef741337039@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 195s] To: [ 195s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 195s] [ 195s] You may investigate any problem if you feel able to do so, in which [ 195s] case the test suite provides a good starting point. Its output may [ 195s] be found below `tests/testsuite.dir'. [ 195s] [ 195s] Makefile:1221: recipe for target 'check-local' failed [ 195s] make[3]: *** [check-local] Error 1 [ 195s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 195s] Makefile:1055: recipe for target 'check-am' failed [ 195s] make[2]: *** [check-am] Error 2 [ 195s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 195s] Makefile:460: recipe for target 'check-recursive' failed [ 195s] make[1]: *** [check-recursive] Error 1 [ 195s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 195s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 195s] debian/rules:12: recipe for target 'build' failed [ 195s] make: *** [build] Error 2 [ 195s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 195s] [ 195s] lamb26 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:24 UTC 2017. [ 195s] [ 195s] ### VM INTERACTION START ### [ 198s] [ 190.479435] reboot: Power down [ 198s] ### VM INTERACTION END ### [ 198s] [ 198s] lamb26 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:28 UTC 2017. [ 198s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:17:46 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:17:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f4e5edd67ed_718e50ef741337128@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 127s] To: [ 127s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 127s] [ 127s] You may investigate any problem if you feel able to do so, in which [ 127s] case the test suite provides a good starting point. Its output may [ 127s] be found below `tests/testsuite.dir'. [ 127s] [ 127s] Makefile:1221: recipe for target 'check-local' failed [ 127s] make[3]: *** [check-local] Error 1 [ 127s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 127s] Makefile:1055: recipe for target 'check-am' failed [ 127s] make[2]: *** [check-am] Error 2 [ 127s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 127s] Makefile:460: recipe for target 'check-recursive' failed [ 127s] make[1]: *** [check-recursive] Error 1 [ 127s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 127s] dh_auto_test: make -j1 check returned exit code 2 [ 127s] debian/rules:12: recipe for target 'build' failed [ 127s] make: *** [build] Error 2 [ 127s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 127s] [ 127s] build74 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:24 UTC 2017. [ 127s] [ 127s] ### VM INTERACTION START ### [ 130s] [ 123.653677] reboot: Power down [ 131s] ### VM INTERACTION END ### [ 131s] [ 131s] build74 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:29 UTC 2017. [ 131s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:17:46 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:17:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f4e5ee669ca_718e50ef74133736d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 136s] To: [ 136s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 136s] [ 136s] You may investigate any problem if you feel able to do so, in which [ 136s] case the test suite provides a good starting point. Its output may [ 136s] be found below `tests/testsuite.dir'. [ 136s] [ 136s] Makefile:1221: recipe for target 'check-local' failed [ 136s] make[3]: *** [check-local] Error 1 [ 136s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 136s] Makefile:1055: recipe for target 'check-am' failed [ 136s] make[2]: *** [check-am] Error 2 [ 136s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 136s] Makefile:460: recipe for target 'check-recursive' failed [ 136s] make[1]: *** [check-recursive] Error 1 [ 136s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 136s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 136s] debian/rules:12: recipe for target 'build' failed [ 136s] make: *** [build] Error 2 [ 136s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 136s] [ 136s] lamb65 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:28 UTC 2017. [ 136s] [ 136s] ### VM INTERACTION START ### [ 140s] [ 132.269252] reboot: Power down [ 140s] ### VM INTERACTION END ### [ 140s] [ 140s] lamb65 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:17:32 UTC 2017. [ 140s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:18:03 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:18:03 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f4e6087884d_718e50ef7413374ca@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_17.04/x86_64 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 113s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 113s] #include [ 113s] ^ [ 113s] compilation terminated. [ 113s] Makefile:505: recipe for target 'a_iface.o' failed [ 113s] make[4]: *** [a_iface.o] Error 1 [ 113s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 113s] Makefile:422: recipe for target 'all-recursive' failed [ 113s] make[3]: *** [all-recursive] Error 1 [ 113s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 113s] Makefile:458: recipe for target 'all-recursive' failed [ 113s] make[2]: *** [all-recursive] Error 1 [ 113s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 113s] Makefile:390: recipe for target 'all' failed [ 113s] make[1]: *** [all] Error 2 [ 113s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 113s] dh_auto_build: make -j1 returned exit code 2 [ 113s] debian/rules:45: recipe for target 'build' failed [ 113s] make: *** [build] Error 2 [ 113s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 113s] [ 113s] cloud127 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 20:17:44 UTC 2017. [ 113s] [ 113s] ### VM INTERACTION START ### [ 116s] [ 90.366136] reboot: Power down [ 118s] ### VM INTERACTION END ### [ 118s] [ 118s] cloud127 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 20:17:50 UTC 2017. [ 118s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:18:03 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:18:03 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f4e608be9aa_718e50ef741337565@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_16.04/i586 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 146s] make[4]: Entering directory '/usr/src/packages/BUILD/src/libmsc' [ 146s] gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../.. -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/asn1c -I/usr/include/ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Werror=implicit -Werror=maybe-uninitialized -Werror=memset-transposed-args -Werror=sizeof-array-argument -Werror=sizeof-pointer-memaccess -c -o a_iface.o a_iface.c [ 146s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 146s] compilation terminated. [ 146s] Makefile:505: recipe for target 'a_iface.o' failed [ 146s] make[4]: *** [a_iface.o] Error 1 [ 146s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 146s] Makefile:422: recipe for target 'all-recursive' failed [ 146s] make[3]: *** [all-recursive] Error 1 [ 146s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 146s] Makefile:458: recipe for target 'all-recursive' failed [ 146s] make[2]: *** [all-recursive] Error 1 [ 146s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 146s] Makefile:390: recipe for target 'all' failed [ 146s] make[1]: *** [all] Error 2 [ 146s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 146s] dh_auto_build: make -j1 returned exit code 2 [ 146s] debian/rules:45: recipe for target 'build' failed [ 146s] make: *** [build] Error 2 [ 146s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 146s] [ 146s] lamb51 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 20:17:48 UTC 2017. [ 146s] [ 146s] ### VM INTERACTION START ### [ 149s] [ 141.738581] reboot: Power down [ 149s] ### VM INTERACTION END ### [ 149s] [ 149s] lamb51 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 20:17:52 UTC 2017. [ 149s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:18:37 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:18:37 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f4e628bff9d_718e50ef7413376bc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 223s] To: [ 223s] Subject: [osmo-pcu 0.3.0.20171028] testsuite: 2 3 5 6 7 8 11 failed [ 223s] [ 223s] You may investigate any problem if you feel able to do so, in which [ 223s] case the test suite provides a good starting point. Its output may [ 223s] be found below `tests/testsuite.dir'. [ 223s] [ 223s] Makefile:1221: recipe for target 'check-local' failed [ 223s] make[3]: *** [check-local] Error 1 [ 223s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 223s] Makefile:1055: recipe for target 'check-am' failed [ 223s] make[2]: *** [check-am] Error 2 [ 223s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 223s] Makefile:460: recipe for target 'check-recursive' failed [ 223s] make[1]: *** [check-recursive] Error 1 [ 223s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 223s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 223s] debian/rules:12: recipe for target 'build' failed [ 223s] make: *** [build] Error 2 [ 223s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 224s] [ 224s] cloud112 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:18:18 UTC 2017. [ 224s] [ 224s] ### VM INTERACTION START ### [ 227s] [ 194.147444] reboot: Power down [ 228s] ### VM INTERACTION END ### [ 228s] [ 228s] cloud112 failed "build osmo-pcu_0.3.0.20171028.dsc" at Sat Oct 28 20:18:23 UTC 2017. [ 228s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:28:53 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:28:53 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f4e89f483a7_718e50ef741339155@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 64s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 64s] #include [ 64s] ^ [ 64s] compilation terminated. [ 64s] Makefile:505: recipe for target 'a_iface.o' failed [ 64s] make[4]: *** [a_iface.o] Error 1 [ 64s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 64s] Makefile:422: recipe for target 'all-recursive' failed [ 64s] make[3]: *** [all-recursive] Error 1 [ 64s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 64s] Makefile:458: recipe for target 'all-recursive' failed [ 64s] make[2]: *** [all-recursive] Error 1 [ 64s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 64s] Makefile:390: recipe for target 'all' failed [ 64s] make[1]: *** [all] Error 2 [ 64s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 64s] dh_auto_build: make -j1 returned exit code 2 [ 64s] debian/rules:45: recipe for target 'build' failed [ 64s] make: *** [build] Error 2 [ 64s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 64s] [ 64s] build84 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:28:38 UTC 2017. [ 64s] [ 64s] ### VM INTERACTION START ### [ 67s] [ 61.156795] reboot: Power down [ 68s] ### VM INTERACTION END ### [ 68s] [ 68s] build84 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:28:42 UTC 2017. [ 68s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:30:20 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:30:20 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f4e8f5bf29b_718e50ef7413392bd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 76s] #include [ 76s] ^ [ 76s] compilation terminated. [ 76s] Makefile:493: recipe for target 'a_iface.o' failed [ 76s] make[4]: *** [a_iface.o] Error 1 [ 76s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 76s] Makefile:410: recipe for target 'all-recursive' failed [ 76s] make[3]: *** [all-recursive] Error 1 [ 76s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 76s] Makefile:446: recipe for target 'all-recursive' failed [ 76s] make[2]: *** [all-recursive] Error 1 [ 76s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 76s] Makefile:377: recipe for target 'all' failed [ 76s] make[1]: *** [all] Error 2 [ 76s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 76s] dh_auto_build: make -j1 returned exit code 2 [ 76s] debian/rules:45: recipe for target 'build' failed [ 76s] make: *** [build] Error 2 [ 76s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 76s] [ 76s] build79 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:30:06 UTC 2017. [ 76s] [ 76s] ### VM INTERACTION START ### [ 77s] Powering off. [ 77s] [ 68.176446] reboot: Power down [ 78s] ### VM INTERACTION END ### [ 78s] [ 78s] build79 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:30:08 UTC 2017. [ 78s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:31:11 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:31:11 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f4e91b90de1_718e50ef741339487@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 44s] a_iface.c:39:10: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 44s] #include [ 44s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 44s] compilation terminated. [ 44s] Makefile:505: recipe for target 'a_iface.o' failed [ 44s] make[4]: *** [a_iface.o] Error 1 [ 44s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 44s] Makefile:422: recipe for target 'all-recursive' failed [ 44s] make[3]: *** [all-recursive] Error 1 [ 44s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 44s] Makefile:458: recipe for target 'all-recursive' failed [ 44s] make[2]: *** [all-recursive] Error 1 [ 44s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 44s] Makefile:390: recipe for target 'all' failed [ 44s] make[1]: *** [all] Error 2 [ 44s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 44s] dh_auto_build: make -j1 returned exit code 2 [ 44s] debian/rules:45: recipe for target 'build' failed [ 44s] make: *** [build] Error 2 [ 44s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 44s] [ 44s] build81 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:30:59 UTC 2017. [ 44s] [ 44s] ### VM INTERACTION START ### [ 47s] [ 42.842785] reboot: Power down [ 48s] ### VM INTERACTION END ### [ 48s] [ 48s] build81 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:31:03 UTC 2017. [ 48s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:31:45 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:31:45 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f4e954689a0_718e50ef7413396e2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-msc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 122s] #include [ 122s] ^ [ 122s] compilation terminated. [ 122s] Makefile:493: recipe for target 'a_iface.o' failed [ 122s] make[4]: *** [a_iface.o] Error 1 [ 122s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 122s] Makefile:410: recipe for target 'all-recursive' failed [ 122s] make[3]: *** [all-recursive] Error 1 [ 122s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 122s] Makefile:446: recipe for target 'all-recursive' failed [ 122s] make[2]: *** [all-recursive] Error 1 [ 122s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 122s] Makefile:377: recipe for target 'all' failed [ 122s] make[1]: *** [all] Error 2 [ 122s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 122s] dh_auto_build: make -j1 returned exit code 2 [ 122s] debian/rules:45: recipe for target 'build' failed [ 122s] make: *** [build] Error 2 [ 122s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 122s] [ 122s] cloud103 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:31:30 UTC 2017. [ 122s] [ 122s] ### VM INTERACTION START ### [ 123s] Powering off. [ 123s] [ 103.896223] reboot: Power down [ 128s] ### VM INTERACTION END ### [ 129s] [ 129s] cloud103 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:31:37 UTC 2017. [ 129s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:34:03 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:34:03 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f4e9cc1340e_718e50ef741340047@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 76s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 76s] #include [ 76s] ^ [ 76s] compilation terminated. [ 76s] Makefile:505: recipe for target 'a_iface.o' failed [ 76s] make[4]: *** [a_iface.o] Error 1 [ 76s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 76s] Makefile:422: recipe for target 'all-recursive' failed [ 76s] make[3]: *** [all-recursive] Error 1 [ 76s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 76s] Makefile:458: recipe for target 'all-recursive' failed [ 76s] make[2]: *** [all-recursive] Error 1 [ 76s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 76s] Makefile:390: recipe for target 'all' failed [ 76s] make[1]: *** [all] Error 2 [ 76s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 76s] dh_auto_build: make -j1 returned exit code 2 [ 76s] debian/rules:45: recipe for target 'build' failed [ 76s] make: *** [build] Error 2 [ 76s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 76s] [ 76s] lamb54 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:33:52 UTC 2017. [ 76s] [ 76s] ### VM INTERACTION START ### [ 79s] [ 72.112881] reboot: Power down [ 79s] ### VM INTERACTION END ### [ 79s] [ 79s] lamb54 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:33:56 UTC 2017. [ 79s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:35:11 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:35:11 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f4ea08c639b_718e50ef74134011d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/Debian_9.0/i586 Package network:osmocom:nightly/osmo-msc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 93s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 93s] #include [ 93s] ^ [ 93s] compilation terminated. [ 93s] Makefile:505: recipe for target 'a_iface.o' failed [ 93s] make[4]: *** [a_iface.o] Error 1 [ 93s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 93s] Makefile:422: recipe for target 'all-recursive' failed [ 93s] make[3]: *** [all-recursive] Error 1 [ 93s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 93s] Makefile:458: recipe for target 'all-recursive' failed [ 93s] make[2]: *** [all-recursive] Error 1 [ 93s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 93s] Makefile:390: recipe for target 'all' failed [ 93s] make[1]: *** [all] Error 2 [ 93s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 93s] dh_auto_build: make -j1 returned exit code 2 [ 93s] debian/rules:45: recipe for target 'build' failed [ 93s] make: *** [build] Error 2 [ 93s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 93s] [ 93s] lamb09 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:34:51 UTC 2017. [ 93s] [ 93s] ### VM INTERACTION START ### [ 96s] [ 86.673979] reboot: Power down [ 96s] ### VM INTERACTION END ### [ 96s] [ 96s] lamb09 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:34:54 UTC 2017. [ 96s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:36:37 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:36:37 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f4ea62b1ab1_718e50ef7413403bd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 126s] Making all in libmsc [ 126s] make[4]: Entering directory '/usr/src/packages/BUILD/src/libmsc' [ 126s] gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../.. -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/asn1c -I/usr/include/ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Werror=implicit -Werror=maybe-uninitialized -Werror=memset-transposed-args -Werror=sizeof-array-argument -Werror=sizeof-pointer-memaccess -c -o a_iface.o a_iface.c [ 126s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 126s] compilation terminated. [ 126s] Makefile:505: recipe for target 'a_iface.o' failed [ 126s] make[4]: *** [a_iface.o] Error 1 [ 126s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 126s] Makefile:422: recipe for target 'all-recursive' failed [ 126s] make[3]: *** [all-recursive] Error 1 [ 126s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 126s] Makefile:458: recipe for target 'all-recursive' failed [ 126s] make[2]: *** [all-recursive] Error 1 [ 126s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 126s] Makefile:390: recipe for target 'all' failed [ 126s] make[1]: *** [all] Error 2 [ 126s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 126s] dh_auto_build: make -j1 returned exit code 2 [ 126s] debian/rules:45: recipe for target 'build' failed [ 126s] make: *** [build] Error 2 [ 126s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 126s] [ 126s] cloud109 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:36:26 UTC 2017. [ 126s] [ 126s] ### VM INTERACTION START ### [ 129s] [ 113.977270] reboot: Power down [ 130s] ### VM INTERACTION END ### [ 130s] [ 130s] cloud109 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:36:30 UTC 2017. -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:37:11 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:37:11 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f4ea7d62746_718e50ef7413405ea@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 118s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 118s] #include [ 118s] ^ [ 118s] compilation terminated. [ 118s] Makefile:505: recipe for target 'a_iface.o' failed [ 118s] make[4]: *** [a_iface.o] Error 1 [ 118s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 118s] Makefile:422: recipe for target 'all-recursive' failed [ 118s] make[3]: *** [all-recursive] Error 1 [ 118s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 118s] Makefile:458: recipe for target 'all-recursive' failed [ 118s] make[2]: *** [all-recursive] Error 1 [ 118s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 118s] Makefile:390: recipe for target 'all' failed [ 118s] make[1]: *** [all] Error 2 [ 118s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 118s] dh_auto_build: make -j1 returned exit code 2 [ 118s] debian/rules:45: recipe for target 'build' failed [ 118s] make: *** [build] Error 2 [ 118s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 118s] [ 118s] cloud109 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:36:41 UTC 2017. [ 118s] [ 118s] ### VM INTERACTION START ### [ 121s] [ 99.030333] reboot: Power down [ 129s] ### VM INTERACTION END ### [ 129s] [ 129s] cloud109 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:36:53 UTC 2017. [ 129s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:37:11 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:37:11 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f4ea7ee5192_718e50ef74134065f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 78s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 78s] #include [ 78s] ^ [ 78s] compilation terminated. [ 78s] Makefile:505: recipe for target 'a_iface.o' failed [ 78s] make[4]: *** [a_iface.o] Error 1 [ 78s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 78s] Makefile:422: recipe for target 'all-recursive' failed [ 78s] make[3]: *** [all-recursive] Error 1 [ 78s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 78s] Makefile:458: recipe for target 'all-recursive' failed [ 78s] make[2]: *** [all-recursive] Error 1 [ 78s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 78s] Makefile:390: recipe for target 'all' failed [ 78s] make[1]: *** [all] Error 2 [ 78s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 78s] dh_auto_build: make -j1 returned exit code 2 [ 78s] debian/rules:45: recipe for target 'build' failed [ 78s] make: *** [build] Error 2 [ 78s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 78s] [ 78s] lamb11 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:37:06 UTC 2017. [ 78s] [ 78s] ### VM INTERACTION START ### [ 82s] [ 73.349200] reboot: Power down [ 82s] ### VM INTERACTION END ### [ 82s] [ 82s] lamb11 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:37:09 UTC 2017. [ 82s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:37:28 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:37:28 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f4ea9d7a17d_718e50ef741340795@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 98s] make[4]: Entering directory '/usr/src/packages/BUILD/src/libmsc' [ 98s] gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../.. -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/asn1c -I/usr/include/ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Werror=implicit -Werror=maybe-uninitialized -Werror=memset-transposed-args -Werror=sizeof-array-argument -Werror=sizeof-pointer-memaccess -c -o a_iface.o a_iface.c [ 98s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 98s] compilation terminated. [ 98s] Makefile:505: recipe for target 'a_iface.o' failed [ 98s] make[4]: *** [a_iface.o] Error 1 [ 98s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 98s] Makefile:422: recipe for target 'all-recursive' failed [ 98s] make[3]: *** [all-recursive] Error 1 [ 98s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 98s] Makefile:458: recipe for target 'all-recursive' failed [ 98s] make[2]: *** [all-recursive] Error 1 [ 98s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 98s] Makefile:390: recipe for target 'all' failed [ 98s] make[1]: *** [all] Error 2 [ 98s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 98s] dh_auto_build: make -j1 returned exit code 2 [ 98s] debian/rules:45: recipe for target 'build' failed [ 98s] make: *** [build] Error 2 [ 98s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 98s] [ 98s] lamb18 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:37:15 UTC 2017. [ 98s] [ 98s] ### VM INTERACTION START ### [ 101s] [ 92.845991] reboot: Power down [ 101s] ### VM INTERACTION END ### [ 101s] [ 101s] lamb18 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:37:18 UTC 2017. [ 101s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 20:37:46 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 20:37:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f4eaa0254fc_718e50ef741341047@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 173s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 173s] #include [ 173s] ^ [ 173s] compilation terminated. [ 173s] Makefile:505: recipe for target 'a_iface.o' failed [ 173s] make[4]: *** [a_iface.o] Error 1 [ 173s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 173s] Makefile:422: recipe for target 'all-recursive' failed [ 173s] make[3]: *** [all-recursive] Error 1 [ 173s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 173s] Makefile:458: recipe for target 'all-recursive' failed [ 173s] make[2]: *** [all-recursive] Error 1 [ 173s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 173s] Makefile:390: recipe for target 'all' failed [ 173s] make[1]: *** [all] Error 2 [ 173s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 173s] dh_auto_build: make -j1 returned exit code 2 [ 173s] debian/rules:45: recipe for target 'build' failed [ 173s] make: *** [build] Error 2 [ 173s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 173s] [ 173s] cloud128 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:37:18 UTC 2017. [ 173s] [ 173s] ### VM INTERACTION START ### [ 177s] [ 142.049335] reboot: Power down [ 196s] ### VM INTERACTION END ### [ 196s] [ 196s] cloud128 failed "build osmo-msc_1.1.1.20171028.dsc" at Sat Oct 28 20:37:41 UTC 2017. [ 196s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Oct 28 21:28:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 21:28:35 +0000 Subject: [PATCH] osmo-ci[master]: Add osmocom-latest-packages.sh script for network:osmocom:la... Message-ID: Review at https://gerrit.osmocom.org/4549 Add osmocom-latest-packages.sh script for network:osmocom:latest Change-Id: I8b036e57d8a5f4e08081c9641bbef50fead0c52a --- A scripts/osmocom-latest-packages.sh 1 file changed, 62 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/49/4549/1 diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh new file mode 100755 index 0000000..2f0152e --- /dev/null +++ b/scripts/osmocom-latest-packages.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +#set -e + +# OBS project name +PROJ=network:osmocom:latest + +DT=`date +%Y%m%d` + +# start with a checkout of the project +if [ -d $PROJ ]; then + (cd $PROJ && osc up) +else + osc co $PROJ +fi + +build() { + echo + echo "====> Building $1" + rm -rf data + [ -d $1 ] || git clone git://git.osmocom.org/$1 + cd $1 + git fetch + VER=`git describe --abbrev=0 --tags --match "*.*.*" origin/master` + git checkout -f -B $VER refs/tags/$VER + gbp buildpackage -d -S -uc -us --git-export-dir=$PWD/../data --git-debian-branch=$VER + cd ../$PROJ/$1 + osc rm * || true + mv ../../data/*.dsc . + mv ../../data/*.tar* . + osc add * + cd ../../ +} + +PACKAGES=" + libosmocore + libosmo-sccp + libosmo-abis + libosmo-netif + libsmpp34 + libasn1c + osmo-iuh + osmo-ggsn + osmo-sgsn + openbsc + osmo-pcap + osmo-trx + osmo-sip-connector + osmo-bts + osmo-pcu + osmo-hlr + osmo-mgw + osmo-msc + osmo-bsc + " + +for p in $PACKAGES; do + build $p +done + +cd $PROJ +osc ci -m "Latest Tagged versions of $DT" -- To view, visit https://gerrit.osmocom.org/4549 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8b036e57d8a5f4e08081c9641bbef50fead0c52a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 21:40:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 21:40:40 +0000 Subject: osmo-ci[master]: Add osmocom-latest-packages.sh script for network:osmocom:la... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4549 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8b036e57d8a5f4e08081c9641bbef50fead0c52a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Oct 28 21:40:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 21:40:42 +0000 Subject: [MERGED] osmo-ci[master]: Add osmocom-latest-packages.sh script for network:osmocom:la... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add osmocom-latest-packages.sh script for network:osmocom:latest ...................................................................... Add osmocom-latest-packages.sh script for network:osmocom:latest Change-Id: I8b036e57d8a5f4e08081c9641bbef50fead0c52a --- A scripts/osmocom-latest-packages.sh 1 file changed, 62 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh new file mode 100755 index 0000000..2f0152e --- /dev/null +++ b/scripts/osmocom-latest-packages.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +#set -e + +# OBS project name +PROJ=network:osmocom:latest + +DT=`date +%Y%m%d` + +# start with a checkout of the project +if [ -d $PROJ ]; then + (cd $PROJ && osc up) +else + osc co $PROJ +fi + +build() { + echo + echo "====> Building $1" + rm -rf data + [ -d $1 ] || git clone git://git.osmocom.org/$1 + cd $1 + git fetch + VER=`git describe --abbrev=0 --tags --match "*.*.*" origin/master` + git checkout -f -B $VER refs/tags/$VER + gbp buildpackage -d -S -uc -us --git-export-dir=$PWD/../data --git-debian-branch=$VER + cd ../$PROJ/$1 + osc rm * || true + mv ../../data/*.dsc . + mv ../../data/*.tar* . + osc add * + cd ../../ +} + +PACKAGES=" + libosmocore + libosmo-sccp + libosmo-abis + libosmo-netif + libsmpp34 + libasn1c + osmo-iuh + osmo-ggsn + osmo-sgsn + openbsc + osmo-pcap + osmo-trx + osmo-sip-connector + osmo-bts + osmo-pcu + osmo-hlr + osmo-mgw + osmo-msc + osmo-bsc + " + +for p in $PACKAGES; do + build $p +done + +cd $PROJ +osc ci -m "Latest Tagged versions of $DT" -- To view, visit https://gerrit.osmocom.org/4549 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8b036e57d8a5f4e08081c9641bbef50fead0c52a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Oct 28 21:44:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Oct 2017 21:44:28 +0000 Subject: [PATCH] osmo-ci[master]: Add JJB YML for Osmocom_OBS_latest Message-ID: Review at https://gerrit.osmocom.org/4550 Add JJB YML for Osmocom_OBS_latest Change-Id: I59a901727e35a35ba0fe73c09accb0bd1fa6b7ab --- A jobs/osmocom-obs-latest.yml 1 file changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/50/4550/1 diff --git a/jobs/osmocom-obs-latest.yml b/jobs/osmocom-obs-latest.yml new file mode 100644 index 0000000..337e067 --- /dev/null +++ b/jobs/osmocom-obs-latest.yml @@ -0,0 +1,22 @@ +--- +- project: + name: Osmocom_OBS_latest + jobs: + - Osmocom_OBS_latest + +- job: + name: 'Osmocom_OBS_latest' + project-type: freestyle + defaults: global + description: 'Generated by job-builder' + node: linux_amd64_debian8 + builders: + - shell: + ./scripts/osmocom-latest-packages.sh + scm: + - git: + url: git://git.osmocom.org/osmo-ci + git-config-name: 'Jenkins Builder' + git-config-email: 'jenkins at osmocom.org' + triggers: + - timed: "@midnight" -- To view, visit https://gerrit.osmocom.org/4550 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I59a901727e35a35ba0fe73c09accb0bd1fa6b7ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From admin at opensuse.org Sat Oct 28 21:59:32 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 21:59:32 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f4fdd396867_718e50ef7413618ef@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_17.04/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 71s] #define HAVE_STRING_H 1 [ 71s] #define HAVE_MEMORY_H 1 [ 71s] #define HAVE_STRINGS_H 1 [ 71s] #define HAVE_INTTYPES_H 1 [ 71s] #define HAVE_STDINT_H 1 [ 71s] #define HAVE_UNISTD_H 1 [ 71s] #define HAVE_DLFCN_H 1 [ 71s] #define LT_OBJDIR ".libs/" [ 71s] [ 71s] configure: exit 1 [ 71s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 71s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 71s] make[1]: *** [override_dh_auto_configure] Error 2 [ 71s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 71s] debian/rules:45: recipe for target 'build' failed [ 71s] make: *** [build] Error 2 [ 71s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 71s] [ 71s] lamb73 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 21:59:17 UTC 2017. [ 71s] [ 71s] ### VM INTERACTION START ### [ 71s] [ 64.256074] serial8250: too much work for irq4 [ 71s] [ 64.352084] serial8250: too much work for irq4 [ 71s] [ 64.444120] serial8250: too much work for irq4 [ 75s] [ 67.665517] reboot: Power down [ 75s] ### VM INTERACTION END ### [ 75s] [ 75s] lamb73 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 21:59:21 UTC 2017. [ 75s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:01:32 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:01:32 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f4fe4e34f40_718e50ef7413619c8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/Debian_9.0/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 85s] #define HAVE_SYS_TYPES_H 1 [ 85s] #define HAVE_SYS_STAT_H 1 [ 85s] #define HAVE_STDLIB_H 1 [ 85s] #define HAVE_STRING_H 1 [ 85s] #define HAVE_MEMORY_H 1 [ 85s] #define HAVE_STRINGS_H 1 [ 85s] #define HAVE_INTTYPES_H 1 [ 85s] #define HAVE_STDINT_H 1 [ 85s] #define HAVE_UNISTD_H 1 [ 85s] #define HAVE_DLFCN_H 1 [ 85s] #define LT_OBJDIR ".libs/" [ 85s] [ 85s] configure: exit 1 [ 85s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 85s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 85s] make[1]: *** [override_dh_auto_configure] Error 2 [ 85s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 85s] debian/rules:45: recipe for target 'build' failed [ 85s] make: *** [build] Error 2 [ 85s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 85s] [ 85s] lamb16 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:01:15 UTC 2017. [ 85s] [ 85s] ### VM INTERACTION START ### [ 88s] [ 79.975490] reboot: Power down [ 88s] ### VM INTERACTION END ### [ 88s] [ 88s] lamb16 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:01:18 UTC 2017. [ 88s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:01:32 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:01:32 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f4fe4ee84e0_718e50ef741362120@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_16.10/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 70s] #define HAVE_SYS_TYPES_H 1 [ 70s] #define HAVE_SYS_STAT_H 1 [ 70s] #define HAVE_STDLIB_H 1 [ 70s] #define HAVE_STRING_H 1 [ 70s] #define HAVE_MEMORY_H 1 [ 70s] #define HAVE_STRINGS_H 1 [ 70s] #define HAVE_INTTYPES_H 1 [ 70s] #define HAVE_STDINT_H 1 [ 70s] #define HAVE_UNISTD_H 1 [ 70s] #define HAVE_DLFCN_H 1 [ 70s] #define LT_OBJDIR ".libs/" [ 70s] [ 70s] configure: exit 1 [ 70s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 70s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 70s] make[1]: *** [override_dh_auto_configure] Error 2 [ 70s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 70s] debian/rules:45: recipe for target 'build' failed [ 70s] make: *** [build] Error 2 [ 70s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 70s] [ 70s] lamb74 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:01:23 UTC 2017. [ 70s] [ 70s] ### VM INTERACTION START ### [ 74s] [ 66.226950] reboot: Power down [ 74s] ### VM INTERACTION END ### [ 74s] [ 74s] lamb74 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:01:27 UTC 2017. [ 74s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:02:40 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:02:40 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f4fe89d01c7_718e50ef741362475@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_17.10/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 79s] #define HAVE_SYS_TYPES_H 1 [ 79s] #define HAVE_SYS_STAT_H 1 [ 79s] #define HAVE_STDLIB_H 1 [ 79s] #define HAVE_STRING_H 1 [ 79s] #define HAVE_MEMORY_H 1 [ 79s] #define HAVE_STRINGS_H 1 [ 79s] #define HAVE_INTTYPES_H 1 [ 79s] #define HAVE_STDINT_H 1 [ 79s] #define HAVE_UNISTD_H 1 [ 79s] #define HAVE_DLFCN_H 1 [ 79s] #define LT_OBJDIR ".libs/" [ 79s] [ 79s] configure: exit 1 [ 79s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 79s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 79s] make[1]: *** [override_dh_auto_configure] Error 2 [ 79s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 79s] debian/rules:45: recipe for target 'build' failed [ 79s] make: *** [build] Error 2 [ 79s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 79s] [ 79s] lamb07 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:02:28 UTC 2017. [ 79s] [ 79s] ### VM INTERACTION START ### [ 82s] [ 74.976267] reboot: Power down [ 82s] ### VM INTERACTION END ### [ 82s] [ 82s] lamb07 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:02:32 UTC 2017. [ 82s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:02:40 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:02:40 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f4fe8a73938_718e50ef741362598@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_16.04/i586 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 97s] #define HAVE_SYS_TYPES_H 1 [ 97s] #define HAVE_SYS_STAT_H 1 [ 97s] #define HAVE_STDLIB_H 1 [ 97s] #define HAVE_STRING_H 1 [ 97s] #define HAVE_MEMORY_H 1 [ 97s] #define HAVE_STRINGS_H 1 [ 97s] #define HAVE_INTTYPES_H 1 [ 97s] #define HAVE_STDINT_H 1 [ 97s] #define HAVE_UNISTD_H 1 [ 97s] #define HAVE_DLFCN_H 1 [ 97s] #define LT_OBJDIR ".libs/" [ 97s] [ 97s] configure: exit 1 [ 97s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 97s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 97s] make[1]: *** [override_dh_auto_configure] Error 255 [ 97s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 97s] debian/rules:45: recipe for target 'build' failed [ 97s] make: *** [build] Error 2 [ 97s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 97s] [ 97s] lamb04 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:02:33 UTC 2017. [ 97s] [ 97s] ### VM INTERACTION START ### [ 100s] [ 93.343401] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 100s] [ 100s] lamb04 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:02:37 UTC 2017. [ 100s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:02:57 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:02:57 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f4fea454472_718e50ef7413626cc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/Debian_9.0/i586 Package network:osmocom:latest/osmo-bsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 92s] #define HAVE_SYS_TYPES_H 1 [ 92s] #define HAVE_SYS_STAT_H 1 [ 92s] #define HAVE_STDLIB_H 1 [ 92s] #define HAVE_STRING_H 1 [ 92s] #define HAVE_MEMORY_H 1 [ 92s] #define HAVE_STRINGS_H 1 [ 92s] #define HAVE_INTTYPES_H 1 [ 92s] #define HAVE_STDINT_H 1 [ 92s] #define HAVE_UNISTD_H 1 [ 92s] #define HAVE_DLFCN_H 1 [ 92s] #define LT_OBJDIR ".libs/" [ 92s] [ 92s] configure: exit 1 [ 92s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 92s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 92s] make[1]: *** [override_dh_auto_configure] Error 2 [ 92s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 92s] debian/rules:45: recipe for target 'build' failed [ 92s] make: *** [build] Error 2 [ 92s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 92s] [ 92s] lamb04 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:02:48 UTC 2017. [ 92s] [ 92s] ### VM INTERACTION START ### [ 95s] [ 86.800122] reboot: Power down [ 95s] ### VM INTERACTION END ### [ 95s] [ 95s] lamb04 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:02:52 UTC 2017. [ 95s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:04:23 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:04:23 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f4feff24125_718e50ef741362729@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_16.10/i586 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 130s] #define HAVE_SYS_TYPES_H 1 [ 130s] #define HAVE_SYS_STAT_H 1 [ 130s] #define HAVE_STDLIB_H 1 [ 130s] #define HAVE_STRING_H 1 [ 130s] #define HAVE_MEMORY_H 1 [ 130s] #define HAVE_STRINGS_H 1 [ 130s] #define HAVE_INTTYPES_H 1 [ 130s] #define HAVE_STDINT_H 1 [ 130s] #define HAVE_UNISTD_H 1 [ 130s] #define HAVE_DLFCN_H 1 [ 130s] #define LT_OBJDIR ".libs/" [ 130s] [ 130s] configure: exit 1 [ 130s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 130s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 130s] make[1]: *** [override_dh_auto_configure] Error 2 [ 130s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 130s] debian/rules:45: recipe for target 'build' failed [ 130s] make: *** [build] Error 2 [ 130s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 130s] [ 130s] lamb65 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:04:15 UTC 2017. [ 130s] [ 130s] ### VM INTERACTION START ### [ 133s] [ 118.608607] reboot: Power down [ 133s] ### VM INTERACTION END ### [ 133s] [ 133s] lamb65 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:04:18 UTC 2017. [ 133s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:05:15 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:05:15 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f4ff20dcd1e_718e50ef74136302a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_16.04/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 136s] #define HAVE_SYS_TYPES_H 1 [ 136s] #define HAVE_SYS_STAT_H 1 [ 136s] #define HAVE_STDLIB_H 1 [ 136s] #define HAVE_STRING_H 1 [ 136s] #define HAVE_MEMORY_H 1 [ 136s] #define HAVE_STRINGS_H 1 [ 136s] #define HAVE_INTTYPES_H 1 [ 136s] #define HAVE_STDINT_H 1 [ 136s] #define HAVE_UNISTD_H 1 [ 136s] #define HAVE_DLFCN_H 1 [ 136s] #define LT_OBJDIR ".libs/" [ 136s] [ 136s] configure: exit 1 [ 136s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 136s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 136s] make[1]: *** [override_dh_auto_configure] Error 255 [ 136s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 136s] debian/rules:45: recipe for target 'build' failed [ 136s] make: *** [build] Error 2 [ 136s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 136s] [ 136s] lamb53 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:05:06 UTC 2017. [ 136s] [ 136s] ### VM INTERACTION START ### [ 139s] [ 131.609042] reboot: Power down [ 139s] ### VM INTERACTION END ### [ 139s] [ 139s] lamb53 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:05:10 UTC 2017. [ 139s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:07:15 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:07:15 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f4ff96cb456_718e50ef74136369d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_17.04/i586 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 124s] #define HAVE_SYS_TYPES_H 1 [ 124s] #define HAVE_SYS_STAT_H 1 [ 124s] #define HAVE_STDLIB_H 1 [ 124s] #define HAVE_STRING_H 1 [ 124s] #define HAVE_MEMORY_H 1 [ 124s] #define HAVE_STRINGS_H 1 [ 124s] #define HAVE_INTTYPES_H 1 [ 124s] #define HAVE_STDINT_H 1 [ 124s] #define HAVE_UNISTD_H 1 [ 124s] #define HAVE_DLFCN_H 1 [ 124s] #define LT_OBJDIR ".libs/" [ 124s] [ 124s] configure: exit 1 [ 124s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 124s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 124s] make[1]: *** [override_dh_auto_configure] Error 2 [ 124s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 124s] debian/rules:45: recipe for target 'build' failed [ 124s] make: *** [build] Error 2 [ 124s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 124s] [ 124s] cloud112 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:06:54 UTC 2017. [ 124s] [ 124s] ### VM INTERACTION START ### [ 127s] [ 103.893283] reboot: Power down [ 128s] ### VM INTERACTION END ### [ 128s] [ 128s] cloud112 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:06:59 UTC 2017. [ 128s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:08:06 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:08:06 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f4ffd11ee1_718e50ef741363920@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/Debian_8.0/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 94s] #define HAVE_SYS_STAT_H 1 [ 94s] #define HAVE_STDLIB_H 1 [ 94s] #define HAVE_STRING_H 1 [ 94s] #define HAVE_MEMORY_H 1 [ 94s] #define HAVE_STRINGS_H 1 [ 94s] #define HAVE_INTTYPES_H 1 [ 94s] #define HAVE_STDINT_H 1 [ 94s] #define HAVE_UNISTD_H 1 [ 94s] #define HAVE_DLFCN_H 1 [ 94s] #define LT_OBJDIR ".libs/" [ 94s] [ 94s] configure: exit 1 [ 94s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 94s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 94s] make[1]: *** [override_dh_auto_configure] Error 255 [ 94s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 94s] debian/rules:45: recipe for target 'build' failed [ 94s] make: *** [build] Error 2 [ 94s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 94s] [ 94s] lamb19 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:07:53 UTC 2017. [ 94s] [ 94s] ### VM INTERACTION START ### [ 95s] Powering off. [ 95s] [ 88.303516] reboot: Power down [ 95s] ### VM INTERACTION END ### [ 95s] [ 95s] lamb19 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:07:55 UTC 2017. [ 95s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:12:40 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:12:40 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f500e2927ad_718e50ef74136469f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_17.04/x86_64 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 89s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 89s] #include [ 89s] ^ [ 89s] compilation terminated. [ 89s] Makefile:505: recipe for target 'a_iface.o' failed [ 89s] make[4]: *** [a_iface.o] Error 1 [ 89s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 89s] Makefile:422: recipe for target 'all-recursive' failed [ 89s] make[3]: *** [all-recursive] Error 1 [ 89s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 89s] Makefile:458: recipe for target 'all-recursive' failed [ 89s] make[2]: *** [all-recursive] Error 1 [ 89s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 89s] Makefile:390: recipe for target 'all' failed [ 89s] make[1]: *** [all] Error 2 [ 89s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 89s] dh_auto_build: make -j1 returned exit code 2 [ 89s] debian/rules:45: recipe for target 'build' failed [ 89s] make: *** [build] Error 2 [ 89s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 89s] [ 89s] lamb14 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:12:23 UTC 2017. [ 89s] [ 89s] ### VM INTERACTION START ### [ 92s] [ 84.705852] reboot: Power down [ 92s] ### VM INTERACTION END ### [ 92s] [ 92s] lamb14 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:12:26 UTC 2017. [ 92s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:12:57 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:12:57 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f500fcf20cb_718e50ef741364752@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/Debian_9.0/x86_64 Package network:osmocom:latest/osmo-msc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 97s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 97s] #include [ 97s] ^ [ 97s] compilation terminated. [ 97s] Makefile:505: recipe for target 'a_iface.o' failed [ 97s] make[4]: *** [a_iface.o] Error 1 [ 97s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 97s] Makefile:422: recipe for target 'all-recursive' failed [ 97s] make[3]: *** [all-recursive] Error 1 [ 97s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 97s] Makefile:458: recipe for target 'all-recursive' failed [ 97s] make[2]: *** [all-recursive] Error 1 [ 97s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 97s] Makefile:390: recipe for target 'all' failed [ 97s] make[1]: *** [all] Error 2 [ 97s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 97s] dh_auto_build: make -j1 returned exit code 2 [ 97s] debian/rules:45: recipe for target 'build' failed [ 97s] make: *** [build] Error 2 [ 97s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 97s] [ 97s] lamb06 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:12:44 UTC 2017. [ 97s] [ 97s] ### VM INTERACTION START ### [ 100s] [ 92.001194] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 100s] [ 100s] lamb06 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:12:48 UTC 2017. [ 100s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:14:57 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:14:57 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f50176d7806_718e50ef741365055@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/Debian_8.0/x86_64 Package network:osmocom:latest/osmo-msc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 108s] #include [ 108s] ^ [ 108s] compilation terminated. [ 108s] Makefile:493: recipe for target 'a_iface.o' failed [ 108s] make[4]: *** [a_iface.o] Error 1 [ 108s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 108s] Makefile:410: recipe for target 'all-recursive' failed [ 108s] make[3]: *** [all-recursive] Error 1 [ 108s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 108s] Makefile:446: recipe for target 'all-recursive' failed [ 108s] make[2]: *** [all-recursive] Error 1 [ 108s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 108s] Makefile:377: recipe for target 'all' failed [ 108s] make[1]: *** [all] Error 2 [ 108s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 108s] dh_auto_build: make -j1 returned exit code 2 [ 108s] debian/rules:45: recipe for target 'build' failed [ 108s] make: *** [build] Error 2 [ 108s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 108s] [ 108s] lamb59 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:14:42 UTC 2017. [ 108s] [ 108s] ### VM INTERACTION START ### [ 109s] Powering off. [ 109s] [ 101.797338] reboot: Power down [ 109s] ### VM INTERACTION END ### [ 109s] [ 109s] lamb59 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:14:43 UTC 2017. [ 109s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:15:32 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:15:32 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f50192578d6_718e50ef7413651a3@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_16.04/x86_64 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 174s] ranlib libvlr.a [ 174s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libvlr' [ 174s] Making all in libmsc [ 174s] make[4]: Entering directory '/usr/src/packages/BUILD/src/libmsc' [ 174s] gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../.. -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/asn1c -I/usr/include/ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Werror=implicit -Werror=maybe-uninitialized -Werror=memset-transposed-args -Werror=sizeof-array-argument -Werror=sizeof-pointer-memaccess -c -o a_iface.o a_iface.c [ 174s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 174s] compilation terminated. [ 174s] Makefile:505: recipe for target 'a_iface.o' failed [ 174s] make[4]: *** [a_iface.o] Error 1 [ 174s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 174s] Makefile:422: recipe for target 'all-recursive' failed [ 174s] make[3]: *** [all-recursive] Error 1 [ 174s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 174s] Makefile:458: recipe for target 'all-recursive' failed [ 174s] make[2]: *** [all-recursive] Error 1 [ 174s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 174s] Makefile:390: recipe for target 'all' failed [ 174s] make[1]: *** [all] Error 2 [ 174s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 174s] dh_auto_build: make -j1 returned exit code 2 [ 174s] debian/rules:45: recipe for target 'build' failed [ 174s] make: *** [build] Error 2 [ 174s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 174s] [ 174s] cloud107 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:15:19 UTC 2017. [ 174s] [ 174s] ### VM INTERACTION START ### [ 177s] [ 145.683161] reboot: Power down [ 179s] ### VM INTERACTION END ### -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:15:49 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:15:49 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f501b19b4e4_718e50ef74136538e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/Debian_9.0/i586 Package network:osmocom:latest/osmo-msc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 118s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 118s] #include [ 118s] ^ [ 118s] compilation terminated. [ 118s] Makefile:505: recipe for target 'a_iface.o' failed [ 118s] make[4]: *** [a_iface.o] Error 1 [ 118s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 118s] Makefile:422: recipe for target 'all-recursive' failed [ 118s] make[3]: *** [all-recursive] Error 1 [ 118s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 118s] Makefile:458: recipe for target 'all-recursive' failed [ 118s] make[2]: *** [all-recursive] Error 1 [ 118s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 118s] Makefile:390: recipe for target 'all' failed [ 118s] make[1]: *** [all] Error 2 [ 118s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 118s] dh_auto_build: make -j1 returned exit code 2 [ 118s] debian/rules:45: recipe for target 'build' failed [ 118s] make: *** [build] Error 2 [ 118s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 118s] [ 118s] lamb18 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:15:30 UTC 2017. [ 118s] [ 118s] ### VM INTERACTION START ### [ 121s] [ 113.295465] reboot: Power down [ 121s] ### VM INTERACTION END ### [ 121s] [ 121s] lamb18 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:15:34 UTC 2017. [ 121s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:15:49 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:15:49 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f501b233b2d_718e50ef7413654f2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_16.04/i586 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 103s] make[4]: Entering directory '/usr/src/packages/BUILD/src/libmsc' [ 103s] gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../.. -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/asn1c -I/usr/include/ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Werror=implicit -Werror=maybe-uninitialized -Werror=memset-transposed-args -Werror=sizeof-array-argument -Werror=sizeof-pointer-memaccess -c -o a_iface.o a_iface.c [ 103s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 103s] compilation terminated. [ 103s] Makefile:505: recipe for target 'a_iface.o' failed [ 103s] make[4]: *** [a_iface.o] Error 1 [ 103s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 103s] Makefile:422: recipe for target 'all-recursive' failed [ 103s] make[3]: *** [all-recursive] Error 1 [ 103s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 103s] Makefile:458: recipe for target 'all-recursive' failed [ 103s] make[2]: *** [all-recursive] Error 1 [ 103s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 103s] Makefile:390: recipe for target 'all' failed [ 103s] make[1]: *** [all] Error 2 [ 103s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 103s] dh_auto_build: make -j1 returned exit code 2 [ 103s] debian/rules:45: recipe for target 'build' failed [ 103s] make: *** [build] Error 2 [ 103s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 103s] [ 103s] lamb68 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:15:36 UTC 2017. [ 103s] [ 104s] ### VM INTERACTION START ### [ 107s] [ 100.188238] reboot: Power down [ 107s] ### VM INTERACTION END ### [ 107s] [ 107s] lamb68 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:15:40 UTC 2017. [ 107s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:16:23 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:16:23 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f501d32bff2_718e50ef7413657bc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_17.10/x86_64 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 80s] a_iface.c:39:10: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 80s] #include [ 80s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 80s] compilation terminated. [ 80s] Makefile:505: recipe for target 'a_iface.o' failed [ 80s] make[4]: *** [a_iface.o] Error 1 [ 80s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 80s] Makefile:422: recipe for target 'all-recursive' failed [ 80s] make[3]: *** [all-recursive] Error 1 [ 80s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 80s] Makefile:458: recipe for target 'all-recursive' failed [ 80s] make[2]: *** [all-recursive] Error 1 [ 80s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 80s] Makefile:390: recipe for target 'all' failed [ 80s] make[1]: *** [all] Error 2 [ 80s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 80s] dh_auto_build: make -j1 returned exit code 2 [ 80s] debian/rules:45: recipe for target 'build' failed [ 80s] make: *** [build] Error 2 [ 80s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 80s] [ 80s] wildcard3 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:16:05 UTC 2017. [ 80s] [ 80s] ### VM INTERACTION START ### [ 83s] [ 73.792876] reboot: Power down [ 85s] ### VM INTERACTION END ### [ 85s] [ 85s] wildcard3 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:16:11 UTC 2017. [ 85s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:16:40 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:16:40 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f501d44b09d_718e50ef7413659dd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_17.04/i586 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 93s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 93s] #include [ 93s] ^ [ 93s] compilation terminated. [ 93s] Makefile:505: recipe for target 'a_iface.o' failed [ 93s] make[4]: *** [a_iface.o] Error 1 [ 93s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 93s] Makefile:422: recipe for target 'all-recursive' failed [ 93s] make[3]: *** [all-recursive] Error 1 [ 93s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 93s] Makefile:458: recipe for target 'all-recursive' failed [ 93s] make[2]: *** [all-recursive] Error 1 [ 93s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 93s] Makefile:390: recipe for target 'all' failed [ 93s] make[1]: *** [all] Error 2 [ 93s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 93s] dh_auto_build: make -j1 returned exit code 2 [ 93s] debian/rules:45: recipe for target 'build' failed [ 93s] make: *** [build] Error 2 [ 93s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 93s] [ 93s] lamb54 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:16:28 UTC 2017. [ 93s] [ 93s] ### VM INTERACTION START ### [ 96s] [ 89.231666] reboot: Power down [ 96s] ### VM INTERACTION END ### [ 96s] [ 96s] lamb54 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:16:31 UTC 2017. [ 96s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:16:40 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:16:40 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f501d496731_718e50ef74136607@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_16.10/i586 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 132s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 132s] #include [ 132s] ^ [ 132s] compilation terminated. [ 132s] Makefile:505: recipe for target 'a_iface.o' failed [ 132s] make[4]: *** [a_iface.o] Error 1 [ 132s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 132s] Makefile:422: recipe for target 'all-recursive' failed [ 132s] make[3]: *** [all-recursive] Error 1 [ 132s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 132s] Makefile:458: recipe for target 'all-recursive' failed [ 132s] make[2]: *** [all-recursive] Error 1 [ 132s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 132s] Makefile:390: recipe for target 'all' failed [ 132s] make[1]: *** [all] Error 2 [ 132s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 132s] dh_auto_build: make -j1 returned exit code 2 [ 132s] debian/rules:45: recipe for target 'build' failed [ 132s] make: *** [build] Error 2 [ 132s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 132s] [ 132s] cloud121 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:16:28 UTC 2017. [ 132s] [ 132s] ### VM INTERACTION START ### [ 135s] [ 89.718732] reboot: Power down [ 135s] ### VM INTERACTION END ### [ 136s] [ 136s] cloud121 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:16:33 UTC 2017. [ 136s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:17:49 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:17:49 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f502294ed21_718e50ef7413663e8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/Debian_8.0/i586 Package network:osmocom:latest/osmo-bsc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 87s] #define HAVE_SYS_STAT_H 1 [ 87s] #define HAVE_STDLIB_H 1 [ 87s] #define HAVE_STRING_H 1 [ 87s] #define HAVE_MEMORY_H 1 [ 87s] #define HAVE_STRINGS_H 1 [ 87s] #define HAVE_INTTYPES_H 1 [ 87s] #define HAVE_STDINT_H 1 [ 87s] #define HAVE_UNISTD_H 1 [ 87s] #define HAVE_DLFCN_H 1 [ 87s] #define LT_OBJDIR ".libs/" [ 87s] [ 87s] configure: exit 1 [ 87s] dh_auto_configure: ./configure --build=i586-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 87s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 87s] make[1]: *** [override_dh_auto_configure] Error 255 [ 87s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 87s] debian/rules:45: recipe for target 'build' failed [ 87s] make: *** [build] Error 2 [ 87s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 87s] [ 87s] lamb03 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:17:35 UTC 2017. [ 87s] [ 87s] ### VM INTERACTION START ### [ 88s] Powering off. [ 88s] [ 80.709163] reboot: Power down [ 88s] ### VM INTERACTION END ### [ 88s] [ 88s] lamb03 failed "build osmo-bsc_1.1.1.dsc" at Sat Oct 28 22:17:36 UTC 2017. [ 88s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:18:23 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:18:23 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f50249746fd_718e50ef7413664a2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_16.10/x86_64 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 188s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 188s] #include [ 188s] ^ [ 188s] compilation terminated. [ 188s] Makefile:505: recipe for target 'a_iface.o' failed [ 188s] make[4]: *** [a_iface.o] Error 1 [ 188s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 189s] Makefile:422: recipe for target 'all-recursive' failed [ 189s] make[3]: *** [all-recursive] Error 1 [ 189s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 189s] Makefile:458: recipe for target 'all-recursive' failed [ 189s] make[2]: *** [all-recursive] Error 1 [ 189s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 189s] Makefile:390: recipe for target 'all' failed [ 189s] make[1]: *** [all] Error 2 [ 189s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 189s] dh_auto_build: make -j1 returned exit code 2 [ 189s] debian/rules:45: recipe for target 'build' failed [ 189s] make: *** [build] Error 2 [ 189s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 189s] [ 189s] lamb22 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:18:04 UTC 2017. [ 189s] [ 189s] ### VM INTERACTION START ### [ 192s] [ 174.964982] reboot: Power down [ 192s] ### VM INTERACTION END ### [ 192s] [ 192s] lamb22 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:18:08 UTC 2017. [ 192s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Oct 28 22:25:46 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Oct 2017 22:25:46 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f503efa615_718e50ef74136774d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/Debian_8.0/i586 Package network:osmocom:latest/osmo-msc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 131s] #include [ 131s] ^ [ 131s] compilation terminated. [ 131s] Makefile:493: recipe for target 'a_iface.o' failed [ 131s] make[4]: *** [a_iface.o] Error 1 [ 131s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 131s] Makefile:410: recipe for target 'all-recursive' failed [ 131s] make[3]: *** [all-recursive] Error 1 [ 131s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 131s] Makefile:446: recipe for target 'all-recursive' failed [ 131s] make[2]: *** [all-recursive] Error 1 [ 131s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 131s] Makefile:377: recipe for target 'all' failed [ 131s] make[1]: *** [all] Error 2 [ 131s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 131s] dh_auto_build: make -j1 returned exit code 2 [ 131s] debian/rules:45: recipe for target 'build' failed [ 131s] make: *** [build] Error 2 [ 131s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 131s] [ 131s] cloud113 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:25:29 UTC 2017. [ 131s] [ 131s] ### VM INTERACTION START ### [ 132s] Powering off. [ 132s] [ 112.534441] reboot: Power down [ 134s] ### VM INTERACTION END ### [ 134s] [ 134s] cloud113 failed "build osmo-msc_1.1.1.dsc" at Sat Oct 28 22:25:33 UTC 2017. [ 134s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:15:17 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:15:17 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f52bbc600ab_718e50ef7414055b8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_17.04/i586 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 137s] #define HAVE_SYS_TYPES_H 1 [ 137s] #define HAVE_SYS_STAT_H 1 [ 137s] #define HAVE_STDLIB_H 1 [ 137s] #define HAVE_STRING_H 1 [ 137s] #define HAVE_MEMORY_H 1 [ 137s] #define HAVE_STRINGS_H 1 [ 137s] #define HAVE_INTTYPES_H 1 [ 137s] #define HAVE_STDINT_H 1 [ 137s] #define HAVE_UNISTD_H 1 [ 137s] #define HAVE_DLFCN_H 1 [ 137s] #define LT_OBJDIR ".libs/" [ 137s] [ 137s] configure: exit 1 [ 137s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 137s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 137s] make[1]: *** [override_dh_auto_configure] Error 2 [ 137s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 137s] debian/rules:45: recipe for target 'build' failed [ 137s] make: *** [build] Error 2 [ 137s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 138s] [ 138s] cloud109 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:15:02 UTC 2017. [ 138s] [ 138s] ### VM INTERACTION START ### [ 141s] [ 106.607246] reboot: Power down [ 144s] ### VM INTERACTION END ### [ 144s] [ 144s] cloud109 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:15:08 UTC 2017. [ 144s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:16:09 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:16:09 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f52bf680f2c_718e50ef741405644@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/Debian_9.0/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 86s] #define HAVE_SYS_TYPES_H 1 [ 86s] #define HAVE_SYS_STAT_H 1 [ 86s] #define HAVE_STDLIB_H 1 [ 86s] #define HAVE_STRING_H 1 [ 86s] #define HAVE_MEMORY_H 1 [ 86s] #define HAVE_STRINGS_H 1 [ 86s] #define HAVE_INTTYPES_H 1 [ 86s] #define HAVE_STDINT_H 1 [ 86s] #define HAVE_UNISTD_H 1 [ 86s] #define HAVE_DLFCN_H 1 [ 86s] #define LT_OBJDIR ".libs/" [ 86s] [ 86s] configure: exit 1 [ 86s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 86s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 86s] make[1]: *** [override_dh_auto_configure] Error 2 [ 86s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 86s] debian/rules:45: recipe for target 'build' failed [ 86s] make: *** [build] Error 2 [ 86s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 86s] [ 86s] lamb60 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:15:53 UTC 2017. [ 86s] [ 86s] ### VM INTERACTION START ### [ 89s] [ 80.890917] reboot: Power down [ 89s] ### VM INTERACTION END ### [ 89s] [ 89s] lamb60 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:15:57 UTC 2017. [ 89s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:14:26 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:14:26 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f52b812cacd_718e50ef7414053d9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_16.04/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 112s] #define HAVE_SYS_TYPES_H 1 [ 112s] #define HAVE_SYS_STAT_H 1 [ 112s] #define HAVE_STDLIB_H 1 [ 112s] #define HAVE_STRING_H 1 [ 112s] #define HAVE_MEMORY_H 1 [ 112s] #define HAVE_STRINGS_H 1 [ 112s] #define HAVE_INTTYPES_H 1 [ 112s] #define HAVE_STDINT_H 1 [ 112s] #define HAVE_UNISTD_H 1 [ 112s] #define HAVE_DLFCN_H 1 [ 112s] #define LT_OBJDIR ".libs/" [ 112s] [ 112s] configure: exit 1 [ 112s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 112s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 112s] make[1]: *** [override_dh_auto_configure] Error 255 [ 112s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 112s] debian/rules:45: recipe for target 'build' failed [ 112s] make: *** [build] Error 2 [ 112s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 112s] [ 112s] lamb57 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:14:10 UTC 2017. [ 112s] [ 112s] ### VM INTERACTION START ### [ 115s] [ 107.896330] reboot: Power down [ 115s] ### VM INTERACTION END ### [ 115s] [ 115s] lamb57 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:14:14 UTC 2017. [ 115s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:16:26 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:16:26 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f52bf7b428d_718e50ef741405778@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/Debian_8.0/i586 Package network:osmocom:latest/osmo-msc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 127s] #include [ 127s] ^ [ 127s] compilation terminated. [ 127s] Makefile:493: recipe for target 'a_iface.o' failed [ 127s] make[4]: *** [a_iface.o] Error 1 [ 127s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 127s] Makefile:410: recipe for target 'all-recursive' failed [ 127s] make[3]: *** [all-recursive] Error 1 [ 127s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 127s] Makefile:446: recipe for target 'all-recursive' failed [ 127s] make[2]: *** [all-recursive] Error 1 [ 127s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 127s] Makefile:377: recipe for target 'all' failed [ 127s] make[1]: *** [all] Error 2 [ 127s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 127s] dh_auto_build: make -j1 returned exit code 2 [ 127s] debian/rules:45: recipe for target 'build' failed [ 127s] make: *** [build] Error 2 [ 127s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 127s] [ 127s] cloud120 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:16:09 UTC 2017. [ 127s] [ 127s] ### VM INTERACTION START ### [ 128s] Powering off. [ 128s] [ 111.742144] reboot: Power down [ 130s] ### VM INTERACTION END ### [ 130s] [ 130s] cloud120 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:16:12 UTC 2017. [ 130s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:13:35 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:13:35 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f52b5e95f6d_718e50ef741405188@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_16.10/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 71s] #define HAVE_SYS_TYPES_H 1 [ 71s] #define HAVE_SYS_STAT_H 1 [ 71s] #define HAVE_STDLIB_H 1 [ 71s] #define HAVE_STRING_H 1 [ 71s] #define HAVE_MEMORY_H 1 [ 71s] #define HAVE_STRINGS_H 1 [ 71s] #define HAVE_INTTYPES_H 1 [ 71s] #define HAVE_STDINT_H 1 [ 71s] #define HAVE_UNISTD_H 1 [ 71s] #define HAVE_DLFCN_H 1 [ 71s] #define LT_OBJDIR ".libs/" [ 71s] [ 71s] configure: exit 1 [ 71s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 71s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 71s] make[1]: *** [override_dh_auto_configure] Error 2 [ 71s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 71s] debian/rules:45: recipe for target 'build' failed [ 71s] make: *** [build] Error 2 [ 71s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 71s] [ 71s] lamb77 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:13:15 UTC 2017. [ 71s] [ 71s] ### VM INTERACTION START ### [ 75s] [ 67.898064] reboot: Power down [ 75s] ### VM INTERACTION END ### [ 75s] [ 75s] lamb77 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:13:19 UTC 2017. [ 75s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:13:35 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:13:35 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f52b5f17ca_718e50ef741405234@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/Debian_9.0/i586 Package network:osmocom:latest/osmo-bsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 89s] #define HAVE_SYS_TYPES_H 1 [ 89s] #define HAVE_SYS_STAT_H 1 [ 89s] #define HAVE_STDLIB_H 1 [ 89s] #define HAVE_STRING_H 1 [ 89s] #define HAVE_MEMORY_H 1 [ 89s] #define HAVE_STRINGS_H 1 [ 89s] #define HAVE_INTTYPES_H 1 [ 89s] #define HAVE_STDINT_H 1 [ 89s] #define HAVE_UNISTD_H 1 [ 89s] #define HAVE_DLFCN_H 1 [ 89s] #define LT_OBJDIR ".libs/" [ 89s] [ 89s] configure: exit 1 [ 89s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 89s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 89s] make[1]: *** [override_dh_auto_configure] Error 2 [ 89s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 89s] debian/rules:45: recipe for target 'build' failed [ 89s] make: *** [build] Error 2 [ 89s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 89s] [ 89s] lamb13 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:13:17 UTC 2017. [ 89s] [ 89s] ### VM INTERACTION START ### [ 92s] [ 84.337147] reboot: Power down [ 92s] ### VM INTERACTION END ### [ 92s] [ 92s] lamb13 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:13:20 UTC 2017. [ 92s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:15:00 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:15:00 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f52b9d88d1_718e50ef74140541e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_17.04/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 76s] #define HAVE_SYS_STAT_H 1 [ 76s] #define HAVE_STDLIB_H 1 [ 76s] #define HAVE_STRING_H 1 [ 76s] #define HAVE_MEMORY_H 1 [ 76s] #define HAVE_STRINGS_H 1 [ 76s] #define HAVE_INTTYPES_H 1 [ 76s] #define HAVE_STDINT_H 1 [ 76s] #define HAVE_UNISTD_H 1 [ 76s] #define HAVE_DLFCN_H 1 [ 76s] #define LT_OBJDIR ".libs/" [ 76s] [ 76s] configure: exit 1 [ 76s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 76s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 76s] make[1]: *** [override_dh_auto_configure] Error 2 [ 76s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 76s] debian/rules:45: recipe for target 'build' failed [ 76s] make: *** [build] Error 2 [ 76s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 76s] [ 76s] lamb77 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:14:51 UTC 2017. [ 76s] [ 76s] ### VM INTERACTION START ### [ 76s] [ 68.784111] serial8250: too much work for irq4 [ 80s] [ 72.001549] reboot: Power down [ 80s] ### VM INTERACTION END ### [ 80s] [ 80s] lamb77 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:14:55 UTC 2017. [ 80s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:20:09 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:20:09 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f52ce93e502_718e50ef74140758b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_16.10/i586 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 80s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 80s] #include [ 80s] ^ [ 80s] compilation terminated. [ 80s] Makefile:505: recipe for target 'a_iface.o' failed [ 80s] make[4]: *** [a_iface.o] Error 1 [ 80s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 80s] Makefile:422: recipe for target 'all-recursive' failed [ 80s] make[3]: *** [all-recursive] Error 1 [ 80s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 80s] Makefile:458: recipe for target 'all-recursive' failed [ 80s] make[2]: *** [all-recursive] Error 1 [ 80s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 80s] Makefile:390: recipe for target 'all' failed [ 80s] make[1]: *** [all] Error 2 [ 80s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 80s] dh_auto_build: make -j1 returned exit code 2 [ 80s] debian/rules:45: recipe for target 'build' failed [ 80s] make: *** [build] Error 2 [ 80s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 80s] [ 80s] lamb13 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:19:48 UTC 2017. [ 80s] [ 80s] ### VM INTERACTION START ### [ 83s] [ 75.919890] reboot: Power down [ 83s] ### VM INTERACTION END ### [ 83s] [ 83s] lamb13 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:19:52 UTC 2017. [ 83s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:22:43 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:22:43 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f52d7c42340_718e50ef741408361@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_16.04/i586 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 79s] make[4]: Entering directory '/usr/src/packages/BUILD/src/libmsc' [ 79s] gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../.. -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/asn1c -I/usr/include/ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Werror=implicit -Werror=maybe-uninitialized -Werror=memset-transposed-args -Werror=sizeof-array-argument -Werror=sizeof-pointer-memaccess -c -o a_iface.o a_iface.c [ 79s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 79s] compilation terminated. [ 79s] Makefile:505: recipe for target 'a_iface.o' failed [ 79s] make[4]: *** [a_iface.o] Error 1 [ 79s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 79s] Makefile:422: recipe for target 'all-recursive' failed [ 79s] make[3]: *** [all-recursive] Error 1 [ 79s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 79s] Makefile:458: recipe for target 'all-recursive' failed [ 79s] make[2]: *** [all-recursive] Error 1 [ 79s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 79s] Makefile:390: recipe for target 'all' failed [ 79s] make[1]: *** [all] Error 2 [ 79s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 79s] dh_auto_build: make -j1 returned exit code 2 [ 79s] debian/rules:45: recipe for target 'build' failed [ 79s] make: *** [build] Error 2 [ 79s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 79s] [ 79s] build77 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:22:32 UTC 2017. [ 79s] [ 79s] ### VM INTERACTION START ### [ 82s] [ 75.664227] reboot: Power down [ 82s] ### VM INTERACTION END ### [ 82s] [ 82s] build77 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:22:36 UTC 2017. [ 82s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:22:43 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:22:43 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f52d7c96e82_718e50ef741408498@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_17.10/x86_64 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 77s] a_iface.c:39:10: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 77s] #include [ 77s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 77s] compilation terminated. [ 77s] Makefile:505: recipe for target 'a_iface.o' failed [ 77s] make[4]: *** [a_iface.o] Error 1 [ 77s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 77s] Makefile:422: recipe for target 'all-recursive' failed [ 77s] make[3]: *** [all-recursive] Error 1 [ 77s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 77s] Makefile:458: recipe for target 'all-recursive' failed [ 77s] make[2]: *** [all-recursive] Error 1 [ 77s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 77s] Makefile:390: recipe for target 'all' failed [ 77s] make[1]: *** [all] Error 2 [ 77s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 77s] dh_auto_build: make -j1 returned exit code 2 [ 77s] debian/rules:45: recipe for target 'build' failed [ 77s] make: *** [build] Error 2 [ 77s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 77s] [ 77s] lamb17 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:22:35 UTC 2017. [ 77s] [ 77s] ### VM INTERACTION START ### [ 80s] [ 72.523649] reboot: Power down [ 80s] ### VM INTERACTION END ### [ 80s] [ 80s] lamb17 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:22:38 UTC 2017. [ 80s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:19:52 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:19:52 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f52cc857b42_718e50ef7414073bf@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/Debian_9.0/i586 Package network:osmocom:latest/osmo-msc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 85s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 85s] #include [ 85s] ^ [ 85s] compilation terminated. [ 85s] Makefile:505: recipe for target 'a_iface.o' failed [ 85s] make[4]: *** [a_iface.o] Error 1 [ 85s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 85s] Makefile:422: recipe for target 'all-recursive' failed [ 85s] make[3]: *** [all-recursive] Error 1 [ 85s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 85s] Makefile:458: recipe for target 'all-recursive' failed [ 85s] make[2]: *** [all-recursive] Error 1 [ 85s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 85s] Makefile:390: recipe for target 'all' failed [ 85s] make[1]: *** [all] Error 2 [ 85s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 85s] dh_auto_build: make -j1 returned exit code 2 [ 85s] debian/rules:45: recipe for target 'build' failed [ 85s] make: *** [build] Error 2 [ 85s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 85s] [ 85s] build80 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:19:34 UTC 2017. [ 85s] [ 85s] ### VM INTERACTION START ### [ 88s] [ 79.778376] reboot: Power down [ 88s] ### VM INTERACTION END ### [ 88s] [ 88s] build80 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:19:39 UTC 2017. [ 88s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:21:00 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:21:00 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f52d0623169_718e50ef7414077cd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_17.04/i586 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 83s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 83s] #include [ 83s] ^ [ 83s] compilation terminated. [ 83s] Makefile:505: recipe for target 'a_iface.o' failed [ 83s] make[4]: *** [a_iface.o] Error 1 [ 83s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 83s] Makefile:422: recipe for target 'all-recursive' failed [ 83s] make[3]: *** [all-recursive] Error 1 [ 83s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 83s] Makefile:458: recipe for target 'all-recursive' failed [ 83s] make[2]: *** [all-recursive] Error 1 [ 83s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 83s] Makefile:390: recipe for target 'all' failed [ 83s] make[1]: *** [all] Error 2 [ 83s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 83s] dh_auto_build: make -j1 returned exit code 2 [ 83s] debian/rules:45: recipe for target 'build' failed [ 83s] make: *** [build] Error 2 [ 83s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 83s] [ 83s] lamb15 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:20:47 UTC 2017. [ 83s] [ 83s] ### VM INTERACTION START ### [ 86s] [ 78.759358] reboot: Power down [ 86s] ### VM INTERACTION END ### [ 86s] [ 86s] lamb15 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:20:50 UTC 2017. [ 86s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:23:52 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:23:52 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f52db9bf53c_718e50ef7414089a4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/Debian_8.0/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 453s] #define HAVE_SYS_STAT_H 1 [ 453s] #define HAVE_STDLIB_H 1 [ 453s] #define HAVE_STRING_H 1 [ 453s] #define HAVE_MEMORY_H 1 [ 453s] #define HAVE_STRINGS_H 1 [ 453s] #define HAVE_INTTYPES_H 1 [ 453s] #define HAVE_STDINT_H 1 [ 453s] #define HAVE_UNISTD_H 1 [ 453s] #define HAVE_DLFCN_H 1 [ 453s] #define LT_OBJDIR ".libs/" [ 453s] [ 453s] configure: exit 1 [ 453s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 453s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 453s] make[1]: *** [override_dh_auto_configure] Error 255 [ 453s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 453s] debian/rules:45: recipe for target 'build' failed [ 453s] make: *** [build] Error 2 [ 453s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 453s] [ 453s] cloud129 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:23:32 UTC 2017. [ 453s] [ 453s] ### VM INTERACTION START ### [ 456s] Powering off. [ 456s] [ 320.519305] reboot: Power down [ 464s] ### VM INTERACTION END ### [ 464s] [ 464s] cloud129 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:23:43 UTC 2017. [ 464s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:24:26 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:24:26 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f52dd662b77_718e50ef74140915e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_16.10/x86_64 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 79s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 79s] #include [ 79s] ^ [ 79s] compilation terminated. [ 79s] Makefile:505: recipe for target 'a_iface.o' failed [ 79s] make[4]: *** [a_iface.o] Error 1 [ 79s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 79s] Makefile:422: recipe for target 'all-recursive' failed [ 79s] make[3]: *** [all-recursive] Error 1 [ 79s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 79s] Makefile:458: recipe for target 'all-recursive' failed [ 79s] make[2]: *** [all-recursive] Error 1 [ 79s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 79s] Makefile:390: recipe for target 'all' failed [ 79s] make[1]: *** [all] Error 2 [ 79s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 79s] dh_auto_build: make -j1 returned exit code 2 [ 79s] debian/rules:45: recipe for target 'build' failed [ 79s] make: *** [build] Error 2 [ 79s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 79s] [ 79s] lamb12 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:24:12 UTC 2017. [ 79s] [ 79s] ### VM INTERACTION START ### [ 82s] [ 74.691862] reboot: Power down [ 82s] ### VM INTERACTION END ### [ 82s] [ 82s] lamb12 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:24:15 UTC 2017. [ 82s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:26:09 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:26:09 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f52e4f8440d_718e50ef74140942a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_17.04/x86_64 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 58s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 58s] #include [ 58s] ^ [ 58s] compilation terminated. [ 58s] Makefile:505: recipe for target 'a_iface.o' failed [ 58s] make[4]: *** [a_iface.o] Error 1 [ 58s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 58s] Makefile:422: recipe for target 'all-recursive' failed [ 58s] make[3]: *** [all-recursive] Error 1 [ 58s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 58s] Makefile:458: recipe for target 'all-recursive' failed [ 58s] make[2]: *** [all-recursive] Error 1 [ 58s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 58s] Makefile:390: recipe for target 'all' failed [ 58s] make[1]: *** [all] Error 2 [ 58s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 58s] dh_auto_build: make -j1 returned exit code 2 [ 58s] debian/rules:45: recipe for target 'build' failed [ 58s] make: *** [build] Error 2 [ 58s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 58s] [ 58s] build79 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:25:57 UTC 2017. [ 58s] [ 58s] ### VM INTERACTION START ### [ 61s] [ 54.820074] reboot: Power down [ 63s] ### VM INTERACTION END ### [ 64s] [ 64s] build79 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:26:03 UTC 2017. [ 64s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:25:52 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:25:52 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f52e3046a5f_718e50ef7414092d0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/Debian_8.0/x86_64 Package network:osmocom:latest/osmo-msc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 433s] #include [ 433s] ^ [ 433s] compilation terminated. [ 433s] Makefile:493: recipe for target 'a_iface.o' failed [ 433s] make[4]: *** [a_iface.o] Error 1 [ 433s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 433s] Makefile:410: recipe for target 'all-recursive' failed [ 433s] make[3]: *** [all-recursive] Error 1 [ 433s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 433s] Makefile:446: recipe for target 'all-recursive' failed [ 433s] make[2]: *** [all-recursive] Error 1 [ 433s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 433s] Makefile:377: recipe for target 'all' failed [ 433s] make[1]: *** [all] Error 2 [ 433s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 433s] dh_auto_build: make -j1 returned exit code 2 [ 433s] debian/rules:45: recipe for target 'build' failed [ 433s] make: *** [build] Error 2 [ 433s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 433s] [ 433s] build84 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:25:34 UTC 2017. [ 433s] [ 434s] ### VM INTERACTION START ### [ 435s] Powering off. [ 435s] [ 409.364359] reboot: Power down [ 436s] ### VM INTERACTION END ### [ 436s] [ 436s] build84 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:25:37 UTC 2017. [ 436s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:30:09 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:30:09 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f52f3fdac4c_718e50ef7414105b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/xUbuntu_16.04/x86_64 Package network:osmocom:latest/osmo-msc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 155s] make[4]: Entering directory '/usr/src/packages/BUILD/src/libmsc' [ 155s] gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../.. -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/ -I/usr/include/asn1c -I/usr/include/ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Werror=implicit -Werror=maybe-uninitialized -Werror=memset-transposed-args -Werror=sizeof-array-argument -Werror=sizeof-pointer-memaccess -c -o a_iface.o a_iface.c [ 155s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 155s] compilation terminated. [ 155s] Makefile:505: recipe for target 'a_iface.o' failed [ 155s] make[4]: *** [a_iface.o] Error 1 [ 155s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 155s] Makefile:422: recipe for target 'all-recursive' failed [ 155s] make[3]: *** [all-recursive] Error 1 [ 155s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 155s] Makefile:458: recipe for target 'all-recursive' failed [ 155s] make[2]: *** [all-recursive] Error 1 [ 155s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 155s] Makefile:390: recipe for target 'all' failed [ 155s] make[1]: *** [all] Error 2 [ 155s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 155s] dh_auto_build: make -j1 returned exit code 2 [ 155s] debian/rules:45: recipe for target 'build' failed [ 155s] make: *** [build] Error 2 [ 155s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 155s] [ 155s] build34 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:30:04 UTC 2017. [ 155s] [ 155s] ### VM INTERACTION START ### [ 158s] [ 150.506034] reboot: Power down [ 159s] ### VM INTERACTION END ### [ 159s] [ 159s] build34 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:30:08 UTC 2017. [ 159s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:31:17 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:31:17 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f52f7ad2bed_718e50ef7414107a6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/Debian_9.0/x86_64 Package network:osmocom:latest/osmo-msc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 132s] a_iface.c:39:37: fatal error: osmocom/sccp/sccp_types.h: No such file or directory [ 132s] #include [ 132s] ^ [ 132s] compilation terminated. [ 132s] Makefile:505: recipe for target 'a_iface.o' failed [ 132s] make[4]: *** [a_iface.o] Error 1 [ 132s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/libmsc' [ 132s] Makefile:422: recipe for target 'all-recursive' failed [ 132s] make[3]: *** [all-recursive] Error 1 [ 132s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 132s] Makefile:458: recipe for target 'all-recursive' failed [ 132s] make[2]: *** [all-recursive] Error 1 [ 132s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 132s] Makefile:390: recipe for target 'all' failed [ 132s] make[1]: *** [all] Error 2 [ 132s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 132s] dh_auto_build: make -j1 returned exit code 2 [ 132s] debian/rules:45: recipe for target 'build' failed [ 132s] make: *** [build] Error 2 [ 132s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 132s] [ 132s] cloud125 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:31:09 UTC 2017. [ 132s] [ 132s] ### VM INTERACTION START ### [ 135s] [ 112.228732] reboot: Power down [ 136s] ### VM INTERACTION END ### [ 136s] [ 136s] cloud125 failed "build osmo-msc_1.1.1.dsc" at Sun Oct 29 01:31:13 UTC 2017. [ 136s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:12:10 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:12:10 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f52b048e564_718e50ef74140501b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_16.04/i586 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 99s] #define HAVE_SYS_TYPES_H 1 [ 99s] #define HAVE_SYS_STAT_H 1 [ 99s] #define HAVE_STDLIB_H 1 [ 99s] #define HAVE_STRING_H 1 [ 99s] #define HAVE_MEMORY_H 1 [ 99s] #define HAVE_STRINGS_H 1 [ 99s] #define HAVE_INTTYPES_H 1 [ 99s] #define HAVE_STDINT_H 1 [ 99s] #define HAVE_UNISTD_H 1 [ 99s] #define HAVE_DLFCN_H 1 [ 99s] #define LT_OBJDIR ".libs/" [ 99s] [ 99s] configure: exit 1 [ 99s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 99s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 99s] make[1]: *** [override_dh_auto_configure] Error 255 [ 99s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 99s] debian/rules:45: recipe for target 'build' failed [ 99s] make: *** [build] Error 2 [ 99s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 99s] [ 99s] lamb69 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:12:02 UTC 2017. [ 99s] [ 99s] ### VM INTERACTION START ### [ 102s] [ 94.803391] reboot: Power down [ 102s] ### VM INTERACTION END ### [ 102s] [ 102s] lamb69 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:12:05 UTC 2017. [ 102s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:11:36 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:11:36 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f52acbd8f3a_718e50ef7414049be@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_17.10/x86_64 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 78s] #define HAVE_SYS_TYPES_H 1 [ 78s] #define HAVE_SYS_STAT_H 1 [ 78s] #define HAVE_STDLIB_H 1 [ 78s] #define HAVE_STRING_H 1 [ 78s] #define HAVE_MEMORY_H 1 [ 78s] #define HAVE_STRINGS_H 1 [ 78s] #define HAVE_INTTYPES_H 1 [ 78s] #define HAVE_STDINT_H 1 [ 78s] #define HAVE_UNISTD_H 1 [ 78s] #define HAVE_DLFCN_H 1 [ 78s] #define LT_OBJDIR ".libs/" [ 78s] [ 78s] configure: exit 1 [ 78s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 78s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 78s] make[1]: *** [override_dh_auto_configure] Error 2 [ 78s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 78s] debian/rules:45: recipe for target 'build' failed [ 78s] make: *** [build] Error 2 [ 79s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 79s] [ 79s] lamb28 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:11:24 UTC 2017. [ 79s] [ 79s] ### VM INTERACTION START ### [ 82s] [ 73.808301] reboot: Power down [ 82s] ### VM INTERACTION END ### [ 82s] [ 82s] lamb28 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:11:28 UTC 2017. [ 82s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:11:17 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:11:17 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f52acada170_718e50ef74140489a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/xUbuntu_16.10/i586 Package network:osmocom:latest/osmo-bsc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 75s] #define HAVE_SYS_TYPES_H 1 [ 75s] #define HAVE_SYS_STAT_H 1 [ 75s] #define HAVE_STDLIB_H 1 [ 75s] #define HAVE_STRING_H 1 [ 75s] #define HAVE_MEMORY_H 1 [ 75s] #define HAVE_STRINGS_H 1 [ 75s] #define HAVE_INTTYPES_H 1 [ 75s] #define HAVE_STDINT_H 1 [ 75s] #define HAVE_UNISTD_H 1 [ 75s] #define HAVE_DLFCN_H 1 [ 75s] #define LT_OBJDIR ".libs/" [ 75s] [ 75s] configure: exit 1 [ 75s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 75s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 75s] make[1]: *** [override_dh_auto_configure] Error 2 [ 75s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 75s] debian/rules:45: recipe for target 'build' failed [ 75s] make: *** [build] Error 2 [ 75s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 75s] [ 75s] lamb62 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:10:59 UTC 2017. [ 75s] [ 75s] ### VM INTERACTION START ### [ 77s] [ 70.659290] reboot: Power down [ 78s] ### VM INTERACTION END ### [ 78s] [ 78s] lamb62 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:11:03 UTC 2017. [ 78s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 01:10:26 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 01:10:26 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f52a92eeb5e_718e50ef7414043c3@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/Debian_8.0/i586 Package network:osmocom:latest/osmo-bsc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 85s] #define HAVE_SYS_STAT_H 1 [ 85s] #define HAVE_STDLIB_H 1 [ 85s] #define HAVE_STRING_H 1 [ 85s] #define HAVE_MEMORY_H 1 [ 85s] #define HAVE_STRINGS_H 1 [ 85s] #define HAVE_INTTYPES_H 1 [ 85s] #define HAVE_STDINT_H 1 [ 85s] #define HAVE_UNISTD_H 1 [ 85s] #define HAVE_DLFCN_H 1 [ 85s] #define LT_OBJDIR ".libs/" [ 85s] [ 85s] configure: exit 1 [ 85s] dh_auto_configure: ./configure --build=i586-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 85s] debian/rules:48: recipe for target 'override_dh_auto_configure' failed [ 85s] make[1]: *** [override_dh_auto_configure] Error 255 [ 85s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 85s] debian/rules:45: recipe for target 'build' failed [ 85s] make: *** [build] Error 2 [ 85s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 85s] [ 85s] lamb74 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:10:12 UTC 2017. [ 85s] [ 85s] ### VM INTERACTION START ### [ 86s] Powering off. [ 86s] [ 79.507894] reboot: Power down [ 86s] ### VM INTERACTION END ### [ 86s] [ 86s] lamb74 failed "build osmo-bsc_1.1.1.dsc" at Sun Oct 29 01:10:14 UTC 2017. [ 86s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sun Oct 29 03:51:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 29 Oct 2017 03:51:00 +0000 Subject: [PATCH] osmo-msc[master]: msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuilt Message-ID: Review at https://gerrit.osmocom.org/4551 msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuilt Before this, a code change in libvlr or libmsc would not cause a rebuild of the tests. Change-Id: Icbdedc1581fa23abe9ed99cef3918592b25f30b3 --- M tests/msc_vlr/Makefile.am 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/51/4551/1 diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 9af9870..07336ee 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -131,6 +131,13 @@ msc_vlr_tests.c \ $(NULL) +msc_vlr_test_*.o: \ + $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ + $(top_builddir)/src/libvlr/libvlr.a \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(NULL) + .PHONY: update_exp update_exp: $(builddir)/msc_vlr_test_no_authen >$(srcdir)/msc_vlr_test_no_authen.ok 2>$(srcdir)/msc_vlr_test_no_authen.err -- To view, visit https://gerrit.osmocom.org/4551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icbdedc1581fa23abe9ed99cef3918592b25f30b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 29 03:51:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 29 Oct 2017 03:51:02 +0000 Subject: [PATCH] osmo-msc[master]: cosmetic: vlr: rename auth_tuple_max_use_count to _reuse_ Message-ID: Review at https://gerrit.osmocom.org/4552 cosmetic: vlr: rename auth_tuple_max_use_count to _reuse_ The name auth_tuple_max_use_count suggests that if I want to use each auth tuple exactly once, I need to set it to 1. Curiously, so far you need to set to intended uses - 1. Reflect this in its name by renaming to auth_tuple_max_reuse_count. I first considered to not rename but change the if-conditions so that == 1 means each tuple is used once, and upon struct vlr allocation, set the default to 1. That would also logically entail that setting to 0 means to re-use vectors infinitely often, like now a value < 0 does. That means, when allocating a vlr struct zeroed out, we would by default have the most dangerous/unsafe configuration. It's no problem to set a default to 1 upon allocation, but by renaming the variable instead, we get safer alloc-zero behavior and don't need to change any conditionals in the code (even though the patch ends up considerably larger from all the renaming). Change-Id: I0b036cae1536d5d6fb2304f837ed1a6c3713be55 --- M include/osmocom/msc/vlr.h M src/libvlr/vlr_auth_fsm.c M tests/msc_vlr/msc_vlr_test_hlr_reject.c 3 files changed, 21 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/52/4552/1 diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h index e9afde3..d5306fa 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -222,7 +222,7 @@ bool retrieve_imeisv_ciphered; bool assign_tmsi; bool check_imei_rqd; - int auth_tuple_max_use_count; + int auth_tuple_max_reuse_count; bool auth_reuse_old_sets_on_error; bool parq_retrieve_imsi; bool is_ps; diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c index 1c9e191..f07e60f 100644 --- a/src/libvlr/vlr_auth_fsm.c +++ b/src/libvlr/vlr_auth_fsm.c @@ -59,7 +59,7 @@ bool is_utran; bool auth_requested; - int auth_tuple_max_use_count; /* see vlr->cfg instead */ + int auth_tuple_max_reuse_count; /* see vlr->cfg instead */ }; /*********************************************************************** @@ -69,13 +69,13 @@ /* Always use either vlr_subscr_get_auth_tuple() or vlr_subscr_has_auth_tuple() * instead, to ensure proper use count. * Return an auth tuple with the lowest use_count among the auth tuples. If - * max_use_count >= 0, return NULL if all available auth tuples have a use - * count > max_use_count. If max_use_count is negative, return a currently + * max_reuse_count >= 0, return NULL if all available auth tuples have a use + * count > max_reuse_count. If max_reuse_count is negative, return a currently * least used auth tuple without enforcing a maximum use count. If there are * no auth tuples, return NULL. */ static struct gsm_auth_tuple * -_vlr_subscr_next_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +_vlr_subscr_next_auth_tuple(struct vlr_subscr *vsub, int max_reuse_count) { unsigned int count; unsigned int idx; @@ -104,7 +104,7 @@ at = &vsub->auth_tuples[idx]; } - if (!at || (max_use_count >= 0 && at->use_count > max_use_count)) + if (!at || (max_reuse_count >= 0 && at->use_count > max_reuse_count)) return NULL; return at; @@ -112,21 +112,21 @@ /* Return an auth tuple and increment its use count. */ static struct gsm_auth_tuple * -vlr_subscr_get_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +vlr_subscr_get_auth_tuple(struct vlr_subscr *vsub, int max_reuse_count) { struct gsm_auth_tuple *at = _vlr_subscr_next_auth_tuple(vsub, - max_use_count); + max_reuse_count); if (!at) return NULL; at->use_count++; return at; } -/* Return whether an auth tuple with the given max_use_count is available. */ +/* Return whether an auth tuple with a matching use_count is available. */ static bool vlr_subscr_has_auth_tuple(struct vlr_subscr *vsub, - int max_use_count) + int max_reuse_count) { - return _vlr_subscr_next_auth_tuple(vsub, max_use_count) != NULL; + return _vlr_subscr_next_auth_tuple(vsub, max_reuse_count) != NULL; } static bool check_auth_resp(struct vlr_subscr *vsub, bool is_r99, @@ -250,7 +250,7 @@ struct gsm_auth_tuple *at; /* Caller ensures we have vectors available */ - at = vlr_subscr_get_auth_tuple(vsub, afp->auth_tuple_max_use_count); + at = vlr_subscr_get_auth_tuple(vsub, afp->auth_tuple_max_reuse_count); if (!at) { LOGPFSML(fi, LOGL_ERROR, "A previous check ensured that an" " auth tuple was available, but now there is in fact" @@ -284,12 +284,12 @@ OSMO_ASSERT(event == VLR_AUTH_E_START); - /* Start off with the default max_use_count, possibly change that if we + /* Start off with the default max_reuse_count, possibly change that if we * need to re-use an old tuple. */ - afp->auth_tuple_max_use_count = vsub->vlr->cfg.auth_tuple_max_use_count; + afp->auth_tuple_max_reuse_count = vsub->vlr->cfg.auth_tuple_max_reuse_count; /* Check if we have vectors available */ - if (!vlr_subscr_has_auth_tuple(vsub, afp->auth_tuple_max_use_count)) { + if (!vlr_subscr_has_auth_tuple(vsub, afp->auth_tuple_max_reuse_count)) { /* Obtain_Authentication_Sets_VLR */ vlr_subscr_req_sai(vsub, NULL, NULL); osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, @@ -323,9 +323,9 @@ || (event == VLR_AUTH_E_HLR_SAI_ABORT)) { if (vsub->vlr->cfg.auth_reuse_old_sets_on_error && vlr_subscr_has_auth_tuple(vsub, -1)) { - /* To re-use an old tuple, disable the max_use_count + /* To re-use an old tuple, disable the max_reuse_count * constraint. */ - afp->auth_tuple_max_use_count = -1; + afp->auth_tuple_max_reuse_count = -1; goto pass; } /* result = procedure error */ diff --git a/tests/msc_vlr/msc_vlr_test_hlr_reject.c b/tests/msc_vlr/msc_vlr_test_hlr_reject.c index 095da81..6cf4afc 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_reject.c +++ b/tests/msc_vlr/msc_vlr_test_hlr_reject.c @@ -84,7 +84,7 @@ net->authentication_required = true; net->vlr->cfg.auth_reuse_old_sets_on_error = false; - net->vlr->cfg.auth_tuple_max_use_count = 0; + net->vlr->cfg.auth_tuple_max_reuse_count = 0; BTW("Submit a used auth tuple in the VLR"); btw("Location Update request causes a GSUP Send Auth Info request to HLR"); @@ -171,7 +171,7 @@ net->authentication_required = true; net->vlr->cfg.auth_reuse_old_sets_on_error = true; - net->vlr->cfg.auth_tuple_max_use_count = 0; + net->vlr->cfg.auth_tuple_max_reuse_count = 0; BTW("Submit a used auth tuple in the VLR"); btw("Location Update request causes a GSUP Send Auth Info request to HLR"); @@ -256,7 +256,7 @@ net->authentication_required = true; net->vlr->cfg.auth_reuse_old_sets_on_error = true; - net->vlr->cfg.auth_tuple_max_use_count = 0; + net->vlr->cfg.auth_tuple_max_reuse_count = 0; btw("Location Update request causes a GSUP Send Auth Info request to HLR"); lu_result_sent = RES_NONE; @@ -291,7 +291,7 @@ net->authentication_required = true; net->vlr->cfg.auth_reuse_old_sets_on_error = true; - net->vlr->cfg.auth_tuple_max_use_count = 0; + net->vlr->cfg.auth_tuple_max_reuse_count = 0; BTW("Submit a used auth tuple in the VLR"); btw("Location Update request causes a GSUP Send Auth Info request to HLR"); -- To view, visit https://gerrit.osmocom.org/4552 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0b036cae1536d5d6fb2304f837ed1a6c3713be55 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 29 03:51:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 29 Oct 2017 03:51:02 +0000 Subject: [PATCH] osmo-msc[master]: tests: add msc_vlr_test_authen_reuse Message-ID: Review at https://gerrit.osmocom.org/4553 tests: add msc_vlr_test_authen_reuse Change-Id: I185a2cbff6241a27722f1c37ae609f0fcc59a71e --- M tests/msc_vlr/Makefile.am A tests/msc_vlr/msc_vlr_test_authen_reuse.c A tests/msc_vlr/msc_vlr_test_authen_reuse.err A tests/msc_vlr/msc_vlr_test_authen_reuse.ok M tests/msc_vlr/msc_vlr_tests.c M tests/testsuite.at 6 files changed, 2,962 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/53/4553/1 diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 07336ee..11a2d15 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -62,6 +62,8 @@ msc_vlr_test_gsm_ciph.err \ msc_vlr_test_umts_authen.ok \ msc_vlr_test_umts_authen.err \ + msc_vlr_test_authen_reuse.ok \ + msc_vlr_test_authen_reuse.err \ msc_vlr_test_hlr_reject.ok \ msc_vlr_test_hlr_reject.err \ msc_vlr_test_hlr_timeout.ok \ @@ -79,6 +81,7 @@ msc_vlr_test_gsm_authen \ msc_vlr_test_gsm_ciph \ msc_vlr_test_umts_authen \ + msc_vlr_test_authen_reuse \ msc_vlr_test_hlr_reject \ msc_vlr_test_hlr_timeout \ msc_vlr_test_ms_timeout \ @@ -103,6 +106,11 @@ msc_vlr_test_umts_authen_SOURCES = \ msc_vlr_test_umts_authen.c \ + msc_vlr_tests.c \ + $(NULL) + +msc_vlr_test_authen_reuse_SOURCES = \ + msc_vlr_test_authen_reuse.c \ msc_vlr_tests.c \ $(NULL) @@ -144,6 +152,7 @@ $(builddir)/msc_vlr_test_gsm_authen >$(srcdir)/msc_vlr_test_gsm_authen.ok 2>$(srcdir)/msc_vlr_test_gsm_authen.err $(builddir)/msc_vlr_test_gsm_ciph >$(srcdir)/msc_vlr_test_gsm_ciph.ok 2>$(srcdir)/msc_vlr_test_gsm_ciph.err $(builddir)/msc_vlr_test_umts_authen >$(srcdir)/msc_vlr_test_umts_authen.ok 2>$(srcdir)/msc_vlr_test_umts_authen.err + $(builddir)/msc_vlr_test_authen_reuse >$(srcdir)/msc_vlr_test_authen_reuse.ok 2>$(srcdir)/msc_vlr_test_authen_reuse.err $(builddir)/msc_vlr_test_hlr_reject >$(srcdir)/msc_vlr_test_hlr_reject.ok 2>$(srcdir)/msc_vlr_test_hlr_reject.err $(builddir)/msc_vlr_test_hlr_timeout >$(srcdir)/msc_vlr_test_hlr_timeout.ok 2>$(srcdir)/msc_vlr_test_hlr_timeout.err $(builddir)/msc_vlr_test_ms_timeout >$(srcdir)/msc_vlr_test_ms_timeout.ok 2>$(srcdir)/msc_vlr_test_ms_timeout.err diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.c b/tests/msc_vlr/msc_vlr_test_authen_reuse.c new file mode 100644 index 0000000..103c904 --- /dev/null +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.c @@ -0,0 +1,337 @@ +/* Osmocom MSC+VLR end-to-end tests */ + +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +/* NOTE that further auth re-use tests exist in msc_vlr_test_hlr_reject.c */ + +#include "msc_vlr_tests.h" + +#define ASSERT_RELEASE_CLEAR(via_ran) \ + switch (via_ran) { \ + case RAN_GERAN_A: \ + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); \ + break; \ + case RAN_UTRAN_IU: \ + VERBOSE_ASSERT(iu_release_sent, == true, "%d"); \ + break; \ + default: \ + OSMO_ASSERT(false); \ + break; \ + } + +void _test_auth_reuse(enum ran_type via_ran, + int set_max_reuse_count, + int loop_requests_without_hlr, + bool final_request_with_hlr) +{ + struct vlr_subscr *vsub; + const char *imsi = "901700000010650"; + int expected_use_count; + int i; + + net->authentication_required = true; + net->vlr->cfg.assign_tmsi = true; + net->vlr->cfg.auth_tuple_max_reuse_count = set_max_reuse_count; + net->vlr->cfg.auth_reuse_old_sets_on_error = false; + rx_from_ran = via_ran; + + btw("Location Update request causes a GSUP Send Auth Info request to HLR"); + lu_result_sent = RES_NONE; + gsup_expect_tx("080108" "09710000000156f0"); + ms_sends_msg("0508" /* MM LU */ + "7" /* ciph key seq: no key available */ + "0" /* LU type: normal */ + "ffffff" "0000" /* LAI, LAC */ + "57" /* classmark 1: R99, early classmark, no power lvl */ + "089910070000106005" /* IMSI */ + "3303575886" /* classmark 2 */ + ); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS"); + /* based on auc_3g: + * K = 'EB215756028D60E3275E613320AEC880', + * OPC = 'FB2A3D1B360F599ABAB99DB8669F8308' + * SQN = 0 + */ + auth_request_sent = false; + auth_request_expect_rand = "39fa2f4e3d523d8619a73b4f65c3e14d"; + auth_request_expect_autn = "8704f5ba55f30000d2ee44b22c8ea919"; + gsup_rx("0a" + /* imsi */ + "0108" "09710000000156f0" + /* TL TL rand */ + "0362" "2010" "39fa2f4e3d523d8619a73b4f65c3e14d" + /* TL sres TL kc */ + "2104" "9b36efdf" "2208" "059a4f668f6fbe39" + /* TL 3G IK */ + "2310" "27497388b6cb044648f396aa155b95ef" + /* TL 3G CK */ + "2410" "f64735036e5871319c679f4742a75ea1" + /* TL AUTN */ + "2510" "8704f5ba55f30000d2ee44b22c8ea919" + /* TL RES */ + "2708" "e229c19e791f2e41", + NULL); + VERBOSE_ASSERT(auth_request_sent, == true, "%d"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + if (via_ran == RAN_GERAN_A) { + btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR"); + gsup_expect_tx("04010809710000000156f0"); + ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); + VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + } else { + /* On UTRAN */ + btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); + cipher_mode_cmd_sent = false; + ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); + VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR"); + gsup_expect_tx("04010809710000000156f0"); + ms_sends_security_mode_complete(); + VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + } + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000000156f00804032443f2", + "12010809710000000156f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); + gsup_rx("06010809710000000156f0", NULL); + + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + + btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); + EXPECT_CONN_COUNT(1); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("even though the TMSI is not acked, we can already find the subscr with it"); + vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100); + VERBOSE_ASSERT(vsub != NULL, == true, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d"); + VERBOSE_ASSERT(vsub->tmsi_new, == 0x03020100, "0x%08x"); + VERBOSE_ASSERT(vsub->tmsi, == GSM_RESERVED_TMSI, "0x%08x"); + vlr_subscr_put(vsub); + + btw("MS sends TMSI Realloc Complete"); + expect_release_clear(via_ran); + ms_sends_msg("055b"); + ASSERT_RELEASE_CLEAR(via_ran); + + btw("LU was successful, and the conn has already been closed"); + EXPECT_CONN_COUNT(0); + + expected_use_count = 1; + + for (i = 0; i < loop_requests_without_hlr; i++, expected_use_count++) { + BTW("Now the auth tuple has use_count == %d", expected_use_count); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + OSMO_ASSERT(vsub->last_tuple); + VERBOSE_ASSERT(vsub->last_tuple->use_count, == expected_use_count, "%d"); + vlr_subscr_put(vsub); + + BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req," + " and reuses old auth vector"); + auth_request_sent = true; + cm_service_result_sent = RES_NONE; + ms_sends_msg("052478" + "03575886" /* classmark 2 */ + "089910070000106005" /* IMSI */); + OSMO_ASSERT(g_conn); + OSMO_ASSERT(g_conn->conn_fsm); + OSMO_ASSERT(g_conn->vsub); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + VERBOSE_ASSERT(auth_request_sent, == true, "%d"); + + if (via_ran == RAN_GERAN_A) { + btw("MS sends Authen Response, VLR accepts with a CM Service Accept"); + gsup_expect_tx(NULL); + ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); + VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); + } else { + /* On UTRAN */ + btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); + cipher_mode_cmd_sent = false; + ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); + VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d"); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + + btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept"); + ms_sends_security_mode_complete(); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + } + + btw("a USSD request is serviced"); + dtap_expect_tx_ussd("Your extension is 42342\r"); + expect_release_clear(via_ran); + ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); + OSMO_ASSERT(dtap_tx_confirmed); + ASSERT_RELEASE_CLEAR(via_ran); + + btw("all requests serviced, conn has been released"); + EXPECT_CONN_COUNT(0); + } + + if (final_request_with_hlr) { + BTW("Now the auth tuple has use_count == %d, as much as is allowed.", expected_use_count); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + OSMO_ASSERT(vsub->last_tuple); + VERBOSE_ASSERT(vsub->last_tuple->use_count, == expected_use_count, "%d"); + vlr_subscr_put(vsub); + + BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req," + " and needs to request a second auth vector from HLR"); + auth_request_sent = false; + cm_service_result_sent = RES_NONE; + gsup_expect_tx("080108" "09710000000156f0"); + ms_sends_msg("052478" + "03575886" /* classmark 2 */ + "089910070000106005" /* IMSI */); + OSMO_ASSERT(g_conn); + OSMO_ASSERT(g_conn->conn_fsm); + OSMO_ASSERT(g_conn->vsub); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + VERBOSE_ASSERT(auth_request_sent, == false, "%d"); + VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); + + btw("from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS"); + auth_request_expect_rand = "c187a53a5e6b9d573cac7c74451fd46d"; + auth_request_expect_autn = "1843a645b98d00005b2d666af46c45d9"; + gsup_rx("0a" + /* imsi */ + "0108" "09710000000156f0" + /* TL TL rand */ + /* TL sres TL kc */ + /* TL 3G IK */ + /* TL 3G CK */ + /* TL AUTN */ + /* TL RES */ + "0362" "2010" "c187a53a5e6b9d573cac7c74451fd46d" + "2104" "85aa3130" "2208" "d3d50a000bf04f6e" + "2310" "1159ec926a50e98c034a6b7d7c9f418d" + "2410" "df3a03d9ca5335641efc8e36d76cd20b" + "2510" "1843a645b98d00005b2d666af46c45d9" + "2708" "7db47cf7f81e4dc7", + NULL); + VERBOSE_ASSERT(auth_request_sent, == true, "%d"); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + + if (via_ran == RAN_GERAN_A) { + btw("MS sends Authen Response, VLR accepts with a CM Service Accept"); + gsup_expect_tx(NULL); + ms_sends_msg("0554" "7db47cf7" "2104" "f81e4dc7"); /* 2nd vector's res, s.a. */ + VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); + } else { + /* On UTRAN */ + btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); + cipher_mode_cmd_sent = false; + ms_sends_msg("0554" "7db47cf7" "2104" "f81e4dc7"); /* 2nd vector's res, s.a. */ + VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d"); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + + btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept"); + ms_sends_security_mode_complete(); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + } + + btw("a USSD request is serviced"); + dtap_expect_tx_ussd("Your extension is 42342\r"); + expect_release_clear(via_ran); + ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); + OSMO_ASSERT(dtap_tx_confirmed); + ASSERT_RELEASE_CLEAR(via_ran); + + btw("all requests serviced, conn has been released"); + EXPECT_CONN_COUNT(0); + } + + BTW("subscriber detaches"); + expect_release_clear(via_ran); + ms_sends_msg("050130" + "089910070000106005" /* IMSI */); + ASSERT_RELEASE_CLEAR(via_ran); + + EXPECT_CONN_COUNT(0); + clear_vlr(); +} + +void test_auth_use_twice_geran() +{ + comment_start(); + _test_auth_reuse(RAN_GERAN_A, 1, 1, true); + comment_end(); +} + +void test_auth_use_twice_utran() +{ + comment_start(); + _test_auth_reuse(RAN_UTRAN_IU, 1, 1, true); + comment_end(); +} + +void test_auth_use_infinitely_geran() +{ + comment_start(); + _test_auth_reuse(RAN_GERAN_A, -1, 3, false); + comment_end(); +} + +void test_auth_use_infinitely_utran() +{ + comment_start(); + _test_auth_reuse(RAN_UTRAN_IU, -1, 3, false); + comment_end(); +} + +void test_no_auth_reuse_geran() +{ + comment_start(); + _test_auth_reuse(RAN_GERAN_A, 0, 0, true); + comment_end(); +} + +void test_no_auth_reuse_utran() +{ + comment_start(); + _test_auth_reuse(RAN_UTRAN_IU, 0, 0, true); + comment_end(); +} + +msc_vlr_test_func_t msc_vlr_tests[] = { + test_auth_use_twice_geran, + test_auth_use_twice_utran, + test_auth_use_infinitely_geran, + test_auth_use_infinitely_utran, + test_no_auth_reuse_geran, + test_no_auth_reuse_utran, + NULL +}; diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err b/tests/msc_vlr/msc_vlr_test_authen_reuse.err new file mode 100644 index 0000000..3ceecf3 --- /dev/null +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err @@ -0,0 +1,2606 @@ +===== test_auth_use_twice_geran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=GERAN Auth (no Ciph) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=2 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=2 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 2, as much as is allowed. +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 2 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and needs to request a second auth vector from HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 0 + gsup_tx_confirmed == 1 +- from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DVLR GSUP rx 111: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(MSISDN:42342) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=c187a53a5e6b9d573cac7c74451fd46d +- ...autn=1843a645b98d00005b2d666af46c45d9 +- ...expecting res=7db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + cm_service_result_sent == 0 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_auth_use_twice_geran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_auth_use_twice_utran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=UTRAN Auth+Ciph +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +- sending SecurityModeControl for IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + lu_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR +DMM <- SECURITY MODE COMPLETE IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() +DIUCS IMSI:901700000010650: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=2 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=2 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 2, as much as is allowed. +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 2 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and needs to request a second auth vector from HLR + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 0 + gsup_tx_confirmed == 1 +- from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DVLR GSUP rx 111: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(MSISDN:42342) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=c187a53a5e6b9d573cac7c74451fd46d +- ...autn=1843a645b98d00005b2d666af46c45d9 +- ...expecting res=7db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + cm_service_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + iu_release_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_auth_use_twice_utran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_auth_use_infinitely_geran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=GERAN Auth (no Ciph) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=2 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=2 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 2 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 2 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=3 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=3 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 3 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 3 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=4 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=4 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_auth_use_infinitely_geran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_auth_use_infinitely_utran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=UTRAN Auth+Ciph +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +- sending SecurityModeControl for IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + lu_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR +DMM <- SECURITY MODE COMPLETE IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() +DIUCS IMSI:901700000010650: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=2 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=2 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 2 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 2 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=3 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=3 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 3 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 3 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=4 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=4 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + iu_release_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_auth_use_infinitely_utran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_no_auth_reuse_geran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=GERAN Auth (no Ciph) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1, as much as is allowed. +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and needs to request a second auth vector from HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 0 + gsup_tx_confirmed == 1 +- from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DVLR GSUP rx 111: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(MSISDN:42342) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=c187a53a5e6b9d573cac7c74451fd46d +- ...autn=1843a645b98d00005b2d666af46c45d9 +- ...expecting res=7db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + cm_service_result_sent == 0 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_auth_reuse_geran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_no_auth_reuse_utran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=UTRAN Auth+Ciph +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +- sending SecurityModeControl for IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + lu_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR +DMM <- SECURITY MODE COMPLETE IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() +DIUCS IMSI:901700000010650: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1, as much as is allowed. +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and needs to request a second auth vector from HLR + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 0 + gsup_tx_confirmed == 1 +- from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DVLR GSUP rx 111: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(MSISDN:42342) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=c187a53a5e6b9d573cac7c74451fd46d +- ...autn=1843a645b98d00005b2d666af46c45d9 +- ...expecting res=7db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + cm_service_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + iu_release_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_auth_reuse_utran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.ok b/tests/msc_vlr/msc_vlr_test_authen_reuse.ok new file mode 100644 index 0000000..a965a70 --- /dev/null +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.ok @@ -0,0 +1 @@ +Done diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index f9dc278..7b1db1b 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -334,6 +334,8 @@ net->vlr->cfg.assign_tmsi = false; net->vlr->cfg.retrieve_imeisv_early = false; net->vlr->cfg.retrieve_imeisv_ciphered = false; + net->vlr->cfg.auth_tuple_max_reuse_count = 0; + net->vlr->cfg.auth_reuse_old_sets_on_error = false; rx_from_ran = RAN_GERAN_A; auth_request_sent = false; diff --git a/tests/testsuite.at b/tests/testsuite.at index e3e9017..f0147e7 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -44,6 +44,13 @@ AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_umts_authen], [], [expout], [experr]) AT_CLEANUP +AT_SETUP([msc_vlr_test_authen_reuse]) +AT_KEYWORDS([msc_vlr_test_authen_reuse]) +cat $abs_srcdir/msc_vlr/msc_vlr_test_authen_reuse.ok > expout +cat $abs_srcdir/msc_vlr/msc_vlr_test_authen_reuse.err > experr +AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_authen_reuse], [], [expout], [experr]) +AT_CLEANUP + AT_SETUP([msc_vlr_test_hlr_reject]) AT_KEYWORDS([msc_vlr_test_hlr_reject]) cat $abs_srcdir/msc_vlr/msc_vlr_test_hlr_reject.ok > expout -- To view, visit https://gerrit.osmocom.org/4553 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I185a2cbff6241a27722f1c37ae609f0fcc59a71e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 29 03:51:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 29 Oct 2017 03:51:02 +0000 Subject: [PATCH] osmo-msc[master]: vty: make auth tuple reuse configurable Message-ID: Review at https://gerrit.osmocom.org/4554 vty: make auth tuple reuse configurable Change-Id: Iba6253d9bf8d4a9d9f6f26ba045e6c7f0dc7f8f2 --- M doc/examples/osmo-msc/osmo-msc.cfg M src/libmsc/msc_vty.c 2 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/54/4554/1 diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg index 1b1d192..fff964b 100644 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ b/doc/examples/osmo-msc/osmo-msc.cfg @@ -17,3 +17,5 @@ msc mgcpgw remote-ip 10.23.24.1 assign-tmsi + auth-tuple-max-reuse-count 3 + auth-tuple-reuse-on-error 1 diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 5c9539d..c19666f 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -88,6 +88,27 @@ return CMD_SUCCESS; } +DEFUN(cfg_msc_auth_tuple_max_reuse_count, cfg_msc_auth_tuple_max_reuse_count_cmd, + "auth-tuple-max-reuse-count <-1-2147483647>", + "Configure authentication tuple re-use\n" + "0 to use each auth tuple at most once (default), >0 to limit re-use, -1 to re-use infinitely (vulnerable!).\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + gsmnet->vlr->cfg.auth_tuple_max_reuse_count = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_msc_auth_tuple_reuse_on_error, cfg_msc_auth_tuple_reuse_on_error_cmd, + "auth-tuple-reuse-on-error (0|1)", + "Configure authentication tuple re-use when HLR is not responsive\n" + "0 = never re-use auth tuples beyond auth-tuple-max-reuse-count (default)\n" + "1 = if the HLR does not deliver new tuples, do re-use already available old ones.\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + gsmnet->vlr->cfg.auth_reuse_old_sets_on_error = atoi(argv[0]) ? true : false; + return CMD_SUCCESS; +} + static int config_write_msc(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); @@ -100,6 +121,14 @@ VTY_NEWLINE); vty_out(vty, " cs7-instance-iu %u%s", gsmnet->iu.cs7_instance, VTY_NEWLINE); + + if (gsmnet->vlr->cfg.auth_tuple_max_reuse_count) + vty_out(vty, " auth-tuple-max-reuse-count %d%s", + OSMO_MAX(-1, gsmnet->vlr->cfg.auth_tuple_max_reuse_count), + VTY_NEWLINE); + if (gsmnet->vlr->cfg.auth_reuse_old_sets_on_error) + vty_out(vty, " auth-tuple-reuse-on-error 1%s", + VTY_NEWLINE); mgcp_client_config_write(vty, " "); #ifdef BUILD_IU @@ -152,6 +181,8 @@ vty_install_default(MSC_NODE); install_element(MSC_NODE, &cfg_msc_assign_tmsi_cmd); install_element(MSC_NODE, &cfg_msc_no_assign_tmsi_cmd); + install_element(MSC_NODE, &cfg_msc_auth_tuple_max_reuse_count_cmd); + install_element(MSC_NODE, &cfg_msc_auth_tuple_reuse_on_error_cmd); install_element(MSC_NODE, &cfg_msc_cs7_instance_a_cmd); install_element(MSC_NODE, &cfg_msc_cs7_instance_iu_cmd); -- To view, visit https://gerrit.osmocom.org/4554 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba6253d9bf8d4a9d9f6f26ba045e6c7f0dc7f8f2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 29 03:51:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 29 Oct 2017 03:51:03 +0000 Subject: [PATCH] osmo-msc[master]: vty: drop deprecated 'logging level sms...' Message-ID: Review at https://gerrit.osmocom.org/4555 vty: drop deprecated 'logging level sms...' No need to drag legacy VTY from osmo-nitb to osmo-msc. Change-Id: I38ba8b9414de383bf497526d97bf7a039e41fd35 --- M src/libmsc/vty_interface_layer3.c 1 file changed, 0 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/55/4555/1 diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index b6e3ded..edc698d 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -819,20 +819,6 @@ return CMD_SUCCESS; } -#define OBSOLETE_MSG "Obsolete\n" -/* this is just for backwards compatibility as the sms code moved into - * libosmocore and old config files no longer parse... */ -DEFUN_DEPRECATED(log_level_sms, log_level_sms_cmd, - "logging level sms (everything|debug|info|notice|error|fatal)", - ".HIDDEN\n" OBSOLETE_MSG OBSOLETE_MSG OBSOLETE_MSG OBSOLETE_MSG - OBSOLETE_MSG OBSOLETE_MSG OBSOLETE_MSG OBSOLETE_MSG) -{ - vty_out(vty, "%% 'logging level sms' is now called 'logging level " - "lsms', please update your config %s", VTY_NEWLINE); - - return CMD_SUCCESS; -} - #define MEAS_STR "Measurement export related\n" DEFUN(mnccint_meas_feed, mnccint_meas_feed_cmd, "meas-feed destination ADDR <0-65535>", @@ -966,7 +952,6 @@ install_element(MNCC_INT_NODE, &mnccint_meas_feed_cmd); install_element(MNCC_INT_NODE, &meas_feed_scenario_cmd); - install_element(CFG_LOG_NODE, &log_level_sms_cmd); install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); install_element(CONFIG_NODE, &cfg_hlr_cmd); -- To view, visit https://gerrit.osmocom.org/4555 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38ba8b9414de383bf497526d97bf7a039e41fd35 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 29 03:51:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 29 Oct 2017 03:51:03 +0000 Subject: [PATCH] osmo-msc[master]: defaults: assign TMSI by default Message-ID: Review at https://gerrit.osmocom.org/4556 defaults: assign TMSI by default When using ciphering, the TMSI is an important part of the ciphering. To guard against users forgetting to set 'assign tmsi' in the config and compromising their ciphering unknowingly, the default should be to use a TMSI. To optimize in an unencrypted network, 'no assign tmsi' config can still switch off TMSI use. Change-Id: If115e95bebc314bedb50faf3993b52071fee5c1e --- M src/libvlr/vlr.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/56/4556/1 diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index adfe258..07c31ee 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -995,6 +995,9 @@ INIT_LLIST_HEAD(&vlr->operations); memcpy(&vlr->ops, ops, sizeof(vlr->ops)); + /* defaults */ + vlr->cfg.assign_tmsi = true; + /* osmo_auth_fsm.c */ osmo_fsm_register(&vlr_auth_fsm); /* osmo_lu_fsm.c */ -- To view, visit https://gerrit.osmocom.org/4556 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If115e95bebc314bedb50faf3993b52071fee5c1e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Oct 29 04:00:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 29 Oct 2017 04:00:41 +0000 Subject: osmo-hlr[master]: add osmo-hlr-db-tool, program to migrate from osmo-nitb db In-Reply-To: References: Message-ID: Patch Set 2: (5 comments) Thanks for hijacking, I guess, but I still found these: https://gerrit.osmocom.org/#/c/4441/2/src/hlr_db_tool.c File src/hlr_db_tool.c: Line 54: printf("Usage: osmo-hlr-db-tool [-l ] import-nitb-db ]\n"); one opening '[' missing; or a ']' too many, depending. Line 55: printf("Call without arguments to create a new empty ./hlr.db.\n"); ^ This is no longer accurate. Line 138: exit(EXIT_FAILURE); would re-enable implicit bootstrap by 'return' here, instead of exit() Line 142: printf("command '%s', %d extra arguments\n", cmd, argc - optind); debug leftover? Line 390: /* Future: add more main_actions, besides --import-nitb-db, here. */ (drop '--') -- To view, visit https://gerrit.osmocom.org/4441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 29 04:15:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 29 Oct 2017 04:15:15 +0000 Subject: osmo-mgw[master]: sdp: refactoring sdp parser/generator In-Reply-To: References: Message-ID: Patch Set 14: Code-Review-1 (5 comments) (introducing new comment markings -- '-1:' are the blockers, '?:' aren't important...) https://gerrit.osmocom.org/#/c/4006/14/src/libosmo-mgcp/mgcp_sdp.c File src/libosmo-mgcp/mgcp_sdp.c: Line 147: static void codecs_update(void *ctx, struct sdp_rtp_map *codecs, int used, ?: const struct ... codecs Line 197: * \param[out] conn associated rtp connection. -1: oh, conn is also an output param? if yes, explain what is returned in conn Line 335: * \returns 0 on success, -1 on failure. */ -1: this returns doc is not accurate, you're returning the len. Why though? the msgb is good in keeping its size. Line 350: ?: add /* FIXME: constify endp and conn args in get_net_donwlink_format_cb() */ and best follow up with a separate patch now. Line 366: len += rc; ?: I guess we can skip counting the len and just return 0 below..... -- To view, visit https://gerrit.osmocom.org/4006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324 Gerrit-PatchSet: 14 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 29 07:50:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 07:50:32 +0000 Subject: [PATCH] osmo-msc[master]: Depend on both libosmo-sigtran-dev and libosmo-sccp-dev Message-ID: Review at https://gerrit.osmocom.org/4557 Depend on both libosmo-sigtran-dev and libosmo-sccp-dev libmsc/a_iface.c and libmsc/a_iface_bssap.c still include osmocom/sccp/sccp_types.h to get access to enums defining SCCP cause values. Until that is resolved, we have to keep the build dependency to libosmo-sccp-dev Change-Id: I957dcb2bcce216d0fd81a58bfe869aca0e4624a8 Related: OS#2601 --- M configure.ac M debian/control M src/libmsc/Makefile.am 3 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/57/4557/1 diff --git a/configure.ac b/configure.ac index 86bb870..601b438 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,7 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0) +PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp) PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.1.0) diff --git a/debian/control b/debian/control index c017e16..12d8364 100644 --- a/debian/control +++ b/debian/control @@ -15,6 +15,7 @@ libsmpp34-dev, libasn1c-dev, libosmocore-dev, + libosmo-sccp-dev, libosmo-sigtran-dev, libosmo-abis-dev, libosmo-mgcp-client-dev, diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index c9b8bb4..fee9f44 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -14,6 +14,7 @@ $(LIBSMPP34_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOSCCP_CFLAGS) \ $(NULL) noinst_HEADERS = \ -- To view, visit https://gerrit.osmocom.org/4557 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I957dcb2bcce216d0fd81a58bfe869aca0e4624a8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 07:50:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 07:50:35 +0000 Subject: [PATCH] osmo-msc[master]: Debian: require minimum versions of packages we depend on Message-ID: Review at https://gerrit.osmocom.org/4558 Debian: require minimum versions of packages we depend on I'm using the dame version as in configure.ac to avoid build failures against older versions of certain packages, such as older libsmpp34. Change-Id: I83c617fa4e83e2e3d2613e454f517d6031814f21 --- M debian/control 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/58/4558/1 diff --git a/debian/control b/debian/control index 12d8364..60d468e 100644 --- a/debian/control +++ b/debian/control @@ -11,16 +11,16 @@ pkg-config, libdbi-dev, libtalloc-dev, - libssl-dev, - libsmpp34-dev, - libasn1c-dev, - libosmocore-dev, + libssl-dev (>= 0.9.5), + libsmpp34-dev (>= 1.12), + libasn1c-dev (>= 0.9.28), + libosmocore-dev (>= 0.10.0), libosmo-sccp-dev, - libosmo-sigtran-dev, + libosmo-sigtran-dev (>= 0.8.0), libosmo-abis-dev, - libosmo-mgcp-client-dev, - libosmo-netif-dev, - libosmo-ranap-dev + libosmo-mgcp-client-dev (>= 1.1.0), + libosmo-netif-dev (>= 0.1.0), + libosmo-ranap-dev (>= 0.2.0) Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/osmo-msc.git Vcs-Browser: https://git.osmocom.org/osmo-msc/ -- To view, visit https://gerrit.osmocom.org/4558 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83c617fa4e83e2e3d2613e454f517d6031814f21 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 07:55:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 07:55:06 +0000 Subject: [PATCH] osmo-bsc[master]: debian/control: Specify versions of packages we depend upon Message-ID: Review at https://gerrit.osmocom.org/4559 debian/control: Specify versions of packages we depend upon Change-Id: Ide71f5029b14293ceda56ea5da715cd91a00c70f --- M debian/control 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/59/4559/1 diff --git a/debian/control b/debian/control index 575c6bb..e4a5b1f 100644 --- a/debian/control +++ b/debian/control @@ -10,14 +10,14 @@ libtool, pkg-config, python-minimal, - libssl-dev, + libssl-dev (>= 0.9.5), libtalloc-dev, - libosmocore-dev, - libosmo-sccp-dev, - libosmo-sigtran-dev, - libosmo-abis-dev, - libosmo-netif-dev, - libosmo-legacy-mgcp-dev + libosmocore-dev (>= 0.10.0), + libosmo-sccp-dev (>= 0.0.2), + libosmo-sigtran-dev (>= 0.8.0), + libosmo-abis-dev (>= 0.3.2), + libosmo-netif-dev (>= 0.1.0), + libosmo-legacy-mgcp-dev (>= 0.0.1) Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/osmo-bsc.git Vcs-Browser: https://git.osmocom.org/osmo-bsc/ -- To view, visit https://gerrit.osmocom.org/4559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide71f5029b14293ceda56ea5da715cd91a00c70f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 07:56:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 07:56:08 +0000 Subject: osmo-ci[master]: Add JJB YML for Osmocom_OBS_latest In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4550 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59a901727e35a35ba0fe73c09accb0bd1fa6b7ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 07:57:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 07:57:59 +0000 Subject: osmo-msc[master]: msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuilt In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4551/1/tests/msc_vlr/Makefile.am File tests/msc_vlr/Makefile.am: Line 135: $(top_builddir)/src/libmsc/libmsc.a \ shouldn't dis work automatically? Would it work if we had those libraries in LDADD rather than LDFLAGS above? -- To view, visit https://gerrit.osmocom.org/4551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbdedc1581fa23abe9ed99cef3918592b25f30b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Oct 29 07:59:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 07:59:02 +0000 Subject: osmo-msc[master]: cosmetic: vlr: rename auth_tuple_max_use_count to _reuse_ In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4552 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0b036cae1536d5d6fb2304f837ed1a6c3713be55 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 07:59:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 07:59:17 +0000 Subject: osmo-msc[master]: tests: add msc_vlr_test_authen_reuse In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4553 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I185a2cbff6241a27722f1c37ae609f0fcc59a71e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 07:59:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 07:59:28 +0000 Subject: osmo-msc[master]: vty: make auth tuple reuse configurable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4554 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba6253d9bf8d4a9d9f6f26ba045e6c7f0dc7f8f2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 07:59:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 07:59:42 +0000 Subject: osmo-msc[master]: vty: drop deprecated 'logging level sms...' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4555 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38ba8b9414de383bf497526d97bf7a039e41fd35 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:00:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:00:06 +0000 Subject: osmo-msc[master]: defaults: assign TMSI by default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4556 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If115e95bebc314bedb50faf3993b52071fee5c1e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:00:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:00:30 +0000 Subject: osmo-msc[master]: Debian: require minimum versions of packages we depend on In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4558 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I83c617fa4e83e2e3d2613e454f517d6031814f21 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:00:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:00:33 +0000 Subject: osmo-msc[master]: Depend on both libosmo-sigtran-dev and libosmo-sccp-dev In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4557 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I957dcb2bcce216d0fd81a58bfe869aca0e4624a8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:00:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:00:36 +0000 Subject: [MERGED] osmo-msc[master]: Depend on both libosmo-sigtran-dev and libosmo-sccp-dev In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Depend on both libosmo-sigtran-dev and libosmo-sccp-dev ...................................................................... Depend on both libosmo-sigtran-dev and libosmo-sccp-dev libmsc/a_iface.c and libmsc/a_iface_bssap.c still include osmocom/sccp/sccp_types.h to get access to enums defining SCCP cause values. Until that is resolved, we have to keep the build dependency to libosmo-sccp-dev Change-Id: I957dcb2bcce216d0fd81a58bfe869aca0e4624a8 Related: OS#2601 --- M configure.ac M debian/control M src/libmsc/Makefile.am 3 files changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 86bb870..601b438 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,7 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0) +PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp) PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.1.0) diff --git a/debian/control b/debian/control index c017e16..12d8364 100644 --- a/debian/control +++ b/debian/control @@ -15,6 +15,7 @@ libsmpp34-dev, libasn1c-dev, libosmocore-dev, + libosmo-sccp-dev, libosmo-sigtran-dev, libosmo-abis-dev, libosmo-mgcp-client-dev, diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index c9b8bb4..fee9f44 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -14,6 +14,7 @@ $(LIBSMPP34_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOSCCP_CFLAGS) \ $(NULL) noinst_HEADERS = \ -- To view, visit https://gerrit.osmocom.org/4557 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I957dcb2bcce216d0fd81a58bfe869aca0e4624a8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:00:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:00:36 +0000 Subject: [MERGED] osmo-msc[master]: Debian: require minimum versions of packages we depend on In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: require minimum versions of packages we depend on ...................................................................... Debian: require minimum versions of packages we depend on I'm using the dame version as in configure.ac to avoid build failures against older versions of certain packages, such as older libsmpp34. Change-Id: I83c617fa4e83e2e3d2613e454f517d6031814f21 --- M debian/control 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 12d8364..60d468e 100644 --- a/debian/control +++ b/debian/control @@ -11,16 +11,16 @@ pkg-config, libdbi-dev, libtalloc-dev, - libssl-dev, - libsmpp34-dev, - libasn1c-dev, - libosmocore-dev, + libssl-dev (>= 0.9.5), + libsmpp34-dev (>= 1.12), + libasn1c-dev (>= 0.9.28), + libosmocore-dev (>= 0.10.0), libosmo-sccp-dev, - libosmo-sigtran-dev, + libosmo-sigtran-dev (>= 0.8.0), libosmo-abis-dev, - libosmo-mgcp-client-dev, - libosmo-netif-dev, - libosmo-ranap-dev + libosmo-mgcp-client-dev (>= 1.1.0), + libosmo-netif-dev (>= 0.1.0), + libosmo-ranap-dev (>= 0.2.0) Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/osmo-msc.git Vcs-Browser: https://git.osmocom.org/osmo-msc/ -- To view, visit https://gerrit.osmocom.org/4558 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I83c617fa4e83e2e3d2613e454f517d6031814f21 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:01:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:01:58 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_osmo-msc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E1=2E2-633e5_=E2=86=92_1=2E1=2E2?= Message-ID: Review at https://gerrit.osmocom.org/4560 Bump version: 1.1.1.2-633e5 ? 1.1.2 Change-Id: Id3ddab71f98046c3ce26ea240313b0ffef8ddf09 --- M debian/changelog 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/60/4560/1 diff --git a/debian/changelog b/debian/changelog index 7c6e1de..708129d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +osmo-msc (1.1.2) unstable; urgency=medium + + * Depend on both libosmo-sigtran-dev and libosmo-sccp-dev + * Debian: require minimum versions of packages we depend on + + -- Harald Welte Sun, 29 Oct 2017 09:01:30 +0100 + osmo-msc (1.1.1) unstable; urgency=medium * Debian: Depend on libosmo-sigtran-dev, not libsomo-sccp-dev! -- To view, visit https://gerrit.osmocom.org/4560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id3ddab71f98046c3ce26ea240313b0ffef8ddf09 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:02:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:02:23 +0000 Subject: osmo-bsc[master]: debian/control: Specify versions of packages we depend upon In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ide71f5029b14293ceda56ea5da715cd91a00c70f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:02:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:02:24 +0000 Subject: [MERGED] osmo-bsc[master]: debian/control: Specify versions of packages we depend upon In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian/control: Specify versions of packages we depend upon ...................................................................... debian/control: Specify versions of packages we depend upon Change-Id: Ide71f5029b14293ceda56ea5da715cd91a00c70f --- M debian/control 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 575c6bb..e4a5b1f 100644 --- a/debian/control +++ b/debian/control @@ -10,14 +10,14 @@ libtool, pkg-config, python-minimal, - libssl-dev, + libssl-dev (>= 0.9.5), libtalloc-dev, - libosmocore-dev, - libosmo-sccp-dev, - libosmo-sigtran-dev, - libosmo-abis-dev, - libosmo-netif-dev, - libosmo-legacy-mgcp-dev + libosmocore-dev (>= 0.10.0), + libosmo-sccp-dev (>= 0.0.2), + libosmo-sigtran-dev (>= 0.8.0), + libosmo-abis-dev (>= 0.3.2), + libosmo-netif-dev (>= 0.1.0), + libosmo-legacy-mgcp-dev (>= 0.0.1) Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/osmo-bsc.git Vcs-Browser: https://git.osmocom.org/osmo-bsc/ -- To view, visit https://gerrit.osmocom.org/4559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ide71f5029b14293ceda56ea5da715cd91a00c70f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:04:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:04:03 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_osmo-bsc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E1=2E2-52cd_=E2=86=92_1=2E1=2E2?= Message-ID: Review at https://gerrit.osmocom.org/4561 Bump version: 1.1.1.2-52cd ? 1.1.2 Change-Id: I76a9ff8eb43b1038213f69a78985444e8b694e40 --- M debian/changelog 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/61/4561/1 diff --git a/debian/changelog b/debian/changelog index c20b9b7..5f345a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +osmo-bsc (1.1.2) unstable; urgency=medium + + * Debian: depend on libosmo-sigtran (bsc) and libosmo-sccp (bsc-nat) + * debian/control: Specify versions of packages we depend upon + + -- Harald Welte Sun, 29 Oct 2017 09:03:33 +0100 + osmo-bsc (1.1.1) unstable; urgency=medium [ Neels Hofmeyr ] -- To view, visit https://gerrit.osmocom.org/4561 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I76a9ff8eb43b1038213f69a78985444e8b694e40 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:08:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:08:34 +0000 Subject: =?UTF-8?Q?osmo-msc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E1=2E2-633e5_=E2=86=92_1=2E1=2E2?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3ddab71f98046c3ce26ea240313b0ffef8ddf09 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:08:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:08:35 +0000 Subject: =?UTF-8?Q?=5BMERGED=5D_osmo-msc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E1=2E2-633e5_=E2=86=92_1=2E1=2E2?= In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Bump version: 1.1.1.2-633e5 ? 1.1.2 ...................................................................... Bump version: 1.1.1.2-633e5 ? 1.1.2 Change-Id: Id3ddab71f98046c3ce26ea240313b0ffef8ddf09 --- M debian/changelog 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 7c6e1de..708129d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +osmo-msc (1.1.2) unstable; urgency=medium + + * Depend on both libosmo-sigtran-dev and libosmo-sccp-dev + * Debian: require minimum versions of packages we depend on + + -- Harald Welte Sun, 29 Oct 2017 09:01:30 +0100 + osmo-msc (1.1.1) unstable; urgency=medium * Debian: Depend on libosmo-sigtran-dev, not libsomo-sccp-dev! -- To view, visit https://gerrit.osmocom.org/4560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id3ddab71f98046c3ce26ea240313b0ffef8ddf09 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:11:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:11:08 +0000 Subject: =?UTF-8?Q?osmo-bsc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E1=2E2-52cd_=E2=86=92_1=2E1=2E2?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4561 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I76a9ff8eb43b1038213f69a78985444e8b694e40 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:11:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:11:10 +0000 Subject: =?UTF-8?Q?=5BMERGED=5D_osmo-bsc=5Bmaster=5D=3A_Bump_version=3A_1=2E1=2E1=2E2-52cd_=E2=86=92_1=2E1=2E2?= In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Bump version: 1.1.1.2-52cd ? 1.1.2 ...................................................................... Bump version: 1.1.1.2-52cd ? 1.1.2 Change-Id: I76a9ff8eb43b1038213f69a78985444e8b694e40 --- M debian/changelog 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index c20b9b7..5f345a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +osmo-bsc (1.1.2) unstable; urgency=medium + + * Debian: depend on libosmo-sigtran (bsc) and libosmo-sccp (bsc-nat) + * debian/control: Specify versions of packages we depend upon + + -- Harald Welte Sun, 29 Oct 2017 09:03:33 +0100 + osmo-bsc (1.1.1) unstable; urgency=medium [ Neels Hofmeyr ] -- To view, visit https://gerrit.osmocom.org/4561 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I76a9ff8eb43b1038213f69a78985444e8b694e40 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Sun Oct 29 08:14:10 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 08:14:10 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f58deeb1718_718e50ef74145878d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 145s] To: [ 145s] Subject: [osmo-pcu 0.3.0.20171029] testsuite: 2 3 5 6 7 8 11 failed [ 145s] [ 145s] You may investigate any problem if you feel able to do so, in which [ 145s] case the test suite provides a good starting point. Its output may [ 145s] be found below `tests/testsuite.dir'. [ 145s] [ 145s] Makefile:1221: recipe for target 'check-local' failed [ 145s] make[3]: *** [check-local] Error 1 [ 145s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 145s] Makefile:1055: recipe for target 'check-am' failed [ 145s] make[2]: *** [check-am] Error 2 [ 145s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 145s] Makefile:460: recipe for target 'check-recursive' failed [ 145s] make[1]: *** [check-recursive] Error 1 [ 145s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 145s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 145s] debian/rules:12: recipe for target 'build' failed [ 145s] make: *** [build] Error 2 [ 145s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 145s] [ 145s] lamb01 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:13:50 UTC 2017. [ 145s] [ 145s] ### VM INTERACTION START ### [ 148s] [ 140.604365] reboot: Power down [ 148s] ### VM INTERACTION END ### [ 148s] [ 148s] lamb01 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:13:53 UTC 2017. [ 148s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 08:15:01 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 08:15:01 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f58e0e82a4f_718e50ef7414590af@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 118s] Subject: [osmo-pcu 0.3.0.20171029] testsuite: 2 3 5 6 7 8 11 failed [ 118s] [ 118s] You may investigate any problem if you feel able to do so, in which [ 118s] case the test suite provides a good starting point. Its output may [ 118s] be found below `tests/testsuite.dir'. [ 118s] [ 118s] Makefile:1208: recipe for target 'check-local' failed [ 118s] make[3]: *** [check-local] Error 1 [ 118s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 118s] Makefile:1044: recipe for target 'check-am' failed [ 118s] make[2]: *** [check-am] Error 2 [ 118s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 118s] Makefile:448: recipe for target 'check-recursive' failed [ 118s] make[1]: *** [check-recursive] Error 1 [ 118s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 118s] dh_auto_test: make -j1 check returned exit code 2 [ 118s] debian/rules:12: recipe for target 'build' failed [ 118s] make: *** [build] Error 2 [ 118s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 118s] [ 118s] lamb67 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:14:52 UTC 2017. [ 118s] [ 118s] ### VM INTERACTION START ### [ 120s] Powering off. [ 120s] [ 112.558764] reboot: Power down [ 120s] ### VM INTERACTION END ### [ 120s] [ 120s] lamb67 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:14:54 UTC 2017. [ 120s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 08:15:18 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 08:15:18 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f58e2834bbb_718e50ef74145919a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 144s] To: [ 144s] Subject: [osmo-pcu 0.3.0.20171029] testsuite: 2 3 5 6 7 8 11 failed [ 144s] [ 144s] You may investigate any problem if you feel able to do so, in which [ 144s] case the test suite provides a good starting point. Its output may [ 144s] be found below `tests/testsuite.dir'. [ 144s] [ 144s] Makefile:1221: recipe for target 'check-local' failed [ 144s] make[3]: *** [check-local] Error 1 [ 144s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 144s] Makefile:1055: recipe for target 'check-am' failed [ 144s] make[2]: *** [check-am] Error 2 [ 144s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 144s] Makefile:460: recipe for target 'check-recursive' failed [ 144s] make[1]: *** [check-recursive] Error 1 [ 144s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 144s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 144s] debian/rules:12: recipe for target 'build' failed [ 144s] make: *** [build] Error 2 [ 144s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 144s] [ 144s] lamb08 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:15:02 UTC 2017. [ 144s] [ 144s] ### VM INTERACTION START ### [ 147s] [ 139.406735] reboot: Power down [ 147s] ### VM INTERACTION END ### [ 147s] [ 147s] lamb08 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:15:05 UTC 2017. [ 147s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 08:15:36 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 08:15:36 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f58e46c2984_718e50ef7414592b8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 142s] To: [ 142s] Subject: [osmo-pcu 0.3.0.20171029] testsuite: 2 3 5 6 7 8 11 failed [ 142s] [ 142s] You may investigate any problem if you feel able to do so, in which [ 142s] case the test suite provides a good starting point. Its output may [ 142s] be found below `tests/testsuite.dir'. [ 142s] [ 142s] Makefile:1221: recipe for target 'check-local' failed [ 142s] make[3]: *** [check-local] Error 1 [ 142s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 142s] Makefile:1055: recipe for target 'check-am' failed [ 142s] make[2]: *** [check-am] Error 2 [ 142s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 142s] Makefile:460: recipe for target 'check-recursive' failed [ 142s] make[1]: *** [check-recursive] Error 1 [ 142s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 142s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 142s] debian/rules:12: recipe for target 'build' failed [ 142s] make: *** [build] Error 2 [ 142s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 142s] [ 142s] lamb27 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:15:15 UTC 2017. [ 142s] [ 142s] ### VM INTERACTION START ### [ 145s] [ 138.652878] reboot: Power down [ 146s] ### VM INTERACTION END ### [ 146s] [ 146s] lamb27 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:15:19 UTC 2017. [ 146s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 08:15:36 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 08:15:36 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f58e48a2ab_718e50ef741459316@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 146s] To: [ 146s] Subject: [osmo-pcu 0.3.0.20171029] testsuite: 2 3 5 6 7 8 11 failed [ 146s] [ 146s] You may investigate any problem if you feel able to do so, in which [ 146s] case the test suite provides a good starting point. Its output may [ 146s] be found below `tests/testsuite.dir'. [ 146s] [ 146s] Makefile:1221: recipe for target 'check-local' failed [ 146s] make[3]: *** [check-local] Error 1 [ 146s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 146s] Makefile:1055: recipe for target 'check-am' failed [ 146s] make[2]: *** [check-am] Error 2 [ 146s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 146s] Makefile:460: recipe for target 'check-recursive' failed [ 146s] make[1]: *** [check-recursive] Error 1 [ 146s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 146s] dh_auto_test: make -j1 check returned exit code 2 [ 146s] debian/rules:12: recipe for target 'build' failed [ 146s] make: *** [build] Error 2 [ 146s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 146s] [ 146s] lamb68 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:15:31 UTC 2017. [ 146s] [ 146s] ### VM INTERACTION START ### [ 150s] [ 142.257541] reboot: Power down [ 150s] ### VM INTERACTION END ### [ 150s] [ 150s] lamb68 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:15:34 UTC 2017. [ 150s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 08:15:53 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 08:15:53 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f58e4898dc4_718e50ef7414594ac@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 94s] To: [ 94s] Subject: [osmo-pcu 0.3.0.20171029] testsuite: 2 3 5 6 7 8 11 failed [ 94s] [ 94s] You may investigate any problem if you feel able to do so, in which [ 94s] case the test suite provides a good starting point. Its output may [ 94s] be found below `tests/testsuite.dir'. [ 94s] [ 94s] Makefile:1221: recipe for target 'check-local' failed [ 94s] make[3]: *** [check-local] Error 1 [ 94s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 94s] Makefile:1055: recipe for target 'check-am' failed [ 94s] make[2]: *** [check-am] Error 2 [ 94s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 94s] Makefile:460: recipe for target 'check-recursive' failed [ 94s] make[1]: *** [check-recursive] Error 1 [ 94s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 94s] dh_auto_test: make -j1 check returned exit code 2 [ 94s] debian/rules:12: recipe for target 'build' failed [ 94s] make: *** [build] Error 2 [ 94s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 94s] [ 94s] build78 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:15:39 UTC 2017. [ 94s] [ 94s] ### VM INTERACTION START ### [ 97s] [ 91.772517] reboot: Power down [ 97s] ### VM INTERACTION END ### [ 97s] [ 97s] build78 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:15:42 UTC 2017. [ 97s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 08:15:53 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 08:15:53 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f58e494197_718e50ef741459536@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 146s] To: [ 146s] Subject: [osmo-pcu 0.3.0.20171029] testsuite: 2 3 5 6 7 8 11 failed [ 146s] [ 146s] You may investigate any problem if you feel able to do so, in which [ 146s] case the test suite provides a good starting point. Its output may [ 146s] be found below `tests/testsuite.dir'. [ 146s] [ 146s] Makefile:1221: recipe for target 'check-local' failed [ 146s] make[3]: *** [check-local] Error 1 [ 146s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 146s] Makefile:1055: recipe for target 'check-am' failed [ 146s] make[2]: *** [check-am] Error 2 [ 146s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 146s] Makefile:460: recipe for target 'check-recursive' failed [ 146s] make[1]: *** [check-recursive] Error 1 [ 146s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 146s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 146s] debian/rules:12: recipe for target 'build' failed [ 146s] make: *** [build] Error 2 [ 146s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 146s] [ 146s] lamb58 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:15:43 UTC 2017. [ 146s] [ 146s] ### VM INTERACTION START ### [ 149s] [ 141.784965] reboot: Power down [ 149s] ### VM INTERACTION END ### [ 149s] [ 149s] lamb58 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:15:46 UTC 2017. [ 149s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 08:16:10 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 08:16:10 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f58e67f248f_718e50ef741459769@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 154s] To: [ 154s] Subject: [osmo-pcu 0.3.0.20171029] testsuite: 2 3 5 6 7 8 11 failed [ 154s] [ 154s] You may investigate any problem if you feel able to do so, in which [ 154s] case the test suite provides a good starting point. Its output may [ 154s] be found below `tests/testsuite.dir'. [ 154s] [ 154s] Makefile:1221: recipe for target 'check-local' failed [ 154s] make[3]: *** [check-local] Error 1 [ 154s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 154s] Makefile:1055: recipe for target 'check-am' failed [ 154s] make[2]: *** [check-am] Error 2 [ 154s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 154s] Makefile:460: recipe for target 'check-recursive' failed [ 154s] make[1]: *** [check-recursive] Error 1 [ 154s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 154s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 154s] debian/rules:12: recipe for target 'build' failed [ 154s] make: *** [build] Error 2 [ 154s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 154s] [ 154s] lamb72 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:16:00 UTC 2017. [ 154s] [ 154s] ### VM INTERACTION START ### [ 157s] [ 148.352563] reboot: Power down [ 157s] ### VM INTERACTION END ### [ 157s] [ 157s] lamb72 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:16:04 UTC 2017. [ 157s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 08:16:10 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 08:16:10 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59f58e68418d1_718e50ef741459823@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 150s] To: [ 150s] Subject: [osmo-pcu 0.3.0.20171029] testsuite: 2 3 5 6 7 8 11 failed [ 150s] [ 150s] You may investigate any problem if you feel able to do so, in which [ 150s] case the test suite provides a good starting point. Its output may [ 150s] be found below `tests/testsuite.dir'. [ 150s] [ 150s] Makefile:1221: recipe for target 'check-local' failed [ 150s] make[3]: *** [check-local] Error 1 [ 150s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 150s] Makefile:1055: recipe for target 'check-am' failed [ 150s] make[2]: *** [check-am] Error 2 [ 150s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 150s] Makefile:460: recipe for target 'check-recursive' failed [ 150s] make[1]: *** [check-recursive] Error 1 [ 150s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 150s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 150s] debian/rules:12: recipe for target 'build' failed [ 150s] make: *** [build] Error 2 [ 150s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 150s] [ 150s] lamb08 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:16:04 UTC 2017. [ 150s] [ 150s] ### VM INTERACTION START ### [ 153s] [ 145.269332] reboot: Power down [ 153s] ### VM INTERACTION END ### [ 153s] [ 153s] lamb08 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:16:07 UTC 2017. [ 153s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 08:16:27 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 08:16:27 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f58e68aa00f_718e50ef741459956@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 142s] To: [ 142s] Subject: [osmo-pcu 0.3.0.20171029] testsuite: 2 3 5 6 7 8 11 failed [ 142s] [ 142s] You may investigate any problem if you feel able to do so, in which [ 142s] case the test suite provides a good starting point. Its output may [ 142s] be found below `tests/testsuite.dir'. [ 142s] [ 142s] Makefile:1221: recipe for target 'check-local' failed [ 142s] make[3]: *** [check-local] Error 1 [ 142s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 142s] Makefile:1055: recipe for target 'check-am' failed [ 142s] make[2]: *** [check-am] Error 2 [ 142s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 142s] Makefile:460: recipe for target 'check-recursive' failed [ 142s] make[1]: *** [check-recursive] Error 1 [ 142s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 142s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 142s] debian/rules:12: recipe for target 'build' failed [ 142s] make: *** [build] Error 2 [ 142s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 142s] [ 142s] lamb67 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:16:13 UTC 2017. [ 142s] [ 142s] ### VM INTERACTION START ### [ 145s] [ 137.265321] reboot: Power down [ 145s] ### VM INTERACTION END ### [ 145s] [ 145s] lamb67 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:16:16 UTC 2017. [ 145s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Oct 29 08:16:27 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Oct 2017 08:16:27 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59f58e68ee17d_718e50ef74146007a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcu/Debian_8.0/i586 Package network:osmocom:nightly/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcu Last lines of build log: [ 149s] Subject: [osmo-pcu 0.3.0.20171029] testsuite: 2 3 5 6 7 8 11 failed [ 149s] [ 149s] You may investigate any problem if you feel able to do so, in which [ 149s] case the test suite provides a good starting point. Its output may [ 149s] be found below `tests/testsuite.dir'. [ 149s] [ 149s] Makefile:1208: recipe for target 'check-local' failed [ 149s] make[3]: *** [check-local] Error 1 [ 149s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 149s] Makefile:1044: recipe for target 'check-am' failed [ 149s] make[2]: *** [check-am] Error 2 [ 149s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 149s] Makefile:448: recipe for target 'check-recursive' failed [ 149s] make[1]: *** [check-recursive] Error 1 [ 149s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 149s] dh_auto_test: make -j1 check returned exit code 2 [ 149s] debian/rules:12: recipe for target 'build' failed [ 149s] make: *** [build] Error 2 [ 149s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 149s] [ 149s] build35 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:16:19 UTC 2017. [ 149s] [ 149s] ### VM INTERACTION START ### [ 150s] Powering off. [ 150s] [ 142.378376] reboot: Power down [ 151s] ### VM INTERACTION END ### [ 151s] [ 151s] build35 failed "build osmo-pcu_0.3.0.20171029.dsc" at Sun Oct 29 08:16:22 UTC 2017. [ 151s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sun Oct 29 08:40:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 08:40:40 +0000 Subject: osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 9: > I guess having one global counters pointer and not making it a BTS > member makes most sense to me, and then the move to pcu_ctr.c also > makes sense. the counters are per BTS, aren't they? A PCU can conceptually handle many BTSs, even if OsmoPCU so far doesn't do that. -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 09:39:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 09:39:27 +0000 Subject: [PATCH] libosmocore[master]: Catch repeated calls to osmo_init_logging() Message-ID: Review at https://gerrit.osmocom.org/4562 Catch repeated calls to osmo_init_logging() If an application calls osmo_init_logging() multiple times, let's bail out in a safe way without corrupting the state + returning an error. Change-Id: Icf337a430fb367bbca48a1b02822a2cb3b644e5f --- M src/application.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/62/4562/1 diff --git a/src/application.c b/src/application.c index ee22639..538ac45 100644 --- a/src/application.c +++ b/src/application.c @@ -112,6 +112,12 @@ */ int osmo_init_logging(const struct log_info *log_info) { + static int logging_initialized = 0; + + if (logging_initialized) + return -EEXIST; + + logging_initialized = 1; log_init(log_info, NULL); osmo_stderr_target = log_target_create_stderr(); if (!osmo_stderr_target) -- To view, visit https://gerrit.osmocom.org/4562 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf337a430fb367bbca48a1b02822a2cb3b644e5f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 09:45:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 09:45:20 +0000 Subject: libosmocore[master]: Catch repeated calls to osmo_init_logging() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4562 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf337a430fb367bbca48a1b02822a2cb3b644e5f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 09:45:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 09:45:25 +0000 Subject: [MERGED] libosmocore[master]: Catch repeated calls to osmo_init_logging() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Catch repeated calls to osmo_init_logging() ...................................................................... Catch repeated calls to osmo_init_logging() If an application calls osmo_init_logging() multiple times, let's bail out in a safe way without corrupting the state + returning an error. Change-Id: Icf337a430fb367bbca48a1b02822a2cb3b644e5f --- M src/application.c 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/application.c b/src/application.c index ee22639..538ac45 100644 --- a/src/application.c +++ b/src/application.c @@ -112,6 +112,12 @@ */ int osmo_init_logging(const struct log_info *log_info) { + static int logging_initialized = 0; + + if (logging_initialized) + return -EEXIST; + + logging_initialized = 1; log_init(log_info, NULL); osmo_stderr_target = log_target_create_stderr(); if (!osmo_stderr_target) -- To view, visit https://gerrit.osmocom.org/4562 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icf337a430fb367bbca48a1b02822a2cb3b644e5f Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 09:50:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 09:50:11 +0000 Subject: [PATCH] libosmocore[master]: Tag/Release Version 0.10.1 Message-ID: Review at https://gerrit.osmocom.org/4563 Tag/Release Version 0.10.1 This is for Change-Id Icf337a430fb367bbca48a1b02822a2cb3b644e5f to catch repeated calls to osmo_init_logging() whcih is what osmo-pcu will perform after some upcoming fixes there. Change-Id: Ie14a7eadf8ba01e8d31a83e330491036358ac650 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/63/4563/1 diff --git a/debian/changelog b/debian/changelog index 3b689e2..6e81256 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libosmocore (0.10.1) unstable; urgency=medium + + * New upstream release of libosmocore + + -- Harald Welte Sun, 29 Oct 2017 10:46:47 +0100 + libosmocore (0.10.0+nmu1) UNRELEASED; urgency=medium * Non-maintainer upload. -- To view, visit https://gerrit.osmocom.org/4563 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie14a7eadf8ba01e8d31a83e330491036358ac650 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 10:01:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 10:01:22 +0000 Subject: libosmocore[master]: Tag/Release Version 0.10.1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4563 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie14a7eadf8ba01e8d31a83e330491036358ac650 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 10:01:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 10:01:24 +0000 Subject: [MERGED] libosmocore[master]: Tag/Release Version 0.10.1 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release Version 0.10.1 ...................................................................... Tag/Release Version 0.10.1 This is for Change-Id Icf337a430fb367bbca48a1b02822a2cb3b644e5f to catch repeated calls to osmo_init_logging() whcih is what osmo-pcu will perform after some upcoming fixes there. Change-Id: Ie14a7eadf8ba01e8d31a83e330491036358ac650 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 3b689e2..6e81256 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libosmocore (0.10.1) unstable; urgency=medium + + * New upstream release of libosmocore + + -- Harald Welte Sun, 29 Oct 2017 10:46:47 +0100 + libosmocore (0.10.0+nmu1) UNRELEASED; urgency=medium * Non-maintainer upload. -- To view, visit https://gerrit.osmocom.org/4563 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie14a7eadf8ba01e8d31a83e330491036358ac650 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 10:02:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 10:02:25 +0000 Subject: [PATCH] osmo-pcu[master]: tests: Don't use private version of log_info but global gprs... Message-ID: Review at https://gerrit.osmocom.org/4564 tests: Don't use private version of log_info but global gprs_log_info There's no need for each test case to carry their own log_info and filter function. They can simply use the global gprs_log_info and configure the stderr log verbosity according to their needs. Change-Id: I8706a624e5d06e062d1198711aa197fbd0860769 --- M tests/Makefile.am M tests/bitcomp/BitcompTest.cpp M tests/edge/EdgeTest.cpp M tests/llc/LlcTest.cpp M tests/ms/MsTest.cpp M tests/tbf/TbfTest.cpp 6 files changed, 15 insertions(+), 119 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/64/4564/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index 79c3ef6..04136f5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -28,6 +28,7 @@ bitcomp_BitcompTest_SOURCES = bitcomp/BitcompTest.cpp ../src/egprs_rlc_compression.cpp bitcomp_BitcompTest_LDADD = \ + $(top_builddir)/src/libgprs.la \ $(LIBOSMOCORE_LIBS) \ $(COMMON_LA) diff --git a/tests/bitcomp/BitcompTest.cpp b/tests/bitcomp/BitcompTest.cpp index 4ec6f29..8dd4534 100644 --- a/tests/bitcomp/BitcompTest.cpp +++ b/tests/bitcomp/BitcompTest.cpp @@ -113,26 +113,6 @@ } }; -static const struct log_info_cat default_categories[] = { - {"DCSN1", "\033[1;31m", "Concrete Syntax Notation One (CSN1)", LOGL_INFO, 0}, - {"DL1IF", "\033[1;32m", "GPRS PCU L1 interface (L1IF)", LOGL_DEBUG, 1}, - {"DRLCMAC", "\033[0;33m", "GPRS RLC/MAC layer (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDATA", "\033[0;33m", "GPRS RLC/MAC layer Data (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDL", "\033[1;33m", "GPRS RLC/MAC layer Downlink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACUL", "\033[1;36m", "GPRS RLC/MAC layer Uplink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACSCHED", "\033[0;36m", "GPRS RLC/MAC layer Scheduling (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACMEAS", "\033[1;31m", "GPRS RLC/MAC layer Measurements (RLCMAC)", LOGL_INFO, 1}, - {"DNS", "\033[1;34m", "GPRS Network Service Protocol (NS)", LOGL_INFO, 1}, - {"DBSSGP", "\033[1;34m", "GPRS BSS Gateway Protocol (BSSGP)", LOGL_INFO, 1}, - {"DPCU", "\033[1;35m", "GPRS Packet Control Unit (PCU)", LOGL_NOTICE, 1}, -}; - -static int filter_fn(const struct log_context *ctx, - struct log_target *tar) -{ - return 1; -} - bool result_matches(const bitvec &bits, const uint8_t *exp_data, unsigned int exp_len) { if (bits.cur_bit != exp_len) @@ -206,17 +186,12 @@ printf("=== end %s ===\n", __func__); } -const struct log_info debug_log_info = { - filter_fn, - (struct log_info_cat *)default_categories, - ARRAY_SIZE(default_categories), -}; - int main(int argc, char **argv) { - osmo_init_logging(&debug_log_info); + osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); + log_parse_category_mask(osmo_stderr_target, "DRLCMACUL,1"); tall_pcu_ctx = talloc_named_const(NULL, 1, "moiji-mobile bitcompTest context"); if (!tall_pcu_ctx) diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index 73aed37..1abdcfd 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -1154,32 +1154,6 @@ printf("=== end %s ===\n", __func__); } -static const struct log_info_cat default_categories[] = { - {"DCSN1", "\033[1;31m", "Concrete Syntax Notation One (CSN1)", LOGL_INFO, 0}, - {"DL1IF", "\033[1;32m", "GPRS PCU L1 interface (L1IF)", LOGL_DEBUG, 1}, - {"DRLCMAC", "\033[0;33m", "GPRS RLC/MAC layer (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDATA", "\033[0;33m", "GPRS RLC/MAC layer Data (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDL", "\033[1;33m", "GPRS RLC/MAC layer Downlink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACUL", "\033[1;36m", "GPRS RLC/MAC layer Uplink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACSCHED", "\033[0;36m", "GPRS RLC/MAC layer Scheduling (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACMEAS", "\033[1;31m", "GPRS RLC/MAC layer Measurements (RLCMAC)", LOGL_INFO, 1}, - {"DNS","\033[1;34m", "GPRS Network Service Protocol (NS)", LOGL_INFO , 1}, - {"DBSSGP","\033[1;34m", "GPRS BSS Gateway Protocol (BSSGP)", LOGL_INFO , 1}, - {"DPCU", "\033[1;35m", "GPRS Packet Control Unit (PCU)", LOGL_NOTICE, 1}, -}; - -static int filter_fn(const struct log_context *ctx, - struct log_target *tar) -{ - return 1; -} - -const struct log_info debug_log_info = { - filter_fn, - (struct log_info_cat*)default_categories, - ARRAY_SIZE(default_categories), -}; - static void setup_bts(BTS *the_bts, uint8_t ts_no, uint8_t cs = 1) { gprs_rlcmac_bts *bts; @@ -1425,12 +1399,12 @@ abort(); msgb_talloc_ctx_init(tall_pcu_ctx, 0); - osmo_init_logging(&debug_log_info); + osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); vty_init(&pcu_vty_info); - pcu_vty_init(&debug_log_info); + pcu_vty_init(&gprs_log_info); test_coding_scheme(); test_rlc_info_init(); diff --git a/tests/llc/LlcTest.cpp b/tests/llc/LlcTest.cpp index 8df010e..f827ef1 100644 --- a/tests/llc/LlcTest.cpp +++ b/tests/llc/LlcTest.cpp @@ -215,22 +215,6 @@ printf("=== end %s ===\n", __func__); } -static const struct log_info_cat default_categories[] = { - {"DPCU", "", "GPRS Packet Control Unit (PCU)", LOGL_INFO, 1}, -}; - -static int filter_fn(const struct log_context *ctx, - struct log_target *tar) -{ - return 1; -} - -const struct log_info debug_log_info = { - filter_fn, - (struct log_info_cat*)default_categories, - ARRAY_SIZE(default_categories), -}; - int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -240,13 +224,14 @@ abort(); msgb_talloc_ctx_init(tall_pcu_ctx, 0); - osmo_init_logging(&debug_log_info); + osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); log_set_log_level(osmo_stderr_target, LOGL_INFO); + log_parse_category_mask(osmo_stderr_target, "DPCU,3"); vty_init(&pcu_vty_info); - pcu_vty_init(&debug_log_info); + pcu_vty_init(&gprs_log_info); test_llc_queue(); test_llc_meta(); diff --git a/tests/ms/MsTest.cpp b/tests/ms/MsTest.cpp index d66f578..ac35998 100644 --- a/tests/ms/MsTest.cpp +++ b/tests/ms/MsTest.cpp @@ -514,22 +514,6 @@ printf("=== end %s ===\n", __func__); } -static const struct log_info_cat default_categories[] = { - {"DPCU", "", "GPRS Packet Control Unit (PCU)", LOGL_INFO, 1}, -}; - -static int filter_fn(const struct log_context *ctx, - struct log_target *tar) -{ - return 1; -} - -const struct log_info debug_log_info = { - filter_fn, - (struct log_info_cat*)default_categories, - ARRAY_SIZE(default_categories), -}; - int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -539,13 +523,14 @@ abort(); msgb_talloc_ctx_init(tall_pcu_ctx, 0); - osmo_init_logging(&debug_log_info); + osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); log_set_log_level(osmo_stderr_target, LOGL_INFO); + log_parse_category_mask(osmo_stderr_target, "DPCU,3:DRLCMAC,3"); vty_init(&pcu_vty_info); - pcu_vty_init(&debug_log_info); + pcu_vty_init(&gprs_log_info); test_ms_state(); test_ms_callback(); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..195bec5 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -3182,32 +3182,6 @@ -static const struct log_info_cat default_categories[] = { - {"DCSN1", "\033[1;31m", "Concrete Syntax Notation One (CSN1)", LOGL_INFO, 0}, - {"DL1IF", "\033[1;32m", "GPRS PCU L1 interface (L1IF)", LOGL_DEBUG, 1}, - {"DRLCMAC", "\033[0;33m", "GPRS RLC/MAC layer (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDATA", "\033[0;33m", "GPRS RLC/MAC layer Data (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDL", "\033[1;33m", "GPRS RLC/MAC layer Downlink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACUL", "\033[1;36m", "GPRS RLC/MAC layer Uplink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACSCHED", "\033[0;36m", "GPRS RLC/MAC layer Scheduling (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACMEAS", "\033[1;31m", "GPRS RLC/MAC layer Measurements (RLCMAC)", LOGL_INFO, 1}, - {"DNS","\033[1;34m", "GPRS Network Service Protocol (NS)", LOGL_INFO , 1}, - {"DBSSGP","\033[1;34m", "GPRS BSS Gateway Protocol (BSSGP)", LOGL_INFO , 1}, - {"DPCU", "\033[1;35m", "GPRS Packet Control Unit (PCU)", LOGL_NOTICE, 1}, -}; - -static int filter_fn(const struct log_context *ctx, - struct log_target *tar) -{ - return 1; -} - -const struct log_info debug_log_info = { - filter_fn, - (struct log_info_cat*)default_categories, - ARRAY_SIZE(default_categories), -}; - static void test_packet_access_rej_prr_no_other_tbfs() { BTS the_bts; @@ -3348,13 +3322,15 @@ abort(); msgb_talloc_ctx_init(tall_pcu_ctx, 0); - osmo_init_logging(&debug_log_info); + osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); bssgp_set_log_ss(DBSSGP); + log_parse_category_mask(osmo_stderr_target, "DL1IF,1:DRLCMAC,1:DRLCMACDATA,1:DRLCMACDL,1:" + "DRLCMACUL,1:DRLCMACSCHED,1:DRLCMACMEAS,3:DNS,3:DBSSGP,3:DPCU,5"); vty_init(&pcu_vty_info); - pcu_vty_init(&debug_log_info); + pcu_vty_init(&gprs_log_info); test_tbf_base(); test_tbf_tlli_update(); -- To view, visit https://gerrit.osmocom.org/4564 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8706a624e5d06e062d1198711aa197fbd0860769 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 10:02:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 10:02:25 +0000 Subject: [PATCH] osmo-pcu[master]: Call osmo_init_logging() before static BTS constructor Message-ID: Review at https://gerrit.osmocom.org/4565 Call osmo_init_logging() before static BTS constructor The BTS constructor uses functions of libosmocore that could in turn want to log something. This requires the logging to be initialized before. The only way to achieve this is to add an __attribute__((constructor)) function *before* the BTS constructor is being run. This solution might not be elegant, but I guess it's the only way to initialize a C library before calling C++ constructors of global static instance of a class. In case anyone comes up with a better / cleaner approach, we can always change later. This change requires libosmocore >= 0.10.1, as only that permits multiple calls to osmo_init_logging() which may now occur. Change-Id: I28dc4f0db229518348c92413959fed5ae85d753d --- M configure.ac M debian/control M src/bts.cpp 3 files changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/65/4565/1 diff --git a/configure.ac b/configure.ac index 0a3557d..3533af9 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl Checks for typedefs, structures and compiler characteristics dnl checks for libraries -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.9) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.1) PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.3) PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.5.1.4) diff --git a/debian/control b/debian/control index 69930e8..ea43016 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Section: net Priority: optional Maintainer: Holger Hans Peter Freyther -Build-Depends: debhelper (>= 7.0.0~), dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, pkg-config, libosmocore-dev +Build-Depends: debhelper (>= 7.0.0~), dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, pkg-config, libosmocore-dev (>= 0.10.1) Standards-Version: 3.8.4 Homepage: http://osmocom.org/projects/osmopcu Vcs-Git: git://git.osmocom.org/osmo-pcu diff --git a/src/bts.cpp b/src/bts.cpp index b768569..e41b1fa 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -36,6 +36,7 @@ #include #include #include + #include } #include @@ -48,6 +49,16 @@ extern void *tall_pcu_ctx; +extern "C" { + /* e must make sure to initialize logging before the BTS static + * constructors are executed below, as those call libosmocore APIs that + * require logging already to be initialized. */ + __attribute__((constructor)) static void early_init(void) + { + osmo_init_logging(&gprs_log_info); + } +} + static BTS s_bts; /** -- To view, visit https://gerrit.osmocom.org/4565 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I28dc4f0db229518348c92413959fed5ae85d753d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 10:28:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 10:28:49 +0000 Subject: osmo-pcu[master]: tests: Don't use private version of log_info but global gprs... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4564 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8706a624e5d06e062d1198711aa197fbd0860769 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 10:28:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 10:28:55 +0000 Subject: osmo-pcu[master]: Call osmo_init_logging() before static BTS constructor In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4565 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I28dc4f0db229518348c92413959fed5ae85d753d Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 10:29:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 10:29:00 +0000 Subject: [MERGED] osmo-pcu[master]: tests: Don't use private version of log_info but global gprs... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: Don't use private version of log_info but global gprs_log_info ...................................................................... tests: Don't use private version of log_info but global gprs_log_info There's no need for each test case to carry their own log_info and filter function. They can simply use the global gprs_log_info and configure the stderr log verbosity according to their needs. Change-Id: I8706a624e5d06e062d1198711aa197fbd0860769 --- M tests/Makefile.am M tests/bitcomp/BitcompTest.cpp M tests/edge/EdgeTest.cpp M tests/llc/LlcTest.cpp M tests/ms/MsTest.cpp M tests/tbf/TbfTest.cpp 6 files changed, 15 insertions(+), 119 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/tests/Makefile.am b/tests/Makefile.am index 79c3ef6..04136f5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -28,6 +28,7 @@ bitcomp_BitcompTest_SOURCES = bitcomp/BitcompTest.cpp ../src/egprs_rlc_compression.cpp bitcomp_BitcompTest_LDADD = \ + $(top_builddir)/src/libgprs.la \ $(LIBOSMOCORE_LIBS) \ $(COMMON_LA) diff --git a/tests/bitcomp/BitcompTest.cpp b/tests/bitcomp/BitcompTest.cpp index 4ec6f29..8dd4534 100644 --- a/tests/bitcomp/BitcompTest.cpp +++ b/tests/bitcomp/BitcompTest.cpp @@ -113,26 +113,6 @@ } }; -static const struct log_info_cat default_categories[] = { - {"DCSN1", "\033[1;31m", "Concrete Syntax Notation One (CSN1)", LOGL_INFO, 0}, - {"DL1IF", "\033[1;32m", "GPRS PCU L1 interface (L1IF)", LOGL_DEBUG, 1}, - {"DRLCMAC", "\033[0;33m", "GPRS RLC/MAC layer (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDATA", "\033[0;33m", "GPRS RLC/MAC layer Data (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDL", "\033[1;33m", "GPRS RLC/MAC layer Downlink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACUL", "\033[1;36m", "GPRS RLC/MAC layer Uplink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACSCHED", "\033[0;36m", "GPRS RLC/MAC layer Scheduling (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACMEAS", "\033[1;31m", "GPRS RLC/MAC layer Measurements (RLCMAC)", LOGL_INFO, 1}, - {"DNS", "\033[1;34m", "GPRS Network Service Protocol (NS)", LOGL_INFO, 1}, - {"DBSSGP", "\033[1;34m", "GPRS BSS Gateway Protocol (BSSGP)", LOGL_INFO, 1}, - {"DPCU", "\033[1;35m", "GPRS Packet Control Unit (PCU)", LOGL_NOTICE, 1}, -}; - -static int filter_fn(const struct log_context *ctx, - struct log_target *tar) -{ - return 1; -} - bool result_matches(const bitvec &bits, const uint8_t *exp_data, unsigned int exp_len) { if (bits.cur_bit != exp_len) @@ -206,17 +186,12 @@ printf("=== end %s ===\n", __func__); } -const struct log_info debug_log_info = { - filter_fn, - (struct log_info_cat *)default_categories, - ARRAY_SIZE(default_categories), -}; - int main(int argc, char **argv) { - osmo_init_logging(&debug_log_info); + osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); + log_parse_category_mask(osmo_stderr_target, "DRLCMACUL,1"); tall_pcu_ctx = talloc_named_const(NULL, 1, "moiji-mobile bitcompTest context"); if (!tall_pcu_ctx) diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index 73aed37..1abdcfd 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -1154,32 +1154,6 @@ printf("=== end %s ===\n", __func__); } -static const struct log_info_cat default_categories[] = { - {"DCSN1", "\033[1;31m", "Concrete Syntax Notation One (CSN1)", LOGL_INFO, 0}, - {"DL1IF", "\033[1;32m", "GPRS PCU L1 interface (L1IF)", LOGL_DEBUG, 1}, - {"DRLCMAC", "\033[0;33m", "GPRS RLC/MAC layer (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDATA", "\033[0;33m", "GPRS RLC/MAC layer Data (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDL", "\033[1;33m", "GPRS RLC/MAC layer Downlink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACUL", "\033[1;36m", "GPRS RLC/MAC layer Uplink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACSCHED", "\033[0;36m", "GPRS RLC/MAC layer Scheduling (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACMEAS", "\033[1;31m", "GPRS RLC/MAC layer Measurements (RLCMAC)", LOGL_INFO, 1}, - {"DNS","\033[1;34m", "GPRS Network Service Protocol (NS)", LOGL_INFO , 1}, - {"DBSSGP","\033[1;34m", "GPRS BSS Gateway Protocol (BSSGP)", LOGL_INFO , 1}, - {"DPCU", "\033[1;35m", "GPRS Packet Control Unit (PCU)", LOGL_NOTICE, 1}, -}; - -static int filter_fn(const struct log_context *ctx, - struct log_target *tar) -{ - return 1; -} - -const struct log_info debug_log_info = { - filter_fn, - (struct log_info_cat*)default_categories, - ARRAY_SIZE(default_categories), -}; - static void setup_bts(BTS *the_bts, uint8_t ts_no, uint8_t cs = 1) { gprs_rlcmac_bts *bts; @@ -1425,12 +1399,12 @@ abort(); msgb_talloc_ctx_init(tall_pcu_ctx, 0); - osmo_init_logging(&debug_log_info); + osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); vty_init(&pcu_vty_info); - pcu_vty_init(&debug_log_info); + pcu_vty_init(&gprs_log_info); test_coding_scheme(); test_rlc_info_init(); diff --git a/tests/llc/LlcTest.cpp b/tests/llc/LlcTest.cpp index 8df010e..f827ef1 100644 --- a/tests/llc/LlcTest.cpp +++ b/tests/llc/LlcTest.cpp @@ -215,22 +215,6 @@ printf("=== end %s ===\n", __func__); } -static const struct log_info_cat default_categories[] = { - {"DPCU", "", "GPRS Packet Control Unit (PCU)", LOGL_INFO, 1}, -}; - -static int filter_fn(const struct log_context *ctx, - struct log_target *tar) -{ - return 1; -} - -const struct log_info debug_log_info = { - filter_fn, - (struct log_info_cat*)default_categories, - ARRAY_SIZE(default_categories), -}; - int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -240,13 +224,14 @@ abort(); msgb_talloc_ctx_init(tall_pcu_ctx, 0); - osmo_init_logging(&debug_log_info); + osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); log_set_log_level(osmo_stderr_target, LOGL_INFO); + log_parse_category_mask(osmo_stderr_target, "DPCU,3"); vty_init(&pcu_vty_info); - pcu_vty_init(&debug_log_info); + pcu_vty_init(&gprs_log_info); test_llc_queue(); test_llc_meta(); diff --git a/tests/ms/MsTest.cpp b/tests/ms/MsTest.cpp index d66f578..ac35998 100644 --- a/tests/ms/MsTest.cpp +++ b/tests/ms/MsTest.cpp @@ -514,22 +514,6 @@ printf("=== end %s ===\n", __func__); } -static const struct log_info_cat default_categories[] = { - {"DPCU", "", "GPRS Packet Control Unit (PCU)", LOGL_INFO, 1}, -}; - -static int filter_fn(const struct log_context *ctx, - struct log_target *tar) -{ - return 1; -} - -const struct log_info debug_log_info = { - filter_fn, - (struct log_info_cat*)default_categories, - ARRAY_SIZE(default_categories), -}; - int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -539,13 +523,14 @@ abort(); msgb_talloc_ctx_init(tall_pcu_ctx, 0); - osmo_init_logging(&debug_log_info); + osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); log_set_log_level(osmo_stderr_target, LOGL_INFO); + log_parse_category_mask(osmo_stderr_target, "DPCU,3:DRLCMAC,3"); vty_init(&pcu_vty_info); - pcu_vty_init(&debug_log_info); + pcu_vty_init(&gprs_log_info); test_ms_state(); test_ms_callback(); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..195bec5 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -3182,32 +3182,6 @@ -static const struct log_info_cat default_categories[] = { - {"DCSN1", "\033[1;31m", "Concrete Syntax Notation One (CSN1)", LOGL_INFO, 0}, - {"DL1IF", "\033[1;32m", "GPRS PCU L1 interface (L1IF)", LOGL_DEBUG, 1}, - {"DRLCMAC", "\033[0;33m", "GPRS RLC/MAC layer (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDATA", "\033[0;33m", "GPRS RLC/MAC layer Data (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACDL", "\033[1;33m", "GPRS RLC/MAC layer Downlink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACUL", "\033[1;36m", "GPRS RLC/MAC layer Uplink (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACSCHED", "\033[0;36m", "GPRS RLC/MAC layer Scheduling (RLCMAC)", LOGL_DEBUG, 1}, - {"DRLCMACMEAS", "\033[1;31m", "GPRS RLC/MAC layer Measurements (RLCMAC)", LOGL_INFO, 1}, - {"DNS","\033[1;34m", "GPRS Network Service Protocol (NS)", LOGL_INFO , 1}, - {"DBSSGP","\033[1;34m", "GPRS BSS Gateway Protocol (BSSGP)", LOGL_INFO , 1}, - {"DPCU", "\033[1;35m", "GPRS Packet Control Unit (PCU)", LOGL_NOTICE, 1}, -}; - -static int filter_fn(const struct log_context *ctx, - struct log_target *tar) -{ - return 1; -} - -const struct log_info debug_log_info = { - filter_fn, - (struct log_info_cat*)default_categories, - ARRAY_SIZE(default_categories), -}; - static void test_packet_access_rej_prr_no_other_tbfs() { BTS the_bts; @@ -3348,13 +3322,15 @@ abort(); msgb_talloc_ctx_init(tall_pcu_ctx, 0); - osmo_init_logging(&debug_log_info); + osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); bssgp_set_log_ss(DBSSGP); + log_parse_category_mask(osmo_stderr_target, "DL1IF,1:DRLCMAC,1:DRLCMACDATA,1:DRLCMACDL,1:" + "DRLCMACUL,1:DRLCMACSCHED,1:DRLCMACMEAS,3:DNS,3:DBSSGP,3:DPCU,5"); vty_init(&pcu_vty_info); - pcu_vty_init(&debug_log_info); + pcu_vty_init(&gprs_log_info); test_tbf_base(); test_tbf_tlli_update(); -- To view, visit https://gerrit.osmocom.org/4564 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8706a624e5d06e062d1198711aa197fbd0860769 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 10:29:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 10:29:02 +0000 Subject: [MERGED] osmo-pcu[master]: Call osmo_init_logging() before static BTS constructor In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Call osmo_init_logging() before static BTS constructor ...................................................................... Call osmo_init_logging() before static BTS constructor The BTS constructor uses functions of libosmocore that could in turn want to log something. This requires the logging to be initialized before. The only way to achieve this is to add an __attribute__((constructor)) function *before* the BTS constructor is being run. This solution might not be elegant, but I guess it's the only way to initialize a C library before calling C++ constructors of global static instance of a class. In case anyone comes up with a better / cleaner approach, we can always change later. This change requires libosmocore >= 0.10.1, as only that permits multiple calls to osmo_init_logging() which may now occur. Change-Id: I28dc4f0db229518348c92413959fed5ae85d753d --- M configure.ac M debian/control M src/bts.cpp 3 files changed, 13 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/configure.ac b/configure.ac index 0a3557d..3533af9 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl Checks for typedefs, structures and compiler characteristics dnl checks for libraries -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.9) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.1) PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.3) PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.5.1.4) diff --git a/debian/control b/debian/control index 69930e8..ea43016 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Section: net Priority: optional Maintainer: Holger Hans Peter Freyther -Build-Depends: debhelper (>= 7.0.0~), dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, pkg-config, libosmocore-dev +Build-Depends: debhelper (>= 7.0.0~), dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, pkg-config, libosmocore-dev (>= 0.10.1) Standards-Version: 3.8.4 Homepage: http://osmocom.org/projects/osmopcu Vcs-Git: git://git.osmocom.org/osmo-pcu diff --git a/src/bts.cpp b/src/bts.cpp index b768569..e41b1fa 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -36,6 +36,7 @@ #include #include #include + #include } #include @@ -48,6 +49,16 @@ extern void *tall_pcu_ctx; +extern "C" { + /* e must make sure to initialize logging before the BTS static + * constructors are executed below, as those call libosmocore APIs that + * require logging already to be initialized. */ + __attribute__((constructor)) static void early_init(void) + { + osmo_init_logging(&gprs_log_info); + } +} + static BTS s_bts; /** -- To view, visit https://gerrit.osmocom.org/4565 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I28dc4f0db229518348c92413959fed5ae85d753d Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 10:57:05 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 29 Oct 2017 10:57:05 +0000 Subject: [PATCH] osmocom-bb[master]: mobile: register the talloc context introspection command Message-ID: Review at https://gerrit.osmocom.org/4566 mobile: register the talloc context introspection command This change registers the command, which is now implemented in libosmocore since the 463deef8c209dd7eb023ac70bf41fa9893ad35ed and allows to introspect mobile application's talloc context directly from the VTY interface. Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 --- M src/host/layer23/src/mobile/app_mobile.c M src/host/layer23/src/mobile/vty_interface.c 2 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/66/4566/1 diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index ecf9820..9dbae7c 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -396,6 +396,7 @@ osmo_gps_init(); + vty_info.tall_ctx = l23_ctx; vty_init(&vty_info); ms_vty_init(); dummy_conn.priv = NULL; diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 0f321ba..2ad95d0 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -2951,6 +2951,9 @@ install_element(MS_NODE, &cfg_ms_shutdown_force_cmd); install_element(MS_NODE, &cfg_ms_no_shutdown_cmd); + /* Register the talloc context introspection command */ + osmo_talloc_vty_add_cmds(); + return 0; } -- To view, visit https://gerrit.osmocom.org/4566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Oct 29 11:05:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 11:05:48 +0000 Subject: [MERGED] osmo-ci[master]: Add JJB YML for Osmocom_OBS_latest In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add JJB YML for Osmocom_OBS_latest ...................................................................... Add JJB YML for Osmocom_OBS_latest Change-Id: I59a901727e35a35ba0fe73c09accb0bd1fa6b7ab --- A jobs/osmocom-obs-latest.yml 1 file changed, 22 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/osmocom-obs-latest.yml b/jobs/osmocom-obs-latest.yml new file mode 100644 index 0000000..337e067 --- /dev/null +++ b/jobs/osmocom-obs-latest.yml @@ -0,0 +1,22 @@ +--- +- project: + name: Osmocom_OBS_latest + jobs: + - Osmocom_OBS_latest + +- job: + name: 'Osmocom_OBS_latest' + project-type: freestyle + defaults: global + description: 'Generated by job-builder' + node: linux_amd64_debian8 + builders: + - shell: + ./scripts/osmocom-latest-packages.sh + scm: + - git: + url: git://git.osmocom.org/osmo-ci + git-config-name: 'Jenkins Builder' + git-config-email: 'jenkins at osmocom.org' + triggers: + - timed: "@midnight" -- To view, visit https://gerrit.osmocom.org/4550 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I59a901727e35a35ba0fe73c09accb0bd1fa6b7ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 11:08:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 11:08:18 +0000 Subject: osmocom-bb[master]: mobile: register the talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 1: please also depend on libosmocore >= 0.10.0 (in both configure.ac as well as debian/rules) to avoid build failures against old versions. -- To view, visit https://gerrit.osmocom.org/4566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 11:09:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 11:09:19 +0000 Subject: [PATCH] osmo-pcu[master]: Debian: Cosmetic changes to control file; add better Descrip... Message-ID: Review at https://gerrit.osmocom.org/4567 Debian: Cosmetic changes to control file; add better Description Change-Id: I0a8bf134757f6ed754bfefd45a9fdac255447e43 --- M debian/control 1 file changed, 20 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/67/4567/1 diff --git a/debian/control b/debian/control index ea43016..9439a39 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,12 @@ Section: net Priority: optional Maintainer: Holger Hans Peter Freyther -Build-Depends: debhelper (>= 7.0.0~), dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, pkg-config, libosmocore-dev (>= 0.10.1) +Build-Depends: debhelper (>= 7.0.0~), + dh-autoreconf, + dh-systemd (>= 1.5), + autotools-dev, + pkg-config, + libosmocore-dev (>= 0.10.1) Standards-Version: 3.8.4 Homepage: http://osmocom.org/projects/osmopcu Vcs-Git: git://git.osmocom.org/osmo-pcu @@ -11,14 +16,22 @@ Package: osmo-pcu Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: osmo-pcu GSM PCU for GPRS and EDGE - osmo-pcu for GPRS and EDGE support in the network +Description: Osmocom GPRS/EDGE Packet Control Unit (PCU) + The GPRS Packet Control Unit is co-located with the GSM BTS or GSM BSC + in order to provide packet-switched services for 2G (2.5G, 2.75G) + networks. OsmoPCU is the Osmcoom implementation of this network + element. It interfaces to osmo-bts via the PCU socket of OsmoBTS + and via Gb (NS-over-IP) interface with the SGSN such as OsmoSGSN. Package: osmo-pcu-dbg Architecture: any Section: debug Priority: extra -Depends: osmo-pcu (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the osmo-pcu - Make debugging possible - +Depends: osmo-pcu (= ${binary:Version}), + ${misc:Depends} +Description: Debug symbols for the Osmocom GPRS/EDGE Packet Control Unit (PCU) + The GPRS Packet Control Unit is co-located with the GSM BTS or GSM BSC + in order to provide packet-switched services for 2G (2.5G, 2.75G) + networks. OsmoPCU is the Osmcoom implementation of this network + element. It interfaces to osmo-bts via the PCU socket of OsmoBTS + and via Gb (NS-over-IP) interface with the SGSN such as OsmoSGSN. -- To view, visit https://gerrit.osmocom.org/4567 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a8bf134757f6ed754bfefd45a9fdac255447e43 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 11:09:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 11:09:19 +0000 Subject: [PATCH] osmo-pcu[master]: Debian: print test results in case of failure + clean-up aut... Message-ID: Review at https://gerrit.osmocom.org/4568 Debian: print test results in case of failure + clean-up autotest Change-Id: Id912a106d42bbd9d2ad89b67d16d52cb2344eb6d --- M debian/rules 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/68/4568/1 diff --git a/debian/rules b/debian/rules index 7623f74..cad7dfc 100755 --- a/debian/rules +++ b/debian/rules @@ -17,3 +17,12 @@ override_dh_autoreconf: echo $(VERSION) > .tarball-version dh_autoreconf + +override_dh_clean: + dh_clean + $(RM) tests/package.m4 + $(RM) test/testsuite + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4568 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id912a106d42bbd9d2ad89b67d16d52cb2344eb6d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 11:09:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 11:09:20 +0000 Subject: [PATCH] osmo-pcu[master]: Debian: migrate from DEB_BUILD_HARDENING to DEB_BUILD_MAINT_... Message-ID: Review at https://gerrit.osmocom.org/4569 Debian: migrate from DEB_BUILD_HARDENING to DEB_BUILD_MAINT_OPTIONS Change-Id: Ic400c509ecd0c6e8485e9433f144528f6abc600d --- M debian/rules 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/69/4569/1 diff --git a/debian/rules b/debian/rules index cad7dfc..63ee1c3 100755 --- a/debian/rules +++ b/debian/rules @@ -5,7 +5,7 @@ VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') #export DH_VERBOSE=1 -export DEB_BUILD_HARDENING=1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: -- To view, visit https://gerrit.osmocom.org/4569 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic400c509ecd0c6e8485e9433f144528f6abc600d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 11:09:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 11:09:20 +0000 Subject: [PATCH] osmo-pcu[master]: Debian: upgrade to debhelper 9 / Standards 3.9.8 Message-ID: Review at https://gerrit.osmocom.org/4570 Debian: upgrade to debhelper 9 / Standards 3.9.8 Change-Id: I1fd274d85b8fd344517d62dd9e6adc4af6de3e26 --- M debian/compat M debian/control M debian/osmo-pcu.install 3 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/70/4570/1 diff --git a/debian/compat b/debian/compat index 7f8f011..ec63514 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +9 diff --git a/debian/control b/debian/control index 9439a39..f6aaaba 100644 --- a/debian/control +++ b/debian/control @@ -2,13 +2,13 @@ Section: net Priority: optional Maintainer: Holger Hans Peter Freyther -Build-Depends: debhelper (>= 7.0.0~), +Build-Depends: debhelper (>= 9), dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, pkg-config, libosmocore-dev (>= 0.10.1) -Standards-Version: 3.8.4 +Standards-Version: 3.9.8 Homepage: http://osmocom.org/projects/osmopcu Vcs-Git: git://git.osmocom.org/osmo-pcu Vcs-Browser: http://git.osmocom.org/osmo-pcu/ diff --git a/debian/osmo-pcu.install b/debian/osmo-pcu.install index 54dcc63..80316ee 100644 --- a/debian/osmo-pcu.install +++ b/debian/osmo-pcu.install @@ -1,4 +1,4 @@ etc/osmocom/osmo-pcu.cfg usr/bin/osmo-pcu usr/include/osmocom/pcu/pcuif_proto.h -usr/lib/pkgconfig/osmo-pcu.pc +usr/lib/*/pkgconfig/osmo-pcu.pc -- To view, visit https://gerrit.osmocom.org/4570 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1fd274d85b8fd344517d62dd9e6adc4af6de3e26 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 11:09:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 11:09:20 +0000 Subject: [PATCH] osmo-pcu[master]: Tag/Release Version 0.4.0 Message-ID: Review at https://gerrit.osmocom.org/4571 Tag/Release Version 0.4.0 Change-Id: I8559585a4513dddf1516c2a2b08968556c69b7ec --- M debian/changelog 1 file changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/71/4571/1 diff --git a/debian/changelog b/debian/changelog index 6a534b4..4caccc8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,33 @@ +osmo-pcu (0.4.0) unstable; urgency=medium + + [ Holger Hans Peter Freyther ] + * Initial release. + + [ Max ] + * Use value string check from osmo-ci + * cosmetic: tighten direct-phy related code + * Support receiving SI13 from BTS + * Move gsmtap and accounting into separate function + * cosmetic: convert explicit warnings to fixme/todo + * Assert valid CS + * TBF-DL: extend index check for RLC block copy + * TS alloc: properly count UL slots + * cosmetic: reformat multislot classes table + + [ Philipp Maier ] + * gb: allow only packets from a specific SGSN + + [ Harald Welte ] + * tests: Don't use private version of log_info but global gprs_log_info + * Call osmo_init_logging() before static BTS constructor + * Forward GPRS SUSPEND REQ from BTS to SGSN using BSSGP + * Debian: Cosmetic changes to control file; add better Description + * Debian: print test results in case of failure + clean-up autotest + * Debian: migrate from DEB_BUILD_HARDENING to DEB_BUILD_MAINT_OPTIONS + * Debian: upgrade to debhelper 9 / Standards 3.9.8 + + -- Harald Welte Sun, 29 Oct 2017 12:03:05 +0100 + osmo-pcu (0.3.0) UNRELEASED; urgency=medium * Initial release. -- To view, visit https://gerrit.osmocom.org/4571 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8559585a4513dddf1516c2a2b08968556c69b7ec Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 11:10:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 11:10:32 +0000 Subject: osmo-pcu[master]: Debian: Cosmetic changes to control file; add better Descrip... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4567 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a8bf134757f6ed754bfefd45a9fdac255447e43 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 11:10:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 11:10:37 +0000 Subject: osmo-pcu[master]: Debian: print test results in case of failure + clean-up aut... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4568 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id912a106d42bbd9d2ad89b67d16d52cb2344eb6d Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 11:10:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 11:10:40 +0000 Subject: osmo-pcu[master]: Debian: migrate from DEB_BUILD_HARDENING to DEB_BUILD_MAINT_... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4569 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic400c509ecd0c6e8485e9433f144528f6abc600d Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 11:10:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 11:10:44 +0000 Subject: osmo-pcu[master]: Debian: upgrade to debhelper 9 / Standards 3.9.8 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4570 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1fd274d85b8fd344517d62dd9e6adc4af6de3e26 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:16:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:16:19 +0000 Subject: [PATCH] osmo-ci[master]: gerrit-verifications.yml: Manual sync with current jobs Message-ID: Review at https://gerrit.osmocom.org/4572 gerrit-verifications.yml: Manual sync with current jobs This is the result of one pass through all gerrit jenkins jobs currently [manually] configured on jenkins.osmocom.org together with alphabetically sorting the definitions to match the order in the Jenkins Web UI. Change-Id: I42051e76234b2695934183188f074ee7e467f58c --- M jobs/gerrit-verifications.yml 1 file changed, 70 insertions(+), 67 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/72/4572/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 780f2d5..f97b380 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -21,41 +21,9 @@ # most common build invocation cmd: ./contrib/jenkins.sh + # in alphabetical order repos: - - osmo-iuh - - osmo-gsm-manuals - - osmo-sip-connector - - osmocom-bb - - osmo-tetra - - - osmo-hlr: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - osmo-trx: - slave_axis: !!python/tuple [OsmocomBuild1] - - - osmo-ggsn: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - osmo-pcap: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libsmpp34: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - openggsn: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libosmo-sccp: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libosmo-netif: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libosmo-abis: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libasn1c: + - asn1c: slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - cellmgr-ng: @@ -65,32 +33,32 @@ -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -w /build -i -u build -v $PWD:/build \ osmocom:amd64 /build/contrib/jenkins.sh' - - osmo-bsc: + - libasn1c: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-abis: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-netif: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-sccp: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmocore: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + a1_name: arch + a1: !!python/tuple [arm-none-eabi, amd64] + combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' cmd: > - docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ - -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build \ - -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ - osmocom:amd64 /build/contrib/jenkins.sh' + if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then + ./contrib/jenkins-arm.sh + else + ./contrib/jenkins.sh + fi - - osmo-gsm-tester: - slave_axis: !!python/tuple [OsmocomBuild1] - cmd: 'make deps; make check' - - - osmo-bts: - a1_name: FIRMWARE_VERSION - a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] - a2_name: BTS_MODEL - a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] - combination_filter: > - FIRMWARE_VERSION == "master" || - (FIRMWARE_VERSION == "femtobts_v2.7" && BTS_MODEL == "sysmo") || - (FIRMWARE_VERSION == "superfemto_v2.4" && BTS_MODEL == "sysmo") || - (FIRMWARE_VERSION == "superfemto_v3.0.1pre" && BTS_MODEL == "sysmo") || - (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "sysmo") || - (FIRMWARE_VERSION == "superfemto_v5.1" && BTS_MODEL == "sysmo") || - (FIRMWARE_VERSION == "v2017.01" && BTS_MODEL == "lc15") || - (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "lc15") - cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + - libsmpp34: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - openBSC: a1_name: SMPP @@ -110,17 +78,41 @@ -v "$HOME/bin:/build_bin" -v "$ARTIFACT_STORE:/artifact_store" \ osmocom:amd64 /build/contrib/jenkins.sh - - libosmocore: + - openggsn: slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - a1_name: arch - a1: !!python/tuple [arm-none-eabi, amd64] - combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' + + - osmo-bsc: cmd: > - if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then - ./contrib/jenkins-arm.sh - else - ./contrib/jenkins.sh - fi + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build \ + -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-bts: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] + a2_name: BTS_MODEL + a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] + combination_filter: > + FIRMWARE_VERSION == "master" || + (FIRMWARE_VERSION == "femtobts_v2.7" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v2.4" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.0.1pre" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v5.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "v2017.01" && BTS_MODEL == "lc15") || + (FIRMWARE_VERSION == "origin/nrw/litecell15-next" && BTS_MODEL == "lc15") + cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + + - osmo-ggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-gsm-manuals + + - osmo-hlr: + slave_axis: !!python/tuple [linux_amd64_debian8, linux_amd63_debian9] + + - osmo-iuh - osmo-mgw: a1_name: MGCP @@ -143,6 +135,9 @@ -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ -w /build -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ osmocom:amd64 /build/contrib/jenkins.sh + + - osmo-pcap: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - osmo-pcu: a1_name: FIRMWARE_VERSION @@ -168,6 +163,14 @@ -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ osmocom:amd64 /build/contrib/jenkins.sh + - osmo-sip-connector + + - osmo-trx: + slave_axis: !!python/tuple [OsmocomBuild1] + + - osmocom-bb + - osmo-tetra + jobs: - '{repos}-gerrit' -- To view, visit https://gerrit.osmocom.org/4572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I42051e76234b2695934183188f074ee7e467f58c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:16:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:16:20 +0000 Subject: [PATCH] osmo-ci[master]: gerrit-verifications.yml: Rename from *-gerrit to gerrit-* Message-ID: Review at https://gerrit.osmocom.org/4573 gerrit-verifications.yml: Rename from *-gerrit to gerrit-* Let's rename the auto-generated jobs to make it easier to differentiate from the old manual jobs with -gerrit suffix. Change-Id: I9e46f03834e1b500b27c16f4a728f0b82dff0933 --- M jobs/gerrit-verifications.yml 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/73/4573/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index f97b380..b76bf24 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -172,10 +172,10 @@ - osmo-tetra jobs: - - '{repos}-gerrit' + - 'gerrit-{repos}' - job-template: - name: '{repos}-gerrit' + name: 'gerrit-{repos}' project-type: matrix node: '{node}' concurrent: '{obj:concurrent}' -- To view, visit https://gerrit.osmocom.org/4573 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e46f03834e1b500b27c16f4a728f0b82dff0933 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:16:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:16:20 +0000 Subject: [PATCH] osmo-ci[master]: gerrit-verifications.yml: State in job description that job ... Message-ID: Review at https://gerrit.osmocom.org/4574 gerrit-verifications.yml: State in job description that job is managed to prevent accidential / unintentional manual modification Change-Id: I26b20a879fe29f153487757ac50f88acb9655338 --- M jobs/gerrit-verifications.yml 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/74/4574/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index b76bf24..455c29d 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -186,7 +186,10 @@ numToKeep: 120 artifactDaysToKeep: -1 artifactNumToKeep: -1 - description: 'Pending reviews: https://gerrit.osmocom.org/#/q/status:open+project:{repos} ' + description: | + Pending reviews of https://gerrit.osmocom.org/#/q/status:open+project:{repos} +

+ Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY! execution-strategy: combination-filter: | -- To view, visit https://gerrit.osmocom.org/4574 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I26b20a879fe29f153487757ac50f88acb9655338 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:16:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:16:20 +0000 Subject: [PATCH] osmo-ci[master]: gerrit-verifications.yml: Turn gerrit URL into hyperlink Message-ID: Review at https://gerrit.osmocom.org/4575 gerrit-verifications.yml: Turn gerrit URL into hyperlink Change-Id: Ia9855f8d8c547f32439df2eea50fb755dfeba388 --- M jobs/gerrit-verifications.yml 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/75/4575/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 455c29d..9d3bc89 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -187,7 +187,8 @@ artifactDaysToKeep: -1 artifactNumToKeep: -1 description: | - Pending reviews of https://gerrit.osmocom.org/#/q/status:open+project:{repos} + Pending gerrit code reviews of + {repos}

Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY! -- To view, visit https://gerrit.osmocom.org/4575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9855f8d8c547f32439df2eea50fb755dfeba388 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:16:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:16:35 +0000 Subject: [MERGED] osmo-pcu[master]: Debian: upgrade to debhelper 9 / Standards 3.9.8 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: upgrade to debhelper 9 / Standards 3.9.8 ...................................................................... Debian: upgrade to debhelper 9 / Standards 3.9.8 Change-Id: I1fd274d85b8fd344517d62dd9e6adc4af6de3e26 --- M debian/compat M debian/control M debian/osmo-pcu.install 3 files changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/compat b/debian/compat index 7f8f011..ec63514 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +9 diff --git a/debian/control b/debian/control index 9439a39..f6aaaba 100644 --- a/debian/control +++ b/debian/control @@ -2,13 +2,13 @@ Section: net Priority: optional Maintainer: Holger Hans Peter Freyther -Build-Depends: debhelper (>= 7.0.0~), +Build-Depends: debhelper (>= 9), dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, pkg-config, libosmocore-dev (>= 0.10.1) -Standards-Version: 3.8.4 +Standards-Version: 3.9.8 Homepage: http://osmocom.org/projects/osmopcu Vcs-Git: git://git.osmocom.org/osmo-pcu Vcs-Browser: http://git.osmocom.org/osmo-pcu/ diff --git a/debian/osmo-pcu.install b/debian/osmo-pcu.install index 54dcc63..80316ee 100644 --- a/debian/osmo-pcu.install +++ b/debian/osmo-pcu.install @@ -1,4 +1,4 @@ etc/osmocom/osmo-pcu.cfg usr/bin/osmo-pcu usr/include/osmocom/pcu/pcuif_proto.h -usr/lib/pkgconfig/osmo-pcu.pc +usr/lib/*/pkgconfig/osmo-pcu.pc -- To view, visit https://gerrit.osmocom.org/4570 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1fd274d85b8fd344517d62dd9e6adc4af6de3e26 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:16:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:16:35 +0000 Subject: [MERGED] osmo-pcu[master]: Debian: migrate from DEB_BUILD_HARDENING to DEB_BUILD_MAINT_... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: migrate from DEB_BUILD_HARDENING to DEB_BUILD_MAINT_OPTIONS ...................................................................... Debian: migrate from DEB_BUILD_HARDENING to DEB_BUILD_MAINT_OPTIONS Change-Id: Ic400c509ecd0c6e8485e9433f144528f6abc600d --- M debian/rules 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index cad7dfc..63ee1c3 100755 --- a/debian/rules +++ b/debian/rules @@ -5,7 +5,7 @@ VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') #export DH_VERBOSE=1 -export DEB_BUILD_HARDENING=1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: -- To view, visit https://gerrit.osmocom.org/4569 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic400c509ecd0c6e8485e9433f144528f6abc600d Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:16:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:16:36 +0000 Subject: [MERGED] osmo-pcu[master]: Debian: print test results in case of failure + clean-up aut... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: print test results in case of failure + clean-up autotest ...................................................................... Debian: print test results in case of failure + clean-up autotest Change-Id: Id912a106d42bbd9d2ad89b67d16d52cb2344eb6d --- M debian/rules 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index 7623f74..cad7dfc 100755 --- a/debian/rules +++ b/debian/rules @@ -17,3 +17,12 @@ override_dh_autoreconf: echo $(VERSION) > .tarball-version dh_autoreconf + +override_dh_clean: + dh_clean + $(RM) tests/package.m4 + $(RM) test/testsuite + +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4568 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id912a106d42bbd9d2ad89b67d16d52cb2344eb6d Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:16:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:16:36 +0000 Subject: [MERGED] osmo-pcu[master]: Debian: Cosmetic changes to control file; add better Descrip... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Debian: Cosmetic changes to control file; add better Description ...................................................................... Debian: Cosmetic changes to control file; add better Description Change-Id: I0a8bf134757f6ed754bfefd45a9fdac255447e43 --- M debian/control 1 file changed, 20 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index ea43016..9439a39 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,12 @@ Section: net Priority: optional Maintainer: Holger Hans Peter Freyther -Build-Depends: debhelper (>= 7.0.0~), dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, pkg-config, libosmocore-dev (>= 0.10.1) +Build-Depends: debhelper (>= 7.0.0~), + dh-autoreconf, + dh-systemd (>= 1.5), + autotools-dev, + pkg-config, + libosmocore-dev (>= 0.10.1) Standards-Version: 3.8.4 Homepage: http://osmocom.org/projects/osmopcu Vcs-Git: git://git.osmocom.org/osmo-pcu @@ -11,14 +16,22 @@ Package: osmo-pcu Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: osmo-pcu GSM PCU for GPRS and EDGE - osmo-pcu for GPRS and EDGE support in the network +Description: Osmocom GPRS/EDGE Packet Control Unit (PCU) + The GPRS Packet Control Unit is co-located with the GSM BTS or GSM BSC + in order to provide packet-switched services for 2G (2.5G, 2.75G) + networks. OsmoPCU is the Osmcoom implementation of this network + element. It interfaces to osmo-bts via the PCU socket of OsmoBTS + and via Gb (NS-over-IP) interface with the SGSN such as OsmoSGSN. Package: osmo-pcu-dbg Architecture: any Section: debug Priority: extra -Depends: osmo-pcu (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the osmo-pcu - Make debugging possible - +Depends: osmo-pcu (= ${binary:Version}), + ${misc:Depends} +Description: Debug symbols for the Osmocom GPRS/EDGE Packet Control Unit (PCU) + The GPRS Packet Control Unit is co-located with the GSM BTS or GSM BSC + in order to provide packet-switched services for 2G (2.5G, 2.75G) + networks. OsmoPCU is the Osmcoom implementation of this network + element. It interfaces to osmo-bts via the PCU socket of OsmoBTS + and via Gb (NS-over-IP) interface with the SGSN such as OsmoSGSN. -- To view, visit https://gerrit.osmocom.org/4567 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a8bf134757f6ed754bfefd45a9fdac255447e43 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:16:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:16:47 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Manual sync with current jobs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42051e76234b2695934183188f074ee7e467f58c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:16:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:16:53 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Rename from *-gerrit to gerrit-* In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4573 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e46f03834e1b500b27c16f4a728f0b82dff0933 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:16:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:16:57 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: State in job description that job ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4574 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I26b20a879fe29f153487757ac50f88acb9655338 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:17:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:17:02 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Turn gerrit URL into hyperlink In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia9855f8d8c547f32439df2eea50fb755dfeba388 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:17:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:17:03 +0000 Subject: [MERGED] osmo-ci[master]: gerrit-verifications.yml: Turn gerrit URL into hyperlink In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gerrit-verifications.yml: Turn gerrit URL into hyperlink ...................................................................... gerrit-verifications.yml: Turn gerrit URL into hyperlink Change-Id: Ia9855f8d8c547f32439df2eea50fb755dfeba388 --- M jobs/gerrit-verifications.yml 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 455c29d..9d3bc89 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -187,7 +187,8 @@ artifactDaysToKeep: -1 artifactNumToKeep: -1 description: | - Pending reviews of https://gerrit.osmocom.org/#/q/status:open+project:{repos} + Pending gerrit code reviews of + {repos}

Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY! -- To view, visit https://gerrit.osmocom.org/4575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia9855f8d8c547f32439df2eea50fb755dfeba388 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:17:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:17:04 +0000 Subject: [MERGED] osmo-ci[master]: gerrit-verifications.yml: State in job description that job ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gerrit-verifications.yml: State in job description that job is managed ...................................................................... gerrit-verifications.yml: State in job description that job is managed to prevent accidential / unintentional manual modification Change-Id: I26b20a879fe29f153487757ac50f88acb9655338 --- M jobs/gerrit-verifications.yml 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index b76bf24..455c29d 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -186,7 +186,10 @@ numToKeep: 120 artifactDaysToKeep: -1 artifactNumToKeep: -1 - description: 'Pending reviews: https://gerrit.osmocom.org/#/q/status:open+project:{repos} ' + description: | + Pending reviews of https://gerrit.osmocom.org/#/q/status:open+project:{repos} +

+ Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY! execution-strategy: combination-filter: | -- To view, visit https://gerrit.osmocom.org/4574 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I26b20a879fe29f153487757ac50f88acb9655338 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:17:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:17:04 +0000 Subject: [MERGED] osmo-ci[master]: gerrit-verifications.yml: Rename from *-gerrit to gerrit-* In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gerrit-verifications.yml: Rename from *-gerrit to gerrit-* ...................................................................... gerrit-verifications.yml: Rename from *-gerrit to gerrit-* Let's rename the auto-generated jobs to make it easier to differentiate from the old manual jobs with -gerrit suffix. Change-Id: I9e46f03834e1b500b27c16f4a728f0b82dff0933 --- M jobs/gerrit-verifications.yml 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index f97b380..b76bf24 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -172,10 +172,10 @@ - osmo-tetra jobs: - - '{repos}-gerrit' + - 'gerrit-{repos}' - job-template: - name: '{repos}-gerrit' + name: 'gerrit-{repos}' project-type: matrix node: '{node}' concurrent: '{obj:concurrent}' -- To view, visit https://gerrit.osmocom.org/4573 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e46f03834e1b500b27c16f4a728f0b82dff0933 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:17:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:17:04 +0000 Subject: [MERGED] osmo-ci[master]: gerrit-verifications.yml: Manual sync with current jobs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gerrit-verifications.yml: Manual sync with current jobs ...................................................................... gerrit-verifications.yml: Manual sync with current jobs This is the result of one pass through all gerrit jenkins jobs currently [manually] configured on jenkins.osmocom.org together with alphabetically sorting the definitions to match the order in the Jenkins Web UI. Change-Id: I42051e76234b2695934183188f074ee7e467f58c --- M jobs/gerrit-verifications.yml 1 file changed, 70 insertions(+), 67 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 780f2d5..f97b380 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -21,41 +21,9 @@ # most common build invocation cmd: ./contrib/jenkins.sh + # in alphabetical order repos: - - osmo-iuh - - osmo-gsm-manuals - - osmo-sip-connector - - osmocom-bb - - osmo-tetra - - - osmo-hlr: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - osmo-trx: - slave_axis: !!python/tuple [OsmocomBuild1] - - - osmo-ggsn: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - osmo-pcap: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libsmpp34: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - openggsn: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libosmo-sccp: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libosmo-netif: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libosmo-abis: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libasn1c: + - asn1c: slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - cellmgr-ng: @@ -65,32 +33,32 @@ -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -w /build -i -u build -v $PWD:/build \ osmocom:amd64 /build/contrib/jenkins.sh' - - osmo-bsc: + - libasn1c: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-abis: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-netif: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-sccp: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmocore: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + a1_name: arch + a1: !!python/tuple [arm-none-eabi, amd64] + combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' cmd: > - docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ - -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build \ - -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ - osmocom:amd64 /build/contrib/jenkins.sh' + if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then + ./contrib/jenkins-arm.sh + else + ./contrib/jenkins.sh + fi - - osmo-gsm-tester: - slave_axis: !!python/tuple [OsmocomBuild1] - cmd: 'make deps; make check' - - - osmo-bts: - a1_name: FIRMWARE_VERSION - a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] - a2_name: BTS_MODEL - a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] - combination_filter: > - FIRMWARE_VERSION == "master" || - (FIRMWARE_VERSION == "femtobts_v2.7" && BTS_MODEL == "sysmo") || - (FIRMWARE_VERSION == "superfemto_v2.4" && BTS_MODEL == "sysmo") || - (FIRMWARE_VERSION == "superfemto_v3.0.1pre" && BTS_MODEL == "sysmo") || - (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "sysmo") || - (FIRMWARE_VERSION == "superfemto_v5.1" && BTS_MODEL == "sysmo") || - (FIRMWARE_VERSION == "v2017.01" && BTS_MODEL == "lc15") || - (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "lc15") - cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + - libsmpp34: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - openBSC: a1_name: SMPP @@ -110,17 +78,41 @@ -v "$HOME/bin:/build_bin" -v "$ARTIFACT_STORE:/artifact_store" \ osmocom:amd64 /build/contrib/jenkins.sh - - libosmocore: + - openggsn: slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - a1_name: arch - a1: !!python/tuple [arm-none-eabi, amd64] - combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' + + - osmo-bsc: cmd: > - if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then - ./contrib/jenkins-arm.sh - else - ./contrib/jenkins.sh - fi + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build \ + -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-bts: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] + a2_name: BTS_MODEL + a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] + combination_filter: > + FIRMWARE_VERSION == "master" || + (FIRMWARE_VERSION == "femtobts_v2.7" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v2.4" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.0.1pre" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v5.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "v2017.01" && BTS_MODEL == "lc15") || + (FIRMWARE_VERSION == "origin/nrw/litecell15-next" && BTS_MODEL == "lc15") + cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + + - osmo-ggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-gsm-manuals + + - osmo-hlr: + slave_axis: !!python/tuple [linux_amd64_debian8, linux_amd63_debian9] + + - osmo-iuh - osmo-mgw: a1_name: MGCP @@ -143,6 +135,9 @@ -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ -w /build -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ osmocom:amd64 /build/contrib/jenkins.sh + + - osmo-pcap: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - osmo-pcu: a1_name: FIRMWARE_VERSION @@ -168,6 +163,14 @@ -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ osmocom:amd64 /build/contrib/jenkins.sh + - osmo-sip-connector + + - osmo-trx: + slave_axis: !!python/tuple [OsmocomBuild1] + + - osmocom-bb + - osmo-tetra + jobs: - '{repos}-gerrit' -- To view, visit https://gerrit.osmocom.org/4572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I42051e76234b2695934183188f074ee7e467f58c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:32:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:32:24 +0000 Subject: [PATCH] osmo-ci[master]: gerrit-verifications.yml: Remove FreeBSD_amd64 builds Message-ID: Review at https://gerrit.osmocom.org/4576 gerrit-verifications.yml: Remove FreeBSD_amd64 builds In early September we asked on the public mailing list if there are any users of the FreeBSD builds, and there was no response at all. Let's disable the build testing on FreeBSD. This will significantly speed up our build testing, as well as pave the way for a more comprehensive docker/containerization of build testing. We're still extremely happy to merge any patches for support of FreeBSD or other operating systems. But the core Osmocom developers will not perform related testing / porting. Change-Id: I2c6d2a17c3cf9d8c78c3675995493e30cbc6be0d --- M jobs/gerrit-verifications.yml 1 file changed, 9 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/76/4576/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 9d3bc89..e94c931 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -23,8 +23,7 @@ # in alphabetical order repos: - - asn1c: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + - asn1c - cellmgr-ng: concurrent: true @@ -33,20 +32,12 @@ -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -w /build -i -u build -v $PWD:/build \ osmocom:amd64 /build/contrib/jenkins.sh' - - libasn1c: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libosmo-abis: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libosmo-netif: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - - - libosmo-sccp: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + - libasn1c + - libosmo-abis + - libosmo-netif + - libosmo-sccp - libosmocore: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] a1_name: arch a1: !!python/tuple [arm-none-eabi, amd64] combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' @@ -57,8 +48,7 @@ ./contrib/jenkins.sh fi - - libsmpp34: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + - libsmpp34 - openBSC: a1_name: SMPP @@ -78,8 +68,7 @@ -v "$HOME/bin:/build_bin" -v "$ARTIFACT_STORE:/artifact_store" \ osmocom:amd64 /build/contrib/jenkins.sh - - openggsn: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + - openggsn - osmo-bsc: cmd: > @@ -104,9 +93,7 @@ (FIRMWARE_VERSION == "origin/nrw/litecell15-next" && BTS_MODEL == "lc15") cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' - - osmo-ggsn: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] - + - osmo-ggsn - osmo-gsm-manuals - osmo-hlr: @@ -136,8 +123,7 @@ -w /build -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ osmocom:amd64 /build/contrib/jenkins.sh - - osmo-pcap: - slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + - osmo-pcap - osmo-pcu: a1_name: FIRMWARE_VERSION -- To view, visit https://gerrit.osmocom.org/4576 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2c6d2a17c3cf9d8c78c3675995493e30cbc6be0d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:32:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:32:44 +0000 Subject: osmo-pcu[master]: Tag/Release Version 0.4.0 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4571 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8559585a4513dddf1516c2a2b08968556c69b7ec Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 12:32:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 12:32:46 +0000 Subject: [MERGED] osmo-pcu[master]: Tag/Release Version 0.4.0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Tag/Release Version 0.4.0 ...................................................................... Tag/Release Version 0.4.0 Change-Id: I8559585a4513dddf1516c2a2b08968556c69b7ec --- M debian/changelog 1 file changed, 30 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 6a534b4..4caccc8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,33 @@ +osmo-pcu (0.4.0) unstable; urgency=medium + + [ Holger Hans Peter Freyther ] + * Initial release. + + [ Max ] + * Use value string check from osmo-ci + * cosmetic: tighten direct-phy related code + * Support receiving SI13 from BTS + * Move gsmtap and accounting into separate function + * cosmetic: convert explicit warnings to fixme/todo + * Assert valid CS + * TBF-DL: extend index check for RLC block copy + * TS alloc: properly count UL slots + * cosmetic: reformat multislot classes table + + [ Philipp Maier ] + * gb: allow only packets from a specific SGSN + + [ Harald Welte ] + * tests: Don't use private version of log_info but global gprs_log_info + * Call osmo_init_logging() before static BTS constructor + * Forward GPRS SUSPEND REQ from BTS to SGSN using BSSGP + * Debian: Cosmetic changes to control file; add better Description + * Debian: print test results in case of failure + clean-up autotest + * Debian: migrate from DEB_BUILD_HARDENING to DEB_BUILD_MAINT_OPTIONS + * Debian: upgrade to debhelper 9 / Standards 3.9.8 + + -- Harald Welte Sun, 29 Oct 2017 12:03:05 +0100 + osmo-pcu (0.3.0) UNRELEASED; urgency=medium * Initial release. -- To view, visit https://gerrit.osmocom.org/4571 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8559585a4513dddf1516c2a2b08968556c69b7ec Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Oct 29 13:23:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 13:23:55 +0000 Subject: osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Patch Set 9: Plesae see I28dc4f0db229518348c92413959fed5ae85d753d as a much less intrusive approach at fixing this particular issue. I'm not saying the structure of the counters or the overall code structure cannot be improved, but let's try to focus and fix only what needs to be fixed now. -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 14:55:36 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 29 Oct 2017 14:55:36 +0000 Subject: osmocom-bb[master]: mobile: register the talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 1: > please also depend on libosmocore >= 0.10.0 (in both configure.ac > as well as debian/rules) to avoid build failures against old > versions. Dear Harald, As this change depends exactly on libosmovty, but not on libosmocore, I think it would be better to bump the libosmovty version first and then add the corresponding dependency here. What do you think? -- To view, visit https://gerrit.osmocom.org/4566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 15:04:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 15:04:10 +0000 Subject: osmocom-bb[master]: mobile: register the talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 1: 0.10.0 was released after this api was introduced, so you can depend on it now. And sure, libosmovty and not libosmcoore. -- To view, visit https://gerrit.osmocom.org/4566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 16:13:12 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 29 Oct 2017 16:13:12 +0000 Subject: [PATCH] osmocom-bb[master]: mobile: register the talloc context introspection command In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4566 to look at the new patch set (#2). mobile: register the talloc context introspection command This change registers the command, which is now implemented in libosmocore since the 463deef8c209dd7eb023ac70bf41fa9893ad35ed and allows to introspect mobile application's talloc context directly from the VTY interface. Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 --- M src/host/layer23/configure.ac M src/host/layer23/src/mobile/app_mobile.c M src/host/layer23/src/mobile/vty_interface.c 3 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/66/4566/2 diff --git a/src/host/layer23/configure.ac b/src/host/layer23/configure.ac index 102d234..f93f50e 100644 --- a/src/host/layer23/configure.ac +++ b/src/host/layer23/configure.ac @@ -13,7 +13,7 @@ dnl checks for libraries PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.1) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm) PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec) AC_CHECK_LIB(gps, gps_waiting, LIBGPS_CFLAGS=" -D_HAVE_GPSD" LIBGPS_LIBS=" -lgps ",,) diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index ecf9820..9dbae7c 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -396,6 +396,7 @@ osmo_gps_init(); + vty_info.tall_ctx = l23_ctx; vty_init(&vty_info); ms_vty_init(); dummy_conn.priv = NULL; diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 0f321ba..2ad95d0 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -2951,6 +2951,9 @@ install_element(MS_NODE, &cfg_ms_shutdown_force_cmd); install_element(MS_NODE, &cfg_ms_no_shutdown_cmd); + /* Register the talloc context introspection command */ + osmo_talloc_vty_add_cmds(); + return 0; } -- To view, visit https://gerrit.osmocom.org/4566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Oct 29 16:15:01 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 29 Oct 2017 16:15:01 +0000 Subject: [PATCH] osmocom-bb[master]: mobile: register the talloc context introspection command In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4566 to look at the new patch set (#3). mobile: register the talloc context introspection command This change registers the command, which is now implemented in libosmocore since the 463deef8c209dd7eb023ac70bf41fa9893ad35ed and allows to introspect mobile application's talloc context directly from the VTY interface. Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 --- M src/host/layer23/configure.ac M src/host/layer23/src/mobile/app_mobile.c M src/host/layer23/src/mobile/vty_interface.c 3 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/66/4566/3 diff --git a/src/host/layer23/configure.ac b/src/host/layer23/configure.ac index 102d234..de26d23 100644 --- a/src/host/layer23/configure.ac +++ b/src/host/layer23/configure.ac @@ -13,7 +13,7 @@ dnl checks for libraries PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm) PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec) AC_CHECK_LIB(gps, gps_waiting, LIBGPS_CFLAGS=" -D_HAVE_GPSD" LIBGPS_LIBS=" -lgps ",,) diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index ecf9820..9dbae7c 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -396,6 +396,7 @@ osmo_gps_init(); + vty_info.tall_ctx = l23_ctx; vty_init(&vty_info); ms_vty_init(); dummy_conn.priv = NULL; diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 0f321ba..2ad95d0 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -2951,6 +2951,9 @@ install_element(MS_NODE, &cfg_ms_shutdown_force_cmd); install_element(MS_NODE, &cfg_ms_no_shutdown_cmd); + /* Register the talloc context introspection command */ + osmo_talloc_vty_add_cmds(); + return 0; } -- To view, visit https://gerrit.osmocom.org/4566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 Gerrit-PatchSet: 3 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:23:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:23:49 +0000 Subject: [PATCH] osmo-ci[master]: gerrit-verifications.yml: Add missing git 'name' and 'refspec' Message-ID: Review at https://gerrit.osmocom.org/4577 gerrit-verifications.yml: Add missing git 'name' and 'refspec' The 'name' and 'refspec' attributes for the git SCM fetcher were not configured correctly (like in old manual job definitions) Change-Id: Ibc63751838c14a449464afeec56930021bef37be --- M jobs/gerrit-verifications.yml 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/77/4577/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index e94c931..b2b6b6a 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -209,6 +209,8 @@ credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d branches: - $GERRIT_BRANCH + refspec: $GERRIT_REFSPEC + name: choosing-strategy: gerrit wipe-workspace: false skip-tag: true -- To view, visit https://gerrit.osmocom.org/4577 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibc63751838c14a449464afeec56930021bef37be Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:23:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:23:52 +0000 Subject: [PATCH] osmo-ci[master]: gerrit-verifcations.yml: Make sure we add a +V=1 on successf... Message-ID: Review at https://gerrit.osmocom.org/4578 gerrit-verifcations.yml: Make sure we add a +V=1 on successful builds Change-Id: I0b3bcb4661a144e231613398031c0aadf8781bb8 --- M jobs/gerrit-verifications.yml 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/78/4578/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index b2b6b6a..40f744d 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -221,6 +221,9 @@ - gerrit: trigger-on: - patchset-created-event + - comment-added-event: + approval-category: 'Verified' + approval-value: 1 projects: - project-compare-type: 'PLAIN' project-pattern: '{repos}' -- To view, visit https://gerrit.osmocom.org/4578 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0b3bcb4661a144e231613398031c0aadf8781bb8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:23:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:23:52 +0000 Subject: [PATCH] osmo-ci[master]: gerrit-verifications.yml: Don't build drafts or no-code-changes Message-ID: Review at https://gerrit.osmocom.org/4579 gerrit-verifications.yml: Don't build drafts or no-code-changes Change-Id: I19e8004a2016626e3525eca690c84800715e4fdc --- M jobs/gerrit-verifications.yml 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/79/4579/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 40f744d..26c9529 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -220,7 +220,9 @@ triggers: - gerrit: trigger-on: - - patchset-created-event + - patchset-created-event: + exclude-drafts: true + exclude-no-code-change: true - comment-added-event: approval-category: 'Verified' approval-value: 1 -- To view, visit https://gerrit.osmocom.org/4579 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I19e8004a2016626e3525eca690c84800715e4fdc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:46:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:46:36 +0000 Subject: [PATCH] osmo-ci[master]: gerrit-verifications.yml: Don't skip the vote Message-ID: Review at https://gerrit.osmocom.org/4580 gerrit-verifications.yml: Don't skip the vote Change-Id: I4eb153701baf1652394bda7505dcd3bc31e28570 --- M jobs/gerrit-verifications.yml 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/80/4580/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 26c9529..ecb179b 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -233,10 +233,10 @@ - branch-compare-type: 'ANT' branch-pattern: '**' skip-vote: - successful: true - failed: true - unstable: true - notbuilt: true + successful: false + failed: false + unstable: false + notbuilt: false silent: false escape-quotes: false no-name-and-email: false -- To view, visit https://gerrit.osmocom.org/4580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4eb153701baf1652394bda7505dcd3bc31e28570 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:47:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:47:32 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Add missing git 'name' and 'refspec' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4577 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibc63751838c14a449464afeec56930021bef37be Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:47:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:47:37 +0000 Subject: osmo-ci[master]: gerrit-verifcations.yml: Make sure we add a +V=1 on successf... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4578 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0b3bcb4661a144e231613398031c0aadf8781bb8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:47:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:47:41 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Don't build drafts or no-code-changes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4579 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I19e8004a2016626e3525eca690c84800715e4fdc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:47:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:47:46 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Don't skip the vote In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4eb153701baf1652394bda7505dcd3bc31e28570 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:47:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:47:59 +0000 Subject: osmocom-bb[master]: mobile: register the talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 Gerrit-PatchSet: 7 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:48:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:48:41 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Add missing git 'name' and 'refspec' In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4577 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibc63751838c14a449464afeec56930021bef37be Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:48:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:48:43 +0000 Subject: osmo-ci[master]: gerrit-verifcations.yml: Make sure we add a +V=1 on successf... In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4578 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0b3bcb4661a144e231613398031c0aadf8781bb8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:48:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:48:45 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Don't build drafts or no-code-changes In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4579 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I19e8004a2016626e3525eca690c84800715e4fdc Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:48:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:48:46 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Don't skip the vote In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/4580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4eb153701baf1652394bda7505dcd3bc31e28570 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:48:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:48:48 +0000 Subject: [MERGED] osmo-ci[master]: gerrit-verifications.yml: Don't skip the vote In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gerrit-verifications.yml: Don't skip the vote ...................................................................... gerrit-verifications.yml: Don't skip the vote Change-Id: I4eb153701baf1652394bda7505dcd3bc31e28570 --- M jobs/gerrit-verifications.yml 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 875a7b6..65e07a1 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -247,10 +247,10 @@ - branch-compare-type: 'ANT' branch-pattern: '**' skip-vote: - successful: true - failed: true - unstable: true - notbuilt: true + successful: false + failed: false + unstable: false + notbuilt: false silent: false escape-quotes: false no-name-and-email: false -- To view, visit https://gerrit.osmocom.org/4580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4eb153701baf1652394bda7505dcd3bc31e28570 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:48:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:48:48 +0000 Subject: [MERGED] osmo-ci[master]: gerrit-verifications.yml: Don't build drafts or no-code-changes In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gerrit-verifications.yml: Don't build drafts or no-code-changes ...................................................................... gerrit-verifications.yml: Don't build drafts or no-code-changes Change-Id: I19e8004a2016626e3525eca690c84800715e4fdc --- M jobs/gerrit-verifications.yml 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index ffb7116..875a7b6 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -234,7 +234,9 @@ triggers: - gerrit: trigger-on: - - patchset-created-event + - patchset-created-event: + exclude-drafts: true + exclude-no-code-change: true - comment-added-event: approval-category: 'Verified' approval-value: 1 -- To view, visit https://gerrit.osmocom.org/4579 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I19e8004a2016626e3525eca690c84800715e4fdc Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:48:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:48:48 +0000 Subject: [MERGED] osmo-ci[master]: gerrit-verifcations.yml: Make sure we add a +V=1 on successf... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gerrit-verifcations.yml: Make sure we add a +V=1 on successful builds ...................................................................... gerrit-verifcations.yml: Make sure we add a +V=1 on successful builds Change-Id: I0b3bcb4661a144e231613398031c0aadf8781bb8 --- M jobs/gerrit-verifications.yml 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 5d2d016..ffb7116 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -235,6 +235,9 @@ - gerrit: trigger-on: - patchset-created-event + - comment-added-event: + approval-category: 'Verified' + approval-value: 1 projects: - project-compare-type: 'PLAIN' project-pattern: '{repos}' -- To view, visit https://gerrit.osmocom.org/4578 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0b3bcb4661a144e231613398031c0aadf8781bb8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Oct 29 17:48:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Oct 2017 17:48:48 +0000 Subject: [MERGED] osmo-ci[master]: gerrit-verifications.yml: Add missing git 'name' and 'refspec' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gerrit-verifications.yml: Add missing git 'name' and 'refspec' ...................................................................... gerrit-verifications.yml: Add missing git 'name' and 'refspec' The 'name' and 'refspec' attributes for the git SCM fetcher were not configured correctly (like in old manual job definitions) Change-Id: Ibc63751838c14a449464afeec56930021bef37be --- M jobs/gerrit-verifications.yml 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 9d3bc89..5d2d016 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -223,6 +223,8 @@ credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d branches: - $GERRIT_BRANCH + refspec: $GERRIT_REFSPEC + name: choosing-strategy: gerrit wipe-workspace: false skip-tag: true -- To view, visit https://gerrit.osmocom.org/4577 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibc63751838c14a449464afeec56930021bef37be Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Oct 30 02:20:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 02:20:20 +0000 Subject: osmo-msc[master]: msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuilt In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4551/1/tests/msc_vlr/Makefile.am File tests/msc_vlr/Makefile.am: Line 135: $(top_builddir)/src/libmsc/libmsc.a \ > shouldn't dis work automatically? Would it work if we had those libraries i ah, that makes a lot of sense. Apparently it's just 'LDADD'. -- To view, visit https://gerrit.osmocom.org/4551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbdedc1581fa23abe9ed99cef3918592b25f30b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 30 02:20:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 02:20:54 +0000 Subject: [PATCH] osmo-msc[master]: msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuilt In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4551 to look at the new patch set (#2). msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuilt Before this, a code change in libvlr or libmsc would not cause a rebuild of the tests. You'd have thought 'AM_LDADD' were the right name for the variable, but apparently it is just 'LDADD' instead. Tested that it works as intended. Change-Id: Icbdedc1581fa23abe9ed99cef3918592b25f30b3 --- M tests/msc_vlr/Makefile.am 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/51/4551/2 diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 9af9870..b1bf78e 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -31,6 +31,9 @@ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ + $(NULL) + +LDADD = \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libvlr/libvlr.a \ -- To view, visit https://gerrit.osmocom.org/4551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icbdedc1581fa23abe9ed99cef3918592b25f30b3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 02:30:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 02:30:09 +0000 Subject: [PATCH] osmo-msc[master]: NOT FOR MERGE: testing gerrit build Message-ID: Review at https://gerrit.osmocom.org/4581 NOT FOR MERGE: testing gerrit build Change-Id: I1f9ba87b633a0c1b07d03dcb1f6e757eeb1f2bd0 --- M configure.ac 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/81/4581/1 diff --git a/configure.ac b/configure.ac index 86bb870..b8f9df6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,3 +1,4 @@ + dnl Process this file with autoconf to produce a configure script AC_INIT([osmo-msc], m4_esyscmd([./git-version-gen .tarball-version]), -- To view, visit https://gerrit.osmocom.org/4581 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f9ba87b633a0c1b07d03dcb1f6e757eeb1f2bd0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:05 +0000 Subject: [PATCH] osmo-ci[master]: jobs: gerrit: fix osmo-msc: missing ARTIFACT_STORE docker mount Message-ID: Review at https://gerrit.osmocom.org/4582 jobs: gerrit: fix osmo-msc: missing ARTIFACT_STORE docker mount Change-Id: Ibeca6f1afad263fb9756ad1d6ce3e55d51ac322b --- M jobs/gerrit-verifications.yml 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/82/4582/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 65e07a1..e52c301 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -134,6 +134,7 @@ -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ -w /build -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + -v "$ARTIFACT_STORE:/artifact_store" \ osmocom:amd64 /build/contrib/jenkins.sh - osmo-pcap: -- To view, visit https://gerrit.osmocom.org/4582 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibeca6f1afad263fb9756ad1d6ce3e55d51ac322b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:05 +0000 Subject: [PATCH] osmo-ci[master]: jobs: gerrit: fix: don't do git plugin cleanup Message-ID: Review at https://gerrit.osmocom.org/4583 jobs: gerrit: fix: don't do git plugin cleanup After the "manual" cleanup from I2409b2928b4d7ebbd6c005097d4ad7337307dd93 has been applied in numerous jenkins.sh scripts of the various osmocom projects, drop the git plugin cleanup step. Rationale: - The git plugin cleanup apparently does not check against non-writable files, like leftovers from a failed 'make distcheck'. If any are left behind, the build fails even before the build steps start. - The git cleanup would wipe out all git clones, which we're trying to re-use across rebuilds now. The osmo-clean-workspace.sh takes care of this, so don't use the jenkins plugin. Change-Id: I8a43b851cef2ad7e8582f1e9bbe3547e3b77fc1a --- M jobs/gerrit-verifications.yml 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/83/4583/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index e52c301..969b483 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -229,8 +229,6 @@ choosing-strategy: gerrit wipe-workspace: false skip-tag: true - clean: - before: true triggers: - gerrit: -- To view, visit https://gerrit.osmocom.org/4583 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a43b851cef2ad7e8582f1e9bbe3547e3b77fc1a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:06 +0000 Subject: [PATCH] osmo-ci[master]: jobs: fix multiline cmds with less-indented first line comments Message-ID: Review at https://gerrit.osmocom.org/4584 jobs: fix multiline cmds with less-indented first line comments Interestingly enough, only a line that has more indenting than the first line also receives an actual newline in the resulting jenkins Execute Shell section. Hence insert '# keep first line with less indent' comments. Change-Id: I13bcb41fa0e59b60a201c2b769bad42067e34ab8 --- M jobs/gerrit-verifications.yml 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/84/4584/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 969b483..cabd5ca 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -51,6 +51,7 @@ a1: !!python/tuple [arm-none-eabi, amd64] combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' cmd: > + # keep first line with less indent to preserve newlines if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then ./contrib/jenkins-arm.sh else @@ -68,9 +69,9 @@ a3_name: IU a3: !!python/tuple [--disable-iu] cmd: > + # keep first line with less indent to preserve newlines ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" - docker run --rm=true -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" \ @@ -127,9 +128,9 @@ a1_name: IU a1: !!python/tuple [--enable-iu, --disable-iu] cmd: > + # keep first line with less indent to preserve newlines ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" - docker run --rm=true -i -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ -- To view, visit https://gerrit.osmocom.org/4584 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13bcb41fa0e59b60a201c2b769bad42067e34ab8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:06 +0000 Subject: [PATCH] osmo-ci[master]: jobs: overhaul README to actually help in usage Message-ID: Review at https://gerrit.osmocom.org/4585 jobs: overhaul README to actually help in usage Change-Id: I5981583d9248bfb47a42e930bd7733bfbce1219c --- M jobs/README.adoc 1 file changed, 53 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/85/4585/1 diff --git a/jobs/README.adoc b/jobs/README.adoc index b8c8164..b18d7aa 100644 --- a/jobs/README.adoc +++ b/jobs/README.adoc @@ -1,31 +1,67 @@ -This "jobs" folder holds +These jenkins.osmocom.org job definitions, managed by https://docs.openstack.org/infra/jenkins-job-builder/index.html[Jenkins Job Builder] -YAML files, which define jenkins' jobs. -One can declare a single job per file or create a job-template to declare several jobs of the same kind. -The gerrit-verifications.yaml file for example holds all gerrit verification jobs. +*Prepare:* -''' -*WIP:* Furthermore, we're planning to automatically deploy merged changes by having two jobs based on gerrit events: +Install jenkins-job-builder: -pre-merge: + apt-get install jenkins-job-builder -- test generation of XML +Have a jenkins-job-builder.ini file. Convenient is to place a system wide one, +if you're the only one using the system, at /etc/jenkins_jobs/jenkins_jobs.ini; +otherwise place one in here and pass it to jenkins-jobs using the --conf file. -post-merge: +Make sure the file not world readable to minimally safeguard your jenkins password. -- test generation of XML -- deploy jobs +jenkins_jobs.ini: -''' -The XML test generation is done by: + [jenkins] + user=my_user_name + password=my_password + url=https://jenkins.osmocom.org/jenkins - jenkins-jobs test jobs/ +and + chmod go-rwx jenkins_jobs.ini -The deployment will be done by: +*Update a single job on jenkins.osmocom.org:* - jenkins-jobs --conf "$JJB_CONFIGFILE" update jobs/ + jenkins-jobs --conf jenkins_jobs.ini update gerrit-verifications.yml gerrit-osmo-msc -but it is not clear *yet* how we want to store/inject the `"$JJB_CONFIGFILE"` part. +NOTE: when you supply a name not defined in that yml file, you will not get an +error message, just nothing will happen. +*Update all jobs of one file:* + + jenkins-jobs --conf jenkins_jobs.ini update gerrit-verifications.yml + +*Update all jobs in all files:* + + jenkins-jobs --conf jenkins_jobs.ini update ./ + +*Troubleshooting:* + +- 'jenkins.JenkinsException: create[gerrit-osmo-msc] failed' + +jenkins.osmocom.org is not reachable, or URL in the config file is erratic. +Make sure it is exactly + + url=https://jenkins.osmocom.org/jenkins + +- newlines: + +The build commands may be multiline, but especially in the +gerrit-verifications.yml, where the commands are first stored in 'cmd' and +later inserted in a 'shell' section, the newlines between individual shell +lines don't all survive. Interestingly enough, only a line that has more +indenting than the first line also receives an actual newline in the resulting +jenkins Execute Shell section; take a look at the job's config page on jenkins. +Hence we often have a '# keep first line with less indent' comment. The safest +way to ensure the commands work is to insert ';' at the end of each and every +shell command. Still keep '\' at the end of lines to be combined, because you +can't rely on newlines being omitted, either. + +- jobs named on cmdline are not updated: + +Make sure the job name is correct, or just issue an entire yml file without +individual job names. -- To view, visit https://gerrit.osmocom.org/4585 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5981583d9248bfb47a42e930bd7733bfbce1219c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:06 +0000 Subject: [PATCH] osmo-ci[master]: jobs: yml files: set vim expandtab (and shiftwidth) Message-ID: Review at https://gerrit.osmocom.org/4586 jobs: yml files: set vim expandtab (and shiftwidth) Having tabs in the yml files cause parse errors. For vim convenience, add comments that instruct vim to expand the tabs to spaces. Change-Id: I5f0598a31e30d1a9440c40935644bb782f645664 --- M jobs/gerrit-verifications.yml M jobs/osmocom-nightly-nitb-split.yml M jobs/osmocom-obs-latest.yml 3 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/86/4586/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index cabd5ca..abde21e 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -265,3 +265,5 @@ console-log-parsers: - 'GNU C Compiler 4 (gcc)' resolve-relative-paths: true + +# vim: expandtab tabstop=2 shiftwidth=2 diff --git a/jobs/osmocom-nightly-nitb-split.yml b/jobs/osmocom-nightly-nitb-split.yml index 7dbf46f..4c64de4 100644 --- a/jobs/osmocom-nightly-nitb-split.yml +++ b/jobs/osmocom-nightly-nitb-split.yml @@ -20,3 +20,5 @@ git-config-email: 'jenkins at osmocom.org' triggers: - timed: "@midnight" + +# vim: expandtab tabstop=2 shiftwidth=2 diff --git a/jobs/osmocom-obs-latest.yml b/jobs/osmocom-obs-latest.yml index 337e067..def633f 100644 --- a/jobs/osmocom-obs-latest.yml +++ b/jobs/osmocom-obs-latest.yml @@ -20,3 +20,5 @@ git-config-email: 'jenkins at osmocom.org' triggers: - timed: "@midnight" + +# vim: expandtab tabstop=2 shiftwidth=2 -- To view, visit https://gerrit.osmocom.org/4586 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f0598a31e30d1a9440c40935644bb782f645664 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:06 +0000 Subject: [PATCH] osmo-ci[master]: gitignore: also ignore jenkins-jobs.ini with a dash Message-ID: Review at https://gerrit.osmocom.org/4587 gitignore: also ignore jenkins-jobs.ini with a dash Some may "accidentally" use a dash when reading the README file. Change-Id: I34877e2ba874c71b1be0079125f3662a9492a314 --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/87/4587/1 diff --git a/.gitignore b/.gitignore index 4163eb6..07c4349 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ tokens.txt .*.sw? jenkins_jobs.ini +jenkins-jobs.ini -- To view, visit https://gerrit.osmocom.org/4587 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I34877e2ba874c71b1be0079125f3662a9492a314 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:18 +0000 Subject: [MERGED] osmo-ci[master]: gitignore: also ignore jenkins-jobs.ini with a dash In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gitignore: also ignore jenkins-jobs.ini with a dash ...................................................................... gitignore: also ignore jenkins-jobs.ini with a dash Some may "accidentally" use a dash when reading the README file. Change-Id: I34877e2ba874c71b1be0079125f3662a9492a314 --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 4163eb6..07c4349 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ tokens.txt .*.sw? jenkins_jobs.ini +jenkins-jobs.ini -- To view, visit https://gerrit.osmocom.org/4587 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I34877e2ba874c71b1be0079125f3662a9492a314 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:18 +0000 Subject: [MERGED] osmo-ci[master]: jobs: yml files: set vim expandtab (and shiftwidth) In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jobs: yml files: set vim expandtab (and shiftwidth) ...................................................................... jobs: yml files: set vim expandtab (and shiftwidth) Having tabs in the yml files cause parse errors. For vim convenience, add comments that instruct vim to expand the tabs to spaces. Change-Id: I5f0598a31e30d1a9440c40935644bb782f645664 --- M jobs/gerrit-verifications.yml M jobs/osmocom-nightly-nitb-split.yml M jobs/osmocom-obs-latest.yml 3 files changed, 6 insertions(+), 0 deletions(-) diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index cabd5ca..abde21e 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -265,3 +265,5 @@ console-log-parsers: - 'GNU C Compiler 4 (gcc)' resolve-relative-paths: true + +# vim: expandtab tabstop=2 shiftwidth=2 diff --git a/jobs/osmocom-nightly-nitb-split.yml b/jobs/osmocom-nightly-nitb-split.yml index 7dbf46f..4c64de4 100644 --- a/jobs/osmocom-nightly-nitb-split.yml +++ b/jobs/osmocom-nightly-nitb-split.yml @@ -20,3 +20,5 @@ git-config-email: 'jenkins at osmocom.org' triggers: - timed: "@midnight" + +# vim: expandtab tabstop=2 shiftwidth=2 diff --git a/jobs/osmocom-obs-latest.yml b/jobs/osmocom-obs-latest.yml index 337e067..def633f 100644 --- a/jobs/osmocom-obs-latest.yml +++ b/jobs/osmocom-obs-latest.yml @@ -20,3 +20,5 @@ git-config-email: 'jenkins at osmocom.org' triggers: - timed: "@midnight" + +# vim: expandtab tabstop=2 shiftwidth=2 -- To view, visit https://gerrit.osmocom.org/4586 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5f0598a31e30d1a9440c40935644bb782f645664 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:18 +0000 Subject: [MERGED] osmo-ci[master]: jobs: overhaul README to actually help in usage In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jobs: overhaul README to actually help in usage ...................................................................... jobs: overhaul README to actually help in usage Change-Id: I5981583d9248bfb47a42e930bd7733bfbce1219c --- M jobs/README.adoc 1 file changed, 53 insertions(+), 17 deletions(-) diff --git a/jobs/README.adoc b/jobs/README.adoc index b8c8164..b18d7aa 100644 --- a/jobs/README.adoc +++ b/jobs/README.adoc @@ -1,31 +1,67 @@ -This "jobs" folder holds +These jenkins.osmocom.org job definitions, managed by https://docs.openstack.org/infra/jenkins-job-builder/index.html[Jenkins Job Builder] -YAML files, which define jenkins' jobs. -One can declare a single job per file or create a job-template to declare several jobs of the same kind. -The gerrit-verifications.yaml file for example holds all gerrit verification jobs. +*Prepare:* -''' -*WIP:* Furthermore, we're planning to automatically deploy merged changes by having two jobs based on gerrit events: +Install jenkins-job-builder: -pre-merge: + apt-get install jenkins-job-builder -- test generation of XML +Have a jenkins-job-builder.ini file. Convenient is to place a system wide one, +if you're the only one using the system, at /etc/jenkins_jobs/jenkins_jobs.ini; +otherwise place one in here and pass it to jenkins-jobs using the --conf file. -post-merge: +Make sure the file not world readable to minimally safeguard your jenkins password. -- test generation of XML -- deploy jobs +jenkins_jobs.ini: -''' -The XML test generation is done by: + [jenkins] + user=my_user_name + password=my_password + url=https://jenkins.osmocom.org/jenkins - jenkins-jobs test jobs/ +and + chmod go-rwx jenkins_jobs.ini -The deployment will be done by: +*Update a single job on jenkins.osmocom.org:* - jenkins-jobs --conf "$JJB_CONFIGFILE" update jobs/ + jenkins-jobs --conf jenkins_jobs.ini update gerrit-verifications.yml gerrit-osmo-msc -but it is not clear *yet* how we want to store/inject the `"$JJB_CONFIGFILE"` part. +NOTE: when you supply a name not defined in that yml file, you will not get an +error message, just nothing will happen. +*Update all jobs of one file:* + + jenkins-jobs --conf jenkins_jobs.ini update gerrit-verifications.yml + +*Update all jobs in all files:* + + jenkins-jobs --conf jenkins_jobs.ini update ./ + +*Troubleshooting:* + +- 'jenkins.JenkinsException: create[gerrit-osmo-msc] failed' + +jenkins.osmocom.org is not reachable, or URL in the config file is erratic. +Make sure it is exactly + + url=https://jenkins.osmocom.org/jenkins + +- newlines: + +The build commands may be multiline, but especially in the +gerrit-verifications.yml, where the commands are first stored in 'cmd' and +later inserted in a 'shell' section, the newlines between individual shell +lines don't all survive. Interestingly enough, only a line that has more +indenting than the first line also receives an actual newline in the resulting +jenkins Execute Shell section; take a look at the job's config page on jenkins. +Hence we often have a '# keep first line with less indent' comment. The safest +way to ensure the commands work is to insert ';' at the end of each and every +shell command. Still keep '\' at the end of lines to be combined, because you +can't rely on newlines being omitted, either. + +- jobs named on cmdline are not updated: + +Make sure the job name is correct, or just issue an entire yml file without +individual job names. -- To view, visit https://gerrit.osmocom.org/4585 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5981583d9248bfb47a42e930bd7733bfbce1219c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:19 +0000 Subject: [MERGED] osmo-ci[master]: jobs: fix multiline cmds with less-indented first line comments In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jobs: fix multiline cmds with less-indented first line comments ...................................................................... jobs: fix multiline cmds with less-indented first line comments Interestingly enough, only a line that has more indenting than the first line also receives an actual newline in the resulting jenkins Execute Shell section. Hence insert '# keep first line with less indent' comments. Change-Id: I13bcb41fa0e59b60a201c2b769bad42067e34ab8 --- M jobs/gerrit-verifications.yml 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 969b483..cabd5ca 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -51,6 +51,7 @@ a1: !!python/tuple [arm-none-eabi, amd64] combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' cmd: > + # keep first line with less indent to preserve newlines if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then ./contrib/jenkins-arm.sh else @@ -68,9 +69,9 @@ a3_name: IU a3: !!python/tuple [--disable-iu] cmd: > + # keep first line with less indent to preserve newlines ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" - docker run --rm=true -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" \ @@ -127,9 +128,9 @@ a1_name: IU a1: !!python/tuple [--enable-iu, --disable-iu] cmd: > + # keep first line with less indent to preserve newlines ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" - docker run --rm=true -i -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ -- To view, visit https://gerrit.osmocom.org/4584 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I13bcb41fa0e59b60a201c2b769bad42067e34ab8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:19 +0000 Subject: [MERGED] osmo-ci[master]: jobs: gerrit: fix: don't do git plugin cleanup In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jobs: gerrit: fix: don't do git plugin cleanup ...................................................................... jobs: gerrit: fix: don't do git plugin cleanup After the "manual" cleanup from I2409b2928b4d7ebbd6c005097d4ad7337307dd93 has been applied in numerous jenkins.sh scripts of the various osmocom projects, drop the git plugin cleanup step. Rationale: - The git plugin cleanup apparently does not check against non-writable files, like leftovers from a failed 'make distcheck'. If any are left behind, the build fails even before the build steps start. - The git cleanup would wipe out all git clones, which we're trying to re-use across rebuilds now. The osmo-clean-workspace.sh takes care of this, so don't use the jenkins plugin. Change-Id: I8a43b851cef2ad7e8582f1e9bbe3547e3b77fc1a --- M jobs/gerrit-verifications.yml 1 file changed, 0 insertions(+), 2 deletions(-) diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index e52c301..969b483 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -229,8 +229,6 @@ choosing-strategy: gerrit wipe-workspace: false skip-tag: true - clean: - before: true triggers: - gerrit: -- To view, visit https://gerrit.osmocom.org/4583 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8a43b851cef2ad7e8582f1e9bbe3547e3b77fc1a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:19 +0000 Subject: [MERGED] osmo-ci[master]: jobs: gerrit: fix osmo-msc: missing ARTIFACT_STORE docker mount In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jobs: gerrit: fix osmo-msc: missing ARTIFACT_STORE docker mount ...................................................................... jobs: gerrit: fix osmo-msc: missing ARTIFACT_STORE docker mount Change-Id: Ibeca6f1afad263fb9756ad1d6ce3e55d51ac322b --- M jobs/gerrit-verifications.yml 1 file changed, 1 insertion(+), 0 deletions(-) diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 65e07a1..e52c301 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -134,6 +134,7 @@ -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ -w /build -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + -v "$ARTIFACT_STORE:/artifact_store" \ osmocom:amd64 /build/contrib/jenkins.sh - osmo-pcap: -- To view, visit https://gerrit.osmocom.org/4582 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibeca6f1afad263fb9756ad1d6ce3e55d51ac322b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:04:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:04:47 +0000 Subject: [PATCH] cellmgr-ng[master]: jenkins: use common osmo-build-dep.sh and osmo-clean-workspa... Message-ID: Review at https://gerrit.osmocom.org/4588 jenkins: use common osmo-build-dep.sh and osmo-clean-workspace.sh Since the gerrit build jobs no longer contain git clean workspace config (for good reasons), it is important to use osmo-clean-workspace.sh. To make it work best, this jenkins.sh should follow the same structure as most others do. Change-Id: I4f5c2346f3b811c1550bf114e1692d33321118cc --- M contrib/jenkins.sh 1 file changed, 38 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/cellmgr-ng refs/changes/88/4588/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 679df6a..ad975a5 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,41 +1,45 @@ #!/usr/bin/env bash +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -rm -rf deps/install -mkdir deps || true -cd deps -osmo-deps.sh libosmocore +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst -cd libosmocore +osmo-clean-workspace.sh + +mkdir "$deps" || true + +osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false + +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmo-abis +osmo-build-dep.sh libosmo-netif +osmo-build-dep.sh libosmo-sccp + +set +x +echo +echo +echo +echo " =============================== cellmgr-ng ===============================" +echo +set -x + +cd "$base" autoreconf --install --force -./configure --prefix=$PWD/../install ac_cv_path_DOXYGEN=false -$MAKE $PARALLEL_MAKE install +./configure --enable-external-tests +$MAKE $PARALLEL_MAKE +$MAKE distcheck \ + || cat-testlogs.sh -cd ../ -osmo-deps.sh libosmo-abis -cd libosmo-abis -autoreconf --install --force -PKG_CONFIG_PATH=$PWD/../install/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=$PWD/../install -PKG_CONFIG_PATH=$PWD/..//install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE $PARALLEL_MAKE install - -cd ../ -osmo-deps.sh libosmo-netif -cd libosmo-netif -autoreconf --install --force -PKG_CONFIG_PATH=$PWD/../install/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=$PWD/../install -PKG_CONFIG_PATH=$PWD/..//install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE $PARALLEL_MAKE install - - -cd ../ -osmo-deps.sh libosmo-sccp -cd libosmo-sccp -autoreconf --install --force -PKG_CONFIG_PATH=$PWD/../install/lib/pkgconfig ./configure --prefix=$PWD/../install -PKG_CONFIG_PATH=$PWD/..//install/lib/pkgconfig $MAKE $PARALLEL_MAKE install - -cd ../../ -autoreconf --install --force -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig ./configure --enable-external-tests -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig $MAKE $PARALLEL_MAKE -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4588 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f5c2346f3b811c1550bf114e1692d33321118cc Gerrit-PatchSet: 1 Gerrit-Project: cellmgr-ng Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:05:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:05:02 +0000 Subject: [PATCH] osmo-tetra[master]: jenkins: use common osmo-build-dep.sh and osmo-clean-workspa... Message-ID: Review at https://gerrit.osmocom.org/4589 jenkins: use common osmo-build-dep.sh and osmo-clean-workspace.sh Since the gerrit build jobs no longer contain git clean workspace config (for good reasons), it is important to use osmo-clean-workspace.sh. To make it work best, this jenkins.sh should follow the same structure as most others do. Change-Id: I3eca957c52b2c018e4c784b29330a0d06c4e3595 --- M contrib/jenkins.sh 1 file changed, 37 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/89/4589/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 503b6a0..895ffc6 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,15 +1,40 @@ -#!/bin/sh -ex +#!/usr/bin/env bash +# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org -rm -rf deps/install -mkdir deps || true -cd deps -osmo-deps.sh libosmocore +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi -cd libosmocore -autoreconf --install --force -./configure --prefix=$PWD/../install -$MAKE $PARALLEL_MAKE install +set -ex -cd ../../src -make clean || true -PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig $MAKE +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +osmo-clean-workspace.sh + +mkdir "$deps" || true + +osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false + +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +set +x +echo +echo +echo +echo " =============================== osmo-tetra ===============================" +echo +set -x + +cd "$base" +cd src +$MAKE clean || true +$MAKE + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4589 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3eca957c52b2c018e4c784b29330a0d06c4e3595 Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:05:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:05:14 +0000 Subject: [PATCH] osmocom-bb[master]: jenkins: use osmo-clean-workspace.sh before and after build Message-ID: Review at https://gerrit.osmocom.org/4590 jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Change-Id: I87cc6aa7d6c332a0c2b4644dc8addc0f1a7df49d --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/90/4590/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index ca72ac5..78c0b59 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -7,8 +7,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false @@ -30,3 +31,5 @@ autoreconf -fi ./configure make + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4590 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I87cc6aa7d6c332a0c2b4644dc8addc0f1a7df49d Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:05:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:05:46 +0000 Subject: [ABANDON] osmo-msc[master]: NOT FOR MERGE: testing gerrit build In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: NOT FOR MERGE: testing gerrit build ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4581 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I1f9ba87b633a0c1b07d03dcb1f6e757eeb1f2bd0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 30 04:19:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 04:19:15 +0000 Subject: cellmgr-ng[master]: jenkins: use common osmo-build-dep.sh and osmo-clean-workspa... In-Reply-To: References: Message-ID: Patch Set 1: An unrelated failure seems to hinder this from succeeding: sctp_m3ua_client.c:25:40: fatal error: osmocom/sigtran/m3ua_types.h: No such file or directory #include No such file actually exists in libosmo-sccp. Not fixing this now, hoping that someone else will... -- To view, visit https://gerrit.osmocom.org/4588 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f5c2346f3b811c1550bf114e1692d33321118cc Gerrit-PatchSet: 1 Gerrit-Project: cellmgr-ng Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 30 08:44:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Oct 2017 08:44:31 +0000 Subject: osmo-pcu[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8aa657c4bf62ef62549fbe9dc15ce3fb018d8d9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 30 08:44:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Oct 2017 08:44:37 +0000 Subject: [MERGED] osmo-pcu[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: If8aa657c4bf62ef62549fbe9dc15ce3fb018d8d9 --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b815ddd..fb529a4 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -19,8 +19,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" # Collect configure options for osmo-pcu PCU_CONFIG="" @@ -80,3 +81,5 @@ DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \ $MAKE distcheck \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If8aa657c4bf62ef62549fbe9dc15ce3fb018d8d9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 08:45:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Oct 2017 08:45:07 +0000 Subject: osmo-msc[master]: msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuilt In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbdedc1581fa23abe9ed99cef3918592b25f30b3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 30 09:43:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 30 Oct 2017 09:43:40 +0000 Subject: [ABANDON] osmo-pcu[master]: Move all rate counter related code together In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Move all rate counter related code together ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I795631752af3b9077a846c3123217e1deda52e86 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 30 09:44:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 30 Oct 2017 09:44:17 +0000 Subject: [ABANDON] osmo-pcu[master]: Initialize logging before initializing rate_ctr In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Initialize logging before initializing rate_ctr ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Oct 30 09:48:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 30 Oct 2017 09:48:29 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Remove FreeBSD_amd64 builds In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4576 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c6d2a17c3cf9d8c78c3675995493e30cbc6be0d Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Oct 30 09:58:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 30 Oct 2017 09:58:03 +0000 Subject: [ABANDON] osmo-sgsn[master]: deb: install .service files In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: deb: install .service files ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I392a90299489bc217a0a8cd8e4cf400cfe6b1bcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Mon Oct 30 09:59:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 30 Oct 2017 09:59:58 +0000 Subject: =?UTF-8?Q?=5BABANDON=5D_libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E0=2E7_=E2=86=92_0=2E0=2E8?= In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Bump version: 0.0.7 ? 0.0.8 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ifc8b9ca64edd40f96cea92388d0e2f000ee07a9d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From admin at opensuse.org Mon Oct 30 09:21:53 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:21:53 +0000 Subject: Build failure of network:osmocom:latest/libasn1c in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <59f7006f2fa86_638112baf881287c5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libasn1c/xUbuntu_17.10/x86_64 Package network:osmocom:latest/libasn1c failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest libasn1c Last lines of build log: [ 126s] dpkg-genbuildinfo [ 126s] dpkg-genchanges >../libasn1c_0.9.28_amd64.changes [ 126s] dpkg-genchanges: info: including full source code in upload [ 126s] dpkg-source --after-build BUILD [ 126s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 126s] Warning: mkbaselibs missing in build root, skipping baselibs [ 126s] ... saving statistics [ 126s] ... saving built packages [ 126s] DEBS/libasn1c_0.9.28.dsc [ 126s] DEBS/libasn1c_0.9.28_amd64.changes [ 126s] DEBS/libasn1c-dbg_0.9.28_amd64.deb [ 126s] DEBS/libasn1c0_0.9.28_amd64.deb [ 126s] DEBS/libasn1c-dev_0.9.28_amd64.deb [ 126s] DEBS/libasn1c_0.9.28.tar.xz [ 126s] OTHER/_statistics [ 126s] [ 126s] lamb17 finished "build libasn1c_0.9.28.dsc" at Mon Oct 30 00:59:06 UTC 2017. [ 126s] [ 126s] ### VM INTERACTION START ### [ 129s] [ 122.797991] reboot: Power down [ 129s] ### VM INTERACTION END ### [ 129s] build: extracting built packages... [ 129s] DEBS/libasn1c_0.9.28.dsc [ 129s] DEBS/libasn1c_0.9.28_amd64.changes [ 129s] DEBS/libasn1c-dbg_0.9.28_amd64.deb [ 129s] DEBS/libasn1c0_0.9.28_amd64.deb [ 129s] DEBS/libasn1c-dev_0.9.28_amd64.deb [ 129s] DEBS/libasn1c_0.9.28.tar.xz [ 129s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:21:53 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:21:53 +0000 Subject: Build failure of network:osmocom:latest/libasn1c in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f7006fbf687_638112baf881288c1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libasn1c/xUbuntu_17.04/i586 Package network:osmocom:latest/libasn1c failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:latest libasn1c Last lines of build log: [ 138s] dpkg-deb: building package 'libasn1c-dbg' in '../libasn1c-dbg_0.9.28_i386.deb'. [ 139s] dpkg-genchanges >../libasn1c_0.9.28_i386.changes [ 139s] dpkg-genchanges: info: including full source code in upload [ 139s] dpkg-source --after-build BUILD [ 139s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 139s] Warning: mkbaselibs missing in build root, skipping baselibs [ 139s] ... saving statistics [ 139s] ... saving built packages [ 139s] DEBS/libasn1c_0.9.28.tar.xz [ 139s] DEBS/libasn1c_0.9.28_i386.changes [ 139s] DEBS/libasn1c_0.9.28.dsc [ 139s] DEBS/libasn1c-dev_0.9.28_i386.deb [ 139s] DEBS/libasn1c-dbg_0.9.28_i386.deb [ 139s] DEBS/libasn1c0_0.9.28_i386.deb [ 139s] OTHER/_statistics [ 139s] [ 139s] lamb20 finished "build libasn1c_0.9.28.dsc" at Mon Oct 30 00:59:18 UTC 2017. [ 139s] [ 139s] ### VM INTERACTION START ### [ 142s] [ 132.929045] reboot: Power down [ 142s] ### VM INTERACTION END ### [ 142s] build: extracting built packages... [ 142s] DEBS/libasn1c_0.9.28.tar.xz [ 142s] DEBS/libasn1c_0.9.28_i386.changes [ 142s] DEBS/libasn1c_0.9.28.dsc [ 142s] DEBS/libasn1c-dev_0.9.28_i386.deb [ 142s] DEBS/libasn1c-dbg_0.9.28_i386.deb [ 142s] DEBS/libasn1c0_0.9.28_i386.deb [ 142s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:21:53 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:21:53 +0000 Subject: Build failure of network:osmocom:latest/libasn1c in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59f7006e435e6_638112baf881285a1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libasn1c/xUbuntu_17.04/x86_64 Package network:osmocom:latest/libasn1c failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest libasn1c Last lines of build log: [ 128s] dpkg-deb: building package 'libasn1c-dev' in '../libasn1c-dev_0.9.28_amd64.deb'. [ 128s] dpkg-genchanges >../libasn1c_0.9.28_amd64.changes [ 128s] dpkg-genchanges: info: including full source code in upload [ 128s] dpkg-source --after-build BUILD [ 129s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 129s] Warning: mkbaselibs missing in build root, skipping baselibs [ 129s] ... saving statistics [ 129s] ... saving built packages [ 129s] DEBS/libasn1c_0.9.28_amd64.changes [ 129s] DEBS/libasn1c_0.9.28.tar.xz [ 129s] DEBS/libasn1c-dbg_0.9.28_amd64.deb [ 129s] DEBS/libasn1c0_0.9.28_amd64.deb [ 129s] DEBS/libasn1c_0.9.28.dsc [ 129s] DEBS/libasn1c-dev_0.9.28_amd64.deb [ 129s] OTHER/_statistics [ 129s] [ 129s] lamb03 finished "build libasn1c_0.9.28.dsc" at Mon Oct 30 00:58:49 UTC 2017. [ 129s] [ 129s] ### VM INTERACTION START ### [ 132s] [ 125.017482] reboot: Power down [ 132s] ### VM INTERACTION END ### [ 132s] build: extracting built packages... [ 132s] DEBS/libasn1c_0.9.28_amd64.changes [ 132s] DEBS/libasn1c_0.9.28.tar.xz [ 132s] DEBS/libasn1c-dbg_0.9.28_amd64.deb [ 132s] DEBS/libasn1c0_0.9.28_amd64.deb [ 132s] DEBS/libasn1c_0.9.28.dsc [ 132s] DEBS/libasn1c-dev_0.9.28_amd64.deb [ 132s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:21:54 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:21:54 +0000 Subject: Build failure of network:osmocom:latest/libasn1c in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59f70070a3b59_638112baf8812890@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libasn1c/Debian_9.0/i586 Package network:osmocom:latest/libasn1c failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:latest libasn1c Last lines of build log: [ 191s] dpkg-genbuildinfo [ 191s] dpkg-genchanges >../libasn1c_0.9.28_i386.changes [ 192s] dpkg-genchanges: info: including full source code in upload [ 192s] dpkg-source --after-build BUILD [ 192s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 192s] Warning: mkbaselibs missing in build root, skipping baselibs [ 192s] ... saving statistics [ 192s] ... saving built packages [ 192s] DEBS/libasn1c_0.9.28.tar.xz [ 192s] DEBS/libasn1c0_0.9.28_i386.deb [ 192s] DEBS/libasn1c_0.9.28.dsc [ 192s] DEBS/libasn1c-dbg_0.9.28_i386.deb [ 192s] DEBS/libasn1c_0.9.28_i386.changes [ 192s] DEBS/libasn1c-dev_0.9.28_i386.deb [ 192s] OTHER/_statistics [ 192s] [ 192s] cloud120 finished "build libasn1c_0.9.28.dsc" at Mon Oct 30 00:59:56 UTC 2017. [ 192s] [ 192s] ### VM INTERACTION START ### [ 195s] [ 161.972723] reboot: Power down [ 196s] ### VM INTERACTION END ### [ 196s] build: extracting built packages... [ 197s] DEBS/libasn1c_0.9.28.tar.xz [ 197s] DEBS/libasn1c0_0.9.28_i386.deb [ 197s] DEBS/libasn1c_0.9.28.dsc [ 197s] DEBS/libasn1c-dbg_0.9.28_i386.deb [ 197s] DEBS/libasn1c_0.9.28_i386.changes [ 197s] DEBS/libasn1c-dev_0.9.28_i386.deb [ 197s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:21:53 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:21:53 +0000 Subject: Build failure of network:osmocom:latest/libasn1c in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f7006e9cd5a_638112baf88128632@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libasn1c/xUbuntu_16.10/x86_64 Package network:osmocom:latest/libasn1c failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest libasn1c Last lines of build log: [ 155s] dpkg-deb: building package 'libasn1c-dev' in '../libasn1c-dev_0.9.28_amd64.deb'. [ 156s] dpkg-genchanges >../libasn1c_0.9.28_amd64.changes [ 156s] dpkg-genchanges: info: including full source code in upload [ 156s] dpkg-source --after-build BUILD [ 156s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 156s] Warning: mkbaselibs missing in build root, skipping baselibs [ 156s] ... saving statistics [ 156s] ... saving built packages [ 156s] DEBS/libasn1c-dev_0.9.28_amd64.deb [ 156s] DEBS/libasn1c-dbg_0.9.28_amd64.deb [ 156s] DEBS/libasn1c_0.9.28.tar.xz [ 156s] DEBS/libasn1c_0.9.28.dsc [ 156s] DEBS/libasn1c_0.9.28_amd64.changes [ 156s] DEBS/libasn1c0_0.9.28_amd64.deb [ 156s] OTHER/_statistics [ 156s] [ 156s] lamb10 finished "build libasn1c_0.9.28.dsc" at Mon Oct 30 00:59:30 UTC 2017. [ 156s] [ 156s] ### VM INTERACTION START ### [ 159s] [ 152.575015] reboot: Power down [ 159s] ### VM INTERACTION END ### [ 159s] build: extracting built packages... [ 159s] DEBS/libasn1c-dev_0.9.28_amd64.deb [ 159s] DEBS/libasn1c-dbg_0.9.28_amd64.deb [ 159s] DEBS/libasn1c_0.9.28.tar.xz [ 159s] DEBS/libasn1c_0.9.28.dsc [ 159s] DEBS/libasn1c_0.9.28_amd64.changes [ 159s] DEBS/libasn1c0_0.9.28_amd64.deb [ 159s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:21:52 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:21:52 +0000 Subject: Build failure of network:osmocom:latest/libasn1c in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59f7006ce44a3_638112baf881284b0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libasn1c/xUbuntu_16.10/i586 Package network:osmocom:latest/libasn1c failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:latest libasn1c Last lines of build log: [ 123s] dpkg-deb: building package 'libasn1c-dev' in '../libasn1c-dev_0.9.28_i386.deb'. [ 123s] dpkg-genchanges >../libasn1c_0.9.28_i386.changes [ 123s] dpkg-genchanges: info: including full source code in upload [ 123s] dpkg-source --after-build BUILD [ 124s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 124s] Warning: mkbaselibs missing in build root, skipping baselibs [ 124s] ... saving statistics [ 124s] ... saving built packages [ 124s] DEBS/libasn1c-dev_0.9.28_i386.deb [ 124s] DEBS/libasn1c_0.9.28.dsc [ 124s] DEBS/libasn1c_0.9.28_i386.changes [ 124s] DEBS/libasn1c-dbg_0.9.28_i386.deb [ 124s] DEBS/libasn1c_0.9.28.tar.xz [ 124s] DEBS/libasn1c0_0.9.28_i386.deb [ 124s] OTHER/_statistics [ 124s] [ 124s] lamb51 finished "build libasn1c_0.9.28.dsc" at Mon Oct 30 00:59:09 UTC 2017. [ 124s] [ 124s] ### VM INTERACTION START ### [ 127s] [ 119.692321] reboot: Power down [ 127s] ### VM INTERACTION END ### [ 127s] build: extracting built packages... [ 127s] DEBS/libasn1c-dev_0.9.28_i386.deb [ 127s] DEBS/libasn1c_0.9.28.dsc [ 127s] DEBS/libasn1c_0.9.28_i386.changes [ 127s] DEBS/libasn1c-dbg_0.9.28_i386.deb [ 127s] DEBS/libasn1c_0.9.28.tar.xz [ 127s] DEBS/libasn1c0_0.9.28_i386.deb [ 127s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:21:54 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:21:54 +0000 Subject: Build failure of network:osmocom:latest/libasn1c in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59f7007169e24_638112baf881290a5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libasn1c/xUbuntu_16.04/i586 Package network:osmocom:latest/libasn1c failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:latest libasn1c Last lines of build log: [ 253s] dpkg-deb: building package 'libasn1c-dev' in '../libasn1c-dev_0.9.28_i386.deb'. [ 254s] dpkg-genchanges >../libasn1c_0.9.28_i386.changes [ 254s] dpkg-genchanges: including full source code in upload [ 254s] dpkg-source --after-build BUILD [ 254s] dpkg-buildpackage: full upload; Debian-native package (full source is included) [ 255s] Warning: mkbaselibs missing in build root, skipping baselibs [ 255s] ... saving statistics [ 255s] ... saving built packages [ 255s] DEBS/libasn1c-dev_0.9.28_i386.deb [ 255s] DEBS/libasn1c_0.9.28.tar.xz [ 255s] DEBS/libasn1c-dbg_0.9.28_i386.deb [ 255s] DEBS/libasn1c_0.9.28_i386.changes [ 255s] DEBS/libasn1c_0.9.28.dsc [ 255s] DEBS/libasn1c0_0.9.28_i386.deb [ 255s] OTHER/_statistics [ 255s] [ 255s] cloud107 finished "build libasn1c_0.9.28.dsc" at Mon Oct 30 01:00:57 UTC 2017. [ 255s] [ 255s] ### VM INTERACTION START ### [ 258s] [ 216.912680] reboot: Power down [ 259s] ### VM INTERACTION END ### [ 259s] build: extracting built packages... [ 259s] DEBS/libasn1c-dev_0.9.28_i386.deb [ 259s] DEBS/libasn1c_0.9.28.tar.xz [ 259s] DEBS/libasn1c-dbg_0.9.28_i386.deb [ 259s] DEBS/libasn1c_0.9.28_i386.changes [ 259s] DEBS/libasn1c_0.9.28.dsc [ 259s] DEBS/libasn1c0_0.9.28_i386.deb [ 259s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:23:16 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:23:16 +0000 Subject: Build failure of network:osmocom:latest/libasn1c in Debian_9.0/aarch64 In-Reply-To: References: Message-ID: <59f700e62cb82_638112baf88130049@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libasn1c/Debian_9.0/aarch64 Package network:osmocom:latest/libasn1c failed to build in Debian_9.0/aarch64 Check out the package for editing: osc checkout network:osmocom:latest libasn1c Last lines of build log: [ 251s] dpkg-genchanges >../libasn1c_0.9.28_arm64.changes [ 252s] dpkg-genchanges: info: including full source code in upload [ 252s] dpkg-source --after-build BUILD [ 252s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 252s] Warning: mkbaselibs missing in build root, skipping baselibs [ 252s] ... saving statistics [ 252s] ... saving built packages [ 252s] DEBS/libasn1c-dev_0.9.28_arm64.deb [ 252s] DEBS/libasn1c_0.9.28_arm64.changes [ 252s] DEBS/libasn1c_0.9.28.dsc [ 252s] DEBS/libasn1c0_0.9.28_arm64.deb [ 252s] DEBS/libasn1c-dbg_0.9.28_arm64.deb [ 252s] DEBS/libasn1c_0.9.28.tar.xz [ 252s] OTHER/_statistics [ 252s] [ 252s] obs-arm-1 finished "build libasn1c_0.9.28.dsc" at Mon Oct 30 01:00:05 UTC 2017. [ 252s] [ 252s] ### VM INTERACTION START ### [ 255s] [ 241.506696] sysrq: SysRq : Power Off [ 255s] [ 241.509720] reboot: Power down [ 255s] ### VM INTERACTION END ### [ 255s] build: extracting built packages... [ 255s] DEBS/libasn1c-dev_0.9.28_arm64.deb [ 255s] DEBS/libasn1c_0.9.28_arm64.changes [ 255s] DEBS/libasn1c_0.9.28.dsc [ 255s] DEBS/libasn1c0_0.9.28_arm64.deb [ 255s] DEBS/libasn1c-dbg_0.9.28_arm64.deb [ 255s] DEBS/libasn1c_0.9.28.tar.xz [ 255s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:25:31 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:25:31 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in Debian_9.0/aarch64 In-Reply-To: References: Message-ID: <59f7016ae0e4a_638112baf881309a7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/Debian_9.0/aarch64 Package network:osmocom:latest/osmo-bsc failed to build in Debian_9.0/aarch64 Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 285s] dpkg-source --after-build BUILD [ 286s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 286s] Warning: mkbaselibs missing in build root, skipping baselibs [ 286s] ... saving statistics [ 286s] ... saving built packages [ 286s] DEBS/osmo-bsc_1.1.2_arm64.changes [ 286s] DEBS/osmo-bsc_1.1.2.tar.xz [ 286s] DEBS/osmo-bsc_1.1.2.dsc [ 286s] DEBS/osmo-bsc-bs11-utils_1.1.2_arm64.deb [ 286s] DEBS/osmo-bsc-dbg_1.1.2_arm64.deb [ 286s] DEBS/osmo-bsc_1.1.2_arm64.deb [ 286s] DEBS/osmo-bsc-ipaccess-utils_1.1.2_arm64.deb [ 286s] OTHER/_statistics [ 286s] [ 286s] obs-arm-1 finished "build osmo-bsc_1.1.2.dsc" at Mon Oct 30 01:21:44 UTC 2017. [ 286s] [ 286s] ### VM INTERACTION START ### [ 289s] [ 275.100331] sysrq: SysRq : Power Off [ 289s] [ 275.103327] reboot: Power down [ 289s] ### VM INTERACTION END ### [ 289s] build: extracting built packages... [ 289s] DEBS/osmo-bsc_1.1.2_arm64.changes [ 289s] DEBS/osmo-bsc_1.1.2.tar.xz [ 289s] DEBS/osmo-bsc_1.1.2.dsc [ 289s] DEBS/osmo-bsc-bs11-utils_1.1.2_arm64.deb [ 289s] DEBS/osmo-bsc-dbg_1.1.2_arm64.deb [ 289s] DEBS/osmo-bsc_1.1.2_arm64.deb [ 289s] DEBS/osmo-bsc-ipaccess-utils_1.1.2_arm64.deb [ 289s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:26:09 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:26:09 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-netif in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59f701add7df1_638112baf88131487@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/libosmo-netif failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-netif Last lines of build log: [ 99s] dpkg-genchanges: info: including full source code in upload [ 99s] dpkg-source --after-build BUILD [ 99s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 99s] Warning: mkbaselibs missing in build root, skipping baselibs [ 99s] ... saving statistics [ 99s] ... saving built packages [ 99s] DEBS/libosmonetif4_0.1.1.20171029_amd64.deb [ 99s] DEBS/libosmo-netif-dbg_0.1.1.20171029_amd64.deb [ 99s] DEBS/libosmo-netif_0.1.1.20171029_amd64.changes [ 99s] DEBS/libosmo-netif-dev_0.1.1.20171029_amd64.deb [ 99s] DEBS/libosmo-netif_0.1.1.20171029.tar.xz [ 99s] DEBS/libosmo-netif-doc_0.1.1.20171029_all.deb [ 99s] DEBS/libosmo-netif_0.1.1.20171029.dsc [ 99s] OTHER/_statistics [ 99s] [ 99s] lamb14 finished "build libosmo-netif_0.1.1.20171029.dsc" at Sun Oct 29 19:58:29 UTC 2017. [ 99s] [ 99s] ### VM INTERACTION START ### [ 103s] [ 94.816680] reboot: Power down [ 103s] ### VM INTERACTION END ### [ 103s] build: extracting built packages... [ 103s] DEBS/libosmonetif4_0.1.1.20171029_amd64.deb [ 103s] DEBS/libosmo-netif-dbg_0.1.1.20171029_amd64.deb [ 103s] DEBS/libosmo-netif_0.1.1.20171029_amd64.changes [ 103s] DEBS/libosmo-netif-dev_0.1.1.20171029_amd64.deb [ 103s] DEBS/libosmo-netif_0.1.1.20171029.tar.xz [ 103s] DEBS/libosmo-netif-doc_0.1.1.20171029_all.deb [ 103s] DEBS/libosmo-netif_0.1.1.20171029.dsc [ 103s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:26:10 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:26:10 +0000 Subject: Build failure of network:osmocom:latest/osmo-bsc in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <59f701af9bfd9_638112baf8813153b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-bsc/Debian_9.0/armv7l Package network:osmocom:latest/osmo-bsc failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:latest osmo-bsc Last lines of build log: [ 246s] dpkg-source --after-build BUILD [ 247s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 247s] Warning: mkbaselibs missing in build root, skipping baselibs [ 247s] ... saving statistics [ 247s] ... saving built packages [ 247s] DEBS/osmo-bsc_1.1.2_armhf.changes [ 247s] DEBS/osmo-bsc-ipaccess-utils_1.1.2_armhf.deb [ 247s] DEBS/osmo-bsc-dbg_1.1.2_armhf.deb [ 247s] DEBS/osmo-bsc_1.1.2.dsc [ 247s] DEBS/osmo-bsc-bs11-utils_1.1.2_armhf.deb [ 247s] DEBS/osmo-bsc_1.1.2.tar.xz [ 247s] DEBS/osmo-bsc_1.1.2_armhf.deb [ 247s] OTHER/_statistics [ 247s] [ 247s] armbuild03 finished "build osmo-bsc_1.1.2.dsc" at Mon Oct 30 01:56:08 UTC 2017. [ 247s] [ 247s] ### VM INTERACTION START ### [ 250s] [ 224.607570] SysRq : Power Off [ 250s] [ 224.624985] reboot: Power down [ 250s] ### VM INTERACTION END ### [ 250s] build: extracting built packages... [ 250s] DEBS/osmo-bsc_1.1.2_armhf.changes [ 250s] DEBS/osmo-bsc-ipaccess-utils_1.1.2_armhf.deb [ 250s] DEBS/osmo-bsc-dbg_1.1.2_armhf.deb [ 250s] DEBS/osmo-bsc_1.1.2.dsc [ 250s] DEBS/osmo-bsc-bs11-utils_1.1.2_armhf.deb [ 250s] DEBS/osmo-bsc_1.1.2.tar.xz [ 250s] DEBS/osmo-bsc_1.1.2_armhf.deb [ 250s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:26:55 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:26:55 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <59f701d39e3fd_638112baf8813194b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/Debian_9.0/armv7l Package network:osmocom:latest/osmo-msc failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 273s] dpkg-deb: building package 'osmo-msc-dbg' in '../osmo-msc-dbg_1.1.2_armhf.deb'. [ 274s] dpkg-genbuildinfo [ 275s] dpkg-genchanges >../osmo-msc_1.1.2_armhf.changes [ 275s] dpkg-genchanges: info: including full source code in upload [ 275s] dpkg-source --after-build BUILD [ 276s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 276s] Warning: mkbaselibs missing in build root, skipping baselibs [ 276s] ... saving statistics [ 276s] ... saving built packages [ 276s] DEBS/osmo-msc-dbg_1.1.2_armhf.deb [ 276s] DEBS/osmo-msc_1.1.2_armhf.deb [ 276s] DEBS/osmo-msc_1.1.2.tar.xz [ 276s] DEBS/osmo-msc_1.1.2.dsc [ 276s] DEBS/osmo-msc_1.1.2_armhf.changes [ 276s] OTHER/_statistics [ 276s] [ 276s] armbuild01 finished "build osmo-msc_1.1.2.dsc" at Mon Oct 30 02:41:20 UTC 2017. [ 276s] [ 276s] ### VM INTERACTION START ### [ 279s] [ 252.590447] SysRq : Power Off [ 279s] [ 252.601875] reboot: Power down [ 279s] ### VM INTERACTION END ### [ 279s] build: extracting built packages... [ 279s] DEBS/osmo-msc-dbg_1.1.2_armhf.deb [ 279s] DEBS/osmo-msc_1.1.2_armhf.deb [ 279s] DEBS/osmo-msc_1.1.2.tar.xz [ 279s] DEBS/osmo-msc_1.1.2.dsc [ 279s] DEBS/osmo-msc_1.1.2_armhf.changes [ 279s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:29:01 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:29:01 +0000 Subject: Build failure of network:osmocom:latest/osmo-msc in Debian_9.0/aarch64 In-Reply-To: References: Message-ID: <59f70206c0af4_638112baf8813435f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-msc/Debian_9.0/aarch64 Package network:osmocom:latest/osmo-msc failed to build in Debian_9.0/aarch64 Check out the package for editing: osc checkout network:osmocom:latest osmo-msc Last lines of build log: [ 292s] dpkg-deb: building package 'osmo-msc' in '../osmo-msc_1.1.2_arm64.deb'. [ 293s] dpkg-genbuildinfo [ 294s] dpkg-genchanges >../osmo-msc_1.1.2_arm64.changes [ 294s] dpkg-genchanges: info: including full source code in upload [ 294s] dpkg-source --after-build BUILD [ 294s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 295s] Warning: mkbaselibs missing in build root, skipping baselibs [ 295s] ... saving statistics [ 295s] ... saving built packages [ 295s] DEBS/osmo-msc-dbg_1.1.2_arm64.deb [ 295s] DEBS/osmo-msc_1.1.2_arm64.deb [ 295s] DEBS/osmo-msc_1.1.2.tar.xz [ 295s] DEBS/osmo-msc_1.1.2.dsc [ 295s] DEBS/osmo-msc_1.1.2_arm64.changes [ 295s] OTHER/_statistics [ 295s] [ 295s] obs-arm-1 finished "build osmo-msc_1.1.2.dsc" at Mon Oct 30 01:41:37 UTC 2017. [ 295s] [ 295s] ### VM INTERACTION START ### [ 298s] [ 282.729643] sysrq: SysRq : Power Off [ 298s] [ 282.732713] reboot: Power down [ 298s] ### VM INTERACTION END ### [ 298s] build: extracting built packages... [ 298s] DEBS/osmo-msc-dbg_1.1.2_arm64.deb [ 298s] DEBS/osmo-msc_1.1.2_arm64.deb [ 298s] DEBS/osmo-msc_1.1.2.tar.xz [ 298s] DEBS/osmo-msc_1.1.2.dsc [ 298s] DEBS/osmo-msc_1.1.2_arm64.changes [ 298s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:30:27 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:30:27 +0000 Subject: Build failure of network:osmocom:latest/libosmocore in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f70234e4353_638112baf8813516@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libosmocore/Debian_8.0/x86_64 Package network:osmocom:latest/libosmocore failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest libosmocore Last lines of build log: [ 180s] build72 finished "build libosmocore_0.10.1.dsc" at Mon Oct 30 00:59:23 UTC 2017. [ 180s] [ 180s] ### VM INTERACTION START ### [ 181s] Powering off. [ 181s] [ 174.781135] reboot: Power down [ 182s] ### VM INTERACTION END ### [ 182s] build: extracting built packages... [ 182s] DEBS/libosmocodec-doc_0.10.1_all.deb [ 182s] DEBS/libosmocore-dbg_0.10.1_amd64.deb [ 182s] DEBS/libosmoctrl1_0.10.1_amd64.deb [ 182s] DEBS/libosmogb5_0.10.1_amd64.deb [ 182s] DEBS/libosmocodec0_0.10.1_amd64.deb [ 182s] DEBS/libosmogsm-doc_0.10.1_all.deb [ 182s] DEBS/libosmocore_0.10.1.tar.xz [ 182s] DEBS/libosmocoding-doc_0.10.1_all.deb [ 182s] DEBS/libosmovty4_0.10.1_amd64.deb [ 182s] DEBS/libosmocore-dev_0.10.1_amd64.deb [ 182s] DEBS/libosmosim0_0.10.1_amd64.deb [ 182s] DEBS/libosmovty-doc_0.10.1_all.deb [ 182s] DEBS/libosmogb-doc_0.10.1_all.deb [ 182s] DEBS/libosmocore_0.10.1.dsc [ 182s] DEBS/libosmogsm8_0.10.1_amd64.deb [ 182s] DEBS/libosmocoding0_0.10.1_amd64.deb [ 182s] DEBS/libosmocore_0.10.1_amd64.changes [ 182s] DEBS/libosmocore-doc_0.10.1_all.deb [ 182s] DEBS/libosmocore9_0.10.1_amd64.deb [ 182s] DEBS/libosmocore_0.10.1_amd64.deb [ 182s] DEBS/libosmocore-utils_0.10.1_amd64.deb [ 182s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:52:33 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:52:33 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59f70860c1e66_638112baf8815607d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 275s] | [ 275s] | This file was extended by libosmocore config.status 0.10.1.20171029, which was [ 275s] | generated by GNU Autoconf 2.69. Invocation command line was [ 275s] | [ 275s] | CONFIG_FILES = [ 275s] | CONFIG_HEADERS = [ 275s] | CONFIG_LINKS = [ 275s] | CONFIG_COMMANDS = [ 275s] | $ ./config.status Doxyfile.core [ 275s] | [ 275s] | on build34 [ 275s] | [ 275s] | config.status:1174: creating Doxyfile.core [ 275s] [ 275s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 275s] make[1]: *** [override_dh_auto_test] Error 1 [ 275s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 275s] debian/rules:15: recipe for target 'build' failed [ 275s] make: *** [build] Error 2 [ 275s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 275s] [ 275s] build34 failed "build libosmocore_0.10.1.20171029.dsc" at Sun Oct 29 19:55:14 UTC 2017. [ 275s] [ 275s] ### VM INTERACTION START ### [ 277s] [ 268.793821] reboot: Power down [ 278s] ### VM INTERACTION END ### [ 278s] [ 278s] build34 failed "build libosmocore_0.10.1.20171029.dsc" at Sun Oct 29 19:55:18 UTC 2017. [ 278s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Oct 30 09:52:33 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Oct 2017 09:52:33 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59f7086034cd3_638112baf88155911@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 254s] | [ 254s] | This file was extended by libosmocore config.status 0.10.1.20171029, which was [ 254s] | generated by GNU Autoconf 2.69. Invocation command line was [ 254s] | [ 254s] | CONFIG_FILES = [ 254s] | CONFIG_HEADERS = [ 254s] | CONFIG_LINKS = [ 254s] | CONFIG_COMMANDS = [ 254s] | $ ./config.status Doxyfile.core [ 254s] | [ 254s] | on build34 [ 254s] | [ 254s] | config.status:1174: creating Doxyfile.core [ 254s] [ 254s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 254s] make[1]: *** [override_dh_auto_test] Error 1 [ 254s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 254s] debian/rules:15: recipe for target 'build' failed [ 254s] make: *** [build] Error 2 [ 254s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 254s] [ 254s] build34 failed "build libosmocore_0.10.1.20171029.dsc" at Sun Oct 29 19:55:07 UTC 2017. [ 254s] [ 254s] ### VM INTERACTION START ### [ 258s] [ 249.155834] reboot: Power down [ 258s] ### VM INTERACTION END ### [ 258s] [ 258s] build34 failed "build libosmocore_0.10.1.20171029.dsc" at Sun Oct 29 19:55:11 UTC 2017. [ 258s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Mon Oct 30 12:51:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 30 Oct 2017 12:51:03 +0000 Subject: [PATCH] libosmocore[master]: Move additional libraries to appropriate place Message-ID: Review at https://gerrit.osmocom.org/4591 Move additional libraries to appropriate place According to https://www.gnu.org/software/automake/manual/automake.html#Libtool-Flags the libraries supposed to be added to *_LDADD or *_LIBADD while *_LDFLAGS should contain additional libtool linking flags. Previously we used both. Let's unify this and move all the libraries into proper automake variable. While at it - also add libosmocore.la for tests to LDADD since all the tests link against it anyway. Change-Id: Ia657a66db75df831421af5df1175a992da5ba80f --- M src/Makefile.am M src/ctrl/Makefile.am M src/gb/Makefile.am M src/gsm/Makefile.am M src/sim/Makefile.am M src/vty/Makefile.am M tests/Makefile.am 7 files changed, 46 insertions(+), 60 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/91/4591/1 diff --git a/src/Makefile.am b/src/Makefile.am index cff5f44..e7f94ce 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -44,11 +44,11 @@ BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c EXTRA_DIST = conv_acc_sse_impl.h +libosmocore_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined + if ENABLE_PLUGIN libosmocore_la_SOURCES += plugin.c -libosmocore_la_LDFLAGS = -version-info $(LIBVERSION) $(TALLOC_LIBS) $(LIBRARY_DL) -no-undefined -else -libosmocore_la_LDFLAGS = -version-info $(LIBVERSION) $(TALLOC_LIBS) -no-undefined +libosmocore_la_LIBADD += $(LIBRARY_DL) endif if ENABLE_MSGFILE diff --git a/src/ctrl/Makefile.am b/src/ctrl/Makefile.am index 8e10c6b..2bda5b7 100644 --- a/src/ctrl/Makefile.am +++ b/src/ctrl/Makefile.am @@ -10,8 +10,8 @@ libosmoctrl_la_SOURCES = control_cmd.c control_if.c fsm_ctrl_commands.c -libosmoctrl_la_LDFLAGS = $(LTLDFLAGS_OSMOCTRL) $(TALLOC_LIBS) -version-info $(LIBVERSION) -no-undefined -libosmoctrl_la_LIBADD = \ +libosmoctrl_la_LDFLAGS = $(LTLDFLAGS_OSMOCTRL) -version-info $(LIBVERSION) -no-undefined +libosmoctrl_la_LIBADD = $(TALLOC_LIBS) \ $(top_builddir)/src/libosmocore.la \ $(top_builddir)/src/gsm/libosmogsm.la \ $(top_builddir)/src/vty/libosmovty.la diff --git a/src/gb/Makefile.am b/src/gb/Makefile.am index 199e16e..1e0aa1e 100644 --- a/src/gb/Makefile.am +++ b/src/gb/Makefile.am @@ -11,8 +11,8 @@ if ENABLE_GB lib_LTLIBRARIES = libosmogb.la -libosmogb_la_LDFLAGS = $(LTLDFLAGS_OSMOGB) -version-info $(LIBVERSION) $(TALLOC_LIBS) -libosmogb_la_LIBADD = \ +libosmogb_la_LDFLAGS = $(LTLDFLAGS_OSMOGB) -version-info $(LIBVERSION) +libosmogb_la_LIBADD = $(TALLOC_LIBS) \ $(top_builddir)/src/libosmocore.la \ $(top_builddir)/src/vty/libosmovty.la \ $(top_builddir)/src/gsm/libosmogsm.la diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 9b52f03..4476971 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -35,8 +35,8 @@ libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la libosmogsm_la_SOURCES = -libosmogsm_la_LDFLAGS = $(LTLDFLAGS_OSMOGSM) -version-info $(LIBVERSION) -no-undefined $(TALLOC_LIBS) -libosmogsm_la_LIBADD = libgsmint.la +libosmogsm_la_LDFLAGS = $(LTLDFLAGS_OSMOGSM) -version-info $(LIBVERSION) -no-undefined +libosmogsm_la_LIBADD = libgsmint.la $(TALLOC_LIBS) EXTRA_DIST = libosmogsm.map diff --git a/src/sim/Makefile.am b/src/sim/Makefile.am index 9590d6c..869e12d 100644 --- a/src/sim/Makefile.am +++ b/src/sim/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -fPIC -Wall $(PCSC_CFLAGS) $(TALLOC_CFLAGS) -AM_LDFLAGS = $(COVERAGE_LDFLAGS) $(TALLOC_LIBS) +AM_LDFLAGS = $(COVERAGE_LDFLAGS) if ENABLE_PCSC # FIXME: only build the PC/SC dependent part conditional, but always build other parts diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index 32b38fb..7b5e1e5 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -12,6 +12,6 @@ libosmovty_la_SOURCES = buffer.c command.c vty.c vector.c utils.c \ telnet_interface.c logging_vty.c stats_vty.c \ fsm_vty.c talloc_ctx_vty.c -libosmovty_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined $(TALLOC_LIBS) -libosmovty_la_LIBADD = $(top_builddir)/src/libosmocore.la +libosmovty_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined +libosmovty_la_LIBADD = $(top_builddir)/src/libosmocore.la $(TALLOC_LIBS) endif diff --git a/tests/Makefile.am b/tests/Makefile.am index 7fb9a7b..1d4fb24 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) -AM_LDFLAGS = $(TALLOC_LIBS) +AM_LDFLAGS = +LDADD = $(top_builddir)/src/libosmocore.la $(TALLOC_LIBS) check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \ smscb/smscb_test bits/bitrev_test a5/a5_test \ @@ -43,155 +44,140 @@ endif utils_utils_test_SOURCES = utils/utils_test.c -utils_utils_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +utils_utils_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la stats_stats_test_SOURCES = stats/stats_test.c -stats_stats_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +stats_stats_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la a5_a5_test_SOURCES = a5/a5_test.c -a5_a5_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libgsmint.la +a5_a5_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la kasumi_kasumi_test_SOURCES = kasumi/kasumi_test.c -kasumi_kasumi_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libgsmint.la +kasumi_kasumi_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la comp128_comp128_test_SOURCES = comp128/comp128_test.c -comp128_comp128_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +comp128_comp128_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la auth_milenage_test_SOURCES = auth/milenage_test.c -auth_milenage_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +auth_milenage_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la abis_abis_test_SOURCES = abis/abis_test.c -abis_abis_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +abis_abis_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la ctrl_ctrl_test_SOURCES = ctrl/ctrl_test.c -ctrl_ctrl_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/ctrl/libosmoctrl.la +ctrl_ctrl_test_LDADD = $(LDADD) $(top_builddir)/src/ctrl/libosmoctrl.la gea_gea_test_SOURCES = gea/gea_test.c -gea_gea_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +gea_gea_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la bits_bitrev_test_SOURCES = bits/bitrev_test.c -bits_bitrev_test_LDADD = $(top_builddir)/src/libosmocore.la bitvec_bitvec_test_SOURCES = bitvec/bitvec_test.c -bitvec_bitvec_test_LDADD = $(top_builddir)/src/libosmocore.la bits_bitcomp_test_SOURCES = bits/bitcomp_test.c -bits_bitcomp_test_LDADD = $(top_builddir)/src/libosmocore.la bits_bitfield_test_SOURCES = bits/bitfield_test.c -bits_bitfield_test_LDADD = $(top_builddir)/src/libosmocore.la conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c -conv_conv_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libgsmint.la +conv_conv_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la conv_conv_gsm0503_test_SOURCES = conv/conv_gsm0503_test.c conv/conv.c conv/gsm0503_test_vectors.c -conv_conv_gsm0503_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libgsmint.la +conv_conv_gsm0503_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la conv_conv_gsm0503_test_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/tests/conv gsm0808_gsm0808_test_SOURCES = gsm0808/gsm0808_test.c -gsm0808_gsm0808_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +gsm0808_gsm0808_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la gsm0408_gsm0408_test_SOURCES = gsm0408/gsm0408_test.c -gsm0408_gsm0408_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +gsm0408_gsm0408_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la gprs_gprs_test_SOURCES = gprs/gprs_test.c -gprs_gprs_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +gprs_gprs_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la lapd_lapd_test_SOURCES = lapd/lapd_test.c -lapd_lapd_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +lapd_lapd_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la msgb_msgb_test_SOURCES = msgb/msgb_test.c -msgb_msgb_test_LDADD = $(top_builddir)/src/libosmocore.la msgfile_msgfile_test_SOURCES = msgfile/msgfile_test.c -msgfile_msgfile_test_LDADD = $(top_builddir)/src/libosmocore.la smscb_smscb_test_SOURCES = smscb/smscb_test.c -smscb_smscb_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +smscb_smscb_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la smscb_gsm0341_test_SOURCES = smscb/gsm0341_test.c -smscb_gsm0341_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +smscb_gsm0341_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la sms_sms_test_SOURCES = sms/sms_test.c -sms_sms_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +sms_sms_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la timer_timer_test_SOURCES = timer/timer_test.c -timer_timer_test_LDADD = $(top_builddir)/src/libosmocore.la ussd_ussd_test_SOURCES = ussd/ussd_test.c -ussd_ussd_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +ussd_ussd_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la gb_bssgp_fc_test_SOURCES = gb/bssgp_fc_test.c -gb_bssgp_fc_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gb/libosmogb.la \ +gb_bssgp_fc_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la \ $(top_builddir)/src/gsm/libosmogsm.la gb_gprs_bssgp_test_SOURCES = gb/gprs_bssgp_test.c -gb_gprs_bssgp_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DL) \ +gb_gprs_bssgp_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DL) \ $(top_builddir)/src/gsm/libosmogsm.la gb_gprs_ns_test_SOURCES = gb/gprs_ns_test.c -gb_gprs_ns_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DL) \ +gb_gprs_ns_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DL) \ $(top_builddir)/src/gsm/libosmogsm.la logging_logging_test_SOURCES = logging/logging_test.c -logging_logging_test_LDADD = $(top_builddir)/src/libosmocore.la fr_fr_test_SOURCES = fr/fr_test.c -fr_fr_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DL) \ +fr_fr_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DL) \ $(top_builddir)/src/gsm/libosmogsm.la codec_codec_test_SOURCES = codec/codec_test.c -codec_codec_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/codec/libosmocodec.la +codec_codec_test_LDADD = $(LDADD) $(top_builddir)/src/codec/libosmocodec.la loggingrb_loggingrb_test_SOURCES = loggingrb/loggingrb_test.c -loggingrb_loggingrb_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/vty/libosmovty.la +loggingrb_loggingrb_test_LDADD = $(LDADD) $(top_builddir)/src/vty/libosmovty.la strrb_strrb_test_SOURCES = strrb/strrb_test.c -strrb_strrb_test_LDADD = $(top_builddir)/src/libosmocore.la vty_vty_test_SOURCES = vty/vty_test.c -vty_vty_test_LDADD = $(top_builddir)/src/vty/libosmovty.la $(top_builddir)/src/libosmocore.la +vty_vty_test_LDADD = $(LDADD) $(top_builddir)/src/vty/libosmovty.la sim_sim_test_SOURCES = sim/sim_test.c -sim_sim_test_LDADD = $(top_builddir)/src/sim/libosmosim.la $(top_builddir)/src/libosmocore.la \ +sim_sim_test_LDADD = $(LDADD) $(top_builddir)/src/sim/libosmosim.la \ $(top_builddir)/src/gsm/libosmogsm.la tlv_tlv_test_SOURCES = tlv/tlv_test.c -tlv_tlv_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la +tlv_tlv_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la gsup_gsup_test_SOURCES = gsup/gsup_test.c -gsup_gsup_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la +gsup_gsup_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la oap_oap_test_SOURCES = oap/oap_test.c -oap_oap_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la +oap_oap_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la fsm_fsm_test_SOURCES = fsm/fsm_test.c -fsm_fsm_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/ctrl/libosmoctrl.la +fsm_fsm_test_LDADD = $(LDADD) $(top_builddir)/src/ctrl/libosmoctrl.la write_queue_wqueue_test_SOURCES = write_queue/wqueue_test.c -write_queue_wqueue_test_LDADD = $(top_builddir)/src/libosmocore.la socket_socket_test_SOURCES = socket/socket_test.c -socket_socket_test_LDADD = $(top_builddir)/src/libosmocore.la coding_coding_test_SOURCES = coding/coding_test.c coding_coding_test_LDADD = \ - $(top_builddir)/src/libosmocore.la \ $(top_builddir)/src/gsm/libosmogsm.la \ $(top_builddir)/src/codec/libosmocodec.la \ $(top_builddir)/src/coding/libosmocoding.la endian_endian_test_SOURCES = endian/endian_test.c -endian_endian_test_LDADD = $(top_builddir)/src/libosmocore.la sercomm_sercomm_test_SOURCES = sercomm/sercomm_test.c -sercomm_sercomm_test_LDADD = $(top_builddir)/src/libosmocore.la prbs_prbs_test_SOURCES = prbs/prbs_test.c -prbs_prbs_test_LDADD = $(top_builddir)/src/libosmocore.la gsm23003_gsm23003_test_SOURCES = gsm23003/gsm23003_test.c -gsm23003_gsm23003_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la +gsm23003_gsm23003_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac -- To view, visit https://gerrit.osmocom.org/4591 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia657a66db75df831421af5df1175a992da5ba80f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 30 12:57:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 30 Oct 2017 12:57:49 +0000 Subject: [PATCH] libosmocore[master]: utils: move linked libraries into common variable Message-ID: Review at https://gerrit.osmocom.org/4592 utils: move linked libraries into common variable Change-Id: I54f4e439cc232d926b42ddba9648d4f5e7487c3e --- M utils/Makefile.am 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/4592/1 diff --git a/utils/Makefile.am b/utils/Makefile.am index 51af3d8..d4999bd 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -1,21 +1,20 @@ if ENABLE_UTILITIES AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) AM_CFLAGS = -Wall +LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la EXTRA_DIST = conv_gen.py conv_codes_gsm.py bin_PROGRAMS = osmo-arfcn osmo-auc-gen osmo_arfcn_SOURCES = osmo-arfcn.c -osmo_arfcn_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la osmo_auc_gen_SOURCES = osmo-auc-gen.c -osmo_auc_gen_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la if ENABLE_PCSC noinst_PROGRAMS = osmo-sim-test osmo_sim_test_SOURCES = osmo-sim-test.c -osmo_sim_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/sim/libosmosim.la $(PCSC_LIBS) +osmo_sim_test_LDADD = $(LDADD) $(top_builddir)/src/sim/libosmosim.la $(PCSC_LIBS) osmo_sim_test_CFLAGS = $(PCSC_CFLAGS) endif endif -- To view, visit https://gerrit.osmocom.org/4592 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54f4e439cc232d926b42ddba9648d4f5e7487c3e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 30 13:23:39 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 30 Oct 2017 13:23:39 +0000 Subject: [PATCH] libosmocore[master]: Enable GnuTLS fallback Message-ID: Review at https://gerrit.osmocom.org/4593 Enable GnuTLS fallback On systems with GNU/Linux kernel older than 3.17 (Debian 7 "wheezy" for example) the osmo_get_rand_id() would always return failure. To support such systems, let's add fallback code which uses GnuTLS library. It have to be enabled explicitly via '--enable-gnutls' option at compile-time. Related: OS#1694 Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b --- M configure.ac M src/gsm/Makefile.am M src/gsm/gsm_utils.c 3 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/4593/1 diff --git a/configure.ac b/configure.ac index d9390cf..4cfc451 100644 --- a/configure.ac +++ b/configure.ac @@ -130,6 +130,24 @@ AM_CONDITIONAL(ENABLE_PCSC, test "x$ENABLE_PCSC" = "xyes") AC_SUBST(ENABLE_PCSC) +AC_ARG_ENABLE(gnutls, + [AS_HELP_STRING( + [--enable-gnutls], + [Enable support for the GnuTLS fallback for missing getrandom()], + )], + [ENABLE_GNUTLS=$enableval], [ENABLE_GNUTLS="no"]) +AM_CONDITIONAL(ENABLE_GNUTLS, test x"$ENABLE_GNUTLS" = x"yes") +AS_IF([test "x$ENABLE_GNUTLS" = "xyes"], [ + PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0]) +]) +AC_SUBST(ENABLE_GNUTLS) +if test x"$ENABLE_GNUTLS" = x"yes" +then + AC_SUBST([LIBGNUTLS_CFLAGS]) + AC_SUBST([LIBGNUTLS_LIBS]) + AC_DEFINE([USE_GNUTLS], [1], [Use GnuTLS as a fallback for missing getrandom()]) +fi + AC_ARG_ENABLE(plugin, [AS_HELP_STRING( [--disable-plugin], @@ -228,6 +246,7 @@ AM_CONDITIONAL(ENABLE_PLUGIN, false) AM_CONDITIONAL(ENABLE_MSGFILE, false) AM_CONDITIONAL(ENABLE_SERIAL, false) + AM_CONDITIONAL(ENABLE_GNUTLS, false) AM_CONDITIONAL(ENABLE_VTY, false) AM_CONDITIONAL(ENABLE_CTRL, false) AM_CONDITIONAL(ENABLE_UTILITIES, false) diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 4476971..12f56db 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -38,6 +38,11 @@ libosmogsm_la_LDFLAGS = $(LTLDFLAGS_OSMOGSM) -version-info $(LIBVERSION) -no-undefined libosmogsm_la_LIBADD = libgsmint.la $(TALLOC_LIBS) +if ENABLE_GNUTLS +AM_CPPFLAGS += $(LIBGNUTLS_CFLAGS) +libosmogsm_la_LIBADD += $(LIBGNUTLS_LIBS) +endif + EXTRA_DIST = libosmogsm.map # Convolutional codes generation diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index e3f792e..f57d826 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -104,6 +104,10 @@ #ifndef GRND_NONBLOCK #define GRND_NONBLOCK 0x0001 #endif +#elif (USE_GNUTLS) +#pragma message ("Secure random unavailable: including GnuTLS.") +#include +#include #endif /* ETSI GSM 03.38 6.2.1 and 6.2.1.1 default alphabet @@ -422,7 +426,12 @@ /* FIXME: this can be removed once we bump glibc requirements to 2.25: */ rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK); #else +#if (USE_GNUTLS) +#pragma message ("Secure random unavailable: using GnuTLS fallback.") + return gnutls_rnd(GNUTLS_RND_RANDOM, out, len); +#else #pragma message ("Secure random unavailable: calls to osmo_get_rand_id() will always fail!") +#endif return -ENOTSUP; #endif /* getrandom() failed entirely: */ -- To view, visit https://gerrit.osmocom.org/4593 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Oct 30 13:45:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 30 Oct 2017 13:45:11 +0000 Subject: [PATCH] osmo-bsc[master]: Migrate from OpenSSL to osmo_get_rand_id() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3819 to look at the new patch set (#3). Migrate from OpenSSL to osmo_get_rand_id() 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. Change-Id: Ia57bf1300525cf3c247284fe966b1c415c2d53e2 Related: OS#1694 --- M configure.ac M contrib/jenkins.sh M debian/control M src/osmo-bsc_nat/Makefile.am M src/osmo-bsc_nat/bsc_nat.c M tests/channel/Makefile.am 6 files changed, 8 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/19/3819/3 diff --git a/configure.ac b/configure.ac index 79523d1..cf8cebe 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,6 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.3.2) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0) -PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 57954f0..6ae6732 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -18,7 +18,7 @@ mkdir "$deps" || true -osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false +osmo-build-dep.sh libosmocore "" '--disable-doxygen --enable-gnutls' verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") diff --git a/debian/control b/debian/control index e4a5b1f..061013f 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,6 @@ libtool, pkg-config, python-minimal, - libssl-dev (>= 0.9.5), libtalloc-dev, libosmocore-dev (>= 0.10.0), libosmo-sccp-dev (>= 0.0.2), diff --git a/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am index 23c2b67..ee0f1ae 100644 --- a/src/osmo-bsc_nat/Makefile.am +++ b/src/osmo-bsc_nat/Makefile.am @@ -12,7 +12,6 @@ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOSCCP_CFLAGS) \ $(LIBOSMOLEGACYMGCP_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -51,7 +50,6 @@ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOLEGACYMGCP_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBRARY_GSM) \ -lrt \ $(NULL) diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c index 1548ea3..5569d2f 100644 --- a/src/osmo-bsc_nat/bsc_nat.c +++ b/src/osmo-bsc_nat/bsc_nat.c @@ -74,8 +74,6 @@ #include -#include - #include "../../bscconfig.h" #define SCCP_CLOSE_TIME 20 @@ -208,7 +206,7 @@ 0x01, IPAC_IDTAG_UNITNAME, 0x01, IPAC_IDTAG_SERNR, }; - + int rc; uint8_t *mrand; uint8_t id_req[sizeof(s_id_req) + (2+16)]; uint8_t *buf = &id_req[sizeof(s_id_req)]; @@ -221,19 +219,17 @@ buf = v_put(buf, 0x23); mrand = bsc->last_rand; - if (RAND_bytes(mrand, 16) != 1) - goto failed_random; + rc = osmo_get_rand_id(mrand, 16); + if (rc < 0) { + /* the timeout will trigger and close this connection */ + LOGP(DNAT, LOGL_ERROR, "osmo_get_rand_id() failed: %s\n", strerror(-rc)); + return; + } memcpy(buf, mrand, 16); buf += 16; bsc_send_data(bsc, id_req, sizeof(id_req), IPAC_PROTO_IPACCESS); - return; - -failed_random: - /* the timeout will trigger and close this connection */ - LOGP(DNAT, LOGL_ERROR, "Failed to read from urandom.\n"); - return; } static struct msgb *nat_create_rlsd(struct nat_sccp_connection *conn) diff --git a/tests/channel/Makefile.am b/tests/channel/Makefile.am index 395daf7..12f18f8 100644 --- a/tests/channel/Makefile.am +++ b/tests/channel/Makefile.am @@ -29,5 +29,4 @@ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/3819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia57bf1300525cf3c247284fe966b1c415c2d53e2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 30 13:50:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 30 Oct 2017 13:50:32 +0000 Subject: [PATCH] osmo-msc[master]: Migrate from OpenSSL to osmo_get_rand_id() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3820 to look at the new patch set (#3). Migrate from OpenSSL to osmo_get_rand_id() This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. Related: OS#1694 Change-Id: I71cd631704a4dc155c6c752fee2a42cd6e2fa336 --- M configure.ac M debian/control M src/libmsc/Makefile.am M src/libmsc/auth.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libvlr/Makefile.am M src/libvlr/vlr.c M src/osmo-msc/Makefile.am M tests/db/Makefile.am M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sms_queue/Makefile.am 13 files changed, 11 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/3820/3 diff --git a/configure.ac b/configure.ac index 601b438..7fd4844 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,6 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp) -PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.1.0) # Enable/disable smpp support in the msc? diff --git a/debian/control b/debian/control index 60d468e..6219ea4 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,6 @@ pkg-config, libdbi-dev, libtalloc-dev, - libssl-dev (>= 0.9.5), libsmpp34-dev (>= 1.12), libasn1c-dev (>= 0.9.28), libosmocore-dev (>= 0.10.0), diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index fee9f44..59c2732 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -10,7 +10,6 @@ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(COVERAGE_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ diff --git a/src/libmsc/auth.c b/src/libmsc/auth.c index 7b5367b..7c78c6e 100644 --- a/src/libmsc/auth.c +++ b/src/libmsc/auth.c @@ -28,8 +28,6 @@ #include #include -#include - #include const struct value_string auth_action_names[] = { diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 4e4477b..36f7526 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -42,8 +42,6 @@ #include #include -#include - static char *db_basename = NULL; static char *db_dirname = NULL; static dbi_conn conn; diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 8a5265b..fd2052a 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -31,7 +31,6 @@ #include #include #include -#include #include "bscconfig.h" diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am index 17ad411..c5ab4a6 100644 --- a/src/libvlr/Makefile.am +++ b/src/libvlr/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ - $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) + $(COVERAGE_CFLAGS) noinst_HEADERS = \ vlr_access_req_fsm.h \ diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index adfe258..83c2c51 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -31,8 +31,6 @@ #include #include -#include - #include #include #include @@ -275,12 +273,13 @@ { struct vlr_instance *vlr = vsub->vlr; uint32_t tmsi; - int tried; + int tried, rc; for (tried = 0; tried < 100; tried++) { - if (RAND_bytes((uint8_t *) &tmsi, sizeof(tmsi)) != 1) { - LOGP(DVLR, LOGL_ERROR, "RAND_bytes failed\n"); - return -1; + rc = osmo_get_rand_id((uint8_t *) &tmsi, sizeof(tmsi)); + if (rc < 0) { + LOGP(DDB, LOGL_ERROR, "osmo_get_rand_id() failed: %s\n", strerror(-rc)); + return rc; } /* throw the dice again, if the TSMI doesn't fit */ if (tmsi == GSM_RESERVED_TMSI) diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index e296f97..1d8bfbd 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -13,7 +13,6 @@ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ @@ -43,7 +42,6 @@ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBSMPP34_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ -ldbi \ diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index bcb66ec..720e005 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -42,6 +42,5 @@ $(LIBOSMOGSM_LIBS) \ $(LIBSMPP34_LIBS) \ $(LIBOSMOVTY_LIBS) \ - $(LIBCRYPTO_LIBS) \ -ldbi \ $(NULL) diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 9af9870..3a37211 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -9,7 +9,6 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ @@ -30,7 +29,7 @@ -Wl,--wrap=ranap_iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ - -Wl,--wrap=RAND_bytes \ + -Wl,--wrap=osmo_get_rand_id \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libvlr/libvlr.a \ @@ -38,7 +37,6 @@ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index f9dc278..3ec54d4 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -250,11 +250,11 @@ } unsigned char next_rand_byte = 0; -/* override, requires '-Wl,--wrap=RAND_bytes' */ -int __real_RAND_bytes(unsigned char *buf, int num); -int __wrap_RAND_bytes(unsigned char *buf, int num) +/* override, requires '-Wl,--wrap=osmo_get_rand_id' */ +int __real_osmo_get_rand_id(uint8_t *buf, size_t num); +int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num) { - int i; + size_t i; for (i = 0; i < num; i++) buf[i] = next_rand_byte++; return 1; diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index a912be1..8c538b0 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -8,7 +8,6 @@ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ @@ -38,7 +37,6 @@ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I71cd631704a4dc155c6c752fee2a42cd6e2fa336 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 30 14:12:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 30 Oct 2017 14:12:33 +0000 Subject: [PATCH] libosmocore[master]: Enable GnuTLS fallback In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4593 to look at the new patch set (#2). Enable GnuTLS fallback On systems with GNU/Linux kernel older than 3.17 (Debian 8 "jessie" for example) the osmo_get_rand_id() would always return failure. To support such systems, let's add fallback code which uses GnuTLS library. It have to be enabled explicitly via '--enable-gnutls' option at compile-time. Related: OS#1694 Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b --- M configure.ac M src/gsm/Makefile.am M src/gsm/gsm_utils.c 3 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/4593/2 diff --git a/configure.ac b/configure.ac index d9390cf..4cfc451 100644 --- a/configure.ac +++ b/configure.ac @@ -130,6 +130,24 @@ AM_CONDITIONAL(ENABLE_PCSC, test "x$ENABLE_PCSC" = "xyes") AC_SUBST(ENABLE_PCSC) +AC_ARG_ENABLE(gnutls, + [AS_HELP_STRING( + [--enable-gnutls], + [Enable support for the GnuTLS fallback for missing getrandom()], + )], + [ENABLE_GNUTLS=$enableval], [ENABLE_GNUTLS="no"]) +AM_CONDITIONAL(ENABLE_GNUTLS, test x"$ENABLE_GNUTLS" = x"yes") +AS_IF([test "x$ENABLE_GNUTLS" = "xyes"], [ + PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0]) +]) +AC_SUBST(ENABLE_GNUTLS) +if test x"$ENABLE_GNUTLS" = x"yes" +then + AC_SUBST([LIBGNUTLS_CFLAGS]) + AC_SUBST([LIBGNUTLS_LIBS]) + AC_DEFINE([USE_GNUTLS], [1], [Use GnuTLS as a fallback for missing getrandom()]) +fi + AC_ARG_ENABLE(plugin, [AS_HELP_STRING( [--disable-plugin], @@ -228,6 +246,7 @@ AM_CONDITIONAL(ENABLE_PLUGIN, false) AM_CONDITIONAL(ENABLE_MSGFILE, false) AM_CONDITIONAL(ENABLE_SERIAL, false) + AM_CONDITIONAL(ENABLE_GNUTLS, false) AM_CONDITIONAL(ENABLE_VTY, false) AM_CONDITIONAL(ENABLE_CTRL, false) AM_CONDITIONAL(ENABLE_UTILITIES, false) diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 4476971..12f56db 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -38,6 +38,11 @@ libosmogsm_la_LDFLAGS = $(LTLDFLAGS_OSMOGSM) -version-info $(LIBVERSION) -no-undefined libosmogsm_la_LIBADD = libgsmint.la $(TALLOC_LIBS) +if ENABLE_GNUTLS +AM_CPPFLAGS += $(LIBGNUTLS_CFLAGS) +libosmogsm_la_LIBADD += $(LIBGNUTLS_LIBS) +endif + EXTRA_DIST = libosmogsm.map # Convolutional codes generation diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index e3f792e..f57d826 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -104,6 +104,10 @@ #ifndef GRND_NONBLOCK #define GRND_NONBLOCK 0x0001 #endif +#elif (USE_GNUTLS) +#pragma message ("Secure random unavailable: including GnuTLS.") +#include +#include #endif /* ETSI GSM 03.38 6.2.1 and 6.2.1.1 default alphabet @@ -422,7 +426,12 @@ /* FIXME: this can be removed once we bump glibc requirements to 2.25: */ rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK); #else +#if (USE_GNUTLS) +#pragma message ("Secure random unavailable: using GnuTLS fallback.") + return gnutls_rnd(GNUTLS_RND_RANDOM, out, len); +#else #pragma message ("Secure random unavailable: calls to osmo_get_rand_id() will always fail!") +#endif return -ENOTSUP; #endif /* getrandom() failed entirely: */ -- To view, visit https://gerrit.osmocom.org/4593 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Oct 30 16:38:33 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Oct 2017 16:38:33 +0000 Subject: [MERGED] osmocom-bb[master]: mobile: register the talloc context introspection command In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: mobile: register the talloc context introspection command ...................................................................... mobile: register the talloc context introspection command This change registers the command, which is now implemented in libosmocore since the 463deef8c209dd7eb023ac70bf41fa9893ad35ed and allows to introspect mobile application's talloc context directly from the VTY interface. Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 --- M src/host/layer23/configure.ac M src/host/layer23/src/mobile/app_mobile.c M src/host/layer23/src/mobile/vty_interface.c 3 files changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/layer23/configure.ac b/src/host/layer23/configure.ac index 102d234..de26d23 100644 --- a/src/host/layer23/configure.ac +++ b/src/host/layer23/configure.ac @@ -13,7 +13,7 @@ dnl checks for libraries PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm) PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec) AC_CHECK_LIB(gps, gps_waiting, LIBGPS_CFLAGS=" -D_HAVE_GPSD" LIBGPS_LIBS=" -lgps ",,) diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index ecf9820..9dbae7c 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -396,6 +396,7 @@ osmo_gps_init(); + vty_info.tall_ctx = l23_ctx; vty_init(&vty_info); ms_vty_init(); dummy_conn.priv = NULL; diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 0f321ba..2ad95d0 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -2951,6 +2951,9 @@ install_element(MS_NODE, &cfg_ms_shutdown_force_cmd); install_element(MS_NODE, &cfg_ms_no_shutdown_cmd); + /* Register the talloc context introspection command */ + osmo_talloc_vty_add_cmds(); + return 0; } -- To view, visit https://gerrit.osmocom.org/4566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338 Gerrit-PatchSet: 7 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Oct 30 17:02:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 30 Oct 2017 17:02:00 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Remove FreeBSD_amd64 builds In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4576/3/jobs/gerrit-verifications.yml File jobs/gerrit-verifications.yml: Line 44: combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' also drop this line -- To view, visit https://gerrit.osmocom.org/4576 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c6d2a17c3cf9d8c78c3675995493e30cbc6be0d Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 30 20:42:49 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Mon, 30 Oct 2017 20:42:49 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 5: Code-Review-1 (1 comment) We hit this issue in one of our installations, so I'm glad to see a work to resolve this. In that case though, we just increased the length of the automatically generated extensions to make sure they never overflow. https://gerrit.osmocom.org/#/c/3910/5/openbsc/src/libmsc/db.c File openbsc/src/libmsc/db.c: Line 1425: "WHERE extension IS NOT NULL"); This way of counting will give wrong results when you have a mix of automatically assigned extension numbers and manually assigned ones (with a different length) like we have in some of our installations. You can probably limit the SELECT here to extensions of a given length or between MIN and MAX to make this more robust. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Oct 30 22:36:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Oct 2017 22:36:07 +0000 Subject: [PATCH] osmo-ci[master]: osmocom-nightly-packages: Build latest libgtpnl Message-ID: Review at https://gerrit.osmocom.org/4595 osmocom-nightly-packages: Build latest libgtpnl libgtpnl is the userspace library for using kenrel GTP-U support, which is used by openggsn (and will be used by osmo-ggsn). Change-Id: Iad600a36cb658bbd874b4587ec514f49703d6a45 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/95/4595/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 6206576..8c7a732 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -15,6 +15,7 @@ git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 git clone git://git.osmocom.org/libasn1c +git clone git://git.osmocom.org/libgtpnl git clone git://git.osmocom.org/osmo-iuh git clone git://git.osmocom.org/osmo-sgsn git clone git://git.osmocom.org/osmo-ggsn @@ -56,6 +57,7 @@ build libosmo-netif build libsmpp34 build libasn1c +build libgtpnl build osmo-iuh build osmo-ggsn build osmo-sgsn -- To view, visit https://gerrit.osmocom.org/4595 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad600a36cb658bbd874b4587ec514f49703d6a45 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 31 00:02:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 00:02:15 +0000 Subject: [PATCH] osmo-ggsn[master]: fix compiler warnings: return 0 in main(), in 3 tests Message-ID: Review at https://gerrit.osmocom.org/4596 fix compiler warnings: return 0 in main(), in 3 tests Change-Id: I9e49ceba6b0a8dffd331e5707667d9bb007f3ec7 --- M tests/gtp/gtpie_test.c M tests/lib/in46a_test.c M tests/lib/ippool_test.c 3 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/96/4596/1 diff --git a/tests/gtp/gtpie_test.c b/tests/gtp/gtpie_test.c index fe2d502..8d87dcc 100644 --- a/tests/gtp/gtpie_test.c +++ b/tests/gtp/gtpie_test.c @@ -124,4 +124,5 @@ /* TODO: gtpie_encaps() */ /* TODO: gtpie_encaps2() */ /* TODO: gtpie_getie(), gtpie_exist(), gtpie_get*() */ + return 0; } diff --git a/tests/lib/in46a_test.c b/tests/lib/in46a_test.c index 42a1768..ab7156f 100644 --- a/tests/lib/in46a_test.c +++ b/tests/lib/in46a_test.c @@ -321,4 +321,5 @@ test_in46a_to_eua(); test_in46a_from_eua(); test_in46a_netmasklen(); + return 0; } diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index ea56edd..5b3227c 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -130,4 +130,5 @@ srand(time(NULL)); test_pool_sizes(); + return 0; } -- To view, visit https://gerrit.osmocom.org/4596 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e49ceba6b0a8dffd331e5707667d9bb007f3ec7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 31 00:42:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 00:42:27 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp-client vty: use name 'mgw' instead of 'mgcpgw' Message-ID: Review at https://gerrit.osmocom.org/4597 mgcp-client vty: use name 'mgw' instead of 'mgcpgw' 'mgcpgw' was a working title for the osmo-mgw. Before this takes hold out there, let's rename the VTY commands to 'mgw'. I'd rather have some local fallout in our testing environments now than drag the stupid name along. Change-Id: I1d43d42929dc9162e57640499526fb7cadbcfbe6 --- M src/libosmo-mgcp-client/mgcp_client_vty.c 1 file changed, 30 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/97/4597/1 diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index c52803f..4ead0f7 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -1,4 +1,4 @@ -/* MGCPGW client interface to quagga VTY */ +/* MGCP client interface to quagga VTY */ /* (C) 2016 by sysmocom s.m.f.c. GmbH * Based on OpenBSC interface to quagga VTY (libmsc/vty_interface_layer3.c) * (C) 2009 by Harald Welte @@ -29,14 +29,14 @@ #include -#define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" +#define MGW_STR "MGCP gateway configuration for RTP streams\n" void *global_mgcp_client_ctx = NULL; struct mgcp_client_conf *global_mgcp_client_conf = NULL; -DEFUN(cfg_mgcpgw_local_ip, cfg_mgcpgw_local_ip_cmd, - "mgcpgw local-ip A.B.C.D", - MGCPGW_STR "local bind to connect to MGCP gateway with\n" +DEFUN(cfg_mgw_local_ip, cfg_mgw_local_ip_cmd, + "mgw local-ip A.B.C.D", + MGW_STR "local bind to connect to MGCP gateway with\n" "local bind IP address\n") { if (!global_mgcp_client_conf) @@ -47,9 +47,9 @@ return CMD_SUCCESS; } -DEFUN(cfg_mgcpgw_local_port, cfg_mgcpgw_local_port_cmd, - "mgcpgw local-port <0-65535>", - MGCPGW_STR "local bind to connect to MGCP gateway with\n" +DEFUN(cfg_mgw_local_port, cfg_mgw_local_port_cmd, + "mgw local-port <0-65535>", + MGW_STR "local bind to connect to MGCP gateway with\n" "local bind port\n") { if (!global_mgcp_client_conf) @@ -58,9 +58,9 @@ return CMD_SUCCESS; } -DEFUN(cfg_mgcpgw_remote_ip, cfg_mgcpgw_remote_ip_cmd, - "mgcpgw remote-ip A.B.C.D", - MGCPGW_STR "remote bind to connect to MGCP gateway with\n" +DEFUN(cfg_mgw_remote_ip, cfg_mgw_remote_ip_cmd, + "mgw remote-ip A.B.C.D", + MGW_STR "remote bind to connect to MGCP gateway with\n" "remote bind IP address\n") { if (!global_mgcp_client_conf) @@ -71,9 +71,9 @@ return CMD_SUCCESS; } -DEFUN(cfg_mgcpgw_remote_port, cfg_mgcpgw_remote_port_cmd, - "mgcpgw remote-port <0-65535>", - MGCPGW_STR "remote bind to connect to MGCP gateway with\n" +DEFUN(cfg_mgw_remote_port, cfg_mgw_remote_port_cmd, + "mgw remote-port <0-65535>", + MGW_STR "remote bind to connect to MGCP gateway with\n" "remote bind port\n") { if (!global_mgcp_client_conf) @@ -82,9 +82,9 @@ return CMD_SUCCESS; } -DEFUN(cfg_mgcpgw_endpoint_range, cfg_mgcpgw_endpoint_range_cmd, - "mgcpgw endpoint-range <1-65534> <1-65534>", - MGCPGW_STR "usable range of endpoint identifiers\n" +DEFUN(cfg_mgw_endpoint_range, cfg_mgw_endpoint_range_cmd, + "mgw endpoint-range <1-65534> <1-65534>", + MGW_STR "usable range of endpoint identifiers\n" "set first useable endpoint identifier\n" "set the last useable endpoint identifier\n") { @@ -106,8 +106,8 @@ #define UDP_PORT_STR "UDP Port number\n" DEFUN(cfg_mgcp_rtp_bts_base_port, cfg_mgcp_rtp_bts_base_port_cmd, - "mgcpgw bts-base <0-65534>", - MGCPGW_STR + "mgw bts-base <0-65534>", + MGW_STR BTS_START_STR UDP_PORT_STR) { @@ -125,32 +125,32 @@ addr = global_mgcp_client_conf->local_addr; if (addr) - vty_out(vty, "%smgcpgw local-ip %s%s", indent, addr, + vty_out(vty, "%smgw local-ip %s%s", indent, addr, VTY_NEWLINE); port = global_mgcp_client_conf->local_port; if (port >= 0) - vty_out(vty, "%smgcpgw local-port %u%s", indent, + vty_out(vty, "%smgw local-port %u%s", indent, (uint16_t)port, VTY_NEWLINE); addr = global_mgcp_client_conf->remote_addr; if (addr) - vty_out(vty, "%smgcpgw remote-ip %s%s", indent, addr, + vty_out(vty, "%smgw remote-ip %s%s", indent, addr, VTY_NEWLINE); port = global_mgcp_client_conf->remote_port; if (port >= 0) - vty_out(vty, "%smgcpgw remote-port %u%s", indent, + vty_out(vty, "%smgw remote-port %u%s", indent, (uint16_t)port, VTY_NEWLINE); first_endpoint = global_mgcp_client_conf->first_endpoint; last_endpoint = global_mgcp_client_conf->last_endpoint; if (last_endpoint != 0) { - vty_out(vty, "%smgcpgw endpoint-range %u %u%s", indent, + vty_out(vty, "%smgw endpoint-range %u %u%s", indent, first_endpoint, last_endpoint, VTY_NEWLINE); } bts_base = global_mgcp_client_conf->bts_base; if (bts_base) { - vty_out(vty, "%smgcpgw bts-base %u%s", indent, + vty_out(vty, "%smgw bts-base %u%s", indent, bts_base, VTY_NEWLINE); } @@ -162,10 +162,10 @@ global_mgcp_client_ctx = talloc_ctx; global_mgcp_client_conf = conf; - install_element(node, &cfg_mgcpgw_local_ip_cmd); - install_element(node, &cfg_mgcpgw_local_port_cmd); - install_element(node, &cfg_mgcpgw_remote_ip_cmd); - install_element(node, &cfg_mgcpgw_remote_port_cmd); - install_element(node, &cfg_mgcpgw_endpoint_range_cmd); + install_element(node, &cfg_mgw_local_ip_cmd); + install_element(node, &cfg_mgw_local_port_cmd); + install_element(node, &cfg_mgw_remote_ip_cmd); + install_element(node, &cfg_mgw_remote_port_cmd); + install_element(node, &cfg_mgw_endpoint_range_cmd); install_element(node, &cfg_mgcp_rtp_bts_base_port_cmd); } -- To view, visit https://gerrit.osmocom.org/4597 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1d43d42929dc9162e57640499526fb7cadbcfbe6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 31 00:42:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 00:42:27 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp client: vty: tweak doc strings Message-ID: Review at https://gerrit.osmocom.org/4598 mgcp client: vty: tweak doc strings Fix errors like "remote bind address", mention 'MGW' instead of 'MGCP gateway', minor typos and wording tweaks. Change-Id: Ie1a408f9e651c5fb3424a84ceaaa603e20ad595c --- M src/libosmo-mgcp-client/mgcp_client_vty.c 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/98/4598/1 diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index 4ead0f7..2011785 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -29,14 +29,14 @@ #include -#define MGW_STR "MGCP gateway configuration for RTP streams\n" +#define MGW_STR "Configure MGCP connection to Media Gateway\n" void *global_mgcp_client_ctx = NULL; struct mgcp_client_conf *global_mgcp_client_conf = NULL; DEFUN(cfg_mgw_local_ip, cfg_mgw_local_ip_cmd, "mgw local-ip A.B.C.D", - MGW_STR "local bind to connect to MGCP gateway with\n" + MGW_STR "local bind to connect to MGW from\n" "local bind IP address\n") { if (!global_mgcp_client_conf) @@ -49,7 +49,7 @@ DEFUN(cfg_mgw_local_port, cfg_mgw_local_port_cmd, "mgw local-port <0-65535>", - MGW_STR "local bind to connect to MGCP gateway with\n" + MGW_STR "local TCP port to connect to MGW from\n" "local bind port\n") { if (!global_mgcp_client_conf) @@ -60,8 +60,8 @@ DEFUN(cfg_mgw_remote_ip, cfg_mgw_remote_ip_cmd, "mgw remote-ip A.B.C.D", - MGW_STR "remote bind to connect to MGCP gateway with\n" - "remote bind IP address\n") + MGW_STR "remote IP address to reach the MGW at\n" + "remote IP address\n") { if (!global_mgcp_client_conf) return CMD_ERR_NOTHING_TODO; @@ -73,8 +73,8 @@ DEFUN(cfg_mgw_remote_port, cfg_mgw_remote_port_cmd, "mgw remote-port <0-65535>", - MGW_STR "remote bind to connect to MGCP gateway with\n" - "remote bind port\n") + MGW_STR "remote TCP port to reach the MGW at\n" + "remote port\n") { if (!global_mgcp_client_conf) return CMD_ERR_NOTHING_TODO; @@ -85,8 +85,8 @@ DEFUN(cfg_mgw_endpoint_range, cfg_mgw_endpoint_range_cmd, "mgw endpoint-range <1-65534> <1-65534>", MGW_STR "usable range of endpoint identifiers\n" - "set first useable endpoint identifier\n" - "set the last useable endpoint identifier\n") + "set first usable endpoint identifier\n" + "set last usable endpoint identifier\n") { uint16_t first_endpoint = atoi(argv[0]); uint16_t last_endpoint = atoi(argv[1]); -- To view, visit https://gerrit.osmocom.org/4598 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1a408f9e651c5fb3424a84ceaaa603e20ad595c Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 31 00:42:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 00:42:45 +0000 Subject: [PATCH] osmo-msc[master]: examples: apply mgcp_client vty rename from 'mgcpgw' to 'mgw' Message-ID: Review at https://gerrit.osmocom.org/4599 examples: apply mgcp_client vty rename from 'mgcpgw' to 'mgw' osmo-mgw.git is changing the mgcp_client_vty API to use 'mgw' instead of 'mgcpgw'. Fix example configs after that patch is merged. Depends: I1d43d42929dc9162e57640499526fb7cadbcfbe6 Change-Id: Ib4c5ec1046a3c7a916ecfb7e5aa83dfe2f5ea8bf --- M doc/examples/osmo-msc/osmo-msc.cfg M doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg M doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/99/4599/1 diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg index 1b1d192..8cc975d 100644 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ b/doc/examples/osmo-msc/osmo-msc.cfg @@ -15,5 +15,5 @@ rrlp mode none mm info 1 msc - mgcpgw remote-ip 10.23.24.1 + mgw remote-ip 10.23.24.1 assign-tmsi diff --git a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg index 4ccb0d0..a5131e4 100644 --- a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg +++ b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg @@ -23,5 +23,5 @@ msc cs7-instance-a 0 cs7-instance-iu 0 - mgcpgw remote-ip 10.23.24.1 + mgw remote-ip 10.23.24.1 assign-tmsi diff --git a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg index 8b481de..72f3410 100644 --- a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg +++ b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg @@ -25,5 +25,5 @@ msc cs7-instance-a 0 cs7-instance-iu 1 - mgcpgw remote-ip 10.23.24.1 + mgw remote-ip 10.23.24.1 assign-tmsi -- To view, visit https://gerrit.osmocom.org/4599 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib4c5ec1046a3c7a916ecfb7e5aa83dfe2f5ea8bf Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 31 00:43:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 00:43:05 +0000 Subject: [PATCH] osmo-gsm-tester[master]: msc cfg: apply mgcp_client vty rename from 'mgcpgw' to 'mgw' Message-ID: Review at https://gerrit.osmocom.org/4600 msc cfg: apply mgcp_client vty rename from 'mgcpgw' to 'mgw' osmo-mgw.git is changing the mgcp_client_vty API to use 'mgw' instead of 'mgcpgw'. Fix builds after that patch is merged. Depends: I1d43d42929dc9162e57640499526fb7cadbcfbe6 Change-Id: Idd970917e84f923d229b0c3de43f3e964a0a20c2 --- M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/00/4600/1 diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 6851ea9..89e73d0 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -20,7 +20,7 @@ cs7 instance 0 point-code 0.0.1 msc - mgcpgw remote-ip ${mgcpgw.ip_address.addr} + mgw remote-ip ${mgcpgw.ip_address.addr} assign-tmsi cs7-instance-iu 0 cs7-instance-a 0 -- To view, visit https://gerrit.osmocom.org/4600 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd970917e84f923d229b0c3de43f3e964a0a20c2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 31 00:43:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 00:43:05 +0000 Subject: [PATCH] osmo-gsm-tester[master]: cosmetic: use name 'mgw' instead of 'mgcpgw' Message-ID: Review at https://gerrit.osmocom.org/4601 cosmetic: use name 'mgw' instead of 'mgcpgw' 'mgcpgw' was a working title for the new 'osmo-mgw'. Rather use the name 'mgw' now. Change-Id: Icf65bd1daa52b280d73e56b6267b3c81ed1c5487 --- R src/osmo_gsm_tester/osmo_mgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/suite.py R src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl M suites/aoip_debug/interactive.py M suites/aoip_encryption/register_a5_0_authopt.py M suites/aoip_encryption/register_a5_0_authreq.py M suites/aoip_encryption/register_a5_1_authreq.py M suites/aoip_smpp/esme_connect_policy_acceptall.py M suites/aoip_smpp/esme_connect_policy_closed.py M suites/aoip_smpp/esme_ms_sms_storeforward.py M suites/aoip_smpp/esme_ms_sms_transaction.py M suites/aoip_sms/mo_mt_sms.py M suites/voice/mo_mt_call.py 15 files changed, 55 insertions(+), 55 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/01/4601/1 diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgw.py similarity index 79% rename from src/osmo_gsm_tester/osmo_mgcpgw.py rename to src/osmo_gsm_tester/osmo_mgw.py index 93c3a7c..18b11ab 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgw.py @@ -1,4 +1,4 @@ -# osmo_gsm_tester: specifics for running an osmo-mgcp-gw (osmo-bsc_mgcp) +# osmo_gsm_tester: specifics for running an osmo-mgw (osmo-bsc_mgcp) # # Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH # @@ -22,7 +22,7 @@ from . import log, util, config, template, process, osmo_ctrl, pcap_recorder -class OsmoMgcpgw(log.Origin): +class OsmoMgw(log.Origin): suite_run = None ip_address = None run_dir = None @@ -30,14 +30,14 @@ process = None def __init__(self, suite_run, ip_address, bts_ip): - super().__init__(log.C_RUN, 'osmo-mgcpgw_%s' % ip_address.get('addr')) + super().__init__(log.C_RUN, 'osmo-mgw_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - # hack: so far mgcpgw needs one specific BTS IP. + # hack: so far mgw needs one specific BTS IP. self.bts_ip = bts_ip def start(self): - self.log('Starting osmo-mgcpgw') + self.log('Starting osmo-mgw') self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-mgw'))) @@ -63,17 +63,17 @@ self.process.launch() def configure(self): - self.config_file = self.run_dir.new_file('osmo-mgcpgw.cfg') + self.config_file = self.run_dir.new_file('osmo-mgw.cfg') self.dbg(config_file=self.config_file) - values = dict(mgcpgw=config.get_defaults('mgcpgw')) + values = dict(mgw=config.get_defaults('mgw')) config.overlay(values, self.suite_run.config()) - config.overlay(values, dict(mgcpgw=dict(ip_address=self.ip_address, bts_ip=self.bts_ip))) + config.overlay(values, dict(mgw=dict(ip_address=self.ip_address, bts_ip=self.bts_ip))) - self.dbg('MGCPGW CONFIG:\n' + pprint.pformat(values)) + self.dbg('MGW CONFIG:\n' + pprint.pformat(values)) with open(self.config_file, 'w') as f: - r = template.render('osmo-mgcpgw.cfg', values) + r = template.render('osmo-mgw.cfg', values) self.dbg(r) f.write(r) @@ -81,7 +81,7 @@ return self.ip_address.get('addr') def conf_for_msc(self): - return dict(mgcpgw=dict(ip_address=self.ip_address)) + return dict(mgw=dict(ip_address=self.ip_address)) def running(self): return not self.process.terminated() diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 67234e3..a5e8585 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -34,12 +34,12 @@ encryption = None authentication = None - def __init__(self, suite_run, hlr, mgcpgw, ip_address): + def __init__(self, suite_run, hlr, mgw, ip_address): super().__init__(log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address self.hlr = hlr - self.mgcpgw = mgcpgw + self.mgw = mgw self.smsc = smsc.Smsc((ip_address.get('addr'), 2775)) def start(self): @@ -75,7 +75,7 @@ values = dict(msc=config.get_defaults('msc')) config.overlay(values, self.suite_run.config()) config.overlay(values, dict(msc=dict(ip_address=self.ip_address))) - config.overlay(values, self.mgcpgw.conf_for_msc()) + config.overlay(values, self.mgw.conf_for_msc()) config.overlay(values, self.hlr.conf_for_msc()) config.overlay(values, self.smsc.get_config()) diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 28bdd69..fe9d3a2 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -25,7 +25,7 @@ import pprint from . import config, log, template, util, resource, schema, ofono_client, event_loop, esme, sms from . import osmo_nitb -from . import osmo_hlr, osmo_mgcpgw, osmo_msc, osmo_bsc, osmo_stp +from . import osmo_hlr, osmo_mgw, osmo_msc, osmo_bsc, osmo_stp from . import test class Timeout(Exception): @@ -322,15 +322,15 @@ ip_address = self.ip_address() return osmo_hlr.OsmoHlr(self, ip_address) - def mgcpgw(self, ip_address=None, bts_ip=None): + def mgw(self, ip_address=None, bts_ip=None): if ip_address is None: ip_address = self.ip_address() - return osmo_mgcpgw.OsmoMgcpgw(self, ip_address, bts_ip) + return osmo_mgw.OsmoMgw(self, ip_address, bts_ip) - def msc(self, hlr, mgcpgw, ip_address=None): + def msc(self, hlr, mgw, ip_address=None): if ip_address is None: ip_address = self.ip_address() - return osmo_msc.OsmoMsc(self, hlr, mgcpgw, ip_address) + return osmo_msc.OsmoMsc(self, hlr, mgw, ip_address) def bsc(self, msc, ip_address=None): if ip_address is None: diff --git a/src/osmo_gsm_tester/templates/osmo-mgcpgw.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl similarity index 73% rename from src/osmo_gsm_tester/templates/osmo-mgcpgw.cfg.tmpl rename to src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl index 28a3798..699e912 100644 --- a/src/osmo_gsm_tester/templates/osmo-mgcpgw.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl @@ -7,11 +7,11 @@ logging level all debug line vty no login - bind ${mgcpgw.ip_address.addr} + bind ${mgw.ip_address.addr} mgcp - local ip ${mgcpgw.ip_address.addr} - bts ip ${mgcpgw.bts_ip} - bind ip ${mgcpgw.ip_address.addr} + local ip ${mgw.ip_address.addr} + bts ip ${mgw.bts_ip} + bind ip ${mgw.ip_address.addr} bind port 2427 rtp base 4000 rtp force-ptime 20 diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 89e73d0..9ac68b3 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -20,7 +20,7 @@ cs7 instance 0 point-code 0.0.1 msc - mgw remote-ip ${mgcpgw.ip_address.addr} + mgw remote-ip ${mgw.ip_address.addr} assign-tmsi cs7-instance-iu 0 cs7-instance-a 0 diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index 819f207..6d8db62 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -2,8 +2,8 @@ from osmo_gsm_tester.test import * hlr = suite.hlr() bts = suite.bts() -mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) -msc = suite.msc(hlr, mgcpgw) +mgw = suite.mgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgw) bsc = suite.bsc(msc) stp = suite.stp() modems = suite.modems(int(prompt('How many modems?'))) @@ -11,7 +11,7 @@ hlr.start() stp.start() msc.start() -mgcpgw.start() +mgw.start() bsc.bts_add(bts) bsc.start() diff --git a/suites/aoip_encryption/register_a5_0_authopt.py b/suites/aoip_encryption/register_a5_0_authopt.py index 0224ee0..dafdc54 100755 --- a/suites/aoip_encryption/register_a5_0_authopt.py +++ b/suites/aoip_encryption/register_a5_0_authopt.py @@ -3,8 +3,8 @@ hlr = suite.hlr() bts = suite.bts() -mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) -msc = suite.msc(hlr, mgcpgw) +mgw = suite.mgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgw) bsc = suite.bsc(msc) stp = suite.stp() ms = suite.modem() @@ -16,7 +16,7 @@ hlr.start() stp.start() msc.start() -mgcpgw.start() +mgw.start() bsc.bts_add(bts) bsc.start() bts.start() diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py index 114c628..49b8021 100755 --- a/suites/aoip_encryption/register_a5_0_authreq.py +++ b/suites/aoip_encryption/register_a5_0_authreq.py @@ -3,8 +3,8 @@ hlr = suite.hlr() bts = suite.bts() -mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) -msc = suite.msc(hlr, mgcpgw) +mgw = suite.mgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgw) bsc = suite.bsc(msc) stp = suite.stp() ms = suite.modem() @@ -16,7 +16,7 @@ hlr.start() stp.start() msc.start() -mgcpgw.start() +mgw.start() bsc.bts_add(bts) bsc.start() bts.start() diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py index a84fa3a..21ac1ef 100755 --- a/suites/aoip_encryption/register_a5_1_authreq.py +++ b/suites/aoip_encryption/register_a5_1_authreq.py @@ -3,8 +3,8 @@ hlr = suite.hlr() bts = suite.bts() -mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) -msc = suite.msc(hlr, mgcpgw) +mgw = suite.mgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgw) bsc = suite.bsc(msc) stp = suite.stp() ms = suite.modem() @@ -16,7 +16,7 @@ hlr.start() stp.start() msc.start() -mgcpgw.start() +mgw.start() bsc.bts_add(bts) bsc.start() bts.start() diff --git a/suites/aoip_smpp/esme_connect_policy_acceptall.py b/suites/aoip_smpp/esme_connect_policy_acceptall.py index 2a954d5..82d4f86 100755 --- a/suites/aoip_smpp/esme_connect_policy_acceptall.py +++ b/suites/aoip_smpp/esme_connect_policy_acceptall.py @@ -7,9 +7,9 @@ from osmo_gsm_tester.test import * hlr = suite.hlr() -bts = suite.bts() # bts not started, only needed for mgcpgw -mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) -msc = suite.msc(hlr, mgcpgw) +bts = suite.bts() # bts not started, only needed for mgw +mgw = suite.mgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgw) smsc = msc.smsc esme = suite.esme() @@ -20,7 +20,7 @@ hlr.start() msc.start() -mgcpgw.start() +mgw.start() # Due to accept-all policy, connect() should work even if we didn't previously # configure the esme in the smsc, no matter the system_id / password we use. diff --git a/suites/aoip_smpp/esme_connect_policy_closed.py b/suites/aoip_smpp/esme_connect_policy_closed.py index 29b25d1..ce07f9c 100755 --- a/suites/aoip_smpp/esme_connect_policy_closed.py +++ b/suites/aoip_smpp/esme_connect_policy_closed.py @@ -13,8 +13,8 @@ hlr = suite.hlr() bts = suite.bts() -mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) -msc = suite.msc(hlr, mgcpgw) +mgw = suite.mgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgw) smsc = msc.smsc esme = suite.esme() @@ -27,7 +27,7 @@ hlr.start() msc.start() -mgcpgw.start() +mgw.start() log('Test with correct credentials (no password)') esme_no_pwd.connect() diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py index 308ebf3..32dc68a 100755 --- a/suites/aoip_smpp/esme_ms_sms_storeforward.py +++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py @@ -14,8 +14,8 @@ hlr = suite.hlr() bts = suite.bts() -mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) -msc = suite.msc(hlr, mgcpgw) +mgw = suite.mgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgw) bsc = suite.bsc(msc) stp = suite.stp() bsc.bts_add(bts) @@ -27,7 +27,7 @@ hlr.start() stp.start() msc.start() -mgcpgw.start() +mgw.start() bsc.start() bts.start() diff --git a/suites/aoip_smpp/esme_ms_sms_transaction.py b/suites/aoip_smpp/esme_ms_sms_transaction.py index 8bcfb6b..cd677fa 100755 --- a/suites/aoip_smpp/esme_ms_sms_transaction.py +++ b/suites/aoip_smpp/esme_ms_sms_transaction.py @@ -12,8 +12,8 @@ hlr = suite.hlr() bts = suite.bts() -mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) -msc = suite.msc(hlr, mgcpgw) +mgw = suite.mgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgw) bsc = suite.bsc(msc) stp = suite.stp() bsc.bts_add(bts) @@ -25,7 +25,7 @@ hlr.start() stp.start() msc.start() -mgcpgw.start() +mgw.start() bsc.start() bts.start() diff --git a/suites/aoip_sms/mo_mt_sms.py b/suites/aoip_sms/mo_mt_sms.py index 217d807..3ede47a 100755 --- a/suites/aoip_sms/mo_mt_sms.py +++ b/suites/aoip_sms/mo_mt_sms.py @@ -3,8 +3,8 @@ hlr = suite.hlr() bts = suite.bts() -mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) -msc = suite.msc(hlr, mgcpgw) +mgw = suite.mgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgw) bsc = suite.bsc(msc) stp = suite.stp() ms_mo = suite.modem() @@ -13,7 +13,7 @@ hlr.start() stp.start() msc.start() -mgcpgw.start() +mgw.start() bsc.bts_add(bts) bsc.start() diff --git a/suites/voice/mo_mt_call.py b/suites/voice/mo_mt_call.py index f426037..fc5911f 100755 --- a/suites/voice/mo_mt_call.py +++ b/suites/voice/mo_mt_call.py @@ -3,8 +3,8 @@ hlr = suite.hlr() bts = suite.bts() -mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) -msc = suite.msc(hlr, mgcpgw) +mgw = suite.mgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgw) bsc = suite.bsc(msc) stp = suite.stp() ms_mo = suite.modem() @@ -13,7 +13,7 @@ hlr.start() stp.start() msc.start() -mgcpgw.start() +mgw.start() bsc.bts_add(bts) bsc.start() -- To view, visit https://gerrit.osmocom.org/4601 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf65bd1daa52b280d73e56b6267b3c81ed1c5487 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 31 00:59:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 00:59:27 +0000 Subject: [PATCH] osmo-sgsn[master]: drop osmo_sgsn.cfg from src/gprs dir Message-ID: Review at https://gerrit.osmocom.org/4602 drop osmo_sgsn.cfg from src/gprs dir There is a semantically identical config in doc/examples/osmo-sgsn. Change-Id: I9b9c502afbddcfc02ea70aa8317e0d2f37276c38 --- D src/gprs/osmo_sgsn.cfg 1 file changed, 0 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/02/4602/1 diff --git a/src/gprs/osmo_sgsn.cfg b/src/gprs/osmo_sgsn.cfg deleted file mode 100644 index c4c9ec1..0000000 --- a/src/gprs/osmo_sgsn.cfg +++ /dev/null @@ -1,23 +0,0 @@ -! -! Osmocom SGSN (0.9.0.474-0ede2) configuration saved from vty -!! -! -line vty - no login -! -sgsn - gtp local-ip 192.168.100.11 - ggsn 0 remote-ip 192.168.100.239 - ggsn 0 gtp-version 1 -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 192.168.100.11 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -bssgp -- To view, visit https://gerrit.osmocom.org/4602 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b9c502afbddcfc02ea70aa8317e0d2f37276c38 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 31 00:59:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 00:59:33 +0000 Subject: [PATCH] osmo-sgsn[master]: change default config filename to osmo-sgsn.cfg, not osmo_sg... Message-ID: Review at https://gerrit.osmocom.org/4603 change default config filename to osmo-sgsn.cfg, not osmo_sgsn.cfg All other Osmocom programs I know of have a default config file using a dash. Comply. Change-Id: If804da17a7481e79e000fe40ae0d9c4be9722e61 --- M src/gprs/sgsn_main.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/03/4603/1 diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index e48d8d1..3e8c84a 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -86,7 +86,7 @@ "There is NO WARRANTY, to the extent permitted by law.\r\n"; static struct sgsn_instance sgsn_inst = { - .config_file = "osmo_sgsn.cfg", + .config_file = "osmo-sgsn.cfg", .cfg = { .gtp_statedir = "./", .auth_policy = SGSN_AUTH_POLICY_CLOSED, -- To view, visit https://gerrit.osmocom.org/4603 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If804da17a7481e79e000fe40ae0d9c4be9722e61 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From admin at opensuse.org Tue Oct 31 00:59:53 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Oct 2017 00:59:53 +0000 Subject: Build failure of network:osmocom:latest/libosmocore in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f7cb1428cd4_638112baf8863884a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libosmocore/Debian_8.0/x86_64 Package network:osmocom:latest/libosmocore failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest libosmocore Last lines of build log: [ 213s] | on build36 [ 213s] | [ 213s] | config.status:1170: creating Doxyfile.core [ 213s] [ 213s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 213s] make[1]: *** [override_dh_auto_test] Error 1 [ 213s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 213s] debian/rules:15: recipe for target 'build' failed [ 213s] make: *** [build] Error 2 [ 213s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 213s] [ 213s] build36 failed "build libosmocore_0.10.1.dsc" at Tue Oct 31 00:59:42 UTC 2017. [ 213s] [ 213s] ### VM INTERACTION START ### [ 213s] [ 204.560188] serial8250: too much work for irq4 [ 213s] [ 204.624141] serial8250: too much work for irq4 [ 213s] [ 204.689580] serial8250: too much work for irq4 [ 213s] [ 204.760185] serial8250: too much work for irq4 [ 213s] [ 204.828186] serial8250: too much work for irq4 [ 213s] [ 204.892151] serial8250: too much work for irq4 [ 213s] [ 204.956312] serial8250: too much work for irq4 [ 213s] [ 205.028177] serial8250: too much work for irq4 [ 213s] [ 205.092151] serial8250: too much work for irq4 [ 214s] Powering off. [ 214s] [ 206.146837] reboot: Power down [ 215s] ### VM INTERACTION END ### [ 215s] [ 215s] build36 failed "build libosmocore_0.10.1.dsc" at Tue Oct 31 00:59:45 UTC 2017. [ 215s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Tue Oct 31 01:01:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 01:01:10 +0000 Subject: [MERGED] osmo-msc[master]: msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuilt In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuilt ...................................................................... msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuilt Before this, a code change in libvlr or libmsc would not cause a rebuild of the tests. You'd have thought 'AM_LDADD' were the right name for the variable, but apparently it is just 'LDADD' instead. Tested that it works as intended. Change-Id: Icbdedc1581fa23abe9ed99cef3918592b25f30b3 --- M tests/msc_vlr/Makefile.am 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 9af9870..b1bf78e 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -31,6 +31,9 @@ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ + $(NULL) + +LDADD = \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libvlr/libvlr.a \ -- To view, visit https://gerrit.osmocom.org/4551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icbdedc1581fa23abe9ed99cef3918592b25f30b3 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 31 01:03:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 01:03:45 +0000 Subject: [MERGED] osmo-msc[master]: defaults: assign TMSI by default In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: defaults: assign TMSI by default ...................................................................... defaults: assign TMSI by default When using ciphering, the TMSI is an important part of the ciphering. To guard against users forgetting to set 'assign tmsi' in the config and compromising their ciphering unknowingly, the default should be to use a TMSI. To optimize in an unencrypted network, 'no assign tmsi' config can still switch off TMSI use. Change-Id: If115e95bebc314bedb50faf3993b52071fee5c1e --- M src/libvlr/vlr.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index adfe258..07c31ee 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -995,6 +995,9 @@ INIT_LLIST_HEAD(&vlr->operations); memcpy(&vlr->ops, ops, sizeof(vlr->ops)); + /* defaults */ + vlr->cfg.assign_tmsi = true; + /* osmo_auth_fsm.c */ osmo_fsm_register(&vlr_auth_fsm); /* osmo_lu_fsm.c */ -- To view, visit https://gerrit.osmocom.org/4556 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If115e95bebc314bedb50faf3993b52071fee5c1e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 31 01:03:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 01:03:45 +0000 Subject: [MERGED] osmo-msc[master]: vty: drop deprecated 'logging level sms...' In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: drop deprecated 'logging level sms...' ...................................................................... vty: drop deprecated 'logging level sms...' No need to drag legacy VTY from osmo-nitb to osmo-msc. Change-Id: I38ba8b9414de383bf497526d97bf7a039e41fd35 --- M src/libmsc/vty_interface_layer3.c 1 file changed, 0 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index b6e3ded..edc698d 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -819,20 +819,6 @@ return CMD_SUCCESS; } -#define OBSOLETE_MSG "Obsolete\n" -/* this is just for backwards compatibility as the sms code moved into - * libosmocore and old config files no longer parse... */ -DEFUN_DEPRECATED(log_level_sms, log_level_sms_cmd, - "logging level sms (everything|debug|info|notice|error|fatal)", - ".HIDDEN\n" OBSOLETE_MSG OBSOLETE_MSG OBSOLETE_MSG OBSOLETE_MSG - OBSOLETE_MSG OBSOLETE_MSG OBSOLETE_MSG OBSOLETE_MSG) -{ - vty_out(vty, "%% 'logging level sms' is now called 'logging level " - "lsms', please update your config %s", VTY_NEWLINE); - - return CMD_SUCCESS; -} - #define MEAS_STR "Measurement export related\n" DEFUN(mnccint_meas_feed, mnccint_meas_feed_cmd, "meas-feed destination ADDR <0-65535>", @@ -966,7 +952,6 @@ install_element(MNCC_INT_NODE, &mnccint_meas_feed_cmd); install_element(MNCC_INT_NODE, &meas_feed_scenario_cmd); - install_element(CFG_LOG_NODE, &log_level_sms_cmd); install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); install_element(CONFIG_NODE, &cfg_hlr_cmd); -- To view, visit https://gerrit.osmocom.org/4555 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I38ba8b9414de383bf497526d97bf7a039e41fd35 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 31 01:03:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 01:03:46 +0000 Subject: [MERGED] osmo-msc[master]: vty: make auth tuple reuse configurable In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: make auth tuple reuse configurable ...................................................................... vty: make auth tuple reuse configurable Change-Id: Iba6253d9bf8d4a9d9f6f26ba045e6c7f0dc7f8f2 --- M doc/examples/osmo-msc/osmo-msc.cfg M src/libmsc/msc_vty.c 2 files changed, 33 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg index 1b1d192..fff964b 100644 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ b/doc/examples/osmo-msc/osmo-msc.cfg @@ -17,3 +17,5 @@ msc mgcpgw remote-ip 10.23.24.1 assign-tmsi + auth-tuple-max-reuse-count 3 + auth-tuple-reuse-on-error 1 diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 5c9539d..c19666f 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -88,6 +88,27 @@ return CMD_SUCCESS; } +DEFUN(cfg_msc_auth_tuple_max_reuse_count, cfg_msc_auth_tuple_max_reuse_count_cmd, + "auth-tuple-max-reuse-count <-1-2147483647>", + "Configure authentication tuple re-use\n" + "0 to use each auth tuple at most once (default), >0 to limit re-use, -1 to re-use infinitely (vulnerable!).\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + gsmnet->vlr->cfg.auth_tuple_max_reuse_count = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_msc_auth_tuple_reuse_on_error, cfg_msc_auth_tuple_reuse_on_error_cmd, + "auth-tuple-reuse-on-error (0|1)", + "Configure authentication tuple re-use when HLR is not responsive\n" + "0 = never re-use auth tuples beyond auth-tuple-max-reuse-count (default)\n" + "1 = if the HLR does not deliver new tuples, do re-use already available old ones.\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + gsmnet->vlr->cfg.auth_reuse_old_sets_on_error = atoi(argv[0]) ? true : false; + return CMD_SUCCESS; +} + static int config_write_msc(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); @@ -100,6 +121,14 @@ VTY_NEWLINE); vty_out(vty, " cs7-instance-iu %u%s", gsmnet->iu.cs7_instance, VTY_NEWLINE); + + if (gsmnet->vlr->cfg.auth_tuple_max_reuse_count) + vty_out(vty, " auth-tuple-max-reuse-count %d%s", + OSMO_MAX(-1, gsmnet->vlr->cfg.auth_tuple_max_reuse_count), + VTY_NEWLINE); + if (gsmnet->vlr->cfg.auth_reuse_old_sets_on_error) + vty_out(vty, " auth-tuple-reuse-on-error 1%s", + VTY_NEWLINE); mgcp_client_config_write(vty, " "); #ifdef BUILD_IU @@ -152,6 +181,8 @@ vty_install_default(MSC_NODE); install_element(MSC_NODE, &cfg_msc_assign_tmsi_cmd); install_element(MSC_NODE, &cfg_msc_no_assign_tmsi_cmd); + install_element(MSC_NODE, &cfg_msc_auth_tuple_max_reuse_count_cmd); + install_element(MSC_NODE, &cfg_msc_auth_tuple_reuse_on_error_cmd); install_element(MSC_NODE, &cfg_msc_cs7_instance_a_cmd); install_element(MSC_NODE, &cfg_msc_cs7_instance_iu_cmd); -- To view, visit https://gerrit.osmocom.org/4554 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba6253d9bf8d4a9d9f6f26ba045e6c7f0dc7f8f2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 31 01:03:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 01:03:46 +0000 Subject: [MERGED] osmo-msc[master]: tests: add msc_vlr_test_authen_reuse In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: tests: add msc_vlr_test_authen_reuse ...................................................................... tests: add msc_vlr_test_authen_reuse Change-Id: I185a2cbff6241a27722f1c37ae609f0fcc59a71e --- M tests/msc_vlr/Makefile.am A tests/msc_vlr/msc_vlr_test_authen_reuse.c A tests/msc_vlr/msc_vlr_test_authen_reuse.err A tests/msc_vlr/msc_vlr_test_authen_reuse.ok M tests/msc_vlr/msc_vlr_tests.c M tests/testsuite.at 6 files changed, 2,962 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index b1bf78e..7fc9212 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -65,6 +65,8 @@ msc_vlr_test_gsm_ciph.err \ msc_vlr_test_umts_authen.ok \ msc_vlr_test_umts_authen.err \ + msc_vlr_test_authen_reuse.ok \ + msc_vlr_test_authen_reuse.err \ msc_vlr_test_hlr_reject.ok \ msc_vlr_test_hlr_reject.err \ msc_vlr_test_hlr_timeout.ok \ @@ -82,6 +84,7 @@ msc_vlr_test_gsm_authen \ msc_vlr_test_gsm_ciph \ msc_vlr_test_umts_authen \ + msc_vlr_test_authen_reuse \ msc_vlr_test_hlr_reject \ msc_vlr_test_hlr_timeout \ msc_vlr_test_ms_timeout \ @@ -106,6 +109,11 @@ msc_vlr_test_umts_authen_SOURCES = \ msc_vlr_test_umts_authen.c \ + msc_vlr_tests.c \ + $(NULL) + +msc_vlr_test_authen_reuse_SOURCES = \ + msc_vlr_test_authen_reuse.c \ msc_vlr_tests.c \ $(NULL) @@ -140,6 +148,7 @@ $(builddir)/msc_vlr_test_gsm_authen >$(srcdir)/msc_vlr_test_gsm_authen.ok 2>$(srcdir)/msc_vlr_test_gsm_authen.err $(builddir)/msc_vlr_test_gsm_ciph >$(srcdir)/msc_vlr_test_gsm_ciph.ok 2>$(srcdir)/msc_vlr_test_gsm_ciph.err $(builddir)/msc_vlr_test_umts_authen >$(srcdir)/msc_vlr_test_umts_authen.ok 2>$(srcdir)/msc_vlr_test_umts_authen.err + $(builddir)/msc_vlr_test_authen_reuse >$(srcdir)/msc_vlr_test_authen_reuse.ok 2>$(srcdir)/msc_vlr_test_authen_reuse.err $(builddir)/msc_vlr_test_hlr_reject >$(srcdir)/msc_vlr_test_hlr_reject.ok 2>$(srcdir)/msc_vlr_test_hlr_reject.err $(builddir)/msc_vlr_test_hlr_timeout >$(srcdir)/msc_vlr_test_hlr_timeout.ok 2>$(srcdir)/msc_vlr_test_hlr_timeout.err $(builddir)/msc_vlr_test_ms_timeout >$(srcdir)/msc_vlr_test_ms_timeout.ok 2>$(srcdir)/msc_vlr_test_ms_timeout.err diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.c b/tests/msc_vlr/msc_vlr_test_authen_reuse.c new file mode 100644 index 0000000..103c904 --- /dev/null +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.c @@ -0,0 +1,337 @@ +/* Osmocom MSC+VLR end-to-end tests */ + +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +/* NOTE that further auth re-use tests exist in msc_vlr_test_hlr_reject.c */ + +#include "msc_vlr_tests.h" + +#define ASSERT_RELEASE_CLEAR(via_ran) \ + switch (via_ran) { \ + case RAN_GERAN_A: \ + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); \ + break; \ + case RAN_UTRAN_IU: \ + VERBOSE_ASSERT(iu_release_sent, == true, "%d"); \ + break; \ + default: \ + OSMO_ASSERT(false); \ + break; \ + } + +void _test_auth_reuse(enum ran_type via_ran, + int set_max_reuse_count, + int loop_requests_without_hlr, + bool final_request_with_hlr) +{ + struct vlr_subscr *vsub; + const char *imsi = "901700000010650"; + int expected_use_count; + int i; + + net->authentication_required = true; + net->vlr->cfg.assign_tmsi = true; + net->vlr->cfg.auth_tuple_max_reuse_count = set_max_reuse_count; + net->vlr->cfg.auth_reuse_old_sets_on_error = false; + rx_from_ran = via_ran; + + btw("Location Update request causes a GSUP Send Auth Info request to HLR"); + lu_result_sent = RES_NONE; + gsup_expect_tx("080108" "09710000000156f0"); + ms_sends_msg("0508" /* MM LU */ + "7" /* ciph key seq: no key available */ + "0" /* LU type: normal */ + "ffffff" "0000" /* LAI, LAC */ + "57" /* classmark 1: R99, early classmark, no power lvl */ + "089910070000106005" /* IMSI */ + "3303575886" /* classmark 2 */ + ); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS"); + /* based on auc_3g: + * K = 'EB215756028D60E3275E613320AEC880', + * OPC = 'FB2A3D1B360F599ABAB99DB8669F8308' + * SQN = 0 + */ + auth_request_sent = false; + auth_request_expect_rand = "39fa2f4e3d523d8619a73b4f65c3e14d"; + auth_request_expect_autn = "8704f5ba55f30000d2ee44b22c8ea919"; + gsup_rx("0a" + /* imsi */ + "0108" "09710000000156f0" + /* TL TL rand */ + "0362" "2010" "39fa2f4e3d523d8619a73b4f65c3e14d" + /* TL sres TL kc */ + "2104" "9b36efdf" "2208" "059a4f668f6fbe39" + /* TL 3G IK */ + "2310" "27497388b6cb044648f396aa155b95ef" + /* TL 3G CK */ + "2410" "f64735036e5871319c679f4742a75ea1" + /* TL AUTN */ + "2510" "8704f5ba55f30000d2ee44b22c8ea919" + /* TL RES */ + "2708" "e229c19e791f2e41", + NULL); + VERBOSE_ASSERT(auth_request_sent, == true, "%d"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + if (via_ran == RAN_GERAN_A) { + btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR"); + gsup_expect_tx("04010809710000000156f0"); + ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); + VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + } else { + /* On UTRAN */ + btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); + cipher_mode_cmd_sent = false; + ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); + VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR"); + gsup_expect_tx("04010809710000000156f0"); + ms_sends_security_mode_complete(); + VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + } + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000000156f00804032443f2", + "12010809710000000156f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); + gsup_rx("06010809710000000156f0", NULL); + + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + + btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); + EXPECT_CONN_COUNT(1); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("even though the TMSI is not acked, we can already find the subscr with it"); + vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100); + VERBOSE_ASSERT(vsub != NULL, == true, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d"); + VERBOSE_ASSERT(vsub->tmsi_new, == 0x03020100, "0x%08x"); + VERBOSE_ASSERT(vsub->tmsi, == GSM_RESERVED_TMSI, "0x%08x"); + vlr_subscr_put(vsub); + + btw("MS sends TMSI Realloc Complete"); + expect_release_clear(via_ran); + ms_sends_msg("055b"); + ASSERT_RELEASE_CLEAR(via_ran); + + btw("LU was successful, and the conn has already been closed"); + EXPECT_CONN_COUNT(0); + + expected_use_count = 1; + + for (i = 0; i < loop_requests_without_hlr; i++, expected_use_count++) { + BTW("Now the auth tuple has use_count == %d", expected_use_count); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + OSMO_ASSERT(vsub->last_tuple); + VERBOSE_ASSERT(vsub->last_tuple->use_count, == expected_use_count, "%d"); + vlr_subscr_put(vsub); + + BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req," + " and reuses old auth vector"); + auth_request_sent = true; + cm_service_result_sent = RES_NONE; + ms_sends_msg("052478" + "03575886" /* classmark 2 */ + "089910070000106005" /* IMSI */); + OSMO_ASSERT(g_conn); + OSMO_ASSERT(g_conn->conn_fsm); + OSMO_ASSERT(g_conn->vsub); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + VERBOSE_ASSERT(auth_request_sent, == true, "%d"); + + if (via_ran == RAN_GERAN_A) { + btw("MS sends Authen Response, VLR accepts with a CM Service Accept"); + gsup_expect_tx(NULL); + ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); + VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); + } else { + /* On UTRAN */ + btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); + cipher_mode_cmd_sent = false; + ms_sends_msg("0554" "e229c19e" "2104" "791f2e41"); + VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d"); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + + btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept"); + ms_sends_security_mode_complete(); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + } + + btw("a USSD request is serviced"); + dtap_expect_tx_ussd("Your extension is 42342\r"); + expect_release_clear(via_ran); + ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); + OSMO_ASSERT(dtap_tx_confirmed); + ASSERT_RELEASE_CLEAR(via_ran); + + btw("all requests serviced, conn has been released"); + EXPECT_CONN_COUNT(0); + } + + if (final_request_with_hlr) { + BTW("Now the auth tuple has use_count == %d, as much as is allowed.", expected_use_count); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + OSMO_ASSERT(vsub->last_tuple); + VERBOSE_ASSERT(vsub->last_tuple->use_count, == expected_use_count, "%d"); + vlr_subscr_put(vsub); + + BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req," + " and needs to request a second auth vector from HLR"); + auth_request_sent = false; + cm_service_result_sent = RES_NONE; + gsup_expect_tx("080108" "09710000000156f0"); + ms_sends_msg("052478" + "03575886" /* classmark 2 */ + "089910070000106005" /* IMSI */); + OSMO_ASSERT(g_conn); + OSMO_ASSERT(g_conn->conn_fsm); + OSMO_ASSERT(g_conn->vsub); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + VERBOSE_ASSERT(auth_request_sent, == false, "%d"); + VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d"); + + btw("from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS"); + auth_request_expect_rand = "c187a53a5e6b9d573cac7c74451fd46d"; + auth_request_expect_autn = "1843a645b98d00005b2d666af46c45d9"; + gsup_rx("0a" + /* imsi */ + "0108" "09710000000156f0" + /* TL TL rand */ + /* TL sres TL kc */ + /* TL 3G IK */ + /* TL 3G CK */ + /* TL AUTN */ + /* TL RES */ + "0362" "2010" "c187a53a5e6b9d573cac7c74451fd46d" + "2104" "85aa3130" "2208" "d3d50a000bf04f6e" + "2310" "1159ec926a50e98c034a6b7d7c9f418d" + "2410" "df3a03d9ca5335641efc8e36d76cd20b" + "2510" "1843a645b98d00005b2d666af46c45d9" + "2708" "7db47cf7f81e4dc7", + NULL); + VERBOSE_ASSERT(auth_request_sent, == true, "%d"); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + + if (via_ran == RAN_GERAN_A) { + btw("MS sends Authen Response, VLR accepts with a CM Service Accept"); + gsup_expect_tx(NULL); + ms_sends_msg("0554" "7db47cf7" "2104" "f81e4dc7"); /* 2nd vector's res, s.a. */ + VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); + } else { + /* On UTRAN */ + btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); + cipher_mode_cmd_sent = false; + ms_sends_msg("0554" "7db47cf7" "2104" "f81e4dc7"); /* 2nd vector's res, s.a. */ + VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d"); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + + btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept"); + ms_sends_security_mode_complete(); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + } + + btw("a USSD request is serviced"); + dtap_expect_tx_ussd("Your extension is 42342\r"); + expect_release_clear(via_ran); + ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); + OSMO_ASSERT(dtap_tx_confirmed); + ASSERT_RELEASE_CLEAR(via_ran); + + btw("all requests serviced, conn has been released"); + EXPECT_CONN_COUNT(0); + } + + BTW("subscriber detaches"); + expect_release_clear(via_ran); + ms_sends_msg("050130" + "089910070000106005" /* IMSI */); + ASSERT_RELEASE_CLEAR(via_ran); + + EXPECT_CONN_COUNT(0); + clear_vlr(); +} + +void test_auth_use_twice_geran() +{ + comment_start(); + _test_auth_reuse(RAN_GERAN_A, 1, 1, true); + comment_end(); +} + +void test_auth_use_twice_utran() +{ + comment_start(); + _test_auth_reuse(RAN_UTRAN_IU, 1, 1, true); + comment_end(); +} + +void test_auth_use_infinitely_geran() +{ + comment_start(); + _test_auth_reuse(RAN_GERAN_A, -1, 3, false); + comment_end(); +} + +void test_auth_use_infinitely_utran() +{ + comment_start(); + _test_auth_reuse(RAN_UTRAN_IU, -1, 3, false); + comment_end(); +} + +void test_no_auth_reuse_geran() +{ + comment_start(); + _test_auth_reuse(RAN_GERAN_A, 0, 0, true); + comment_end(); +} + +void test_no_auth_reuse_utran() +{ + comment_start(); + _test_auth_reuse(RAN_UTRAN_IU, 0, 0, true); + comment_end(); +} + +msc_vlr_test_func_t msc_vlr_tests[] = { + test_auth_use_twice_geran, + test_auth_use_twice_utran, + test_auth_use_infinitely_geran, + test_auth_use_infinitely_utran, + test_no_auth_reuse_geran, + test_no_auth_reuse_utran, + NULL +}; diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err b/tests/msc_vlr/msc_vlr_test_authen_reuse.err new file mode 100644 index 0000000..3ceecf3 --- /dev/null +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err @@ -0,0 +1,2606 @@ +===== test_auth_use_twice_geran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=GERAN Auth (no Ciph) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=2 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=2 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 2, as much as is allowed. +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 2 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and needs to request a second auth vector from HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 0 + gsup_tx_confirmed == 1 +- from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DVLR GSUP rx 111: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(MSISDN:42342) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=c187a53a5e6b9d573cac7c74451fd46d +- ...autn=1843a645b98d00005b2d666af46c45d9 +- ...expecting res=7db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + cm_service_result_sent == 0 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_auth_use_twice_geran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_auth_use_twice_utran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=UTRAN Auth+Ciph +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +- sending SecurityModeControl for IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + lu_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR +DMM <- SECURITY MODE COMPLETE IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() +DIUCS IMSI:901700000010650: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=2 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=2 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 2, as much as is allowed. +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 2 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and needs to request a second auth vector from HLR + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 0 + gsup_tx_confirmed == 1 +- from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DVLR GSUP rx 111: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(MSISDN:42342) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=c187a53a5e6b9d573cac7c74451fd46d +- ...autn=1843a645b98d00005b2d666af46c45d9 +- ...expecting res=7db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + cm_service_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + iu_release_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_auth_use_twice_utran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_auth_use_infinitely_geran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=GERAN Auth (no Ciph) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=2 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=2 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 2 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 2 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=3 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=3 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 3 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 3 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=4 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=4 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_auth_use_infinitely_geran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_auth_use_infinitely_utran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=UTRAN Auth+Ciph +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +- sending SecurityModeControl for IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + lu_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR +DMM <- SECURITY MODE COMPLETE IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() +DIUCS IMSI:901700000010650: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=2 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=2 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 2 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 2 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=3 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=3 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 3 +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 3 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and reuses old auth vector + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=4 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=4 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 1 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + iu_release_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_auth_use_infinitely_utran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_no_auth_reuse_geran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=GERAN Auth (no Ciph) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1, as much as is allowed. +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and needs to request a second auth vector from HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=GERAN Auth (no Ciph) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 0 + gsup_tx_confirmed == 1 +- from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DVLR GSUP rx 111: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(MSISDN:42342) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=c187a53a5e6b9d573cac7c74451fd46d +- ...autn=1843a645b98d00005b2d666af46c45d9 +- ...expecting res=7db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + cm_service_result_sent == 0 +- MS sends Authen Response, VLR accepts with a CM Service Accept + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +- sending CM Service Accept for MSISDN:42342 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 1 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_auth_reuse_geran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_no_auth_reuse_utran +- Location Update request causes a GSUP Send Auth Info request to HLR + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000010650 type=NORMAL +DMM LU/new-LAC: 0/0 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: rev=R99 net=UTRAN Auth+Ciph +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 +DVLR New subscr, IMSI: 901700000010650 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + lu_result_sent == 0 +- from HLR, rx _SEND_AUTH_INFO_RESULT, only one tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DVLR GSUP rx 111: 0a010809710000000156f00362201039fa2f4e3d523d8619a73b4f65c3e14d21049b36efdf2208059a4f668f6fbe39231027497388b6cb044648f396aa155b95ef2410f64735036e5871319c679f4742a75ea125108704f5ba55f30000d2ee44b22c8ea9192708e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(IMSI:901700000010650) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for IMSI:901700000010650: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=39fa2f4e3d523d8619a73b4f65c3e14d +- ...autn=8704f5ba55f30000d2ee44b22c8ea919 +- ...expecting res=e229c19e791f2e41 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + lu_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF IMSI:901700000010650: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 +DVLR SUBSCR(IMSI:901700000010650) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() +- sending SecurityModeControl for IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH +DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000010650: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + lu_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req to HLR +DMM <- SECURITY MODE COMPLETE IMSI:901700000010650 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() +DIUCS IMSI:901700000010650: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_CIPH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000000156f0 +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA + gsup_tx_confirmed == 1 + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000000156f00804032443f2 +DVLR GSUP rx 17: 10010809710000000156f00804032443f2 +DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DVLR IMSI:901700000010650 has MSISDN:42342 +DVLR GSUP tx: 12010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000000156f0 +DVLR GSUP rx 11: 06010809710000000156f0 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000010650){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000010650) +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000010650){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:42342, with TMSI 0x03020100 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000010650) +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- Now the auth tuple has use_count == 1, as much as is allowed. +DREF VLR subscr MSISDN:42342 usage increases to: 2 + vsub->last_tuple->use_count == 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +--- +- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, and needs to request a second auth vector from HLR + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: rev=R99 net=UTRAN Auth+Ciph +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START +DVLR GSUP tx: 08010809710000000156f0 +GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cm_service_result_sent == 0 + auth_request_sent == 0 + gsup_tx_confirmed == 1 +- from HLR, rx _SEND_AUTH_INFO_RESULT, second tuple; VLR sends Auth Req to MS +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DVLR GSUP rx 111: 0a010809710000000156f003622010c187a53a5e6b9d573cac7c74451fd46d210485aa31302208d3d50a000bf04f6e23101159ec926a50e98c034a6b7d7c9f418d2410df3a03d9ca5335641efc8e36d76cd20b25101843a645b98d00005b2d666af46c45d927087db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage increases to: 3 +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK +DVLR SUBSCR(MSISDN:42342) Received 1 auth tuples +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0 +- sending UMTS Auth Request for MSISDN:42342: tuple use_count=1 key_seq=0 auth_types=0x3 and... +- ...rand=c187a53a5e6b9d573cac7c74451fd46d +- ...autn=1843a645b98d00005b2d666af46c45d9 +- ...expecting res=7db47cf7f81e4dc7 +DREF VLR subscr MSISDN:42342 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0 + auth_request_sent == 1 + cm_service_result_sent == 0 +- MS sends Authen Response, VLR accepts and sends SecurityModeControl + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) +DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP +DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 +DVLR SUBSCR(MSISDN:42342) AUTH established UMTS security context +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Removing from parent Process_Access_Request_VLR(901700000010650) +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Freeing instance +DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() +- sending SecurityModeControl for MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH +DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:42342: MSC conn use - 1 == 1 + cipher_mode_cmd_sent == 1 + cm_service_result_sent == 0 +- MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept +DMM <- SECURITY MODE COMPLETE MSISDN:42342 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() +DIUCS MSISDN:42342: tx CommonID 901700000010650 +- Iu Common ID --RAN_UTRAN_IU--> MS (IMSI=901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_PASSED) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_PASSED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: received_cm_service_request = true +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request + cm_service_result_sent == 0 +- a USSD request is serviced + expecting USSD: + Your extension is 42342 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b +DREF MSISDN:42342: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:42342: MSISDN = 42342 +DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP matches expected message +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000010650) +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:42342, cause=2): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF MSISDN:42342: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:42342: MSC conn use - 1 == 0 +DRLL subscr MSISDN:42342: Freeing subscriber connection +DREF VLR subscr MSISDN:42342 usage decreases to: 1 + iu_release_sent == 1 +- all requests serviced, conn has been released + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 +DREF VLR subscr MSISDN:42342 usage increases to: 2 +DMM IMSI DETACH for MSISDN:42342 +DREF VLR subscr MSISDN:42342 usage decreases to: 1 +DREF VLR subscr MSISDN:42342 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:42342 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- Iu Release --RAN_UTRAN_IU--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + iu_release_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_auth_reuse_utran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.ok b/tests/msc_vlr/msc_vlr_test_authen_reuse.ok new file mode 100644 index 0000000..a965a70 --- /dev/null +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.ok @@ -0,0 +1 @@ +Done diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index f9dc278..7b1db1b 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -334,6 +334,8 @@ net->vlr->cfg.assign_tmsi = false; net->vlr->cfg.retrieve_imeisv_early = false; net->vlr->cfg.retrieve_imeisv_ciphered = false; + net->vlr->cfg.auth_tuple_max_reuse_count = 0; + net->vlr->cfg.auth_reuse_old_sets_on_error = false; rx_from_ran = RAN_GERAN_A; auth_request_sent = false; diff --git a/tests/testsuite.at b/tests/testsuite.at index e3e9017..f0147e7 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -44,6 +44,13 @@ AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_umts_authen], [], [expout], [experr]) AT_CLEANUP +AT_SETUP([msc_vlr_test_authen_reuse]) +AT_KEYWORDS([msc_vlr_test_authen_reuse]) +cat $abs_srcdir/msc_vlr/msc_vlr_test_authen_reuse.ok > expout +cat $abs_srcdir/msc_vlr/msc_vlr_test_authen_reuse.err > experr +AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_authen_reuse], [], [expout], [experr]) +AT_CLEANUP + AT_SETUP([msc_vlr_test_hlr_reject]) AT_KEYWORDS([msc_vlr_test_hlr_reject]) cat $abs_srcdir/msc_vlr/msc_vlr_test_hlr_reject.ok > expout -- To view, visit https://gerrit.osmocom.org/4553 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I185a2cbff6241a27722f1c37ae609f0fcc59a71e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 31 01:03:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 01:03:46 +0000 Subject: [MERGED] osmo-msc[master]: cosmetic: vlr: rename auth_tuple_max_use_count to _reuse_ In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: vlr: rename auth_tuple_max_use_count to _reuse_ ...................................................................... cosmetic: vlr: rename auth_tuple_max_use_count to _reuse_ The name auth_tuple_max_use_count suggests that if I want to use each auth tuple exactly once, I need to set it to 1. Curiously, so far you need to set to intended uses - 1. Reflect this in its name by renaming to auth_tuple_max_reuse_count. I first considered to not rename but change the if-conditions so that == 1 means each tuple is used once, and upon struct vlr allocation, set the default to 1. That would also logically entail that setting to 0 means to re-use vectors infinitely often, like now a value < 0 does. That means, when allocating a vlr struct zeroed out, we would by default have the most dangerous/unsafe configuration. It's no problem to set a default to 1 upon allocation, but by renaming the variable instead, we get safer alloc-zero behavior and don't need to change any conditionals in the code (even though the patch ends up considerably larger from all the renaming). Change-Id: I0b036cae1536d5d6fb2304f837ed1a6c3713be55 --- M include/osmocom/msc/vlr.h M src/libvlr/vlr_auth_fsm.c M tests/msc_vlr/msc_vlr_test_hlr_reject.c 3 files changed, 21 insertions(+), 21 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h index e9afde3..d5306fa 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -222,7 +222,7 @@ bool retrieve_imeisv_ciphered; bool assign_tmsi; bool check_imei_rqd; - int auth_tuple_max_use_count; + int auth_tuple_max_reuse_count; bool auth_reuse_old_sets_on_error; bool parq_retrieve_imsi; bool is_ps; diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c index 1c9e191..f07e60f 100644 --- a/src/libvlr/vlr_auth_fsm.c +++ b/src/libvlr/vlr_auth_fsm.c @@ -59,7 +59,7 @@ bool is_utran; bool auth_requested; - int auth_tuple_max_use_count; /* see vlr->cfg instead */ + int auth_tuple_max_reuse_count; /* see vlr->cfg instead */ }; /*********************************************************************** @@ -69,13 +69,13 @@ /* Always use either vlr_subscr_get_auth_tuple() or vlr_subscr_has_auth_tuple() * instead, to ensure proper use count. * Return an auth tuple with the lowest use_count among the auth tuples. If - * max_use_count >= 0, return NULL if all available auth tuples have a use - * count > max_use_count. If max_use_count is negative, return a currently + * max_reuse_count >= 0, return NULL if all available auth tuples have a use + * count > max_reuse_count. If max_reuse_count is negative, return a currently * least used auth tuple without enforcing a maximum use count. If there are * no auth tuples, return NULL. */ static struct gsm_auth_tuple * -_vlr_subscr_next_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +_vlr_subscr_next_auth_tuple(struct vlr_subscr *vsub, int max_reuse_count) { unsigned int count; unsigned int idx; @@ -104,7 +104,7 @@ at = &vsub->auth_tuples[idx]; } - if (!at || (max_use_count >= 0 && at->use_count > max_use_count)) + if (!at || (max_reuse_count >= 0 && at->use_count > max_reuse_count)) return NULL; return at; @@ -112,21 +112,21 @@ /* Return an auth tuple and increment its use count. */ static struct gsm_auth_tuple * -vlr_subscr_get_auth_tuple(struct vlr_subscr *vsub, int max_use_count) +vlr_subscr_get_auth_tuple(struct vlr_subscr *vsub, int max_reuse_count) { struct gsm_auth_tuple *at = _vlr_subscr_next_auth_tuple(vsub, - max_use_count); + max_reuse_count); if (!at) return NULL; at->use_count++; return at; } -/* Return whether an auth tuple with the given max_use_count is available. */ +/* Return whether an auth tuple with a matching use_count is available. */ static bool vlr_subscr_has_auth_tuple(struct vlr_subscr *vsub, - int max_use_count) + int max_reuse_count) { - return _vlr_subscr_next_auth_tuple(vsub, max_use_count) != NULL; + return _vlr_subscr_next_auth_tuple(vsub, max_reuse_count) != NULL; } static bool check_auth_resp(struct vlr_subscr *vsub, bool is_r99, @@ -250,7 +250,7 @@ struct gsm_auth_tuple *at; /* Caller ensures we have vectors available */ - at = vlr_subscr_get_auth_tuple(vsub, afp->auth_tuple_max_use_count); + at = vlr_subscr_get_auth_tuple(vsub, afp->auth_tuple_max_reuse_count); if (!at) { LOGPFSML(fi, LOGL_ERROR, "A previous check ensured that an" " auth tuple was available, but now there is in fact" @@ -284,12 +284,12 @@ OSMO_ASSERT(event == VLR_AUTH_E_START); - /* Start off with the default max_use_count, possibly change that if we + /* Start off with the default max_reuse_count, possibly change that if we * need to re-use an old tuple. */ - afp->auth_tuple_max_use_count = vsub->vlr->cfg.auth_tuple_max_use_count; + afp->auth_tuple_max_reuse_count = vsub->vlr->cfg.auth_tuple_max_reuse_count; /* Check if we have vectors available */ - if (!vlr_subscr_has_auth_tuple(vsub, afp->auth_tuple_max_use_count)) { + if (!vlr_subscr_has_auth_tuple(vsub, afp->auth_tuple_max_reuse_count)) { /* Obtain_Authentication_Sets_VLR */ vlr_subscr_req_sai(vsub, NULL, NULL); osmo_fsm_inst_state_chg(fi, VLR_SUB_AS_NEEDS_AUTH_WAIT_AI, @@ -323,9 +323,9 @@ || (event == VLR_AUTH_E_HLR_SAI_ABORT)) { if (vsub->vlr->cfg.auth_reuse_old_sets_on_error && vlr_subscr_has_auth_tuple(vsub, -1)) { - /* To re-use an old tuple, disable the max_use_count + /* To re-use an old tuple, disable the max_reuse_count * constraint. */ - afp->auth_tuple_max_use_count = -1; + afp->auth_tuple_max_reuse_count = -1; goto pass; } /* result = procedure error */ diff --git a/tests/msc_vlr/msc_vlr_test_hlr_reject.c b/tests/msc_vlr/msc_vlr_test_hlr_reject.c index 095da81..6cf4afc 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_reject.c +++ b/tests/msc_vlr/msc_vlr_test_hlr_reject.c @@ -84,7 +84,7 @@ net->authentication_required = true; net->vlr->cfg.auth_reuse_old_sets_on_error = false; - net->vlr->cfg.auth_tuple_max_use_count = 0; + net->vlr->cfg.auth_tuple_max_reuse_count = 0; BTW("Submit a used auth tuple in the VLR"); btw("Location Update request causes a GSUP Send Auth Info request to HLR"); @@ -171,7 +171,7 @@ net->authentication_required = true; net->vlr->cfg.auth_reuse_old_sets_on_error = true; - net->vlr->cfg.auth_tuple_max_use_count = 0; + net->vlr->cfg.auth_tuple_max_reuse_count = 0; BTW("Submit a used auth tuple in the VLR"); btw("Location Update request causes a GSUP Send Auth Info request to HLR"); @@ -256,7 +256,7 @@ net->authentication_required = true; net->vlr->cfg.auth_reuse_old_sets_on_error = true; - net->vlr->cfg.auth_tuple_max_use_count = 0; + net->vlr->cfg.auth_tuple_max_reuse_count = 0; btw("Location Update request causes a GSUP Send Auth Info request to HLR"); lu_result_sent = RES_NONE; @@ -291,7 +291,7 @@ net->authentication_required = true; net->vlr->cfg.auth_reuse_old_sets_on_error = true; - net->vlr->cfg.auth_tuple_max_use_count = 0; + net->vlr->cfg.auth_tuple_max_reuse_count = 0; BTW("Submit a used auth tuple in the VLR"); btw("Location Update request causes a GSUP Send Auth Info request to HLR"); -- To view, visit https://gerrit.osmocom.org/4552 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0b036cae1536d5d6fb2304f837ed1a6c3713be55 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 31 01:05:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 01:05:23 +0000 Subject: osmo-ggsn[master]: fix compiler warnings: return 0 in main(), in 3 tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 +2 for triviality -- To view, visit https://gerrit.osmocom.org/4596 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e49ceba6b0a8dffd331e5707667d9bb007f3ec7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 01:05:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 01:05:24 +0000 Subject: [MERGED] osmo-ggsn[master]: fix compiler warnings: return 0 in main(), in 3 tests In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix compiler warnings: return 0 in main(), in 3 tests ...................................................................... fix compiler warnings: return 0 in main(), in 3 tests Change-Id: I9e49ceba6b0a8dffd331e5707667d9bb007f3ec7 --- M tests/gtp/gtpie_test.c M tests/lib/in46a_test.c M tests/lib/ippool_test.c 3 files changed, 3 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/gtp/gtpie_test.c b/tests/gtp/gtpie_test.c index fe2d502..8d87dcc 100644 --- a/tests/gtp/gtpie_test.c +++ b/tests/gtp/gtpie_test.c @@ -124,4 +124,5 @@ /* TODO: gtpie_encaps() */ /* TODO: gtpie_encaps2() */ /* TODO: gtpie_getie(), gtpie_exist(), gtpie_get*() */ + return 0; } diff --git a/tests/lib/in46a_test.c b/tests/lib/in46a_test.c index 42a1768..ab7156f 100644 --- a/tests/lib/in46a_test.c +++ b/tests/lib/in46a_test.c @@ -321,4 +321,5 @@ test_in46a_to_eua(); test_in46a_from_eua(); test_in46a_netmasklen(); + return 0; } diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index ea56edd..5b3227c 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -130,4 +130,5 @@ srand(time(NULL)); test_pool_sizes(); + return 0; } -- To view, visit https://gerrit.osmocom.org/4596 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e49ceba6b0a8dffd331e5707667d9bb007f3ec7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 31 01:05:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 01:05:42 +0000 Subject: [MERGED] openbsc[master]: debian/rules: show testsuite.log when tests are failing In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian/rules: show testsuite.log when tests are failing ...................................................................... debian/rules: show testsuite.log when tests are failing Change-Id: I30151897d621a1428095006e1f0e8a47059de4cd --- M debian/rules 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index 05bbbef..ef08596 100755 --- a/debian/rules +++ b/debian/rules @@ -27,3 +27,6 @@ echo $(VERSION) > openbsc/.tarball-version dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp +# Print test results in case of a failure +override_dh_auto_test: + dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/4414 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I30151897d621a1428095006e1f0e8a47059de4cd Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 31 01:37:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 01:37:08 +0000 Subject: osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 (11 comments) https://gerrit.osmocom.org/#/c/4334/4/src/osmo-bsc/osmo_bsc_mgcp.c File src/osmo-bsc/osmo_bsc_mgcp.c: Line 130: > I am not so sure about this. While developing this the OSMO_ASSERT() helped yes, that's fine. Just consider that for the future. I remember myself using a lot of non-null assertions all over the place, until I realized one day that most are just bloat... Line 143: > I think even if it won't change anything, it is logically incorrect. The ti erm, not sure I understand. AFAIK when you change an FSM's state with 0 for timeout, there will not be any timeout, the fsm will happily remain in that state forever. Is there another timeout function I'm not aware of? If yes it should probably be incorporated into the fsm? ...hold on, this waits for the subscriber to end the call, right? Does it make sense to at least give it a ridiculous timeout, like 24 hours? Line 147: LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "fsm-state: %s\n", get_value_string(fsm_bsc_mgcp_state_names, fi->state)); ah damn, it appears all of my comments here are wrong, because this is the error handling. You go to the DLCX state and then dispatch an event to it to take an action. It is a bit unintuitive to me because in the VLR FSMs I think we call a static function to tear down and put the fsm directly in the final ending state without dispatching events ... I guess either way is fine. Just tell me now that I got it right this time, and all is fine. Line 185: > (Note: lindent/indent has problems with that format) hmm, then I'm not going to use lindent :P Line 190: mgcp_msg = (struct mgcp_msg) { > If we do this we will loose the flexibility to support any endpoint naming right, so we need flexible endpoint strings. -1: However, snprintf can fail, shouldn't this have error handling of sorts? Line 193: MGCP_MSG_PRESENCE_CONN_MODE), > I do not think that we will benefit much from this. The presence field is i we have osmo_sccp_make_addr_pc_ssn(), osmo_sccp_addr_set_ssn() :) Line 499: > I am not sure here, but I think this is should be catched by the client (we ...which would mean the client needs to cache all the sent messages. I don't think we want that. If the MGW sends a CRCX OK message and we can't parse that, I think going to DLCX is the right move here. It shouldn't actually happen in a real setup, so this is just waterproofing. Line 814: mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm_bsc_mgcp, NULL, ctx, LOGL_DEBUG, name); > Probably we should have also some protection that makes it impossible to re harald has already merged such protection, which is why some builds were failing and we had to fix some names that are already in master. Remember? https://gerrit.osmocom.org/#/c/4334/7/src/osmo-bsc/osmo_bsc_vty.c File src/osmo-bsc/osmo_bsc_vty.c: Line 977: struct gsm_network *net = bsc_gsmnet; and earlier comment: why create a local var if it is used only once and also is just an alias for another short enough name? Line 978: -1: ws Line 1044: -1: ws -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 31 01:37:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 01:37:27 +0000 Subject: osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams In-Reply-To: References: Message-ID: Patch Set 7: ...and what with the build failure? -- To view, visit https://gerrit.osmocom.org/4334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From admin at opensuse.org Tue Oct 31 07:45:35 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Oct 2017 07:45:35 +0000 Subject: Build failure of network:osmocom:latest/libosmocore in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59f82a3c6f016_638112baf8867268d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libosmocore/Debian_8.0/x86_64 Package network:osmocom:latest/libosmocore failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest libosmocore Last lines of build log: [ 244s] -[+] Testing: ??? (non-recursive, direct truncation, not punctured) [ 244s] -[.] Input length : ret = 224 exp = 224 -> OK [ 244s] -[.] Output length : ret = 448 exp = 448 -> OK [ 244s] -[.] Pre computed vector checks: [ 244s] -[..] Encoding: OK [ 244s] -[..] Decoding: OK [ 244s] -[.] Random vector checks: [ 244s] -[..] Encoding / Decoding cycle : OK [ 244s] -[..] Encoding / Decoding cycle : OK [ 244s] -[..] Encoding / Decoding cycle : OK [ 244s] - [ 244s] ./testsuite.at:57: exit code was 132, expected 0 [ 244s] 9. testsuite.at:54: 9. conv (testsuite.at:54): FAILED (testsuite.at:57) [ 244s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 244s] make[1]: *** [override_dh_auto_test] Error 1 [ 244s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 244s] debian/rules:15: recipe for target 'build' failed [ 244s] make: *** [build] Error 2 [ 244s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 244s] [ 244s] build31 failed "build libosmocore_0.10.1.dsc" at Tue Oct 31 07:45:25 UTC 2017. [ 244s] [ 244s] ### VM INTERACTION START ### [ 246s] Powering off. [ 246s] [ 237.780391] reboot: Power down [ 246s] ### VM INTERACTION END ### [ 246s] [ 246s] build31 failed "build libosmocore_0.10.1.dsc" at Tue Oct 31 07:45:27 UTC 2017. [ 246s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:15:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:15:40 +0000 Subject: osmo-sgsn[master]: drop osmo_sgsn.cfg from src/gprs dir In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4602 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b9c502afbddcfc02ea70aa8317e0d2f37276c38 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:16:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:16:31 +0000 Subject: osmo-sgsn[master]: change default config filename to osmo-sgsn.cfg, not osmo_sg... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 I agree with this, and it has been a long-standing, known issue. Hoewver, we cannot simply break all existing users. I think we need to accept both the old and the new file name. Preference should be on the new? -- To view, visit https://gerrit.osmocom.org/4603 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If804da17a7481e79e000fe40ae0d9c4be9722e61 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:17:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:17:03 +0000 Subject: osmo-gsm-tester[master]: cosmetic: use name 'mgw' instead of 'mgcpgw' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4601 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf65bd1daa52b280d73e56b6267b3c81ed1c5487 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:17:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:17:15 +0000 Subject: osmo-gsm-tester[master]: msc cfg: apply mgcp_client vty rename from 'mgcpgw' to 'mgw' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4600 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idd970917e84f923d229b0c3de43f3e964a0a20c2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:18:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:18:14 +0000 Subject: osmo-mgw[master]: mgcp-client vty: use name 'mgw' instead of 'mgcpgw' In-Reply-To: References: Message-ID: Patch Set 1: I think we have to install a legacy alias command to still continue to accept the old name. I would expect this to be rather straight-forward, i.e. without a lot of effort. right? -- To view, visit https://gerrit.osmocom.org/4597 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1d43d42929dc9162e57640499526fb7cadbcfbe6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:19:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:19:09 +0000 Subject: osmo-mgw[master]: mgcp client: vty: tweak doc strings In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4598/1/src/libosmo-mgcp-client/mgcp_client_vty.c File src/libosmo-mgcp-client/mgcp_client_vty.c: Line 76: MGW_STR "remote TCP port to reach the MGW at\n" both MGCP and RTP are UDP, so TCP is wrong, IMHO -- To view, visit https://gerrit.osmocom.org/4598 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie1a408f9e651c5fb3424a84ceaaa603e20ad595c Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:19:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:19:30 +0000 Subject: osmo-ci[master]: osmocom-nightly-packages: Build latest libgtpnl In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/4595 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iad600a36cb658bbd874b4587ec514f49703d6a45 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:19:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:19:33 +0000 Subject: [MERGED] osmo-ci[master]: osmocom-nightly-packages: Build latest libgtpnl In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmocom-nightly-packages: Build latest libgtpnl ...................................................................... osmocom-nightly-packages: Build latest libgtpnl libgtpnl is the userspace library for using kenrel GTP-U support, which is used by openggsn (and will be used by osmo-ggsn). Change-Id: Iad600a36cb658bbd874b4587ec514f49703d6a45 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 6206576..8c7a732 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -15,6 +15,7 @@ git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 git clone git://git.osmocom.org/libasn1c +git clone git://git.osmocom.org/libgtpnl git clone git://git.osmocom.org/osmo-iuh git clone git://git.osmocom.org/osmo-sgsn git clone git://git.osmocom.org/osmo-ggsn @@ -56,6 +57,7 @@ build libosmo-netif build libsmpp34 build libasn1c +build libgtpnl build osmo-iuh build osmo-ggsn build osmo-sgsn -- To view, visit https://gerrit.osmocom.org/4595 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iad600a36cb658bbd874b4587ec514f49703d6a45 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:22:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:22:06 +0000 Subject: libosmocore[master]: Enable GnuTLS fallback In-Reply-To: References: Message-ID: Patch Set 2: I would argue to activate the --enable-gnutls by default, if it is present on the system. But I don't have a strong opinion here. Or maybe rather, fail configure.ac if gnutls is not found AND no --disable-gnutls was present. Furthermore, in terms of efficiency (we allocate TMSIs all the time on a busy network), it makes sense to cache the failure of the syscall and not attempt to use the syscall at every random number generation to then fall back to gnutls. Let's try once, and if it fails store that in a static variable and use that variable next time. Does that make sense? -- To view, visit https://gerrit.osmocom.org/4593 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:23:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:23:15 +0000 Subject: libosmocore[master]: utils: move linked libraries into common variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 are you sure this is correct? Do we need the exact same set of libraries for both tools? Do you get dpkg-shlibdeps warnings for any of those? (I'm not saying I saw some, I just saw tons of them and fixed a whole bunch of them over the weekend in various osmocom projects). -- To view, visit https://gerrit.osmocom.org/4592 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I54f4e439cc232d926b42ddba9648d4f5e7487c3e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:24:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:24:17 +0000 Subject: libosmocore[master]: Move additional libraries to appropriate place In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4591 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia657a66db75df831421af5df1175a992da5ba80f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:24:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:24:35 +0000 Subject: osmo-tetra[master]: jenkins: use common osmo-build-dep.sh and osmo-clean-workspa... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4589 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3eca957c52b2c018e4c784b29330a0d06c4e3595 Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:24:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:24:41 +0000 Subject: osmocom-bb[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4590 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I87cc6aa7d6c332a0c2b4644dc8addc0f1a7df49d Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:24:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:24:55 +0000 Subject: osmo-trx[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4490 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I609f7c7c88b49f26e2e48e1f1cffed76d9e6fb5e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:24:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:24:58 +0000 Subject: [MERGED] osmo-trx[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93 Change-Id: I609f7c7c88b49f26e2e48e1f1cffed76d9e6fb5e --- M contrib/jenkins.sh 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 80d6612..f31579e 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,7 +1,12 @@ #!/bin/sh set -ex + +osmo-clean-workspace.sh + autoreconf --install --force ./configure $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4490 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I609f7c7c88b49f26e2e48e1f1cffed76d9e6fb5e Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:25:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:25:06 +0000 Subject: [MERGED] osmo-tetra[master]: jenkins: use common osmo-build-dep.sh and osmo-clean-workspa... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use common osmo-build-dep.sh and osmo-clean-workspace.sh ...................................................................... jenkins: use common osmo-build-dep.sh and osmo-clean-workspace.sh Since the gerrit build jobs no longer contain git clean workspace config (for good reasons), it is important to use osmo-clean-workspace.sh. To make it work best, this jenkins.sh should follow the same structure as most others do. Change-Id: I3eca957c52b2c018e4c784b29330a0d06c4e3595 --- M contrib/jenkins.sh 1 file changed, 37 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 503b6a0..895ffc6 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,15 +1,40 @@ -#!/bin/sh -ex +#!/usr/bin/env bash +# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org -rm -rf deps/install -mkdir deps || true -cd deps -osmo-deps.sh libosmocore +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi -cd libosmocore -autoreconf --install --force -./configure --prefix=$PWD/../install -$MAKE $PARALLEL_MAKE install +set -ex -cd ../../src -make clean || true -PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig $MAKE +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +osmo-clean-workspace.sh + +mkdir "$deps" || true + +osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false + +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +set +x +echo +echo +echo +echo " =============================== osmo-tetra ===============================" +echo +set -x + +cd "$base" +cd src +$MAKE clean || true +$MAKE + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4589 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3eca957c52b2c018e4c784b29330a0d06c4e3595 Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:25:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:25:11 +0000 Subject: [MERGED] osmocom-bb[master]: jenkins: use osmo-clean-workspace.sh before and after build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: use osmo-clean-workspace.sh before and after build ...................................................................... jenkins: use osmo-clean-workspace.sh before and after build See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale. Change-Id: I87cc6aa7d6c332a0c2b4644dc8addc0f1a7df49d --- M contrib/jenkins.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index ca72ac5..78c0b59 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -7,8 +7,9 @@ inst="$deps/install" export deps inst +osmo-clean-workspace.sh + mkdir "$deps" || true -rm -rf "$inst" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false @@ -30,3 +31,5 @@ autoreconf -fi ./configure make + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/4590 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I87cc6aa7d6c332a0c2b4644dc8addc0f1a7df49d Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Oct 31 09:26:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Oct 2017 09:26:31 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Remove FreeBSD_amd64 builds In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 (1 comment) I suggest to merge this only once we also (manually) disable the non-gerrit freebsd builds, otherwise we just shift any build failures from gerrit to non-gerrit jenkins job time. https://gerrit.osmocom.org/#/c/4576/3/jobs/gerrit-verifications.yml File jobs/gerrit-verifications.yml: Line 44: combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' > also drop this line I thought to keep it in case we might re-introduce it later, as a reminder. -- To view, visit https://gerrit.osmocom.org/4576 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c6d2a17c3cf9d8c78c3675995493e30cbc6be0d Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Oct 31 13:26:29 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 31 Oct 2017 13:26:29 +0000 Subject: libosmocore[master]: Move additional libraries to appropriate place In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4591 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia657a66db75df831421af5df1175a992da5ba80f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Oct 31 23:17:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 23:17:44 +0000 Subject: [MERGED] osmo-sgsn[master]: drop osmo_sgsn.cfg from src/gprs dir In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: drop osmo_sgsn.cfg from src/gprs dir ...................................................................... drop osmo_sgsn.cfg from src/gprs dir There is a semantically identical config in doc/examples/osmo-sgsn. Change-Id: I9b9c502afbddcfc02ea70aa8317e0d2f37276c38 --- D src/gprs/osmo_sgsn.cfg 1 file changed, 0 insertions(+), 23 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/osmo_sgsn.cfg b/src/gprs/osmo_sgsn.cfg deleted file mode 100644 index c4c9ec1..0000000 --- a/src/gprs/osmo_sgsn.cfg +++ /dev/null @@ -1,23 +0,0 @@ -! -! Osmocom SGSN (0.9.0.474-0ede2) configuration saved from vty -!! -! -line vty - no login -! -sgsn - gtp local-ip 192.168.100.11 - ggsn 0 remote-ip 192.168.100.239 - ggsn 0 gtp-version 1 -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 192.168.100.11 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -bssgp -- To view, visit https://gerrit.osmocom.org/4602 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b9c502afbddcfc02ea70aa8317e0d2f37276c38 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Oct 31 23:18:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 31 Oct 2017 23:18:26 +0000 Subject: [PATCH] osmo-sgsn[master]: change default config filename to osmo-sgsn.cfg, not osmo_sg... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4603 to look at the new patch set (#2). change default config filename to osmo-sgsn.cfg, not osmo_sgsn.cfg 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 --- M src/gprs/sgsn_main.c 1 file changed, 26 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/03/4603/2 diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index e48d8d1..8cd68ff 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -85,8 +85,11 @@ "This is free software: you are free to change and redistribute it.\r\n" "There is NO WARRANTY, to the extent permitted by law.\r\n"; +#define CONFIG_FILE_DEFAULT "osmo-sgsn.cfg" +#define CONFIG_FILE_LEGACY "osmo_sgsn.cfg" + static struct sgsn_instance sgsn_inst = { - .config_file = "osmo_sgsn.cfg", + .config_file = NULL, .cfg = { .gtp_statedir = "./", .auth_policy = SGSN_AUTH_POLICY_CLOSED, @@ -216,7 +219,7 @@ printf(" -D --daemonize\tFork the process into a background daemon\n"); printf(" -d option --debug\tenable Debugging\n"); printf(" -s --disable-color\n"); - printf(" -c --config-file\tThe config file to use [%s]\n", sgsn->config_file); + printf(" -c --config-file\tThe config file to use [%s]\n", CONFIG_FILE_DEFAULT); printf(" -e --log-level number\tSet a global log level\n"); } @@ -356,6 +359,12 @@ int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data); #endif +static bool file_exists(const char *path) +{ + struct stat sb; + return stat(path, &sb) ? false : true; +} + int main(int argc, char **argv) { struct ctrl_handle *ctrl; @@ -392,6 +401,21 @@ handle_options(argc, argv); + /* Backwards compatibility: for years, the default config file name was + * osmo_sgsn.cfg. All other Osmocom programs use osmo-*.cfg with a + * dash. To be able to use the new config file name without breaking + * previous setups that might rely on the legacy default config file + * name, we need to look for the old config file if no -c option was + * passed AND no file exists with the new default file name. */ + if (!sgsn_inst.config_file) { + /* No -c option was passed */ + if (file_exists(CONFIG_FILE_LEGACY) + && !file_exists(CONFIG_FILE_DEFAULT)) + sgsn_inst.config_file = CONFIG_FILE_LEGACY; + else + sgsn_inst.config_file = CONFIG_FILE_DEFAULT; + } + rate_ctr_init(tall_bsc_ctx); gprs_ns_set_log_ss(DNS); -- To view, visit https://gerrit.osmocom.org/4603 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If804da17a7481e79e000fe40ae0d9c4be9722e61 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder